summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2006-06-16 15:50:29 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2006-06-16 15:50:29 +0000
commit8a1b6c09c8dec181f68518b1e2554a8297fc01f6 (patch)
treed1729ad0e6ebd8889062e5a7f36c34f3207518c6
parentc291aae0928d26753a167e1edf899ebb77ae30be (diff)
Cleanup radix.c, remove unused stuff, use nicer prototype definitions and
remove the ugly routed hacks. OK henning@, hshoexer@
-rw-r--r--sys/net/radix.h62
1 files changed, 22 insertions, 40 deletions
diff --git a/sys/net/radix.h b/sys/net/radix.h
index 661858abd36..f3324f56f9a 100644
--- a/sys/net/radix.h
+++ b/sys/net/radix.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: radix.h,v 1.12 2004/04/25 02:48:03 itojun Exp $ */
+/* $OpenBSD: radix.h,v 1.13 2006/06/16 15:50:28 claudio Exp $ */
/* $NetBSD: radix.h,v 1.8 1996/02/13 22:00:37 christos Exp $ */
/*
@@ -109,24 +109,15 @@ struct radix_node_head {
/* add based on sockaddr */
struct radix_node *(*rnh_addaddr)(void *v, void *mask,
struct radix_node_head *head, struct radix_node nodes[]);
- /* add based on packet hdr */
- struct radix_node *(*rnh_addpkt)(void *v, void *mask,
- struct radix_node_head *head, struct radix_node nodes[]);
/* remove based on sockaddr */
struct radix_node *(*rnh_deladdr)(void *v, void *mask,
struct radix_node_head *head, struct radix_node *rn);
- /* remove based on packet hdr */
- struct radix_node *(*rnh_delpkt)(void *v, void *mask,
- struct radix_node_head *head);
/* locate based on sockaddr */
struct radix_node *(*rnh_matchaddr)(void *v,
struct radix_node_head *head);
/* locate based on sockaddr */
struct radix_node *(*rnh_lookup)(void *v, void *mask,
struct radix_node_head *head);
- /* locate based on packet hdr */
- struct radix_node *(*rnh_matchpkt)(void *v,
- struct radix_node_head *head);
/* traverse tree */
int (*rnh_walktree)(struct radix_node_head *,
int (*)(struct radix_node *, void *), void *);
@@ -134,40 +125,31 @@ struct radix_node_head {
int rnh_multipath; /* multipath? */
};
-
-#ifndef _KERNEL
-#define Bcmp(a, b, n) bcmp(((char *)(a)), ((char *)(b)), (n))
-#define Bcopy(a, b, n) bcopy(((char *)(a)), ((char *)(b)), (unsigned)(n))
-#define Bzero(p, n) bzero((char *)(p), (int)(n));
-#define R_Malloc(p, t, n) (p = (t) malloc((unsigned int)(n)))
-#define Free(p) free((char *)p);
-#else
+#ifdef _KERNEL
#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_DONTWAIT))
#define Free(p) free((caddr_t)p, M_RTABLE);
-#endif /* !_KERNEL */
-#if defined(_KERNEL) || defined(_ROUTED)
-void rn_init(void);
-int rn_inithead(void **, int);
-int rn_inithead0(struct radix_node_head *, int);
-int rn_refines(void *, void *);
-int rn_walktree(struct radix_node_head *,
- int (*)(struct radix_node *, void *), void *);
-struct radix_node
- *rn_addmask(void *, int, int),
- *rn_addroute(void *, void *, struct radix_node_head *,
- struct radix_node [2]),
- *rn_delete(void *, void *, struct radix_node_head *,
- struct radix_node *),
- *rn_insert(void *, struct radix_node_head *, int *,
- struct radix_node [2]),
- *rn_lookup(void *, void *, struct radix_node_head *),
- *rn_match(void *, struct radix_node_head *),
- *rn_newpair(void *, int, struct radix_node[2]),
- *rn_search(void *, struct radix_node *),
- *rn_search_m(void *, struct radix_node *, void *);
-#endif /* define(_KERNEL) || defined(_ROUTED) */
+void rn_init(void);
+int rn_inithead(void **, int);
+int rn_inithead0(struct radix_node_head *, int);
+int rn_refines(void *, void *);
+int rn_walktree(struct radix_node_head *,
+ int (*)(struct radix_node *, void *), void *);
+
+struct radix_node *rn_addmask(void *, int, int);
+struct radix_node *rn_addroute(void *, void *, struct radix_node_head *,
+ struct radix_node [2]);
+struct radix_node *rn_delete(void *, void *, struct radix_node_head *,
+ struct radix_node *);
+struct radix_node *rn_insert(void *, struct radix_node_head *, int *,
+ struct radix_node [2]);
+struct radix_node *rn_lookup(void *, void *, struct radix_node_head *);
+struct radix_node *rn_match(void *, struct radix_node_head *);
+struct radix_node *rn_newpair(void *, int, struct radix_node[2]);
+struct radix_node *rn_search(void *, struct radix_node *);
+struct radix_node *rn_search_m(void *, struct radix_node *, void *);
+#endif /* _KERNEL */
#endif /* _NET_RADIX_H_ */