Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
0002 /*
0003  * VLAN     An implementation of 802.1Q VLAN tagging.
0004  *
0005  * Authors: Ben Greear <greearb@candelatech.com>
0006  *
0007  *      This program is free software; you can redistribute it and/or
0008  *      modify it under the terms of the GNU General Public License
0009  *      as published by the Free Software Foundation; either version
0010  *      2 of the License, or (at your option) any later version.
0011  *
0012  */
0013 
0014 #ifndef _UAPI_LINUX_IF_VLAN_H_
0015 #define _UAPI_LINUX_IF_VLAN_H_
0016 
0017 
0018 /* VLAN IOCTLs are found in sockios.h */
0019 
0020 /* Passed in vlan_ioctl_args structure to determine behaviour. */
0021 enum vlan_ioctl_cmds {
0022     ADD_VLAN_CMD,
0023     DEL_VLAN_CMD,
0024     SET_VLAN_INGRESS_PRIORITY_CMD,
0025     SET_VLAN_EGRESS_PRIORITY_CMD,
0026     GET_VLAN_INGRESS_PRIORITY_CMD,
0027     GET_VLAN_EGRESS_PRIORITY_CMD,
0028     SET_VLAN_NAME_TYPE_CMD,
0029     SET_VLAN_FLAG_CMD,
0030     GET_VLAN_REALDEV_NAME_CMD, /* If this works, you know it's a VLAN device, btw */
0031     GET_VLAN_VID_CMD /* Get the VID of this VLAN (specified by name) */
0032 };
0033 
0034 enum vlan_flags {
0035     VLAN_FLAG_REORDER_HDR       = 0x1,
0036     VLAN_FLAG_GVRP          = 0x2,
0037     VLAN_FLAG_LOOSE_BINDING     = 0x4,
0038     VLAN_FLAG_MVRP          = 0x8,
0039     VLAN_FLAG_BRIDGE_BINDING    = 0x10,
0040 };
0041 
0042 enum vlan_name_types {
0043     VLAN_NAME_TYPE_PLUS_VID, /* Name will look like:  vlan0005 */
0044     VLAN_NAME_TYPE_RAW_PLUS_VID, /* name will look like:  eth1.0005 */
0045     VLAN_NAME_TYPE_PLUS_VID_NO_PAD, /* Name will look like:  vlan5 */
0046     VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD, /* Name will look like:  eth0.5 */
0047     VLAN_NAME_TYPE_HIGHEST
0048 };
0049 
0050 struct vlan_ioctl_args {
0051     int cmd; /* Should be one of the vlan_ioctl_cmds enum above. */
0052     char device1[24];
0053 
0054         union {
0055         char device2[24];
0056         int VID;
0057         unsigned int skb_priority;
0058         unsigned int name_type;
0059         unsigned int bind_type;
0060         unsigned int flag; /* Matches vlan_dev_priv flags */
0061         } u;
0062 
0063     short vlan_qos;   
0064 };
0065 
0066 #endif /* _UAPI_LINUX_IF_VLAN_H_ */