From 6d1dda0fad1b5d311f4a1749f63bd861ac8b1aff Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Mon, 5 Jan 2015 14:17:21 +0100 Subject: [PATCH] ntp: rename NIO_Get*Socket functions --- ntp_core.c | 8 ++++---- ntp_io.c | 4 ++-- ntp_io.h | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ntp_core.c b/ntp_core.c index 050d87e..f179dbf 100644 --- a/ntp_core.c +++ b/ntp_core.c @@ -415,7 +415,7 @@ NCR_GetInstance(NTP_Remote_Address *remote_addr, NTP_Source_Type type, SourcePar result->mode = MODE_CLIENT; break; case NTP_PEER: - result->local_addr.sock_fd = NIO_GetServerSocket(remote_addr); + result->local_addr.sock_fd = NIO_OpenServerSocket(remote_addr); result->mode = MODE_ACTIVE; break; default: @@ -551,7 +551,7 @@ NCR_ChangeRemoteAddress(NCR_Instance inst, NTP_Remote_Address *remote_addr) if (inst->mode == MODE_CLIENT) close_client_socket(inst); else - inst->local_addr.sock_fd = NIO_GetServerSocket(remote_addr); + inst->local_addr.sock_fd = NIO_OpenServerSocket(remote_addr); /* Update the reference ID and reset the source/sourcestats instances */ SRC_SetRefid(inst->source, UTI_IPToRefid(&remote_addr->ip_addr), @@ -885,7 +885,7 @@ transmit_timeout(void *arg) if (inst->mode == MODE_CLIENT) { close_client_socket(inst); assert(inst->local_addr.sock_fd == INVALID_SOCK_FD); - inst->local_addr.sock_fd = NIO_GetClientSocket(&inst->remote_addr); + inst->local_addr.sock_fd = NIO_OpenClientSocket(&inst->remote_addr); } /* Check whether we need to 'warm up' the link to the other end by @@ -1923,7 +1923,7 @@ NCR_AddBroadcastDestination(IPAddr *addr, unsigned short port, int interval) destination->addr.ip_addr = *addr; destination->addr.port = port; destination->local_addr.ip_addr.family = IPADDR_UNSPEC; - destination->local_addr.sock_fd = NIO_GetServerSocket(&destination->addr); + destination->local_addr.sock_fd = NIO_OpenServerSocket(&destination->addr); destination->interval = interval; SCH_AddTimeoutInClass(destination->interval, SAMPLING_SEPARATION, SAMPLING_RANDOMNESS, diff --git a/ntp_io.c b/ntp_io.c index ab9585f..d45dba6 100644 --- a/ntp_io.c +++ b/ntp_io.c @@ -347,7 +347,7 @@ NIO_Finalise(void) /* ================================================== */ int -NIO_GetClientSocket(NTP_Remote_Address *remote_addr) +NIO_OpenClientSocket(NTP_Remote_Address *remote_addr) { if (separate_client_sockets) { int sock_fd = prepare_separate_client_socket(remote_addr->ip_addr.family); @@ -378,7 +378,7 @@ NIO_GetClientSocket(NTP_Remote_Address *remote_addr) /* ================================================== */ int -NIO_GetServerSocket(NTP_Remote_Address *remote_addr) +NIO_OpenServerSocket(NTP_Remote_Address *remote_addr) { switch (remote_addr->ip_addr.family) { case IPADDR_INET4: diff --git a/ntp_io.h b/ntp_io.h index ea81e8a..6714bfe 100644 --- a/ntp_io.h +++ b/ntp_io.h @@ -39,12 +39,12 @@ extern void NIO_Initialise(int family); extern void NIO_Finalise(void); /* Function to obtain a socket for sending client packets */ -extern int NIO_GetClientSocket(NTP_Remote_Address *remote_addr); +extern int NIO_OpenClientSocket(NTP_Remote_Address *remote_addr); /* Function to obtain a socket for sending server/peer packets */ -extern int NIO_GetServerSocket(NTP_Remote_Address *remote_addr); +extern int NIO_OpenServerSocket(NTP_Remote_Address *remote_addr); -/* Function to close a socket returned by NIO_GetClientSocket() */ +/* Function to close a socket returned by NIO_OpenClientSocket() */ extern void NIO_CloseClientSocket(int sock_fd); /* Function to check if socket is a server socket */