summaryrefslogtreecommitdiff
path: root/networking/udhcp/arpping.c
diff options
context:
space:
mode:
authorDenis Vlasenko2006-11-18 19:51:32 +0000
committerDenis Vlasenko2006-11-18 19:51:32 +0000
commit5a3395bc01cd4b11309595a6ecdaf32f8279f378 (patch)
tree1e63aa591a05e9ec75aefdcd639ca4188e583648 /networking/udhcp/arpping.c
parentabfc4cf6d8b9c59724aceb70df5081a1368fdb62 (diff)
downloadbusybox-5a3395bc01cd4b11309595a6ecdaf32f8279f378.zip
busybox-5a3395bc01cd4b11309595a6ecdaf32f8279f378.tar.gz
udhcp: fix indentation and style.
Eliminate (group) a lot of smallish *.h files Remove lots of unneeded #includes
Diffstat (limited to 'networking/udhcp/arpping.c')
-rw-r--r--networking/udhcp/arpping.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/networking/udhcp/arpping.c b/networking/udhcp/arpping.c
index 2716a28..471e36d 100644
--- a/networking/udhcp/arpping.c
+++ b/networking/udhcp/arpping.c
@@ -6,18 +6,31 @@
* by Yoichi Hariguchi <yoichi@fore.com>
*/
-#include <time.h>
-#include <sys/socket.h>
#include <netinet/if_ether.h>
#include <net/if_arp.h>
-#include <netinet/in.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-#include "dhcpd.h"
-#include "arpping.h"
#include "common.h"
+#include "dhcpd.h"
+
+
+struct arpMsg {
+ /* Ethernet header */
+ u_char h_dest[6]; /* destination ether addr */
+ u_char h_source[6]; /* source ether addr */
+ u_short h_proto; /* packet type ID field */
+
+ /* ARP packet */
+ uint16_t htype; /* hardware type (must be ARPHRD_ETHER) */
+ uint16_t ptype; /* protocol type (must be ETH_P_IP) */
+ uint8_t hlen; /* hardware address length (must be 6) */
+ uint8_t plen; /* protocol address length (must be 4) */
+ uint16_t operation; /* ARP opcode */
+ uint8_t sHaddr[6]; /* sender's hardware address */
+ uint8_t sInaddr[4]; /* sender's IP address */
+ uint8_t tHaddr[6]; /* target's hardware address */
+ uint8_t tInaddr[4]; /* target's IP address */
+ uint8_t pad[18]; /* pad for min. Ethernet payload (60 bytes) */
+} ATTRIBUTE_PACKED;
/* args: yiaddr - what IP to ping
* ip - our ip