ntp: rename NIO_Get*Socket functions
This commit is contained in:
parent
7a90dab8ff
commit
6d1dda0fad
3 changed files with 9 additions and 9 deletions
|
@ -415,7 +415,7 @@ NCR_GetInstance(NTP_Remote_Address *remote_addr, NTP_Source_Type type, SourcePar
|
||||||
result->mode = MODE_CLIENT;
|
result->mode = MODE_CLIENT;
|
||||||
break;
|
break;
|
||||||
case NTP_PEER:
|
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;
|
result->mode = MODE_ACTIVE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -551,7 +551,7 @@ NCR_ChangeRemoteAddress(NCR_Instance inst, NTP_Remote_Address *remote_addr)
|
||||||
if (inst->mode == MODE_CLIENT)
|
if (inst->mode == MODE_CLIENT)
|
||||||
close_client_socket(inst);
|
close_client_socket(inst);
|
||||||
else
|
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 */
|
/* Update the reference ID and reset the source/sourcestats instances */
|
||||||
SRC_SetRefid(inst->source, UTI_IPToRefid(&remote_addr->ip_addr),
|
SRC_SetRefid(inst->source, UTI_IPToRefid(&remote_addr->ip_addr),
|
||||||
|
@ -885,7 +885,7 @@ transmit_timeout(void *arg)
|
||||||
if (inst->mode == MODE_CLIENT) {
|
if (inst->mode == MODE_CLIENT) {
|
||||||
close_client_socket(inst);
|
close_client_socket(inst);
|
||||||
assert(inst->local_addr.sock_fd == INVALID_SOCK_FD);
|
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
|
/* 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.ip_addr = *addr;
|
||||||
destination->addr.port = port;
|
destination->addr.port = port;
|
||||||
destination->local_addr.ip_addr.family = IPADDR_UNSPEC;
|
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;
|
destination->interval = interval;
|
||||||
|
|
||||||
SCH_AddTimeoutInClass(destination->interval, SAMPLING_SEPARATION, SAMPLING_RANDOMNESS,
|
SCH_AddTimeoutInClass(destination->interval, SAMPLING_SEPARATION, SAMPLING_RANDOMNESS,
|
||||||
|
|
4
ntp_io.c
4
ntp_io.c
|
@ -347,7 +347,7 @@ NIO_Finalise(void)
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|
||||||
int
|
int
|
||||||
NIO_GetClientSocket(NTP_Remote_Address *remote_addr)
|
NIO_OpenClientSocket(NTP_Remote_Address *remote_addr)
|
||||||
{
|
{
|
||||||
if (separate_client_sockets) {
|
if (separate_client_sockets) {
|
||||||
int sock_fd = prepare_separate_client_socket(remote_addr->ip_addr.family);
|
int sock_fd = prepare_separate_client_socket(remote_addr->ip_addr.family);
|
||||||
|
@ -378,7 +378,7 @@ NIO_GetClientSocket(NTP_Remote_Address *remote_addr)
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|
||||||
int
|
int
|
||||||
NIO_GetServerSocket(NTP_Remote_Address *remote_addr)
|
NIO_OpenServerSocket(NTP_Remote_Address *remote_addr)
|
||||||
{
|
{
|
||||||
switch (remote_addr->ip_addr.family) {
|
switch (remote_addr->ip_addr.family) {
|
||||||
case IPADDR_INET4:
|
case IPADDR_INET4:
|
||||||
|
|
6
ntp_io.h
6
ntp_io.h
|
@ -39,12 +39,12 @@ extern void NIO_Initialise(int family);
|
||||||
extern void NIO_Finalise(void);
|
extern void NIO_Finalise(void);
|
||||||
|
|
||||||
/* Function to obtain a socket for sending client packets */
|
/* 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 */
|
/* 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);
|
extern void NIO_CloseClientSocket(int sock_fd);
|
||||||
|
|
||||||
/* Function to check if socket is a server socket */
|
/* Function to check if socket is a server socket */
|
||||||
|
|
Loading…
Reference in a new issue