summaryrefslogtreecommitdiff
path: root/usr.sbin/npppd/common/radish.h
diff options
context:
space:
mode:
authorYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2017-05-30 17:52:06 +0000
committerYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2017-05-30 17:52:06 +0000
commita9d6a48846a7ff4d36c33c702103c2451ca35641 (patch)
treea0c2f04bd0d61e54a21a66511d42f7942ffbe60a /usr.sbin/npppd/common/radish.h
parent1d88a27ab69c3f8585dd6a4b6291ef7da4b81130 (diff)
Remove never used ifdefs, define FATAL macro properly and define function
parameters in modern way.
Diffstat (limited to 'usr.sbin/npppd/common/radish.h')
-rw-r--r--usr.sbin/npppd/common/radish.h36
1 files changed, 5 insertions, 31 deletions
diff --git a/usr.sbin/npppd/common/radish.h b/usr.sbin/npppd/common/radish.h
index 2d0a44686ec..0427e4597df 100644
--- a/usr.sbin/npppd/common/radish.h
+++ b/usr.sbin/npppd/common/radish.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: radish.h,v 1.5 2017/05/30 17:22:00 yasuoka Exp $ */
+/* $OpenBSD: radish.h,v 1.6 2017/05/30 17:52:05 yasuoka Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
* All rights reserved.
@@ -39,9 +39,8 @@
* Email: kazu@is.aist-nara.ac.jp
*/
-#ifdef RADISH
-#ifndef _NET_RADISH_H_
-#define _NET_RADISH_H_
+#ifndef _RADISH_H_
+#define _RADISH_H_
struct radish {
struct sockaddr *rd_route; /* destination route */
@@ -53,11 +52,7 @@ struct radish {
struct radish *rd_p; /* parent */
struct radish *rd_l; /* left child */
struct radish *rd_r; /* right child */
-#ifndef GENERIC_USE
- struct rtentry *rd_rtent; /* rtentry */
-#else /* GENERIC_USE */
- void *rd_rtent; /* rtentry */
-#endif /* GENERIC_USE */
+ void *rd_rtent; /* rtentry */
};
struct radish_head {
@@ -69,13 +64,6 @@ struct radish_head {
int (*rdh_match)(void *, void *);
};
-#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((n), M_RTABLE, M_DONTWAIT))
-#define Free(p) free((caddr_t)p, M_RTABLE);
-#else /* KERNEL */
#ifndef Bcmp
#define Bcmp(a, b, n) memcmp(((char *)(a)), ((char *)(b)), (size_t)(n))
#endif
@@ -84,7 +72,6 @@ struct radish_head {
#endif
#define R_Malloc(p, t, n) (p = (t) malloc((n)))
#define Free(p) free((char *)p);
-#endif /* KERNEL */
/*
* prototype for radish functions
@@ -93,29 +80,16 @@ struct radish_head {
int rd_inithead(void **, int, int, int, int, int (*)(void *, void *));
struct sockaddr *rd_mask(struct sockaddr *, struct radish_head *, int *);
-#ifndef GENERIC_USE
-int rd_insert(struct sockaddr *, struct sockaddr *,
- struct radish_head *, struct rtentry *);
-#else /* GENERIC_USE */
int rd_insert(struct sockaddr *, struct sockaddr *,
struct radish_head *, void *);
-#endif /* GENERIC_USE */
int rd_glue(struct radish *, struct radish *, int, struct radish_head *);
int rd_match(struct sockaddr *, struct radish_head *, struct radish **);
int rd_match_next(struct sockaddr *, struct radish_head *, struct radish **, struct radish *);
-#ifndef GENERIC_USE
-struct rtentry *rd_lookup(struct sockaddr *,
- struct sockaddr *, struct radish_head *);
-int rd_delete(struct sockaddr *, struct sockaddr *,
- struct radish_head *, struct rtentry **);
-#else /* GENERIC_USE */
void *rd_lookup(struct sockaddr *,
struct sockaddr *, struct radish_head *);
int rd_delete(struct sockaddr *, struct sockaddr *,
struct radish_head *, void **);
-#endif /* GENERIC_USE */
void rd_unlink(struct radish *, struct radish *);
int rd_walktree(struct radish_head *, int (*)(struct radish *, void *), void *);
int rd_refines(void *, void *);
-#endif /* !_NET_RADISH_H_ */
-#endif /* RADISH */
+#endif