{
struct lldpd_hardware *hw;
- LIST_FOR_EACH (hw, h_entries, &cfg->g_hardware.h_entries) {
+ LIST_FOR_EACH (hw, h_entries, &cfg->g_hardware) {
if (!strcmp(hw->h_ifname, name) && hw->h_ifindex == index
&& (!ops || ops == hw->h_ops)) {
return hw;
VLOG_DBG("cleanup all ports");
- LIST_FOR_EACH_SAFE (hw, hw_next, h_entries, &cfg->g_hardware.h_entries) {
+ LIST_FOR_EACH_SAFE (hw, hw_next, h_entries, &cfg->g_hardware) {
if (!hw->h_flags) {
list_remove(&hw->h_entries);
lldpd_remote_cleanup(hw, NULL, true);
VLOG_DBG("apply smart filter results on all ports");
- LIST_FOR_EACH (hw, h_entries, &cfg->g_hardware.h_entries) {
+ LIST_FOR_EACH (hw, h_entries, &cfg->g_hardware) {
if (cfg->g_config.c_smart & SMART_INCOMING_FILTER) {
lldpd_hide_ports(cfg, hw, SMART_INCOMING);
}
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);
}
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 *) p->data_, p->size_);
}
}
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};
hw->h_lport.p_element.system_id.mlt_id[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);
hw->h_lport.p_element.system_id.mlt_id[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;
}