summaryrefslogtreecommitdiff
path: root/sys/src/cmd/ip/arp.h
diff options
context:
space:
mode:
authorTaru Karttunen <taruti@taruti.net>2011-03-30 15:46:40 +0300
committerTaru Karttunen <taruti@taruti.net>2011-03-30 15:46:40 +0300
commite5888a1ffdae813d7575f5fb02275c6bb07e5199 (patch)
treed8d51eac403f07814b9e936eed0c9a79195e2450 /sys/src/cmd/ip/arp.h
Import sources from 2011-03-30 iso image
Diffstat (limited to 'sys/src/cmd/ip/arp.h')
-rwxr-xr-xsys/src/cmd/ip/arp.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/sys/src/cmd/ip/arp.h b/sys/src/cmd/ip/arp.h
new file mode 100755
index 000000000..17a71fb14
--- /dev/null
+++ b/sys/src/cmd/ip/arp.h
@@ -0,0 +1,45 @@
+/*
+ * this file used by (at least) the kernel, arpd, snoopy, tboot
+ */
+typedef struct Arppkt Arppkt;
+typedef struct Arpentry Arpentry;
+typedef struct Arpstats Arpstats;
+
+/* Format of ethernet arp request */
+struct Arppkt {
+ uchar d[6];
+ uchar s[6];
+ uchar type[2];
+ uchar hrd[2];
+ uchar pro[2];
+ uchar hln;
+ uchar pln;
+ uchar op[2];
+ uchar sha[6];
+ uchar spa[4];
+ uchar tha[6];
+ uchar tpa[4];
+ };
+
+#define ARPSIZE 42
+
+/* Format of request from starp to user level arpd */
+struct Arpentry {
+ uchar etaddr[6];
+ uchar ipaddr[4];
+ };
+
+/* Arp cache statistics */
+struct Arpstats {
+ int hit;
+ int miss;
+ int failed;
+ };
+
+#define ET_ARP 0x0806
+#define ET_RARP 0x8035
+
+#define ARP_REQUEST 1
+#define ARP_REPLY 2
+#define RARP_REQUEST 3
+#define RARP_REPLY 4