9 bool Test_ARP_Basic(void)
11 TEST_SETNAME(__func__);
15 // Request test machine's IP
16 ARP_SendRequest(0, BLOB(TEST_IP));
17 TEST_ASSERT( rxlen = Net_Receive(0, sizeof(rxbuf), rxbuf, 1000) );
18 TEST_ASSERT( ARP_Pkt_IsResponse(rxlen, rxbuf, BLOB(TEST_IP), BLOB(TEST_MAC)) );
20 // Request host machine's IP
21 ARP_SendRequest(0, BLOB(HOST_IP));
22 TEST_ASSERT( Net_Receive(0, sizeof(rxbuf), rxbuf, 1000) == 0 );
25 // Ask test machine to request our IP
26 Stack_SendCommand("arprequest "HOST_IP_STR);
27 TEST_ASSERT( rxlen = Net_Receive(0, sizeof(rxbuf), rxbuf, 1000) );
28 TEST_ASSERT( ARP_Pkt_IsRequest(rxlen, rxbuf, HOST_IP) );
31 ARP_SendResponse(0, HOST_IP, HOST_MAC);
33 // Ask test machine to request our IP again (expecting nothing)
34 Stack_SendCommand("arprequest "HOST_IP_STR);
35 TEST_ASSERT( !Net_Receive(0, sizeof(rxbuf), rxbuf, 1000) );