Deleted Added
full compact
radix.h (224151) radix.h (225698)
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

--- 13 unchanged lines hidden (view full) ---

22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)radix.h 8.2 (Berkeley) 10/31/94
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

--- 13 unchanged lines hidden (view full) ---

22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)radix.h 8.2 (Berkeley) 10/31/94
30 * $FreeBSD: head/sys/net/radix.h 224151 2011-07-17 21:15:20Z bz $
30 * $FreeBSD: head/sys/net/radix.h 225698 2011-09-20 20:27:26Z kmacy $
31 */
32
33#ifndef _RADIX_H_
34#define _RADIX_H_
35
36#ifdef _KERNEL
37#include <sys/_lock.h>
38#include <sys/_mutex.h>

--- 61 unchanged lines hidden (view full) ---

100
101#define rm_mask rm_rmu.rmu_mask
102#define rm_leaf rm_rmu.rmu_leaf /* extra field would make 32 bytes */
103
104typedef int walktree_f_t(struct radix_node *, void *);
105
106struct radix_node_head {
107 struct radix_node *rnh_treetop;
31 */
32
33#ifndef _RADIX_H_
34#define _RADIX_H_
35
36#ifdef _KERNEL
37#include <sys/_lock.h>
38#include <sys/_mutex.h>

--- 61 unchanged lines hidden (view full) ---

100
101#define rm_mask rm_rmu.rmu_mask
102#define rm_leaf rm_rmu.rmu_leaf /* extra field would make 32 bytes */
103
104typedef int walktree_f_t(struct radix_node *, void *);
105
106struct radix_node_head {
107 struct radix_node *rnh_treetop;
108 u_int rnh_gen; /* generation counter */
109 int rnh_multipath; /* multipath capable ? */
108 int rnh_addrsize; /* permit, but not require fixed keys */
109 int rnh_pktsize; /* permit, but not require fixed keys */
110 struct radix_node *(*rnh_addaddr) /* add based on sockaddr */
111 (void *v, void *mask,
112 struct radix_node_head *head, struct radix_node nodes[]);
113 struct radix_node *(*rnh_addpkt) /* add based on packet hdr */
114 (void *v, void *mask,
115 struct radix_node_head *head, struct radix_node nodes[]);

--- 10 unchanged lines hidden (view full) ---

126 int (*rnh_walktree) /* traverse tree */
127 (struct radix_node_head *head, walktree_f_t *f, void *w);
128 int (*rnh_walktree_from) /* traverse tree below a */
129 (struct radix_node_head *head, void *a, void *m,
130 walktree_f_t *f, void *w);
131 void (*rnh_close) /* do something when the last ref drops */
132 (struct radix_node *rn, struct radix_node_head *head);
133 struct radix_node rnh_nodes[3]; /* empty tree for common case */
110 int rnh_addrsize; /* permit, but not require fixed keys */
111 int rnh_pktsize; /* permit, but not require fixed keys */
112 struct radix_node *(*rnh_addaddr) /* add based on sockaddr */
113 (void *v, void *mask,
114 struct radix_node_head *head, struct radix_node nodes[]);
115 struct radix_node *(*rnh_addpkt) /* add based on packet hdr */
116 (void *v, void *mask,
117 struct radix_node_head *head, struct radix_node nodes[]);

--- 10 unchanged lines hidden (view full) ---

128 int (*rnh_walktree) /* traverse tree */
129 (struct radix_node_head *head, walktree_f_t *f, void *w);
130 int (*rnh_walktree_from) /* traverse tree below a */
131 (struct radix_node_head *head, void *a, void *m,
132 walktree_f_t *f, void *w);
133 void (*rnh_close) /* do something when the last ref drops */
134 (struct radix_node *rn, struct radix_node_head *head);
135 struct radix_node rnh_nodes[3]; /* empty tree for common case */
134 int rnh_multipath; /* multipath capable ? */
135 u_int rnh_spare; /* route caching */
136#ifdef _KERNEL
137 struct rwlock rnh_lock; /* locks entire radix tree */
138#endif
139};
140
141#ifndef _KERNEL
142#define R_Malloc(p, t, n) (p = (t) malloc((unsigned int)(n)))
143#define R_Zalloc(p, t, n) (p = (t) calloc(1,(unsigned int)(n)))

--- 34 unchanged lines hidden ---
136#ifdef _KERNEL
137 struct rwlock rnh_lock; /* locks entire radix tree */
138#endif
139};
140
141#ifndef _KERNEL
142#define R_Malloc(p, t, n) (p = (t) malloc((unsigned int)(n)))
143#define R_Zalloc(p, t, n) (p = (t) calloc(1,(unsigned int)(n)))

--- 34 unchanged lines hidden ---