summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-06-16 07:16:29 (GMT)
committerGitHub <noreply@github.com>2023-06-16 07:16:29 (GMT)
commit546d79dad7b75e58160a4110bd27c75272b69678 (patch)
tree6e2f94cdabc52b09572205ccac6cc571b56cdd91 /utils
parent68eba3da69e659fab69bbef5901ce42e82cea1dc (diff)
downloadhdf5-546d79dad7b75e58160a4110bd27c75272b69678.zip
hdf5-546d79dad7b75e58160a4110bd27c75272b69678.tar.gz
hdf5-546d79dad7b75e58160a4110bd27c75272b69678.tar.bz2
Remove HD prefix from network calls (#3142)
HDsocket(), etc. Only affects the mirror VFD and its test code.
Diffstat (limited to 'utils')
-rw-r--r--utils/mirror_vfd/mirror_server.c20
-rw-r--r--utils/mirror_vfd/mirror_server_stop.c8
2 files changed, 14 insertions, 14 deletions
diff --git a/utils/mirror_vfd/mirror_server.c b/utils/mirror_vfd/mirror_server.c
index 25ab36d..bef743b 100644
--- a/utils/mirror_vfd/mirror_server.c
+++ b/utils/mirror_vfd/mirror_server.c
@@ -241,28 +241,28 @@ prepare_listening_socket(struct server_run *run)
mirror_log(run->loginfo, V_INFO, "preparing socket");
server_addr.sin_family = AF_INET;
- server_addr.sin_addr.s_addr = HDhtonl(INADDR_ANY);
- server_addr.sin_port = HDhtons((uint16_t)run->opts.main_port);
+ server_addr.sin_addr.s_addr = htonl(INADDR_ANY);
+ server_addr.sin_port = htons((uint16_t)run->opts.main_port);
mirror_log(run->loginfo, V_INFO, "socket()");
- ret_value = HDsocket(AF_INET, SOCK_STREAM, 0);
+ ret_value = socket(AF_INET, SOCK_STREAM, 0);
if (ret_value < 0) {
mirror_log(run->loginfo, V_ERR, "listening socket:%d", ret_value);
goto error;
}
mirror_log(run->loginfo, V_ALL, "setsockopt()");
- HDsetsockopt(ret_value, SOL_SOCKET, SO_REUSEADDR, &_true, sizeof(int));
+ setsockopt(ret_value, SOL_SOCKET, SO_REUSEADDR, &_true, sizeof(int));
mirror_log(run->loginfo, V_INFO, "bind()");
- ret = HDbind(ret_value, (struct sockaddr *)&server_addr, sizeof(server_addr));
+ ret = bind(ret_value, (struct sockaddr *)&server_addr, sizeof(server_addr));
if (ret < 0) {
mirror_log(run->loginfo, V_ERR, "bind() %s", HDstrerror(errno));
goto error;
}
mirror_log(run->loginfo, V_INFO, "listen()");
- ret = HDlisten(ret_value, LISTENQ);
+ ret = listen(ret_value, LISTENQ);
if (ret < 0) {
mirror_log(run->loginfo, V_ERR, "H5FD server listen:%d", ret);
goto error;
@@ -392,7 +392,7 @@ accept_connection(struct server_run *run)
/*------------------------------*/
/* accept a connection on a socket */
clilen = sizeof(client_addr);
- connfd = HDaccept(run->listenfd, (struct sockaddr *)&client_addr, &clilen);
+ connfd = accept(run->listenfd, (struct sockaddr *)&client_addr, &clilen);
if (connfd < 0) {
mirror_log(run->loginfo, V_ERR, "accept:%d", connfd);
goto error;
@@ -401,15 +401,15 @@ accept_connection(struct server_run *run)
/*------------------------------*/
/* get client address information */
- host_port = HDgethostbyaddr((const char *)&client_addr.sin_addr.s_addr,
- sizeof(client_addr.sin_addr.s_addr), AF_INET);
+ host_port = gethostbyaddr((const char *)&client_addr.sin_addr.s_addr, sizeof(client_addr.sin_addr.s_addr),
+ AF_INET);
if (host_port == NULL) {
mirror_log(run->loginfo, V_ERR, "gethostbyaddr()");
goto error;
}
/* function has the string space statically scoped -- OK until next call */
- hostaddrp = HDinet_ntoa(client_addr.sin_addr);
+ hostaddrp = inet_ntoa(client_addr.sin_addr);
/* TODO? proper error-checking */
mirror_log(run->loginfo, V_INFO, "server connected with %s (%s)", host_port->h_name, hostaddrp);
diff --git a/utils/mirror_vfd/mirror_server_stop.c b/utils/mirror_vfd/mirror_server_stop.c
index c2874b7..f54b210 100644
--- a/utils/mirror_vfd/mirror_server_stop.c
+++ b/utils/mirror_vfd/mirror_server_stop.c
@@ -137,18 +137,18 @@ send_shutdown(struct mshs_opts *opts)
return -1;
}
- live_socket = HDsocket(AF_INET, SOCK_STREAM, 0);
+ live_socket = socket(AF_INET, SOCK_STREAM, 0);
if (live_socket < 0) {
HDprintf("ERROR socket()\n");
return -1;
}
target_addr.sin_family = AF_INET;
- target_addr.sin_port = HDhtons((uint16_t)opts->portno);
- target_addr.sin_addr.s_addr = HDinet_addr(opts->ip);
+ target_addr.sin_port = htons((uint16_t)opts->portno);
+ target_addr.sin_addr.s_addr = inet_addr(opts->ip);
HDmemset(target_addr.sin_zero, 0, sizeof(target_addr.sin_zero));
- if (HDconnect(live_socket, (struct sockaddr *)&target_addr, (socklen_t)sizeof(target_addr)) < 0) {
+ if (connect(live_socket, (struct sockaddr *)&target_addr, (socklen_t)sizeof(target_addr)) < 0) {
HDprintf("ERROR connect() (%d)\n%s\n", errno, HDstrerror(errno));
return -1;
}