Commit cdb296a5 authored by Jukka Rissanen's avatar Jukka Rissanen
Browse files

net: apps: Set IPv4 configuration when doing automatic testing



Set the IPv4 address, netmask and default router addresses
that are used for automatic testing.

Change-Id: Iebddc42c56dceeb089af7878102f8a73c30f0b74
Signed-off-by: default avatarJukka Rissanen <jukka.rissanen@linux.intel.com>
parent 7e91a42c
Loading
Loading
Loading
Loading
+27 −6
Original line number Diff line number Diff line
@@ -60,16 +60,16 @@ static uint8_t net_testing_my_mac[] = net_testing_client_mac;
#else /* NET_TESTING_SERVER */
#define MY_IPADDR { { { 0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2 } } }
#define PEER_IPADDR { { { 0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x1 } } }
#endif
#else
#endif /* NET_TESTING_SERVER */
#else /* CONFIG_NET_TESTING_USE_RFC3849_ADDRESSES */
#if NET_TESTING_SERVER
#define MY_IPADDR { { { 0xfe, 0x80, 0, 0, 0, 0, 0, 0, 0x5c, 0x25, 0xe2, 0xff, 0xfe, 0x15, 0x01, 0x01 } } }
#define PEER_IPADDR { { { 0xfe, 0x80, 0, 0, 0, 0, 0, 0, 0xc3, 0x1e, 0x47, 0xff, 0xfe, 0x15, 0x02, 0x02 } } }
#else
#else /* NET_TESTING_SERVER */
#define PEER_IPADDR { { { 0xfe, 0x80, 0, 0, 0, 0, 0, 0, 0x5c, 0x25, 0xe2, 0xff, 0xfe, 0x15, 0x01, 0x01 } } }
#define MY_IPADDR { { { 0xfe, 0x80, 0, 0, 0, 0, 0, 0, 0xc3, 0x1e, 0x47, 0xff, 0xfe, 0x15, 0x02, 0x02 } } }
#endif
#endif
#endif /* NET_TESTING_SERVER */
#endif /* CONFIG_NET_TESTING_USE_RFC3849_ADDRESSES */

static const struct in6_addr net_testing_in6addr_peer = PEER_IPADDR;
static struct in6_addr net_testing_in6addr_my = MY_IPADDR;
@@ -77,10 +77,31 @@ static struct in6_addr net_testing_in6addr_my = MY_IPADDR;
#else /* CONFIG_NETWORKING_WITH_IPV6 */

/* The 192.0.2.0/24 is the private address space for documentation RFC 5737 */
#define MY_IPADDR { { { 192, 0, 2, 2 } } }
#define UIP_IPADDR0 192
#define UIP_IPADDR1 0
#define UIP_IPADDR2 2

#if defined(NET_TESTING_SERVER)
#define UIP_IPADDR3 1
#else
#define UIP_IPADDR3 2
#endif

#define UIP_DRIPADDR0 UIP_IPADDR0
#define UIP_DRIPADDR1 UIP_IPADDR1
#define UIP_DRIPADDR2 UIP_IPADDR2
#define UIP_DRIPADDR3 99

#define MY_IPADDR { { { UIP_IPADDR0, UIP_IPADDR1, UIP_IPADDR2, UIP_IPADDR3 } } }

uip_ipaddr_t uip_hostaddr = { { UIP_IPADDR0, UIP_IPADDR1,
				UIP_IPADDR2, UIP_IPADDR3 } };
uip_ipaddr_t uip_draddr = { { UIP_DRIPADDR0, UIP_DRIPADDR1,
			      UIP_DRIPADDR2, UIP_DRIPADDR3 } };
uip_ipaddr_t uip_netmask = { { 255, 255, 255, 0 } };

#endif /* CONFIG_NETWORKING_WITH_IPV6 */


/* Generic routines for Qemu testing with slip */