X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/2d21ac55c334faf3a56e5634905ed6987fc787d4..3e170ce000f1506b7b5d2c5c7faec85ceabb573d:/bsd/net/radix.h diff --git a/bsd/net/radix.h b/bsd/net/radix.h index 3431a2d25..d48399aae 100644 --- a/bsd/net/radix.h +++ b/bsd/net/radix.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -101,6 +101,7 @@ struct radix_node { struct radix_node *rn_twin; struct radix_node *rn_ybro; #endif + }; #define rn_dupedkey rn_u.rn_leaf.rn_Dupedkey @@ -140,6 +141,7 @@ struct radix_mask { #define MKFree(m) { (m)->rm_mklist = rn_mkfreelist; rn_mkfreelist = (m);} typedef int walktree_f_t(struct radix_node *, void *); +typedef int rn_matchf_t(struct radix_node *, void *); struct radix_node_head { struct radix_node *rnh_treetop; @@ -157,8 +159,16 @@ struct radix_node_head { (void *v, void *mask, struct radix_node_head *head); struct radix_node *(*rnh_matchaddr) /* locate based on sockaddr */ (void *v, struct radix_node_head *head); + /* locate based on sockaddr and rn_matchf_t() */ + struct radix_node *(*rnh_matchaddr_args) + (void *v, struct radix_node_head *head, + rn_matchf_t *f, void *w); struct radix_node *(*rnh_lookup) /* locate based on sockaddr */ (void *v, void *mask, struct radix_node_head *head); + /* locate based on sockaddr, mask and rn_matchf_t() */ + struct radix_node *(*rnh_lookup_args) + (void *v, void *mask, struct radix_node_head *head, + rn_matchf_t *f, void *); struct radix_node *(*rnh_matchpkt) /* locate based on packet hdr */ (void *v, struct radix_node_head *head); int (*rnh_walktree) /* traverse tree */ @@ -182,11 +192,11 @@ struct radix_node_head { #define Bcmp(a, b, n) bcmp(((caddr_t)(a)), ((caddr_t)(b)), (unsigned)(n)) #define Bcopy(a, b, n) bcopy(((caddr_t)(a)), ((caddr_t)(b)), (unsigned)(n)) #define Bzero(p, n) bzero((caddr_t)(p), (unsigned)(n)); -#define R_Malloc(p, t, n) (p = (t) _MALLOC((unsigned long)(n), M_RTABLE, M_WAITOK)) +#define R_Malloc(p, t, n) (p = (t) _MALLOC((uint32_t)(n), M_RTABLE, M_WAITOK)) #define R_Free(p) FREE((caddr_t)p, M_RTABLE); #endif /*KERNEL*/ -void rn_init(void) __attribute__((section("__TEXT, initcode"))); +void rn_init(void); int rn_inithead(void **, int); int rn_refines(void *, void *); struct radix_node @@ -195,7 +205,10 @@ struct radix_node struct radix_node [2]), *rn_delete(void *, void *, struct radix_node_head *), *rn_lookup(void *v_arg, void *m_arg, struct radix_node_head *head), - *rn_match(void *, struct radix_node_head *); + *rn_lookup_args(void *v_arg, void *m_arg, struct radix_node_head *head, + rn_matchf_t *, void *), + *rn_match(void *, struct radix_node_head *), + *rn_match_args(void *, struct radix_node_head *, rn_matchf_t *, void *); #endif /* PRIVATE */ #endif /* _RADIX_H_ */