Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 1 | /* |
| 2 | * arpping .h |
| 3 | */ |
| 4 | |
| 5 | #ifndef ARPPING_H |
| 6 | #define ARPPING_H |
| 7 | |
| 8 | #include <netinet/if_ether.h> |
| 9 | #include <net/if_arp.h> |
| 10 | #include <net/if.h> |
| 11 | #include <netinet/in.h> |
| 12 | |
| 13 | struct arpMsg { |
| 14 | struct ethhdr ethhdr; /* Ethernet header */ |
Eric Andersen | ad95373 | 2004-01-30 23:45:53 +0000 | [diff] [blame^] | 15 | uint16_t htype; /* hardware type (must be ARPHRD_ETHER) */ |
| 16 | uint16_t ptype; /* protocol type (must be ETH_P_IP) */ |
| 17 | uint8_t hlen; /* hardware address length (must be 6) */ |
| 18 | uint8_t plen; /* protocol address length (must be 4) */ |
| 19 | uint16_t operation; /* ARP opcode */ |
| 20 | uint8_t sHaddr[6]; /* sender's hardware address */ |
| 21 | uint8_t sInaddr[4]; /* sender's IP address */ |
| 22 | uint8_t tHaddr[6]; /* target's hardware address */ |
| 23 | uint8_t tInaddr[4]; /* target's IP address */ |
| 24 | uint8_t pad[18]; /* pad for min. Ethernet payload (60 bytes) */ |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 25 | }; |
| 26 | |
| 27 | /* function prototypes */ |
Eric Andersen | ad95373 | 2004-01-30 23:45:53 +0000 | [diff] [blame^] | 28 | int arpping(uint32_t yiaddr, uint32_t ip, uint8_t *arp, char *interface); |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 29 | |
| 30 | #endif |