summaryrefslogtreecommitdiff
path: root/sys/netinet/if_ether.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-06-17 00:27:06 -0400
committerIan Moffett <ian@osmora.org>2025-06-17 00:27:06 -0400
commit767547ed81651a4ff6977c34c3033c82e1ebee16 (patch)
tree1409a856238d5b8378beac39b99a05a03a97f487 /sys/netinet/if_ether.c
parent74851a0f0d6db52659d57000830d078359db4d6d (diff)
kernel: netinet: Implement ARP reply logic
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/netinet/if_ether.c')
-rw-r--r--sys/netinet/if_ether.c18
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);
+}