/*
- * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
struct radix_node *rn_twin;
struct radix_node *rn_ybro;
#endif
+
};
#define rn_dupedkey rn_u.rn_leaf.rn_Dupedkey
#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;
(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 */
#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
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_ */