cfm_bridge.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  2. #ifndef _LINUX_CFM_BRIDGE_H_
  3. #define _LINUX_CFM_BRIDGE_H_
  4. #include <linux/types.h>
  5. #include <linux/if_ether.h>
  6. #define ETHER_HEADER_LENGTH (6+6+4+2)
  7. #define CFM_MAID_LENGTH 48
  8. #define CFM_CCM_PDU_LENGTH 75
  9. #define CFM_PORT_STATUS_TLV_LENGTH 4
  10. #define CFM_IF_STATUS_TLV_LENGTH 4
  11. #define CFM_IF_STATUS_TLV_TYPE 4
  12. #define CFM_PORT_STATUS_TLV_TYPE 2
  13. #define CFM_ENDE_TLV_TYPE 0
  14. #define CFM_CCM_MAX_FRAME_LENGTH (ETHER_HEADER_LENGTH+\
  15. CFM_CCM_PDU_LENGTH+\
  16. CFM_PORT_STATUS_TLV_LENGTH+\
  17. CFM_IF_STATUS_TLV_LENGTH)
  18. #define CFM_FRAME_PRIO 7
  19. #define CFM_CCM_TLV_OFFSET 70
  20. #define CFM_CCM_PDU_MAID_OFFSET 10
  21. #define CFM_CCM_PDU_MEPID_OFFSET 8
  22. #define CFM_CCM_PDU_SEQNR_OFFSET 4
  23. #define CFM_CCM_PDU_TLV_OFFSET 74
  24. #define CFM_CCM_ITU_RESERVED_SIZE 16
  25. struct br_cfm_common_hdr {
  26. __u8 mdlevel_version;
  27. __u8 opcode;
  28. __u8 flags;
  29. __u8 tlv_offset;
  30. };
  31. enum br_cfm_opcodes {
  32. BR_CFM_OPCODE_CCM = 0x1,
  33. };
  34. /* MEP domain */
  35. enum br_cfm_domain {
  36. BR_CFM_PORT,
  37. BR_CFM_VLAN,
  38. };
  39. /* MEP direction */
  40. enum br_cfm_mep_direction {
  41. BR_CFM_MEP_DIRECTION_DOWN,
  42. BR_CFM_MEP_DIRECTION_UP,
  43. };
  44. /* CCM interval supported. */
  45. enum br_cfm_ccm_interval {
  46. BR_CFM_CCM_INTERVAL_NONE,
  47. BR_CFM_CCM_INTERVAL_3_3_MS,
  48. BR_CFM_CCM_INTERVAL_10_MS,
  49. BR_CFM_CCM_INTERVAL_100_MS,
  50. BR_CFM_CCM_INTERVAL_1_SEC,
  51. BR_CFM_CCM_INTERVAL_10_SEC,
  52. BR_CFM_CCM_INTERVAL_1_MIN,
  53. BR_CFM_CCM_INTERVAL_10_MIN,
  54. };
  55. #endif