45{
48 { "192.168.1.0", 1 },
49 { "10.255.255.254", 1 },
50 { "172.18.5.4", 1 },
51 { "8.8.4.4", 1 },
52 { "0.0.0.0", 1 },
53 { "127.0.0.1", 1 },
54 { "1.256.3.4", 0 },
55 { "256.0.0.1", 0 },
56 { "1.2.3.4:5060", 1 },
57 { "::ffff:5.6.7.8", 1 },
58 { "fdf8:f53b:82e4::53", 1 },
59 { "fe80::200:5aee:feaa:20a2", 1 },
60 { "2001::1", 1 },
61 { "2001:0000:4136:e378:8000:63bf:3fff:fdd2", 1 },
62 { "2001:0002:6c::430", 1 },
63 { "2001:10:240:ab::a", 1 },
64 { "2002:cb0a:3cdd:1::1", 1 },
65 { "2001:db8:8:4::2", 1 },
66 { "ff01:0:0:0:0:0:0:2", 1 },
67 { "[fdf8:f53b:82e4::53]", 1 },
68 { "[fe80::200:5aee:feaa:20a2]", 1 },
69 { "[2001::1]", 1 },
70 { "[2001:0000:4136:e378:8000:63bf:3fff:fdd2]:5060", 1 },
71 { "2001:0000:4136:e378:8000:63bf:3fff:fdd2:5060", 0 },
72 { "fe80::200::abcd", 0 },
73 };
74
75 size_t x;
77 int parse_result;
78
79 switch (cmd) {
81 info->name =
"parsing";
82 info->category =
"/main/netsock2/";
83 info->summary =
"netsock2 parsing unit test";
85 "Test parsing of IPv4 and IPv6 network addresses";
88 break;
89 }
90
91 for (x = 0; x <
ARRAY_LEN(test_vals); x++) {
92 memset(&addr, 0, sizeof(addr));
96 }
97 if (parse_result) {
100
102 memset(&tmp_addr, 0, sizeof(tmp_addr));
109 }
110 }
111 }
112
113 return res;
114}
static char * ast_sockaddr_stringify(const struct ast_sockaddr *addr)
Wrapper around ast_sockaddr_stringify_fmt() with default format.
int ast_sockaddr_cmp_addr(const struct ast_sockaddr *a, const struct ast_sockaddr *b)
Compares the addresses of two ast_sockaddr structures.
int ast_sockaddr_parse(struct ast_sockaddr *addr, const char *str, int flags)
Parse an IPv4 or IPv6 address string.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Socket address structure.
#define ast_test_status_update(a, b, c...)