1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _UAPI_LINUX_CFM_BRIDGE_H_
20 #define _UAPI_LINUX_CFM_BRIDGE_H_
21 #include <linux/types.h>
22 #include <linux/if_ether.h>
23 #define ETHER_HEADER_LENGTH (6 + 6 + 4 + 2)
24 #define CFM_MAID_LENGTH 48
25 #define CFM_CCM_PDU_LENGTH 75
26 #define CFM_PORT_STATUS_TLV_LENGTH 4
27 #define CFM_IF_STATUS_TLV_LENGTH 4
28 #define CFM_IF_STATUS_TLV_TYPE 4
29 #define CFM_PORT_STATUS_TLV_TYPE 2
30 #define CFM_ENDE_TLV_TYPE 0
31 #define CFM_CCM_MAX_FRAME_LENGTH (ETHER_HEADER_LENGTH + CFM_CCM_PDU_LENGTH + CFM_PORT_STATUS_TLV_LENGTH + CFM_IF_STATUS_TLV_LENGTH)
32 #define CFM_FRAME_PRIO 7
33 #define CFM_CCM_TLV_OFFSET 70
34 #define CFM_CCM_PDU_MAID_OFFSET 10
35 #define CFM_CCM_PDU_MEPID_OFFSET 8
36 #define CFM_CCM_PDU_SEQNR_OFFSET 4
37 #define CFM_CCM_PDU_TLV_OFFSET 74
38 #define CFM_CCM_ITU_RESERVED_SIZE 16
39 struct br_cfm_common_hdr {
40   __u8 mdlevel_version;
41   __u8 opcode;
42   __u8 flags;
43   __u8 tlv_offset;
44 };
45 enum br_cfm_opcodes {
46   BR_CFM_OPCODE_CCM = 0x1,
47 };
48 enum br_cfm_domain {
49   BR_CFM_PORT,
50   BR_CFM_VLAN,
51 };
52 enum br_cfm_mep_direction {
53   BR_CFM_MEP_DIRECTION_DOWN,
54   BR_CFM_MEP_DIRECTION_UP,
55 };
56 enum br_cfm_ccm_interval {
57   BR_CFM_CCM_INTERVAL_NONE,
58   BR_CFM_CCM_INTERVAL_3_3_MS,
59   BR_CFM_CCM_INTERVAL_10_MS,
60   BR_CFM_CCM_INTERVAL_100_MS,
61   BR_CFM_CCM_INTERVAL_1_SEC,
62   BR_CFM_CCM_INTERVAL_10_SEC,
63   BR_CFM_CCM_INTERVAL_1_MIN,
64   BR_CFM_CCM_INTERVAL_10_MIN,
65 };
66 #endif
67