0001
0002 #ifndef _UAPI__LINUX_MROUTE_H
0003 #define _UAPI__LINUX_MROUTE_H
0004
0005 #include <linux/sockios.h>
0006 #include <linux/types.h>
0007 #include <linux/in.h> /* For struct in_addr. */
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #define MRT_BASE 200
0019 #define MRT_INIT (MRT_BASE)
0020 #define MRT_DONE (MRT_BASE+1)
0021 #define MRT_ADD_VIF (MRT_BASE+2)
0022 #define MRT_DEL_VIF (MRT_BASE+3)
0023 #define MRT_ADD_MFC (MRT_BASE+4)
0024 #define MRT_DEL_MFC (MRT_BASE+5)
0025 #define MRT_VERSION (MRT_BASE+6)
0026 #define MRT_ASSERT (MRT_BASE+7)
0027 #define MRT_PIM (MRT_BASE+8)
0028 #define MRT_TABLE (MRT_BASE+9)
0029 #define MRT_ADD_MFC_PROXY (MRT_BASE+10)
0030 #define MRT_DEL_MFC_PROXY (MRT_BASE+11)
0031 #define MRT_FLUSH (MRT_BASE+12)
0032 #define MRT_MAX (MRT_BASE+12)
0033
0034 #define SIOCGETVIFCNT SIOCPROTOPRIVATE
0035 #define SIOCGETSGCNT (SIOCPROTOPRIVATE+1)
0036 #define SIOCGETRPF (SIOCPROTOPRIVATE+2)
0037
0038
0039 #define MRT_FLUSH_MFC 1
0040 #define MRT_FLUSH_MFC_STATIC 2
0041 #define MRT_FLUSH_VIFS 4
0042 #define MRT_FLUSH_VIFS_STATIC 8
0043
0044 #define MAXVIFS 32
0045 typedef unsigned long vifbitmap_t;
0046 typedef unsigned short vifi_t;
0047 #define ALL_VIFS ((vifi_t)(-1))
0048
0049
0050
0051 #define VIFM_SET(n,m) ((m)|=(1<<(n)))
0052 #define VIFM_CLR(n,m) ((m)&=~(1<<(n)))
0053 #define VIFM_ISSET(n,m) ((m)&(1<<(n)))
0054 #define VIFM_CLRALL(m) ((m)=0)
0055 #define VIFM_COPY(mfrom,mto) ((mto)=(mfrom))
0056 #define VIFM_SAME(m1,m2) ((m1)==(m2))
0057
0058
0059
0060
0061 struct vifctl {
0062 vifi_t vifc_vifi;
0063 unsigned char vifc_flags;
0064 unsigned char vifc_threshold;
0065 unsigned int vifc_rate_limit;
0066 union {
0067 struct in_addr vifc_lcl_addr;
0068 int vifc_lcl_ifindex;
0069 };
0070 struct in_addr vifc_rmt_addr;
0071 };
0072
0073 #define VIFF_TUNNEL 0x1
0074 #define VIFF_SRCRT 0x2
0075 #define VIFF_REGISTER 0x4
0076 #define VIFF_USE_IFINDEX 0x8
0077
0078
0079
0080 struct mfcctl {
0081 struct in_addr mfcc_origin;
0082 struct in_addr mfcc_mcastgrp;
0083 vifi_t mfcc_parent;
0084 unsigned char mfcc_ttls[MAXVIFS];
0085 unsigned int mfcc_pkt_cnt;
0086 unsigned int mfcc_byte_cnt;
0087 unsigned int mfcc_wrong_if;
0088 int mfcc_expire;
0089 };
0090
0091
0092 struct sioc_sg_req {
0093 struct in_addr src;
0094 struct in_addr grp;
0095 unsigned long pktcnt;
0096 unsigned long bytecnt;
0097 unsigned long wrong_if;
0098 };
0099
0100
0101 struct sioc_vif_req {
0102 vifi_t vifi;
0103 unsigned long icount;
0104 unsigned long ocount;
0105 unsigned long ibytes;
0106 unsigned long obytes;
0107 };
0108
0109
0110
0111
0112 struct igmpmsg {
0113 __u32 unused1,unused2;
0114 unsigned char im_msgtype;
0115 unsigned char im_mbz;
0116 unsigned char im_vif;
0117 unsigned char im_vif_hi;
0118 struct in_addr im_src,im_dst;
0119 };
0120
0121
0122 enum {
0123 IPMRA_TABLE_UNSPEC,
0124 IPMRA_TABLE_ID,
0125 IPMRA_TABLE_CACHE_RES_QUEUE_LEN,
0126 IPMRA_TABLE_MROUTE_REG_VIF_NUM,
0127 IPMRA_TABLE_MROUTE_DO_ASSERT,
0128 IPMRA_TABLE_MROUTE_DO_PIM,
0129 IPMRA_TABLE_VIFS,
0130 IPMRA_TABLE_MROUTE_DO_WRVIFWHOLE,
0131 __IPMRA_TABLE_MAX
0132 };
0133 #define IPMRA_TABLE_MAX (__IPMRA_TABLE_MAX - 1)
0134
0135
0136
0137
0138
0139
0140 enum {
0141 IPMRA_VIF_UNSPEC,
0142 IPMRA_VIF,
0143 __IPMRA_VIF_MAX
0144 };
0145 #define IPMRA_VIF_MAX (__IPMRA_VIF_MAX - 1)
0146
0147
0148 enum {
0149 IPMRA_VIFA_UNSPEC,
0150 IPMRA_VIFA_IFINDEX,
0151 IPMRA_VIFA_VIF_ID,
0152 IPMRA_VIFA_FLAGS,
0153 IPMRA_VIFA_BYTES_IN,
0154 IPMRA_VIFA_BYTES_OUT,
0155 IPMRA_VIFA_PACKETS_IN,
0156 IPMRA_VIFA_PACKETS_OUT,
0157 IPMRA_VIFA_LOCAL_ADDR,
0158 IPMRA_VIFA_REMOTE_ADDR,
0159 IPMRA_VIFA_PAD,
0160 __IPMRA_VIFA_MAX
0161 };
0162 #define IPMRA_VIFA_MAX (__IPMRA_VIFA_MAX - 1)
0163
0164
0165 enum {
0166 IPMRA_CREPORT_UNSPEC,
0167 IPMRA_CREPORT_MSGTYPE,
0168 IPMRA_CREPORT_VIF_ID,
0169 IPMRA_CREPORT_SRC_ADDR,
0170 IPMRA_CREPORT_DST_ADDR,
0171 IPMRA_CREPORT_PKT,
0172 IPMRA_CREPORT_TABLE,
0173 __IPMRA_CREPORT_MAX
0174 };
0175 #define IPMRA_CREPORT_MAX (__IPMRA_CREPORT_MAX - 1)
0176
0177
0178
0179 #define MFC_ASSERT_THRESH (3*HZ)
0180
0181
0182 #define IGMPMSG_NOCACHE 1
0183 #define IGMPMSG_WRONGVIF 2
0184 #define IGMPMSG_WHOLEPKT 3
0185 #define IGMPMSG_WRVIFWHOLE 4
0186
0187 #endif