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