1 | /*************************************** 2 | $Revision: 1.9 $ 3 | 4 | Functions to interface with RX module (create/update rx-nodes) 5 | 6 | Status: NOT REVUED, NOT TESTED 7 | 8 | Author(s): Andrei Robachevsky 9 | 10 | ******************/ /****************** 11 | Modification History: 12 | andrei (17/01/2000) Created. 13 | ******************/ /****************** 14 | Copyright (c) 2000 RIPE NCC 15 | 16 | All Rights Reserved 17 | 18 | Permission to use, copy, modify, and distribute this software and its 19 | documentation for any purpose and without fee is hereby granted, 20 | provided that the above copyright notice appear in all copies and that 21 | both that copyright notice and this permission notice appear in 22 | supporting documentation, and that the name of the author not be 23 | used in advertising or publicity pertaining to distribution of the 24 | software without specific, written prior permission. 25 | 26 | THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 27 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL 28 | AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 29 | DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 30 | AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 31 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 32 | ***************************************/ 33 | #include "ud.h" 34 | #include "ud_int.h" 35 | #include <rp.h> 36 | 37 | /* Function to fill data for radix tree */ 38 | void get_rx_data(void *element_data, void *tr_ptr) 39 | { 40 | Attribute_t *attr = element_data; 41 | Transaction_t *tr = (Transaction_t *)tr_ptr; 42 | switch(attr->type){ 43 | case A_IN: 44 | case A_RT: 45 | case A_I6: 46 | case A_DN: 47 | if( RP_asc2pack( tr->packptr, attr->type, attr->value) != IP_OK ) { 48 | dieif( attr->type != A_DN ); /* DN can be forgiven, but radix should not be updated */ 49 | } else tr->action |= TA_UPD_RX; /* Update radix in all other cases */ 50 | break; 51 | default: break; 52 | } 53 | }