lib/netdev-windows.c
/* Looks up in the ARP table entry for a given 'ip'. If it is found, the
 * corresponding MAC address will be copied in 'mac' and return 0. If no
 * matching entry is found or an error occurs it will log it and return ENXIO.
 */
Looks up in the ARP table entry for a given 'ip'. If it is found, the
corresponding MAC address will be copied in 'mac' and return 0. If no
matching entry is found or an error occurs it will log it and return ENXIO.
Looks up in the ARP table entry for a given ' ip ' . If it is found the corresponding MAC address will be copied in ' mac ' and return 0 . If no matching entry is found or an error occurs it will log it and return ENXIO .
static int
netdev_windows_arp_lookup(const struct netdev *netdev,
                          ovs_be32 ip, struct eth_addr *mac)
{
    PMIB_IPNETTABLE arp_table = NULL;
    uint32_t buffer_length = 0;
    uint32_t ret_val = 0;
    uint32_t counter = 0;
    ret_val = GetIpNetTable(arp_table, &buffer_length, false);
    if (ret_val != ERROR_INSUFFICIENT_BUFFER ) {
        VLOG_ERR("Call to GetIpNetTable failed with error: %s",
                 ovs_format_message(ret_val));
        return ENXIO;
    }
    arp_table = (MIB_IPNETTABLE *) xmalloc(buffer_length);
    ret_val = GetIpNetTable(arp_table, &buffer_length, false);
    if (ret_val == NO_ERROR) {
        for (counter = 0; counter < arp_table->dwNumEntries; counter++) {
            if (arp_table->table[counter].dwAddr == ip) {
                memcpy(mac, arp_table->table[counter].bPhysAddr, ETH_ADDR_LEN);
                free(arp_table);
                return 0;
            }
        }
    } else {
        VLOG_ERR("Call to GetIpNetTable failed with error: %s",
                 ovs_format_message(ret_val));
    }
    free(arp_table);
    return ENXIO;
}
static int netdev_windows_arp_lookup ( const struct netdev * netdev , ovs_be32 ip , struct eth_addr * mac ) { PMIB_IPNETTABLE arp_table = NULL ; uint32_t buffer_length = 0 ; uint32_t ret_val = 0 ; uint32_t counter = 0 ; ret_val = GetIpNetTable ( arp_table , & buffer_length , false ) ; if ( ret_val != ERROR_INSUFFICIENT_BUFFER ) { VLOG_ERR ( " " , ovs_format_message ( ret_val ) ) ; return ENXIO ; } arp_table = ( MIB_IPNETTABLE * ) xmalloc ( buffer_length ) ; ret_val = GetIpNetTable ( arp_table , & buffer_length , false ) ; if ( ret_val == NO_ERROR ) { for ( counter = 0 ; counter < arp_table -> dwNumEntries ; counter ++ ) { if ( arp_table -> table [ counter ] . dwAddr == ip ) { memcpy ( mac , arp_table -> table [ counter ] . bPhysAddr , ETH_ADDR_LEN ) ; free ( arp_table ) ; return 0 ; } } } else { VLOG_ERR ( " " , ovs_format_message ( ret_val ) ) ; } free ( arp_table ) ; return ENXIO ; }
Looks up in the ARP table entry for a given 'ip'.
Looks up in the ARP table entry for a given ' ip ' .
/* The buffer length of all ARP entries */