return;
}
- LIST_FOR_EACH (hw, h_entries, &lldp->lldpd->g_hardware.h_entries) {
+ LIST_FOR_EACH (hw, h_entries, &lldp->lldpd->g_hardware) {
ds_put_format(ds, "\ttx cnt: %"PRIu64"\n", hw->h_tx_cnt);
ds_put_format(ds, "\trx cnt: %"PRIu64"\n", hw->h_rx_cnt);
ds_put_format(ds, "\trx discarded cnt: %"PRIu64"\n",
return;
}
- LIST_FOR_EACH (hw, h_entries, &lldp->lldpd->g_hardware.h_entries) {
+ LIST_FOR_EACH (hw, h_entries, &lldp->lldpd->g_hardware) {
aa_print_element_status_port(ds, hw);
}
}
ds_put_format(ds, "LLDP: %s\n", lldp->name);
- LIST_FOR_EACH (hw, h_entries, &lldp->lldpd->g_hardware.h_entries) {
+ LIST_FOR_EACH (hw, h_entries, &lldp->lldpd->g_hardware) {
aa_print_isid_status_port(lldp, hw);
}
HMAP_FOR_EACH (lldp, hmap_node, all_lldps) {
struct lldpd_chassis *chassis;
- LIST_FOR_EACH (chassis, list, &lldp->lldpd->g_chassis.list) {
+ LIST_FOR_EACH (chassis, list, &lldp->lldpd->g_chassis) {
/* System Description */
free(chassis->c_descr);
chassis->c_descr = s->system_description[0] ?
hash_pointer(m->aux, 0));
/* Configure the mapping on each port of the LLDP stack. */
- LIST_FOR_EACH (hw, h_entries, &lldp->lldpd->g_hardware.h_entries) {
+ LIST_FOR_EACH (hw, h_entries, &lldp->lldpd->g_hardware) {
update_mapping_on_lldp(lldp, hw, m);
}
}
free(m);
/* Remove from all the lldp instances */
- LIST_FOR_EACH (hw, h_entries, &lldp->lldpd->g_hardware.h_entries) {
+ LIST_FOR_EACH (hw, h_entries, &lldp->lldpd->g_hardware) {
if (hw->h_ifname) {
VLOG_INFO("\t\t hardware->h_ifname=%s", hw->h_ifname);
}
lldp_process_packet(struct lldp *lldp, const struct dp_packet *p)
{
if (lldp) {
- lldpd_recv(lldp->lldpd,
- (struct lldpd_hardware *)
- lldp->lldpd->g_hardware.h_entries.next,
- (char *) p->data_,
- p->size_);
+ lldpd_recv(lldp->lldpd, lldpd_first_hardware(lldp->lldpd),
+ (char *) dp_packet_data(p), dp_packet_size(p));
}
}
uint8_t eth_src[ETH_ADDR_LEN]) OVS_EXCLUDED(mutex)
{
struct lldpd *mylldpd = lldp->lldpd;
- struct lldpd_hardware *hw = (struct lldpd_hardware *)
- mylldpd->g_hardware.h_entries.next;
+ struct lldpd_hardware *hw = lldpd_first_hardware(mylldpd);
uint32_t lldp_size = 0;
static const uint8_t eth_addr_lldp[6] =
{0x01, 0x80, 0xC2, 0x00, 0x00, 0x0e};
lldp->lldpd->g_config.c_tx_hold;
lchassis->c_ttl = LLDP_CHASSIS_TTL;
lldpd_assign_cfg_to_protocols(lldp->lldpd);
- list_init(&lldp->lldpd->g_chassis.list);
- list_push_back(&lldp->lldpd->g_chassis.list, &lchassis->list);
+ list_init(&lldp->lldpd->g_chassis);
+ list_push_back(&lldp->lldpd->g_chassis, &lchassis->list);
if ((hw = lldpd_alloc_hardware(lldp->lldpd,
(char *) netdev_get_name(netdev),
hw->h_lport.p_id_len = strlen(netdev_get_name(netdev));
/* Auto Attach element tlv */
- hw->h_lport.p_element.type = LLDP_TLV_AA_ELEM_TYPE_TAG_CLIENT;
+ hw->h_lport.p_element.type = LLDP_TLV_AA_ELEM_TYPE_CLIENT_VIRTUAL_SWITCH;
hw->h_lport.p_element.mgmt_vlan = 0;
memcpy(&hw->h_lport.p_element.system_id.system_mac,
lchassis->c_id, lchassis->c_id_len);
hw->h_lport.p_element.system_id.conn_type =
LLDP_TLV_AA_ELEM_CONN_TYPE_SINGLE;
-
- hw->h_lport.p_element.system_id.smlt_id = 0;
- hw->h_lport.p_element.system_id.mlt_id[0] = 0;
- hw->h_lport.p_element.system_id.mlt_id[1] = 0;
+ hw->h_lport.p_element.system_id.rsvd = 0;
+ hw->h_lport.p_element.system_id.rsvd2[0] = 0;
+ hw->h_lport.p_element.system_id.rsvd2[1] = 0;
list_init(&hw->h_lport.p_isid_vlan_maps);
- list_init(&lldp->lldpd->g_hardware.h_entries);
- list_push_back(&lldp->lldpd->g_hardware.h_entries, &hw->h_entries);
+ list_init(&lldp->lldpd->g_hardware);
+ list_push_back(&lldp->lldpd->g_hardware, &hw->h_entries);
ovs_mutex_lock(&mutex);
list_init(&lchassis->c_mgmt);
lchassis->c_ttl = LLDP_CHASSIS_TTL;
lldpd_assign_cfg_to_protocols(lldp->lldpd);
- list_init(&lldp->lldpd->g_chassis.list);
- list_push_back(&lldp->lldpd->g_chassis.list, &lchassis->list);
+ list_init(&lldp->lldpd->g_chassis);
+ list_push_back(&lldp->lldpd->g_chassis, &lchassis->list);
hw = lldpd_alloc_hardware(lldp->lldpd, "dummy-hw", 0);
hw->h_lport.p_id_len = strlen(hw->h_lport.p_id);
/* Auto Attach element tlv */
- hw->h_lport.p_element.type = LLDP_TLV_AA_ELEM_TYPE_TAG_CLIENT;
+ hw->h_lport.p_element.type = LLDP_TLV_AA_ELEM_TYPE_CLIENT_VIRTUAL_SWITCH;
hw->h_lport.p_element.mgmt_vlan = 0;
memcpy(&hw->h_lport.p_element.system_id.system_mac,
lchassis->c_id, lchassis->c_id_len);
hw->h_lport.p_element.system_id.conn_type =
LLDP_TLV_AA_ELEM_CONN_TYPE_SINGLE;
- hw->h_lport.p_element.system_id.smlt_id = 0;
- hw->h_lport.p_element.system_id.mlt_id[0] = 0;
- hw->h_lport.p_element.system_id.mlt_id[1] = 0;
+ hw->h_lport.p_element.system_id.rsvd = 0;
+ hw->h_lport.p_element.system_id.rsvd2[0] = 0;
+ hw->h_lport.p_element.system_id.rsvd2[1] = 0;
list_init(&hw->h_lport.p_isid_vlan_maps);
- list_init(&lldp->lldpd->g_hardware.h_entries);
- list_push_back(&lldp->lldpd->g_hardware.h_entries, &hw->h_entries);
+ list_init(&lldp->lldpd->g_hardware);
+ list_push_back(&lldp->lldpd->g_hardware, &hw->h_entries);
return lldp;
}