-static struct ofpbuf *
-compose_ccm(struct cfm_internal *cfmi)
-{
- struct ccm *ccm;
- struct ofpbuf *packet;
- struct eth_header *eth;
-
- packet = xzalloc(sizeof *packet);
-
- ofpbuf_init(packet, ETH_HEADER_LEN + CCM_LEN + 2);
-
- ofpbuf_reserve(packet, 2);
-
- eth = ofpbuf_put_zeros(packet, ETH_HEADER_LEN);
- ccm = ofpbuf_put_zeros(packet, CCM_LEN);
-
- eth_addr_from_uint64(DEST_ADDR, eth->eth_dst);
- memcpy(eth->eth_src, cfmi->cfm.eth_src, sizeof eth->eth_src);
- eth->eth_type = htons(ETH_TYPE_CFM);
-
- ccm->mdlevel_version = 0;
- ccm->opcode = CCM_OPCODE;
- ccm->tlv_offset = 70;
- ccm->seq = htonl(++cfmi->seq);
- ccm->mpid = htons(cfmi->cfm.mpid);
- ccm->flags = cfmi->ccm_interval;
- memcpy(ccm->maid, cfmi->cfm.maid, sizeof ccm->maid);
- return packet;
-}
-