1
2 #ifndef _UAPI__LINUX_MROUTE_H
3 #define _UAPI__LINUX_MROUTE_H
4
5 #include <linux/sockios.h>
6 #include <linux/types.h>
7 #include <linux/in.h>
8
9
10
11
12
13
14
15
16
17
18 #define MRT_BASE 200
19 #define MRT_INIT (MRT_BASE)
20 #define MRT_DONE (MRT_BASE+1)
21 #define MRT_ADD_VIF (MRT_BASE+2)
22 #define MRT_DEL_VIF (MRT_BASE+3)
23 #define MRT_ADD_MFC (MRT_BASE+4)
24 #define MRT_DEL_MFC (MRT_BASE+5)
25 #define MRT_VERSION (MRT_BASE+6)
26 #define MRT_ASSERT (MRT_BASE+7)
27 #define MRT_PIM (MRT_BASE+8)
28 #define MRT_TABLE (MRT_BASE+9)
29 #define MRT_ADD_MFC_PROXY (MRT_BASE+10)
30 #define MRT_DEL_MFC_PROXY (MRT_BASE+11)
31 #define MRT_FLUSH (MRT_BASE+12)
32 #define MRT_MAX (MRT_BASE+12)
33
34 #define SIOCGETVIFCNT SIOCPROTOPRIVATE
35 #define SIOCGETSGCNT (SIOCPROTOPRIVATE+1)
36 #define SIOCGETRPF (SIOCPROTOPRIVATE+2)
37
38
39 #define MRT_FLUSH_MFC 1
40 #define MRT_FLUSH_MFC_STATIC 2
41 #define MRT_FLUSH_VIFS 4
42 #define MRT_FLUSH_VIFS_STATIC 8
43
44 #define MAXVIFS 32
45 typedef unsigned long vifbitmap_t;
46 typedef unsigned short vifi_t;
47 #define ALL_VIFS ((vifi_t)(-1))
48
49
50
51 #define VIFM_SET(n,m) ((m)|=(1<<(n)))
52 #define VIFM_CLR(n,m) ((m)&=~(1<<(n)))
53 #define VIFM_ISSET(n,m) ((m)&(1<<(n)))
54 #define VIFM_CLRALL(m) ((m)=0)
55 #define VIFM_COPY(mfrom,mto) ((mto)=(mfrom))
56 #define VIFM_SAME(m1,m2) ((m1)==(m2))
57
58
59
60
61 struct vifctl {
62 vifi_t vifc_vifi;
63 unsigned char vifc_flags;
64 unsigned char vifc_threshold;
65 unsigned int vifc_rate_limit;
66 union {
67 struct in_addr vifc_lcl_addr;
68 int vifc_lcl_ifindex;
69 };
70 struct in_addr vifc_rmt_addr;
71 };
72
73 #define VIFF_TUNNEL 0x1
74 #define VIFF_SRCRT 0x2
75 #define VIFF_REGISTER 0x4
76 #define VIFF_USE_IFINDEX 0x8
77
78
79
80 struct mfcctl {
81 struct in_addr mfcc_origin;
82 struct in_addr mfcc_mcastgrp;
83 vifi_t mfcc_parent;
84 unsigned char mfcc_ttls[MAXVIFS];
85 unsigned int mfcc_pkt_cnt;
86 unsigned int mfcc_byte_cnt;
87 unsigned int mfcc_wrong_if;
88 int mfcc_expire;
89 };
90
91
92 struct sioc_sg_req {
93 struct in_addr src;
94 struct in_addr grp;
95 unsigned long pktcnt;
96 unsigned long bytecnt;
97 unsigned long wrong_if;
98 };
99
100
101 struct sioc_vif_req {
102 vifi_t vifi;
103 unsigned long icount;
104 unsigned long ocount;
105 unsigned long ibytes;
106 unsigned long obytes;
107 };
108
109
110
111
112 struct igmpmsg {
113 __u32 unused1,unused2;
114 unsigned char im_msgtype;
115 unsigned char im_mbz;
116 unsigned char im_vif;
117 unsigned char unused3;
118 struct in_addr im_src,im_dst;
119 };
120
121
122 enum {
123 IPMRA_TABLE_UNSPEC,
124 IPMRA_TABLE_ID,
125 IPMRA_TABLE_CACHE_RES_QUEUE_LEN,
126 IPMRA_TABLE_MROUTE_REG_VIF_NUM,
127 IPMRA_TABLE_MROUTE_DO_ASSERT,
128 IPMRA_TABLE_MROUTE_DO_PIM,
129 IPMRA_TABLE_VIFS,
130 IPMRA_TABLE_MROUTE_DO_WRVIFWHOLE,
131 __IPMRA_TABLE_MAX
132 };
133 #define IPMRA_TABLE_MAX (__IPMRA_TABLE_MAX - 1)
134
135
136
137
138
139
140 enum {
141 IPMRA_VIF_UNSPEC,
142 IPMRA_VIF,
143 __IPMRA_VIF_MAX
144 };
145 #define IPMRA_VIF_MAX (__IPMRA_VIF_MAX - 1)
146
147
148 enum {
149 IPMRA_VIFA_UNSPEC,
150 IPMRA_VIFA_IFINDEX,
151 IPMRA_VIFA_VIF_ID,
152 IPMRA_VIFA_FLAGS,
153 IPMRA_VIFA_BYTES_IN,
154 IPMRA_VIFA_BYTES_OUT,
155 IPMRA_VIFA_PACKETS_IN,
156 IPMRA_VIFA_PACKETS_OUT,
157 IPMRA_VIFA_LOCAL_ADDR,
158 IPMRA_VIFA_REMOTE_ADDR,
159 IPMRA_VIFA_PAD,
160 __IPMRA_VIFA_MAX
161 };
162 #define IPMRA_VIFA_MAX (__IPMRA_VIFA_MAX - 1)
163
164
165 enum {
166 IPMRA_CREPORT_UNSPEC,
167 IPMRA_CREPORT_MSGTYPE,
168 IPMRA_CREPORT_VIF_ID,
169 IPMRA_CREPORT_SRC_ADDR,
170 IPMRA_CREPORT_DST_ADDR,
171 IPMRA_CREPORT_PKT,
172 __IPMRA_CREPORT_MAX
173 };
174 #define IPMRA_CREPORT_MAX (__IPMRA_CREPORT_MAX - 1)
175
176
177
178 #define MFC_ASSERT_THRESH (3*HZ)
179
180
181 #define IGMPMSG_NOCACHE 1
182 #define IGMPMSG_WRONGVIF 2
183 #define IGMPMSG_WHOLEPKT 3
184 #define IGMPMSG_WRVIFWHOLE 4
185
186 #endif