xref: /freebsd/contrib/wpa/src/common/linux_vlan.h (revision e6bfd18d21b225af6a0ed67ceeaf1293b7b9eba5)
1 /*
2  * Linux VLAN configuration kernel interface
3  * Copyright (c) 2016, Jouni Malinen <j@w1.fi>
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8 
9 #ifndef LINUX_VLAN_H
10 #define LINUX_VLAN_H
11 
12 /* This ioctl is defined in linux/sockios.h */
13 
14 #ifndef SIOCSIFVLAN
15 #define SIOCSIFVLAN 0x8983
16 #endif /* SIOCSIFVLAN */
17 
18 /* This interface is defined in linux/if_vlan.h */
19 
20 #define ADD_VLAN_CMD 0
21 #define DEL_VLAN_CMD 1
22 #define SET_VLAN_INGRESS_PRIORITY_CMD 2
23 #define SET_VLAN_EGRESS_PRIORITY_CMD 3
24 #define GET_VLAN_INGRESS_PRIORITY_CMD 4
25 #define GET_VLAN_EGRESS_PRIORITY_CMD 5
26 #define SET_VLAN_NAME_TYPE_CMD 6
27 #define SET_VLAN_FLAG_CMD 7
28 #define GET_VLAN_REALDEV_NAME_CMD 8
29 #define GET_VLAN_VID_CMD 9
30 
31 #define VLAN_NAME_TYPE_PLUS_VID 0
32 #define VLAN_NAME_TYPE_RAW_PLUS_VID 1
33 #define VLAN_NAME_TYPE_PLUS_VID_NO_PAD 2
34 #define VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD 3
35 
36 struct vlan_ioctl_args {
37 	int cmd;
38 	char device1[24];
39 
40 	union {
41 		char device2[24];
42 		int VID;
43 		unsigned int skb_priority;
44 		unsigned int name_type;
45 		unsigned int bind_type;
46 		unsigned int flag;
47 	} u;
48 
49 	short vlan_qos;
50 };
51 
52 #endif /* LINUX_VLAN_H */
53