diff options
author | Josh Blum <josh@joshknows.com> | 2010-11-04 19:40:02 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-11-04 19:40:02 -0700 |
commit | 7c36bc7b7456225f613887a2b84ebefac2b1c208 (patch) | |
tree | 8722cdad5748a113924f7809d789aaefda94df4e /firmware/microblaze/lib/net_common.c | |
parent | c8cb4bcadc32e59e98fc2901eb94830f600d5d28 (diff) | |
parent | 7a7e704fa3d79036da1f33013e761eb747b725f0 (diff) | |
download | uhd-7c36bc7b7456225f613887a2b84ebefac2b1c208.tar.gz uhd-7c36bc7b7456225f613887a2b84ebefac2b1c208.tar.bz2 uhd-7c36bc7b7456225f613887a2b84ebefac2b1c208.zip |
Merge branch 'good_stuff' into mb_eeprom
Diffstat (limited to 'firmware/microblaze/lib/net_common.c')
-rw-r--r-- | firmware/microblaze/lib/net_common.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/firmware/microblaze/lib/net_common.c b/firmware/microblaze/lib/net_common.c index 6c9509c92..beaaa5948 100644 --- a/firmware/microblaze/lib/net_common.c +++ b/firmware/microblaze/lib/net_common.c @@ -351,6 +351,22 @@ send_arp_reply(struct arp_eth_ipv4 *req, eth_mac_addr_t our_mac) send_pkt(t, ETHERTYPE_ARP, &reply, sizeof(reply), 0, 0, 0, 0); } +void send_gratuitous_arp(void){ + struct arp_eth_ipv4 req _AL4; + req.ar_hrd = ARPHRD_ETHER; + req.ar_pro = ETHERTYPE_IPV4; + req.ar_hln = sizeof(eth_mac_addr_t); + req.ar_pln = sizeof(struct ip_addr); + req.ar_op = ARPOP_REQUEST; + memcpy(req.ar_sha, ethernet_mac_addr(), sizeof(eth_mac_addr_t)); + memcpy(req.ar_sip, get_ip_addr(), sizeof(struct ip_addr)); + memset(req.ar_tha, 0x00, sizeof(eth_mac_addr_t)); + memcpy(req.ar_tip, get_ip_addr(), sizeof(struct ip_addr)); + + //send the request with a broadcast ethernet mac address + eth_mac_addr_t t; memset(&t, 0xff, sizeof(t)); + send_pkt(t, ETHERTYPE_ARP, &req, sizeof(req), 0, 0, 0, 0); +} static void handle_arp_packet(struct arp_eth_ipv4 *p, size_t size) |