FreeBSD kernel IPv4 code
ip_mroute.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  vifctl
 
struct  mfcctl
 
struct  mfcctl2
 
struct  bw_data
 
struct  bw_upcall
 
struct  mrtstat
 
struct  sioc_sg_req
 
struct  sioc_vif_req
 
struct  vif
 
struct  mfc
 
struct  igmpmsg
 
struct  rtdetq
 
struct  bw_meter
 

Macros

#define MRT_INIT   100 /* initialize forwarder */
 
#define MRT_DONE   101 /* shut down forwarder */
 
#define MRT_ADD_VIF   102 /* create virtual interface */
 
#define MRT_DEL_VIF   103 /* delete virtual interface */
 
#define MRT_ADD_MFC   104 /* insert forwarding cache entry */
 
#define MRT_DEL_MFC   105 /* delete forwarding cache entry */
 
#define MRT_VERSION   106 /* get kernel version number */
 
#define MRT_ASSERT   107 /* enable assert processing */
 
#define MRT_PIM   MRT_ASSERT /* enable PIM processing */
 
#define MRT_API_SUPPORT   109 /* supported MRT API */
 
#define MRT_API_CONFIG   110 /* config MRT API */
 
#define MRT_ADD_BW_UPCALL   111 /* create bandwidth monitor */
 
#define MRT_DEL_BW_UPCALL   112 /* delete bandwidth monitor */
 
#define MAXVIFS   32
 
#define ALL_VIFS   (vifi_t)-1
 
#define VIFM_SET(n, m)   ((m) |= (1 << (n)))
 
#define VIFM_CLR(n, m)   ((m) &= ~(1 << (n)))
 
#define VIFM_ISSET(n, m)   ((m) & (1 << (n)))
 
#define VIFM_CLRALL(m)   ((m) = 0x00000000)
 
#define VIFM_COPY(mfrom, mto)   ((mto) = (mfrom))
 
#define VIFM_SAME(m1, m2)   ((m1) == (m2))
 
#define VIFF_TUNNEL   0x1 /* no-op; retained for old source */
 
#define VIFF_SRCRT   0x2 /* no-op; retained for old source */
 
#define VIFF_REGISTER   0x4 /* used for PIM Register encap/decap */
 
#define MRT_MFC_FLAGS_DISABLE_WRONGVIF   (1 << 0) /* disable WRONGVIF signals */
 
#define MRT_MFC_FLAGS_BORDER_VIF   (1 << 1) /* border vif */
 
#define MRT_MFC_RP   (1 << 8) /* enable RP address */
 
#define MRT_MFC_BW_UPCALL   (1 << 9) /* enable bw upcalls */
 
#define MRT_MFC_FLAGS_ALL
 
#define MRT_API_FLAGS_ALL
 
#define BW_UPCALL_UNIT_PACKETS   (1 << 0) /* threshold (in packets) */
 
#define BW_UPCALL_UNIT_BYTES   (1 << 1) /* threshold (in bytes) */
 
#define BW_UPCALL_GEQ   (1 << 2) /* upcall if bw >= threshold */
 
#define BW_UPCALL_LEQ   (1 << 3) /* upcall if bw <= threshold */
 
#define BW_UPCALL_DELETE_ALL   (1 << 4) /* delete all upcalls for s,d*/
 
#define BW_UPCALLS_MAX   1024
 
#define BW_UPCALL_THRESHOLD_INTERVAL_MIN_SEC   3
 
#define BW_UPCALL_THRESHOLD_INTERVAL_MIN_USEC   0
 
#define MRTSTAT_ADD(name, val)    VNET_PCPUSTAT_ADD(struct mrtstat, mrtstat, name, (val))
 
#define MRTSTAT_INC(name)   MRTSTAT_ADD(name, 1)
 
#define IGMPMSG_NOCACHE   1 /* no MFC in the kernel */
 
