7#if !LWIP_STATS || !UDP_STATS || !MEMP_STATS || !ETHARP_STATS
8#error "This tests needs UDP-, MEMP- and ETHARP-statistics enabled"
10#if !ETHARP_SUPPORT_STATIC_ENTRIES
11#error "This test needs ETHARP_SUPPORT_STATIC_ENTRIES enabled"
28 for(
i = 0;
i < 0xff;
i++) {
37 fail_unless(
p !=
NULL);
78 struct eth_hdr *ethhdr;
79 struct etharp_hdr *etharphdr;
84 ethhdr = (
struct eth_hdr*)
p->payload;
85 etharphdr = (
struct etharp_hdr*)(ethhdr + 1);
89 ethhdr->type =
htons(ETHTYPE_ARP);
91 etharphdr->hwtype =
htons( 1);
92 etharphdr->proto =
htons(ETHTYPE_IP);
93 etharphdr->hwlen = ETHARP_HWADDR_LEN;
95 etharphdr->opcode =
htons(ARP_REPLY);
135#if ETHARP_SUPPORT_STATIC_ENTRIES
140 struct eth_addr *unused_ethaddr;
145 fail(
"This test needs a default netif");
151 fail_unless(pcb !=
NULL);
161 fail_unless(
p !=
NULL);
163 err_t err = udp_sendto(pcb,
p, &adrs[
i], 123);
174 idx = etharp_find_addr(
NULL, &adrs[
i], &unused_ethaddr, &unused_ipaddr);
175 fail_unless(
idx ==
i);
180#if ETHARP_SUPPORT_STATIC_ENTRIES
185 fail_unless(
idx == 0);
193 fail_unless(
p !=
NULL);
195 err_t err = udp_sendto(pcb,
p, &adrs[
i], 123);
206 idx = etharp_find_addr(
NULL, &adrs[
i], &unused_ethaddr, &unused_ipaddr);
208 fail_unless(
idx ==
i+1);
211 fail_unless(
idx == 1);
216#if ETHARP_SUPPORT_STATIC_ENTRIES
221 fail_unless(
idx == 0);
223 fail_unless(
idx == 2);
228 fail_unless(
idx == 0);
230 fail_unless(
idx == -1);
236 fail_unless(
idx == 0);
238#if ETHARP_SUPPORT_STATIC_ENTRIES
243 fail_unless(
idx == -1);
245 fail_unless(
idx == -1);
#define LWIP_UNUSED_ARG(x)
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 IP4_ADDR(ipaddr, a, b, c, d)
typedefPACK_STRUCT_END struct ip_addr ip_addr_t
static Suite * create_suite(const char *name, TFun *tests, size_t num_tests, SFun setup, SFun teardown)
static struct test_info tests[]
struct netif * netif_default
struct netif * netif_add(struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask, ip_addr_t *gw, void *state, netif_init_fn init, netif_input_fn input)
void netif_remove(struct netif *netif)
void netif_set_default(struct netif *netif)
void netif_set_up(struct netif *netif)
#define NETIF_FLAG_LINK_UP
#define NETIF_FLAG_ETHARP
#define NETIF_FLAG_BROADCAST
#define SMEMCPY(dst, src, len)
struct pbuf * pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
u8_t pbuf_free(struct pbuf *p)
netif_linkoutput_fn linkoutput
struct eth_addr test_ethaddr2
END_TEST Suite * etharp_suite(void)
struct eth_addr test_ethaddr3
static void etharp_remove_all(void)
static err_t default_netif_linkoutput(struct netif *netif, struct pbuf *p)
static void etharp_setup(void)
static ip_addr_t test_netmask
static struct netif test_netif
static err_t default_netif_init(struct netif *netif)
static ip_addr_t test_ipaddr
struct eth_addr test_ethaddr
static void default_netif_add(void)
static void default_netif_remove(void)
static int linkoutput_ctr
static void etharp_teardown(void)
static void create_arp_response(ip_addr_t *adr)
struct eth_addr test_ethaddr4