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