mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-01-06 23:09:35 -05:00
please doxygen
git-svn-id: file:///svn/unbound/trunk@1970 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
48c0528720
commit
27090c3ea7
2 changed files with 26 additions and 4 deletions
|
|
@ -48,6 +48,11 @@
|
|||
#include "util/data/msgreply.h"
|
||||
#include "util/data/dname.h"
|
||||
|
||||
#ifndef PF_INET6
|
||||
/** define in case streamtcp is compiled on legacy systems */
|
||||
#define PF_INET6 10
|
||||
#endif
|
||||
|
||||
/** usage information for streamtcp */
|
||||
void usage(char* argv[])
|
||||
{
|
||||
|
|
@ -73,10 +78,6 @@ open_svr(const char* svr, int udp)
|
|||
printf("fatal: bad server specs '%s'\n", svr);
|
||||
exit(1);
|
||||
}
|
||||
#ifndef PF_INET6
|
||||
/** define in case streamtcp is compiled on legacy systems */
|
||||
#define PF_INET6 10
|
||||
#endif
|
||||
fd = socket(addr_is_ip6(&addr, addrlen)?PF_INET6:PF_INET,
|
||||
udp?SOCK_DGRAM:SOCK_STREAM, 0);
|
||||
if(fd == -1) {
|
||||
|
|
|
|||
|
|
@ -243,6 +243,27 @@ net_test()
|
|||
(struct sockaddr_storage*)&b6, i, l6) == i);
|
||||
}
|
||||
}
|
||||
/* test sockaddr_cmp_addr */
|
||||
unit_show_func("util/net_help.c", "sockaddr_cmp_addr");
|
||||
if(1) {
|
||||
struct sockaddr_storage a, b;
|
||||
socklen_t alen = (socklen_t)sizeof(a);
|
||||
socklen_t blen = (socklen_t)sizeof(b);
|
||||
unit_assert(ipstrtoaddr("127.0.0.0", 53, &a, &alen));
|
||||
unit_assert(ipstrtoaddr("127.255.255.255", 53, &b, &blen));
|
||||
unit_assert(sockaddr_cmp_addr(&a, alen, &b, blen) == -1);
|
||||
unit_assert(sockaddr_cmp_addr(&b, blen, &a, alen) == +1);
|
||||
unit_assert(sockaddr_cmp_addr(&a, alen, &a, alen) == 0);
|
||||
unit_assert(sockaddr_cmp_addr(&b, blen, &b, blen) == 0);
|
||||
unit_assert(ipstrtoaddr("192.168.121.5", 53, &a, &alen));
|
||||
unit_assert(sockaddr_cmp_addr(&a, alen, &b, blen) == +1);
|
||||
unit_assert(sockaddr_cmp_addr(&b, blen, &a, alen) == -1);
|
||||
unit_assert(sockaddr_cmp_addr(&a, alen, &a, alen) == 0);
|
||||
unit_assert(ipstrtoaddr("2001:3578:ffeb::99", 53, &b, &blen));
|
||||
unit_assert(sockaddr_cmp_addr(&b, blen, &b, blen) == 0);
|
||||
unit_assert(sockaddr_cmp_addr(&a, alen, &b, blen) == -1);
|
||||
unit_assert(sockaddr_cmp_addr(&b, blen, &a, alen) == +1);
|
||||
}
|
||||
/* test addr_is_ip4mapped */
|
||||
unit_show_func("util/net_help.c", "addr_is_ip4mapped");
|
||||
if(1) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue