ip_mroute.h (178888) | ip_mroute.h (190012) |
---|---|
1/*- 2 * Copyright (c) 1989 Stephen Deering. 3 * Copyright (c) 1992, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Stephen Deering of Stanford University. 8 * --- 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 * @(#)ip_mroute.h 8.1 (Berkeley) 6/10/93 | 1/*- 2 * Copyright (c) 1989 Stephen Deering. 3 * Copyright (c) 1992, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Stephen Deering of Stanford University. 8 * --- 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 * @(#)ip_mroute.h 8.1 (Berkeley) 6/10/93 |
34 * $FreeBSD: head/sys/netinet/ip_mroute.h 178888 2008-05-09 23:03:00Z julian $ | 34 * $FreeBSD: head/sys/netinet/ip_mroute.h 190012 2009-03-19 01:43:03Z bms $ |
35 */ 36 37#ifndef _NETINET_IP_MROUTE_H_ 38#define _NETINET_IP_MROUTE_H_ 39 40/* 41 * Definitions for IP multicast forwarding. 42 * --- 22 unchanged lines hidden (view full) --- 65#define MRT_VERSION 106 /* get kernel version number */ 66#define MRT_ASSERT 107 /* enable assert processing */ 67#define MRT_PIM MRT_ASSERT /* enable PIM processing */ 68#define MRT_API_SUPPORT 109 /* supported MRT API */ 69#define MRT_API_CONFIG 110 /* config MRT API */ 70#define MRT_ADD_BW_UPCALL 111 /* create bandwidth monitor */ 71#define MRT_DEL_BW_UPCALL 112 /* delete bandwidth monitor */ 72 | 35 */ 36 37#ifndef _NETINET_IP_MROUTE_H_ 38#define _NETINET_IP_MROUTE_H_ 39 40/* 41 * Definitions for IP multicast forwarding. 42 * --- 22 unchanged lines hidden (view full) --- 65#define MRT_VERSION 106 /* get kernel version number */ 66#define MRT_ASSERT 107 /* enable assert processing */ 67#define MRT_PIM MRT_ASSERT /* enable PIM processing */ 68#define MRT_API_SUPPORT 109 /* supported MRT API */ 69#define MRT_API_CONFIG 110 /* config MRT API */ 70#define MRT_ADD_BW_UPCALL 111 /* create bandwidth monitor */ 71#define MRT_DEL_BW_UPCALL 112 /* delete bandwidth monitor */ 72 |
73 74#define GET_TIME(t) microtime(&t) 75 | |
76/* 77 * Types and macros for handling bitmaps with one bit per virtual interface. 78 */ 79#define MAXVIFS 32 80typedef u_long vifbitmap_t; 81typedef u_short vifi_t; /* type of a vif index */ 82#define ALL_VIFS (vifi_t)-1 83 --- 164 unchanged lines hidden (view full) --- 248 249 250/* 251 * The kernel's virtual-interface structure. 252 */ 253struct vif { 254 u_char v_flags; /* VIFF_ flags defined above */ 255 u_char v_threshold; /* min ttl required to forward on vif*/ | 73/* 74 * Types and macros for handling bitmaps with one bit per virtual interface. 75 */ 76#define MAXVIFS 32 77typedef u_long vifbitmap_t; 78typedef u_short vifi_t; /* type of a vif index */ 79#define ALL_VIFS (vifi_t)-1 80 --- 164 unchanged lines hidden (view full) --- 245 246 247/* 248 * The kernel's virtual-interface structure. 249 */ 250struct vif { 251 u_char v_flags; /* VIFF_ flags defined above */ 252 u_char v_threshold; /* min ttl required to forward on vif*/ |
256 u_int v_rate_limit; /* ignored; kept for compatibility */ 257 struct tbf *v_tbf; /* ignored; kept for compatibility */ | |
258 struct in_addr v_lcl_addr; /* local interface address */ 259 struct in_addr v_rmt_addr; /* remote address (tunnels only) */ 260 struct ifnet *v_ifp; /* pointer to interface */ 261 u_long v_pkt_in; /* # pkts in on interface */ 262 u_long v_pkt_out; /* # pkts out on interface */ 263 u_long v_bytes_in; /* # bytes in on interface */ 264 u_long v_bytes_out; /* # bytes out on interface */ 265 struct route v_route; /* cached route */ | 253 struct in_addr v_lcl_addr; /* local interface address */ 254 struct in_addr v_rmt_addr; /* remote address (tunnels only) */ 255 struct ifnet *v_ifp; /* pointer to interface */ 256 u_long v_pkt_in; /* # pkts in on interface */ 257 u_long v_pkt_out; /* # pkts out on interface */ 258 u_long v_bytes_in; /* # bytes in on interface */ 259 u_long v_bytes_out; /* # bytes out on interface */ 260 struct route v_route; /* cached route */ |
266 u_int v_rsvp_on; /* RSVP listening on this vif */ 267 struct socket *v_rsvpd; /* RSVP daemon socket */ | |
268}; 269 270/* 271 * The kernel's multicast forwarding cache entry structure | 261}; 262 263/* 264 * The kernel's multicast forwarding cache entry structure |
272 * (A field for the type of service (mfc_tos) is to be added 273 * at a future point) | |
274 */ 275struct mfc { | 265 */ 266struct mfc { |
267 LIST_ENTRY(mfc) mfc_hash; |
|
276 struct in_addr mfc_origin; /* IP origin of mcasts */ 277 struct in_addr mfc_mcastgrp; /* multicast group associated*/ 278 vifi_t mfc_parent; /* incoming vif */ 279 u_char mfc_ttls[MAXVIFS]; /* forwarding ttls on vifs */ 280 u_long mfc_pkt_cnt; /* pkt count for src-grp */ 281 u_long mfc_byte_cnt; /* byte count for src-grp */ 282 u_long mfc_wrong_if; /* wrong if for src-grp */ 283 int mfc_expire; /* time to clean entry up */ 284 struct timeval mfc_last_assert; /* last time I sent an assert*/ | 268 struct in_addr mfc_origin; /* IP origin of mcasts */ 269 struct in_addr mfc_mcastgrp; /* multicast group associated*/ 270 vifi_t mfc_parent; /* incoming vif */ 271 u_char mfc_ttls[MAXVIFS]; /* forwarding ttls on vifs */ 272 u_long mfc_pkt_cnt; /* pkt count for src-grp */ 273 u_long mfc_byte_cnt; /* byte count for src-grp */ 274 u_long mfc_wrong_if; /* wrong if for src-grp */ 275 int mfc_expire; /* time to clean entry up */ 276 struct timeval mfc_last_assert; /* last time I sent an assert*/ |
285 struct rtdetq *mfc_stall; /* q of packets awaiting mfc */ 286 struct mfc *mfc_next; /* next mfc entry */ | |
287 uint8_t mfc_flags[MAXVIFS]; /* the MRT_MFC_FLAGS_* flags */ 288 struct in_addr mfc_rp; /* the RP address */ 289 struct bw_meter *mfc_bw_meter; /* list of bandwidth meters */ | 277 uint8_t mfc_flags[MAXVIFS]; /* the MRT_MFC_FLAGS_* flags */ 278 struct in_addr mfc_rp; /* the RP address */ 279 struct bw_meter *mfc_bw_meter; /* list of bandwidth meters */ |
280 u_long mfc_nstall; /* # of packets awaiting mfc */ 281 TAILQ_HEAD(, rtdetq) mfc_stall; /* q of packets awaiting mfc */ |
|
290}; 291 292/* 293 * Struct used to communicate from kernel to multicast router 294 * note the convenient similarity to an IP packet 295 */ 296struct igmpmsg { 297 uint32_t unused1; --- 8 unchanged lines hidden (view full) --- 306 u_char unused3; 307 struct in_addr im_src, im_dst; 308}; 309 310/* 311 * Argument structure used for pkt info. while upcall is made 312 */ 313struct rtdetq { | 282}; 283 284/* 285 * Struct used to communicate from kernel to multicast router 286 * note the convenient similarity to an IP packet 287 */ 288struct igmpmsg { 289 uint32_t unused1; --- 8 unchanged lines hidden (view full) --- 298 u_char unused3; 299 struct in_addr im_src, im_dst; 300}; 301 302/* 303 * Argument structure used for pkt info. while upcall is made 304 */ 305struct rtdetq { |
306 TAILQ_ENTRY(rtdetq) rte_link; |
|
314 struct mbuf *m; /* A copy of the packet */ 315 struct ifnet *ifp; /* Interface pkt came in on */ 316 vifi_t xmt_vif; /* Saved copy of imo_multicast_vif */ | 307 struct mbuf *m; /* A copy of the packet */ 308 struct ifnet *ifp; /* Interface pkt came in on */ 309 vifi_t xmt_vif; /* Saved copy of imo_multicast_vif */ |
317 struct rtdetq *next; /* Next in list of packets */ | |
318}; | 310}; |
319 320#define MFCTBLSIZ 256 321#if (MFCTBLSIZ & (MFCTBLSIZ - 1)) == 0 /* from sys:route.h */ 322#define MFCHASHMOD(h) ((h) & (MFCTBLSIZ - 1)) 323#else 324#define MFCHASHMOD(h) ((h) % MFCTBLSIZ) 325#endif 326 | |
327#define MAX_UPQ 4 /* max. no of pkts in upcall Q */ 328 329/* 330 * Structure for measuring the bandwidth and sending an upcall if the 331 * measured bandwidth is above or below a threshold. 332 */ 333struct bw_meter { 334 struct bw_meter *bm_mfc_next; /* next bw meter (same mfc) */ --- 32 unchanged lines hidden --- | 311#define MAX_UPQ 4 /* max. no of pkts in upcall Q */ 312 313/* 314 * Structure for measuring the bandwidth and sending an upcall if the 315 * measured bandwidth is above or below a threshold. 316 */ 317struct bw_meter { 318 struct bw_meter *bm_mfc_next; /* next bw meter (same mfc) */ --- 32 unchanged lines hidden --- |