FreeBSD kernel IPv4 code
|
#include <sys/cdefs.h>
#include "opt_inet.h"
#include "opt_mrouting.h"
#include <sys/types.h>
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/stddef.h>
#include <sys/condvar.h>
#include <sys/eventhandler.h>
#include <sys/lock.h>
#include <sys/kthread.h>
#include <sys/ktr.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/module.h>
#include <sys/priv.h>
#include <sys/protosw.h>
#include <sys/signalvar.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/sockio.h>
#include <sys/sx.h>
#include <sys/sysctl.h>
#include <sys/syslog.h>
#include <sys/systm.h>
#include <sys/taskqueue.h>
#include <sys/time.h>
#include <sys/counter.h>
#include <machine/atomic.h>
#include <net/if.h>
#include <net/if_var.h>
#include <net/if_types.h>
#include <net/netisr.h>
#include <net/route.h>
#include <net/vnet.h>
#include <netinet/in.h>
#include <netinet/igmp.h>
#include <netinet/in_systm.h>
#include <netinet/in_var.h>
#include <netinet/ip.h>
#include <netinet/ip_encap.h>
#include <netinet/ip_mroute.h>
#include <netinet/ip_var.h>
#include <netinet/ip_options.h>
#include <netinet/pim.h>
#include <netinet/pim_var.h>
#include <netinet/udp.h>
#include <machine/in_cksum.h>
Go to the source code of this file.
Data Structures | |
struct | pim_encap_pimhdr |
Macros | |
#define | _PIM_VT 1 |
#define | KTR_IPMF KTR_INET |
#define | VIFI_INVALID ((vifi_t) -1) |
#define | MRW_RLOCK() rw_rlock(&mrouter_mtx) |
#define | MRW_WLOCK() rw_wlock(&mrouter_mtx) |
#define | MRW_RUNLOCK() rw_runlock(&mrouter_mtx) |
#define | MRW_WUNLOCK() rw_wunlock(&mrouter_mtx) |
#define | MRW_UNLOCK() rw_unlock(&mrouter_mtx) |
#define | MRW_LOCK_ASSERT() rw_assert(&mrouter_mtx, RA_LOCKED) |
#define | MRW_WLOCK_ASSERT() rw_assert(&mrouter_mtx, RA_WLOCKED) |
#define | MRW_LOCK_TRY_UPGRADE() rw_try_upgrade(&mrouter_mtx) |
#define | MRW_WOWNED() rw_wowned(&mrouter_mtx) |
#define | MRW_LOCK_INIT() rw_init(&mrouter_mtx, "IPv4 multicast forwarding") |
#define | MRW_LOCK_DESTROY() rw_destroy(&mrouter_mtx) |
#define | V_mfchash VNET(mfchash) |
#define | MFCHASH(a, g) |
#define | MFCHASHSIZE 256 |
#define | V_nexpire VNET(nexpire) |
#define | V_mfchashtbl VNET(mfchashtbl) |
#define | V_task_queue VNET(task_queue) |
#define | V_task VNET(task) |
#define | V_numvifs VNET(numvifs) |
#define | V_viftable VNET(viftable) |
#define | V_expire_upcalls_ch VNET(expire_upcalls_ch) |
#define | V_buf_ring_mtx VNET(buf_ring_mtx) |
#define | EXPIRE_TIMEOUT (hz / 4) /* 4x / second */ |
#define | UPCALL_EXPIRE 6 /* number of timeouts */ |
#define | V_bw_upcalls_ch VNET(bw_upcalls_ch) |
#define | V_bw_upcalls_ring VNET(bw_upcalls_ring) |
#define | V_bw_upcalls_ring_mtx VNET(bw_upcalls_ring_mtx) |
#define | BW_UPCALLS_PERIOD (hz) /* periodical flush of bw upcalls */ |
#define | PIM_ENCAP_TTL 64 |
#define | V_reg_vif_num VNET(reg_vif_num) |
#define | V_multicast_register_if VNET(multicast_register_if) |
#define | MRT_API_VERSION 0x0305 |
#define | V_mrt_api_config VNET(mrt_api_config) |
#define | V_pim_assert_enabled VNET(pim_assert_enabled) |
#define | TUNNEL_LEN 12 /* # bytes of IP option for tunnel encapsulation */ |
#define | BW_TIMEVALCMP(tvp, uvp, cmp) timevalcmp((tvp), (uvp), cmp) |
#define | BW_TIMEVALDECR(vvp, uvp) timevalsub((vvp), (uvp)) |
#define | BW_TIMEVALADD(vvp, uvp) timevaladd((vvp), (uvp)) |
Functions | |
__FBSDID ("$FreeBSD$") | |
static | MALLOC_DEFINE (M_MRTABLE, "mroutetbl", "multicast forwarding cache") |
VNET_PCPUSTAT_DEFINE_STATIC (struct mrtstat, mrtstat) | |
VNET_PCPUSTAT_SYSINIT (mrtstat) | |
VNET_PCPUSTAT_SYSUNINIT (mrtstat) | |
SYSCTL_VNET_PCPUSTAT (_net_inet_ip, OID_AUTO, mrtstat, struct mrtstat, mrtstat, "IPv4 Multicast Forwarding Statistics (struct mrtstat, " "netinet/ip_mroute.h)") | |
VNET_DEFINE_STATIC (u_long, mfchash) | |
VNET_DEFINE_STATIC (u_char *, nexpire) | |
VNET_DEFINE_STATIC (LIST_HEAD(mfchashhdr, mfc) *, mfchashtbl) | |
VNET_DEFINE_STATIC (struct taskqueue *, task_queue) | |
VNET_DEFINE_STATIC (struct task, task) | |
VNET_DEFINE_STATIC (vifi_t, numvifs) | |
VNET_DEFINE_STATIC (struct vif *, viftable) | |
VNET_DEFINE_STATIC (struct callout, expire_upcalls_ch) | |
VNET_DEFINE_STATIC (struct mtx, buf_ring_mtx) | |
static | MALLOC_DEFINE (M_BWMETER, "bwmeter", "multicast upcall bw meters") |
VNET_DEFINE_STATIC (struct callout, bw_upcalls_ch) | |
VNET_DEFINE_STATIC (struct buf_ring *, bw_upcalls_ring) | |
VNET_DEFINE_STATIC (struct mtx, bw_upcalls_ring_mtx) | |
VNET_PCPUSTAT_DEFINE_STATIC (struct pimstat, pimstat) | |
VNET_PCPUSTAT_SYSINIT (pimstat) | |
VNET_PCPUSTAT_SYSUNINIT (pimstat) | |
SYSCTL_NODE (_net_inet, IPPROTO_PIM, pim, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "PIM") | |
SYSCTL_VNET_PCPUSTAT (_net_inet_pim, PIMCTL_STATS, stats, struct pimstat, pimstat, "PIM Statistics (struct pimstat, netinet/pim_var.h)") | |
SYSCTL_ULONG (_net_inet_pim, OID_AUTO, squelch_wholepkt, CTLFLAG_RW, &pim_squelch_wholepkt, 0, "Disable IGMP_WHOLEPKT notifications if rendezvous point is unspecified") | |
static int | pim_encapcheck (const struct mbuf *, int, int, void *) |
static int | pim_input (struct mbuf *, int, int, void *) |
VNET_DEFINE_STATIC (vifi_t, reg_vif_num) | |
VNET_DEFINE_STATIC (struct ifnet *, multicast_register_if) | |
static u_long | X_ip_mcast_src (int) |
static int | X_ip_mforward (struct ip *, struct ifnet *, struct mbuf *, struct ip_moptions *) |
static int | X_ip_mrouter_done (void) |
static int | X_ip_mrouter_get (struct socket *, struct sockopt *) |
static int | X_ip_mrouter_set (struct socket *, struct sockopt *) |
static int | X_legal_vif_num (int) |
static int | X_mrt_ioctl (u_long, caddr_t, int) |
static int | add_bw_upcall (struct bw_upcall *) |
static int | add_mfc (struct mfcctl2 *) |
static int | add_vif (struct vifctl *) |
static void | bw_meter_prepare_upcall (struct bw_meter *, struct timeval *) |
static void | bw_meter_geq_receive_packet (struct bw_meter *, int, struct timeval *) |
static void | bw_upcalls_send (void) |
static int | del_bw_upcall (struct bw_upcall *) |
static int | del_mfc (struct mfcctl2 *) |
static int | del_vif (vifi_t) |
static int | del_vif_locked (vifi_t, struct ifnet **) |
static void | expire_bw_upcalls_send (void *) |
static void | expire_mfc (struct mfc *) |
static void | expire_upcalls (void *) |
static void | free_bw_list (struct bw_meter *) |
static int | get_sg_cnt (struct sioc_sg_req *) |
static int | get_vif_cnt (struct sioc_vif_req *) |
static void | if_detached_event (void *, struct ifnet *) |
static int | ip_mdq (struct mbuf *, struct ifnet *, struct mfc *, vifi_t) |
static int | ip_mrouter_init (struct socket *, int) |
static __inline struct mfc * | mfc_find (struct in_addr *, struct in_addr *) |
static void | phyint_send (struct ip *, struct vif *, struct mbuf *) |
static struct mbuf * | pim_register_prepare (struct ip *, struct mbuf *) |
static int | pim_register_send (struct ip *, struct vif *, struct mbuf *, struct mfc *) |
static int | pim_register_send_rp (struct ip *, struct vif *, struct mbuf *, struct mfc *) |
static int | pim_register_send_upcall (struct ip *, struct vif *, struct mbuf *, struct mfc *) |
static void | send_packet (struct vif *, struct mbuf *) |
static int | set_api_config (uint32_t *) |
static int | set_assert (int) |
static int | socket_send (struct socket *, struct mbuf *, struct sockaddr_in *) |
VNET_DEFINE_STATIC (uint32_t, mrt_api_config) | |
VNET_DEFINE_STATIC (int, pim_assert_enabled) | |
static __inline struct mfc * | mfc_alloc (void) |
static int | X_mrt_ioctl (u_long cmd, caddr_t data, int fibnum __unused) |
static void | if_detached_event (void *arg __unused, struct ifnet *ifp) |
static void | ip_mrouter_upcall_thread (void *arg, int pending __unused) |
static void | update_mfc_params (struct mfc *rt, struct mfcctl2 *mfccp) |
static void | init_mfc_params (struct mfc *rt, struct mfcctl2 *mfccp) |
static int | X_ip_rsvp_vif (struct socket *so __unused, struct sockopt *sopt __unused) |
static void | X_ip_rsvp_force_done (struct socket *so __unused) |
static int | X_rsvp_input (struct mbuf **mp, int *offp, int proto) |
static uint32_t | compute_bw_meter_flags (struct bw_upcall *req) |
static void | expire_bw_meter_leq (void *arg) |
static int | pim_encapcheck (const struct mbuf *m __unused, int off __unused, int proto __unused, void *arg __unused) |
static int | pim_input (struct mbuf *m, int off, int proto, void *arg __unused) |
static int | sysctl_mfctable (SYSCTL_HANDLER_ARGS) |
static | SYSCTL_NODE (_net_inet_ip, OID_AUTO, mfctable, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_mfctable, "IPv4 Multicast Forwarding Table " "(struct *mfc[mfchashsize], netinet/ip_mroute.h)") |
static int | sysctl_viflist (SYSCTL_HANDLER_ARGS) |
SYSCTL_PROC (_net_inet_ip, OID_AUTO, viftable, CTLTYPE_OPAQUE|CTLFLAG_VNET|CTLFLAG_RD|CTLFLAG_MPSAFE, NULL, 0, sysctl_viflist, "S,vif[MAXVIFS]", "IPv4 Multicast Interfaces (struct vif[MAXVIFS], netinet/ip_mroute.h)") | |
static void | vnet_mroute_init (const void *unused __unused) |
VNET_SYSINIT (vnet_mroute_init, SI_SUB_PROTO_MC, SI_ORDER_ANY, vnet_mroute_init, NULL) | |
static void | vnet_mroute_uninit (const void *unused __unused) |
VNET_SYSUNINIT (vnet_mroute_uninit, SI_SUB_PROTO_MC, SI_ORDER_MIDDLE, vnet_mroute_uninit, NULL) | |
static int | ip_mroute_modevent (module_t mod, int type, void *unused) |
DECLARE_MODULE (ip_mroute, ip_mroutemod, SI_SUB_PROTO_MC, SI_ORDER_MIDDLE) | |
Variables | |
static struct rwlock | mrouter_mtx |
static int | ip_mrouter_cnt |
static int | ip_mrouter_unloading |
static u_long | mfchashsize |
static eventhandler_tag | if_detach_event_tag = NULL |
static u_long | pim_squelch_wholepkt = 0 |
static const struct encaptab * | pim_encap_cookie |
int | in_mcast_loop |
static const struct encap_config | ipv4_encap_cfg |
static struct ip | pim_encap_iphdr |
static struct pim_encap_pimhdr | pim_encap_pimhdr |
static const int | mrt_api_version = MRT_API_VERSION |
static const uint32_t | mrt_api_support |
static struct timeval | pim_assert_interval = { 3, 0 } |
static moduledata_t | ip_mroutemod |
#define _PIM_VT 1 |
Definition at line 78 of file ip_mroute.c.
#define BW_TIMEVALADD | ( | vvp, | |
uvp | |||
) | timevaladd((vvp), (uvp)) |
Definition at line 1811 of file ip_mroute.c.
#define BW_TIMEVALCMP | ( | tvp, | |
uvp, | |||
cmp | |||
) | timevalcmp((tvp), (uvp), cmp) |
Definition at line 1809 of file ip_mroute.c.
#define BW_TIMEVALDECR | ( | vvp, | |
uvp | |||
) | timevalsub((vvp), (uvp)) |
Definition at line 1810 of file ip_mroute.c.
#define BW_UPCALLS_PERIOD (hz) /* periodical flush of bw upcalls */ |
Definition at line 218 of file ip_mroute.c.
#define EXPIRE_TIMEOUT (hz / 4) /* 4x / second */ |
Definition at line 199 of file ip_mroute.c.
#define KTR_IPMF KTR_INET |
Definition at line 130 of file ip_mroute.c.
#define MFCHASH | ( | a, | |
g | |||
) |
Definition at line 171 of file ip_mroute.c.
#define MFCHASHSIZE 256 |
Definition at line 174 of file ip_mroute.c.
#define MRT_API_VERSION 0x0305 |
Definition at line 351 of file ip_mroute.c.
#define MRW_LOCK_ASSERT | ( | ) | rw_assert(&mrouter_mtx, RA_LOCKED) |
Definition at line 151 of file ip_mroute.c.
#define MRW_LOCK_DESTROY | ( | ) | rw_destroy(&mrouter_mtx) |
Definition at line 157 of file ip_mroute.c.
#define MRW_LOCK_INIT | ( | ) | rw_init(&mrouter_mtx, "IPv4 multicast forwarding") |
Definition at line 155 of file ip_mroute.c.
#define MRW_LOCK_TRY_UPGRADE | ( | ) | rw_try_upgrade(&mrouter_mtx) |
Definition at line 153 of file ip_mroute.c.
#define MRW_RLOCK | ( | ) | rw_rlock(&mrouter_mtx) |
Definition at line 146 of file ip_mroute.c.
#define MRW_RUNLOCK | ( | ) | rw_runlock(&mrouter_mtx) |
Definition at line 148 of file ip_mroute.c.
#define MRW_UNLOCK | ( | ) | rw_unlock(&mrouter_mtx) |
Definition at line 150 of file ip_mroute.c.
#define MRW_WLOCK | ( | ) | rw_wlock(&mrouter_mtx) |
Definition at line 147 of file ip_mroute.c.
#define MRW_WLOCK_ASSERT | ( | ) | rw_assert(&mrouter_mtx, RA_WLOCKED) |
Definition at line 152 of file ip_mroute.c.
#define MRW_WOWNED | ( | ) | rw_wowned(&mrouter_mtx) |
Definition at line 154 of file ip_mroute.c.
#define MRW_WUNLOCK | ( | ) | rw_wunlock(&mrouter_mtx) |
Definition at line 149 of file ip_mroute.c.
#define PIM_ENCAP_TTL 64 |
Definition at line 263 of file ip_mroute.c.
#define TUNNEL_LEN 12 /* # bytes of IP option for tunnel encapsulation */ |
Definition at line 1284 of file ip_mroute.c.
#define UPCALL_EXPIRE 6 /* number of timeouts */ |
Definition at line 200 of file ip_mroute.c.
#define V_buf_ring_mtx VNET(buf_ring_mtx) |
Definition at line 197 of file ip_mroute.c.
#define V_bw_upcalls_ch VNET(bw_upcalls_ch) |
Definition at line 212 of file ip_mroute.c.
#define V_bw_upcalls_ring VNET(bw_upcalls_ring) |
Definition at line 214 of file ip_mroute.c.
#define V_bw_upcalls_ring_mtx VNET(bw_upcalls_ring_mtx) |
Definition at line 216 of file ip_mroute.c.
#define V_expire_upcalls_ch VNET(expire_upcalls_ch) |
Definition at line 194 of file ip_mroute.c.
#define V_mfchash VNET(mfchash) |
Definition at line 170 of file ip_mroute.c.
#define V_mfchashtbl VNET(mfchashtbl) |
Definition at line 180 of file ip_mroute.c.
#define V_mrt_api_config VNET(mrt_api_config) |
Definition at line 359 of file ip_mroute.c.
#define V_multicast_register_if VNET(multicast_register_if) |
Definition at line 294 of file ip_mroute.c.
#define V_nexpire VNET(nexpire) |
Definition at line 178 of file ip_mroute.c.
#define V_numvifs VNET(numvifs) |
Definition at line 187 of file ip_mroute.c.
#define V_pim_assert_enabled VNET(pim_assert_enabled) |
Definition at line 361 of file ip_mroute.c.
#define V_reg_vif_num VNET(reg_vif_num) |
Definition at line 292 of file ip_mroute.c.
#define V_task VNET(task) |
Definition at line 184 of file ip_mroute.c.
#define V_task_queue VNET(task_queue) |
Definition at line 182 of file ip_mroute.c.
#define V_viftable VNET(viftable) |
Definition at line 189 of file ip_mroute.c.
#define VIFI_INVALID ((vifi_t) -1) |
Definition at line 133 of file ip_mroute.c.
__FBSDID | ( | "$FreeBSD$" | ) |
|
static |
Definition at line 1877 of file ip_mroute.c.
References bw_meter::arg, bw_data::b_bytes, bw_data::b_packets, bw_data::b_time, bw_meter::bm_flags, bw_meter::bm_measured, bw_meter::bm_meter_callout, bw_meter::bm_mfc, bw_meter::bm_mfc_next, bw_meter::bm_spin, bw_meter::bm_spin_name, bw_meter::bm_start_time, bw_meter::bm_threshold, bw_meter::bm_time_next, bw_upcall::bu_dst, bw_upcall::bu_flags, bw_upcall::bu_src, bw_upcall::bu_threshold, BW_METER_USER_FLAGS, BW_TIMEVALCMP, BW_UPCALL_GEQ, BW_UPCALL_LEQ, BW_UPCALL_THRESHOLD_INTERVAL_MIN_SEC, BW_UPCALL_THRESHOLD_INTERVAL_MIN_USEC, BW_UPCALL_UNIT_BYTES, BW_UPCALL_UNIT_PACKETS, compute_bw_meter_flags(), expire_bw_meter_leq(), mfc::mfc_bw_meter_geq, mfc::mfc_bw_meter_leq, mfc_find(), mrouter_mtx, MRT_MFC_BW_UPCALL, MRW_WLOCK, MRW_WUNLOCK, and V_mrt_api_config.
Referenced by X_ip_mrouter_set().
|
static |
Definition at line 1121 of file ip_mroute.c.
References rtdetq::ifp, in_hosteq, init_mfc_params(), ip_mdq(), KTR_IPMF, rtdetq::m, mfc_alloc(), mfc::mfc_bw_meter_geq, mfc::mfc_bw_meter_leq, mfc::mfc_expire, mfc_find(), mfc::mfc_mcastgrp, mfc::mfc_origin, mfc::mfc_stall_ring, mfcctl2::mfcc_mcastgrp, mfcctl2::mfcc_origin, mfcctl2::mfcc_parent, MFCHASH, MRW_WLOCK, MRW_WUNLOCK, in_addr::s_addr, update_mfc_params(), V_mfchashtbl, and V_nexpire.
Referenced by X_ip_mrouter_set().
|
static |
Definition at line 892 of file ip_mroute.c.
References in_nullhost, KTR_IPMF, MAXVIFS, MRW_WLOCK, MRW_WUNLOCK, in_addr::s_addr, sockaddr_in::sin_addr, vif::v_bytes_in, vif::v_bytes_out, vif::v_flags, vif::v_ifp, vif::v_lcl_addr, V_multicast_register_if, V_numvifs, vif::v_pkt_in, vif::v_pkt_out, V_reg_vif_num, vif::v_rmt_addr, vif::v_spin, vif::v_spin_name, vif::v_threshold, V_viftable, vifctl::vifc_flags, vifctl::vifc_lcl_addr, vifctl::vifc_rate_limit, vifctl::vifc_rmt_addr, vifctl::vifc_threshold, vifctl::vifc_vifi, VIFF_REGISTER, VIFF_TUNNEL, and VIFI_INVALID.
Referenced by X_ip_mrouter_set().
|
static |
Definition at line 2073 of file ip_mroute.c.
References bw_data::b_bytes, bw_data::b_packets, bw_data::b_time, bw_meter::bm_flags, bw_meter::bm_measured, bw_meter::bm_start_time, bw_meter::bm_threshold, bw_meter_prepare_upcall(), BW_METER_UNIT_BYTES, BW_METER_UNIT_PACKETS, BW_METER_UPCALL_DELIVERED, BW_TIMEVALCMP, BW_TIMEVALDECR, and MRW_LOCK_ASSERT.
Referenced by ip_mdq().
|
static |
Definition at line 2118 of file ip_mroute.c.
References bw_data::b_bytes, bw_data::b_packets, bw_data::b_time, bw_meter::bm_flags, bw_meter::bm_measured, bw_meter::bm_mfc, bw_meter::bm_start_time, bw_meter::bm_threshold, bw_upcall::bu_dst, bw_upcall::bu_flags, bw_upcall::bu_measured, bw_upcall::bu_src, bw_upcall::bu_threshold, BW_METER_GEQ, BW_METER_LEQ, BW_METER_UNIT_BYTES, BW_METER_UNIT_PACKETS, BW_TIMEVALDECR, BW_UPCALL_GEQ, BW_UPCALL_LEQ, BW_UPCALL_UNIT_BYTES, BW_UPCALL_UNIT_PACKETS, BW_UPCALLS_MAX, mfc::mfc_mcastgrp, mfc::mfc_origin, MRW_LOCK_ASSERT, V_bw_upcalls_ring, V_task, and V_task_queue.
Referenced by bw_meter_geq_receive_packet(), and expire_bw_meter_leq().
|
static |
Definition at line 2167 of file ip_mroute.c.
References IGMPMSG_BW_UPCALL, MRTSTAT_INC, MRW_LOCK_ASSERT, socket_send(), V_bw_upcalls_ring, and V_ip_mrouter.
Referenced by expire_bw_upcalls_send(), and ip_mrouter_upcall_thread().
Definition at line 1814 of file ip_mroute.c.
References bw_upcall::bu_flags, BW_METER_GEQ, BW_METER_LEQ, BW_METER_UNIT_BYTES, BW_METER_UNIT_PACKETS, BW_UPCALL_GEQ, BW_UPCALL_LEQ, BW_UPCALL_UNIT_BYTES, and BW_UPCALL_UNIT_PACKETS.
Referenced by add_bw_upcall(), and del_bw_upcall().
DECLARE_MODULE | ( | ip_mroute | , |
ip_mroutemod | , | ||
SI_SUB_PROTO_MC | , | ||
SI_ORDER_MIDDLE | |||
) |
|
static |
Definition at line 1994 of file ip_mroute.c.
References bw_data::b_bytes, bw_data::b_packets, bw_data::b_time, bw_meter::bm_mfc_next, bw_upcall::bu_dst, bw_upcall::bu_flags, bw_upcall::bu_src, bw_upcall::bu_threshold, BW_METER_USER_FLAGS, BW_TIMEVALCMP, BW_UPCALL_DELETE_ALL, BW_UPCALL_GEQ, BW_UPCALL_LEQ, compute_bw_meter_flags(), free_bw_list(), mfc::mfc_bw_meter_geq, mfc::mfc_bw_meter_leq, mfc_find(), MRT_MFC_BW_UPCALL, MRW_WLOCK, MRW_WUNLOCK, and V_mrt_api_config.
Referenced by X_ip_mrouter_set().
|
static |
Definition at line 1218 of file ip_mroute.c.
References free_bw_list(), KTR_IPMF, mfc::mfc_bw_meter_geq, mfc::mfc_bw_meter_leq, mfc_find(), mfcctl2::mfcc_mcastgrp, mfcctl2::mfcc_origin, MRW_WLOCK, MRW_WUNLOCK, and in_addr::s_addr.
Referenced by X_ip_mrouter_set().
|
static |
Definition at line 1040 of file ip_mroute.c.
References del_vif_locked(), MRW_WLOCK, and MRW_WUNLOCK.
Referenced by X_ip_mrouter_set().
|
static |
Definition at line 996 of file ip_mroute.c.
References in_nullhost, KTR_IPMF, MRW_WLOCK_ASSERT, vif::v_flags, vif::v_ifp, vif::v_lcl_addr, V_multicast_register_if, V_numvifs, V_reg_vif_num, vif::v_spin, V_viftable, VIFF_REGISTER, VIFF_TUNNEL, and VIFI_INVALID.
Referenced by del_vif(), and if_detached_event().
|
static |
Definition at line 1831 of file ip_mroute.c.
References bw_meter::arg, bw_data::b_bytes, bw_data::b_packets, bw_data::b_time, bw_meter::bm_flags, bw_meter::bm_measured, bw_meter::bm_meter_callout, bw_meter::bm_spin, bw_meter::bm_start_time, bw_meter::bm_threshold, bw_meter_prepare_upcall(), BW_METER_UNIT_BYTES, BW_METER_UNIT_PACKETS, V_task, and V_task_queue.
Referenced by add_bw_upcall().
|
static |
Definition at line 2220 of file ip_mroute.c.
References BW_UPCALLS_PERIOD, bw_upcalls_send(), expire_bw_upcalls_send(), and V_bw_upcalls_ch.
Referenced by expire_bw_upcalls_send(), and ip_mrouter_init().
|
static |
Definition at line 1095 of file ip_mroute.c.
References free_bw_list(), rtdetq::m, mfc::mfc_bw_meter_geq, mfc::mfc_bw_meter_leq, mfc::mfc_stall_ring, and MRW_WLOCK_ASSERT.
Referenced by expire_upcalls(), if_detached_event(), and X_ip_mrouter_done().
|
static |
Definition at line 1504 of file ip_mroute.c.
References expire_mfc(), EXPIRE_TIMEOUT, expire_upcalls(), KTR_IPMF, mfc::mfc_expire, mfc::mfc_mcastgrp, mfc::mfc_origin, mfc::mfc_stall_ring, mfchashsize, MRTSTAT_INC, in_addr::s_addr, V_expire_upcalls_ch, V_mfchashtbl, and V_nexpire.
Referenced by expire_upcalls(), and ip_mrouter_init().
|
static |
Definition at line 1974 of file ip_mroute.c.
References bw_meter::bm_flags, bw_meter::bm_meter_callout, bw_meter::bm_mfc_next, bw_meter::bm_spin, and BW_METER_LEQ.
Referenced by del_bw_upcall(), del_mfc(), and expire_mfc().
|
static |
Definition at line 577 of file ip_mroute.c.
References sioc_sg_req::bytecnt, sioc_sg_req::grp, mfc::mfc_byte_cnt, mfc_find(), mfc::mfc_pkt_cnt, mfc::mfc_wrong_if, MRW_RLOCK, MRW_RUNLOCK, sioc_sg_req::pktcnt, sioc_sg_req::src, and sioc_sg_req::wrong_if.
Referenced by X_mrt_ioctl().
|
static |
Definition at line 599 of file ip_mroute.c.
References sioc_vif_req::ibytes, sioc_vif_req::icount, MRW_RLOCK, MRW_RUNLOCK, sioc_vif_req::obytes, sioc_vif_req::ocount, V_numvifs, V_viftable, and sioc_vif_req::vifi.
Referenced by X_mrt_ioctl().
|
static |
|
static |
Definition at line 621 of file ip_mroute.c.
References del_vif_locked(), expire_mfc(), mfc::mfc_parent, mfchashsize, MRW_WLOCK, MRW_WUNLOCK, V_ip_mrouter, V_mfchashtbl, V_numvifs, and V_viftable.
Definition at line 1080 of file ip_mroute.c.
References mfc::mfc_byte_cnt, mfc::mfc_last_assert, mfc::mfc_mcastgrp, mfc::mfc_origin, mfc::mfc_pkt_cnt, mfc::mfc_wrong_if, mfcctl2::mfcc_mcastgrp, mfcctl2::mfcc_origin, and update_mfc_params().
Referenced by add_mfc().
Definition at line 1544 of file ip_mroute.c.
References bw_data::b_bytes, bw_data::b_packets, bw_meter::bm_measured, bw_meter::bm_mfc_next, bw_meter::bm_spin, bw_meter_geq_receive_packet(), IGMPMSG_WRONGVIF, igmpmsg::im_mbz, igmpmsg::im_msgtype, igmpmsg::im_vif, in_hosteq, ip::ip_hl, ip::ip_len, ip::ip_ttl, KTR_IPMF, mfc::mfc_bw_meter_geq, mfc::mfc_bw_meter_leq, mfc::mfc_byte_cnt, mfc::mfc_flags, mfc::mfc_last_assert, mfc::mfc_parent, mfc::mfc_pkt_cnt, mfc::mfc_ttls, mfc::mfc_wrong_if, MRT_MFC_FLAGS_DISABLE_WRONGVIF, MRTSTAT_INC, MRW_LOCK_ASSERT, phyint_send(), pim_assert_interval, pim_register_send(), PIMSTAT_INC, sockaddr_in::sin_addr, socket_send(), V_ip_mrouter, V_multicast_register_if, V_numvifs, V_pim_assert_enabled, V_viftable, and VIFF_REGISTER.
Referenced by add_mfc(), and X_ip_mforward().
|
static |
Definition at line 2783 of file ip_mroute.c.
References if_detach_event_tag, if_detached_event(), ip_encap_attach(), ip_encap_detach(), ip_mcast_src, ip_mforward, ip_mrouter_cnt, ip_mrouter_done, ip_mrouter_get, ip_mrouter_set, ip_mrouter_unloading, ip_rsvp_force_done, ip_rsvp_vif, ipv4_encap_cfg, legal_vif_num, MFCHASHSIZE, mfchashsize, mrt_ioctl, MRW_LOCK_DESTROY, MRW_LOCK_INIT, MRW_WLOCK, MRW_WUNLOCK, pim_encap_cookie, pim_squelch_wholepkt, rsvp_input_p, X_ip_mcast_src(), X_ip_mforward(), X_ip_mrouter_done(), X_ip_mrouter_get(), X_ip_mrouter_set(), X_ip_rsvp_force_done(), X_ip_rsvp_vif(), X_legal_vif_num(), X_mrt_ioctl(), and X_rsvp_input().
|
static |
Definition at line 686 of file ip_mroute.c.
References BW_UPCALLS_MAX, BW_UPCALLS_PERIOD, expire_bw_upcalls_send(), EXPIRE_TIMEOUT, expire_upcalls(), ip_mrouter_cnt, ip_mrouter_unloading, ip_mrouter_upcall_thread(), KTR_IPMF, mfchashsize, MRW_WLOCK, MRW_WUNLOCK, V_buf_ring_mtx, V_bw_upcalls_ch, V_bw_upcalls_ring, V_bw_upcalls_ring_mtx, V_expire_upcalls_ch, V_ip_mrouter, V_mfchash, V_mfchashtbl, V_task, and V_task_queue.
Referenced by X_ip_mrouter_set().
|
static |
Definition at line 671 of file ip_mroute.c.
References bw_upcalls_send(), MRW_WLOCK, and MRW_WUNLOCK.
Referenced by ip_mrouter_init().
|
static |
|
static |
|
static |
Definition at line 391 of file ip_mroute.c.
References MAX_UPQ, mfc::mfc_stall_ring, and V_buf_ring_mtx.
Referenced by add_mfc(), and X_ip_mforward().
Definition at line 369 of file ip_mroute.c.
References in_hosteq, mfc::mfc_mcastgrp, mfc::mfc_origin, mfc::mfc_stall_ring, MFCHASH, MRW_LOCK_ASSERT, and V_mfchashtbl.
Referenced by add_bw_upcall(), add_mfc(), del_bw_upcall(), del_mfc(), get_sg_cnt(), and X_ip_mforward().
Definition at line 1727 of file ip_mroute.c.
References ip::ip_hl, MRW_LOCK_ASSERT, and send_packet().
Referenced by ip_mdq().
|
static |
|
static |
Definition at line 2459 of file ip_mroute.c.
|
static |
|
static |
Definition at line 2476 of file ip_mroute.c.
References ip::ip_dst, ip::ip_hl, ip::ip_len, ip::ip_sum, ip_tos, ip::ip_tos, ip::ip_v, IPVERSION, KTR_IPMF, MRW_RLOCK, MRW_RUNLOCK, PIM_MINLEN, PIM_NULL_REGISTER, PIM_REG_MINLEN, PIM_REGISTER, PIM_VERSION, PIMSTAT_ADD, PIMSTAT_INC, rip_input(), in_addr::s_addr, sockaddr_in::sin_family, V_numvifs, V_reg_vif_num, V_viftable, and VIFI_INVALID.
|
static |
Definition at line 2286 of file ip_mroute.c.
References in_delayed_cksum(), ip_fragment(), ip::ip_hl, ip::ip_len, ip::ip_sum, ip::ip_ttl, and pim_encap_iphdr.
Referenced by pim_register_send().
|
static |
Definition at line 2242 of file ip_mroute.c.
References in_nullhost, mfc::mfc_rp, MRT_MFC_RP, pim_register_prepare(), pim_register_send_rp(), pim_register_send_upcall(), pim_squelch_wholepkt, and V_mrt_api_config.
Referenced by ip_mdq().
|
static |
Definition at line 2386 of file ip_mroute.c.
References pim_encap_pimhdr::flags, in_nullhost, IP_DF, ip::ip_dst, ip_fillid(), ip::ip_len, ip::ip_off, ip::ip_tos, mfc::mfc_flags, mfc::mfc_parent, mfc::mfc_rp, MRT_MFC_FLAGS_BORDER_VIF, MRW_LOCK_ASSERT, pim_encap_pimhdr::pim, PIM_BORDER_REGISTER, pim::pim_cksum, pim_encap_iphdr, pim_encap_pimhdr, PIMSTAT_ADD, PIMSTAT_INC, send_packet(), V_mrt_api_config, V_numvifs, and V_viftable.
Referenced by pim_register_send().
|
static |
Definition at line 2334 of file ip_mroute.c.
References IGMPMSG_WHOLEPKT, igmpmsg::im_dst, igmpmsg::im_mbz, igmpmsg::im_msgtype, igmpmsg::im_vif, ip::ip_dst, ip::ip_len, KTR_IPMF, MRTSTAT_INC, MRW_LOCK_ASSERT, PIMSTAT_ADD, PIMSTAT_INC, sockaddr_in::sin_addr, socket_send(), V_ip_mrouter, and V_viftable.
Referenced by pim_register_send().
|
static |
Definition at line 1749 of file ip_mroute.c.
References in_mcast_loop, IP_FORWARDING, ip_output(), KTR_IPMF, MRW_LOCK_ASSERT, vif::v_ifp, and V_viftable.
Referenced by phyint_send(), and pim_register_send_rp().
|
static |
Definition at line 850 of file ip_mroute.c.
References mfchashsize, mrt_api_support, MRW_RLOCK, MRW_RUNLOCK, V_mfchashtbl, V_mrt_api_config, V_numvifs, and V_pim_assert_enabled.
Referenced by X_ip_mrouter_set().
|
static |
Definition at line 836 of file ip_mroute.c.
References V_pim_assert_enabled.
Referenced by X_ip_mrouter_set().
|
static |
Definition at line 1258 of file ip_mroute.c.
Referenced by bw_upcalls_send(), ip_mdq(), pim_register_send_upcall(), and X_ip_mforward().
|
static |
Definition at line 2691 of file ip_mroute.c.
References mfchashsize, MRW_RLOCK, MRW_RUNLOCK, and V_mfchashtbl.
SYSCTL_NODE | ( | _net_inet | , |
IPPROTO_PIM | , | ||
pim | , | ||
CTLFLAG_RW| | CTLFLAG_MPSAFE, | ||
0 | , | ||
"PIM" | |||
) |
|
static |
SYSCTL_PROC | ( | _net_inet_ip | , |
OID_AUTO | , | ||
viftable | , | ||
CTLTYPE_OPAQUE|CTLFLAG_VNET|CTLFLAG_RD| | CTLFLAG_MPSAFE, | ||
NULL | , | ||
0 | , | ||
sysctl_viflist | , | ||
" | S, | ||
vif" | [MAXVIFS], | ||
"IPv4 Multicast Interfaces (struct vif[MAXVIFS], netinet/ip_mroute.h)" | |||
) |
SYSCTL_ULONG | ( | _net_inet_pim | , |
OID_AUTO | , | ||
squelch_wholepkt | , | ||
CTLFLAG_RW | , | ||
& | pim_squelch_wholepkt, | ||
0 | , | ||
"Disable IGMP_WHOLEPKT notifications if rendezvous point is unspecified" | |||
) |
|
static |
Definition at line 2723 of file ip_mroute.c.
References MAXVIFS, MRW_RLOCK, MRW_RUNLOCK, and V_viftable.
SYSCTL_VNET_PCPUSTAT | ( | _net_inet_ip | , |
OID_AUTO | , | ||
mrtstat | , | ||
struct mrtstat | , | ||
mrtstat | , | ||
"IPv4 Multicast Forwarding Statistics (struct mrtstat, " "netinet/ip_mroute.h)" | |||
) |
SYSCTL_VNET_PCPUSTAT | ( | _net_inet_pim | , |
PIMCTL_STATS | , | ||
stats | , | ||
struct pimstat | , | ||
pimstat | , | ||
"PIM Statistics (struct pimstat, netinet/pim_var.h)" | |||
) |
Definition at line 1059 of file ip_mroute.c.
References INADDR_ANY, mfc::mfc_flags, mfc::mfc_parent, mfc::mfc_rp, mfc::mfc_ttls, mfcctl2::mfcc_flags, mfcctl2::mfcc_parent, mfcctl2::mfcc_rp, mfcctl2::mfcc_ttls, MRT_MFC_FLAGS_ALL, MRT_MFC_RP, in_addr::s_addr, V_mrt_api_config, and V_numvifs.
Referenced by add_mfc(), and init_mfc_params().
VNET_DEFINE_STATIC | ( | int | , |
pim_assert_enabled | |||
) |
VNET_DEFINE_STATIC | ( | struct buf_ring * | , |
bw_upcalls_ring | |||
) |
VNET_DEFINE_STATIC | ( | struct callout | , |
bw_upcalls_ch | |||
) |
VNET_DEFINE_STATIC | ( | struct callout | , |
expire_upcalls_ch | |||
) |
VNET_DEFINE_STATIC | ( | struct ifnet * | , |
multicast_register_if | |||
) |
VNET_DEFINE_STATIC | ( | struct mtx | , |
buf_ring_mtx | |||
) |
VNET_DEFINE_STATIC | ( | struct mtx | , |
bw_upcalls_ring_mtx | |||
) |
VNET_DEFINE_STATIC | ( | struct task | , |
task | |||
) |
VNET_DEFINE_STATIC | ( | struct taskqueue * | , |
task_queue | |||
) |
VNET_DEFINE_STATIC | ( | struct vif * | , |
viftable | |||
) |
VNET_DEFINE_STATIC | ( | u_char * | , |
nexpire | |||
) |
VNET_DEFINE_STATIC | ( | u_long | , |
mfchash | |||
) |
VNET_DEFINE_STATIC | ( | uint32_t | , |
mrt_api_config | |||
) |
VNET_DEFINE_STATIC | ( | vifi_t | , |
numvifs | |||
) |
VNET_DEFINE_STATIC | ( | vifi_t | , |
reg_vif_num | |||
) |
|
static |
Definition at line 2747 of file ip_mroute.c.
References MAXVIFS, mfchashsize, mrouter_mtx, V_bw_upcalls_ch, V_expire_upcalls_ch, V_nexpire, V_task_queue, and V_viftable.
|
static |
Definition at line 2768 of file ip_mroute.c.
References V_nexpire, V_task_queue, and V_viftable.
VNET_PCPUSTAT_SYSINIT | ( | mrtstat | ) |
VNET_PCPUSTAT_SYSINIT | ( | pimstat | ) |
VNET_PCPUSTAT_SYSUNINIT | ( | mrtstat | ) |
VNET_PCPUSTAT_SYSUNINIT | ( | pimstat | ) |
VNET_SYSINIT | ( | vnet_mroute_init | , |
SI_SUB_PROTO_MC | , | ||
SI_ORDER_ANY | , | ||
vnet_mroute_init | , | ||
NULL | |||
) |
VNET_SYSUNINIT | ( | vnet_mroute_uninit | , |
SI_SUB_PROTO_MC | , | ||
SI_ORDER_MIDDLE | , | ||
vnet_mroute_uninit | , | ||
NULL | |||
) |
|
static |
Definition at line 1710 of file ip_mroute.c.
References INADDR_ANY, MRW_RLOCK, MRW_RUNLOCK, V_numvifs, and V_viftable.
Referenced by ip_mroute_modevent().
|
static |
Definition at line 1287 of file ip_mroute.c.
References rtdetq::ifp, IGMPMSG_NOCACHE, igmpmsg::im_mbz, igmpmsg::im_msgtype, igmpmsg::im_vif, in_hosteq, INADDR_ANY, ip::ip_dst, ip::ip_hl, ip_mdq(), ip::ip_ttl, IPOPT_LSRR, KTR_IPMF, rtdetq::m, MAXTTL, mfc_alloc(), mfc::mfc_bw_meter_geq, mfc::mfc_bw_meter_leq, mfc::mfc_byte_cnt, mfc::mfc_expire, mfc_find(), mfc::mfc_flags, mfc::mfc_last_assert, mfc::mfc_mcastgrp, mfc::mfc_origin, mfc::mfc_parent, mfc::mfc_pkt_cnt, mfc::mfc_rp, mfc::mfc_stall_ring, mfc::mfc_ttls, mfc::mfc_wrong_if, MFCHASH, MRTSTAT_INC, MRW_LOCK_TRY_UPGRADE, MRW_RLOCK, MRW_RUNLOCK, MRW_UNLOCK, MRW_WLOCK, MRW_WOWNED, MRW_WUNLOCK, in_addr::s_addr, sockaddr_in::sin_addr, socket_send(), TUNNEL_LEN, UPCALL_EXPIRE, V_ip_mrouter, V_mfchashtbl, V_nexpire, V_numvifs, and V_viftable.
Referenced by ip_mroute_modevent().
|
static |
Definition at line 748 of file ip_mroute.c.
References expire_mfc(), in_nullhost, ip_mrouter_cnt, KTR_IPMF, MAXVIFS, mfchashsize, MRW_WLOCK, MRW_WUNLOCK, V_buf_ring_mtx, V_bw_upcalls_ch, V_bw_upcalls_ring, V_bw_upcalls_ring_mtx, V_expire_upcalls_ch, V_ip_mrouter, V_mfchashtbl, V_mrt_api_config, V_nexpire, V_numvifs, V_pim_assert_enabled, V_reg_vif_num, V_task, V_task_queue, V_viftable, VIFF_REGISTER, VIFF_TUNNEL, and VIFI_INVALID.
Referenced by ip_mroute_modevent().
|
static |
Definition at line 512 of file ip_mroute.c.
References MRT_API_CONFIG, mrt_api_support, MRT_API_SUPPORT, mrt_api_version, MRT_ASSERT, MRT_VERSION, V_mrt_api_config, and V_pim_assert_enabled.
Referenced by ip_mroute_modevent().
|
static |
Definition at line 412 of file ip_mroute.c.
References add_bw_upcall(), add_mfc(), add_vif(), del_bw_upcall(), del_mfc(), del_vif(), ip_mrouter_done, ip_mrouter_init(), MRT_ADD_BW_UPCALL, MRT_ADD_MFC, MRT_ADD_VIF, MRT_API_CONFIG, MRT_API_FLAGS_ALL, MRT_ASSERT, MRT_DEL_BW_UPCALL, MRT_DEL_MFC, MRT_DEL_VIF, MRT_DONE, MRT_INIT, set_api_config(), set_assert(), V_ip_mrouter, and V_mrt_api_config.
Referenced by ip_mroute_modevent().
|
static |
Definition at line 1785 of file ip_mroute.c.
Referenced by ip_mroute_modevent().
|
static |
Definition at line 1778 of file ip_mroute.c.
Referenced by ip_mroute_modevent().
|
static |
Definition at line 1690 of file ip_mroute.c.
References MRW_RLOCK, MRW_RUNLOCK, and V_numvifs.
Referenced by ip_mroute_modevent().
|
static |
Definition at line 545 of file ip_mroute.c.
References get_sg_cnt(), and get_vif_cnt().
|
static |
|
static |
Definition at line 1791 of file ip_mroute.c.
References V_rsvp_on.
Referenced by ip_mroute_modevent().
|
static |
Definition at line 191 of file ip_mroute.c.
Referenced by ip_mroute_modevent().
|
extern |
Definition at line 188 of file in_mcast.c.
Referenced by send_packet().
|
static |
Definition at line 2878 of file ip_mroute.c.
|
static |
Definition at line 159 of file ip_mroute.c.
Referenced by ip_mroute_modevent(), ip_mrouter_init(), and X_ip_mrouter_done().
|
static |
Definition at line 160 of file ip_mroute.c.
Referenced by ip_mroute_modevent(), and ip_mrouter_init().
|
static |
Definition at line 240 of file ip_mroute.c.
Referenced by ip_mroute_modevent().
|
static |
Definition at line 176 of file ip_mroute.c.
Referenced by expire_upcalls(), if_detached_event(), ip_mroute_modevent(), ip_mrouter_init(), set_api_config(), sysctl_mfctable(), vnet_mroute_init(), and X_ip_mrouter_done().
|
static |
Definition at line 145 of file ip_mroute.c.
Referenced by add_bw_upcall(), and vnet_mroute_init().
|
static |
Definition at line 354 of file ip_mroute.c.
Referenced by set_api_config(), and X_ip_mrouter_get().
|
static |
Definition at line 353 of file ip_mroute.c.
Referenced by X_ip_mrouter_get().
|
static |
Definition at line 362 of file ip_mroute.c.
Referenced by ip_mdq().
|
static |
Definition at line 234 of file ip_mroute.c.
Referenced by ip_mroute_modevent().
|
static |
Definition at line 265 of file ip_mroute.c.
Referenced by pim_register_prepare(), and pim_register_send_rp().
|
static |
Definition at line 282 of file ip_mroute.c.
Referenced by pim_register_send_rp().
|
static |
Definition at line 229 of file ip_mroute.c.
Referenced by ip_mroute_modevent(), and pim_register_send().