xref: /linux/include/uapi/linux/if_vlan.h (revision c39f2d9db0fd81ea20bb5cce9b3f082ca63753e2)
1e2be04c7SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2607ca46eSDavid Howells /*
3607ca46eSDavid Howells  * VLAN		An implementation of 802.1Q VLAN tagging.
4607ca46eSDavid Howells  *
5607ca46eSDavid Howells  * Authors:	Ben Greear <greearb@candelatech.com>
6607ca46eSDavid Howells  *
7607ca46eSDavid Howells  *		This program is free software; you can redistribute it and/or
8607ca46eSDavid Howells  *		modify it under the terms of the GNU General Public License
9607ca46eSDavid Howells  *		as published by the Free Software Foundation; either version
10607ca46eSDavid Howells  *		2 of the License, or (at your option) any later version.
11607ca46eSDavid Howells  *
12607ca46eSDavid Howells  */
13607ca46eSDavid Howells 
14607ca46eSDavid Howells #ifndef _UAPI_LINUX_IF_VLAN_H_
15607ca46eSDavid Howells #define _UAPI_LINUX_IF_VLAN_H_
16607ca46eSDavid Howells 
17607ca46eSDavid Howells 
18607ca46eSDavid Howells /* VLAN IOCTLs are found in sockios.h */
19607ca46eSDavid Howells 
20607ca46eSDavid Howells /* Passed in vlan_ioctl_args structure to determine behaviour. */
21607ca46eSDavid Howells enum vlan_ioctl_cmds {
22607ca46eSDavid Howells 	ADD_VLAN_CMD,
23607ca46eSDavid Howells 	DEL_VLAN_CMD,
24607ca46eSDavid Howells 	SET_VLAN_INGRESS_PRIORITY_CMD,
25607ca46eSDavid Howells 	SET_VLAN_EGRESS_PRIORITY_CMD,
26607ca46eSDavid Howells 	GET_VLAN_INGRESS_PRIORITY_CMD,
27607ca46eSDavid Howells 	GET_VLAN_EGRESS_PRIORITY_CMD,
28607ca46eSDavid Howells 	SET_VLAN_NAME_TYPE_CMD,
29607ca46eSDavid Howells 	SET_VLAN_FLAG_CMD,
30607ca46eSDavid Howells 	GET_VLAN_REALDEV_NAME_CMD, /* If this works, you know it's a VLAN device, btw */
31607ca46eSDavid Howells 	GET_VLAN_VID_CMD /* Get the VID of this VLAN (specified by name) */
32607ca46eSDavid Howells };
33607ca46eSDavid Howells 
34607ca46eSDavid Howells enum vlan_flags {
35607ca46eSDavid Howells 	VLAN_FLAG_REORDER_HDR		= 0x1,
36607ca46eSDavid Howells 	VLAN_FLAG_GVRP			= 0x2,
37607ca46eSDavid Howells 	VLAN_FLAG_LOOSE_BINDING		= 0x4,
3886fbe9bbSDavid Ward 	VLAN_FLAG_MVRP			= 0x8,
39*8c8b3458SMike Manning 	VLAN_FLAG_BRIDGE_BINDING	= 0x10,
40607ca46eSDavid Howells };
41607ca46eSDavid Howells 
42607ca46eSDavid Howells enum vlan_name_types {
43607ca46eSDavid Howells 	VLAN_NAME_TYPE_PLUS_VID, /* Name will look like:  vlan0005 */
44607ca46eSDavid Howells 	VLAN_NAME_TYPE_RAW_PLUS_VID, /* name will look like:  eth1.0005 */
45607ca46eSDavid Howells 	VLAN_NAME_TYPE_PLUS_VID_NO_PAD, /* Name will look like:  vlan5 */
46607ca46eSDavid Howells 	VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD, /* Name will look like:  eth0.5 */
47607ca46eSDavid Howells 	VLAN_NAME_TYPE_HIGHEST
48607ca46eSDavid Howells };
49607ca46eSDavid Howells 
50607ca46eSDavid Howells struct vlan_ioctl_args {
51607ca46eSDavid Howells 	int cmd; /* Should be one of the vlan_ioctl_cmds enum above. */
52607ca46eSDavid Howells 	char device1[24];
53607ca46eSDavid Howells 
54607ca46eSDavid Howells         union {
55607ca46eSDavid Howells 		char device2[24];
56607ca46eSDavid Howells 		int VID;
57607ca46eSDavid Howells 		unsigned int skb_priority;
58607ca46eSDavid Howells 		unsigned int name_type;
59607ca46eSDavid Howells 		unsigned int bind_type;
60607ca46eSDavid Howells 		unsigned int flag; /* Matches vlan_dev_priv flags */
61607ca46eSDavid Howells         } u;
62607ca46eSDavid Howells 
63607ca46eSDavid Howells 	short vlan_qos;
64607ca46eSDavid Howells };
65607ca46eSDavid Howells 
66607ca46eSDavid Howells #endif /* _UAPI_LINUX_IF_VLAN_H_ */
67