xref: /OK3568_Linux_fs/kernel/include/uapi/linux/if_vlan.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * VLAN		An implementation of 802.1Q VLAN tagging.
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Authors:	Ben Greear <greearb@candelatech.com>
6*4882a593Smuzhiyun  *
7*4882a593Smuzhiyun  *		This program is free software; you can redistribute it and/or
8*4882a593Smuzhiyun  *		modify it under the terms of the GNU General Public License
9*4882a593Smuzhiyun  *		as published by the Free Software Foundation; either version
10*4882a593Smuzhiyun  *		2 of the License, or (at your option) any later version.
11*4882a593Smuzhiyun  *
12*4882a593Smuzhiyun  */
13*4882a593Smuzhiyun 
14*4882a593Smuzhiyun #ifndef _UAPI_LINUX_IF_VLAN_H_
15*4882a593Smuzhiyun #define _UAPI_LINUX_IF_VLAN_H_
16*4882a593Smuzhiyun 
17*4882a593Smuzhiyun 
18*4882a593Smuzhiyun /* VLAN IOCTLs are found in sockios.h */
19*4882a593Smuzhiyun 
20*4882a593Smuzhiyun /* Passed in vlan_ioctl_args structure to determine behaviour. */
21*4882a593Smuzhiyun enum vlan_ioctl_cmds {
22*4882a593Smuzhiyun 	ADD_VLAN_CMD,
23*4882a593Smuzhiyun 	DEL_VLAN_CMD,
24*4882a593Smuzhiyun 	SET_VLAN_INGRESS_PRIORITY_CMD,
25*4882a593Smuzhiyun 	SET_VLAN_EGRESS_PRIORITY_CMD,
26*4882a593Smuzhiyun 	GET_VLAN_INGRESS_PRIORITY_CMD,
27*4882a593Smuzhiyun 	GET_VLAN_EGRESS_PRIORITY_CMD,
28*4882a593Smuzhiyun 	SET_VLAN_NAME_TYPE_CMD,
29*4882a593Smuzhiyun 	SET_VLAN_FLAG_CMD,
30*4882a593Smuzhiyun 	GET_VLAN_REALDEV_NAME_CMD, /* If this works, you know it's a VLAN device, btw */
31*4882a593Smuzhiyun 	GET_VLAN_VID_CMD /* Get the VID of this VLAN (specified by name) */
32*4882a593Smuzhiyun };
33*4882a593Smuzhiyun 
34*4882a593Smuzhiyun enum vlan_flags {
35*4882a593Smuzhiyun 	VLAN_FLAG_REORDER_HDR		= 0x1,
36*4882a593Smuzhiyun 	VLAN_FLAG_GVRP			= 0x2,
37*4882a593Smuzhiyun 	VLAN_FLAG_LOOSE_BINDING		= 0x4,
38*4882a593Smuzhiyun 	VLAN_FLAG_MVRP			= 0x8,
39*4882a593Smuzhiyun 	VLAN_FLAG_BRIDGE_BINDING	= 0x10,
40*4882a593Smuzhiyun };
41*4882a593Smuzhiyun 
42*4882a593Smuzhiyun enum vlan_name_types {
43*4882a593Smuzhiyun 	VLAN_NAME_TYPE_PLUS_VID, /* Name will look like:  vlan0005 */
44*4882a593Smuzhiyun 	VLAN_NAME_TYPE_RAW_PLUS_VID, /* name will look like:  eth1.0005 */
45*4882a593Smuzhiyun 	VLAN_NAME_TYPE_PLUS_VID_NO_PAD, /* Name will look like:  vlan5 */
46*4882a593Smuzhiyun 	VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD, /* Name will look like:  eth0.5 */
47*4882a593Smuzhiyun 	VLAN_NAME_TYPE_HIGHEST
48*4882a593Smuzhiyun };
49*4882a593Smuzhiyun 
50*4882a593Smuzhiyun struct vlan_ioctl_args {
51*4882a593Smuzhiyun 	int cmd; /* Should be one of the vlan_ioctl_cmds enum above. */
52*4882a593Smuzhiyun 	char device1[24];
53*4882a593Smuzhiyun 
54*4882a593Smuzhiyun         union {
55*4882a593Smuzhiyun 		char device2[24];
56*4882a593Smuzhiyun 		int VID;
57*4882a593Smuzhiyun 		unsigned int skb_priority;
58*4882a593Smuzhiyun 		unsigned int name_type;
59*4882a593Smuzhiyun 		unsigned int bind_type;
60*4882a593Smuzhiyun 		unsigned int flag; /* Matches vlan_dev_priv flags */
61*4882a593Smuzhiyun         } u;
62*4882a593Smuzhiyun 
63*4882a593Smuzhiyun 	short vlan_qos;
64*4882a593Smuzhiyun };
65*4882a593Smuzhiyun 
66*4882a593Smuzhiyun #endif /* _UAPI_LINUX_IF_VLAN_H_ */
67