aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/arpping.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-11-18 19:51:32 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-11-18 19:51:32 +0000
commit5a3395bc01cd4b11309595a6ecdaf32f8279f378 (patch)
tree1e63aa591a05e9ec75aefdcd639ca4188e583648 /networking/udhcp/arpping.c
parentabfc4cf6d8b9c59724aceb70df5081a1368fdb62 (diff)
downloadbusybox-w32-5a3395bc01cd4b11309595a6ecdaf32f8279f378.tar.gz
busybox-w32-5a3395bc01cd4b11309595a6ecdaf32f8279f378.tar.bz2
busybox-w32-5a3395bc01cd4b11309595a6ecdaf32f8279f378.zip
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 2716a28c6..471e36d62 100644
--- a/networking/udhcp/arpping.c
+++ b/networking/udhcp/arpping.c
@@ -6,18 +6,31 @@
6 * by Yoichi Hariguchi <yoichi@fore.com> 6 * by Yoichi Hariguchi <yoichi@fore.com>
7 */ 7 */
8 8
9#include <time.h>
10#include <sys/socket.h>
11#include <netinet/if_ether.h> 9#include <netinet/if_ether.h>
12#include <net/if_arp.h> 10#include <net/if_arp.h>
13#include <netinet/in.h>
14#include <string.h>
15#include <unistd.h>
16#include <errno.h>
17 11
18#include "dhcpd.h"
19#include "arpping.h"
20#include "common.h" 12#include "common.h"
13#include "dhcpd.h"
14
15
16struct arpMsg {
17 /* Ethernet header */
18 u_char h_dest[6]; /* destination ether addr */
19 u_char h_source[6]; /* source ether addr */
20 u_short h_proto; /* packet type ID field */
21
22 /* ARP packet */
23 uint16_t htype; /* hardware type (must be ARPHRD_ETHER) */
24 uint16_t ptype; /* protocol type (must be ETH_P_IP) */
25 uint8_t hlen; /* hardware address length (must be 6) */
26 uint8_t plen; /* protocol address length (must be 4) */
27 uint16_t operation; /* ARP opcode */
28 uint8_t sHaddr[6]; /* sender's hardware address */
29 uint8_t sInaddr[4]; /* sender's IP address */
30 uint8_t tHaddr[6]; /* target's hardware address */
31 uint8_t tInaddr[4]; /* target's IP address */
32 uint8_t pad[18]; /* pad for min. Ethernet payload (60 bytes) */
33} ATTRIBUTE_PACKED;
21 34
22/* args: yiaddr - what IP to ping 35/* args: yiaddr - what IP to ping
23 * ip - our ip 36 * ip - our ip