1    | /***************************************
2    |   $Revision: 1.7 $
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_int.h"
34   | #include <rp.h>
35   | #include <nh.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   |  
43   |  static rp_upd_pack_t pack;
44   | 
45   | /* Do this only for inetnum, inet6num, routes and domains (reverse) */
46   |  switch(attr->type){
47   |    case A_IN:
48   |    case A_RT:
49   |    case A_I6:	 
50   |    case A_DN:
51   |     if( RP_asc2pack( &pack, attr->type, attr->value) != IP_OK ) {
52   |      dieif( attr->type != A_DN );  /* DN can be forgiven */
53   |     }
54   |     else tr->packptr = &pack;
55   |     break;
56   |  /*  case A_NH:
57   |     NH_parse(attr->value, &nh_ptr);
58   |     tr->nh = nh_ptr;
59   |     break; */
60   |    default:
61   |     break; 
62   |  }
63   | }