summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_mroute.h
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2009-03-19 01:43:03 +0000
committerbms <bms@FreeBSD.org>2009-03-19 01:43:03 +0000
commit76f193cd692e42617fb7f33b9581e7e5a3da58f0 (patch)
treed8c3186aadc92c08ebcc649765a90704c2e1d233 /sys/netinet/ip_mroute.h
parentbe7293a078080bef32e2a64d792bfdfa0c65dead (diff)
downloadFreeBSD-src-76f193cd692e42617fb7f33b9581e7e5a3da58f0.zip
FreeBSD-src-76f193cd692e42617fb7f33b9581e7e5a3da58f0.tar.gz
Introduce a number of changes to the MROUTING code.
This is purely a forwarding plane cleanup; no control plane code is involved. Summary: * Split IPv4 and IPv6 MROUTING support. The static compile-time kernel option remains the same, however, the modules may now be built for IPv4 and IPv6 separately as ip_mroute_mod and ip6_mroute_mod. * Clean up the IPv4 multicast forwarding code to use BSD queue and hash table constructs. Don't build our own timer abstractions when ratecheck() and timevalclear() etc will do. * Expose the multicast forwarding cache (MFC) and virtual interface table (VIF) as sysctls, to reduce netstat's dependence on libkvm for this information for running kernels. * bandwidth meters however still require libkvm. * Make the MFC hash table size a boot/load-time tunable ULONG, net.inet.ip.mfchashsize (defaults to 256). * Remove unused members from struct vif and struct mfc. * Kill RSVP support, as no current RSVP implementation uses it. These stubs could be moved to raw_ip.c. * Don't share locks or initialization between IPv4 and IPv6. * Don't use a static struct route_in6 in ip6_mroute.c. The v6 code is still using a cached struct route_in6, this is moved to mif6 for the time being. * More cleanup remains to be merged from ip_mroute.c to ip6_mroute.c. v4 path tested using ports/net/mcast-tools. v6 changes are mostly mechanical locking and *have not* been tested. As these changes partially break some kernel ABIs, they will not be MFCed. There is a lot more work to be done here. Reviewed by: Pavlin Radoslavov
Diffstat (limited to 'sys/netinet/ip_mroute.h')
-rw-r--r--sys/netinet/ip_mroute.h24
1 files changed, 4 insertions, 20 deletions
diff --git a/sys/netinet/ip_mroute.h b/sys/netinet/ip_mroute.h
index 4043e44..a167965 100644
--- a/sys/netinet/ip_mroute.h
+++ b/sys/netinet/ip_mroute.h
@@ -70,9 +70,6 @@
#define MRT_ADD_BW_UPCALL 111 /* create bandwidth monitor */
#define MRT_DEL_BW_UPCALL 112 /* delete bandwidth monitor */
-
-#define GET_TIME(t) microtime(&t)
-
/*
* Types and macros for handling bitmaps with one bit per virtual interface.
*/
@@ -253,8 +250,6 @@ struct sioc_vif_req {
struct vif {
u_char v_flags; /* VIFF_ flags defined above */
u_char v_threshold; /* min ttl required to forward on vif*/
- u_int v_rate_limit; /* ignored; kept for compatibility */
- struct tbf *v_tbf; /* ignored; kept for compatibility */
struct in_addr v_lcl_addr; /* local interface address */
struct in_addr v_rmt_addr; /* remote address (tunnels only) */
struct ifnet *v_ifp; /* pointer to interface */
@@ -263,16 +258,13 @@ struct vif {
u_long v_bytes_in; /* # bytes in on interface */
u_long v_bytes_out; /* # bytes out on interface */
struct route v_route; /* cached route */
- u_int v_rsvp_on; /* RSVP listening on this vif */
- struct socket *v_rsvpd; /* RSVP daemon socket */
};
/*
* The kernel's multicast forwarding cache entry structure
- * (A field for the type of service (mfc_tos) is to be added
- * at a future point)
*/
struct mfc {
+ LIST_ENTRY(mfc) mfc_hash;
struct in_addr mfc_origin; /* IP origin of mcasts */
struct in_addr mfc_mcastgrp; /* multicast group associated*/
vifi_t mfc_parent; /* incoming vif */
@@ -282,11 +274,11 @@ struct mfc {
u_long mfc_wrong_if; /* wrong if for src-grp */
int mfc_expire; /* time to clean entry up */
struct timeval mfc_last_assert; /* last time I sent an assert*/
- struct rtdetq *mfc_stall; /* q of packets awaiting mfc */
- struct mfc *mfc_next; /* next mfc entry */
uint8_t mfc_flags[MAXVIFS]; /* the MRT_MFC_FLAGS_* flags */
struct in_addr mfc_rp; /* the RP address */
struct bw_meter *mfc_bw_meter; /* list of bandwidth meters */
+ u_long mfc_nstall; /* # of packets awaiting mfc */
+ TAILQ_HEAD(, rtdetq) mfc_stall; /* q of packets awaiting mfc */
};
/*
@@ -311,19 +303,11 @@ struct igmpmsg {
* Argument structure used for pkt info. while upcall is made
*/
struct rtdetq {
+ TAILQ_ENTRY(rtdetq) rte_link;
struct mbuf *m; /* A copy of the packet */
struct ifnet *ifp; /* Interface pkt came in on */
vifi_t xmt_vif; /* Saved copy of imo_multicast_vif */
- struct rtdetq *next; /* Next in list of packets */
};
-
-#define MFCTBLSIZ 256
-#if (MFCTBLSIZ & (MFCTBLSIZ - 1)) == 0 /* from sys:route.h */
-#define MFCHASHMOD(h) ((h) & (MFCTBLSIZ - 1))
-#else
-#define MFCHASHMOD(h) ((h) % MFCTBLSIZ)
-#endif
-
#define MAX_UPQ 4 /* max. no of pkts in upcall Q */
/*
OpenPOWER on IntegriCloud