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