This is the second commit of the implementation of the CFM protocol according to 802.1Q section 12.14. Functionality is extended with CCM frame transmission. Interface is extended with these functions: br_cfm_cc_rdi_set() br_cfm_cc_ccm_tx() br_cfm_cc_config_set() A MEP Continuity Check feature can be configured by br_cfm_cc_config_set() The Continuity Check parameters can be configured to be used when transmitting CCM. A MEP can be configured to start or stop transmission of CCM frames by br_cfm_cc_ccm_tx() The CCM will be transmitted for a selected period in seconds. Must call this function before timeout to keep transmission alive. A MEP transmitting CCM can be configured with inserted RDI in PDU by br_cfm_cc_rdi_set()
Showing the changes to include/uapi/linux (1 of 3 files). Show all
Unified · Split
| @@ -6,7 +6,32 @@ · 5 unmodified lines | |||
| 6 | #include <linux/types.h> | 6 | #include <linux/types.h> |
| 7 | #include <linux/if_ether.h> | 7 | #include <linux/if_ether.h> |
| 8 | 8 | ||
| 9 | #define CFM_MAID_LENGTH 48 | 9 | #define ETHER_HEADER_LENGTH (6+6+4+2) |
| 10 | #define CFM_MAID_LENGTH 48 | ||
| 11 | #define CFM_CCM_PDU_LENGTH 75 | ||
| 12 | #define CFM_PORT_STATUS_TLV_LENGTH 4 | ||
| 13 | #define CFM_IF_STATUS_TLV_LENGTH 4 | ||
| 14 | #define CFM_IF_STATUS_TLV_TYPE 4 | ||
| 15 | #define CFM_PORT_STATUS_TLV_TYPE 2 | ||
| 16 | #define CFM_ENDE_TLV_TYPE 0 | ||
| 17 | #define CFM_CCM_MAX_FRAME_LENGTH (ETHER_HEADER_LENGTH+\ | ||
| 18 | CFM_CCM_PDU_LENGTH+\ | ||
| 19 | CFM_PORT_STATUS_TLV_LENGTH+\ | ||
| 20 | CFM_IF_STATUS_TLV_LENGTH) | ||
| 21 | #define CFM_FRAME_PRIO 7 | ||
| 22 | #define CFM_CCM_TLV_OFFSET 70 | ||
| 23 | #define CFM_CCM_ITU_RESERVED_SIZE 16 | ||
| 24 | |||
| 25 | struct br_cfm_common_hdr { | ||
| 26 | __u8 mdlevel_version; | ||
| 27 | __u8 opcode; | ||
| 28 | __u8 flags; | ||
| 29 | __u8 tlv_offset; | ||
| 30 | }; | ||
| 31 | |||
| 32 | enum br_cfm_opcodes { | ||
| 33 | BR_CFM_OPCODE_CCM = 0x1, | ||
| 34 | }; | ||
| 10 | 35 | ||
| 11 | /* MEP domain */ | 36 | /* MEP domain */ |
| 12 | enum br_cfm_domain { | 37 | enum br_cfm_domain { |
| @@ -20,4 +45,16 @@ enum br_cfm_mep_direction { · 7 unmodified lines | |||
| 20 | BR_CFM_MEP_DIRECTION_UP, | 45 | BR_CFM_MEP_DIRECTION_UP, |
| 21 | }; | 46 | }; |
| 22 | 47 | ||
| 48 | /* CCM interval supported. */ | ||
| 49 | enum br_cfm_ccm_interval { | ||
| 50 | BR_CFM_CCM_INTERVAL_NONE, | ||
| 51 | BR_CFM_CCM_INTERVAL_3_3_MS, | ||
| 52 | BR_CFM_CCM_INTERVAL_10_MS, | ||
| 53 | BR_CFM_CCM_INTERVAL_100_MS, | ||
| 54 | BR_CFM_CCM_INTERVAL_1_SEC, | ||
| 55 | BR_CFM_CCM_INTERVAL_10_SEC, | ||
| 56 | BR_CFM_CCM_INTERVAL_1_MIN, | ||
| 57 | BR_CFM_CCM_INTERVAL_10_MIN, | ||
| 58 | }; | ||
| 59 | |||
| 23 | #endif | 60 | #endif |