+/* Ethernet destination address of CCM packets. */
+static const uint8_t eth_addr_ccm[6] = { 0x01, 0x80, 0xC2, 0x00, 0x00, 0x30 };
+static const uint8_t eth_addr_ccm_x[6] = {
+ 0x01, 0x23, 0x20, 0x00, 0x00, 0x30
+};
+
+#define ETH_TYPE_CFM 0x8902
+
+/* A 'ccm' represents a Continuity Check Message from the 802.1ag
+ * specification. Continuity Check Messages are broadcast periodically so that
+ * hosts can determine whom they have connectivity to. */
+#define CCM_LEN 74
+#define CCM_MAID_LEN 48
+#define CCM_OPCODE 1 /* CFM message opcode meaning CCM. */
+#define CCM_RDI_MASK 0x80
+struct ccm {
+ uint8_t mdlevel_version; /* MD Level and Version */
+ uint8_t opcode;
+ uint8_t flags;
+ uint8_t tlv_offset;
+ ovs_be32 seq;
+ ovs_be16 mpid;
+ uint8_t maid[CCM_MAID_LEN];
+
+ /* Defined by ITU-T Y.1731 should be zero */
+ ovs_be16 interval_ms_x; /* Transmission interval in ms. */
+ ovs_be64 mpid64; /* MPID in extended mode. */
+ uint8_t zero[6];
+} __attribute__((packed));
+BUILD_ASSERT_DECL(CCM_LEN == sizeof(struct ccm));
+
+struct cfm {
+ char *name; /* Name of this CFM object. */
+ struct hmap_node hmap_node; /* Node in all_cfms list. */
+
+ uint64_t mpid;
+ bool extended; /* Extended mode. */
+ bool fault; /* Indicates connectivity fault. */
+ bool unexpected_recv; /* Received an unexpected CCM. */