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