3 |
* Address Resolution Protocol module for IP over Ethernet |
* Address Resolution Protocol module for IP over Ethernet |
4 |
* |
* |
5 |
* $Log$ |
* $Log$ |
6 |
|
* Revision 1.28 2003/02/21 16:43:46 jani |
7 |
|
* byte-order handling functions are in inet.c now and the uperrcase counterparts are gone. opt.h has all the |
8 |
|
* configurable items debug does not need to be directly included. |
9 |
|
* |
10 |
* Revision 1.27 2003/02/20 16:32:24 jani |
* Revision 1.27 2003/02/20 16:32:24 jani |
11 |
* do not directly include lwipopts.h but lwip/opt.h instead |
* do not directly include lwipopts.h but lwip/opt.h instead |
12 |
* |
* |
160 |
*/ |
*/ |
161 |
|
|
162 |
#include "lwip/opt.h" |
#include "lwip/opt.h" |
|
#include "lwip/debug.h" |
|
163 |
#include "lwip/inet.h" |
#include "lwip/inet.h" |
164 |
#include "netif/etharp.h" |
#include "netif/etharp.h" |
165 |
#include "lwip/ip.h" |
#include "lwip/ip.h" |
185 |
#define ARP_REQUEST 1 |
#define ARP_REQUEST 1 |
186 |
#define ARP_REPLY 2 |
#define ARP_REPLY 2 |
187 |
|
|
188 |
#define ARPH_HWLEN(hdr) (NTOHS((hdr)->_hwlen_protolen) >> 8) |
#define ARPH_HWLEN(hdr) (ntohs((hdr)->_hwlen_protolen) >> 8) |
189 |
#define ARPH_PROTOLEN(hdr) (NTOHS((hdr)->_hwlen_protolen) & 0xff) |
#define ARPH_PROTOLEN(hdr) (ntohs((hdr)->_hwlen_protolen) & 0xff) |
190 |
|
|
191 |
#define ARPH_HWLEN_SET(hdr, len) (hdr)->_hwlen_protolen = HTONS(ARPH_PROTOLEN(hdr) | ((len) << 8)) |
#define ARPH_HWLEN_SET(hdr, len) (hdr)->_hwlen_protolen = htons(ARPH_PROTOLEN(hdr) | ((len) << 8)) |
192 |
#define ARPH_PROTOLEN_SET(hdr, len) (hdr)->_hwlen_protolen = HTONS((len) | (ARPH_HWLEN(hdr) << 8)) |
#define ARPH_PROTOLEN_SET(hdr, len) (hdr)->_hwlen_protolen = htons((len) | (ARPH_HWLEN(hdr) << 8)) |
193 |
|
|
194 |
enum etharp_state { |
enum etharp_state { |
195 |
ETHARP_STATE_EMPTY, |
ETHARP_STATE_EMPTY, |