summaryrefslogtreecommitdiffstats
path: root/rtemsbsd/include/rtems/bsd/util.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-01-20 15:01:35 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-01-30 15:04:19 +0100
commitf8c3d6eacf0748628ecf90b61576afc24ef3c25b (patch)
tree0aeb4b66be791460f2fc758e9ec5256d05a05969 /rtemsbsd/include/rtems/bsd/util.h
parentDefine __FreeBSD__ in <net/bpf.h> if not defined (diff)
downloadrtems-libbsd-f8c3d6eacf0748628ecf90b61576afc24ef3c25b.tar.bz2
Add an ARP packet processor
Diffstat (limited to 'rtemsbsd/include/rtems/bsd/util.h')
-rw-r--r--rtemsbsd/include/rtems/bsd/util.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/rtemsbsd/include/rtems/bsd/util.h b/rtemsbsd/include/rtems/bsd/util.h
index 2b1e6eeb..a2cd1e80 100644
--- a/rtemsbsd/include/rtems/bsd/util.h
+++ b/rtemsbsd/include/rtems/bsd/util.h
@@ -34,6 +34,8 @@
#include <sys/types.h>
+#include <net/if.h>
+#include <net/if_arp.h>
#include <net/ethernet.h>
#include <stdint.h>
@@ -57,6 +59,24 @@ extern "C" {
int
rtems_bsd_get_ethernet_addr(const char *ifname, uint8_t eaddr[ETHER_ADDR_LEN]);
+typedef void (*rtems_bsd_arp_processor)(void *arg, int fd,
+ const uint8_t eaddr[ETHER_ADDR_LEN], const struct arphdr *ar,
+ uint32_t spa, uint32_t tpa, const uint8_t *sha, const uint8_t *tha);
+
+typedef struct rtems_bsd_arp_processor_context rtems_bsd_arp_processor_context;
+
+rtems_bsd_arp_processor_context *
+rtems_bsd_arp_processor_create(const char *ifname);
+
+int
+rtems_bsd_arp_processor_get_file_descriptor(
+ const rtems_bsd_arp_processor_context *ctx);
+
+int
+rtems_bsd_arp_processor_process(
+ rtems_bsd_arp_processor_context *ctx,
+ rtems_bsd_arp_processor processor, void *arg);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */