Deleted Added
full compact
ip_mroute.c (249562) ip_mroute.c (253084)
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 *

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

62 * TODO: Cleanup LSRR removal further.
63 * TODO: Push RSVP stubs into raw_ip.c.
64 * TODO: Use bitstring.h for vif set.
65 * TODO: Fix mrt6_ioctl dangling ref when dynamically loaded.
66 * TODO: Sync ip6_mroute.c with this file.
67 */
68
69#include <sys/cdefs.h>
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 *

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

62 * TODO: Cleanup LSRR removal further.
63 * TODO: Push RSVP stubs into raw_ip.c.
64 * TODO: Use bitstring.h for vif set.
65 * TODO: Fix mrt6_ioctl dangling ref when dynamically loaded.
66 * TODO: Sync ip6_mroute.c with this file.
67 */
68
69#include <sys/cdefs.h>
70__FBSDID("$FreeBSD: head/sys/netinet/ip_mroute.c 249562 2013-04-16 19:32:12Z delphij $");
70__FBSDID("$FreeBSD: head/sys/netinet/ip_mroute.c 253084 2013-07-09 09:50:15Z ae $");
71
72#include "opt_inet.h"
73#include "opt_mrouting.h"
74
75#define _PIM_VT 1
76
77#include <sys/param.h>
78#include <sys/kernel.h>

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

88#include <sys/socket.h>
89#include <sys/socketvar.h>
90#include <sys/sockio.h>
91#include <sys/sx.h>
92#include <sys/sysctl.h>
93#include <sys/syslog.h>
94#include <sys/systm.h>
95#include <sys/time.h>
71
72#include "opt_inet.h"
73#include "opt_mrouting.h"
74
75#define _PIM_VT 1
76
77#include <sys/param.h>
78#include <sys/kernel.h>

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

88#include <sys/socket.h>
89#include <sys/socketvar.h>
90#include <sys/sockio.h>
91#include <sys/sx.h>
92#include <sys/sysctl.h>
93#include <sys/syslog.h>
94#include <sys/systm.h>
95#include <sys/time.h>
96#include <sys/counter.h>
96
97#include <net/if.h>
98#include <net/netisr.h>
99#include <net/route.h>
100#include <net/vnet.h>
101
102#include <netinet/in.h>
103#include <netinet/igmp.h>

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

140#define MROUTER_LOCK_ASSERT() mtx_assert(&mrouter_mtx, MA_OWNED)
141#define MROUTER_LOCK_INIT() \
142 mtx_init(&mrouter_mtx, "IPv4 multicast forwarding", NULL, MTX_DEF)
143#define MROUTER_LOCK_DESTROY() mtx_destroy(&mrouter_mtx)
144
145static int ip_mrouter_cnt; /* # of vnets with active mrouters */
146static int ip_mrouter_unloading; /* Allow no more V_ip_mrouter sockets */
147
97
98#include <net/if.h>
99#include <net/netisr.h>
100#include <net/route.h>
101#include <net/vnet.h>
102
103#include <netinet/in.h>
104#include <netinet/igmp.h>

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

