diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-06-16 07:16:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-16 07:16:29 (GMT) |
commit | 546d79dad7b75e58160a4110bd27c75272b69678 (patch) | |
tree | 6e2f94cdabc52b09572205ccac6cc571b56cdd91 /src | |
parent | 68eba3da69e659fab69bbef5901ce42e82cea1dc (diff) | |
download | hdf5-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 'src')
-rw-r--r-- | src/H5FDmirror.c | 16 | ||||
-rw-r--r-- | src/H5private.h | 42 |
2 files changed, 8 insertions, 50 deletions
diff --git a/src/H5FDmirror.c b/src/H5FDmirror.c index 6f6ae8f..4df0d43 100644 --- a/src/H5FDmirror.c +++ b/src/H5FDmirror.c @@ -285,7 +285,7 @@ H5FD__mirror_xmit_decode_uint16(uint16_t *out, const unsigned char *_buf) HDassert(_buf && out); H5MM_memcpy(&n, _buf, sizeof(n)); - *out = (uint16_t)HDntohs(n); + *out = (uint16_t)ntohs(n); return 2; /* number of bytes eaten */ } /* end H5FD__mirror_xmit_decode_uint16() */ @@ -313,7 +313,7 @@ H5FD__mirror_xmit_decode_uint32(uint32_t *out, const unsigned char *_buf) HDassert(_buf && out); H5MM_memcpy(&n, _buf, sizeof(n)); - *out = (uint32_t)HDntohl(n); + *out = (uint32_t)ntohl(n); return 4; /* number of bytes eaten */ } /* end H5FD__mirror_xmit_decode_uint32() */ @@ -424,7 +424,7 @@ H5FD__mirror_xmit_encode_uint16(unsigned char *_dest, uint16_t v) HDassert(_dest); - n = (uint16_t)HDhtons(v); + n = (uint16_t)htons(v); H5MM_memcpy(_dest, &n, sizeof(n)); return 2; @@ -451,7 +451,7 @@ H5FD__mirror_xmit_encode_uint32(unsigned char *_dest, uint32_t v) HDassert(_dest); - n = (uint32_t)HDhtonl(v); + n = (uint32_t)htonl(v); H5MM_memcpy(_dest, &n, sizeof(n)); return 4; @@ -1380,17 +1380,17 @@ H5FD__mirror_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad /* Handshake with remote */ /* --------------------- */ - live_socket = HDsocket(AF_INET, SOCK_STREAM, 0); + live_socket = socket(AF_INET, SOCK_STREAM, 0); if (live_socket < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "can't create socket"); target_addr.sin_family = AF_INET; - target_addr.sin_port = HDhtons((uint16_t)fa.handshake_port); - target_addr.sin_addr.s_addr = HDinet_addr(fa.remote_ip); + target_addr.sin_port = htons((uint16_t)fa.handshake_port); + target_addr.sin_addr.s_addr = inet_addr(fa.remote_ip); HDmemset(target_addr.sin_zero, '\0', sizeof target_addr.sin_zero); addr_size = sizeof(target_addr); - if (HDconnect(live_socket, (struct sockaddr *)&target_addr, addr_size) < 0) + if (connect(live_socket, (struct sockaddr *)&target_addr, addr_size) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "can't connect to remote server"); /* ------------- */ diff --git a/src/H5private.h b/src/H5private.h index 433472b..f5c9f40 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -611,9 +611,6 @@ typedef off_t h5_stat_size_t; #ifndef HDabort #define HDabort() abort() #endif -#ifndef HDaccept -#define HDaccept(A, B, C) accept((A), (B), (C)) -#endif #ifndef HDaccess #define HDaccess(F, M) access(F, M) #endif @@ -644,9 +641,6 @@ typedef off_t h5_stat_size_t; #ifndef HDatoll #define HDatoll(S) atoll(S) #endif -#ifndef HDbind -#define HDbind(A, B, C) bind((A), (B), (C)) -#endif #ifndef HDcalloc #define HDcalloc(N, Z) calloc(N, Z) #endif @@ -668,9 +662,6 @@ typedef off_t h5_stat_size_t; #ifndef HDclosedir #define HDclosedir(D) closedir(D) #endif -#ifndef HDconnect -#define HDconnect(A, B, C) connect((A), (B), (C)) -#endif #ifndef HDcreat #define HDcreat(S, M) creat(S, M) #endif @@ -826,9 +817,6 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation); #ifndef HDgetenv #define HDgetenv(S) getenv(S) #endif -#ifndef HDgethostbyaddr -#define HDgethostbyaddr(A, B, C) gethostbyaddr((A), (B), (C)) -#endif #ifndef HDgethostname #define HDgethostname(N, L) gethostname(N, L) #endif @@ -850,18 +838,6 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation); #ifndef HDgmtime #define HDgmtime(T) gmtime(T) #endif -#ifndef HDhtonl -#define HDhtonl(X) htonl((X)) -#endif -#ifndef HDhtons -#define HDhtons(X) htons((X)) -#endif -#ifndef HDinet_addr -#define HDinet_addr(C) inet_addr((C)) -#endif -#ifndef HDinet_ntoa -#define HDinet_ntoa(C) inet_ntoa((C)) -#endif #ifndef HDisalnum #define HDisalnum(C) isalnum((int)(C)) /* Cast for Solaris warning */ #endif @@ -907,9 +883,6 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation); #ifndef HDldexp #define HDldexp(X, N) ldexp(X, N) #endif -#ifndef HDlisten -#define HDlisten(A, B) listen((A), (B)) -#endif #ifndef HDllround #define HDllround(V) llround(V) #endif @@ -973,12 +946,6 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation); #ifndef HDnanosleep #define HDnanosleep(N, O) nanosleep(N, O) #endif -#ifndef HDntohl -#define HDntohl(A) ntohl((A)) -#endif -#ifndef HDntohs -#define HDntohs(A) ntohs((A)) -#endif #ifndef HDopen #define HDopen(F, ...) open(F, __VA_ARGS__) #endif @@ -1100,9 +1067,6 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation); #ifndef HDsetenv #define HDsetenv(N, V, O) setenv(N, V, O) #endif -#ifndef HDsetsockopt -#define HDsetsockopt(A, B, C, D, E) setsockopt((A), (B), (C), (D), (E)) -#endif #ifndef HDsetvbuf #define HDsetvbuf(F, S, M, Z) setvbuf(F, S, M, Z) #endif @@ -1124,9 +1088,6 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation); #ifndef HDsnprintf #define HDsnprintf snprintf /*varargs*/ #endif -#ifndef HDsocket -#define HDsocket(A, B, C) socket((A), (B), (C)) -#endif #ifndef HDsprintf #define HDsprintf sprintf /*varargs*/ #endif @@ -1191,9 +1152,6 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation); #ifndef HDstrndup #define HDstrndup(S, N) strndup(S, N) #endif -#ifndef HDstrpbrk -#define HDstrpbrk(X, Y) strpbrk(X, Y) -#endif #ifndef HDstrrchr #define HDstrrchr(S, C) strrchr(S, C) #endif |