Forum Discussion
Altera_Forum
Honored Contributor
10 years agoIniche stack - how found MAC address from IP
I'm using Nios II system to provide ethernet services (like ICMP, ARP etc. etc.) to an video over IP design. I'm using the uCOS II system with Nichestack. My video to IP transmitter (hardware des...
Altera_Forum
Honored Contributor
10 years agoThanks,
I've implemented a function that parse the ARP table up to find correspondance between my IP and IP contained in ARP table, then I extract the relative MAC address. //parse arp_table to find matching specified IP <-> IP in ARP table and then readback MAC address for (i=0; i<= MAXARPS; i++) { if (arp_table.t_pro_addr ==invert_addr_byte_order(udp_ip_tx_config[0].ipdestaddress)){
mac_found = 1;
mac_addr[0] = arp_table.t_phy_addr[0]; MAC_addr[1] = arp_table.t_phy_addr[1];
mac_addr[2] = arp_table.t_phy_addr[2]; MAC_addr[3] = arp_table.t_phy_addr[3];
mac_addr[4] = arp_table.t_phy_addr[4]; MAC_addr[5] = arp_table[i].t_phy_addr[5]; } }