diff --git a/radix/radix.h b/radix/radix.h index 04b8d9d..505e59a 100644 --- a/radix/radix.h +++ b/radix/radix.h @@ -10,10 +10,10 @@ #define RULE_NOT_FOUND -1 struct routing_record { - unsigned long long _ip; - unsigned short _rule; - unsigned _ip_end_bit:7; - unsigned _rule_valid:1; + unsigned long _ip[2]; + unsigned short _rule; + unsigned _mask:7; + unsigned _valid:1; }; struct radix_node { @@ -31,9 +31,9 @@ typedef struct radix_node* radix_node_t; typedef struct radix_holder* radix_holder_t; typedef struct routing_record* record_t; -struct radix_holder* create_holder(); -struct radix_node* create_node(record_t record); -static struct radix_node* clone_node(radix_node_t n); +radix_holder_t create_holder(); +radix_node_t create_node(record_t record); +static radix_node_t clone_node(radix_node_t n); static void split_node(struct radix_node* n, unsigned bit); int destory_holder(struct radix_holder*);