1 #ifndef __LINUX_MROUTE_H
2 #define __LINUX_MROUTE_H
3
4
5
6
7
8
9
10
11 #define MRT_BASE 200
12 #define MRT_INIT (MRT_BASE)
13 #define MRT_DONE (MRT_BASE+1)
14 #define MRT_ADD_VIF (MRT_BASE+2)
15 #define MRT_DEL_VIF (MRT_BASE+3)
16 #define MRT_ADD_MFC (MRT_BASE+4)
17 #define MRT_DEL_MFC (MRT_BASE+5)
18 #define MRT_VERSION (MRT_BASE+6)
19 #define MRT_ASSERT (MRT_BASE+7)
20
21 #define SIOCGETVIFCNT SIOCPROTOPRIVATE
22 #define SIOCGETSGCNT (SIOCPROTOPRIVATE+1)
23
24 #define MAXVIFS 32
25 typedef unsigned long vifbitmap_t;
26 typedef unsigned short vifi_t;
27 #define ALL_VIFS ((vifi_t)(-1))
28
29
30
31
32
33 #define VIFM_SET(n,m) ((m)|=(1<<(n)))
34 #define VIFM_CLR(n,m) ((m)&=~(1<<(n)))
35 #define VIFM_ISSET(n,m) ((m)&(1<<(n)))
36 #define VIFM_CLRALL(m) ((m)=0)
37 #define VIFM_COPY(mfrom,mto) ((mto)=(mfrom))
38 #define VIFM_SAME(m1,m2) ((m1)==(m2))
39
40
41
42
43
44
45 struct vifctl {
46 vifi_t vifc_vifi;
47 unsigned char vifc_flags;
48 unsigned char vifc_threshold;
49 unsigned int vifc_rate_limit;
50 struct in_addr vifc_lcl_addr;
51 struct in_addr vifc_rmt_addr;
52 };
53
54 #define VIFF_TUNNEL 0x1
55 #define VIFF_SRCRT 0x02
56
57
58
59
60
61 struct mfcctl
62 {
63 struct in_addr mfcc_origin;
64 struct in_addr mfcc_mcastgrp;
65 vifi_t mfcc_parent;
66 unsigned char mfcc_ttls[MAXVIFS];
67 };
68
69
70
71
72
73 struct sioc_sg_req
74 {
75 struct in_addr src;
76 struct in_addr grp;
77 unsigned long pktcnt;
78 unsigned long bytecnt;
79 unsigned long wrong_if;
80 };
81
82
83
84
85
86 struct sioc_vif_req
87 {
88 vifi_t vifi;
89 unsigned long icount;
90 unsigned long ocount;
91 unsigned long ibytes;
92 unsigned long obytes;
93 };
94
95
96
97
98
99
100 struct igmpmsg
101 {
102 unsigned long unused1,unused2;
103 unsigned char im_msgtype;
104 unsigned char im_mbz;
105 unsigned char im_vif;
106 unsigned char unused3;
107 struct in_addr im_src,im_dst;
108 };
109
110
111
112
113
114 #ifdef __KERNEL__
115 extern struct sock *mroute_socket;
116 extern int ip_mroute_setsockopt(struct sock *, int, char *, int);
117 extern int ip_mroute_getsockopt(struct sock *, int, char *, int *);
118 extern int ipmr_ioctl(struct sock *sk, int cmd, unsigned long arg);
119 extern void mroute_close(struct sock *sk);
120
121 struct vif_device
122 {
123 struct device *dev;
124 struct route *rt_cache;
125 unsigned long bytes_in,bytes_out;
126 unsigned long pkt_in,pkt_out;
127 unsigned long rate_limit;
128 unsigned char threshold;
129 unsigned short flags;
130 unsigned long local,remote;
131 };
132
133 #endif
134 #endif