xref: /netbsd-src/sys/net/if_srt.h (revision 1fbab01a9353563bcc435f692ca5268e5626005a)
1 #ifndef _IF_SRT_H_1b91f8f1_
2 #define _IF_SRT_H_1b91f8f1_
3 
4 /* $NetBSD: if_srt.h,v 1.4 2015/09/06 06:01:01 dholland Exp $ */
5 
6 /* This file is in the public domain. */
7 
8 #include <sys/ioccom.h> /* for _IOR etc */
9 #include <net/if.h> /* XXX for IFNAMSIZ */
10 #include <netinet/in.h> /* for in_addr/in6_addr */
11 
12 struct srt_rt {
13 	unsigned int inx;
14 	int af;
15 	union {
16 		struct in_addr v4;
17 		struct in6_addr v6;
18 	} srcmatch;
19 	unsigned int srcmask;
20 	union {
21 		struct ifnet *dstifp;
22 		char dstifn[IFNAMSIZ];
23 	} u;
24 	union {
25 		struct sockaddr_in sin;
26 		struct sockaddr_in6 sin6;
27 		struct sockaddr sa;
28 	} dst;
29 };
30 
31 /* Gets the number of slots in the rts array */
32 #define SRT_GETNRT _IOR('e',0,unsigned int)
33 
34 /* Gets an rt entry, given the slot number in the inx field */
35 #define SRT_GETRT  _IOWR('e',1,struct srt_rt)
36 
37 /* Sets an rt entry; inx must be either in the array or one past it */
38 #define SRT_SETRT  _IOW('e',2,struct srt_rt)
39 
40 /* Delete an rt entry by index; shifts the rest down */
41 #define SRT_DELRT  _IOW('e',3,unsigned int)
42 
43 /* Set flag bits */
44 #define SRT_SFLAGS _IOW('e',4,unsigned int)
45 
46 /* Get flag bits */
47 #define SRT_GFLAGS _IOR('e',5,unsigned int)
48 
49 /* Atomically replace flag bits */
50 #define SRT_SGFLAGS _IOWR('e',6,unsigned int)
51 
52 /* Do debugging tasks (not documented here - see the source) */
53 #define SRT_DEBUG _IOW('e',7,void *)
54 
55 /* Flag bits for SRT_*FLAGS */
56 #define SSF_MTULOCK 0x00000001 /* don't auto-update MTU */
57 /* Some flags are global; some are per-unit. */
58 #define SSF_GLOBAL (0)
59 
60 #endif
61