mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-05 07:08:11 +00:00
core_getifaddrs is introduced.
IP address of all interfaces is automatically retrived. But, some interface will be discarded. - unspcified IP address - loopback address - IPv6 multicast - IPv6 link-local - IPv6 site-local
This commit is contained in:
parent
6a90caaf8f
commit
4baf7ece46
4 changed files with 129 additions and 14 deletions
|
|
@ -285,6 +285,17 @@ static void sock_test7(abts_case *tc, void *data)
|
|||
ABTS_STR_EQUAL(tc, "::1", CORE_ADDR(&sa, buf));
|
||||
}
|
||||
|
||||
static void sock_test8(abts_case *tc, void *data)
|
||||
{
|
||||
c_sockaddr_t *sa, *iter;
|
||||
status_t rv;
|
||||
|
||||
rv = core_getifaddrs(&sa);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
||||
rv = core_freeaddrinfo(sa);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
}
|
||||
|
||||
abts_suite *testsock(abts_suite *suite)
|
||||
{
|
||||
|
|
@ -297,6 +308,7 @@ abts_suite *testsock(abts_suite *suite)
|
|||
abts_run_test(suite, sock_test5, NULL);
|
||||
abts_run_test(suite, sock_test6, NULL);
|
||||
abts_run_test(suite, sock_test7, NULL);
|
||||
abts_run_test(suite, sock_test8, NULL);
|
||||
|
||||
return suite;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue