mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-05 23:37:22 +00:00
Improve the socket option configuration (#1404)
o GTP-C Option (Default)
- so_bindtodevice : NULL
gtpc:
addr: 127.0.0.7
option:
so_bindtodevice: vrf-blue
o GTP-U Option (Default)
- so_bindtodevice : NULL
gtpu:
addr: 127.0.0.7
option:
so_bindtodevice: vrf-blue
o PFCP Option (Default)
- so_bindtodevice : NULL
pfcp:
addr: 127.0.0.7
option:
so_bindtodevice: vrf-blue
o SBI Option (Default)
- tcp_nodelay : true
- so_linger.l_onoff : false
sbi:
addr: 127.0.0.10
option:
tcp_nodelay: false
so_linger:
l_onoff: true
l_linger: 10
o NGAP Option (Default)
- sctp_nodelay : true
- so_linger.l_onoff : false
ngap:
addr: 127.0.0.5
option:
stcp_nodelay: false
so_linger:
l_onoff: true
l_linger: 10
o NGAP SCTP Option (Default)
- spp_hbinterval : 5000 (5secs)
- spp_sackdelay : 200 (200ms)
- srto_initial : 3000 (3secs)
- srto_min : 1000 (1sec)
- srto_max : 5000 (5secs)
- sinit_num_ostreams : 30
- sinit_max_instreams : 65535
- sinit_max_attempts : 4
- sinit_max_init_timeo : 8000(8secs)
ngap:
addr: 127.0.0.5
option:
sctp:
spp_hbinterval : 5000
spp_sackdelay : 200
srto_initial : 3000
srto_min : 1000
srto_max : 5000
sinit_num_ostreams : 30
sinit_max_instreams : 65535
sinit_max_attempts : 4
sinit_max_init_timeo : 8000
This commit is contained in:
parent
73836c063c
commit
bcf53124d5
61 changed files with 1725 additions and 701 deletions
|
|
@ -34,31 +34,30 @@ static void test1_func(abts_case *tc, void *data)
|
|||
int rv;
|
||||
ogs_sock_t *udp;
|
||||
ogs_sockaddr_t *addr;
|
||||
ogs_socknode_t *node;
|
||||
|
||||
rv = ogs_getaddrinfo(&addr, AF_UNSPEC, NULL, PORT, AI_PASSIVE);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
node = ogs_socknode_new(addr);
|
||||
ABTS_PTR_NOTNULL(tc, node);
|
||||
udp = ogs_udp_server(node, false);
|
||||
udp = ogs_udp_server(addr, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, udp);
|
||||
ogs_socknode_free(node);
|
||||
ogs_sock_destroy(udp);
|
||||
rv = ogs_freeaddrinfo(addr);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
rv = ogs_getaddrinfo(&addr, AF_UNSPEC, "127.0.0.1", PORT, AI_PASSIVE);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
node = ogs_socknode_new(addr);
|
||||
ABTS_PTR_NOTNULL(tc, node);
|
||||
udp = ogs_udp_server(node, false);
|
||||
udp = ogs_udp_server(addr, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, udp);
|
||||
ogs_socknode_free(node);
|
||||
ogs_sock_destroy(udp);
|
||||
rv = ogs_freeaddrinfo(addr);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
rv = ogs_getaddrinfo(&addr, AF_UNSPEC, "::1", PORT, AI_PASSIVE);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
node = ogs_socknode_new(addr);
|
||||
ABTS_PTR_NOTNULL(tc, node);
|
||||
udp = ogs_udp_server(node, false);
|
||||
udp = ogs_udp_server(addr, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, udp);
|
||||
ogs_socknode_free(node);
|
||||
ogs_sock_destroy(udp);
|
||||
rv = ogs_freeaddrinfo(addr);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
}
|
||||
|
||||
static ogs_thread_t *test2_thread;
|
||||
|
|
@ -68,21 +67,20 @@ static void test2_main(void *data)
|
|||
abts_case *tc = data;
|
||||
ogs_sock_t *tcp;
|
||||
ogs_sockaddr_t *addr;
|
||||
ogs_socknode_t *node;
|
||||
char str[STRLEN];
|
||||
ssize_t size;
|
||||
|
||||
rv = ogs_getaddrinfo(&addr, AF_UNSPEC, "::1", PORT, AI_PASSIVE);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
node = ogs_socknode_new(addr);
|
||||
ABTS_PTR_NOTNULL(tc, node);
|
||||
tcp = ogs_tcp_client(node);
|
||||
tcp = ogs_tcp_client(addr, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, tcp);
|
||||
|
||||
size = ogs_recv(tcp->fd, str, STRLEN, 0);
|
||||
ABTS_INT_EQUAL(tc, strlen(DATASTR), size);
|
||||
|
||||
ogs_socknode_free(node);
|
||||
ogs_sock_destroy(tcp);
|
||||
rv = ogs_freeaddrinfo(addr);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
}
|
||||
|
||||
static void test2_func(abts_case *tc, void *data)
|
||||
|
|
@ -95,9 +93,7 @@ static void test2_func(abts_case *tc, void *data)
|
|||
|
||||
rv = ogs_getaddrinfo(&addr, AF_INET6, NULL, PORT, AI_PASSIVE);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
node = ogs_socknode_new(addr);
|
||||
ABTS_PTR_NOTNULL(tc, node);
|
||||
tcp = ogs_tcp_server(node);
|
||||
tcp = ogs_tcp_server(addr, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, tcp);
|
||||
|
||||
test2_thread = ogs_thread_create(test2_main, tc);
|
||||
|
|
@ -112,7 +108,9 @@ static void test2_func(abts_case *tc, void *data)
|
|||
ogs_thread_destroy(test2_thread);
|
||||
|
||||
ogs_sock_destroy(tcp2);
|
||||
ogs_socknode_free(node);
|
||||
ogs_sock_destroy(tcp);
|
||||
rv = ogs_freeaddrinfo(addr);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
}
|
||||
|
||||
static ogs_thread_t *test3_thread;
|
||||
|
|
@ -127,7 +125,7 @@ static void test3_main(void *data)
|
|||
rv = ogs_getaddrinfo(&addr, AF_INET, NULL, PORT, 0);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
udp = ogs_udp_socket(AF_INET, NULL);
|
||||
udp = ogs_sock_socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||
ABTS_PTR_NOTNULL(tc, udp);
|
||||
|
||||
size = ogs_sendto(udp->fd, DATASTR, strlen(DATASTR), 0, addr);
|
||||
|
|
@ -146,15 +144,12 @@ static void test3_func(abts_case *tc, void *data)
|
|||
ssize_t size;
|
||||
ogs_sockaddr_t sa;
|
||||
ogs_sockaddr_t *addr;
|
||||
ogs_socknode_t *node;
|
||||
char str[STRLEN];
|
||||
char buf[OGS_ADDRSTRLEN];
|
||||
|
||||
rv = ogs_getaddrinfo(&addr, AF_INET, NULL, PORT, AI_PASSIVE);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
node = ogs_socknode_new(addr);
|
||||
ABTS_PTR_NOTNULL(tc, node);
|
||||
udp = ogs_udp_server(node, false);
|
||||
udp = ogs_udp_server(addr, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, udp);
|
||||
|
||||
test3_thread = ogs_thread_create(test3_main, tc);
|
||||
|
|
@ -166,7 +161,10 @@ static void test3_func(abts_case *tc, void *data)
|
|||
|
||||
ogs_thread_destroy(test3_thread);
|
||||
|
||||
ogs_socknode_free(node);
|
||||
ogs_sock_destroy(udp);
|
||||
|
||||
rv = ogs_freeaddrinfo(addr);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
}
|
||||
|
||||
static ogs_thread_t *test4_thread;
|
||||
|
|
@ -176,15 +174,12 @@ static void test4_main(void *data)
|
|||
abts_case *tc = data;
|
||||
ogs_sock_t *udp;
|
||||
ogs_sockaddr_t *addr;
|
||||
ogs_socknode_t *node;
|
||||
char str[STRLEN];
|
||||
ssize_t size;
|
||||
|
||||
rv = ogs_getaddrinfo(&addr, AF_INET, NULL, PORT, 0);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
node = ogs_socknode_new(addr);
|
||||
ABTS_PTR_NOTNULL(tc, node);
|
||||
udp = ogs_udp_client(node);
|
||||
udp = ogs_udp_client(addr, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, udp);
|
||||
|
||||
size = ogs_send(udp->fd, DATASTR, strlen(DATASTR), 0);
|
||||
|
|
@ -193,7 +188,10 @@ static void test4_main(void *data)
|
|||
size = ogs_recv(udp->fd, str, STRLEN, 0);
|
||||
ABTS_INT_EQUAL(tc, strlen(DATASTR), size);
|
||||
|
||||
ogs_socknode_free(node);
|
||||
ogs_sock_destroy(udp);
|
||||
|
||||
rv = ogs_freeaddrinfo(addr);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
}
|
||||
|
||||
static void test4_func(abts_case *tc, void *data)
|
||||
|
|
@ -203,15 +201,12 @@ static void test4_func(abts_case *tc, void *data)
|
|||
ssize_t size;
|
||||
ogs_sockaddr_t sa;
|
||||
ogs_sockaddr_t *addr;
|
||||
ogs_socknode_t *node;
|
||||
char str[STRLEN];
|
||||
char buf[OGS_ADDRSTRLEN];
|
||||
|
||||
rv = ogs_getaddrinfo(&addr, AF_INET, NULL, PORT, AI_PASSIVE);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
node = ogs_socknode_new(addr);
|
||||
ABTS_PTR_NOTNULL(tc, node);
|
||||
udp = ogs_udp_server(node, false);
|
||||
udp = ogs_udp_server(addr, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, udp);
|
||||
|
||||
test4_thread = ogs_thread_create(test4_main, tc);
|
||||
|
|
@ -226,7 +221,10 @@ static void test4_func(abts_case *tc, void *data)
|
|||
|
||||
ogs_thread_destroy(test4_thread);
|
||||
|
||||
ogs_socknode_free(node);
|
||||
ogs_sock_destroy(udp);
|
||||
|
||||
rv = ogs_freeaddrinfo(addr);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
}
|
||||
|
||||
static ogs_thread_t *test5_thread;
|
||||
|
|
@ -242,10 +240,10 @@ static void test5_main(void *data)
|
|||
|
||||
rv = ogs_getaddrinfo(&addr, AF_INET6, NULL, PORT2, AI_PASSIVE);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
node = ogs_socknode_new(addr);
|
||||
ABTS_PTR_NOTNULL(tc, node);
|
||||
udp = ogs_udp_server(node, false);
|
||||
udp = ogs_udp_server(addr, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, udp);
|
||||
rv = ogs_freeaddrinfo(addr);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
rv = ogs_getaddrinfo(&addr, AF_INET6, NULL, PORT, 0);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
|
@ -260,7 +258,7 @@ static void test5_main(void *data)
|
|||
size = ogs_recv(udp->fd, str, STRLEN, 0);
|
||||
ABTS_INT_EQUAL(tc, strlen(DATASTR), size);
|
||||
|
||||
ogs_socknode_free(node);
|
||||
ogs_sock_destroy(udp);
|
||||
}
|
||||
|
||||
static void test5_func(abts_case *tc, void *data)
|
||||
|
|
@ -269,16 +267,15 @@ static void test5_func(abts_case *tc, void *data)
|
|||
int rv;
|
||||
ssize_t size;
|
||||
ogs_sockaddr_t sa, *addr;
|
||||
ogs_socknode_t *node;
|
||||
char str[STRLEN];
|
||||
char buf[OGS_ADDRSTRLEN];
|
||||
|
||||
rv = ogs_getaddrinfo(&addr, AF_INET6, NULL, PORT, AI_PASSIVE);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
node = ogs_socknode_new(addr);
|
||||
ABTS_PTR_NOTNULL(tc, node);
|
||||
udp = ogs_udp_server(node, false);
|
||||
udp = ogs_udp_server(addr, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, udp);
|
||||
rv = ogs_freeaddrinfo(addr);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
rv = ogs_getaddrinfo(&addr, AF_INET6, NULL, PORT2, 0);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
|
@ -299,7 +296,7 @@ static void test5_func(abts_case *tc, void *data)
|
|||
|
||||
ogs_thread_destroy(test5_thread);
|
||||
|
||||
ogs_socknode_free(node);
|
||||
ogs_sock_destroy(udp);
|
||||
}
|
||||
|
||||
static void test6_func(abts_case *tc, void *data)
|
||||
|
|
@ -389,14 +386,14 @@ static void test7_func(abts_case *tc, void *data)
|
|||
rv = ogs_getaddrinfo(&addr, AF_UNSPEC, "localhost", PORT, 0);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
node = ogs_socknode_add(&list, AF_INET, addr);
|
||||
node = ogs_socknode_add(&list, AF_INET, addr, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, node);
|
||||
|
||||
ogs_freeaddrinfo(addr);
|
||||
|
||||
ogs_socknode_remove_all(&list);
|
||||
|
||||
rv = ogs_socknode_probe(&list, &list6, NULL, PORT);
|
||||
rv = ogs_socknode_probe(&list, &list6, NULL, PORT, NULL);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
ogs_socknode_remove_all(&list);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue