* SUCH DAMAGE.
*
* @(#)radix.h 8.2 (Berkeley) 10/31/94
+ * $FreeBSD: src/sys/net/radix.h,v 1.16.2.1 2000/05/03 19:17:11 wollman Exp $
*/
#ifndef _RADIX_H_
#define _RADIX_H_
+#include <sys/appleapiopts.h>
+
+#if !defined(KERNEL) || defined(__APPLE_API_PRIVATE)
#ifdef MALLOC_DECLARE
MALLOC_DECLARE(M_RTABLE);
struct radix_node {
struct radix_mask *rn_mklist; /* list of masks contained in subtree */
- struct radix_node *rn_p; /* parent */
- short rn_b; /* bit offset; -1-index(netmask) */
+ struct radix_node *rn_parent; /* parent */
+ short rn_bit; /* bit offset; -1-index(netmask) */
char rn_bmask; /* node: mask for bit test*/
u_char rn_flags; /* enumerated next */
#define RNF_NORMAL 1 /* leaf contains normal route */
#endif
};
-#define rn_dupedkey rn_u.rn_leaf.rn_Dupedkey
-#define rn_key rn_u.rn_leaf.rn_Key
-#define rn_mask rn_u.rn_leaf.rn_Mask
-#define rn_off rn_u.rn_node.rn_Off
-#define rn_l rn_u.rn_node.rn_L
-#define rn_r rn_u.rn_node.rn_R
-
+#define rn_dupedkey rn_u.rn_leaf.rn_Dupedkey
+#define rn_key rn_u.rn_leaf.rn_Key
+#define rn_mask rn_u.rn_leaf.rn_Mask
+#define rn_offset rn_u.rn_node.rn_Off
+#define rn_left rn_u.rn_node.rn_L
+#define rn_right rn_u.rn_node.rn_R
+
+#if 0
+/* for backward compatibility with previous definitions */
+#define rn_p rn_parent
+#define rn_b rn_bit
+#define rn_off rn_offset
+#define rn_l rn_left
+#define rn_r rn_right
+#endif
/*
* Annotations to tree concerning potential routes applying to subtrees.
*/
struct radix_mask {
- short rm_b; /* bit offset; -1-index(netmask) */
+ short rm_bit; /* bit offset; -1-index(netmask) */
char rm_unused; /* cf. rn_bmask */
u_char rm_flags; /* cf. rn_flags */
struct radix_mask *rm_mklist; /* more masks to try */
int rm_refs; /* # of references to this struct */
};
-#define rm_mask rm_rmu.rmu_mask
-#define rm_leaf rm_rmu.rmu_leaf /* extra field would make 32 bytes */
+#define rm_mask rm_rmu.rmu_mask
+#define rm_leaf rm_rmu.rmu_leaf /* extra field would make 32 bytes */
+
#define MKGet(m) {\
if (rn_mkfreelist) {\
struct radix_node_head *head)),
*rn_match __P((void *, struct radix_node_head *));
-
+#endif /* __APPLE_API_PRIVATE || !KERNEL */
#endif /* _RADIX_H_ */