#define IGMPMSG_WRONGVIF   2 /* packet came from wrong interface */
 
#define IGMPMSG_WHOLEPKT   3 /* PIM pkt for user level encap. */
 
#define IGMPMSG_BW_UPCALL   4 /* BW monitoring upcall */
 
#define MAX_UPQ   4 /* max. no of pkts in upcall Q */
 
#define BW_METER_UNIT_PACKETS   (1 << 0) /* threshold (in packets) */
 
#define BW_METER_UNIT_BYTES   (1 << 1) /* threshold (in bytes) */
 
#define BW_METER_GEQ   (1 << 2) /* upcall if bw >= threshold */
 
#define BW_METER_LEQ   (1 << 3) /* upcall if bw <= threshold */
 
#define BW_METER_USER_FLAGS
 
#define BW_METER_UPCALL_DELIVERED   (1 << 24) /* upcall was delivered */
 

Typedefs

typedef u_long vifbitmap_t
 
typedef u_short vifi_t
 

Variables

int(* ip_mrouter_set )(struct socket *, struct sockopt *)
 
int(* ip_mrouter_get )(struct socket *, struct sockopt *)
 
int(* ip_mrouter_done )(void)
 
int(* mrt_ioctl )(u_long, caddr_t, int)
 

Macro Definition Documentation

◆ ALL_VIFS

#define ALL_VIFS   (vifi_t)-1

Definition at line 80 of file ip_mroute.h.

◆ BW_METER_GEQ

#define BW_METER_GEQ   (1 << 2) /* upcall if bw >= threshold */

Definition at line 340 of file ip_mroute.h.

◆ BW_METER_LEQ

#define BW_METER_LEQ   (1 << 3) /* upcall if bw <= threshold */

Definition at line 341 of file ip_mroute.h.

◆ BW_METER_UNIT_BYTES

#define BW_METER_UNIT_BYTES   (1 << 1) /* threshold (in bytes) */

Definition at line 339 of file ip_mroute.h.

◆ BW_METER_UNIT_PACKETS

#define BW_METER_UNIT_PACKETS   (1 << 0) /* threshold (in packets) */

Definition at line 338 of file ip_mroute.h.

◆ BW_METER_UPCALL_DELIVERED

#define BW_METER_UPCALL_DELIVERED   (1 << 24) /* upcall was delivered */

Definition at line 347 of file ip_mroute.h.

◆ BW_METER_USER_FLAGS

#define BW_METER_USER_FLAGS
Value:
BW_METER_UNIT_BYTES | \
BW_METER_GEQ | \
BW_METER_LEQ)
#define BW_METER_UNIT_PACKETS
Definition: ip_mroute.h:338

Definition at line 342 of file ip_mroute.h.

◆ BW_UPCALL_DELETE_ALL

#define BW_UPCALL_DELETE_ALL   (1 << 4) /* delete all upcalls for s,d*/

Definition at line 196 of file ip_mroute.h.

◆ BW_UPCALL_GEQ

#define BW_UPCALL_GEQ   (1 << 2) /* upcall if bw >= threshold */

Definition at line 194 of file ip_mroute.h.

◆ BW_UPCALL_LEQ

#define BW_UPCALL_LEQ   (1 << 3) /* upcall if bw <= threshold */

Definition at line 195 of file ip_mroute.h.

◆ BW_UPCALL_THRESHOLD_INTERVAL_MIN_SEC

#define BW_UPCALL_THRESHOLD_INTERVAL_MIN_SEC   3

Definition at line 204 of file ip_mroute.h.

◆ BW_UPCALL_THRESHOLD_INTERVAL_MIN_USEC

#define BW_UPCALL_THRESHOLD_INTERVAL_MIN_USEC   0

Definition at line 205 of file ip_mroute.h.

◆ BW_UPCALL_UNIT_BYTES

#define BW_UPCALL_UNIT_BYTES   (1 << 1) /* threshold (in bytes) */

