uint32_t seq; /* The sequence number of our last CCM. */
uint8_t ccm_interval; /* The CCM transmission interval. */
int ccm_interval_ms; /* 'ccm_interval' in milliseconds. */
+ uint16_t ccm_vlan; /* Vlan tag of CCM PDUs. */
uint8_t maid[CCM_MAID_LEN]; /* The MAID of this CFM. */
struct timer tx_timer; /* Send CCM when expired. */
struct ccm *ccm;
timer_set_duration(&cfm->tx_timer, cfm->ccm_interval_ms);
- ccm = eth_compose(packet, cfm_ccm_addr(cfm), eth_src, ETH_TYPE_CFM,
- sizeof *ccm);
+ eth_compose(packet, cfm_ccm_addr(cfm), eth_src, ETH_TYPE_CFM, sizeof *ccm);
+
+ if (cfm->ccm_vlan) {
+ eth_push_vlan(packet, htons(cfm->ccm_vlan));
+ }
+
+ ccm = packet->l3;
ccm->mdlevel_version = 0;
ccm->opcode = CCM_OPCODE;
ccm->tlv_offset = 70;
interval = ms_to_ccm_interval(s->interval);
interval_ms = ccm_interval_to_ms(interval);
+ cfm->ccm_vlan = s->ccm_vlan & VLAN_VID_MASK;
if (cfm->extended && interval_ms != s->interval) {
interval = 0;
interval_ms = MIN(s->interval, UINT16_MAX);
int interval; /* The requested transmission interval. */
bool extended; /* Run in extended mode. */
bool opup; /* Operational State. */
+ uint16_t ccm_vlan; /* CCM Vlan tag. Zero if none. */
};
void cfm_init(void);
/* Populates 'b' with an Ethernet II packet headed with the given 'eth_dst',
* 'eth_src' and 'eth_type' parameters. A payload of 'size' bytes is allocated
* in 'b' and returned. This payload may be populated with appropriate
- * information by the caller.
+ * information by the caller. Sets 'b''s 'l2' and 'l3' pointers to the
+ * Ethernet header and payload respectively.
*
* The returned packet has enough headroom to insert an 802.1Q VLAN header if
* desired. */
memcpy(eth->eth_src, eth_src, ETH_ADDR_LEN);
eth->eth_type = htons(eth_type);
+ b->l2 = eth;
+ b->l3 = data;
+
return data;
}
s.mpid = *cfg->cfm_mpid;
s.interval = atoi(get_interface_other_config(iface->cfg, "cfm_interval",
"0"));
+ s.ccm_vlan = atoi(get_interface_other_config(iface->cfg, "cfm_ccm_vlan",
+ "0"));
if (s.interval <= 0) {
s.interval = 1000;
}
OpenFlow action. This setting is ignored when CFM is not in extended
mode. Defaults to <code>up</code>.
</column>
+
+ <column name="other_config" key="cfm_ccm_vlan"
+ type='{"type": "integer", "minInteger": 1, "maxInteger": 4095}'>
+ When set, the CFM module will apply a VLAN tag to all CCMs it generates
+ with the given value.
+ </column>
+
</group>
<group title="Bonding Configuration">