2 * netsniff-ng - the packet sniffing beast
3 * Copyright 2011 Daniel Borkmann, rewritten
4 * Copyright 1991-2007 Kawahara Lab., Kyoto University
5 * Copyright 2000-2005 Shikano Lab., Nara Institute of Science and Technology
6 * Copyright 2005-2007 Julius project team, Nagoya Institute of Technology
8 * Subject to the GPL, version 2.
14 #include <netinet/in.h>
18 struct patricia_node
{
21 struct sockaddr_storage
*addr
;
27 struct patricia_node
*l
, *r
;
28 } __cacheline_aligned
;
30 extern int ptree_search_data_nearest(void *str
, size_t sstr
,
31 struct sockaddr_storage
*addr
, size_t *alen
,
32 struct patricia_node
*root
);
33 extern int ptree_search_data_exact(void *str
, size_t sstr
,
34 struct sockaddr_storage
*addr
, size_t *alen
,
35 struct patricia_node
*root
);
36 extern int ptree_add_entry(void *str
, size_t sstr
, int data
,
37 struct sockaddr_storage
*addr
, size_t alen
,
38 struct patricia_node
**root
);
39 extern void ptree_del_entry(void *str
, size_t sstr
,
40 struct patricia_node
**root
);
41 extern void ptree_get_key(int data
, struct patricia_node
*node
,
42 struct patricia_node
**wanted
);
43 extern void ptree_get_key_addr(struct sockaddr_storage
*addr
, size_t alen
,
44 struct patricia_node
*node
,
45 struct patricia_node
**wanted
);
46 extern void ptree_display(struct patricia_node
*node
, int level
);
47 extern void ptree_free(struct patricia_node
*root
);
49 #endif /* PATRICIA_H */