10#if !LWIP_STATS || !UDP_STATS || !MEMP_STATS || !ETHARP_STATS
11#error "This tests needs UDP-, MEMP- and ETHARP-statistics enabled"
13#if !ETHARP_SUPPORT_STATIC_ENTRIES
14#error "This test needs ETHARP_SUPPORT_STATIC_ENTRIES enabled"
31 for(
i = 0;
i < 0xff;
i++) {
40 fail_unless(
p !=
NULL);
50 netif->output = etharp_output;
60 IP4_ADDR(&
test_gw, 192,168,0,1);
87 ethhdr = (
struct eth_hdr*)
p->payload;
97 etharphdr->protolen =
sizeof(ip4_addr_t);
100 SMEMCPY(ðarphdr->sipaddr, adr,
sizeof(ip4_addr_t));
140#if ETHARP_SUPPORT_STATIC_ENTRIES
144 const ip4_addr_t *unused_ipaddr;
150 fail(
"This test needs a default netif");
156 fail_unless(pcb !=
NULL);
161 IP4_ADDR(&adrs[
i], 192,168,0,
i+2);
166 fail_unless(
p !=
NULL);
170 ip_addr_copy_from_ip4(
dst, adrs[
i]);
171 err2 = udp_sendto(pcb,
p, &
dst, 123);
172 fail_unless(err2 ==
ERR_OK);
182 idx = etharp_find_addr(
NULL, &adrs[
i], &unused_ethaddr, &unused_ipaddr);
183 fail_unless(
idx ==
i);
188#if ETHARP_SUPPORT_STATIC_ENTRIES
193 fail_unless(
idx == 0);
201 fail_unless(
p !=
NULL);
205 ip_addr_copy_from_ip4(
dst, adrs[
i]);
206 err2 = udp_sendto(pcb,
p, &
dst, 123);
207 fail_unless(err2 ==
ERR_OK);
217 idx = etharp_find_addr(
NULL, &adrs[
i], &unused_ethaddr, &unused_ipaddr);
219 fail_unless(
idx ==
i+1);
222 fail_unless(
idx == 1);
227#if ETHARP_SUPPORT_STATIC_ENTRIES
232 fail_unless(
idx == 0);
234 fail_unless(
idx == 2);
239 fail_unless(
idx == 0);
241 fail_unless(
idx == -1);
247 fail_unless(
idx == 0);
249#if ETHARP_SUPPORT_STATIC_ENTRIES
254 fail_unless(
idx == -1);
256 fail_unless(
idx == -1);
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define LWIP_UNUSED_ARG(x)
@ LWIP_IANA_HWTYPE_ETHERNET
#define SMEMCPY(dst, src, len)
#define NETIF_FLAG_LINK_UP
#define NETIF_FLAG_ETHARP
#define NETIF_FLAG_BROADCAST
void netif_remove(struct netif *netif)
struct netif * netif_add(struct netif *netif, void *state, netif_init_fn init, netif_input_fn input)
void netif_set_default(struct netif *netif)
void netif_set_up(struct netif *netif)
struct pbuf * pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
u8_t pbuf_free(struct pbuf *p)
#define ETHARP_HWADDR_LEN
Suite * create_suite(const char *name, testfunc *tests, size_t num_tests, SFun setup, SFun teardown)
void lwip_check_ensure_no_alloc(unsigned int skip)
static struct test_info tests[]
struct netif * netif_default
netif_linkoutput_fn linkoutput
struct eth_addr test_ethaddr2
END_TEST Suite * etharp_suite(void)
static ip4_addr_t test_netmask
struct eth_addr test_ethaddr3
static void etharp_remove_all(void)
static err_t default_netif_linkoutput(struct netif *netif, struct pbuf *p)
static ip4_addr_t test_gw
static void etharp_setup(void)
static struct netif test_netif
static err_t default_netif_init(struct netif *netif)
struct eth_addr test_ethaddr
static void default_netif_add(void)
static void create_arp_response(ip4_addr_t *adr)
static ip4_addr_t test_ipaddr
static void default_netif_remove(void)
static int linkoutput_ctr
static void etharp_teardown(void)
struct eth_addr test_ethaddr4