Definition at line 193 of file ip_mroute.h.

◆ BW_UPCALL_UNIT_PACKETS

#define BW_UPCALL_UNIT_PACKETS   (1 << 0) /* threshold (in packets) */

Definition at line 192 of file ip_mroute.h.

◆ BW_UPCALLS_MAX

#define BW_UPCALLS_MAX   1024

Definition at line 202 of file ip_mroute.h.

◆ IGMPMSG_BW_UPCALL

#define IGMPMSG_BW_UPCALL   4 /* BW monitoring upcall */

Definition at line 309 of file ip_mroute.h.

◆ IGMPMSG_NOCACHE

#define IGMPMSG_NOCACHE   1 /* no MFC in the kernel */

Definition at line 306 of file ip_mroute.h.

◆ IGMPMSG_WHOLEPKT

#define IGMPMSG_WHOLEPKT   3 /* PIM pkt for user level encap. */

Definition at line 308 of file ip_mroute.h.

◆ IGMPMSG_WRONGVIF

#define IGMPMSG_WRONGVIF   2 /* packet came from wrong interface */

Definition at line 307 of file ip_mroute.h.

◆ MAX_UPQ

#define MAX_UPQ   4 /* max. no of pkts in upcall Q */

Definition at line 326 of file ip_mroute.h.

◆ MAXVIFS

#define MAXVIFS   32

Definition at line 77 of file ip_mroute.h.

◆ MRT_ADD_BW_UPCALL

#define MRT_ADD_BW_UPCALL   111 /* create bandwidth monitor */

Definition at line 71 of file ip_mroute.h.

◆ MRT_ADD_MFC

#define MRT_ADD_MFC   104 /* insert forwarding cache entry */

Definition at line 64 of file ip_mroute.h.

◆ MRT_ADD_VIF

#define MRT_ADD_VIF   102 /* create virtual interface */

Definition at line 62 of file ip_mroute.h.

◆ MRT_API_CONFIG

#define MRT_API_CONFIG   110 /* config MRT API */

Definition at line 70 of file ip_mroute.h.

◆ MRT_API_FLAGS_ALL

#define MRT_API_FLAGS_ALL
Value:
MRT_MFC_RP | \
MRT_MFC_BW_UPCALL)
#define MRT_MFC_FLAGS_ALL
Definition: ip_mroute.h:144

Definition at line 146 of file ip_mroute.h.

◆ MRT_API_SUPPORT

#define MRT_API_SUPPORT   109 /* supported MRT API */

Definition at line 69 of file ip_mroute.h.

◆ MRT_ASSERT

#define MRT_ASSERT   107 /* enable assert processing */

Definition at line 67 of file ip_mroute.h.

◆ MRT_DEL_BW_UPCALL

#define MRT_DEL_BW_UPCALL   112 /* delete bandwidth monitor */

Definition at line 72 of file ip_mroute.h.

◆ MRT_DEL_MFC

#define MRT_DEL_MFC   105 /* delete forwarding cache entry */

Definition at line 65 of file ip_mroute.h.

◆ MRT_DEL_VIF

#define MRT_DEL_VIF   103 /* delete virtual interface */

Definition at line 63 of file ip_mroute.h.

◆ MRT_DONE

#define MRT_DONE   101 /* shut down forwarder */

Definition at line 61 of file ip_mroute.h.

◆ MRT_INIT

#define MRT_INIT   100 /* initialize forwarder */

Definition at line 60 of file ip_mroute.h.

◆ MRT_MFC_BW_UPCALL

#define MRT_MFC_BW_UPCALL   (1 << 9) /* enable bw upcalls */

Definition at line 143 of file ip_mroute.h.

◆ MRT_MFC_FLAGS_ALL

#define MRT_MFC_FLAGS_ALL
Value:
MRT_MFC_FLAGS_BORDER_VIF)
#define MRT_MFC_FLAGS_DISABLE_WRONGVIF
Definition: ip_mroute.h:140