141#define MROUTER_LOCK_ASSERT() mtx_assert(&mrouter_mtx, MA_OWNED)
142#define MROUTER_LOCK_INIT() \
143 mtx_init(&mrouter_mtx, "IPv4 multicast forwarding", NULL, MTX_DEF)
144#define MROUTER_LOCK_DESTROY() mtx_destroy(&mrouter_mtx)
145
146static int ip_mrouter_cnt; /* # of vnets with active mrouters */
147static int ip_mrouter_unloading; /* Allow no more V_ip_mrouter sockets */
148
148static VNET_DEFINE(struct mrtstat, mrtstat);
149#define V_mrtstat VNET(mrtstat)
150SYSCTL_VNET_STRUCT(_net_inet_ip, OID_AUTO, mrtstat, CTLFLAG_RW,
151 &VNET_NAME(mrtstat), mrtstat,
152 "IPv4 Multicast Forwarding Statistics (struct mrtstat, "
149static VNET_PCPUSTAT_DEFINE(struct mrtstat, mrtstat);
150VNET_PCPUSTAT_SYSINIT(mrtstat);
151VNET_PCPUSTAT_SYSUNINIT(mrtstat);
152SYSCTL_VNET_PCPUSTAT(_net_inet_ip, OID_AUTO, mrtstat, struct mrtstat,
153 mrtstat, "IPv4 Multicast Forwarding Statistics (struct mrtstat, "
153 "netinet/ip_mroute.h)");
154
155static VNET_DEFINE(u_long, mfchash);
156#define V_mfchash VNET(mfchash)
157#define MFCHASH(a, g) \
158 ((((a).s_addr >> 20) ^ ((a).s_addr >> 10) ^ (a).s_addr ^ \
159 ((g).s_addr >> 20) ^ ((g).s_addr >> 10) ^ (g).s_addr) & V_mfchash)
160#define MFCHASHSIZE 256

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

220#define V_bw_upcalls VNET(bw_upcalls)
221static VNET_DEFINE(u_int, bw_upcalls_n); /* # of pending upcalls */
222#define V_bw_upcalls_n VNET(bw_upcalls_n)
223static VNET_DEFINE(struct callout, bw_upcalls_ch);
224#define V_bw_upcalls_ch VNET(bw_upcalls_ch)
225
226#define BW_UPCALLS_PERIOD (hz) /* periodical flush of bw upcalls */
227
154 "netinet/ip_mroute.h)");
155
156static VNET_DEFINE(u_long, mfchash);
157#define V_mfchash VNET(mfchash)
158#define MFCHASH(a, g) \
159 ((((a).s_addr >> 20) ^ ((a).s_addr >> 10) ^ (a).s_addr ^ \
160 ((g).s_addr >> 20) ^ ((g).s_addr >> 10) ^ (g).s_addr) & V_mfchash)
161#define MFCHASHSIZE 256

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

221#define V_bw_upcalls VNET(bw_upcalls)
222static VNET_DEFINE(u_int, bw_upcalls_n); /* # of pending upcalls */
223#define V_bw_upcalls_n VNET(bw_upcalls_n)
224static VNET_DEFINE(struct callout, bw_upcalls_ch);
225#define V_bw_upcalls_ch VNET(bw_upcalls_ch)
226
227#define BW_UPCALLS_PERIOD (hz) /* periodical flush of bw upcalls */
228
228static VNET_DEFINE(struct pimstat, pimstat);
229#define V_pimstat VNET(pimstat)
229static VNET_PCPUSTAT_DEFINE(struct pimstat, pimstat);
230VNET_PCPUSTAT_SYSINIT(pimstat);
231VNET_PCPUSTAT_SYSUNINIT(pimstat);
230
231SYSCTL_NODE(_net_inet, IPPROTO_PIM, pim, CTLFLAG_RW, 0, "PIM");
232
233SYSCTL_NODE(_net_inet, IPPROTO_PIM, pim, CTLFLAG_RW, 0, "PIM");
232SYSCTL_VNET_STRUCT(_net_inet_pim, PIMCTL_STATS, stats, CTLFLAG_RD,
233 &VNET_NAME(pimstat), pimstat,
234 "PIM Statistics (struct pimstat, netinet/pim_var.h)");
234SYSCTL_VNET_PCPUSTAT(_net_inet_pim, PIMCTL_STATS, stats, struct pimstat,
235 pimstat, "PIM Statistics (struct pimstat, netinet/pim_var.h)");
235
236static u_long pim_squelch_wholepkt = 0;
237SYSCTL_ULONG(_net_inet_pim, OID_AUTO, squelch_wholepkt, CTLFLAG_RW,
238 &pim_squelch_wholepkt, 0,
239 "Disable IGMP_WHOLEPKT notifications if rendezvous point is unspecified");
240
241extern struct domain inetdomain;
242static const struct protosw in_pim_protosw = {

--- 2706 unchanged lines hidden ---
236
237static u_long pim_squelch_wholepkt = 0;
238SYSCTL_ULONG(_net_inet_pim, OID_AUTO, squelch_wholepkt, CTLFLAG_RW,
239 &pim_squelch_wholepkt, 0,
240 "Disable IGMP_WHOLEPKT notifications if rendezvous point is unspecified");
241
242extern struct domain inetdomain;
243static const struct protosw in_pim_protosw = {

--- 2706 unchanged lines hidden ---