Remove non-standard API function accept4()

This commit is contained in:
Joseph Henry
2021-03-13 21:22:44 -08:00
parent 9185af5426
commit 575cfc364e
3 changed files with 0 additions and 37 deletions

View File

@@ -1463,19 +1463,6 @@ ZTS_API int ZTCALL zts_listen(int fd, int backlog);
*/
ZTS_API int ZTCALL zts_accept(int fd, struct zts_sockaddr *addr, zts_socklen_t *addrlen);
/**
* @brief Accept an incoming connection (sets zts_errno)
*
* @param fd Socket file descriptor
* @param addr Address of remote host for accepted connection
* @param addrlen Length of address
* @param flags
* @return New socket file descriptor on success. ZTS_ERR_SOCKET, ZTS_ERR_SERVICE, ZTS_ERR_ARG on failure.
*/
#if defined(__linux__)
int zts_accept4(int fd, struct zts_sockaddr *addr, zts_socklen_t *addrlen, int flags);
#endif
// Socket level option number
#define ZTS_SOL_SOCKET 0x0fff
// Socket options

View File

@@ -153,29 +153,6 @@ JNIEXPORT jint JNICALL Java_com_zerotier_libzt_ZeroTier_accept(
}
#endif
#if defined(__linux__)
int zts_accept4(int fd, struct zts_sockaddr *addr, zts_socklen_t *addrlen, int flags)
{
if (!(_serviceStateFlags & ZTS_STATE_NET_SERVICE_RUNNING)) {
return ZTS_ERR_SERVICE;
}
return ZTS_ERR_SERVICE; // TODO
}
#endif
#ifdef ZTS_ENABLE_JAVA
#if defined(__linux__)
JNIEXPORT jint JNICALL Java_com_zerotier_libzt_ZeroTier_accept4(
JNIEnv *env, jobject thisObj, jint fd, jobject addr, jint port, jint flags)
{
struct zts_sockaddr_storage ss;
zts_socklen_t addrlen = sizeof(struct zts_sockaddr_storage);
int retval = zts_accept4(fd, (struct zts_sockaddr *)&ss, &addrlen, flags);
ss2zta(env, &ss, addr);
return retval > -1 ? retval : -(zts_errno);
}
#endif
#endif
int zts_setsockopt(int fd, int level, int optname, const void *optval,zts_socklen_t optlen)
{
if (!(_serviceStateFlags & ZTS_STATE_NET_SERVICE_RUNNING)) {

View File

@@ -25,7 +25,6 @@
%ignore zts_sockaddr_in6;
%ignore zts_linger;
%ignore zts_accept4;
%ignore zts_ip_mreq;
%ignore zts_in_pktinfo;
%ignore zts_ipv6_mreq;