diff options
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/if_ether.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 23bf026..db1d6d4 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -78,8 +78,8 @@ arp_create(struct netif *nifp, uint32_t *sproto, uint32_t *tproto, uint16_t op) return packet; } -int -arp_request(struct netif *nifp, uint8_t *sproto, uint8_t *tproto) +static int +arp_send(struct netif *nifp, uint8_t *sproto, uint8_t *tproto, uint16_t op) { struct arp_pkt *packet; struct netbuf nb; @@ -95,7 +95,7 @@ arp_request(struct netif *nifp, uint8_t *sproto, uint8_t *tproto) src_tmp = (uint32_t *)sproto; targ_tmp = (uint32_t *)tproto; - packet = arp_create(nifp, src_tmp, targ_tmp, ARP_REQUEST); + packet = arp_create(nifp, src_tmp, targ_tmp, op); if (packet == NULL) { return -ENOMEM; } @@ -108,3 +108,15 @@ arp_request(struct netif *nifp, uint8_t *sproto, uint8_t *tproto) dynfree(packet); return 0; } + +int +arp_request(struct netif *nifp, uint8_t *sproto, uint8_t *tproto) +{ + return arp_send(nifp, sproto, tproto, ARP_REQUEST); +} + +int +arp_reply(struct netif *nifp, uint8_t *sproto, uint8_t *tproto) +{ + return arp_send(nifp, sproto, tproto, ARP_REPLY); +} |