1 #ifndef MINIX_TEST_SOCKLIB_H
2 #define MINIX_TEST_SOCKLIB_H
4 /* TCP/IP test values. */
5 #define TEST_PORT_A 12345 /* this port should be free and usable */
6 #define TEST_PORT_B 12346 /* this port should be free and usable */
8 #define LOOPBACK_IFNAME "lo0" /* loopback interface name */
9 #define LOOPBACK_IPV4 "127.0.0.1" /* IPv4 address */
10 #define LOOPBACK_LL_IPV6 "fe80::1" /* link-local IPv6 address */
12 /* These address should simply eat all packets. */
14 * IMPORTANT: the ::2 address works only if there is a route for ::/64. This
15 * route is supposed to be added by /etc/rc.d/network, and is not present by
16 * default. As a result, the tests will pass only when regular system/network
17 * initialization is not skipped. We cannot add the route ourselves, since not
18 * all tests run as root.
20 #define TEST_BLACKHOLE_IPV4 "127.255.0.254"
21 #define TEST_BLACKHOLE_IPV6 "::2"
22 #define TEST_BLACKHOLE_LL_IPV6 "fe80::ffff"
24 #define BAD_SCOPE_ID 255 /* guaranteed not to belong to an interface */
99 int socklib_sweep_call(enum call call
, int fd
, struct sockaddr
* local_addr
,
100 struct sockaddr
* remote_addr
, socklen_t addr_len
);
101 void socklib_sweep(int domain
, int type
, int protocol
,
102 const enum state
* states
, unsigned int nstates
, const int * results
,
103 int (* proc
)(int domain
, int type
, int protocol
, enum state
,
106 void socklib_multicast_tx_options(int type
);
107 void socklib_large_transfers(int fd
[2]);
108 void socklib_producer_consumer(int fd
[2]);
109 void socklib_stream_recv(int (* socket_pair
)(int, int, int, int *), int domain
,
110 int type
, int (* break_recv
)(int, const char *, size_t));
111 int socklib_find_pcb(const char * path
, int protocol
, uint16_t local_port
,
112 uint16_t remote_port
, struct kinfo_pcb
* ki
);
113 void socklib_test_addrs(int type
, int protocol
);
114 void socklib_test_multicast(int type
, int protocol
);
116 #endif /* !MINIX_TEST_SOCKLIB_H */