radix.h (4469) | radix.h (7090) |
---|---|
1/* 2 * Copyright (c) 1988, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)radix.h 8.1 (Berkeley) 6/10/93 | 1/* 2 * Copyright (c) 1988, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)radix.h 8.1 (Berkeley) 6/10/93 |
34 * $Id: radix.h,v 1.4 1994/11/02 04:41:23 wollman Exp $ | 34 * $Id: radix.h,v 1.5 1994/11/14 14:06:06 bde Exp $ |
35 */ 36 37#ifndef _NET_RADIX_H_ 38#define _NET_RADIX_H_ 39 40/* 41 * Radix search tree node layout. 42 */ --- 77 unchanged lines hidden (view full) --- 120 __P((void *v, struct radix_node_head *head)); 121 int (*rnh_walktree) /* traverse tree */ 122 __P((struct radix_node_head *head, walktree_f_t *f, void *w)); 123 void (*rnh_close) /* do something when the last ref drops */ 124 __P((struct radix_node *rn, struct radix_node_head *head)); 125 struct radix_node rnh_nodes[3]; /* empty tree for common case */ 126}; 127 | 35 */ 36 37#ifndef _NET_RADIX_H_ 38#define _NET_RADIX_H_ 39 40/* 41 * Radix search tree node layout. 42 */ --- 77 unchanged lines hidden (view full) --- 120 __P((void *v, struct radix_node_head *head)); 121 int (*rnh_walktree) /* traverse tree */ 122 __P((struct radix_node_head *head, walktree_f_t *f, void *w)); 123 void (*rnh_close) /* do something when the last ref drops */ 124 __P((struct radix_node *rn, struct radix_node_head *head)); 125 struct radix_node rnh_nodes[3]; /* empty tree for common case */ 126}; 127 |
128 | |
129#ifndef KERNEL 130#define Bcmp(a, b, n) bcmp(((char *)(a)), ((char *)(b)), (n)) 131#define Bzero(p, n) bzero((char *)(p), (int)(n)); 132#define R_Malloc(p, t, n) (p = (t) malloc((unsigned int)(n))) 133#define Free(p) free((char *)p); 134#else 135#define Bcmp(a, b, n) bcmp(((caddr_t)(a)), ((caddr_t)(b)), (unsigned)(n)) 136#define Bcopy(a, b, n) bcopy(((caddr_t)(a)), ((caddr_t)(b)), (unsigned)(n)) 137#define Bzero(p, n) bzero((caddr_t)(p), (unsigned)(n)); 138#define R_Malloc(p, t, n) (p = (t) malloc((unsigned long)(n), M_RTABLE, M_DONTWAIT)) 139#define Free(p) free((caddr_t)p, M_RTABLE); 140 | 128#ifndef KERNEL 129#define Bcmp(a, b, n) bcmp(((char *)(a)), ((char *)(b)), (n)) 130#define Bzero(p, n) bzero((char *)(p), (int)(n)); 131#define R_Malloc(p, t, n) (p = (t) malloc((unsigned int)(n))) 132#define Free(p) free((char *)p); 133#else 134#define Bcmp(a, b, n) bcmp(((caddr_t)(a)), ((caddr_t)(b)), (unsigned)(n)) 135#define Bcopy(a, b, n) bcopy(((caddr_t)(a)), ((caddr_t)(b)), (unsigned)(n)) 136#define Bzero(p, n) bzero((caddr_t)(p), (unsigned)(n)); 137#define R_Malloc(p, t, n) (p = (t) malloc((unsigned long)(n), M_RTABLE, M_DONTWAIT)) 138#define Free(p) free((caddr_t)p, M_RTABLE); 139 |
140extern struct radix_node_head *mask_rnhead; 141 |
|
141void rn_init __P((void)); 142int rn_inithead __P((void **, int)); 143int rn_refines __P((void *, void *)); 144int rn_walktree __P((struct radix_node_head *, walktree_f_t *, void *)); 145struct radix_node 146 *rn_addmask __P((void *, int, int)), 147 *rn_addroute __P((void *, void *, struct radix_node_head *, 148 struct radix_node [2])), 149 *rn_delete __P((void *, void *, struct radix_node_head *)), 150 *rn_insert __P((void *, struct radix_node_head *, int *, 151 struct radix_node [2])), 152 *rn_match __P((void *, struct radix_node_head *)), 153 *rn_newpair __P((void *, int, struct radix_node[2])), 154 *rn_search __P((void *, struct radix_node *)), 155 *rn_search_m __P((void *, struct radix_node *, void *)); 156 157#endif /*KERNEL*/ 158 159#endif /* !_NET_RADIX_H_ */ | 142void rn_init __P((void)); 143int rn_inithead __P((void **, int)); 144int rn_refines __P((void *, void *)); 145int rn_walktree __P((struct radix_node_head *, walktree_f_t *, void *)); 146struct radix_node 147 *rn_addmask __P((void *, int, int)), 148 *rn_addroute __P((void *, void *, struct radix_node_head *, 149 struct radix_node [2])), 150 *rn_delete __P((void *, void *, struct radix_node_head *)), 151 *rn_insert __P((void *, struct radix_node_head *, int *, 152 struct radix_node [2])), 153 *rn_match __P((void *, struct radix_node_head *)), 154 *rn_newpair __P((void *, int, struct radix_node[2])), 155 *rn_search __P((void *, struct radix_node *)), 156 *rn_search_m __P((void *, struct radix_node *, void *)); 157 158#endif /*KERNEL*/ 159 160#endif /* !_NET_RADIX_H_ */ |