aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/include/generic-netbsd/net/if_srt.h
blob: b0c3e11cbdd1298c5936204958d359013535000a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef _IF_SRT_H_1b91f8f1_
#define _IF_SRT_H_1b91f8f1_

/* $NetBSD: if_srt.h,v 1.4 2015/09/06 06:01:01 dholland Exp $ */

/* This file is in the public domain. */

#include <sys/ioccom.h> /* for _IOR etc */
#include <net/if.h> /* XXX for IFNAMSIZ */
#include <netinet/in.h> /* for in_addr/in6_addr */

struct srt_rt {
	unsigned int inx;
	int af;
	union {
		struct in_addr v4;
		struct in6_addr v6;
	} srcmatch;
	unsigned int srcmask;
	union {
		struct ifnet *dstifp;
		char dstifn[IFNAMSIZ];
	} u;
	union {
		struct sockaddr_in sin;
		struct sockaddr_in6 sin6;
		struct sockaddr sa;
	} dst;
};

/* Gets the number of slots in the rts array */
#define SRT_GETNRT _IOR('e',0,unsigned int)

/* Gets an rt entry, given the slot number in the inx field */
#define SRT_GETRT  _IOWR('e',1,struct srt_rt)

/* Sets an rt entry; inx must be either in the array or one past it */
#define SRT_SETRT  _IOW('e',2,struct srt_rt)

/* Delete an rt entry by index; shifts the rest down */
#define SRT_DELRT  _IOW('e',3,unsigned int)

/* Set flag bits */
#define SRT_SFLAGS _IOW('e',4,unsigned int)

/* Get flag bits */
#define SRT_GFLAGS _IOR('e',5,unsigned int)

/* Atomically replace flag bits */
#define SRT_SGFLAGS _IOWR('e',6,unsigned int)

/* Do debugging tasks (not documented here - see the source) */
#define SRT_DEBUG _IOW('e',7,void *)

/* Flag bits for SRT_*FLAGS */
#define SSF_MTULOCK 0x00000001 /* don't auto-update MTU */
/* Some flags are global; some are per-unit. */
#define SSF_GLOBAL (0)

#endif