Definition at line 144 of file ip_mroute.h.

◆ MRT_MFC_FLAGS_BORDER_VIF

#define MRT_MFC_FLAGS_BORDER_VIF   (1 << 1) /* border vif */

Definition at line 141 of file ip_mroute.h.

◆ MRT_MFC_FLAGS_DISABLE_WRONGVIF

#define MRT_MFC_FLAGS_DISABLE_WRONGVIF   (1 << 0) /* disable WRONGVIF signals */

Definition at line 140 of file ip_mroute.h.

◆ MRT_MFC_RP

#define MRT_MFC_RP   (1 << 8) /* enable RP address */

Definition at line 142 of file ip_mroute.h.

◆ MRT_PIM

#define MRT_PIM   MRT_ASSERT /* enable PIM processing */

Definition at line 68 of file ip_mroute.h.

◆ MRT_VERSION

#define MRT_VERSION   106 /* get kernel version number */

Definition at line 66 of file ip_mroute.h.

◆ MRTSTAT_ADD

#define MRTSTAT_ADD (   name,
  val 
)     VNET_PCPUSTAT_ADD(struct mrtstat, mrtstat, name, (val))

Definition at line 227 of file ip_mroute.h.

◆ MRTSTAT_INC

#define MRTSTAT_INC (   name)    MRTSTAT_ADD(name, 1)

Definition at line 229 of file ip_mroute.h.

◆ VIFF_REGISTER

#define VIFF_REGISTER   0x4 /* used for PIM Register encap/decap */

Definition at line 106 of file ip_mroute.h.

◆ VIFF_SRCRT

#define VIFF_SRCRT   0x2 /* no-op; retained for old source */

Definition at line 105 of file ip_mroute.h.

◆ VIFF_TUNNEL

#define VIFF_TUNNEL   0x1 /* no-op; retained for old source */

Definition at line 104 of file ip_mroute.h.

◆ VIFM_CLR

#define VIFM_CLR (   n,
 
)    ((m) &= ~(1 << (n)))

Definition at line 83 of file ip_mroute.h.

◆ VIFM_CLRALL

#define VIFM_CLRALL (   m)    ((m) = 0x00000000)

Definition at line 85 of file ip_mroute.h.

◆ VIFM_COPY

#define VIFM_COPY (   mfrom,
  mto 
)    ((mto) = (mfrom))

Definition at line 86 of file ip_mroute.h.

◆ VIFM_ISSET

#define VIFM_ISSET (   n,
 
)    ((m) & (1 << (n)))

Definition at line 84 of file ip_mroute.h.

◆ VIFM_SAME

#define VIFM_SAME (   m1,
  m2 
)    ((m1) == (m2))

Definition at line 87 of file ip_mroute.h.

◆ VIFM_SET

#define VIFM_SET (   n,
 
)    ((m) |= (1 << (n)))

Definition at line 82 of file ip_mroute.h.

Typedef Documentation

◆ vifbitmap_t

typedef u_long vifbitmap_t

Definition at line 78 of file ip_mroute.h.

◆ vifi_t

typedef u_short vifi_t

Definition at line 79 of file ip_mroute.h.

Variable Documentation

◆ ip_mrouter_done

int(* ip_mrouter_done) (void) ( void  )
extern

◆ ip_mrouter_get

int(* ip_mrouter_get) (struct socket *, struct sockopt *) ( struct socket *  ,
struct sockopt *   
)
extern

Referenced by ip_mroute_modevent().

◆ ip_mrouter_set

int(* ip_mrouter_set) (struct socket *, struct sockopt *) ( struct socket *  ,
struct sockopt *   
)
extern

Referenced by ip_mroute_modevent().

◆ mrt_ioctl

int(* mrt_ioctl) (u_long, caddr_t, int) ( u_long  ,
caddr_t  ,
int   
)
extern

Referenced by ip_mroute_modevent().