42 #define IPV4(a,b,c,d) \ 43 htonl ( ( (a) << 24 ) | ( (b) << 16 ) | ( (c) << 8 ) | (d) ) 60 DBG (
"inet_ntoa ( %d.%d.%d.%d ) = %s\n",
64 ( (
ntohl (
addr ) >> 0 ) & 0xff ), actual );
65 okx (
strcmp ( actual, text ) == 0, file, line );
67 #define inet_ntoa_ok( addr, text ) \ 68 inet_ntoa_okx ( addr, text, __FILE__, __LINE__ ) 84 DBG (
"inet_aton ( \"%s\" ) = %s\n", text,
inet_ntoa ( actual ) );
87 #define inet_aton_ok( text, addr ) \ 88 inet_aton_okx ( text, addr, __FILE__, __LINE__ ) 104 #define inet_aton_fail_ok( text ) \ 105 inet_aton_fail_okx ( text, __FILE__, __LINE__ ) #define IN_IS_CLASSA(addr)
#define IN_IS_CLASSB(addr)
Self-test infrastructure.
const char * name
Test set name.
static void inet_ntoa_okx(uint32_t addr, const char *text, const char *file, unsigned int line)
Report an inet_ntoa() test result.
struct self_test ipv4_test __self_test
IPv4 self-test.
#define okx(success, file, line)
Report test result.
#define inet_aton_ok(text, addr)
int inet_aton(const char *string, struct in_addr *in)
Parse IPv4 address.
char * inet_ntoa(struct in_addr in)
Convert IPv4 address to dotted-quad notation.
#define inet_ntoa_ok(addr, text)
static void inet_aton_fail_okx(const char *text, const char *file, unsigned int line)
Report an inet_aton() failure test result.
#define IPV4(a, b, c, d)
Define inline IPv4 address.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
int strcmp(const char *first, const char *second)
Compare strings.
#define inet_aton_fail_ok(text)
#define IN_IS_MULTICAST(addr)
static void ipv4_test_exec(void)
Perform IPv4 self-tests.
#define IN_IS_CLASSC(addr)
#define DBG(...)
Print a debugging message.
static void inet_aton_okx(const char *text, uint32_t addr, const char *file, unsigned int line)
Report an inet_aton() test result.