Getting rid of sctp_init_client function. The only thing it does is call the sctp_init_socket function.

master
Pedro Alvarez 3 years ago
parent 3295449619
commit e9a7e6dbae

@ -86,7 +86,7 @@ protected:
namespace net_utils {
bool sctp_init_client(unique_socket* socket, net_utils::socket_type socktype, const char* bind_addr_str, int bind_port);
bool sctp_init_socket(unique_socket* socket, net_utils::socket_type socktype, const char* bind_addr_str, int bind_port);
bool sctp_init_server(unique_socket* socket, net_utils::socket_type socktype, const char* bind_addr_str, int port);
} // namespace net_utils

@ -55,8 +55,8 @@ int test_socket_handler()
TESTASSERT(sctp_init_server(&server_socket, socket_type::seqpacket, server_addr, server_port));
logger.info("Listening from fd=%d", server_socket.fd());
TESTASSERT(sctp_init_client(&client_socket, socket_type::seqpacket, "127.0.0.1", 0));
TESTASSERT(sctp_init_client(&client_socket2, socket_type::seqpacket, "127.0.0.2", 0));
TESTASSERT(sctp_init_socket(&client_socket, socket_type::seqpacket, "127.0.0.1", 0));
TESTASSERT(sctp_init_socket(&client_socket2, socket_type::seqpacket, "127.0.0.2", 0));
TESTASSERT(client_socket.connect_to(server_addr, server_port));
TESTASSERT(client_socket2.connect_to(server_addr, server_port));

@ -611,7 +611,7 @@ bool ngap::connect_amf()
logger.info("Connecting to AMF %s:%d", args.amf_addr.c_str(), int(AMF_PORT));
// Init SCTP socket and bind it
if (not sctp_init_client(&amf_socket, socket_type::seqpacket, args.ngc_bind_addr.c_str(), 0)) {
if (not sctp_init_socket(&amf_socket, socket_type::seqpacket, args.ngc_bind_addr.c_str(), 0)) {
return false;
}
logger.info("SCTP socket opened. fd=%d", amf_socket.fd());

@ -479,7 +479,8 @@ bool s1ap::connect_mme()
logger.info("Connecting to MME %s:%d", args.mme_addr.c_str(), int(MME_PORT));
// Init SCTP socket and bind it
if (not sctp_init_client(&mme_socket, socket_type::seqpacket, args.s1c_bind_addr.c_str(), args.s1c_bind_port)) {
if (not srsran::net_utils::sctp_init_socket(
&mme_socket, socket_type::seqpacket, args.s1c_bind_addr.c_str(), args.s1c_bind_port)) {
return false;
}
logger.info("SCTP socket opened. fd=%d", mme_socket.fd());

Loading…
Cancel
Save