diff --git a/examples/c/adhoc.c b/examples/c/adhoc.c index 9c15bf7..135a6c7 100644 --- a/examples/c/adhoc.c +++ b/examples/c/adhoc.c @@ -85,7 +85,7 @@ int main(int argc, char** argv) printf("Join %llx from another machine and ping6 me at %s\n", net_id, ipstr); // Do network stuff! - // zts_socket, zts_connect, etc + // zts_bsd_socket, zts_bsd_connect, etc while (1) { zts_util_delay(500); // Idle indefinitely diff --git a/examples/c/callbackapi.c b/examples/c/callbackapi.c index dffa5b2..02d92ec 100644 --- a/examples/c/callbackapi.c +++ b/examples/c/callbackapi.c @@ -97,7 +97,7 @@ int main(int argc, char** argv) printf("Join %llx from another machine and ping me at %s\n", net_id, ipstr); // Do network stuff! - // zts_socket, zts_connect, etc + // zts_bsd_socket, zts_bsd_connect, etc while (1) { zts_util_delay(500); // Idle indefinitely diff --git a/examples/c/client.c b/examples/c/client.c index 8767f69..cde9919 100644 --- a/examples/c/client.c +++ b/examples/c/client.c @@ -76,23 +76,23 @@ int main(int argc, char** argv) // Connect to remote host - // Can also use traditional: zts_socket(), zts_connect(), etc + // Can also use traditional: zts_bsd_socket(), zts_bsd_connect(), etc printf("Attempting to connect...\n"); - while ((fd = zts_simple_tcp_client(remote_addr, remote_port)) < 0) { + while ((fd = zts_tcp_client(remote_addr, remote_port)) < 0) { printf("Re-attempting to connect...\n"); } // Data I/O printf("Sending message string to server...\n"); - if ((bytes = zts_write(fd, msgStr, strlen(msgStr))) < 0) { + if ((bytes = zts_bsd_write(fd, msgStr, strlen(msgStr))) < 0) { printf("Error (fd=%d, ret=%d, zts_errno=%d). Exiting.\n", fd, bytes, zts_errno); exit(1); } printf("Sent %d bytes: %s\n", bytes, msgStr); printf("Reading message string from server...\n"); - if ((bytes = zts_read(fd, recvBuf, sizeof(recvBuf))) < 0) { + if ((bytes = zts_bsd_read(fd, recvBuf, sizeof(recvBuf))) < 0) { printf("Error (fd=%d, ret=%d, zts_errno=%d). Exiting.\n", fd, bytes, zts_errno); exit(1); } @@ -101,6 +101,6 @@ int main(int argc, char** argv) // Close printf("Closing sockets\n"); - zts_close(fd); + zts_bsd_close(fd); return zts_node_stop(); } diff --git a/examples/c/nonblockingclient.c b/examples/c/nonblockingclient.c index 76177f2..82f011e 100644 --- a/examples/c/nonblockingclient.c +++ b/examples/c/nonblockingclient.c @@ -65,7 +65,7 @@ int main(int argc, char** argv) // Create socket - if ((fd = zts_socket(ZTS_AF_INET, ZTS_SOCK_STREAM, 0)) < 0) { + if ((fd = zts_bsd_socket(ZTS_AF_INET, ZTS_SOCK_STREAM, 0)) < 0) { printf("Error (fd=%d, zts_errno=%d). Exiting.\n", fd, zts_errno); exit(1); } @@ -73,8 +73,8 @@ int main(int argc, char** argv) // Connect // Can also use: - // zts_connect(int fd, const struct zts_sockaddr* addr, zts_socklen_t addrlen); - while (zts_simple_connect(fd, remote_addr, remote_port, 0) != ZTS_ERR_OK) { + // zts_bsd_connect(int fd, const struct zts_sockaddr* addr, zts_socklen_t addrlen); + while (zts_connect(fd, remote_addr, remote_port, 0) != ZTS_ERR_OK) { printf("Attempting to connect...\n"); } @@ -83,14 +83,14 @@ int main(int argc, char** argv) // Wait random intervals to send a message to the server // The non-blocking aspect of this example is server-side while (1) { - if ((bytes = zts_send(fd, msgStr, strlen(msgStr), 0)) < 0) { + if ((bytes = zts_bsd_send(fd, msgStr, strlen(msgStr), 0)) < 0) { printf("Error (fd=%d, ret=%d, zts_errno=%d). Exiting.\n", fd, bytes, zts_errno); exit(1); } - printf("zts_send()=%d\n", bytes); + printf("zts_bsd_send()=%d\n", bytes); zts_util_delay((rand() % 100) * 50); } - zts_close(fd); + zts_bsd_close(fd); return zts_node_stop(); } diff --git a/examples/c/nonblockingserver.c b/examples/c/nonblockingserver.c index 49aff6b..32cf932 100644 --- a/examples/c/nonblockingserver.c +++ b/examples/c/nonblockingserver.c @@ -69,20 +69,20 @@ int main(int argc, char** argv) // Sockets printf("Creating socket...\n"); - if ((fd = zts_socket(ZTS_AF_INET, ZTS_SOCK_STREAM, 0)) < 0) { + if ((fd = zts_bsd_socket(ZTS_AF_INET, ZTS_SOCK_STREAM, 0)) < 0) { printf("Error (fd=%d, ret=%d, zts_errno=%d). Exiting.\n", fd, err, zts_errno); exit(1); } printf("Binding...\n"); // Can also use: - // zts_bind(int fd, const struct zts_sockaddr* addr, zts_socklen_t addrlen) - if ((err = zts_simple_bind(fd, local_addr, local_port) < 0)) { + // zts_bsd_bind(int fd, const struct zts_sockaddr* addr, zts_socklen_t addrlen) + if ((err = zts_bind(fd, local_addr, local_port) < 0)) { printf("Error (fd=%d, ret=%d, zts_errno=%d). Exiting.\n", fd, err, zts_errno); exit(1); } printf("Listening...\n"); int backlog = 100; - if ((err = zts_listen(fd, backlog)) < 0) { + if ((err = zts_bsd_listen(fd, backlog)) < 0) { printf("Error (fd=%d, ret=%d, zts_errno=%d). Exiting.\n", fd, err, zts_errno); exit(1); } @@ -93,12 +93,12 @@ int main(int argc, char** argv) while (1) { // Accept // Can also use - // zts_accept(int fd, struct zts_sockaddr* addr, zts_socklen_t* addrlen) + // zts_bsd_accept(int fd, struct zts_sockaddr* addr, zts_socklen_t* addrlen) char ipstr[ZTS_INET6_ADDRSTRLEN] = { 0 }; unsigned int port = 0; printf("Accepting on listening socket...\n"); - if ((accfd = zts_simple_accept(fd, ipstr, ZTS_INET6_ADDRSTRLEN, &port)) < 0) { + if ((accfd = zts_accept(fd, ipstr, ZTS_INET6_ADDRSTRLEN, &port)) < 0) { printf("Error (fd=%d, ret=%d, zts_errno=%d). Exiting.\n", fd, err, zts_errno); } printf("Accepted connection from %s:%d\n", ipstr, port); @@ -108,16 +108,16 @@ int main(int argc, char** argv) // Technique 1: ZTS_O_NONBLOCK if (0) { - zts_fcntl(fd, ZTS_F_SETFL, ZTS_O_NONBLOCK); - zts_fcntl(accfd, ZTS_F_SETFL, ZTS_O_NONBLOCK); + zts_bsd_fcntl(fd, ZTS_F_SETFL, ZTS_O_NONBLOCK); + zts_bsd_fcntl(accfd, ZTS_F_SETFL, ZTS_O_NONBLOCK); while (1) { - bytes = zts_recv(accfd, recvBuf, sizeof(recvBuf), 0); - printf("zts_recv(%d, ...)=%d\n", accfd, bytes); + bytes = zts_bsd_recv(accfd, recvBuf, sizeof(recvBuf), 0); + printf("zts_bsd_recv(%d, ...)=%d\n", accfd, bytes); zts_util_delay(100); } } - // Technique 2: zts_select + // Technique 2: zts_bsd_select if (0) { struct zts_timeval tv; tv.tv_sec = 0; @@ -128,21 +128,21 @@ int main(int argc, char** argv) ZTS_FD_SET(accfd, &active_fd_set); while (1) { read_fd_set = active_fd_set; - if ((result = zts_select(ZTS_FD_SETSIZE, &read_fd_set, NULL, NULL, &tv) < 0)) { + if ((result = zts_bsd_select(ZTS_FD_SETSIZE, &read_fd_set, NULL, NULL, &tv) < 0)) { // perror ("select"); exit(1); } for (int i = 0; i < ZTS_FD_SETSIZE; i++) { if (ZTS_FD_ISSET(i, &read_fd_set)) { - bytes = zts_recv(accfd, recvBuf, sizeof(recvBuf), 0); - printf("zts_recv(%d, ...)=%d\n", i, bytes); + bytes = zts_bsd_recv(accfd, recvBuf, sizeof(recvBuf), 0); + printf("zts_bsd_recv(%d, ...)=%d\n", i, bytes); } // ZTS_FD_CLR(i, &active_fd_set); } } } - // Technique 3: zts_poll + // Technique 3: zts_bsd_poll if (1) { int numfds = 0; struct zts_pollfd poll_set[16]; @@ -153,17 +153,17 @@ int main(int argc, char** argv) int result = 0; int timeout_ms = 50; while (1) { - result = zts_poll(poll_set, numfds, timeout_ms); - printf("zts_poll()=%d\n", result); + result = zts_bsd_poll(poll_set, numfds, timeout_ms); + printf("zts_bsd_poll()=%d\n", result); for (int i = 0; i < numfds; i++) { if (poll_set[i].revents & ZTS_POLLIN) { - bytes = zts_recv(poll_set[i].fd, recvBuf, sizeof(recvBuf), 0); - printf("zts_recv(%d, ...)=%d\n", i, bytes); + bytes = zts_bsd_recv(poll_set[i].fd, recvBuf, sizeof(recvBuf), 0); + printf("zts_bsd_recv(%d, ...)=%d\n", i, bytes); } } } } - err = zts_close(fd); + err = zts_bsd_close(fd); return zts_node_stop(); } diff --git a/examples/c/nostorage.c b/examples/c/nostorage.c index 4dcfa4e..bceddb3 100644 --- a/examples/c/nostorage.c +++ b/examples/c/nostorage.c @@ -97,7 +97,7 @@ int main(int argc, char** argv) } // Do network stuff! - // zts_socket, zts_connect, etc + // zts_bsd_socket, zts_bsd_connect, etc printf("Node %llx is now online. Idling.\n", zts_node_get_id()); while (1) { diff --git a/examples/c/pingable-node.c b/examples/c/pingable-node.c index d479257..d1672bc 100644 --- a/examples/c/pingable-node.c +++ b/examples/c/pingable-node.c @@ -56,7 +56,7 @@ int main(int argc, char** argv) printf("Join %llx from another machine and ping me at %s\n", net_id, ipstr); // Do network stuff! - // zts_socket, zts_connect, etc + // zts_bsd_socket, zts_bsd_connect, etc while (1) { zts_util_delay(500); // Idle indefinitely diff --git a/examples/c/server.c b/examples/c/server.c index cec5ba0..184f1f2 100644 --- a/examples/c/server.c +++ b/examples/c/server.c @@ -72,12 +72,12 @@ int main(int argc, char** argv) // Accept incoming connection - // Can also use traditional: zts_socket(), zts_bind(), zts_listen(), zts_accept(), etc. + // Can also use traditional: zts_bsd_socket(), zts_bsd_bind(), zts_bsd_listen(), zts_bsd_accept(), etc. char remote_addr[ZTS_INET6_ADDRSTRLEN] = { 0 }; int remote_port = 0; int len = ZTS_INET6_ADDRSTRLEN; - if ((accfd = zts_simple_tcp_server(local_addr, local_port, remote_addr, len, &remote_port)) < 0) { + if ((accfd = zts_tcp_server(local_addr, local_port, remote_addr, len, &remote_port)) < 0) { printf("Error (fd=%d, zts_errno=%d). Exiting.\n", accfd, zts_errno); exit(1); } @@ -89,13 +89,13 @@ int main(int argc, char** argv) char recvBuf[128] = { 0 }; printf("Reading message string from client...\n"); - if ((bytes = zts_read(accfd, recvBuf, sizeof(recvBuf))) < 0) { + if ((bytes = zts_bsd_read(accfd, recvBuf, sizeof(recvBuf))) < 0) { printf("Error (fd=%d, ret=%d, zts_errno=%d). Exiting.\n", fd, bytes, zts_errno); exit(1); } printf("Read %d bytes: %s\n", bytes, recvBuf); printf("Sending message string to client...\n"); - if ((bytes = zts_write(accfd, recvBuf, bytes)) < 0) { + if ((bytes = zts_bsd_write(accfd, recvBuf, bytes)) < 0) { printf("Error (fd=%d, ret=%d, zts_errno=%d). Exiting.\n", fd, bytes, zts_errno); exit(1); } @@ -104,7 +104,7 @@ int main(int argc, char** argv) // Close printf("Closing sockets\n"); - err = zts_close(accfd); - err = zts_close(fd); + err = zts_bsd_close(accfd); + err = zts_bsd_close(fd); return zts_node_stop(); } diff --git a/examples/c/statistics.c b/examples/c/statistics.c index 425c67c..6fa59d2 100644 --- a/examples/c/statistics.c +++ b/examples/c/statistics.c @@ -57,7 +57,7 @@ int main(int argc, char** argv) printf("Join %llx from another machine and ping me at %s\n", net_id, ipstr); // Do network stuff! - // zts_socket, zts_connect, etc + // zts_bsd_socket, zts_bsd_connect, etc // Show protocol statistics diff --git a/include/ZeroTierSockets.h b/include/ZeroTierSockets.h index c5ab7cf..712ef54 100644 --- a/include/ZeroTierSockets.h +++ b/include/ZeroTierSockets.h @@ -1834,7 +1834,7 @@ ZTS_API int ZTCALL zts_stats_get_all(zts_stats_counter_t* dst); * @return Numbered file descriptor on success, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_socket(int family, int type, int protocol); +ZTS_API int ZTCALL zts_bsd_socket(int family, int type, int protocol); /** * @brief Connect a socket to a remote host @@ -1845,7 +1845,7 @@ ZTS_API int ZTCALL zts_socket(int family, int type, int protocol); * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_connect(int fd, const struct zts_sockaddr* addr, zts_socklen_t addrlen); +ZTS_API int ZTCALL zts_bsd_connect(int fd, const struct zts_sockaddr* addr, zts_socklen_t addrlen); /** * @brief Bind a socket to a local address @@ -1856,7 +1856,7 @@ ZTS_API int ZTCALL zts_connect(int fd, const struct zts_sockaddr* addr, zts_sock * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_bind(int fd, const struct zts_sockaddr* addr, zts_socklen_t addrlen); +ZTS_API int ZTCALL zts_bsd_bind(int fd, const struct zts_sockaddr* addr, zts_socklen_t addrlen); /** * @brief Listen for incoming connections on socket @@ -1866,7 +1866,7 @@ ZTS_API int ZTCALL zts_bind(int fd, const struct zts_sockaddr* addr, zts_socklen * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_listen(int fd, int backlog); +ZTS_API int ZTCALL zts_bsd_listen(int fd, int backlog); /** * @brief Accept an incoming connection @@ -1877,7 +1877,7 @@ ZTS_API int ZTCALL zts_listen(int fd, int backlog); * @return New file descriptor if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_accept(int fd, struct zts_sockaddr* addr, zts_socklen_t* addrlen); +ZTS_API int ZTCALL zts_bsd_accept(int fd, struct zts_sockaddr* addr, zts_socklen_t* addrlen); // Socket level option number #define ZTS_SOL_SOCKET 0x0fff @@ -2017,7 +2017,7 @@ typedef struct zts_ipv6_mreq { * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_setsockopt(int fd, int level, int optname, const void* optval, zts_socklen_t optlen); +ZTS_API int ZTCALL zts_bsd_setsockopt(int fd, int level, int optname, const void* optval, zts_socklen_t optlen); /** * @brief Get socket options. @@ -2030,7 +2030,7 @@ ZTS_API int ZTCALL zts_setsockopt(int fd, int level, int optname, const void* op * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_getsockopt(int fd, int level, int optname, void* optval, zts_socklen_t* optlen); +ZTS_API int ZTCALL zts_bsd_getsockopt(int fd, int level, int optname, void* optval, zts_socklen_t* optlen); /** * @brief Get the name (address) of the local end of the socket @@ -2041,7 +2041,7 @@ ZTS_API int ZTCALL zts_getsockopt(int fd, int level, int optname, void* optval, * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_getsockname(int fd, struct zts_sockaddr* addr, zts_socklen_t* addrlen); +ZTS_API int ZTCALL zts_bsd_getsockname(int fd, struct zts_sockaddr* addr, zts_socklen_t* addrlen); /** * @brief Get the name (address) of the remote end of the socket @@ -2052,7 +2052,7 @@ ZTS_API int ZTCALL zts_getsockname(int fd, struct zts_sockaddr* addr, zts_sockle * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_getpeername(int fd, struct zts_sockaddr* addr, zts_socklen_t* addrlen); +ZTS_API int ZTCALL zts_bsd_getpeername(int fd, struct zts_sockaddr* addr, zts_socklen_t* addrlen); /** * @brief Close socket. @@ -2061,7 +2061,7 @@ ZTS_API int ZTCALL zts_getpeername(int fd, struct zts_sockaddr* addr, zts_sockle * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_close(int fd); +ZTS_API int ZTCALL zts_bsd_close(int fd); /* FD_SET used for lwip_select */ @@ -2117,7 +2117,7 @@ typedef struct zts_timeval { * `ZTS_ERR_SERVICE` on failure. Sets `zts_errno` */ ZTS_API int ZTCALL -zts_select(int nfds, zts_fd_set* readfds, zts_fd_set* writefds, zts_fd_set* exceptfds, struct zts_timeval* timeout); +zts_bsd_select(int nfds, zts_fd_set* readfds, zts_fd_set* writefds, zts_fd_set* exceptfds, struct zts_timeval* timeout); // fnctl() commands #define ZTS_F_GETFL 0x0003 @@ -2138,7 +2138,7 @@ zts_select(int nfds, zts_fd_set* readfds, zts_fd_set* writefds, zts_fd_set* exce * @param flags Flags * @return */ -ZTS_API int ZTCALL zts_fcntl(int fd, int cmd, int flags); +ZTS_API int ZTCALL zts_bsd_fcntl(int fd, int cmd, int flags); #define ZTS_POLLIN 0x001 #define ZTS_POLLOUT 0x002 @@ -2170,7 +2170,7 @@ struct zts_pollfd { * the node experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets * `zts_errno` */ -ZTS_API int ZTCALL zts_poll(struct zts_pollfd* fds, zts_nfds_t nfds, int timeout); +ZTS_API int ZTCALL zts_bsd_poll(struct zts_pollfd* fds, zts_nfds_t nfds, int timeout); /** * @brief Control a device @@ -2181,7 +2181,7 @@ ZTS_API int ZTCALL zts_poll(struct zts_pollfd* fds, zts_nfds_t nfds, int timeout * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_ioctl(int fd, unsigned long request, void* argp); +ZTS_API int ZTCALL zts_bsd_ioctl(int fd, unsigned long request, void* argp); /** * @brief Send data to remote host @@ -2193,7 +2193,7 @@ ZTS_API int ZTCALL zts_ioctl(int fd, unsigned long request, void* argp); * @return Number of bytes sent if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API ssize_t ZTCALL zts_send(int fd, const void* buf, size_t len, int flags); +ZTS_API ssize_t ZTCALL zts_bsd_send(int fd, const void* buf, size_t len, int flags); /** * @brief Send data to remote host @@ -2208,7 +2208,7 @@ ZTS_API ssize_t ZTCALL zts_send(int fd, const void* buf, size_t len, int flags); * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ ZTS_API ssize_t ZTCALL -zts_sendto(int fd, const void* buf, size_t len, int flags, const struct zts_sockaddr* addr, zts_socklen_t addrlen); +zts_bsd_sendto(int fd, const void* buf, size_t len, int flags, const struct zts_sockaddr* addr, zts_socklen_t addrlen); struct zts_iovec { void* iov_base; @@ -2239,7 +2239,7 @@ struct zts_msghdr { * @return Number of bytes sent if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API ssize_t ZTCALL zts_sendmsg(int fd, const struct zts_msghdr* msg, int flags); +ZTS_API ssize_t ZTCALL zts_bsd_sendmsg(int fd, const struct zts_msghdr* msg, int flags); /** * @brief Receive data from remote host @@ -2251,7 +2251,7 @@ ZTS_API ssize_t ZTCALL zts_sendmsg(int fd, const struct zts_msghdr* msg, int fla * @return Number of bytes received if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API ssize_t ZTCALL zts_recv(int fd, void* buf, size_t len, int flags); +ZTS_API ssize_t ZTCALL zts_bsd_recv(int fd, void* buf, size_t len, int flags); /** * @brief Receive data from remote host @@ -2266,7 +2266,7 @@ ZTS_API ssize_t ZTCALL zts_recv(int fd, void* buf, size_t len, int flags); * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ ZTS_API ssize_t ZTCALL -zts_recvfrom(int fd, void* buf, size_t len, int flags, struct zts_sockaddr* addr, zts_socklen_t* addrlen); +zts_bsd_recvfrom(int fd, void* buf, size_t len, int flags, struct zts_sockaddr* addr, zts_socklen_t* addrlen); /** * @brief Receive a message from remote host @@ -2277,7 +2277,7 @@ zts_recvfrom(int fd, void* buf, size_t len, int flags, struct zts_sockaddr* addr * @return Number of bytes received if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API ssize_t ZTCALL zts_recvmsg(int fd, struct zts_msghdr* msg, int flags); +ZTS_API ssize_t ZTCALL zts_bsd_recvmsg(int fd, struct zts_msghdr* msg, int flags); /** * @brief Read data from socket onto buffer @@ -2288,7 +2288,7 @@ ZTS_API ssize_t ZTCALL zts_recvmsg(int fd, struct zts_msghdr* msg, int flags); * @return Number of bytes read if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API ssize_t ZTCALL zts_read(int fd, void* buf, size_t len); +ZTS_API ssize_t ZTCALL zts_bsd_read(int fd, void* buf, size_t len); /** * @brief Read data from socket into multiple buffers @@ -2299,7 +2299,7 @@ ZTS_API ssize_t ZTCALL zts_read(int fd, void* buf, size_t len); * @return Number of bytes read if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API ssize_t ZTCALL zts_readv(int fd, const struct zts_iovec* iov, int iovcnt); +ZTS_API ssize_t ZTCALL zts_bsd_readv(int fd, const struct zts_iovec* iov, int iovcnt); /** * @brief Write data from buffer to socket @@ -2310,7 +2310,7 @@ ZTS_API ssize_t ZTCALL zts_readv(int fd, const struct zts_iovec* iov, int iovcnt * @return Number of bytes written if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API ssize_t ZTCALL zts_write(int fd, const void* buf, size_t len); +ZTS_API ssize_t ZTCALL zts_bsd_write(int fd, const void* buf, size_t len); /** * @brief Write data from multiple buffers to socket. @@ -2321,7 +2321,7 @@ ZTS_API ssize_t ZTCALL zts_write(int fd, const void* buf, size_t len); * @return Number of bytes written if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API ssize_t ZTCALL zts_writev(int fd, const struct zts_iovec* iov, int iovcnt); +ZTS_API ssize_t ZTCALL zts_bsd_writev(int fd, const struct zts_iovec* iov, int iovcnt); #define ZTS_SHUT_RD 0x0 #define ZTS_SHUT_WR 0x1 @@ -2336,20 +2336,31 @@ ZTS_API ssize_t ZTCALL zts_writev(int fd, const struct zts_iovec* iov, int iovcn * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_shutdown(int fd, int how); +ZTS_API int ZTCALL zts_bsd_shutdown(int fd, int how); //----------------------------------------------------------------------------// -// Convenience functions // +// Simplified socket API // //----------------------------------------------------------------------------// /** - * Helper functions that simplify API wrapper generation and usage in other - * non-C-like languages. Use simple integer types instead of bit flags, - * limit the number of operations each function performs, prevent the user - * from needing to manipulate the contents of structures in a non-native - * language. + * A subset (and) extension of the traditional BSD-style socket API that simplifies + * API wrapper generation and usage in other non-C-like languages. Uses simple + * integer types instead of bit flags, limit the number of operations each function + * performs, prevent the user from needing to manipulate the contents of structures + * in a non-native language. */ +/** + * @brief Create a socket + * + * @param family `ZTS_AF_INET` or `ZTS_AF_INET6` + * @param type `ZTS_SOCK_STREAM` or `ZTS_SOCK_DGRAM` + * @param protocol Protocols supported on this socket + * @return Numbered file descriptor on success, `ZTS_ERR_SERVICE` if the node + * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` + */ +ZTS_API int ZTCALL zts_socket(int family, int type, int protocol); + /** * @brief Connect a socket to a remote host * @@ -2357,9 +2368,9 @@ ZTS_API int ZTCALL zts_shutdown(int fd, int how); * links. This means that links between peers do not exist until peers try to * talk to each other. This can be a problem during connection procedures since * some of the initial packets are lost. To alleviate the need to try - * `zts_connect` many times, this function will keep re-trying for you, even if + * `zts_bsd_connect` many times, this function will keep re-trying for you, even if * no known routes exist. However, if the socket is set to `non-blocking` mode - * it will behave identically to `zts_connect` and return immediately upon + * it will behave identically to `zts_bsd_connect` and return immediately upon * failure. * * @param fd Socket file descriptor @@ -2373,7 +2384,7 @@ ZTS_API int ZTCALL zts_shutdown(int fd, int how); * out with no connection made, `ZTS_ERR_SERVICE` if the node experiences a * problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_connect(int fd, const char* ipstr, unsigned short port, int timeout_ms); +ZTS_API int ZTCALL zts_connect(int fd, const char* ipstr, unsigned short port, int timeout_ms); /** * @brief Bind a socket to a local address @@ -2384,7 +2395,17 @@ ZTS_API int ZTCALL zts_simple_connect(int fd, const char* ipstr, unsigned short * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_bind(int fd, const char* ipstr, unsigned short port); +ZTS_API int ZTCALL zts_bind(int fd, const char* ipstr, unsigned short port); + +/** + * @brief Listen for incoming connections on socket + * + * @param fd Socket file descriptor + * @param backlog Number of backlogged connections allowed + * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node + * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` + */ +ZTS_API int ZTCALL zts_listen(int fd, int backlog); /** * @brief Accept an incoming connection @@ -2397,7 +2418,89 @@ ZTS_API int ZTCALL zts_simple_bind(int fd, const char* ipstr, unsigned short por * @return New file descriptor if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_accept(int fd, char* remote_addr, int len, unsigned short* port); +ZTS_API int ZTCALL zts_accept(int fd, char* remote_addr, int len, unsigned short* port); + +/** + * @brief Send data to remote host + * + * @param fd Socket file descriptor + * @param buf Pointer to data buffer + * @param len Length of data to write + * @param flags (e.g. `ZTS_MSG_DONTWAIT`, `ZTS_MSG_MORE`) + * @return Number of bytes sent if successful, `ZTS_ERR_SERVICE` if the node + * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` + */ +ZTS_API ssize_t ZTCALL zts_send(int fd, const void* buf, size_t len, int flags); + +/** + * @brief Receive data from remote host + * + * @param fd Socket file descriptor + * @param buf Pointer to data buffer + * @param len Length of data buffer + * @param flags Specifies the type of message receipt + * @return Number of bytes received if successful, `ZTS_ERR_SERVICE` if the node + * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` + */ +ZTS_API ssize_t ZTCALL zts_recv(int fd, void* buf, size_t len, int flags); + +/** + * @brief Read data from socket onto buffer + * + * @param fd Socket file descriptor + * @param buf Pointer to data buffer + * @param len Length of data buffer to receive data + * @return Number of bytes read if successful, `ZTS_ERR_SERVICE` if the node + * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` + */ +ZTS_API ssize_t ZTCALL zts_read(int fd, void* buf, size_t len); + +/** + * @brief Write data from buffer to socket + * + * @param fd Socket file descriptor + * @param buf Pointer to data buffer + * @param len Length of buffer to write + * @return Number of bytes written if successful, `ZTS_ERR_SERVICE` if the node + * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` + */ +ZTS_API ssize_t ZTCALL zts_write(int fd, const void* buf, size_t len); + +/** + * @brief Shut down `read` aspect of a socket + * + * @param fd Socket file descriptor + * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node + * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` + */ +ZTS_API int ZTCALL zts_shutdown_rd(int fd); + +/** + * @brief Shut down `write` aspect of a socket + * + * @param fd Socket file descriptor + * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node + * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` + */ +ZTS_API int ZTCALL zts_shutdown_wr(int fd); + +/** + * @brief Shut down both `read` and `write` aspect of a socket + * + * @param fd Socket file descriptor + * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node + * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` + */ +ZTS_API int ZTCALL zts_shutdown_rdwr(int fd); + +/** + * @brief Close socket. + * + * @param fd Socket file descriptor + * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node + * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` + */ +ZTS_API int ZTCALL zts_close(int fd); /** * @brief Get the name (address) of the remote end of the socket @@ -2408,7 +2511,7 @@ ZTS_API int ZTCALL zts_simple_accept(int fd, char* remote_addr, int len, unsigne * @param port Value-result parameter that will contain resultant port number * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_getpeername(int fd, char* remote_addr_str, int len, unsigned short* port); +ZTS_API int ZTCALL zts_getpeername(int fd, char* remote_addr_str, int len, unsigned short* port); /** * @brief Get the name (address) of the local end of the socket @@ -2419,7 +2522,7 @@ ZTS_API int ZTCALL zts_simple_getpeername(int fd, char* remote_addr_str, int len * @param port Value-result parameter that will contain resultant port number * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_getsockname(int fd, char* local_addr_str, int len, unsigned short* port); +ZTS_API int ZTCALL zts_getsockname(int fd, char* local_addr_str, int len, unsigned short* port); /** * @brief A convenience function that takes a remote address IP string and creates @@ -2431,7 +2534,7 @@ ZTS_API int ZTCALL zts_simple_getsockname(int fd, char* local_addr_str, int len, * @return New file descriptor if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_tcp_client(const char* remote_ipstr, unsigned short remote_port); +ZTS_API int ZTCALL zts_tcp_client(const char* remote_ipstr, unsigned short remote_port); /** * @brief A convenience function that takes a remote address IP string and creates @@ -2446,7 +2549,7 @@ ZTS_API int ZTCALL zts_simple_tcp_client(const char* remote_ipstr, unsigned shor * @return New file descriptor if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_tcp_server( +ZTS_API int ZTCALL zts_tcp_server( const char* local_ipstr, unsigned short local_port, char* remote_ipstr, @@ -2463,11 +2566,11 @@ ZTS_API int ZTCALL zts_simple_tcp_server( * @return New file descriptor if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_udp_server(const char* local_ipstr, unsigned short local_port); +ZTS_API int ZTCALL zts_udp_server(const char* local_ipstr, unsigned short local_port); /** * @brief This function doesn't really do anything other than be a namespace - * counterpart to `zts_simple_udp_server`. All this function does is create a + * counterpart to `zts_udp_server`. All this function does is create a * `ZTS_SOCK_DGRAM` socket and return its file descriptor. * * @param remote_ipstr Remote address string. IPv4 or IPv6 @@ -2475,7 +2578,7 @@ ZTS_API int ZTCALL zts_simple_udp_server(const char* local_ipstr, unsigned short * @return New file descriptor if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_udp_client(const char* remote_ipstr); +ZTS_API int ZTCALL zts_udp_client(const char* remote_ipstr); /** * @brief Enable or disable `TCP_NODELAY`. Enabling this is equivalent to @@ -2486,7 +2589,7 @@ ZTS_API int ZTCALL zts_simple_udp_client(const char* remote_ipstr); * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_set_no_delay(int fd, int enabled); +ZTS_API int ZTCALL zts_set_no_delay(int fd, int enabled); /** * @brief Return whether `TCP_NODELAY` is enabled @@ -2495,7 +2598,7 @@ ZTS_API int ZTCALL zts_simple_set_no_delay(int fd, int enabled); * @return `1` if enabled, `0` if disabled, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_get_no_delay(int fd); +ZTS_API int ZTCALL zts_get_no_delay(int fd); /** * @brief Enable or disable `SO_LINGER` while also setting its value @@ -2506,7 +2609,7 @@ ZTS_API int ZTCALL zts_simple_get_no_delay(int fd); * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_set_linger(int fd, int enabled, int value); +ZTS_API int ZTCALL zts_set_linger(int fd, int enabled, int value); /** * @brief Return whether `SO_LINGER` is enabled @@ -2515,7 +2618,7 @@ ZTS_API int ZTCALL zts_simple_set_linger(int fd, int enabled, int value); * @return `1` if enabled, `0` if disabled, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_get_linger_enabled(int fd); +ZTS_API int ZTCALL zts_get_linger_enabled(int fd); /** * @brief Return the value of `SO_LINGER` @@ -2524,7 +2627,7 @@ ZTS_API int ZTCALL zts_simple_get_linger_enabled(int fd); * @return Value of `SO_LINGER` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_get_linger_value(int fd); +ZTS_API int ZTCALL zts_get_linger_value(int fd); /** * @brief Return the number of bytes available to read from the network buffer @@ -2533,7 +2636,7 @@ ZTS_API int ZTCALL zts_simple_get_linger_value(int fd); * @return Number of bytes to read if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_get_pending_data_size(int fd); +ZTS_API int ZTCALL zts_get_pending_data_size(int fd); /** * @brief Enable or disable `SO_REUSEADDR` @@ -2543,7 +2646,7 @@ ZTS_API int ZTCALL zts_simple_get_pending_data_size(int fd); * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_set_reuse_addr(int fd, int enabled); +ZTS_API int ZTCALL zts_set_reuse_addr(int fd, int enabled); /** * @brief Return whether `SO_REUSEADDR` is enabled @@ -2552,7 +2655,7 @@ ZTS_API int ZTCALL zts_simple_set_reuse_addr(int fd, int enabled); * @return `1` if enabled, `0` if disabled, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_get_reuse_addr(int fd); +ZTS_API int ZTCALL zts_get_reuse_addr(int fd); /** * @brief Set the value of `SO_RCVTIMEO` @@ -2563,7 +2666,7 @@ ZTS_API int ZTCALL zts_simple_get_reuse_addr(int fd); * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_set_recv_timeout(int fd, int seconds, int microseconds); +ZTS_API int ZTCALL zts_set_recv_timeout(int fd, int seconds, int microseconds); /** * @brief Return the value of `SO_RCVTIMEO` @@ -2572,7 +2675,7 @@ ZTS_API int ZTCALL zts_simple_set_recv_timeout(int fd, int seconds, int microsec * @return Value of `SO_RCVTIMEO` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_get_recv_timeout(int fd); +ZTS_API int ZTCALL zts_get_recv_timeout(int fd); /** * @brief Set the value of `SO_SNDTIMEO` @@ -2583,7 +2686,7 @@ ZTS_API int ZTCALL zts_simple_get_recv_timeout(int fd); * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_set_send_timeout(int fd, int seconds, int microseconds); +ZTS_API int ZTCALL zts_set_send_timeout(int fd, int seconds, int microseconds); /** * @brief Return the value of `SO_SNDTIMEO` @@ -2592,7 +2695,7 @@ ZTS_API int ZTCALL zts_simple_set_send_timeout(int fd, int seconds, int microsec * @return Value of `SO_SNDTIMEO` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_get_send_timeout(int fd); +ZTS_API int ZTCALL zts_get_send_timeout(int fd); /** * @brief Set the value of `SO_SNDBUF` @@ -2602,7 +2705,7 @@ ZTS_API int ZTCALL zts_simple_get_send_timeout(int fd); * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_set_send_buf_size(int fd, int size); +ZTS_API int ZTCALL zts_set_send_buf_size(int fd, int size); /** * @brief Return the value of `SO_SNDBUF` @@ -2611,7 +2714,7 @@ ZTS_API int ZTCALL zts_simple_set_send_buf_size(int fd, int size); * @return Value of `SO_SNDBUF` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_get_send_buf_size(int fd); +ZTS_API int ZTCALL zts_get_send_buf_size(int fd); /** * @brief Set the value of `SO_RCVBUF` @@ -2621,7 +2724,7 @@ ZTS_API int ZTCALL zts_simple_get_send_buf_size(int fd); * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_set_recv_buf_size(int fd, int size); +ZTS_API int ZTCALL zts_set_recv_buf_size(int fd, int size); /** * @brief Return the value of `SO_RCVBUF` @@ -2630,7 +2733,7 @@ ZTS_API int ZTCALL zts_simple_set_recv_buf_size(int fd, int size); * @return Value of `SO_RCVBUF` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_get_recv_buf_size(int fd); +ZTS_API int ZTCALL zts_get_recv_buf_size(int fd); /** * @brief Set the value of `IP_TTL` @@ -2640,7 +2743,7 @@ ZTS_API int ZTCALL zts_simple_get_recv_buf_size(int fd); * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_set_ttl(int fd, int ttl); +ZTS_API int ZTCALL zts_set_ttl(int fd, int ttl); /** * @brief Return the value of `IP_TTL` @@ -2649,7 +2752,7 @@ ZTS_API int ZTCALL zts_simple_set_ttl(int fd, int ttl); * @return Value of `IP_TTL` `[0,255]` if successful, `ZTS_ERR_SERVICE` if the * node experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_get_ttl(int fd); +ZTS_API int ZTCALL zts_get_ttl(int fd); /** * @brief Change blocking behavior `O_NONBLOCK` @@ -2660,7 +2763,7 @@ ZTS_API int ZTCALL zts_simple_get_ttl(int fd); * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_set_blocking(int fd, int enabled); +ZTS_API int ZTCALL zts_set_blocking(int fd, int enabled); /** * @brief Return whether blocking mode `O_NONBLOCK` is enabled @@ -2669,7 +2772,7 @@ ZTS_API int ZTCALL zts_simple_set_blocking(int fd, int enabled); * @return `1` if enabled, `0` if disabled, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_get_blocking(int fd); +ZTS_API int ZTCALL zts_get_blocking(int fd); /** * @brief Enable or disable `SO_KEEPALIVE` @@ -2679,7 +2782,7 @@ ZTS_API int ZTCALL zts_simple_get_blocking(int fd); * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_set_keepalive(int fd, int enabled); +ZTS_API int ZTCALL zts_set_keepalive(int fd, int enabled); /** * @brief Return whether `SO_KEEPALIVE` is enabled @@ -2688,7 +2791,7 @@ ZTS_API int ZTCALL zts_simple_set_keepalive(int fd, int enabled); * @return `1` if enabled, `0` if disabled, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. Sets `zts_errno` */ -ZTS_API int ZTCALL zts_simple_get_keepalive(int fd); +ZTS_API int ZTCALL zts_get_keepalive(int fd); //----------------------------------------------------------------------------// // DNS // @@ -2712,7 +2815,7 @@ struct zts_hostent { * @param name A null-terminated string representing the name of the host * @return Pointer to struct zts_hostent if successful, NULL otherwise */ -struct zts_hostent* zts_gethostbyname(const char* name); +struct zts_hostent* zts_bsd_gethostbyname(const char* name); struct zts_ip4_addr { uint32_t addr; diff --git a/pkg/nuget/ZeroTier.Sockets/readme.txt b/pkg/nuget/ZeroTier.Sockets/readme.txt index c04fe02..03e8bfe 100644 --- a/pkg/nuget/ZeroTier.Sockets/readme.txt +++ b/pkg/nuget/ZeroTier.Sockets/readme.txt @@ -26,7 +26,7 @@ Other API options: We offer two other API layers depending on your use case. The first is a lower- level BSD-style socket API. This API is similar to BSD-style sockets -(zts_socket(), zts_listen(), zts_bind(), etc.) The second is a Highly- +(zts_bsd_socket(), zts_bsd_listen(), zts_bsd_bind(), etc.) The second is a Highly- performant virtual Ethernet layer. It can be used for any transport protocol and is only recommended for those who have advanced or specialty applications. diff --git a/pkg/nuget/version.in b/pkg/nuget/version.in index 7e4fd51..88c5fb8 100644 --- a/pkg/nuget/version.in +++ b/pkg/nuget/version.in @@ -1 +1 @@ -1.3.4-alpha.0 +1.4.0 diff --git a/src/Sockets.cpp b/src/Sockets.cpp index e39890e..82aba34 100644 --- a/src/Sockets.cpp +++ b/src/Sockets.cpp @@ -32,7 +32,7 @@ namespace ZeroTier { extern "C" { #endif -int zts_socket(const int socket_family, const int socket_type, const int protocol) +int zts_bsd_socket(const int socket_family, const int socket_type, const int protocol) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -40,7 +40,7 @@ int zts_socket(const int socket_family, const int socket_type, const int protoco return lwip_socket(socket_family, socket_type, protocol); } -int zts_connect(int fd, const struct zts_sockaddr* addr, zts_socklen_t addrlen) +int zts_bsd_connect(int fd, const struct zts_sockaddr* addr, zts_socklen_t addrlen) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -55,46 +55,7 @@ int zts_connect(int fd, const struct zts_sockaddr* addr, zts_socklen_t addrlen) return lwip_connect(fd, (sockaddr*)addr, addrlen); } -int zts_simple_connect(int fd, const char* ipstr, unsigned short port, int timeout_ms) -{ - if (! transport_ok()) { - return ZTS_ERR_SERVICE; - } - if (timeout_ms < 0) { - return ZTS_ERR_ARG; - } - if (timeout_ms == 0) { - timeout_ms = 30000; // Default - } - int div = 4; // Must be > 0, Four connection attempts per second - int n_tries = (timeout_ms / 1000) * div; - int connect_delay = 1000 / div; - int err = ZTS_ERR_SOCKET; - - zts_socklen_t addrlen = 0; - struct zts_sockaddr_storage ss; - struct zts_sockaddr* sa = NULL; - - // Convert to standard address structure - - addrlen = sizeof(ss); - zts_util_ipstr_to_saddr(ipstr, port, (struct zts_sockaddr*)&ss, &addrlen); - sa = (struct zts_sockaddr*)&ss; - - if (addrlen > 0 && sa != NULL) { - if (zts_simple_get_blocking(fd)) { - do { - err = zts_connect(fd, sa, addrlen); - zts_util_delay(connect_delay); - n_tries--; - } while ((err < 0) && (zts_errno != 0) && (n_tries > 0)); - } - return err; - } - return ZTS_ERR_ARG; -} - -int zts_bind(int fd, const struct zts_sockaddr* addr, zts_socklen_t addrlen) +int zts_bsd_bind(int fd, const struct zts_sockaddr* addr, zts_socklen_t addrlen) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -108,26 +69,7 @@ int zts_bind(int fd, const struct zts_sockaddr* addr, zts_socklen_t addrlen) return lwip_bind(fd, (sockaddr*)addr, addrlen); } -int zts_simple_bind(int fd, const char* ipstr, unsigned short port) -{ - if (! transport_ok()) { - return ZTS_ERR_SERVICE; - } - zts_socklen_t addrlen = 0; - struct zts_sockaddr_storage ss; - struct zts_sockaddr* sa = NULL; - - addrlen = sizeof(ss); - int err = ZTS_ERR_OK; - if ((err = zts_util_ipstr_to_saddr(ipstr, port, (struct zts_sockaddr*)&ss, &addrlen)) != ZTS_ERR_OK) { - printf("ERRRRRRR=%d\n", err); - return err; - } - sa = (struct zts_sockaddr*)&ss; - return zts_bind(fd, sa, addrlen); -} - -int zts_listen(int fd, int backlog) +int zts_bsd_listen(int fd, int backlog) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -135,7 +77,7 @@ int zts_listen(int fd, int backlog) return lwip_listen(fd, backlog); } -int zts_accept(int fd, struct zts_sockaddr* addr, zts_socklen_t* addrlen) +int zts_bsd_accept(int fd, struct zts_sockaddr* addr, zts_socklen_t* addrlen) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -143,124 +85,7 @@ int zts_accept(int fd, struct zts_sockaddr* addr, zts_socklen_t* addrlen) return lwip_accept(fd, (sockaddr*)addr, (socklen_t*)addrlen); } -int zts_simple_accept(int fd, char* remote_addr, int len, unsigned short* port) -{ - if (! transport_ok()) { - return ZTS_ERR_SERVICE; - } - if (len != ZTS_INET6_ADDRSTRLEN) { - return ZTS_ERR_ARG; - } - zts_sockaddr_storage ss; - zts_socklen_t addrlen = sizeof(ss); - - int acc_fd = zts_accept(fd, (zts_sockaddr*)&ss, (zts_socklen_t*)&addrlen); - int err = ZTS_ERR_OK; - if ((err = zts_util_ntop((struct zts_sockaddr*)&ss, addrlen, remote_addr, len, port)) < ZTS_ERR_OK) { - return err; - } - return acc_fd; -} - -int zts_simple_getpeername(int fd, char* remote_addr_str, int len, unsigned short* port) -{ - if (! transport_ok()) { - return ZTS_ERR_SERVICE; - } - if (len != ZTS_INET6_ADDRSTRLEN) { - return ZTS_ERR_ARG; - } - struct zts_sockaddr_storage ss; - struct zts_sockaddr* sa = (struct zts_sockaddr*)&ss; - int err = ZTS_ERR_OK; - zts_socklen_t addrlen = sizeof(ss); - if ((err = zts_getpeername(fd, sa, &addrlen)) < 0) { - return err; - } - return zts_util_ntop(sa, addrlen, remote_addr_str, len, port); -} - -int zts_simple_getsockname(int fd, char* local_addr_str, int len, unsigned short* port) -{ - if (! transport_ok()) { - return ZTS_ERR_SERVICE; - } - if (len != ZTS_INET6_ADDRSTRLEN) { - return ZTS_ERR_ARG; - } - struct zts_sockaddr_storage ss; - struct zts_sockaddr* sa = (struct zts_sockaddr*)&ss; - int err = ZTS_ERR_OK; - zts_socklen_t addrlen = sizeof(ss); - if ((err = zts_getsockname(fd, sa, &addrlen)) < 0) { - return err; - } - return zts_util_ntop(sa, addrlen, local_addr_str, len, port); -} - -int zts_simple_tcp_client(const char* remote_ipstr, unsigned short remote_port) -{ - int fd, family = zts_util_get_ip_family(remote_ipstr); - if ((fd = zts_socket(family, ZTS_SOCK_STREAM, 0)) < 0) { - return fd; // Failed to create socket - } - int timeout = 0; - if ((fd = zts_simple_connect(fd, remote_ipstr, remote_port, timeout)) < 0) { - zts_close(fd); - return fd; // Failed to connect - } - return fd; -} - -int zts_simple_tcp_server( - const char* local_ipstr, - unsigned short local_port, - char* remote_ipstr, - int len, - unsigned short* remote_port) -{ - int listen_fd, family = zts_util_get_ip_family(local_ipstr); - if ((listen_fd = zts_socket(family, ZTS_SOCK_STREAM, 0)) < 0) { - return listen_fd; // Failed to create socket - } - if ((listen_fd = zts_simple_bind(listen_fd, local_ipstr, local_port)) < 0) { - return listen_fd; // Failed to bind - } - int backlog = 0; - if ((listen_fd = zts_listen(listen_fd, backlog)) < 0) { - return listen_fd; // Failed to listen - } - int acc_fd = 0; - if ((acc_fd = zts_simple_accept(listen_fd, remote_ipstr, len, remote_port)) < 0) { - return acc_fd; // Failed to accept - } - zts_close(listen_fd); - return acc_fd; -} - -int zts_simple_udp_server(const char* local_ipstr, unsigned short local_port) -{ - int fd, family = zts_util_get_ip_family(local_ipstr); - if ((fd = zts_socket(family, ZTS_SOCK_DGRAM, 0)) < 0) { - return fd; // Failed to create socket - } - if ((fd = zts_simple_bind(fd, local_ipstr, local_port)) < 0) { - zts_close(fd); - return fd; // Failed to connect - } - return fd; -} - -int zts_simple_udp_client(const char* remote_ipstr) -{ - int fd, family = zts_util_get_ip_family(remote_ipstr); - if ((fd = zts_socket(family, ZTS_SOCK_DGRAM, 0)) < 0) { - return fd; // Failed to create socket - } - return fd; -} - -int zts_setsockopt(int fd, int level, int optname, const void* optval, zts_socklen_t optlen) +int zts_bsd_setsockopt(int fd, int level, int optname, const void* optval, zts_socklen_t optlen) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -268,7 +93,7 @@ int zts_setsockopt(int fd, int level, int optname, const void* optval, zts_sockl return lwip_setsockopt(fd, level, optname, optval, optlen); } -int zts_getsockopt(int fd, int level, int optname, void* optval, zts_socklen_t* optlen) +int zts_bsd_getsockopt(int fd, int level, int optname, void* optval, zts_socklen_t* optlen) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -276,7 +101,7 @@ int zts_getsockopt(int fd, int level, int optname, void* optval, zts_socklen_t* return lwip_getsockopt(fd, level, optname, optval, (socklen_t*)optlen); } -int zts_getsockname(int fd, struct zts_sockaddr* addr, zts_socklen_t* addrlen) +int zts_bsd_getsockname(int fd, struct zts_sockaddr* addr, zts_socklen_t* addrlen) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -290,7 +115,7 @@ int zts_getsockname(int fd, struct zts_sockaddr* addr, zts_socklen_t* addrlen) return lwip_getsockname(fd, (sockaddr*)addr, (socklen_t*)addrlen); } -int zts_getpeername(int fd, struct zts_sockaddr* addr, zts_socklen_t* addrlen) +int zts_bsd_getpeername(int fd, struct zts_sockaddr* addr, zts_socklen_t* addrlen) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -304,7 +129,7 @@ int zts_getpeername(int fd, struct zts_sockaddr* addr, zts_socklen_t* addrlen) return lwip_getpeername(fd, (sockaddr*)addr, (socklen_t*)addrlen); } -int zts_close(int fd) +int zts_bsd_close(int fd) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -312,7 +137,12 @@ int zts_close(int fd) return lwip_close(fd); } -int zts_select(int nfds, zts_fd_set* readfds, zts_fd_set* writefds, zts_fd_set* exceptfds, struct zts_timeval* timeout) +int zts_bsd_select( + int nfds, + zts_fd_set* readfds, + zts_fd_set* writefds, + zts_fd_set* exceptfds, + struct zts_timeval* timeout) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -320,7 +150,7 @@ int zts_select(int nfds, zts_fd_set* readfds, zts_fd_set* writefds, zts_fd_set* return lwip_select(nfds, (fd_set*)readfds, (fd_set*)writefds, (fd_set*)exceptfds, (timeval*)timeout); } -int zts_fcntl(int fd, int cmd, int flags) +int zts_bsd_fcntl(int fd, int cmd, int flags) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -328,7 +158,7 @@ int zts_fcntl(int fd, int cmd, int flags) return lwip_fcntl(fd, cmd, flags); } -int zts_poll(struct zts_pollfd* fds, nfds_t nfds, int timeout) +int zts_bsd_poll(struct zts_pollfd* fds, nfds_t nfds, int timeout) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -336,7 +166,7 @@ int zts_poll(struct zts_pollfd* fds, nfds_t nfds, int timeout) return lwip_poll((pollfd*)fds, nfds, timeout); } -int zts_ioctl(int fd, unsigned long request, void* argp) +int zts_bsd_ioctl(int fd, unsigned long request, void* argp) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -347,7 +177,7 @@ int zts_ioctl(int fd, unsigned long request, void* argp) return lwip_ioctl(fd, request, argp); } -ssize_t zts_send(int fd, const void* buf, size_t len, int flags) +ssize_t zts_bsd_send(int fd, const void* buf, size_t len, int flags) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -359,7 +189,7 @@ ssize_t zts_send(int fd, const void* buf, size_t len, int flags) } ssize_t -zts_sendto(int fd, const void* buf, size_t len, int flags, const struct zts_sockaddr* addr, zts_socklen_t addrlen) +zts_bsd_sendto(int fd, const void* buf, size_t len, int flags, const struct zts_sockaddr* addr, zts_socklen_t addrlen) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -373,7 +203,7 @@ zts_sendto(int fd, const void* buf, size_t len, int flags, const struct zts_sock return lwip_sendto(fd, buf, len, flags, (sockaddr*)addr, addrlen); } -ssize_t zts_sendmsg(int fd, const struct zts_msghdr* msg, int flags) +ssize_t zts_bsd_sendmsg(int fd, const struct zts_msghdr* msg, int flags) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -381,7 +211,7 @@ ssize_t zts_sendmsg(int fd, const struct zts_msghdr* msg, int flags) return lwip_sendmsg(fd, (const struct msghdr*)msg, flags); } -ssize_t zts_recv(int fd, void* buf, size_t len, int flags) +ssize_t zts_bsd_recv(int fd, void* buf, size_t len, int flags) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -392,7 +222,7 @@ ssize_t zts_recv(int fd, void* buf, size_t len, int flags) return lwip_recv(fd, buf, len, flags); } -ssize_t zts_recvfrom(int fd, void* buf, size_t len, int flags, struct zts_sockaddr* addr, zts_socklen_t* addrlen) +ssize_t zts_bsd_recvfrom(int fd, void* buf, size_t len, int flags, struct zts_sockaddr* addr, zts_socklen_t* addrlen) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -403,7 +233,7 @@ ssize_t zts_recvfrom(int fd, void* buf, size_t len, int flags, struct zts_sockad return lwip_recvfrom(fd, buf, len, flags, (sockaddr*)addr, (socklen_t*)addrlen); } -ssize_t zts_recvmsg(int fd, struct zts_msghdr* msg, int flags) +ssize_t zts_bsd_recvmsg(int fd, struct zts_msghdr* msg, int flags) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -414,7 +244,7 @@ ssize_t zts_recvmsg(int fd, struct zts_msghdr* msg, int flags) return lwip_recvmsg(fd, (struct msghdr*)msg, flags); } -ssize_t zts_read(int fd, void* buf, size_t len) +ssize_t zts_bsd_read(int fd, void* buf, size_t len) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -425,7 +255,7 @@ ssize_t zts_read(int fd, void* buf, size_t len) return lwip_read(fd, buf, len); } -ssize_t zts_readv(int fd, const struct zts_iovec* iov, int iovcnt) +ssize_t zts_bsd_readv(int fd, const struct zts_iovec* iov, int iovcnt) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -433,7 +263,7 @@ ssize_t zts_readv(int fd, const struct zts_iovec* iov, int iovcnt) return lwip_readv(fd, (iovec*)iov, iovcnt); } -ssize_t zts_write(int fd, const void* buf, size_t len) +ssize_t zts_bsd_write(int fd, const void* buf, size_t len) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -444,7 +274,7 @@ ssize_t zts_write(int fd, const void* buf, size_t len) return lwip_write(fd, buf, len); } -ssize_t zts_writev(int fd, const struct zts_iovec* iov, int iovcnt) +ssize_t zts_bsd_writev(int fd, const struct zts_iovec* iov, int iovcnt) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -452,7 +282,7 @@ ssize_t zts_writev(int fd, const struct zts_iovec* iov, int iovcnt) return lwip_writev(fd, (iovec*)iov, iovcnt); } -int zts_shutdown(int fd, int how) +int zts_bsd_shutdown(int fd, int how) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -460,7 +290,7 @@ int zts_shutdown(int fd, int how) return lwip_shutdown(fd, how); } -struct zts_hostent* zts_gethostbyname(const char* name) +struct zts_hostent* zts_bsd_gethostbyname(const char* name) { if (! transport_ok()) { return NULL; @@ -554,7 +384,231 @@ int zts_util_ipstr_to_saddr( return ZTS_ERR_ARG; } -int zts_simple_set_no_delay(int fd, int enabled) +int zts_socket(int family, int type, int protocol) +{ + return zts_bsd_socket(family, type, protocol); +} + +int zts_connect(int fd, const char* ipstr, unsigned short port, int timeout_ms) +{ + if (! transport_ok()) { + return ZTS_ERR_SERVICE; + } + if (timeout_ms < 0) { + return ZTS_ERR_ARG; + } + if (timeout_ms == 0) { + timeout_ms = 30000; // Default + } + int div = 4; // Must be > 0, Four connection attempts per second + int n_tries = (timeout_ms / 1000) * div; + int connect_delay = 1000 / div; + int err = ZTS_ERR_SOCKET; + + zts_socklen_t addrlen = 0; + struct zts_sockaddr_storage ss; + struct zts_sockaddr* sa = NULL; + + // Convert to standard address structure + + addrlen = sizeof(ss); + zts_util_ipstr_to_saddr(ipstr, port, (struct zts_sockaddr*)&ss, &addrlen); + sa = (struct zts_sockaddr*)&ss; + + if (addrlen > 0 && sa != NULL) { + if (zts_get_blocking(fd)) { + do { + err = zts_bsd_connect(fd, sa, addrlen); + zts_util_delay(connect_delay); + n_tries--; + } while ((err < 0) && (zts_errno != 0) && (n_tries > 0)); + } + return err; + } + return ZTS_ERR_ARG; +} + +int zts_bind(int fd, const char* ipstr, unsigned short port) +{ + if (! transport_ok()) { + return ZTS_ERR_SERVICE; + } + zts_socklen_t addrlen = 0; + struct zts_sockaddr_storage ss; + struct zts_sockaddr* sa = NULL; + + addrlen = sizeof(ss); + int err = ZTS_ERR_OK; + if ((err = zts_util_ipstr_to_saddr(ipstr, port, (struct zts_sockaddr*)&ss, &addrlen)) != ZTS_ERR_OK) { + return err; + } + sa = (struct zts_sockaddr*)&ss; + return zts_bsd_bind(fd, sa, addrlen); +} + +int zts_listen(int fd, int backlog) +{ + return zts_bsd_listen(fd, backlog); +} + +int zts_accept(int fd, char* remote_addr, int len, unsigned short* port) +{ + if (! transport_ok()) { + return ZTS_ERR_SERVICE; + } + if (len != ZTS_INET6_ADDRSTRLEN) { + return ZTS_ERR_ARG; + } + zts_sockaddr_storage ss; + zts_socklen_t addrlen = sizeof(ss); + + int acc_fd = zts_bsd_accept(fd, (zts_sockaddr*)&ss, (zts_socklen_t*)&addrlen); + int err = ZTS_ERR_OK; + if ((err = zts_util_ntop((struct zts_sockaddr*)&ss, addrlen, remote_addr, len, port)) < ZTS_ERR_OK) { + return err; + } + return acc_fd; +} + +ssize_t zts_send(int fd, const void* buf, size_t len, int flags) +{ + return zts_bsd_send(fd, buf, len, flags); +} + +ssize_t zts_recv(int fd, void* buf, size_t len, int flags) +{ + return zts_bsd_recv(fd, buf, len, flags); +} + +ssize_t zts_read(int fd, void* buf, size_t len) +{ + return zts_bsd_read(fd, buf, len); +} + +ssize_t zts_write(int fd, const void* buf, size_t len) +{ + return zts_bsd_write(fd, buf, len); +} + +int zts_shutdown_rd(int fd) +{ + return zts_bsd_shutdown(fd, ZTS_SHUT_RD); +} + +int zts_shutdown_wr(int fd) +{ + return zts_bsd_shutdown(fd, ZTS_SHUT_WR); +} + +int zts_shutdown_rdwr(int fd) +{ + return zts_bsd_shutdown(fd, ZTS_SHUT_RDWR); +} + +int zts_close(int fd) +{ + return zts_bsd_close(fd); +} + +int zts_getpeername(int fd, char* remote_addr_str, int len, unsigned short* port) +{ + if (! transport_ok()) { + return ZTS_ERR_SERVICE; + } + if (len != ZTS_INET6_ADDRSTRLEN) { + return ZTS_ERR_ARG; + } + struct zts_sockaddr_storage ss; + struct zts_sockaddr* sa = (struct zts_sockaddr*)&ss; + int err = ZTS_ERR_OK; + zts_socklen_t addrlen = sizeof(ss); + if ((err = zts_bsd_getpeername(fd, sa, &addrlen)) < 0) { + return err; + } + return zts_util_ntop(sa, addrlen, remote_addr_str, len, port); +} + +int zts_getsockname(int fd, char* local_addr_str, int len, unsigned short* port) +{ + if (! transport_ok()) { + return ZTS_ERR_SERVICE; + } + if (len != ZTS_INET6_ADDRSTRLEN) { + return ZTS_ERR_ARG; + } + struct zts_sockaddr_storage ss; + struct zts_sockaddr* sa = (struct zts_sockaddr*)&ss; + int err = ZTS_ERR_OK; + zts_socklen_t addrlen = sizeof(ss); + if ((err = zts_bsd_getsockname(fd, sa, &addrlen)) < 0) { + return err; + } + return zts_util_ntop(sa, addrlen, local_addr_str, len, port); +} + +int zts_tcp_client(const char* remote_ipstr, unsigned short remote_port) +{ + int fd, family = zts_util_get_ip_family(remote_ipstr); + if ((fd = zts_bsd_socket(family, ZTS_SOCK_STREAM, 0)) < 0) { + return fd; // Failed to create socket + } + int timeout = 0; + if ((fd = zts_connect(fd, remote_ipstr, remote_port, timeout)) < 0) { + zts_bsd_close(fd); + return fd; // Failed to connect + } + return fd; +} + +int zts_tcp_server( + const char* local_ipstr, + unsigned short local_port, + char* remote_ipstr, + int len, + unsigned short* remote_port) +{ + int listen_fd, family = zts_util_get_ip_family(local_ipstr); + if ((listen_fd = zts_bsd_socket(family, ZTS_SOCK_STREAM, 0)) < 0) { + return listen_fd; // Failed to create socket + } + if ((listen_fd = zts_bind(listen_fd, local_ipstr, local_port)) < 0) { + return listen_fd; // Failed to bind + } + int backlog = 0; + if ((listen_fd = zts_bsd_listen(listen_fd, backlog)) < 0) { + return listen_fd; // Failed to listen + } + int acc_fd = 0; + if ((acc_fd = zts_accept(listen_fd, remote_ipstr, len, remote_port)) < 0) { + return acc_fd; // Failed to accept + } + zts_bsd_close(listen_fd); + return acc_fd; +} + +int zts_udp_server(const char* local_ipstr, unsigned short local_port) +{ + int fd, family = zts_util_get_ip_family(local_ipstr); + if ((fd = zts_bsd_socket(family, ZTS_SOCK_DGRAM, 0)) < 0) { + return fd; // Failed to create socket + } + if ((fd = zts_bind(fd, local_ipstr, local_port)) < 0) { + zts_bsd_close(fd); + return fd; // Failed to connect + } + return fd; +} + +int zts_udp_client(const char* remote_ipstr) +{ + int fd, family = zts_util_get_ip_family(remote_ipstr); + if ((fd = zts_bsd_socket(family, ZTS_SOCK_DGRAM, 0)) < 0) { + return fd; // Failed to create socket + } + return fd; +} + +int zts_set_no_delay(int fd, int enabled) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -562,23 +616,23 @@ int zts_simple_set_no_delay(int fd, int enabled) if (enabled != 0 && enabled != 1) { return ZTS_ERR_ARG; } - return zts_setsockopt(fd, ZTS_IPPROTO_TCP, ZTS_TCP_NODELAY, (void*)&enabled, sizeof(int)); + return zts_bsd_setsockopt(fd, ZTS_IPPROTO_TCP, ZTS_TCP_NODELAY, (void*)&enabled, sizeof(int)); } -int zts_simple_get_no_delay(int fd) +int zts_get_no_delay(int fd) { if (! transport_ok()) { return ZTS_ERR_SERVICE; } int err, optval = 0; zts_socklen_t len = sizeof(optval); - if ((err = zts_getsockopt(fd, ZTS_IPPROTO_TCP, ZTS_TCP_NODELAY, (void*)&optval, &len)) < 0) { + if ((err = zts_bsd_getsockopt(fd, ZTS_IPPROTO_TCP, ZTS_TCP_NODELAY, (void*)&optval, &len)) < 0) { return err; } return optval != 0; } -int zts_simple_set_linger(int fd, int enabled, int value) +int zts_set_linger(int fd, int enabled, int value) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -592,10 +646,10 @@ int zts_simple_set_linger(int fd, int enabled, int value) struct zts_linger linger; linger.l_onoff = enabled; linger.l_linger = value; - return zts_setsockopt(fd, ZTS_SOL_SOCKET, ZTS_SO_LINGER, (void*)&linger, sizeof(linger)); + return zts_bsd_setsockopt(fd, ZTS_SOL_SOCKET, ZTS_SO_LINGER, (void*)&linger, sizeof(linger)); } -int zts_simple_get_linger_enabled(int fd) +int zts_get_linger_enabled(int fd) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -603,13 +657,13 @@ int zts_simple_get_linger_enabled(int fd) struct zts_linger linger; zts_socklen_t len = sizeof(linger); int err; - if ((err = zts_getsockopt(fd, ZTS_SOL_SOCKET, ZTS_SO_LINGER, (void*)&linger, &len)) < 0) { + if ((err = zts_bsd_getsockopt(fd, ZTS_SOL_SOCKET, ZTS_SO_LINGER, (void*)&linger, &len)) < 0) { return err; } return linger.l_onoff; } -int zts_simple_get_linger_value(int fd) +int zts_get_linger_value(int fd) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -617,26 +671,26 @@ int zts_simple_get_linger_value(int fd) struct zts_linger linger; zts_socklen_t len = sizeof(linger); int err; - if ((err = zts_getsockopt(fd, ZTS_SOL_SOCKET, ZTS_SO_LINGER, (void*)&linger, &len)) < 0) { + if ((err = zts_bsd_getsockopt(fd, ZTS_SOL_SOCKET, ZTS_SO_LINGER, (void*)&linger, &len)) < 0) { return err; } return linger.l_linger; } -int zts_simple_get_pending_data_size(int fd) +int zts_get_pending_data_size(int fd) { if (! transport_ok()) { return ZTS_ERR_SERVICE; } int bytes_available = 0; int err = ZTS_ERR_OK; - if ((err = zts_ioctl(fd, ZTS_FIONREAD, &bytes_available)) < 0) { + if ((err = zts_bsd_ioctl(fd, ZTS_FIONREAD, &bytes_available)) < 0) { return err; } return bytes_available; } -int zts_simple_set_reuse_addr(int fd, int enabled) +int zts_set_reuse_addr(int fd, int enabled) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -644,23 +698,23 @@ int zts_simple_set_reuse_addr(int fd, int enabled) if (enabled != 0 && enabled != 1) { return ZTS_ERR_ARG; } - return zts_setsockopt(fd, ZTS_SOL_SOCKET, ZTS_SO_REUSEADDR, (void*)&enabled, sizeof(enabled)); + return zts_bsd_setsockopt(fd, ZTS_SOL_SOCKET, ZTS_SO_REUSEADDR, (void*)&enabled, sizeof(enabled)); } -int zts_simple_get_reuse_addr(int fd) +int zts_get_reuse_addr(int fd) { if (! transport_ok()) { return ZTS_ERR_SERVICE; } int err, optval = 0; zts_socklen_t optlen = sizeof(optval); - if ((err = zts_getsockopt(fd, ZTS_SOL_SOCKET, ZTS_SO_REUSEADDR, (void*)&optval, &optlen)) < 0) { + if ((err = zts_bsd_getsockopt(fd, ZTS_SOL_SOCKET, ZTS_SO_REUSEADDR, (void*)&optval, &optlen)) < 0) { return err; } return optval != 0; } -int zts_simple_set_recv_timeout(int fd, int seconds, int microseconds) +int zts_set_recv_timeout(int fd, int seconds, int microseconds) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -671,10 +725,10 @@ int zts_simple_set_recv_timeout(int fd, int seconds, int microseconds) struct timeval tv; tv.tv_sec = seconds; tv.tv_usec = microseconds; - return zts_setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (void*)&tv, sizeof(tv)); + return zts_bsd_setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (void*)&tv, sizeof(tv)); } -int zts_simple_get_recv_timeout(int fd) +int zts_get_recv_timeout(int fd) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -682,13 +736,13 @@ int zts_simple_get_recv_timeout(int fd) struct timeval tv; zts_socklen_t optlen = sizeof(tv); int err; - if ((err = zts_getsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (void*)&tv, &optlen)) < 0) { + if ((err = zts_bsd_getsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (void*)&tv, &optlen)) < 0) { return err; } return tv.tv_sec; // TODO microseconds } -int zts_simple_set_send_timeout(int fd, int seconds, int microseconds) +int zts_set_send_timeout(int fd, int seconds, int microseconds) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -699,10 +753,10 @@ int zts_simple_set_send_timeout(int fd, int seconds, int microseconds) struct timeval tv; tv.tv_sec = seconds; tv.tv_usec = microseconds; - return zts_setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, (void*)&tv, sizeof(tv)); + return zts_bsd_setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, (void*)&tv, sizeof(tv)); } -int zts_simple_get_send_timeout(int fd) +int zts_get_send_timeout(int fd) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -710,13 +764,13 @@ int zts_simple_get_send_timeout(int fd) struct zts_timeval tv; zts_socklen_t optlen = sizeof(tv); int err; - if ((err = zts_getsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, (void*)&tv, &optlen)) < 0) { + if ((err = zts_bsd_getsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, (void*)&tv, &optlen)) < 0) { return err; } return tv.tv_sec; // TODO microseconds } -int zts_simple_set_send_buf_size(int fd, int size) +int zts_set_send_buf_size(int fd, int size) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -724,23 +778,23 @@ int zts_simple_set_send_buf_size(int fd, int size) if (size < 0) { return ZTS_ERR_ARG; } - return zts_setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (void*)&size, sizeof(int)); + return zts_bsd_setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (void*)&size, sizeof(int)); } -int zts_simple_get_send_buf_size(int fd) +int zts_get_send_buf_size(int fd) { if (! transport_ok()) { return ZTS_ERR_SERVICE; } int err, optval = 0; zts_socklen_t optlen = sizeof(optval); - if ((err = zts_getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char*)&optval, &optlen)) < 0) { + if ((err = zts_bsd_getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char*)&optval, &optlen)) < 0) { return err; } return optval; } -int zts_simple_set_recv_buf_size(int fd, int size) +int zts_set_recv_buf_size(int fd, int size) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -748,23 +802,23 @@ int zts_simple_set_recv_buf_size(int fd, int size) if (size < 0) { return ZTS_ERR_ARG; } - return zts_setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (void*)&size, sizeof(int)); + return zts_bsd_setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (void*)&size, sizeof(int)); } -int zts_simple_get_recv_buf_size(int fd) +int zts_get_recv_buf_size(int fd) { if (! transport_ok()) { return ZTS_ERR_SERVICE; } int err, optval = 0; zts_socklen_t optlen = sizeof(optval); - if ((err = zts_getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char*)&optval, &optlen)) < 0) { + if ((err = zts_bsd_getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char*)&optval, &optlen)) < 0) { return err; } return optval; } -int zts_simple_set_ttl(int fd, int ttl) +int zts_set_ttl(int fd, int ttl) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -772,23 +826,23 @@ int zts_simple_set_ttl(int fd, int ttl) if (ttl < 0 || ttl > 255) { return ZTS_ERR_ARG; } - return zts_setsockopt(fd, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl)); + return zts_bsd_setsockopt(fd, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl)); } -int zts_simple_get_ttl(int fd) +int zts_get_ttl(int fd) { if (! transport_ok()) { return ZTS_ERR_SERVICE; } int err, ttl = 0; zts_socklen_t optlen = sizeof(ttl); - if ((err = zts_getsockopt(fd, IPPROTO_IP, IP_TTL, &ttl, &optlen)) < 0) { + if ((err = zts_bsd_getsockopt(fd, IPPROTO_IP, IP_TTL, &ttl, &optlen)) < 0) { return err; } return ttl; } -int zts_simple_set_blocking(int fd, int enabled) +int zts_set_blocking(int fd, int enabled) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -796,29 +850,29 @@ int zts_simple_set_blocking(int fd, int enabled) if (enabled != 0 && enabled != 1) { return ZTS_ERR_ARG; } - int flags = zts_fcntl(fd, ZTS_F_GETFL, 0); + int flags = zts_bsd_fcntl(fd, ZTS_F_GETFL, 0); if (! enabled) { - return zts_fcntl(fd, ZTS_F_SETFL, flags | ZTS_O_NONBLOCK); + return zts_bsd_fcntl(fd, ZTS_F_SETFL, flags | ZTS_O_NONBLOCK); } else { // Default - return zts_fcntl(fd, ZTS_F_SETFL, flags & (~ZTS_O_NONBLOCK)); + return zts_bsd_fcntl(fd, ZTS_F_SETFL, flags & (~ZTS_O_NONBLOCK)); } } -int zts_simple_get_blocking(int fd) +int zts_get_blocking(int fd) { if (! transport_ok()) { return ZTS_ERR_SERVICE; } - int flags = zts_fcntl(fd, ZTS_F_GETFL, 0); + int flags = zts_bsd_fcntl(fd, ZTS_F_GETFL, 0); if (flags < 0) { return flags; } return ! (flags & ZTS_O_NONBLOCK); } -int zts_simple_set_keepalive(int fd, int enabled) +int zts_set_keepalive(int fd, int enabled) { if (! transport_ok()) { return ZTS_ERR_SERVICE; @@ -827,17 +881,17 @@ int zts_simple_set_keepalive(int fd, int enabled) return ZTS_ERR_ARG; } int keepalive = enabled; - return zts_setsockopt(fd, ZTS_SOL_SOCKET, ZTS_SO_KEEPALIVE, &keepalive, sizeof(keepalive)); + return zts_bsd_setsockopt(fd, ZTS_SOL_SOCKET, ZTS_SO_KEEPALIVE, &keepalive, sizeof(keepalive)); } -int zts_simple_get_keepalive(int fd) +int zts_get_keepalive(int fd) { if (! transport_ok()) { return ZTS_ERR_SERVICE; } int err, optval = 0; zts_socklen_t optlen = sizeof(optval); - if ((err = zts_getsockopt(fd, ZTS_SOL_SOCKET, ZTS_SO_KEEPALIVE, (void*)&optval, &optlen)) < 0) { + if ((err = zts_bsd_getsockopt(fd, ZTS_SOL_SOCKET, ZTS_SO_KEEPALIVE, (void*)&optval, &optlen)) < 0) { return err; } return optval != 0; diff --git a/src/bindings/csharp/CSharpSockets.cxx b/src/bindings/csharp/CSharpSockets.cxx index e5fef39..2aa2921 100644 --- a/src/bindings/csharp/CSharpSockets.cxx +++ b/src/bindings/csharp/CSharpSockets.cxx @@ -1097,7 +1097,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_stats_get_all(void* jarg1) return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_socket(int jarg1, int jarg2, int jarg3) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_bsd_socket(int jarg1, int jarg2, int jarg3) { int jresult; int arg1; @@ -1107,12 +1107,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_socket(int jarg1, int jarg2, int jarg3) arg1 = (int)jarg1; arg2 = (int)jarg2; arg3 = (int)jarg3; - result = (int)zts_socket(arg1, arg2, arg3); + result = (int)zts_bsd_socket(arg1, arg2, arg3); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_connect(int jarg1, zts_sockaddr* jarg2, unsigned short jarg3) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_bsd_connect(int jarg1, zts_sockaddr* jarg2, unsigned short jarg3) { int jresult; int arg1; @@ -1122,12 +1122,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_connect(int jarg1, zts_sockaddr* jarg2, un arg1 = (int)jarg1; arg2 = (zts_sockaddr*)jarg2; arg3 = (zts_socklen_t)jarg3; - result = (int)zts_connect(arg1, (zts_sockaddr const*)arg2, arg3); + result = (int)zts_bsd_connect(arg1, (zts_sockaddr const*)arg2, arg3); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_connect(int jarg1, char* jarg2, int jarg3, int jarg4) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_connect(int jarg1, char* jarg2, int jarg3, int jarg4) { int jresult; int arg1; @@ -1139,12 +1139,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_connect(int jarg1, char* jarg2, int arg2 = (char*)jarg2; arg3 = (int)jarg3; arg4 = (int)jarg4; - result = (int)zts_simple_connect(arg1, (char const*)arg2, arg3, arg4); + result = (int)zts_connect(arg1, (char const*)arg2, arg3, arg4); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_bind(int jarg1, zts_sockaddr* jarg2, unsigned short jarg3) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_bsd_bind(int jarg1, zts_sockaddr* jarg2, unsigned short jarg3) { int jresult; int arg1; @@ -1154,12 +1154,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_bind(int jarg1, zts_sockaddr* jarg2, unsig arg1 = (int)jarg1; arg2 = (zts_sockaddr*)jarg2; arg3 = (zts_socklen_t)jarg3; - result = (int)zts_bind(arg1, (zts_sockaddr const*)arg2, arg3); + result = (int)zts_bsd_bind(arg1, (zts_sockaddr const*)arg2, arg3); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_bind(int jarg1, char* jarg2, int jarg3) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_bind(int jarg1, char* jarg2, int jarg3) { int jresult; int arg1; @@ -1169,12 +1169,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_bind(int jarg1, char* jarg2, int ja arg1 = (int)jarg1; arg2 = (char*)jarg2; arg3 = (int)jarg3; - result = (int)zts_simple_bind(arg1, (char const*)arg2, arg3); + result = (int)zts_bind(arg1, (char const*)arg2, arg3); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_listen(int jarg1, int jarg2) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_bsd_listen(int jarg1, int jarg2) { int jresult; int arg1; @@ -1182,12 +1182,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_listen(int jarg1, int jarg2) int result; arg1 = (int)jarg1; arg2 = (int)jarg2; - result = (int)zts_listen(arg1, arg2); + result = (int)zts_bsd_listen(arg1, arg2); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_accept(int jarg1, zts_sockaddr* jarg2, void* jarg3) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_bsd_accept(int jarg1, zts_sockaddr* jarg2, void* jarg3) { int jresult; int arg1; @@ -1197,12 +1197,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_accept(int jarg1, zts_sockaddr* jarg2, voi arg1 = (int)jarg1; arg2 = (zts_sockaddr*)jarg2; arg3 = (zts_socklen_t*)jarg3; - result = (int)zts_accept(arg1, arg2, arg3); + result = (int)zts_bsd_accept(arg1, arg2, arg3); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_accept(int jarg1, char* jarg2, int jarg3, void* jarg4) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_accept(int jarg1, char* jarg2, int jarg3, void* jarg4) { int arg1; char* arg2 = (char*)0; @@ -1212,10 +1212,10 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_accept(int jarg1, char* jarg2, int arg2 = (char*)jarg2; arg3 = (int)jarg3; arg4 = (unsigned short*)jarg4; - return zts_simple_accept(arg1, arg2, arg3, arg4); + return zts_accept(arg1, arg2, arg3, arg4); } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_tcp_client(char* jarg1, int jarg2) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_tcp_client(char* jarg1, int jarg2) { int jresult; char* arg1 = (char*)0; @@ -1223,12 +1223,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_tcp_client(char* jarg1, int jarg2) int result; arg1 = (char*)jarg1; arg2 = (int)jarg2; - result = (int)zts_simple_tcp_client((char const*)arg1, arg2); + result = (int)zts_tcp_client((char const*)arg1, arg2); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_tcp_server(char* jarg1, int jarg2, char* jarg3, int jarg4, void* jarg5) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_tcp_server(char* jarg1, int jarg2, char* jarg3, int jarg4, void* jarg5) { char* arg1 = (char*)0; int arg2; @@ -1240,10 +1240,10 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_tcp_server(char* jarg1, int jarg2, arg3 = (char*)jarg3; arg4 = (int)jarg4; arg5 = (unsigned short*)jarg5; - return zts_simple_tcp_server((char const*)arg1, arg2, arg3, arg4, arg5); + return zts_tcp_server((char const*)arg1, arg2, arg3, arg4, arg5); } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_udp_server(char* jarg1, int jarg2) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_udp_server(char* jarg1, int jarg2) { int jresult; char* arg1 = (char*)0; @@ -1251,23 +1251,23 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_udp_server(char* jarg1, int jarg2) int result; arg1 = (char*)jarg1; arg2 = (int)jarg2; - result = (int)zts_simple_udp_server((char const*)arg1, arg2); + result = (int)zts_udp_server((char const*)arg1, arg2); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_udp_client(char* jarg1) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_udp_client(char* jarg1) { int jresult; char* arg1 = (char*)0; int result; arg1 = (char*)jarg1; - result = (int)zts_simple_udp_client((char const*)arg1); + result = (int)zts_udp_client((char const*)arg1); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_setsockopt(int jarg1, int jarg2, int jarg3, void* jarg4, unsigned short jarg5) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_bsd_setsockopt(int jarg1, int jarg2, int jarg3, void* jarg4, unsigned short jarg5) { int jresult; int arg1; @@ -1281,12 +1281,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_setsockopt(int jarg1, int jarg2, int jarg3 arg3 = (int)jarg3; arg4 = (void*)jarg4; arg5 = (zts_socklen_t)jarg5; - result = (int)zts_setsockopt(arg1, arg2, arg3, (void const*)arg4, arg5); + result = (int)zts_bsd_setsockopt(arg1, arg2, arg3, (void const*)arg4, arg5); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_getsockopt(int jarg1, int jarg2, int jarg3, void* jarg4, void* jarg5) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_bsd_getsockopt(int jarg1, int jarg2, int jarg3, void* jarg4, void* jarg5) { int jresult; int arg1; @@ -1300,12 +1300,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_getsockopt(int jarg1, int jarg2, int jarg3 arg3 = (int)jarg3; arg4 = (void*)jarg4; arg5 = (zts_socklen_t*)jarg5; - result = (int)zts_getsockopt(arg1, arg2, arg3, arg4, arg5); + result = (int)zts_bsd_getsockopt(arg1, arg2, arg3, arg4, arg5); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_getsockname(int jarg1, zts_sockaddr* jarg2, void* jarg3) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_bsd_getsockname(int jarg1, zts_sockaddr* jarg2, void* jarg3) { int jresult; int arg1; @@ -1315,12 +1315,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_getsockname(int jarg1, zts_sockaddr* jarg2 arg1 = (int)jarg1; arg2 = (zts_sockaddr*)jarg2; arg3 = (zts_socklen_t*)jarg3; - result = (int)zts_getsockname(arg1, arg2, arg3); + result = (int)zts_bsd_getsockname(arg1, arg2, arg3); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_getpeername(int jarg1, zts_sockaddr* jarg2, void* jarg3) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_bsd_getpeername(int jarg1, zts_sockaddr* jarg2, void* jarg3) { int jresult; int arg1; @@ -1330,23 +1330,23 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_getpeername(int jarg1, zts_sockaddr* jarg2 arg1 = (int)jarg1; arg2 = (zts_sockaddr*)jarg2; arg3 = (zts_socklen_t*)jarg3; - result = (int)zts_getpeername(arg1, arg2, arg3); + result = (int)zts_bsd_getpeername(arg1, arg2, arg3); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_close(int jarg1) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_bsd_close(int jarg1) { int jresult; int arg1; int result; arg1 = (int)jarg1; - result = (int)zts_close(arg1); + result = (int)zts_bsd_close(arg1); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_select(int jarg1, void* jarg2, void* jarg3, void* jarg4, void* jarg5) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_bsd_select(int jarg1, void* jarg2, void* jarg3, void* jarg4, void* jarg5) { int jresult; int arg1; @@ -1360,12 +1360,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_select(int jarg1, void* jarg2, void* jarg3 arg3 = (zts_fd_set*)jarg3; arg4 = (zts_fd_set*)jarg4; arg5 = (zts_timeval*)jarg5; - result = (int)zts_select(arg1, arg2, arg3, arg4, arg5); + result = (int)zts_bsd_select(arg1, arg2, arg3, arg4, arg5); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_fcntl(int jarg1, int jarg2, int jarg3) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_bsd_fcntl(int jarg1, int jarg2, int jarg3) { int jresult; int arg1; @@ -1375,12 +1375,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_fcntl(int jarg1, int jarg2, int jarg3) arg1 = (int)jarg1; arg2 = (int)jarg2; arg3 = (int)jarg3; - result = (int)zts_fcntl(arg1, arg2, arg3); + result = (int)zts_bsd_fcntl(arg1, arg2, arg3); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_poll(void* jarg1, unsigned int jarg2, int jarg3) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_bsd_poll(void* jarg1, unsigned int jarg2, int jarg3) { int jresult; zts_pollfd* arg1 = (zts_pollfd*)0; @@ -1390,12 +1390,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_poll(void* jarg1, unsigned int jarg2, int arg1 = (zts_pollfd*)jarg1; arg2 = (zts_nfds_t)jarg2; arg3 = (int)jarg3; - result = (int)zts_poll(arg1, arg2, arg3); + result = (int)zts_bsd_poll(arg1, arg2, arg3); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_ioctl(int jarg1, unsigned long jarg2, void* jarg3) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_bsd_ioctl(int jarg1, unsigned long jarg2, void* jarg3) { int jresult; int arg1; @@ -1405,12 +1405,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_ioctl(int jarg1, unsigned long jarg2, void arg1 = (int)jarg1; arg2 = (unsigned long)jarg2; arg3 = (void*)jarg3; - result = (int)zts_ioctl(arg1, arg2, arg3); + result = (int)zts_bsd_ioctl(arg1, arg2, arg3); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_send(int jarg1, void* jarg2, unsigned long jarg3, int jarg4) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_bsd_send(int jarg1, void* jarg2, unsigned long jarg3, int jarg4) { int arg1; void* arg2 = (void*)0; @@ -1420,11 +1420,11 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_send(int jarg1, void* jarg2, unsigned long arg2 = (void*)jarg2; arg3 = (size_t)jarg3; arg4 = (int)jarg4; - return zts_send(arg1, (void const*)arg2, arg3, arg4); + return zts_bsd_send(arg1, (void const*)arg2, arg3, arg4); } SWIGEXPORT int SWIGSTDCALL -CSharp_zts_sendto(int jarg1, void* jarg2, unsigned long jarg3, int jarg4, zts_sockaddr* jarg5, unsigned short jarg6) +CSharp_zts_bsd_sendto(int jarg1, void* jarg2, unsigned long jarg3, int jarg4, zts_sockaddr* jarg5, unsigned short jarg6) { int arg1; void* arg2 = (void*)0; @@ -1438,7 +1438,7 @@ CSharp_zts_sendto(int jarg1, void* jarg2, unsigned long jarg3, int jarg4, zts_so arg4 = (int)jarg4; arg5 = (zts_sockaddr*)jarg5; arg6 = (zts_socklen_t)jarg6; - return zts_sendto(arg1, (void const*)arg2, arg3, arg4, (zts_sockaddr const*)arg5, arg6); + return zts_bsd_sendto(arg1, (void const*)arg2, arg3, arg4, (zts_sockaddr const*)arg5, arg6); } SWIGEXPORT void* SWIGSTDCALL CSharp_new_zts_iovec() @@ -1451,7 +1451,7 @@ SWIGEXPORT void* SWIGSTDCALL CSharp_new_zts_iovec() return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_sendmsg(int jarg1, void* jarg2, int jarg3) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_bsd_sendmsg(int jarg1, void* jarg2, int jarg3) { int arg1; zts_msghdr* arg2 = (zts_msghdr*)0; @@ -1459,10 +1459,10 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_sendmsg(int jarg1, void* jarg2, int jarg3) arg1 = (int)jarg1; arg2 = (zts_msghdr*)jarg2; arg3 = (int)jarg3; - return zts_sendmsg(arg1, (zts_msghdr const*)arg2, arg3); + return zts_bsd_sendmsg(arg1, (zts_msghdr const*)arg2, arg3); } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_recv(int jarg1, void* jarg2, unsigned long jarg3, int jarg4) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_bsd_recv(int jarg1, void* jarg2, unsigned long jarg3, int jarg4) { int arg1; void* arg2 = (void*)0; @@ -1472,11 +1472,11 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_recv(int jarg1, void* jarg2, unsigned long arg2 = (void*)jarg2; arg3 = (size_t)jarg3; arg4 = (int)jarg4; - return zts_recv(arg1, arg2, arg3, arg4); + return zts_bsd_recv(arg1, arg2, arg3, arg4); } SWIGEXPORT int SWIGSTDCALL -CSharp_zts_recvfrom(int jarg1, void* jarg2, unsigned long jarg3, int jarg4, zts_sockaddr* jarg5, void* jarg6) +CSharp_zts_bsd_recvfrom(int jarg1, void* jarg2, unsigned long jarg3, int jarg4, zts_sockaddr* jarg5, void* jarg6) { int arg1; void* arg2 = (void*)0; @@ -1490,10 +1490,10 @@ CSharp_zts_recvfrom(int jarg1, void* jarg2, unsigned long jarg3, int jarg4, zts_ arg4 = (int)jarg4; arg5 = (zts_sockaddr*)jarg5; arg6 = (zts_socklen_t*)jarg6; - return zts_recvfrom(arg1, arg2, arg3, arg4, arg5, arg6); + return zts_bsd_recvfrom(arg1, arg2, arg3, arg4, arg5, arg6); } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_recvmsg(int jarg1, void* jarg2, int jarg3) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_bsd_recvmsg(int jarg1, void* jarg2, int jarg3) { int arg1; zts_msghdr* arg2 = (zts_msghdr*)0; @@ -1501,10 +1501,10 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_recvmsg(int jarg1, void* jarg2, int jarg3) arg1 = (int)jarg1; arg2 = (zts_msghdr*)jarg2; arg3 = (int)jarg3; - return zts_recvmsg(arg1, arg2, arg3); + return zts_bsd_recvmsg(arg1, arg2, arg3); } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_read(int jarg1, void* jarg2, unsigned long jarg3) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_bsd_read(int jarg1, void* jarg2, unsigned long jarg3) { int arg1; void* arg2 = (void*)0; @@ -1512,10 +1512,10 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_read(int jarg1, void* jarg2, unsigned long arg1 = (int)jarg1; arg2 = (void*)jarg2; arg3 = (size_t)jarg3; - return zts_read(arg1, arg2, arg3); + return zts_bsd_read(arg1, arg2, arg3); } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_readv(int jarg1, void* jarg2, int jarg3) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_bsd_readv(int jarg1, void* jarg2, int jarg3) { int arg1; zts_iovec* arg2 = (zts_iovec*)0; @@ -1523,10 +1523,10 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_readv(int jarg1, void* jarg2, int jarg3) arg1 = (int)jarg1; arg2 = (zts_iovec*)jarg2; arg3 = (int)jarg3; - return zts_readv(arg1, (zts_iovec const*)arg2, arg3); + return zts_bsd_readv(arg1, (zts_iovec const*)arg2, arg3); } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_write(int jarg1, void* jarg2, unsigned long jarg3) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_bsd_write(int jarg1, void* jarg2, unsigned long jarg3) { int arg1; void* arg2 = (void*)0; @@ -1534,10 +1534,10 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_write(int jarg1, void* jarg2, unsigned lon arg1 = (int)jarg1; arg2 = (void*)jarg2; arg3 = (size_t)jarg3; - return zts_write(arg1, (void const*)arg2, arg3); + return zts_bsd_write(arg1, (void const*)arg2, arg3); } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_writev(int jarg1, void* jarg2, int jarg3) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_bsd_writev(int jarg1, void* jarg2, int jarg3) { int arg1; zts_iovec* arg2 = (zts_iovec*)0; @@ -1545,10 +1545,10 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_writev(int jarg1, void* jarg2, int jarg3) arg1 = (int)jarg1; arg2 = (zts_iovec*)jarg2; arg3 = (int)jarg3; - return zts_writev(arg1, (zts_iovec const*)arg2, arg3); + return zts_bsd_writev(arg1, (zts_iovec const*)arg2, arg3); } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_shutdown(int jarg1, int jarg2) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_bsd_shutdown(int jarg1, int jarg2) { int jresult; int arg1; @@ -1556,12 +1556,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_shutdown(int jarg1, int jarg2) int result; arg1 = (int)jarg1; arg2 = (int)jarg2; - result = (int)zts_shutdown(arg1, arg2); + result = (int)zts_bsd_shutdown(arg1, arg2); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_set_no_delay(int jarg1, int jarg2) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_set_no_delay(int jarg1, int jarg2) { int jresult; int arg1; @@ -1569,23 +1569,23 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_set_no_delay(int jarg1, int jarg2) int result; arg1 = (int)jarg1; arg2 = (int)jarg2; - result = (int)zts_simple_set_no_delay(arg1, arg2); + result = (int)zts_set_no_delay(arg1, arg2); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_get_no_delay(int jarg1) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_get_no_delay(int jarg1) { int jresult; int arg1; int result; arg1 = (int)jarg1; - result = (int)zts_simple_get_no_delay(arg1); + result = (int)zts_get_no_delay(arg1); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_set_linger(int jarg1, int jarg2, int jarg3) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_set_linger(int jarg1, int jarg2, int jarg3) { int jresult; int arg1; @@ -1595,34 +1595,34 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_set_linger(int jarg1, int jarg2, in arg1 = (int)jarg1; arg2 = (int)jarg2; arg3 = (int)jarg3; - result = (int)zts_simple_set_linger(arg1, arg2, arg3); + result = (int)zts_set_linger(arg1, arg2, arg3); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_get_linger_enabled(int jarg1) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_get_linger_enabled(int jarg1) { int jresult; int arg1; int result; arg1 = (int)jarg1; - result = (int)zts_simple_get_linger_enabled(arg1); + result = (int)zts_get_linger_enabled(arg1); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_get_linger_value(int jarg1) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_get_linger_value(int jarg1) { int jresult; int arg1; int result; arg1 = (int)jarg1; - result = (int)zts_simple_get_linger_value(arg1); + result = (int)zts_get_linger_value(arg1); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_set_reuse_addr(int jarg1, int jarg2) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_set_reuse_addr(int jarg1, int jarg2) { int jresult; int arg1; @@ -1630,23 +1630,23 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_set_reuse_addr(int jarg1, int jarg2 int result; arg1 = (int)jarg1; arg2 = (int)jarg2; - result = (int)zts_simple_set_reuse_addr(arg1, arg2); + result = (int)zts_set_reuse_addr(arg1, arg2); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_get_reuse_addr(int jarg1) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_get_reuse_addr(int jarg1) { int jresult; int arg1; int result; arg1 = (int)jarg1; - result = (int)zts_simple_get_reuse_addr(arg1); + result = (int)zts_get_reuse_addr(arg1); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_set_recv_timeout(int jarg1, int jarg2, int jarg3) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_set_recv_timeout(int jarg1, int jarg2, int jarg3) { int jresult; int arg1; @@ -1656,23 +1656,23 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_set_recv_timeout(int jarg1, int jar arg1 = (int)jarg1; arg2 = (int)jarg2; arg3 = (int)jarg3; - result = (int)zts_simple_set_recv_timeout(arg1, arg2, arg3); + result = (int)zts_set_recv_timeout(arg1, arg2, arg3); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_get_recv_timeout(int jarg1) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_get_recv_timeout(int jarg1) { int jresult; int arg1; int result; arg1 = (int)jarg1; - result = (int)zts_simple_get_recv_timeout(arg1); + result = (int)zts_get_recv_timeout(arg1); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_set_send_timeout(int jarg1, int jarg2, int jarg3) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_set_send_timeout(int jarg1, int jarg2, int jarg3) { int jresult; int arg1; @@ -1682,23 +1682,23 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_set_send_timeout(int jarg1, int jar arg1 = (int)jarg1; arg2 = (int)jarg2; arg3 = (int)jarg3; - result = (int)zts_simple_set_send_timeout(arg1, arg2, arg3); + result = (int)zts_set_send_timeout(arg1, arg2, arg3); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_get_send_timeout(int jarg1) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_get_send_timeout(int jarg1) { int jresult; int arg1; int result; arg1 = (int)jarg1; - result = (int)zts_simple_get_send_timeout(arg1); + result = (int)zts_get_send_timeout(arg1); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_set_send_buf_size(int jarg1, int jarg2) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_set_send_buf_size(int jarg1, int jarg2) { int jresult; int arg1; @@ -1706,23 +1706,23 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_set_send_buf_size(int jarg1, int ja int result; arg1 = (int)jarg1; arg2 = (int)jarg2; - result = (int)zts_simple_set_send_buf_size(arg1, arg2); + result = (int)zts_set_send_buf_size(arg1, arg2); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_get_send_buf_size(int jarg1) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_get_send_buf_size(int jarg1) { int jresult; int arg1; int result; arg1 = (int)jarg1; - result = (int)zts_simple_get_send_buf_size(arg1); + result = (int)zts_get_send_buf_size(arg1); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_set_recv_buf_size(int jarg1, int jarg2) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_set_recv_buf_size(int jarg1, int jarg2) { int jresult; int arg1; @@ -1730,23 +1730,23 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_set_recv_buf_size(int jarg1, int ja int result; arg1 = (int)jarg1; arg2 = (int)jarg2; - result = (int)zts_simple_set_recv_buf_size(arg1, arg2); + result = (int)zts_set_recv_buf_size(arg1, arg2); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_get_recv_buf_size(int jarg1) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_get_recv_buf_size(int jarg1) { int jresult; int arg1; int result; arg1 = (int)jarg1; - result = (int)zts_simple_get_recv_buf_size(arg1); + result = (int)zts_get_recv_buf_size(arg1); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_set_ttl(int jarg1, int jarg2) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_set_ttl(int jarg1, int jarg2) { int jresult; int arg1; @@ -1754,23 +1754,23 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_set_ttl(int jarg1, int jarg2) int result; arg1 = (int)jarg1; arg2 = (int)jarg2; - result = (int)zts_simple_set_ttl(arg1, arg2); + result = (int)zts_set_ttl(arg1, arg2); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_get_ttl(int jarg1) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_get_ttl(int jarg1) { int jresult; int arg1; int result; arg1 = (int)jarg1; - result = (int)zts_simple_get_ttl(arg1); + result = (int)zts_get_ttl(arg1); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_set_blocking(int jarg1, int jarg2) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_set_blocking(int jarg1, int jarg2) { int jresult; int arg1; @@ -1778,23 +1778,23 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_set_blocking(int jarg1, int jarg2) int result; arg1 = (int)jarg1; arg2 = (int)jarg2; - result = (int)zts_simple_set_blocking(arg1, arg2); + result = (int)zts_set_blocking(arg1, arg2); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_get_blocking(int jarg1) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_get_blocking(int jarg1) { int jresult; int arg1; int result; arg1 = (int)jarg1; - result = (int)zts_simple_get_blocking(arg1); + result = (int)zts_get_blocking(arg1); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_set_keepalive(int jarg1, int jarg2) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_set_keepalive(int jarg1, int jarg2) { int jresult; int arg1; @@ -1802,29 +1802,29 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_set_keepalive(int jarg1, int jarg2) int result; arg1 = (int)jarg1; arg2 = (int)jarg2; - result = (int)zts_simple_set_keepalive(arg1, arg2); + result = (int)zts_set_keepalive(arg1, arg2); jresult = result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_zts_simple_get_keepalive(int jarg1) +SWIGEXPORT int SWIGSTDCALL CSharp_zts_get_keepalive(int jarg1) { int jresult; int arg1; int result; arg1 = (int)jarg1; - result = (int)zts_simple_get_keepalive(arg1); + result = (int)zts_get_keepalive(arg1); jresult = result; return jresult; } -SWIGEXPORT void* SWIGSTDCALL CSharp_zts_gethostbyname(char* jarg1) +SWIGEXPORT void* SWIGSTDCALL CSharp_zts_bsd_gethostbyname(char* jarg1) { void* jresult; char* arg1 = (char*)0; zts_hostent* result = 0; arg1 = (char*)jarg1; - result = (zts_hostent*)zts_gethostbyname((char const*)arg1); + result = (zts_hostent*)zts_bsd_gethostbyname((char const*)arg1); jresult = (void*)result; return jresult; } diff --git a/src/bindings/csharp/Socket.cs b/src/bindings/csharp/Socket.cs old mode 100755 new mode 100644 index 3663515..7c15c3a --- a/src/bindings/csharp/Socket.cs +++ b/src/bindings/csharp/Socket.cs @@ -91,7 +91,7 @@ namespace ZeroTier.Sockets protocol = 0; // ? break; } - if ((_fd = zts_socket(family, type, protocol)) < 0) { + if ((_fd = zts_bsd_socket(family, type, protocol)) < 0) { throw new ZeroTier.Sockets.SocketException((int)_fd); } _socketFamily = addressFamily; @@ -129,11 +129,7 @@ namespace ZeroTier.Sockets if (remoteEndPoint == null) { throw new ArgumentNullException("remoteEndPoint"); } - int err = zts_simple_connect( - _fd, - remoteEndPoint.Address.ToString(), - (ushort)remoteEndPoint.Port, - _connectTimeout); + int err = zts_connect(_fd, remoteEndPoint.Address.ToString(), (ushort)remoteEndPoint.Port, _connectTimeout); if (err < 0) { throw new ZeroTier.Sockets.SocketException(err, ZeroTier.Core.Node.ErrNo); } @@ -155,11 +151,11 @@ namespace ZeroTier.Sockets } int err = Constants.ERR_OK; if (localEndPoint.AddressFamily == AddressFamily.InterNetwork) { - err = zts_simple_bind(_fd, "0.0.0.0", (ushort)localEndPoint.Port); + err = zts_bind(_fd, "0.0.0.0", (ushort)localEndPoint.Port); } if (localEndPoint.AddressFamily == AddressFamily.InterNetworkV6) { // Todo: detect IPAddress.IPv6Any - err = zts_simple_bind(_fd, "::", (ushort)localEndPoint.Port); + err = zts_bind(_fd, "::", (ushort)localEndPoint.Port); } if (err < 0) { throw new ZeroTier.Sockets.SocketException((int)err); @@ -178,7 +174,7 @@ namespace ZeroTier.Sockets throw new ZeroTier.Sockets.SocketException((int)Constants.ERR_SOCKET); } int err = Constants.ERR_OK; - if ((err = zts_listen(_fd, backlog)) < 0) { + if ((err = zts_bsd_listen(_fd, backlog)) < 0) { // Invalid backlog value perhaps? throw new ZeroTier.Sockets.SocketException((int)Constants.ERR_SOCKET); } @@ -199,14 +195,14 @@ namespace ZeroTier.Sockets } IntPtr lpBuffer = Marshal.AllocHGlobal(ZeroTier.Constants.INET6_ADDRSTRLEN); int port = 0; - int accepted_fd = zts_simple_accept(_fd, lpBuffer, ZeroTier.Constants.INET6_ADDRSTRLEN, ref port); + int accepted_fd = zts_accept(_fd, lpBuffer, ZeroTier.Constants.INET6_ADDRSTRLEN, ref port); // Convert buffer to managed string string str = Marshal.PtrToStringAnsi(lpBuffer); Marshal.FreeHGlobal(lpBuffer); lpBuffer = IntPtr.Zero; IPEndPoint clientEndPoint = new IPEndPoint(IPAddress.Parse(str), port); Console.WriteLine("clientEndPoint = " + clientEndPoint.ToString()); - // Create new socket by providing file descriptor returned from zts_accept call. + // Create new socket by providing file descriptor returned from zts_bsd_accept call. Socket clientSocket = new Socket(accepted_fd, _socketFamily, _socketType, _socketProtocol, _localEndPoint, clientEndPoint); return clientSocket; @@ -229,7 +225,7 @@ namespace ZeroTier.Sockets ztHow = Constants.O_RDWR; break; } - zts_shutdown(_fd, ztHow); + zts_bsd_shutdown(_fd, ztHow); } public void Close() @@ -237,17 +233,17 @@ namespace ZeroTier.Sockets if (_isClosed) { throw new ObjectDisposedException("Socket has already been closed"); } - zts_close(_fd); + zts_bsd_close(_fd); _isClosed = true; } public bool Blocking { get { - return Convert.ToBoolean(zts_simple_get_blocking(_fd)); + return Convert.ToBoolean(zts_get_blocking(_fd)); } set { - zts_simple_set_blocking(_fd, Convert.ToInt32(value)); + zts_set_blocking(_fd, Convert.ToInt32(value)); } } @@ -272,7 +268,7 @@ namespace ZeroTier.Sockets int result = 0; int timeout_ms = (microSeconds / 1000); uint numfds = 1; - if ((result = zts_poll(poll_fd_ptr, numfds, timeout_ms)) < 0) { + if ((result = zts_bsd_poll(poll_fd_ptr, numfds, timeout_ms)) < 0) { throw new ZeroTier.Sockets.SocketException(result, ZeroTier.Core.Node.ErrNo); } poll_set = (zts_pollfd)Marshal.PtrToStructure(poll_fd_ptr, typeof(zts_pollfd)); @@ -306,7 +302,7 @@ namespace ZeroTier.Sockets } int flags = 0; IntPtr bufferPtr = Marshal.UnsafeAddrOfPinnedArrayElement(buffer, 0); - return zts_send(_fd, bufferPtr, (uint)Buffer.ByteLength(buffer), (int)flags); + return zts_bsd_send(_fd, bufferPtr, (uint)Buffer.ByteLength(buffer), (int)flags); } public Int32 Receive(Byte[] buffer) @@ -322,7 +318,7 @@ namespace ZeroTier.Sockets } int flags = 0; IntPtr bufferPtr = Marshal.UnsafeAddrOfPinnedArrayElement(buffer, 0); - return zts_recv(_fd, bufferPtr, (uint)Buffer.ByteLength(buffer), (int)flags); + return zts_bsd_recv(_fd, bufferPtr, (uint)Buffer.ByteLength(buffer), (int)flags); } public int ReceiveTimeout @@ -490,11 +486,11 @@ namespace ZeroTier.Sockets [DllImport( "libzt", CharSet = CharSet.Ansi, - EntryPoint = "CSharp_zts_gethostbyname")] public static extern global::System.IntPtr - zts_gethostbyname(string jarg1); + EntryPoint = "CSharp_zts_bsd_gethostbyname")] public static extern global::System.IntPtr + zts_bsd_gethostbyname(string jarg1); - [DllImport("libzt", EntryPoint = "CSharp_zts_select")] - static extern int zts_select( + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_select")] + static extern int zts_bsd_select( int jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, @@ -507,86 +503,86 @@ namespace ZeroTier.Sockets [DllImport("libzt", EntryPoint = "CSharp_zts_get_protocol_stats")] static extern int zts_get_protocol_stats(int arg1, IntPtr arg2); - [DllImport("libzt", EntryPoint = "CSharp_zts_socket")] - static extern int zts_socket(int arg1, int arg2, int arg3); + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_socket")] + static extern int zts_bsd_socket(int arg1, int arg2, int arg3); - [DllImport("libzt", EntryPoint = "CSharp_zts_connect")] - static extern int zts_connect(int arg1, IntPtr arg2, ushort arg3); + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_connect")] + static extern int zts_bsd_connect(int arg1, IntPtr arg2, ushort arg3); - [DllImport("libzt", CharSet = CharSet.Ansi, EntryPoint = "CSharp_zts_connect_easy")] - static extern int zts_connect_easy(int arg1, int arg2, string arg3, ushort arg4, int arg5); + [DllImport("libzt", CharSet = CharSet.Ansi, EntryPoint = "CSharp_zts_bsd_connect_easy")] + static extern int zts_bsd_connect_easy(int arg1, int arg2, string arg3, ushort arg4, int arg5); - [DllImport("libzt", EntryPoint = "CSharp_zts_bind")] - static extern int zts_bind(int arg1, IntPtr arg2, ushort arg3); + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_bind")] + static extern int zts_bsd_bind(int arg1, IntPtr arg2, ushort arg3); - [DllImport("libzt", CharSet = CharSet.Ansi, EntryPoint = "CSharp_zts_bind_easy")] - static extern int zts_bind_easy(int arg1, int arg2, string arg3, ushort arg4); + [DllImport("libzt", CharSet = CharSet.Ansi, EntryPoint = "CSharp_zts_bsd_bind_easy")] + static extern int zts_bsd_bind_easy(int arg1, int arg2, string arg3, ushort arg4); - [DllImport("libzt", EntryPoint = "CSharp_zts_listen")] - static extern int zts_listen(int arg1, int arg2); + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_listen")] + static extern int zts_bsd_listen(int arg1, int arg2); - [DllImport("libzt", EntryPoint = "CSharp_zts_accept")] - static extern int zts_accept(int arg1, IntPtr arg2, IntPtr arg3); + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_accept")] + static extern int zts_bsd_accept(int arg1, IntPtr arg2, IntPtr arg3); - [DllImport("libzt", CharSet = CharSet.Ansi, EntryPoint = "CSharp_zts_accept_easy")] - static extern int zts_accept_easy(int arg1, IntPtr remoteAddrStr, int arg2, ref int arg3); + [DllImport("libzt", CharSet = CharSet.Ansi, EntryPoint = "CSharp_zts_bsd_accept_easy")] + static extern int zts_bsd_accept_easy(int arg1, IntPtr remoteAddrStr, int arg2, ref int arg3); - [DllImport("libzt", EntryPoint = "CSharp_zts_setsockopt")] - static extern int zts_setsockopt(int arg1, int arg2, int arg3, IntPtr arg4, ushort arg5); + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_setsockopt")] + static extern int zts_bsd_setsockopt(int arg1, int arg2, int arg3, IntPtr arg4, ushort arg5); - [DllImport("libzt", EntryPoint = "CSharp_zts_getsockopt")] - static extern int zts_getsockopt(int arg1, int arg2, int arg3, IntPtr arg4, IntPtr arg5); + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_getsockopt")] + static extern int zts_bsd_getsockopt(int arg1, int arg2, int arg3, IntPtr arg4, IntPtr arg5); - [DllImport("libzt", EntryPoint = "CSharp_zts_getsockname")] - static extern int zts_getsockname(int arg1, IntPtr arg2, IntPtr arg3); + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_getsockname")] + static extern int zts_bsd_getsockname(int arg1, IntPtr arg2, IntPtr arg3); - [DllImport("libzt", EntryPoint = "CSharp_zts_getpeername")] - static extern int zts_getpeername(int arg1, IntPtr arg2, IntPtr arg3); + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_getpeername")] + static extern int zts_bsd_getpeername(int arg1, IntPtr arg2, IntPtr arg3); - [DllImport("libzt", EntryPoint = "CSharp_zts_close")] - static extern int zts_close(int arg1); + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_close")] + static extern int zts_bsd_close(int arg1); - [DllImport("libzt", EntryPoint = "CSharp_zts_fcntl")] - static extern int zts_fcntl(int arg1, int arg2, int arg3); + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_fcntl")] + static extern int zts_bsd_fcntl(int arg1, int arg2, int arg3); - [DllImport("libzt", EntryPoint = "CSharp_zts_poll")] - static extern int zts_poll(IntPtr arg1, uint arg2, int arg3); + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_poll")] + static extern int zts_bsd_poll(IntPtr arg1, uint arg2, int arg3); - [DllImport("libzt", EntryPoint = "CSharp_zts_ioctl")] - static extern int zts_ioctl(int arg1, uint arg2, IntPtr arg3); + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_ioctl")] + static extern int zts_bsd_ioctl(int arg1, uint arg2, IntPtr arg3); - [DllImport("libzt", EntryPoint = "CSharp_zts_send")] - static extern int zts_send(int arg1, IntPtr arg2, uint arg3, int arg4); + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_send")] + static extern int zts_bsd_send(int arg1, IntPtr arg2, uint arg3, int arg4); - [DllImport("libzt", EntryPoint = "CSharp_zts_sendto")] - static extern int zts_sendto(int arg1, IntPtr arg2, uint arg3, int arg4, IntPtr arg5, ushort arg6); + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_sendto")] + static extern int zts_bsd_sendto(int arg1, IntPtr arg2, uint arg3, int arg4, IntPtr arg5, ushort arg6); - [DllImport("libzt", EntryPoint = "CSharp_zts_sendmsg")] - static extern int zts_sendmsg(int arg1, IntPtr arg2, int arg3); + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_sendmsg")] + static extern int zts_bsd_sendmsg(int arg1, IntPtr arg2, int arg3); - [DllImport("libzt", EntryPoint = "CSharp_zts_recv")] - static extern int zts_recv(int arg1, IntPtr arg2, uint arg3, int arg4); + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_recv")] + static extern int zts_bsd_recv(int arg1, IntPtr arg2, uint arg3, int arg4); - [DllImport("libzt", EntryPoint = "CSharp_zts_recvfrom")] - static extern int zts_recvfrom(int arg1, IntPtr arg2, uint arg3, int arg4, IntPtr arg5, IntPtr arg6); + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_recvfrom")] + static extern int zts_bsd_recvfrom(int arg1, IntPtr arg2, uint arg3, int arg4, IntPtr arg5, IntPtr arg6); - [DllImport("libzt", EntryPoint = "CSharp_zts_recvmsg")] - static extern int zts_recvmsg(int arg1, IntPtr arg2, int arg3); + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_recvmsg")] + static extern int zts_bsd_recvmsg(int arg1, IntPtr arg2, int arg3); - [DllImport("libzt", EntryPoint = "CSharp_zts_read")] - static extern int zts_read(int arg1, IntPtr arg2, uint arg3); + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_read")] + static extern int zts_bsd_read(int arg1, IntPtr arg2, uint arg3); - [DllImport("libzt", EntryPoint = "CSharp_zts_readv")] - static extern int zts_readv(int arg1, IntPtr arg2, int arg3); + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_readv")] + static extern int zts_bsd_readv(int arg1, IntPtr arg2, int arg3); - [DllImport("libzt", EntryPoint = "CSharp_zts_write")] - static extern int zts_write(int arg1, IntPtr arg2, uint arg3); + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_write")] + static extern int zts_bsd_write(int arg1, IntPtr arg2, uint arg3); - [DllImport("libzt", EntryPoint = "CSharp_zts_writev")] - static extern int zts_writev(int arg1, IntPtr arg2, int arg3); + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_writev")] + static extern int zts_bsd_writev(int arg1, IntPtr arg2, int arg3); - [DllImport("libzt", EntryPoint = "CSharp_zts_shutdown")] - static extern int zts_shutdown(int arg1, int arg2); + [DllImport("libzt", EntryPoint = "CSharp_zts_bsd_shutdown")] + static extern int zts_bsd_shutdown(int arg1, int arg2); [DllImport("libzt", EntryPoint = "CSharp_zts_set_no_delay")] static extern int zts_set_no_delay(int fd, int enabled); @@ -660,97 +656,102 @@ namespace ZeroTier.Sockets [DllImport("libzt", EntryPoint = "CSharp_zts_errno_get")] static extern int zts_errno_get(); - [DllImport("libzt", CharSet = CharSet.Ansi, EntryPoint = "CSharp_zts_simple_accept")] - static extern int zts_simple_accept(int jarg1, IntPtr jarg2, int jarg3, ref int jarg4); + [DllImport("libzt", CharSet = CharSet.Ansi, EntryPoint = "CSharp_zts_accept")] + static extern int zts_accept(int jarg1, IntPtr jarg2, int jarg3, ref int jarg4); - [DllImport("libzt", CharSet = CharSet.Ansi, EntryPoint = "CSharp_zts_simple_tcp_client")] - static extern int zts_simple_tcp_client(string jarg1, int jarg2); + [DllImport("libzt", CharSet = CharSet.Ansi, EntryPoint = "CSharp_zts_tcp_client")] + static extern int zts_tcp_client(string jarg1, int jarg2); - [DllImport("libzt", CharSet = CharSet.Ansi, EntryPoint = "CSharp_zts_simple_tcp_server")] - static extern int zts_simple_tcp_server( + [DllImport("libzt", CharSet = CharSet.Ansi, EntryPoint = "CSharp_zts_tcp_server")] + static extern int zts_tcp_server( string jarg1, int jarg2, string jarg3, int jarg4, global::System.Runtime.InteropServices.HandleRef jarg5); - [DllImport("libzt", CharSet = CharSet.Ansi, EntryPoint = "CSharp_zts_simple_udp_server")] - static extern int zts_simple_udp_server(string jarg1, int jarg2); + [DllImport("libzt", CharSet = CharSet.Ansi, EntryPoint = "CSharp_zts_udp_server")] + static extern int zts_udp_server(string jarg1, int jarg2); - [DllImport("libzt", CharSet = CharSet.Ansi, EntryPoint = "CSharp_zts_simple_udp_client")] - static extern int zts_simple_udp_client(string jarg1); + [DllImport("libzt", CharSet = CharSet.Ansi, EntryPoint = "CSharp_zts_udp_client")] + static extern int zts_udp_client(string jarg1); - [DllImport("libzt", CharSet = CharSet.Ansi, EntryPoint = "CSharp_zts_simple_bind")] - static extern int zts_simple_bind(int jarg1, string jarg2, int jarg3); + [DllImport("libzt", CharSet = CharSet.Ansi, EntryPoint = "CSharp_zts_bind")] + static extern int zts_bind(int jarg1, string jarg2, int jarg3); - [DllImport("libzt", CharSet = CharSet.Ansi, EntryPoint = "CSharp_zts_simple_connect")] - static extern int zts_simple_connect(int jarg1, string jarg2, int jarg3, int jarg4); + [DllImport("libzt", CharSet = CharSet.Ansi, EntryPoint = "CSharp_zts_connect")] + static extern int zts_connect(int jarg1, string jarg2, int jarg3, int jarg4); [DllImport("libzt", EntryPoint = "CSharp_zts_stats_get_all")] static extern int zts_stats_get_all(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("libzt", EntryPoint = "CSharp_zts_simple_set_no_delay")] - static extern int zts_simple_set_no_delay(int jarg1, int jarg2); + /* + [DllImport("libzt", EntryPoint = "CSharp_zts_set_no_delay")] + static extern int zts_set_no_delay(int jarg1, int jarg2); - [DllImport("libzt", EntryPoint = "CSharp_zts_simple_get_no_delay")] - static extern int zts_simple_get_no_delay(int jarg1); + [DllImport("libzt", EntryPoint = "CSharp_zts_get_no_delay")] + static extern int zts_get_no_delay(int jarg1); - [DllImport("libzt", EntryPoint = "CSharp_zts_simple_set_linger")] - static extern int zts_simple_set_linger(int jarg1, int jarg2, int jarg3); + [DllImport("libzt", EntryPoint = "CSharp_zts_set_linger")] + static extern int zts_set_linger(int jarg1, int jarg2, int jarg3); - [DllImport("libzt", EntryPoint = "CSharp_zts_simple_get_linger_enabled")] - static extern int zts_simple_get_linger_enabled(int jarg1); + [DllImport("libzt", EntryPoint = "CSharp_zts_get_linger_enabled")] + static extern int zts_get_linger_enabled(int jarg1); - [DllImport("libzt", EntryPoint = "CSharp_zts_simple_get_linger_value")] - static extern int zts_simple_get_linger_value(int jarg1); + [DllImport("libzt", EntryPoint = "CSharp_zts_get_linger_value")] + static extern int zts_get_linger_value(int jarg1); - [DllImport("libzt", EntryPoint = "CSharp_zts_simple_set_reuse_addr")] - static extern int zts_simple_set_reuse_addr(int jarg1, int jarg2); + [DllImport("libzt", EntryPoint = "CSharp_zts_set_reuse_addr")] + static extern int zts_set_reuse_addr(int jarg1, int jarg2); - [DllImport("libzt", EntryPoint = "CSharp_zts_simple_get_reuse_addr")] - static extern int zts_simple_get_reuse_addr(int jarg1); + [DllImport("libzt", EntryPoint = "CSharp_zts_get_reuse_addr")] + static extern int zts_get_reuse_addr(int jarg1); - [DllImport("libzt", EntryPoint = "CSharp_zts_simple_set_recv_timeout")] - static extern int zts_simple_set_recv_timeout(int jarg1, int jarg2, int jarg3); + [DllImport("libzt", EntryPoint = "CSharp_zts_set_recv_timeout")] + static extern int zts_set_recv_timeout(int jarg1, int jarg2, int jarg3); - [DllImport("libzt", EntryPoint = "CSharp_zts_simple_get_recv_timeout")] - static extern int zts_simple_get_recv_timeout(int jarg1); + [DllImport("libzt", EntryPoint = "CSharp_zts_get_recv_timeout")] + static extern int zts_get_recv_timeout(int jarg1); - [DllImport("libzt", EntryPoint = "CSharp_zts_simple_set_send_timeout")] - static extern int zts_simple_set_send_timeout(int jarg1, int jarg2, int jarg3); + [DllImport("libzt", EntryPoint = "CSharp_zts_set_send_timeout")] + static extern int zts_set_send_timeout(int jarg1, int jarg2, int jarg3); - [DllImport("libzt", EntryPoint = "CSharp_zts_simple_get_send_timeout")] - static extern int zts_simple_get_send_timeout(int jarg1); + [DllImport("libzt", EntryPoint = "CSharp_zts_get_send_timeout")] + static extern int zts_get_send_timeout(int jarg1); - [DllImport("libzt", EntryPoint = "CSharp_zts_simple_set_send_buf_size")] - static extern int zts_simple_set_send_buf_size(int jarg1, int jarg2); + [DllImport("libzt", EntryPoint = "CSharp_zts_set_send_buf_size")] + static extern int zts_set_send_buf_size(int jarg1, int jarg2); - [DllImport("libzt", EntryPoint = "CSharp_zts_simple_get_send_buf_size")] - static extern int zts_simple_get_send_buf_size(int jarg1); + [DllImport("libzt", EntryPoint = "CSharp_zts_get_send_buf_size")] + static extern int zts_get_send_buf_size(int jarg1); - [DllImport("libzt", EntryPoint = "CSharp_zts_simple_set_recv_buf_size")] - static extern int zts_simple_set_recv_buf_size(int jarg1, int jarg2); + [DllImport("libzt", EntryPoint = "CSharp_zts_set_recv_buf_size")] + static extern int zts_set_recv_buf_size(int jarg1, int jarg2); - [DllImport("libzt", EntryPoint = "CSharp_zts_simple_get_recv_buf_size")] - static extern int zts_simple_get_recv_buf_size(int jarg1); + [DllImport("libzt", EntryPoint = "CSharp_zts_get_recv_buf_size")] + static extern int zts_get_recv_buf_size(int jarg1); - [DllImport("libzt", EntryPoint = "CSharp_zts_simple_set_ttl")] - static extern int zts_simple_set_ttl(int jarg1, int jarg2); + [DllImport("libzt", EntryPoint = "CSharp_zts_set_ttl")] + static extern int zts_set_ttl(int jarg1, int jarg2); - [DllImport("libzt", EntryPoint = "CSharp_zts_simple_get_ttl")] - static extern int zts_simple_get_ttl(int jarg1); + [DllImport("libzt", EntryPoint = "CSharp_zts_get_ttl")] + static extern int zts_get_ttl(int jarg1); - [DllImport("libzt", EntryPoint = "CSharp_zts_simple_set_blocking")] - static extern int zts_simple_set_blocking(int jarg1, int jarg2); + [DllImport("libzt", EntryPoint = "CSharp_zts_set_blocking")] + static extern int zts_set_blocking(int jarg1, int jarg2); - [DllImport("libzt", EntryPoint = "CSharp_zts_simple_get_blocking")] - static extern int zts_simple_get_blocking(int jarg1); + [DllImport("libzt", EntryPoint = "CSharp_zts_get_blocking")] + static extern int zts_get_blocking(int jarg1); - [DllImport("libzt", EntryPoint = "CSharp_zts_simple_set_keepalive")] - static extern int zts_simple_set_keepalive(int jarg1, int jarg2); + [DllImport("libzt", EntryPoint = "CSharp_zts_set_keepalive")] + static extern int zts_set_keepalive(int jarg1, int jarg2); - [DllImport("libzt", EntryPoint = "CSharp_zts_simple_get_keepalive")] - static extern int zts_simple_get_keepalive(int jarg1); + [DllImport("libzt", EntryPoint = "CSharp_zts_get_keepalive")] + static extern int zts_get_keepalive(int jarg1); + + + + */ [DllImport("libzt", EntryPoint = "CSharp_zts_util_delay")] public static extern void zts_util_delay(int jarg1); diff --git a/src/bindings/java/JavaSockets.cxx b/src/bindings/java/JavaSockets.cxx index 899dfe3..651e68d 100644 --- a/src/bindings/java/JavaSockets.cxx +++ b/src/bindings/java/JavaSockets.cxx @@ -59,54 +59,58 @@ JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1init(JNIEnv* en return rs != JNI_OK ? ZTS_ERR_GENERAL : ZTS_ERR_OK; } -JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1socket(JNIEnv* env, jobject thisObj, jint family, jint type, jint protocol) +JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1socket( + JNIEnv* env, + jobject thisObj, + jint family, + jint type, + jint protocol) { - int retval = zts_socket(family, type, protocol); + int retval = zts_bsd_socket(family, type, protocol); return retval > -1 ? retval : -(zts_errno); // Encode lwIP errno into return value for JNI functions only } /* JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1connect(JNIEnv* env, jobject thisObj, jint fd, jobject addr) +Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1connect(JNIEnv* env, jobject thisObj, jint fd, jobject addr) { struct zts_sockaddr_storage ss; zta2ss(env, &ss, addr); socklen_t addrlen = ss.ss_family == ZTS_AF_INET ? sizeof(struct zts_sockaddr_in) : sizeof(struct zts_sockaddr_in6); - int retval = zts_connect(fd, (struct zts_sockaddr*)&ss, addrlen); + int retval = zts_bsd_connect(fd, (struct zts_sockaddr*)&ss, addrlen); return retval > -1 ? retval : -(zts_errno); } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1bind(JNIEnv* env, jobject thisObj, jint fd, jobject addr) +Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1bind(JNIEnv* env, jobject thisObj, jint fd, jobject addr) { struct zts_sockaddr_storage ss; zta2ss(env, &ss, addr); zts_socklen_t addrlen = ss.ss_family == ZTS_AF_INET ? sizeof(struct zts_sockaddr_in) : sizeof(struct zts_sockaddr_in6); - int retval = zts_bind(fd, (struct zts_sockaddr*)&ss, addrlen); + int retval = zts_bsd_bind(fd, (struct zts_sockaddr*)&ss, addrlen); return retval > -1 ? retval : -(zts_errno); } */ JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1listen(JNIEnv* env, jobject thisObj, jint fd, int backlog) +Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1listen(JNIEnv* env, jobject thisObj, jint fd, int backlog) { - int retval = zts_listen(fd, backlog); + int retval = zts_bsd_listen(fd, backlog); return retval > -1 ? retval : -(zts_errno); } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1accept(JNIEnv* env, jobject thisObj, jint fd, jobject addr, jint port) +Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1accept(JNIEnv* env, jobject thisObj, jint fd, jobject addr, jint port) { struct zts_sockaddr_storage ss; zts_socklen_t addrlen = sizeof(struct zts_sockaddr_storage); - int retval = zts_accept(fd, (zts_sockaddr*)&ss, &addrlen); + int retval = zts_bsd_accept(fd, (zts_sockaddr*)&ss, &addrlen); ss2zta(env, &ss, addr); return retval > -1 ? retval : -(zts_errno); } /* -JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1setsockopt( +JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1setsockopt( JNIEnv* env, jobject thisObj, jint fd, @@ -138,15 +142,15 @@ JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1setsockopt( // Convert milliseconds from setSoTimeout() call to seconds and microseconds tv.tv_usec = optval_int * 1000; tv.tv_sec = optval_int / 1000000; - retval = zts_setsockopt(fd, level, optname, &tv, sizeof(tv)); + retval = zts_bsd_setsockopt(fd, level, optname, &tv, sizeof(tv)); } else { - retval = zts_setsockopt(fd, level, optname, &optval_int, sizeof(optval_int)); + retval = zts_bsd_setsockopt(fd, level, optname, &optval_int, sizeof(optval_int)); } return retval > -1 ? retval : -(zts_errno); } -JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1getsockopt( +JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1getsockopt( JNIEnv* env, jobject thisObj, jint fd, @@ -166,12 +170,12 @@ JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1getsockopt( if (optname == SO_RCVTIMEO) { struct zts_timeval tv; optlen = sizeof(tv); - retval = zts_getsockopt(fd, level, optname, &tv, &optlen); + retval = zts_bsd_getsockopt(fd, level, optname, &tv, &optlen); // Convert seconds and microseconds back to milliseconds optval_int = (tv.tv_sec * 1000) + (tv.tv_usec / 1000); } else { - retval = zts_getsockopt(fd, level, optname, &optval_int, &optlen); + retval = zts_bsd_getsockopt(fd, level, optname, &optval_int, &optlen); } if (optname == SO_BROADCAST || optname == SO_KEEPALIVE || optname == SO_REUSEADDR || optname == SO_REUSEPORT @@ -193,30 +197,31 @@ JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1getsockopt( */ JNIEXPORT jboolean JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1getsockname(JNIEnv* env, jobject thisObj, jint fd, jobject addr) +Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1getsockname(JNIEnv* env, jobject thisObj, jint fd, jobject addr) { struct zts_sockaddr_storage ss; zts_socklen_t addrlen = sizeof(struct zts_sockaddr_storage); - int retval = zts_getsockname(fd, (struct zts_sockaddr*)&ss, &addrlen); + int retval = zts_bsd_getsockname(fd, (struct zts_sockaddr*)&ss, &addrlen); ss2zta(env, &ss, addr); return retval > -1 ? retval : -(zts_errno); } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1getpeername(JNIEnv* env, jobject thisObj, jint fd, jobject addr) +Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1getpeername(JNIEnv* env, jobject thisObj, jint fd, jobject addr) { struct zts_sockaddr_storage ss; - int retval = zts_getpeername(fd, (struct zts_sockaddr*)&ss, (zts_socklen_t*)sizeof(struct zts_sockaddr_storage)); + int retval = + zts_bsd_getpeername(fd, (struct zts_sockaddr*)&ss, (zts_socklen_t*)sizeof(struct zts_sockaddr_storage)); ss2zta(env, &ss, addr); return retval > -1 ? retval : -(zts_errno); } -JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1close(JNIEnv* env, jobject thisObj, jint fd) +JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1close(JNIEnv* env, jobject thisObj, jint fd) { - return zts_close(fd); + return zts_bsd_close(fd); } -JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1select( +JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1select( JNIEnv* env, jobject thisObj, jint nfds, @@ -245,7 +250,7 @@ JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1select( e = &_exceptfds; ztfdset2fdset(env, nfds, exceptfds, &_exceptfds); } - int retval = zts_select(nfds, r, w, e, &_timeout); + int retval = zts_bsd_select(nfds, r, w, e, &_timeout); if (readfds) { fdset2ztfdset(env, nfds, &_readfds, readfds); } @@ -259,19 +264,19 @@ JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1select( } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1fcntl(JNIEnv* env, jobject thisObj, jint fd, jint cmd, jint flags) +Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1fcntl(JNIEnv* env, jobject thisObj, jint fd, jint cmd, jint flags) { - int retval = zts_fcntl(fd, cmd, flags); + int retval = zts_bsd_fcntl(fd, cmd, flags); return retval > -1 ? retval : -(zts_errno); } JNIEXPORT int JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1ioctl(JNIEnv* env, jobject thisObj, jint fd, jlong request, jobject argp) +Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1ioctl(JNIEnv* env, jobject thisObj, jint fd, jlong request, jobject argp) { int retval = ZTS_ERR_OK; if (request == FIONREAD) { int bytesRemaining = 0; - retval = zts_ioctl(fd, request, &bytesRemaining); + retval = zts_bsd_ioctl(fd, request, &bytesRemaining); // set value in general object jclass c = env->GetObjectClass(argp); if (! c) { @@ -283,21 +288,21 @@ Java_com_zerotier_sdk_ZeroTierNative_zts_1ioctl(JNIEnv* env, jobject thisObj, ji if (request == FIONBIO) { // TODO: double check int meaninglessVariable = 0; - retval = zts_ioctl(fd, request, &meaninglessVariable); + retval = zts_bsd_ioctl(fd, request, &meaninglessVariable); } return retval > -1 ? retval : -(zts_errno); } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1send(JNIEnv* env, jobject thisObj, jint fd, jbyteArray buf, int flags) +Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1send(JNIEnv* env, jobject thisObj, jint fd, jbyteArray buf, int flags) { void* data = env->GetPrimitiveArrayCritical(buf, NULL); - int retval = zts_send(fd, data, env->GetArrayLength(buf), flags); + int retval = zts_bsd_send(fd, data, env->GetArrayLength(buf), flags); env->ReleasePrimitiveArrayCritical(buf, data, 0); return retval > -1 ? retval : -(zts_errno); } -JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1sendto( +JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1sendto( JNIEnv* env, jobject thisObj, jint fd, @@ -310,21 +315,21 @@ JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1sendto( zta2ss(env, &ss, addr); zts_socklen_t addrlen = ss.ss_family == ZTS_AF_INET ? sizeof(struct zts_sockaddr_in) : sizeof(struct zts_sockaddr_in6); - int retval = zts_sendto(fd, data, env->GetArrayLength(buf), flags, (struct zts_sockaddr*)&ss, addrlen); + int retval = zts_bsd_sendto(fd, data, env->GetArrayLength(buf), flags, (struct zts_sockaddr*)&ss, addrlen); env->ReleasePrimitiveArrayCritical(buf, data, 0); return retval > -1 ? retval : -(zts_errno); } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1recv(JNIEnv* env, jobject thisObj, jint fd, jbyteArray buf, jint flags) +Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1recv(JNIEnv* env, jobject thisObj, jint fd, jbyteArray buf, jint flags) { void* data = env->GetPrimitiveArrayCritical(buf, NULL); - int retval = zts_recv(fd, data, env->GetArrayLength(buf), flags); + int retval = zts_bsd_recv(fd, data, env->GetArrayLength(buf), flags); env->ReleasePrimitiveArrayCritical(buf, data, 0); return retval > -1 ? retval : -(zts_errno); } -JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1recvfrom( +JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1recvfrom( JNIEnv* env, jobject thisObj, jint fd, @@ -335,28 +340,28 @@ JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1recvfrom( zts_socklen_t addrlen = sizeof(struct zts_sockaddr_storage); struct zts_sockaddr_storage ss; void* data = env->GetPrimitiveArrayCritical(buf, NULL); - int retval = zts_recvfrom(fd, data, env->GetArrayLength(buf), flags, (struct zts_sockaddr*)&ss, &addrlen); + int retval = zts_bsd_recvfrom(fd, data, env->GetArrayLength(buf), flags, (struct zts_sockaddr*)&ss, &addrlen); env->ReleasePrimitiveArrayCritical(buf, data, 0); ss2zta(env, &ss, addr); return retval > -1 ? retval : -(zts_errno); } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1read(JNIEnv* env, jobject thisObj, jint fd, jbyteArray buf) +Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1read(JNIEnv* env, jobject thisObj, jint fd, jbyteArray buf) { void* data = env->GetPrimitiveArrayCritical(buf, NULL); - int retval = zts_read(fd, data, env->GetArrayLength(buf)); + int retval = zts_bsd_read(fd, data, env->GetArrayLength(buf)); env->ReleasePrimitiveArrayCritical(buf, data, 0); return retval > -1 ? retval : -(zts_errno); } -ssize_t zts_read_offset(int fd, void* buf, size_t offset, size_t len) +ssize_t zts_bsd_read_offset(int fd, void* buf, size_t offset, size_t len) { char* cbuf = (char*)buf; - return zts_read(fd, &(cbuf[offset]), len); + return zts_bsd_read(fd, &(cbuf[offset]), len); } -JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1read_1offset( +JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1read_1offset( JNIEnv* env, jobject thisObj, jint fd, @@ -365,30 +370,34 @@ JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1read_1offset( jint len) { void* data = env->GetPrimitiveArrayCritical(buf, NULL); - int retval = zts_read_offset(fd, data, offset, len); + int retval = zts_bsd_read_offset(fd, data, offset, len); + env->ReleasePrimitiveArrayCritical(buf, data, 0); + return retval > -1 ? retval : -(zts_errno); +} + +JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1read_1length( + JNIEnv* env, + jobject thisObj, + jint fd, + jbyteArray buf, + jint len) +{ + void* data = env->GetPrimitiveArrayCritical(buf, NULL); + int retval = zts_bsd_read(fd, data, len); env->ReleasePrimitiveArrayCritical(buf, data, 0); return retval > -1 ? retval : -(zts_errno); } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1read_1length(JNIEnv* env, jobject thisObj, jint fd, jbyteArray buf, jint len) +Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1write__IB(JNIEnv* env, jobject thisObj, jint fd, jbyteArray buf) { void* data = env->GetPrimitiveArrayCritical(buf, NULL); - int retval = zts_read(fd, data, len); + int retval = zts_bsd_write(fd, data, env->GetArrayLength(buf)); env->ReleasePrimitiveArrayCritical(buf, data, 0); return retval > -1 ? retval : -(zts_errno); } -JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1write__IB(JNIEnv* env, jobject thisObj, jint fd, jbyteArray buf) -{ - void* data = env->GetPrimitiveArrayCritical(buf, NULL); - int retval = zts_write(fd, data, env->GetArrayLength(buf)); - env->ReleasePrimitiveArrayCritical(buf, data, 0); - return retval > -1 ? retval : -(zts_errno); -} - -JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1write_1offset( +JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1write_1offset( JNIEnv* env, jobject thisObj, jint fd, @@ -397,21 +406,22 @@ JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1write_1offset( jint len) { void* data = env->GetPrimitiveArrayCritical(&(buf[offset]), NULL); // PENDING: check? - int retval = zts_write(fd, data, len); + int retval = zts_bsd_write(fd, data, len); env->ReleasePrimitiveArrayCritical(buf, data, 0); return retval > -1 ? retval : -(zts_errno); } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1write_1byte(JNIEnv* env, jobject thisObj, jint fd, jbyte buf) +Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1write_1byte(JNIEnv* env, jobject thisObj, jint fd, jbyte buf) { - int retval = zts_write(fd, &buf, 1); + int retval = zts_bsd_write(fd, &buf, 1); return retval > -1 ? retval : -(zts_errno); } -JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1shutdown(JNIEnv* env, jobject thisObj, int fd, int how) +JNIEXPORT jint JNICALL +Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1shutdown(JNIEnv* env, jobject thisObj, int fd, int how) { - return zts_shutdown(fd, how); + return zts_bsd_shutdown(fd, how); } void ztfdset2fdset(JNIEnv* env, int nfds, jobject src_ztfd_set, zts_fd_set* dest_fd_set) @@ -844,7 +854,7 @@ Java_com_zerotier_sdk_ZeroTierNative_zts_1moon_1deorbit(JNIEnv* jenv, jobject th return zts_moon_deorbit(moon_roots_id); } -JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1connect( +JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1connect( JNIEnv* jenv, jobject thisObj, jint fd, @@ -859,13 +869,13 @@ JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1connect if (! utf_string) { return ZTS_ERR_GENERAL; } - int retval = zts_simple_connect(fd, utf_string, port, timeout_ms); + int retval = zts_connect(fd, utf_string, port, timeout_ms); jenv->ReleaseStringUTFChars(ipstr, utf_string); return retval; } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1bind(JNIEnv* jenv, jobject thisObj, jint fd, jstring ipstr, jint port) +Java_com_zerotier_sdk_ZeroTierNative_zts_1bind(JNIEnv* jenv, jobject thisObj, jint fd, jstring ipstr, jint port) { if (! ipstr) { return ZTS_ERR_ARG; @@ -874,12 +884,12 @@ Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1bind(JNIEnv* jenv, jobject thi if (! utf_string) { return ZTS_ERR_GENERAL; } - int retval = zts_simple_bind(fd, utf_string, port); + int retval = zts_bind(fd, utf_string, port); jenv->ReleaseStringUTFChars(ipstr, utf_string); return retval; } -JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1accept( +JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1accept( JNIEnv* jenv, jobject thisObj, int fd, @@ -895,7 +905,7 @@ JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1accept( if (! utf_string) { return ZTS_ERR_GENERAL; } - int retval = zts_simple_bind(fd, utf_string, port); + int retval = zts_bind(fd, utf_string, port); jenv->ReleaseStringUTFChars(ipstr, utf_string); return retval; @@ -909,162 +919,149 @@ JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1accept( } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1udp_1client(JNIEnv* jenv, jobject thisObj, jstring remote_ipstr) +Java_com_zerotier_sdk_ZeroTierNative_zts_1udp_1client(JNIEnv* jenv, jobject thisObj, jstring remote_ipstr) { return ZTS_ERR_OK; } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1set_1no_1delay(JNIEnv* jenv, jobject thisObj, jint fd, jint enabled) +Java_com_zerotier_sdk_ZeroTierNative_zts_1set_1no_1delay(JNIEnv* jenv, jobject thisObj, jint fd, jint enabled) { - return zts_simple_set_no_delay(fd, enabled); + return zts_set_no_delay(fd, enabled); +} + +JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1get_1no_1delay(JNIEnv* jenv, jobject thisObj, jint fd) +{ + return zts_get_no_delay(fd); } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1get_1no_1delay(JNIEnv* jenv, jobject thisObj, jint fd) +Java_com_zerotier_sdk_ZeroTierNative_zts_1set_1linger(JNIEnv* jenv, jobject thisObj, jint fd, jint enabled, jint value) { - return zts_simple_get_no_delay(fd); -} - -JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1set_1linger( - JNIEnv* jenv, - jobject thisObj, - jint fd, - jint enabled, - jint value) -{ - return zts_simple_set_linger(fd, enabled, value); + return zts_set_linger(fd, enabled, value); } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1get_1linger_1enabled(JNIEnv* jenv, jobject thisObj, jint fd) +Java_com_zerotier_sdk_ZeroTierNative_zts_1get_1linger_1enabled(JNIEnv* jenv, jobject thisObj, jint fd) { - return zts_simple_get_linger_enabled(fd); + return zts_get_linger_enabled(fd); } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1get_1linger_1value(JNIEnv* jenv, jobject thisObj, jint fd) +Java_com_zerotier_sdk_ZeroTierNative_zts_1get_1linger_1value(JNIEnv* jenv, jobject thisObj, jint fd) { - return zts_simple_get_linger_value(fd); + return zts_get_linger_value(fd); } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1get_1pending_1data_1size(JNIEnv* jenv, jobject thisObj, jint fd) +Java_com_zerotier_sdk_ZeroTierNative_zts_1get_1pending_1data_1size(JNIEnv* jenv, jobject thisObj, jint fd) { - return zts_simple_get_pending_data_size(fd); + return zts_get_pending_data_size(fd); } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1set_1reuse_1addr(JNIEnv* jenv, jobject thisObj, jint fd, jint enabled) +Java_com_zerotier_sdk_ZeroTierNative_zts_1set_1reuse_1addr(JNIEnv* jenv, jobject thisObj, jint fd, jint enabled) { - return zts_simple_set_reuse_addr(fd, enabled); + return zts_set_reuse_addr(fd, enabled); } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1get_1reuse_1addr(JNIEnv* jenv, jobject thisObj, jint fd) +Java_com_zerotier_sdk_ZeroTierNative_zts_1get_1reuse_1addr(JNIEnv* jenv, jobject thisObj, jint fd) { - return zts_simple_get_reuse_addr(fd); + return zts_get_reuse_addr(fd); } -JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1set_1recv_1timeout( +JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1set_1recv_1timeout( JNIEnv* jenv, jobject thisObj, jint fd, jint seconds, jint microseconds) { - return zts_simple_set_recv_timeout(fd, seconds, microseconds); + return zts_set_recv_timeout(fd, seconds, microseconds); } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1get_1recv_1timeout(JNIEnv* jenv, jobject thisObj, jint fd) +Java_com_zerotier_sdk_ZeroTierNative_zts_1get_1recv_1timeout(JNIEnv* jenv, jobject thisObj, jint fd) { - return zts_simple_get_recv_timeout(fd); + return zts_get_recv_timeout(fd); } -JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1set_1send_1timeout( +JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1set_1send_1timeout( JNIEnv* jenv, jobject thisObj, jint fd, jint seconds, jint microseconds) { - return zts_simple_set_send_timeout(fd, seconds, microseconds); + return zts_set_send_timeout(fd, seconds, microseconds); } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1get_1send_1timeout(JNIEnv* jenv, jobject thisObj, jint fd) +Java_com_zerotier_sdk_ZeroTierNative_zts_1get_1send_1timeout(JNIEnv* jenv, jobject thisObj, jint fd) { - return zts_simple_get_send_timeout(fd); -} - -JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1set_1send_1buf_1size( - JNIEnv* jenv, - jobject thisObj, - jint fd, - jint size) -{ - return zts_simple_set_send_buf_size(fd, size); + return zts_get_send_timeout(fd); } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1get_1send_1buf_1size(JNIEnv* jenv, jobject thisObj, jint fd) +Java_com_zerotier_sdk_ZeroTierNative_zts_1set_1send_1buf_1size(JNIEnv* jenv, jobject thisObj, jint fd, jint size) { - return zts_simple_get_send_buf_size(fd); -} - -JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1set_1recv_1buf_1size( - JNIEnv* jenv, - jobject thisObj, - jint fd, - jint size) -{ - return zts_simple_set_recv_buf_size(fd, size); + return zts_set_send_buf_size(fd, size); } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1get_1recv_1buf_1size(JNIEnv* jenv, jobject thisObj, jint fd) +Java_com_zerotier_sdk_ZeroTierNative_zts_1get_1send_1buf_1size(JNIEnv* jenv, jobject thisObj, jint fd) { - return zts_simple_get_recv_buf_size(fd); + return zts_get_send_buf_size(fd); } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1set_1ttl(JNIEnv* jenv, jobject thisObj, jint fd, jint ttl) +Java_com_zerotier_sdk_ZeroTierNative_zts_1set_1recv_1buf_1size(JNIEnv* jenv, jobject thisObj, jint fd, jint size) { - return zts_simple_set_ttl(fd, ttl); + return zts_set_recv_buf_size(fd, size); } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1get_1ttl(JNIEnv* jenv, jobject thisObj, jint fd) +Java_com_zerotier_sdk_ZeroTierNative_zts_1get_1recv_1buf_1size(JNIEnv* jenv, jobject thisObj, jint fd) { - return zts_simple_get_ttl(fd); + return zts_get_recv_buf_size(fd); } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1set_1blocking(JNIEnv* jenv, jobject thisObj, jint fd, jint enabled) +Java_com_zerotier_sdk_ZeroTierNative_zts_1set_1ttl(JNIEnv* jenv, jobject thisObj, jint fd, jint ttl) { - return zts_simple_set_blocking(fd, enabled); + return zts_set_ttl(fd, ttl); +} + +JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1get_1ttl(JNIEnv* jenv, jobject thisObj, jint fd) +{ + return zts_get_ttl(fd); } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1get_1blocking(JNIEnv* jenv, jobject thisObj, jint fd) +Java_com_zerotier_sdk_ZeroTierNative_zts_1set_1blocking(JNIEnv* jenv, jobject thisObj, jint fd, jint enabled) { - return zts_simple_get_blocking(fd); + return zts_set_blocking(fd, enabled); +} + +JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1get_1blocking(JNIEnv* jenv, jobject thisObj, jint fd) +{ + return zts_get_blocking(fd); } JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1set_1keepalive(JNIEnv* jenv, jobject thisObj, jint fd, jint enabled) +Java_com_zerotier_sdk_ZeroTierNative_zts_1set_1keepalive(JNIEnv* jenv, jobject thisObj, jint fd, jint enabled) { - return zts_simple_set_keepalive(fd, enabled); + return zts_set_keepalive(fd, enabled); } -JNIEXPORT jint JNICALL -Java_com_zerotier_sdk_ZeroTierNative_zts_1simple_1get_1keepalive(JNIEnv* jenv, jobject thisObj, jint fd) +JNIEXPORT jint JNICALL Java_com_zerotier_sdk_ZeroTierNative_zts_1get_1keepalive(JNIEnv* jenv, jobject thisObj, jint fd) { - return zts_simple_get_keepalive(fd); + return zts_get_keepalive(fd); } -struct hostent* Java_com_zerotier_sdk_ZeroTierNative_zts_1gethostbyname(JNIEnv* jenv, jobject thisObj, jstring name) +struct hostent* +Java_com_zerotier_sdk_ZeroTierNative_zts_1bsd_1gethostbyname(JNIEnv* jenv, jobject thisObj, jstring name) { return NULL; } diff --git a/src/bindings/java/ZeroTierInputStream.java b/src/bindings/java/ZeroTierInputStream.java index e99f413..ac6928a 100644 --- a/src/bindings/java/ZeroTierInputStream.java +++ b/src/bindings/java/ZeroTierInputStream.java @@ -37,7 +37,7 @@ public class ZeroTierInputStream extends InputStream { that aspect of the socket but not actually close it and free resources. Resources will be properly freed when the socket implementation's close() is called or if both I/OStreams are closed separately */ - ZeroTierNative.zts_shutdown(zfd, ZeroTierNative.ZTS_SHUT_RD); + ZeroTierNative.zts_bsd_shutdown(zfd, ZeroTierNative.ZTS_SHUT_RD); zfd = -1; } @@ -52,7 +52,7 @@ public class ZeroTierInputStream extends InputStream { Objects.requireNonNull(destStream, "destStream must not be null"); int bytesTransferred = 0, bytesRead; byte[] buf = new byte[8192]; - while (((bytesRead = ZeroTierNative.zts_read(zfd, buf)) >= 0)) { + while (((bytesRead = ZeroTierNative.zts_bsd_read(zfd, buf)) >= 0)) { destStream.write(buf, 0, bytesRead); bytesTransferred += bytesRead; } @@ -68,7 +68,7 @@ public class ZeroTierInputStream extends InputStream { { byte[] buf = new byte[1]; // Unlike a native read(), if nothing is read we should return -1 - int retval = ZeroTierNative.zts_read(zfd, buf); + int retval = ZeroTierNative.zts_bsd_read(zfd, buf); if ((retval == 0) | (retval == -104) /* EINTR, from SO_RCVTIMEO */) { return -1; } @@ -88,7 +88,7 @@ public class ZeroTierInputStream extends InputStream { { Objects.requireNonNull(destBuffer, "input byte array must not be null"); // Unlike a native read(), if nothing is read we should return -1 - int retval = ZeroTierNative.zts_read(zfd, destBuffer); + int retval = ZeroTierNative.zts_bsd_read(zfd, destBuffer); if ((retval == 0) | (retval == -104) /* EINTR, from SO_RCVTIMEO */) { return -1; } @@ -122,7 +122,7 @@ public class ZeroTierInputStream extends InputStream { return 0; } // Unlike a native read(), if nothing is read we should return -1 - int retval = ZeroTierNative.zts_read_offset(zfd, destBuffer, offset, numBytes); + int retval = ZeroTierNative.zts_bsd_read_offset(zfd, destBuffer, offset, numBytes); if ((retval == 0) | (retval == -104) /* EINTR, from SO_RCVTIMEO */) { return -1; } @@ -139,9 +139,9 @@ public class ZeroTierInputStream extends InputStream { */ public byte[] readAllBytes​() throws IOException { - int pendingDataSize = ZeroTierNative.zts_simple_get_pending_data_size(zfd); + int pendingDataSize = ZeroTierNative.zts_get_pending_data_size(zfd); byte[] buf = new byte[pendingDataSize]; - int retval = ZeroTierNative.zts_read(zfd, buf); + int retval = ZeroTierNative.zts_bsd_read(zfd, buf); if ((retval == 0) | (retval == -104) /* EINTR, from SO_RCVTIMEO */) { // No action needed } @@ -174,7 +174,7 @@ public class ZeroTierInputStream extends InputStream { if (numBytes == 0) { return 0; } - int retval = ZeroTierNative.zts_read_offset(zfd, destBuffer, offset, numBytes); + int retval = ZeroTierNative.zts_bsd_read_offset(zfd, destBuffer, offset, numBytes); if ((retval == 0) | (retval == -104) /* EINTR, from SO_RCVTIMEO */) { // No action needed } @@ -199,7 +199,8 @@ public class ZeroTierInputStream extends InputStream { int bufSize = (int)Math.min(2048, bytesRemaining); byte[] buf = new byte[bufSize]; while (bytesRemaining > 0) { - if ((bytesRead = ZeroTierNative.zts_read_length(zfd, buf, (int)Math.min(bufSize, bytesRemaining))) < 0) { + if ((bytesRead = ZeroTierNative.zts_bsd_read_length(zfd, buf, (int)Math.min(bufSize, bytesRemaining))) + < 0) { break; } bytesRemaining -= bytesRead; diff --git a/src/bindings/java/ZeroTierNative.java b/src/bindings/java/ZeroTierNative.java index 1e1a5dc..e3dd489 100644 --- a/src/bindings/java/ZeroTierNative.java +++ b/src/bindings/java/ZeroTierNative.java @@ -473,20 +473,20 @@ public class ZeroTierNative { public static native int zts_moon_orbit(long moon_roots_id, long moon_seed); public static native int zts_moon_deorbit(long moon_roots_id); - // public static native int zts_socket(int family, int type, int protocol); - // public static native int zts_connect(int fd, /*const*/ struct sockaddr* addr, socklen_t addrlen); - // public static native int zts_bind(int fd, /*const*/ struct sockaddr* addr, socklen_t addrlen); - // public static native int zts_listen(int fd, int backlog); - // public static native int zts_accept(int fd, struct sockaddr* addr, socklen_t* addrlen); - // public static native int zts_setsockopt(int fd, int level, int optname, /*const*/ void* optval, socklen_t - // optlen); public static native int zts_getsockopt(int fd, int level, int optname, void* optval, socklen_t* - // optlen); public static native int zts_getsockname(int fd, struct sockaddr* addr, socklen_t* addrlen); public - // static native int zts_getpeername(int fd, struct sockaddr* addr, socklen_t* addrlen); public static native int - // zts_close(int fd); public static native int zts_select(int nfds, fd_set* readfds, fd_set* writefds, fd_set* - // exceptfds, struct timeval* timeout); public static native int zts_fcntl(int fd, int cmd, int flags); public - // static native int zts_poll(struct pollfd* fds, nfds_t nfds, int timeout); public static native int zts_ioctl(int - // fd, long request, void* argp); public static native int send(int fd, /*const*/ void* buf, size_t len, int - // flags); public static native int sendto(int fd, + // public static native int zts_bsd_socket(int family, int type, int protocol); + // public static native int zts_bsd_connect(int fd, /*const*/ struct sockaddr* addr, socklen_t addrlen); + // public static native int zts_bsd_bind(int fd, /*const*/ struct sockaddr* addr, socklen_t addrlen); + // public static native int zts_bsd_listen(int fd, int backlog); + // public static native int zts_bsd_accept(int fd, struct sockaddr* addr, socklen_t* addrlen); + // public static native int zts_bsd_setsockopt(int fd, int level, int optname, /*const*/ void* optval, socklen_t + // optlen); public static native int zts_bsd_getsockopt(int fd, int level, int optname, void* optval, socklen_t* + // optlen); public static native int zts_bsd_getsockname(int fd, struct sockaddr* addr, socklen_t* addrlen); public + // static native int zts_bsd_getpeername(int fd, struct sockaddr* addr, socklen_t* addrlen); public static native + // int zts_bsd_close(int fd); public static native int zts_bsd_select(int nfds, fd_set* readfds, fd_set* writefds, + // fd_set* exceptfds, struct timeval* timeout); public static native int zts_bsd_fcntl(int fd, int cmd, int flags); + // public static native int zts_bsd_poll(struct pollfd* fds, nfds_t nfds, int timeout); public static native int + // zts_bsd_ioctl(int fd, long request, void* argp); public static native int send(int fd, /*const*/ void* buf, + // size_t len, int flags); public static native int sendto(int fd, // /*const*/ void* buf, size_t len, int flags, /*const*/ struct sockaddr* addr, socklen_t addrlen); public static // native int sendmsg(int fd, /*const*/ struct msghdr* msg, int flags); public static native int recv(int fd, // void* buf, size_t len, int flags); public static native int recvfrom(int fd, void* buf, size_t len, int flags, @@ -495,36 +495,36 @@ public class ZeroTierNative { // /*const*/ struct iovec* iov, int iovcnt); public static native int write(int fd, /*const*/ void* buf, size_t // len); public static native int writev(int fd, /*const*/ struct iovec* iov, int iovcnt); public static native int // shutdown(int fd, int how); - public static native int zts_simple_connect(int fd, /*const*/ String ipstr, int port, int timeout_ms); - public static native int zts_simple_bind(int fd, /*const*/ String ipstr, int port); - // public static native int zts_simple_accept(int fd, String remote_addr, int len, int* port); - public static native int zts_simple_tcp_client(/*const*/ String remote_ipstr, int remote_port); - // public static native int zts_simple_tcp_server(/*const*/ String local_ipstr, int local_port, String remote_ipstr, + public static native int zts_connect(int fd, /*const*/ String ipstr, int port, int timeout_ms); + public static native int zts_bind(int fd, /*const*/ String ipstr, int port); + // public static native int zts_accept(int fd, String remote_addr, int len, int* port); + public static native int zts_tcp_client(/*const*/ String remote_ipstr, int remote_port); + // public static native int zts_tcp_server(/*const*/ String local_ipstr, int local_port, String remote_ipstr, // int len, int* remote_port); - public static native int zts_simple_udp_server(/*const*/ String local_ipstr, int local_port); - public static native int zts_simple_udp_client(/*const*/ String remote_ipstr); - public static native int zts_simple_set_no_delay(int fd, int enabled); - public static native int zts_simple_get_no_delay(int fd); - public static native int zts_simple_set_linger(int fd, int enabled, int value); - public static native int zts_simple_get_linger_enabled(int fd); - public static native int zts_simple_get_linger_value(int fd); - public static native int zts_simple_get_pending_data_size(int fd); - public static native int zts_simple_set_reuse_addr(int fd, int enabled); - public static native int zts_simple_get_reuse_addr(int fd); - public static native int zts_simple_set_recv_timeout(int fd, int seconds, int microseconds); - public static native int zts_simple_get_recv_timeout(int fd); - public static native int zts_simple_set_send_timeout(int fd, int seconds, int microseconds); - public static native int zts_simple_get_send_timeout(int fd); - public static native int zts_simple_set_send_buf_size(int fd, int size); - public static native int zts_simple_get_send_buf_size(int fd); - public static native int zts_simple_set_recv_buf_size(int fd, int size); - public static native int zts_simple_get_recv_buf_size(int fd); - public static native int zts_simple_set_ttl(int fd, int ttl); - public static native int zts_simple_get_ttl(int fd); - public static native int zts_simple_set_blocking(int fd, int enabled); - public static native int zts_simple_get_blocking(int fd); - public static native int zts_simple_set_keepalive(int fd, int enabled); - public static native int zts_simple_get_keepalive(int fd); + public static native int zts_udp_server(/*const*/ String local_ipstr, int local_port); + public static native int zts_udp_client(/*const*/ String remote_ipstr); + public static native int zts_set_no_delay(int fd, int enabled); + public static native int zts_get_no_delay(int fd); + public static native int zts_set_linger(int fd, int enabled, int value); + public static native int zts_get_linger_enabled(int fd); + public static native int zts_get_linger_value(int fd); + public static native int zts_get_pending_data_size(int fd); + public static native int zts_set_reuse_addr(int fd, int enabled); + public static native int zts_get_reuse_addr(int fd); + public static native int zts_set_recv_timeout(int fd, int seconds, int microseconds); + public static native int zts_get_recv_timeout(int fd); + public static native int zts_set_send_timeout(int fd, int seconds, int microseconds); + public static native int zts_get_send_timeout(int fd); + public static native int zts_set_send_buf_size(int fd, int size); + public static native int zts_get_send_buf_size(int fd); + public static native int zts_set_recv_buf_size(int fd, int size); + public static native int zts_get_recv_buf_size(int fd); + public static native int zts_set_ttl(int fd, int ttl); + public static native int zts_get_ttl(int fd); + public static native int zts_set_blocking(int fd, int enabled); + public static native int zts_get_blocking(int fd); + public static native int zts_set_keepalive(int fd, int enabled); + public static native int zts_get_keepalive(int fd); // struct hostent* gethostbyname(/*const*/ String name); // public static native int zts_dns_set_server(uint8_t index, /*const*/ ip_addr* addr); // ZTS_API /*const*/ ip_addr* ZTCALL dns_get_server(uint8_t index); @@ -565,35 +565,35 @@ public class ZeroTierNative { // Socket API // ////////////////////////////////////////////////////////////////////////////// - public static native int zts_socket(int family, int type, int protocol); - // public static native int zts_connect(int fd, ZeroTierSocketAddress addr); - // public static native int zts_bind(int fd, ZeroTierSocketAddress addr); - public static native int zts_listen(int fd, int backlog); - public static native int zts_accept(int fd, ZeroTierSocketAddress addr); + public static native int zts_bsd_socket(int family, int type, int protocol); + // public static native int zts_bsd_connect(int fd, ZeroTierSocketAddress addr); + // public static native int zts_bsd_bind(int fd, ZeroTierSocketAddress addr); + public static native int zts_bsd_listen(int fd, int backlog); + public static native int zts_bsd_accept(int fd, ZeroTierSocketAddress addr); - // public static native int zts_setsockopt(int fd, int level, int optname, ZeroTierSocketOptionValue optval); - // public static native int zts_getsockopt(int fd, int level, int optname, ZeroTierSocketOptionValue optval); + // public static native int zts_bsd_setsockopt(int fd, int level, int optname, ZeroTierSocketOptionValue optval); + // public static native int zts_bsd_getsockopt(int fd, int level, int optname, ZeroTierSocketOptionValue optval); - public static native int zts_read(int fd, byte[] buf); - public static native int zts_read_offset(int fd, byte[] buf, int offset, int len); - public static native int zts_read_length(int fd, byte[] buf, int len); - public static native int zts_recv(int fd, byte[] buf, int flags); - public static native int zts_recvfrom(int fd, byte[] buf, int flags, ZeroTierSocketAddress addr); + public static native int zts_bsd_read(int fd, byte[] buf); + public static native int zts_bsd_read_offset(int fd, byte[] buf, int offset, int len); + public static native int zts_bsd_read_length(int fd, byte[] buf, int len); + public static native int zts_bsd_recv(int fd, byte[] buf, int flags); + public static native int zts_bsd_recvfrom(int fd, byte[] buf, int flags, ZeroTierSocketAddress addr); - public static native int zts_write(int fd, byte[] buf); - public static native int zts_write_byte(int fd, byte b); - public static native int zts_write_offset(int fd, byte[] buf, int offset, int len); - public static native int zts_sendto(int fd, byte[] buf, int flags, ZeroTierSocketAddress addr); - public static native int zts_send(int fd, byte[] buf, int flags); + public static native int zts_bsd_write(int fd, byte[] buf); + public static native int zts_bsd_write_byte(int fd, byte b); + public static native int zts_bsd_write_offset(int fd, byte[] buf, int offset, int len); + public static native int zts_bsd_sendto(int fd, byte[] buf, int flags, ZeroTierSocketAddress addr); + public static native int zts_bsd_send(int fd, byte[] buf, int flags); - public static native int zts_shutdown(int fd, int how); - public static native int zts_close(int fd); + public static native int zts_bsd_shutdown(int fd, int how); + public static native int zts_bsd_close(int fd); - public static native boolean zts_getsockname(int fd, ZeroTierSocketAddress addr); - public static native int zts_getpeername(int fd, ZeroTierSocketAddress addr); - public static native int zts_fcntl(int sock, int cmd, int flag); - // public static native int zts_ioctl(int fd, long request, ZeroTierIoctlArg arg); - public static native int zts_select( + public static native boolean zts_bsd_getsockname(int fd, ZeroTierSocketAddress addr); + public static native int zts_bsd_getpeername(int fd, ZeroTierSocketAddress addr); + public static native int zts_bsd_fcntl(int sock, int cmd, int flag); + // public static native int zts_bsd_ioctl(int fd, long request, ZeroTierIoctlArg arg); + public static native int zts_bsd_select( int nfds, ZeroTierFileDescriptorSet readfds, ZeroTierFileDescriptorSet writefds, diff --git a/src/bindings/java/ZeroTierOutputStream.java b/src/bindings/java/ZeroTierOutputStream.java index 8cbff7f..a1127de 100644 --- a/src/bindings/java/ZeroTierOutputStream.java +++ b/src/bindings/java/ZeroTierOutputStream.java @@ -39,7 +39,7 @@ public class ZeroTierOutputStream extends OutputStream { it and free resources. Resources will be properly freed when the socket implementation's native close() is called or if both I/OStreams are closed separately */ - ZeroTierNative.zts_shutdown(zfd, ZeroTierNative.ZTS_SHUT_WR); + ZeroTierNative.zts_bsd_shutdown(zfd, ZeroTierNative.ZTS_SHUT_WR); zfd = -1; } @@ -50,7 +50,7 @@ public class ZeroTierOutputStream extends OutputStream { */ public void write(byte[] originBuffer) throws IOException { - int bytesWritten = ZeroTierNative.zts_write(zfd, originBuffer); + int bytesWritten = ZeroTierNative.zts_bsd_write(zfd, originBuffer); if (bytesWritten < 0) { throw new IOException("write(originBuffer[]), errno=" + bytesWritten); } @@ -75,7 +75,7 @@ public class ZeroTierOutputStream extends OutputStream { if ((offset + numBytes) > originBuffer.length) { throw new IndexOutOfBoundsException("(offset+numBytes) > originBuffer.length"); } - int bytesWritten = ZeroTierNative.zts_write_offset(zfd, originBuffer, offset, numBytes); + int bytesWritten = ZeroTierNative.zts_bsd_write_offset(zfd, originBuffer, offset, numBytes); if (bytesWritten < 0) { throw new IOException("write(originBuffer[],offset,numBytes), errno=" + bytesWritten); } @@ -89,7 +89,7 @@ public class ZeroTierOutputStream extends OutputStream { public void write(int d) throws IOException { byte lowByte = (byte)(d & 0xFF); - int bytesWritten = ZeroTierNative.zts_write_byte(zfd, lowByte); + int bytesWritten = ZeroTierNative.zts_bsd_write_byte(zfd, lowByte); if (bytesWritten < 0) { throw new IOException("write(d), errno=" + bytesWritten); } diff --git a/src/bindings/java/ZeroTierSocket.java b/src/bindings/java/ZeroTierSocket.java index 4aafb75..d8f526b 100644 --- a/src/bindings/java/ZeroTierSocket.java +++ b/src/bindings/java/ZeroTierSocket.java @@ -76,7 +76,7 @@ public class ZeroTierSocket { if (_zfd > -1) { throw new IOException("This socket has already been created (fd=" + _zfd + ")"); } - _zfd = ZeroTierNative.zts_socket(ZeroTierNative.ZTS_AF_INET, ZeroTierNative.ZTS_SOCK_STREAM, protocol); + _zfd = ZeroTierNative.zts_bsd_socket(ZeroTierNative.ZTS_AF_INET, ZeroTierNative.ZTS_SOCK_STREAM, protocol); if (_zfd < 0) { throw new IOException("Error while creating socket (" + _zfd + ")"); } @@ -105,7 +105,7 @@ public class ZeroTierSocket { throw new IOException("Invalid address type. Socket is of type AF_INET6"); } int err; - if ((err = ZeroTierNative.zts_simple_connect(_zfd, remoteAddr.getHostAddress(), remotePort, 0)) < 0) { + if ((err = ZeroTierNative.zts_connect(_zfd, remoteAddr.getHostAddress(), remotePort, 0)) < 0) { throw new IOException("Error while connecting to remote host (" + err + ")"); } _isConnected = true; @@ -155,7 +155,7 @@ public class ZeroTierSocket { throw new IOException("Invalid address type. Socket is of type AF_INET6"); } int err; - if ((err = ZeroTierNative.zts_simple_bind(_zfd, localAddr.getHostAddress(), localPort)) < 0) { + if ((err = ZeroTierNative.zts_bind(_zfd, localAddr.getHostAddress(), localPort)) < 0) { throw new IOException("Error while connecting to remote host (" + err + ")"); } _localPort = localPort; @@ -190,7 +190,7 @@ public class ZeroTierSocket { throw new IOException("Invalid backlog value"); } int err; - if ((err = ZeroTierNative.zts_listen(_zfd, backlog)) < 0) { + if ((err = ZeroTierNative.zts_bsd_listen(_zfd, backlog)) < 0) { throw new IOException("Error while putting socket into listening state (" + err + ")"); } } @@ -207,7 +207,7 @@ public class ZeroTierSocket { } int accetpedFd = -1; ZeroTierSocketAddress addr = new ZeroTierSocketAddress(); - if ((accetpedFd = ZeroTierNative.zts_accept(_zfd, addr)) < 0) { + if ((accetpedFd = ZeroTierNative.zts_bsd_accept(_zfd, addr)) < 0) { throw new IOException("Error while accepting connection (" + accetpedFd + ")"); } return new ZeroTierSocket(_family, _type, _protocol, accetpedFd); @@ -223,7 +223,7 @@ public class ZeroTierSocket { if (_zfd < 0) { throw new IOException("Invalid socket (fd < 0)"); } - ZeroTierNative.zts_close(_zfd); + ZeroTierNative.zts_bsd_close(_zfd); _isClosed = true; } @@ -237,7 +237,7 @@ public class ZeroTierSocket { if (_isClosed) { throw new SocketException("Error: ZeroTierSocket is closed"); } - return ZeroTierNative.zts_simple_get_keepalive(_zfd) == 1; + return ZeroTierNative.zts_get_keepalive(_zfd) == 1; } /** @@ -298,7 +298,7 @@ public class ZeroTierSocket { if (_isClosed) { throw new SocketException("Error: ZeroTierSocket is closed"); } - return ZeroTierNative.zts_simple_get_recv_buf_size(_zfd); + return ZeroTierNative.zts_get_recv_buf_size(_zfd); } /** @@ -311,7 +311,7 @@ public class ZeroTierSocket { if (_isClosed) { throw new SocketException("Error: ZeroTierSocket is closed"); } - return ZeroTierNative.zts_simple_get_send_buf_size(_zfd); + return ZeroTierNative.zts_get_send_buf_size(_zfd); } /** @@ -324,7 +324,7 @@ public class ZeroTierSocket { if (_isClosed) { throw new SocketException("Error: ZeroTierSocket is closed"); } - return ZeroTierNative.zts_simple_get_reuse_addr(_zfd) == 1; + return ZeroTierNative.zts_get_reuse_addr(_zfd) == 1; } /** @@ -337,7 +337,7 @@ public class ZeroTierSocket { if (_isClosed) { throw new SocketException("Error: ZeroTierSocket is closed"); } - return ZeroTierNative.zts_simple_get_linger_value(_zfd); + return ZeroTierNative.zts_get_linger_value(_zfd); } /** @@ -350,7 +350,7 @@ public class ZeroTierSocket { if (_isClosed) { throw new SocketException("Error: ZeroTierSocket is closed"); } - return ZeroTierNative.zts_simple_get_recv_timeout(_zfd); + return ZeroTierNative.zts_get_recv_timeout(_zfd); } /** @@ -363,7 +363,7 @@ public class ZeroTierSocket { if (_isClosed) { throw new SocketException("Error: ZeroTierSocket is closed"); } - return ZeroTierNative.zts_simple_get_no_delay(_zfd) == 1; + return ZeroTierNative.zts_get_no_delay(_zfd) == 1; } /** @@ -409,7 +409,7 @@ public class ZeroTierSocket { if (_inputHasBeenShutdown) { throw new SocketException("Error: ZeroTierSocket input has been shut down"); } - ZeroTierNative.zts_shutdown(_zfd, ZeroTierNative.ZTS_SHUT_RD); + ZeroTierNative.zts_bsd_shutdown(_zfd, ZeroTierNative.ZTS_SHUT_RD); _inputHasBeenShutdown = true; } @@ -429,7 +429,7 @@ public class ZeroTierSocket { if (_outputHasBeenShutdown) { throw new SocketException("Error: ZeroTierSocket output has been shut down"); } - ZeroTierNative.zts_shutdown(_zfd, ZeroTierNative.ZTS_SHUT_WR); + ZeroTierNative.zts_bsd_shutdown(_zfd, ZeroTierNative.ZTS_SHUT_WR); _outputHasBeenShutdown = true; } @@ -500,7 +500,7 @@ public class ZeroTierSocket { if (_isClosed) { throw new SocketException("Error: ZeroTierSocket is closed"); } - if (ZeroTierNative.zts_simple_set_keepalive(_zfd, (enabled ? 1 : 0)) != ZeroTierNative.ZTS_ERR_OK) { + if (ZeroTierNative.zts_set_keepalive(_zfd, (enabled ? 1 : 0)) != ZeroTierNative.ZTS_ERR_OK) { throw new SocketException("Error: Could not set SO_KEEPALIVE"); } } @@ -519,7 +519,7 @@ public class ZeroTierSocket { if (bufferSize <= 0) { throw new IllegalArgumentException("Error: bufferSize <= 0"); } - if (ZeroTierNative.zts_simple_set_recv_buf_size(_zfd, bufferSize) != ZeroTierNative.ZTS_ERR_OK) { + if (ZeroTierNative.zts_set_recv_buf_size(_zfd, bufferSize) != ZeroTierNative.ZTS_ERR_OK) { throw new SocketException("Error: Could not set receive buffer size"); } } @@ -535,7 +535,7 @@ public class ZeroTierSocket { if (_isClosed) { throw new SocketException("Error: ZeroTierSocket is closed"); } - if (ZeroTierNative.zts_simple_set_reuse_addr(_zfd, (enabled ? 1 : 0)) != ZeroTierNative.ZTS_ERR_OK) { + if (ZeroTierNative.zts_set_reuse_addr(_zfd, (enabled ? 1 : 0)) != ZeroTierNative.ZTS_ERR_OK) { throw new SocketException("Error: Could not set SO_REUSEADDR"); } } @@ -554,7 +554,7 @@ public class ZeroTierSocket { if (bufferSize <= 0) { throw new IllegalArgumentException("Error: bufferSize <= 0"); } - if (ZeroTierNative.zts_simple_set_send_buf_size(_zfd, bufferSize) != ZeroTierNative.ZTS_ERR_OK) { + if (ZeroTierNative.zts_set_send_buf_size(_zfd, bufferSize) != ZeroTierNative.ZTS_ERR_OK) { throw new SocketException("Error: Could not set SO_SNDBUF"); } } @@ -574,7 +574,7 @@ public class ZeroTierSocket { if (lingerTime < 0) { throw new IllegalArgumentException("Error: lingerTime < 0"); } - if (ZeroTierNative.zts_simple_set_linger(_zfd, (enabled ? 1 : 0), lingerTime) != ZeroTierNative.ZTS_ERR_OK) { + if (ZeroTierNative.zts_set_linger(_zfd, (enabled ? 1 : 0), lingerTime) != ZeroTierNative.ZTS_ERR_OK) { throw new SocketException("Error: Could not set ZTS_SO_LINGER"); } } @@ -594,7 +594,7 @@ public class ZeroTierSocket { throw new IllegalArgumentException("Error: SO_TIMEOUT < 0"); } // TODO: This is incorrect - if (ZeroTierNative.zts_simple_set_recv_timeout(_zfd, timeout, timeout) != ZeroTierNative.ZTS_ERR_OK) { + if (ZeroTierNative.zts_set_recv_timeout(_zfd, timeout, timeout) != ZeroTierNative.ZTS_ERR_OK) { throw new SocketException("Error: Could not set SO_RCVTIMEO"); } } @@ -610,7 +610,7 @@ public class ZeroTierSocket { if (_isClosed) { throw new SocketException("Error: ZeroTierSocket is closed"); } - if (ZeroTierNative.zts_simple_set_no_delay(_zfd, (enabled ? 1 : 0)) != ZeroTierNative.ZTS_ERR_OK) { + if (ZeroTierNative.zts_set_no_delay(_zfd, (enabled ? 1 : 0)) != ZeroTierNative.ZTS_ERR_OK) { throw new SocketException("Error: Could not set TCP_NODELAY"); } } diff --git a/src/bindings/python/PythonSockets.cxx b/src/bindings/python/PythonSockets.cxx index a4bd32e..ff32daa 100644 --- a/src/bindings/python/PythonSockets.cxx +++ b/src/bindings/python/PythonSockets.cxx @@ -29,7 +29,7 @@ int zts_py_setblocking(int fd, int block) { int new_flags, cur_flags, err = 0; - Py_BEGIN_ALLOW_THREADS cur_flags = zts_fcntl(fd, F_GETFL, 0); + Py_BEGIN_ALLOW_THREADS cur_flags = zts_bsd_fcntl(fd, F_GETFL, 0); if (cur_flags < 0) { err = ZTS_ERR_SOCKET; @@ -44,7 +44,7 @@ int zts_py_setblocking(int fd, int block) } if (new_flags != cur_flags) { - err = zts_fcntl(fd, F_SETFL, new_flags); + err = zts_bsd_fcntl(fd, F_SETFL, new_flags); } done: @@ -57,7 +57,7 @@ int zts_py_getblocking(int fd) { int flags; - Py_BEGIN_ALLOW_THREADS flags = zts_fcntl(fd, F_GETFL, 0); + Py_BEGIN_ALLOW_THREADS flags = zts_bsd_fcntl(fd, F_GETFL, 0); Py_END_ALLOW_THREADS if (flags < 0) @@ -103,7 +103,7 @@ PyObject* zts_py_accept(int fd) { struct zts_sockaddr_in addrbuf = { 0 }; socklen_t addrlen = sizeof(addrbuf); - int err = zts_accept(fd, (struct zts_sockaddr*)&addrbuf, &addrlen); + int err = zts_bsd_accept(fd, (struct zts_sockaddr*)&addrbuf, &addrlen); char ipstr[ZTS_INET_ADDRSTRLEN] = { 0 }; zts_inet_ntop(ZTS_AF_INET, &(addrbuf.sin_addr), ipstr, ZTS_INET_ADDRSTRLEN); PyObject* t; @@ -120,7 +120,7 @@ int zts_py_listen(int fd, int backlog) if (backlog < 0) { backlog = 128; } - return zts_listen(fd, backlog); + return zts_bsd_listen(fd, backlog); } int zts_py_bind(int fd, int family, int type, PyObject* addr_obj) @@ -131,7 +131,7 @@ int zts_py_bind(int fd, int family, int type, PyObject* addr_obj) if (zts_py_tuple_to_sockaddr(family, addr_obj, (struct zts_sockaddr*)&addrbuf, &addrlen) != ZTS_ERR_OK) { return ZTS_ERR_ARG; } - Py_BEGIN_ALLOW_THREADS err = zts_bind(fd, (struct zts_sockaddr*)&addrbuf, addrlen); + Py_BEGIN_ALLOW_THREADS err = zts_bsd_bind(fd, (struct zts_sockaddr*)&addrbuf, addrlen); Py_END_ALLOW_THREADS return err; } @@ -143,7 +143,7 @@ int zts_py_connect(int fd, int family, int type, PyObject* addr_obj) if (zts_py_tuple_to_sockaddr(family, addr_obj, (struct zts_sockaddr*)&addrbuf, &addrlen) != ZTS_ERR_OK) { return ZTS_ERR_ARG; } - Py_BEGIN_ALLOW_THREADS err = zts_connect(fd, (struct zts_sockaddr*)&addrbuf, addrlen); + Py_BEGIN_ALLOW_THREADS err = zts_bsd_connect(fd, (struct zts_sockaddr*)&addrbuf, addrlen); Py_END_ALLOW_THREADS return err; } @@ -157,7 +157,7 @@ PyObject* zts_py_recv(int fd, int len, int flags) return NULL; } - bytes_read = zts_recv(fd, PyBytes_AS_STRING(buf), len, flags); + bytes_read = zts_bsd_recv(fd, PyBytes_AS_STRING(buf), len, flags); t = PyTuple_New(2); PyTuple_SetItem(t, 0, PyLong_FromLong(bytes_read)); @@ -187,7 +187,7 @@ int zts_py_send(int fd, PyObject* buf, int flags) return 0; } - bytes_sent = zts_send(fd, output.buf, output.len, flags); + bytes_sent = zts_bsd_send(fd, output.buf, output.len, flags); PyBuffer_Release(&output); return bytes_sent; @@ -196,7 +196,7 @@ int zts_py_send(int fd, PyObject* buf, int flags) int zts_py_close(int fd) { int err; - Py_BEGIN_ALLOW_THREADS err = zts_close(fd); + Py_BEGIN_ALLOW_THREADS err = zts_bsd_close(fd); Py_END_ALLOW_THREADS return err; } diff --git a/src/bindings/python/libzt.py b/src/bindings/python/libzt.py old mode 100644 new mode 100755 index 7d506ee..ef8f508 --- a/src/bindings/python/libzt.py +++ b/src/bindings/python/libzt.py @@ -1,11 +1,10 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 4.0.1 +# Version 4.0.2 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info as _swig_python_version_info - if _swig_python_version_info < (2, 7, 0): raise RuntimeError("Python 2.7 or later required") @@ -20,17 +19,12 @@ try: except ImportError: import __builtin__ - def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() except __builtin__.Exception: strthis = "" - return "<%s.%s; %s >" % ( - self.__class__.__module__, - self.__class__.__name__, - strthis, - ) + return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) def _swig_setattr_nondynamic_instance_variable(set): @@ -43,7 +37,6 @@ def _swig_setattr_nondynamic_instance_variable(set): set(self, name, value) else: raise AttributeError("You cannot add instance attributes to %s" % self) - return set_instance_attr @@ -53,35 +46,35 @@ def _swig_setattr_nondynamic_class_variable(set): set(cls, name, value) else: raise AttributeError("You cannot add class attributes to %s" % cls) - return set_class_attr def _swig_add_metaclass(metaclass): """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass""" - def wrapper(cls): return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy()) - return wrapper class _SwigNonDynamicMeta(type): """Meta class to enforce nondynamic attributes (no new attributes) for a class""" - __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__) import weakref ZTS_ENABLE_PYTHON = _libzt.ZTS_ENABLE_PYTHON +ZTS_ERR_OK = _libzt.ZTS_ERR_OK +ZTS_ERR_SOCKET = _libzt.ZTS_ERR_SOCKET +ZTS_ERR_SERVICE = _libzt.ZTS_ERR_SERVICE +ZTS_ERR_ARG = _libzt.ZTS_ERR_ARG +ZTS_ERR_NO_RESULT = _libzt.ZTS_ERR_NO_RESULT +ZTS_ERR_GENERAL = _libzt.ZTS_ERR_GENERAL ZTS_EVENT_NODE_UP = _libzt.ZTS_EVENT_NODE_UP ZTS_EVENT_NODE_ONLINE = _libzt.ZTS_EVENT_NODE_ONLINE ZTS_EVENT_NODE_OFFLINE = _libzt.ZTS_EVENT_NODE_OFFLINE ZTS_EVENT_NODE_DOWN = _libzt.ZTS_EVENT_NODE_DOWN -ZTS_EVENT_NODE_IDENTITY_COLLISION = _libzt.ZTS_EVENT_NODE_IDENTITY_COLLISION -ZTS_EVENT_NODE_UNRECOVERABLE_ERROR = _libzt.ZTS_EVENT_NODE_UNRECOVERABLE_ERROR -ZTS_EVENT_NODE_NORMAL_TERMINATION = _libzt.ZTS_EVENT_NODE_NORMAL_TERMINATION +ZTS_EVENT_NODE_FATAL_ERROR = _libzt.ZTS_EVENT_NODE_FATAL_ERROR ZTS_EVENT_NETWORK_NOT_FOUND = _libzt.ZTS_EVENT_NETWORK_NOT_FOUND ZTS_EVENT_NETWORK_CLIENT_TOO_OLD = _libzt.ZTS_EVENT_NETWORK_CLIENT_TOO_OLD ZTS_EVENT_NETWORK_REQ_CONFIG = _libzt.ZTS_EVENT_NETWORK_REQ_CONFIG @@ -110,99 +103,30 @@ ZTS_EVENT_ADDR_ADDED_IP4 = _libzt.ZTS_EVENT_ADDR_ADDED_IP4 ZTS_EVENT_ADDR_REMOVED_IP4 = _libzt.ZTS_EVENT_ADDR_REMOVED_IP4 ZTS_EVENT_ADDR_ADDED_IP6 = _libzt.ZTS_EVENT_ADDR_ADDED_IP6 ZTS_EVENT_ADDR_REMOVED_IP6 = _libzt.ZTS_EVENT_ADDR_REMOVED_IP6 -ZTS_ERR_OK = _libzt.ZTS_ERR_OK -ZTS_ERR_SOCKET = _libzt.ZTS_ERR_SOCKET -ZTS_ERR_SERVICE = _libzt.ZTS_ERR_SERVICE -ZTS_ERR_ARG = _libzt.ZTS_ERR_ARG -ZTS_ERR_NO_RESULT = _libzt.ZTS_ERR_NO_RESULT -ZTS_ERR_GENERAL = _libzt.ZTS_ERR_GENERAL +ZTS_EVENT_STORE_IDENTITY_SECRET = _libzt.ZTS_EVENT_STORE_IDENTITY_SECRET +ZTS_EVENT_STORE_IDENTITY_PUBLIC = _libzt.ZTS_EVENT_STORE_IDENTITY_PUBLIC +ZTS_EVENT_STORE_PLANET = _libzt.ZTS_EVENT_STORE_PLANET +ZTS_EVENT_STORE_PEER = _libzt.ZTS_EVENT_STORE_PEER +ZTS_EVENT_STORE_NETWORK = _libzt.ZTS_EVENT_STORE_NETWORK ZTS_EPERM = _libzt.ZTS_EPERM ZTS_ENOENT = _libzt.ZTS_ENOENT ZTS_ESRCH = _libzt.ZTS_ESRCH ZTS_EINTR = _libzt.ZTS_EINTR ZTS_EIO = _libzt.ZTS_EIO ZTS_ENXIO = _libzt.ZTS_ENXIO -ZTS_E2BIG = _libzt.ZTS_E2BIG -ZTS_ENOEXEC = _libzt.ZTS_ENOEXEC ZTS_EBADF = _libzt.ZTS_EBADF -ZTS_ECHILD = _libzt.ZTS_ECHILD ZTS_EAGAIN = _libzt.ZTS_EAGAIN +ZTS_EWOULDBLOCK = _libzt.ZTS_EWOULDBLOCK ZTS_ENOMEM = _libzt.ZTS_ENOMEM ZTS_EACCES = _libzt.ZTS_EACCES ZTS_EFAULT = _libzt.ZTS_EFAULT -ZTS_ENOTBLK = _libzt.ZTS_ENOTBLK ZTS_EBUSY = _libzt.ZTS_EBUSY ZTS_EEXIST = _libzt.ZTS_EEXIST -ZTS_EXDEV = _libzt.ZTS_EXDEV ZTS_ENODEV = _libzt.ZTS_ENODEV -ZTS_ENOTDIR = _libzt.ZTS_ENOTDIR -ZTS_EISDIR = _libzt.ZTS_EISDIR ZTS_EINVAL = _libzt.ZTS_EINVAL ZTS_ENFILE = _libzt.ZTS_ENFILE ZTS_EMFILE = _libzt.ZTS_EMFILE -ZTS_ENOTTY = _libzt.ZTS_ENOTTY -ZTS_ETXTBSY = _libzt.ZTS_ETXTBSY -ZTS_EFBIG = _libzt.ZTS_EFBIG -ZTS_ENOSPC = _libzt.ZTS_ENOSPC -ZTS_ESPIPE = _libzt.ZTS_ESPIPE -ZTS_EROFS = _libzt.ZTS_EROFS -ZTS_EMLINK = _libzt.ZTS_EMLINK -ZTS_EPIPE = _libzt.ZTS_EPIPE -ZTS_EDOM = _libzt.ZTS_EDOM -ZTS_ERANGE = _libzt.ZTS_ERANGE -ZTS_EDEADLK = _libzt.ZTS_EDEADLK -ZTS_ENAMETOOLONG = _libzt.ZTS_ENAMETOOLONG -ZTS_ENOLCK = _libzt.ZTS_ENOLCK ZTS_ENOSYS = _libzt.ZTS_ENOSYS -ZTS_ENOTEMPTY = _libzt.ZTS_ENOTEMPTY -ZTS_ELOOP = _libzt.ZTS_ELOOP -ZTS_EWOULDBLOCK = _libzt.ZTS_EWOULDBLOCK -ZTS_ENOMSG = _libzt.ZTS_ENOMSG -ZTS_EIDRM = _libzt.ZTS_EIDRM -ZTS_ECHRNG = _libzt.ZTS_ECHRNG -ZTS_EL2NSYNC = _libzt.ZTS_EL2NSYNC -ZTS_EL3HLT = _libzt.ZTS_EL3HLT -ZTS_EL3RST = _libzt.ZTS_EL3RST -ZTS_ELNRNG = _libzt.ZTS_ELNRNG -ZTS_EUNATCH = _libzt.ZTS_EUNATCH -ZTS_ENOCSI = _libzt.ZTS_ENOCSI -ZTS_EL2HLT = _libzt.ZTS_EL2HLT -ZTS_EBADE = _libzt.ZTS_EBADE -ZTS_EBADR = _libzt.ZTS_EBADR -ZTS_EXFULL = _libzt.ZTS_EXFULL -ZTS_ENOANO = _libzt.ZTS_ENOANO -ZTS_EBADRQC = _libzt.ZTS_EBADRQC -ZTS_EBADSLT = _libzt.ZTS_EBADSLT -ZTS_EDEADLOCK = _libzt.ZTS_EDEADLOCK -ZTS_EBFONT = _libzt.ZTS_EBFONT -ZTS_ENOSTR = _libzt.ZTS_ENOSTR -ZTS_ENODATA = _libzt.ZTS_ENODATA -ZTS_ETIME = _libzt.ZTS_ETIME -ZTS_ENOSR = _libzt.ZTS_ENOSR -ZTS_ENONET = _libzt.ZTS_ENONET -ZTS_ENOPKG = _libzt.ZTS_ENOPKG -ZTS_EREMOTE = _libzt.ZTS_EREMOTE -ZTS_ENOLINK = _libzt.ZTS_ENOLINK -ZTS_EADV = _libzt.ZTS_EADV -ZTS_ESRMNT = _libzt.ZTS_ESRMNT -ZTS_ECOMM = _libzt.ZTS_ECOMM -ZTS_EPROTO = _libzt.ZTS_EPROTO -ZTS_EMULTIHOP = _libzt.ZTS_EMULTIHOP -ZTS_EDOTDOT = _libzt.ZTS_EDOTDOT -ZTS_EBADMSG = _libzt.ZTS_EBADMSG -ZTS_EOVERFLOW = _libzt.ZTS_EOVERFLOW -ZTS_ENOTUNIQ = _libzt.ZTS_ENOTUNIQ -ZTS_EBADFD = _libzt.ZTS_EBADFD -ZTS_EREMCHG = _libzt.ZTS_EREMCHG -ZTS_ELIBACC = _libzt.ZTS_ELIBACC -ZTS_ELIBBAD = _libzt.ZTS_ELIBBAD -ZTS_ELIBSCN = _libzt.ZTS_ELIBSCN -ZTS_ELIBMAX = _libzt.ZTS_ELIBMAX -ZTS_ELIBEXEC = _libzt.ZTS_ELIBEXEC -ZTS_EILSEQ = _libzt.ZTS_EILSEQ -ZTS_ERESTART = _libzt.ZTS_ERESTART -ZTS_ESTRPIPE = _libzt.ZTS_ESTRPIPE -ZTS_EUSERS = _libzt.ZTS_EUSERS ZTS_ENOTSOCK = _libzt.ZTS_ENOTSOCK ZTS_EDESTADDRREQ = _libzt.ZTS_EDESTADDRREQ ZTS_EMSGSIZE = _libzt.ZTS_EMSGSIZE @@ -217,32 +141,26 @@ ZTS_EADDRINUSE = _libzt.ZTS_EADDRINUSE ZTS_EADDRNOTAVAIL = _libzt.ZTS_EADDRNOTAVAIL ZTS_ENETDOWN = _libzt.ZTS_ENETDOWN ZTS_ENETUNREACH = _libzt.ZTS_ENETUNREACH -ZTS_ENETRESET = _libzt.ZTS_ENETRESET ZTS_ECONNABORTED = _libzt.ZTS_ECONNABORTED ZTS_ECONNRESET = _libzt.ZTS_ECONNRESET ZTS_ENOBUFS = _libzt.ZTS_ENOBUFS ZTS_EISCONN = _libzt.ZTS_EISCONN ZTS_ENOTCONN = _libzt.ZTS_ENOTCONN -ZTS_ESHUTDOWN = _libzt.ZTS_ESHUTDOWN -ZTS_ETOOMANYREFS = _libzt.ZTS_ETOOMANYREFS ZTS_ETIMEDOUT = _libzt.ZTS_ETIMEDOUT -ZTS_ECONNREFUSED = _libzt.ZTS_ECONNREFUSED -ZTS_EHOSTDOWN = _libzt.ZTS_EHOSTDOWN ZTS_EHOSTUNREACH = _libzt.ZTS_EHOSTUNREACH ZTS_EALREADY = _libzt.ZTS_EALREADY ZTS_EINPROGRESS = _libzt.ZTS_EINPROGRESS -ZTS_ESTALE = _libzt.ZTS_ESTALE -ZTS_EUCLEAN = _libzt.ZTS_EUCLEAN -ZTS_ENOTNAM = _libzt.ZTS_ENOTNAM -ZTS_ENAVAIL = _libzt.ZTS_ENAVAIL -ZTS_EISNAM = _libzt.ZTS_EISNAM -ZTS_EREMOTEIO = _libzt.ZTS_EREMOTEIO -ZTS_EDQUOT = _libzt.ZTS_EDQUOT -ZTS_ENOMEDIUM = _libzt.ZTS_ENOMEDIUM -ZTS_EMEDIUMTYPE = _libzt.ZTS_EMEDIUMTYPE ZTS_MAC_ADDRSTRLEN = _libzt.ZTS_MAC_ADDRSTRLEN ZTS_INET_ADDRSTRLEN = _libzt.ZTS_INET_ADDRSTRLEN ZTS_INET6_ADDRSTRLEN = _libzt.ZTS_INET6_ADDRSTRLEN +ZTS_IP_MAX_STR_LEN = _libzt.ZTS_IP_MAX_STR_LEN +ZTS_STORE_DATA_LEN = _libzt.ZTS_STORE_DATA_LEN +ZTS_MAX_NETWORK_SHORT_NAME_LENGTH = _libzt.ZTS_MAX_NETWORK_SHORT_NAME_LENGTH +ZTS_MAX_NETWORK_ROUTES = _libzt.ZTS_MAX_NETWORK_ROUTES +ZTS_MAX_ASSIGNED_ADDRESSES = _libzt.ZTS_MAX_ASSIGNED_ADDRESSES +ZTS_MAX_PEER_NETWORK_PATHS = _libzt.ZTS_MAX_PEER_NETWORK_PATHS +ZTS_MAX_MULTICAST_SUBSCRIPTIONS = _libzt.ZTS_MAX_MULTICAST_SUBSCRIPTIONS +ZTS_MAX_ENDPOINT_STR_LEN = _libzt.ZTS_MAX_ENDPOINT_STR_LEN ZTS_SOCK_STREAM = _libzt.ZTS_SOCK_STREAM ZTS_SOCK_DGRAM = _libzt.ZTS_SOCK_DGRAM ZTS_SOCK_RAW = _libzt.ZTS_SOCK_RAW @@ -270,165 +188,39 @@ ZTS_IOC_VOID = _libzt.ZTS_IOC_VOID ZTS_IOC_OUT = _libzt.ZTS_IOC_OUT ZTS_IOC_IN = _libzt.ZTS_IOC_IN ZTS_IOC_INOUT = _libzt.ZTS_IOC_INOUT -ZTS_MAX_ASSIGNED_ADDRESSES = _libzt.ZTS_MAX_ASSIGNED_ADDRESSES -ZTS_MAX_NETWORK_ROUTES = _libzt.ZTS_MAX_NETWORK_ROUTES -ZTS_MAX_PEER_NETWORK_PATHS = _libzt.ZTS_MAX_PEER_NETWORK_PATHS -ZTS_PEER_ROLE_LEAF = _libzt.ZTS_PEER_ROLE_LEAF -ZTS_PEER_ROLE_MOON = _libzt.ZTS_PEER_ROLE_MOON -ZTS_PEER_ROLE_PLANET = _libzt.ZTS_PEER_ROLE_PLANET - - -class zts_node_details(object): - thisown = property( - lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag" - ) +class zts_node_info_t(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - address = property( - _libzt.zts_node_details_address_get, _libzt.zts_node_details_address_set - ) - primaryPort = property( - _libzt.zts_node_details_primaryPort_get, _libzt.zts_node_details_primaryPort_set - ) - secondaryPort = property( - _libzt.zts_node_details_secondaryPort_get, - _libzt.zts_node_details_secondaryPort_set, - ) - tertiaryPort = property( - _libzt.zts_node_details_tertiaryPort_get, - _libzt.zts_node_details_tertiaryPort_set, - ) - versionMajor = property( - _libzt.zts_node_details_versionMajor_get, - _libzt.zts_node_details_versionMajor_set, - ) - versionMinor = property( - _libzt.zts_node_details_versionMinor_get, - _libzt.zts_node_details_versionMinor_set, - ) - versionRev = property( - _libzt.zts_node_details_versionRev_get, _libzt.zts_node_details_versionRev_set - ) + node_id = property(_libzt.zts_node_info_t_node_id_get, _libzt.zts_node_info_t_node_id_set) + port_primary = property(_libzt.zts_node_info_t_port_primary_get, _libzt.zts_node_info_t_port_primary_set) + port_secondary = property(_libzt.zts_node_info_t_port_secondary_get, _libzt.zts_node_info_t_port_secondary_set) + port_tertiary = property(_libzt.zts_node_info_t_port_tertiary_get, _libzt.zts_node_info_t_port_tertiary_set) + ver_major = property(_libzt.zts_node_info_t_ver_major_get, _libzt.zts_node_info_t_ver_major_set) + ver_minor = property(_libzt.zts_node_info_t_ver_minor_get, _libzt.zts_node_info_t_ver_minor_set) + ver_rev = property(_libzt.zts_node_info_t_ver_rev_get, _libzt.zts_node_info_t_ver_rev_set) def __init__(self): - _libzt.zts_node_details_swiginit(self, _libzt.new_zts_node_details()) + _libzt.zts_node_info_t_swiginit(self, _libzt.new_zts_node_info_t()) + __swig_destroy__ = _libzt.delete_zts_node_info_t - __swig_destroy__ = _libzt.delete_zts_node_details - - -# Register zts_node_details in _libzt: -_libzt.zts_node_details_swigregister(zts_node_details) +# Register zts_node_info_t in _libzt: +_libzt.zts_node_info_t_swigregister(zts_node_info_t) cvar = _libzt.cvar - -class zts_callback_msg(object): - thisown = property( - lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag" - ) +class zts_addr_info_t(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - eventCode = property( - _libzt.zts_callback_msg_eventCode_get, _libzt.zts_callback_msg_eventCode_set - ) - node = property(_libzt.zts_callback_msg_node_get, _libzt.zts_callback_msg_node_set) - network = property( - _libzt.zts_callback_msg_network_get, _libzt.zts_callback_msg_network_set - ) - netif = property( - _libzt.zts_callback_msg_netif_get, _libzt.zts_callback_msg_netif_set - ) - route = property( - _libzt.zts_callback_msg_route_get, _libzt.zts_callback_msg_route_set - ) - peer = property(_libzt.zts_callback_msg_peer_get, _libzt.zts_callback_msg_peer_set) - addr = property(_libzt.zts_callback_msg_addr_get, _libzt.zts_callback_msg_addr_set) + net_id = property(_libzt.zts_addr_info_t_net_id_get, _libzt.zts_addr_info_t_net_id_set) + addr = property(_libzt.zts_addr_info_t_addr_get, _libzt.zts_addr_info_t_addr_set) def __init__(self): - _libzt.zts_callback_msg_swiginit(self, _libzt.new_zts_callback_msg()) + _libzt.zts_addr_info_t_swiginit(self, _libzt.new_zts_addr_info_t()) + __swig_destroy__ = _libzt.delete_zts_addr_info_t - __swig_destroy__ = _libzt.delete_zts_callback_msg +# Register zts_addr_info_t in _libzt: +_libzt.zts_addr_info_t_swigregister(zts_addr_info_t) - -# Register zts_callback_msg in _libzt: -_libzt.zts_callback_msg_swigregister(zts_callback_msg) - - -class zts_addr_details(object): - thisown = property( - lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag" - ) - __repr__ = _swig_repr - nwid = property(_libzt.zts_addr_details_nwid_get, _libzt.zts_addr_details_nwid_set) - addr = property(_libzt.zts_addr_details_addr_get, _libzt.zts_addr_details_addr_set) - - def __init__(self): - _libzt.zts_addr_details_swiginit(self, _libzt.new_zts_addr_details()) - - __swig_destroy__ = _libzt.delete_zts_addr_details - - -# Register zts_addr_details in _libzt: -_libzt.zts_addr_details_swigregister(zts_addr_details) - - -class zts_netif_details(object): - thisown = property( - lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag" - ) - __repr__ = _swig_repr - nwid = property( - _libzt.zts_netif_details_nwid_get, _libzt.zts_netif_details_nwid_set - ) - mac = property(_libzt.zts_netif_details_mac_get, _libzt.zts_netif_details_mac_set) - mtu = property(_libzt.zts_netif_details_mtu_get, _libzt.zts_netif_details_mtu_set) - - def __init__(self): - _libzt.zts_netif_details_swiginit(self, _libzt.new_zts_netif_details()) - - __swig_destroy__ = _libzt.delete_zts_netif_details - - -# Register zts_netif_details in _libzt: -_libzt.zts_netif_details_swigregister(zts_netif_details) - - -class zts_virtual_network_route(object): - thisown = property( - lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag" - ) - __repr__ = _swig_repr - target = property( - _libzt.zts_virtual_network_route_target_get, - _libzt.zts_virtual_network_route_target_set, - ) - via = property( - _libzt.zts_virtual_network_route_via_get, - _libzt.zts_virtual_network_route_via_set, - ) - flags = property( - _libzt.zts_virtual_network_route_flags_get, - _libzt.zts_virtual_network_route_flags_set, - ) - metric = property( - _libzt.zts_virtual_network_route_metric_get, - _libzt.zts_virtual_network_route_metric_set, - ) - - def __init__(self): - _libzt.zts_virtual_network_route_swiginit( - self, _libzt.new_zts_virtual_network_route() - ) - - __swig_destroy__ = _libzt.delete_zts_virtual_network_route - - -# Register zts_virtual_network_route in _libzt: -_libzt.zts_virtual_network_route_swigregister(zts_virtual_network_route) - -ZTS_MAX_NETWORK_SHORT_NAME_LENGTH = _libzt.ZTS_MAX_NETWORK_SHORT_NAME_LENGTH -ZTS_MAX_ZT_ASSIGNED_ADDRESSES = _libzt.ZTS_MAX_ZT_ASSIGNED_ADDRESSES -ZTS_MAX_MULTICAST_SUBSCRIPTIONS = _libzt.ZTS_MAX_MULTICAST_SUBSCRIPTIONS -ZTS_NETWORK_STATUS_REQUESTING_CONFIGURATION = ( - _libzt.ZTS_NETWORK_STATUS_REQUESTING_CONFIGURATION -) +ZTS_NETWORK_STATUS_REQUESTING_CONFIGURATION = _libzt.ZTS_NETWORK_STATUS_REQUESTING_CONFIGURATION ZTS_NETWORK_STATUS_OK = _libzt.ZTS_NETWORK_STATUS_OK ZTS_NETWORK_STATUS_ACCESS_DENIED = _libzt.ZTS_NETWORK_STATUS_ACCESS_DENIED ZTS_NETWORK_STATUS_NOT_FOUND = _libzt.ZTS_NETWORK_STATUS_NOT_FOUND @@ -436,217 +228,166 @@ ZTS_NETWORK_STATUS_PORT_ERROR = _libzt.ZTS_NETWORK_STATUS_PORT_ERROR ZTS_NETWORK_STATUS_CLIENT_TOO_OLD = _libzt.ZTS_NETWORK_STATUS_CLIENT_TOO_OLD ZTS_NETWORK_TYPE_PRIVATE = _libzt.ZTS_NETWORK_TYPE_PRIVATE ZTS_NETWORK_TYPE_PUBLIC = _libzt.ZTS_NETWORK_TYPE_PUBLIC - - -class ZTS_VirtualNetworkRoute(object): - thisown = property( - lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag" - ) +class zts_route_info_t(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - target = property( - _libzt.ZTS_VirtualNetworkRoute_target_get, - _libzt.ZTS_VirtualNetworkRoute_target_set, - ) - via = property( - _libzt.ZTS_VirtualNetworkRoute_via_get, _libzt.ZTS_VirtualNetworkRoute_via_set - ) - flags = property( - _libzt.ZTS_VirtualNetworkRoute_flags_get, - _libzt.ZTS_VirtualNetworkRoute_flags_set, - ) - metric = property( - _libzt.ZTS_VirtualNetworkRoute_metric_get, - _libzt.ZTS_VirtualNetworkRoute_metric_set, - ) + target = property(_libzt.zts_route_info_t_target_get, _libzt.zts_route_info_t_target_set) + via = property(_libzt.zts_route_info_t_via_get, _libzt.zts_route_info_t_via_set) + flags = property(_libzt.zts_route_info_t_flags_get, _libzt.zts_route_info_t_flags_set) + metric = property(_libzt.zts_route_info_t_metric_get, _libzt.zts_route_info_t_metric_set) def __init__(self): - _libzt.ZTS_VirtualNetworkRoute_swiginit( - self, _libzt.new_ZTS_VirtualNetworkRoute() - ) + _libzt.zts_route_info_t_swiginit(self, _libzt.new_zts_route_info_t()) + __swig_destroy__ = _libzt.delete_zts_route_info_t - __swig_destroy__ = _libzt.delete_ZTS_VirtualNetworkRoute +# Register zts_route_info_t in _libzt: +_libzt.zts_route_info_t_swigregister(zts_route_info_t) - -# Register ZTS_VirtualNetworkRoute in _libzt: -_libzt.ZTS_VirtualNetworkRoute_swigregister(ZTS_VirtualNetworkRoute) - - -class zts_network_details(object): - thisown = property( - lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag" - ) +class zts_multicast_group_t(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - nwid = property( - _libzt.zts_network_details_nwid_get, _libzt.zts_network_details_nwid_set - ) - mac = property( - _libzt.zts_network_details_mac_get, _libzt.zts_network_details_mac_set - ) - name = property( - _libzt.zts_network_details_name_get, _libzt.zts_network_details_name_set - ) - status = property( - _libzt.zts_network_details_status_get, _libzt.zts_network_details_status_set - ) - type = property( - _libzt.zts_network_details_type_get, _libzt.zts_network_details_type_set - ) - mtu = property( - _libzt.zts_network_details_mtu_get, _libzt.zts_network_details_mtu_set - ) - dhcp = property( - _libzt.zts_network_details_dhcp_get, _libzt.zts_network_details_dhcp_set - ) - bridge = property( - _libzt.zts_network_details_bridge_get, _libzt.zts_network_details_bridge_set - ) - broadcastEnabled = property( - _libzt.zts_network_details_broadcastEnabled_get, - _libzt.zts_network_details_broadcastEnabled_set, - ) - portError = property( - _libzt.zts_network_details_portError_get, - _libzt.zts_network_details_portError_set, - ) - netconfRevision = property( - _libzt.zts_network_details_netconfRevision_get, - _libzt.zts_network_details_netconfRevision_set, - ) - assignedAddressCount = property( - _libzt.zts_network_details_assignedAddressCount_get, - _libzt.zts_network_details_assignedAddressCount_set, - ) - assignedAddresses = property( - _libzt.zts_network_details_assignedAddresses_get, - _libzt.zts_network_details_assignedAddresses_set, - ) - routeCount = property( - _libzt.zts_network_details_routeCount_get, - _libzt.zts_network_details_routeCount_set, - ) - routes = property( - _libzt.zts_network_details_routes_get, _libzt.zts_network_details_routes_set - ) - multicastSubscriptionCount = property( - _libzt.zts_network_details_multicastSubscriptionCount_get, - _libzt.zts_network_details_multicastSubscriptionCount_set, - ) + mac = property(_libzt.zts_multicast_group_t_mac_get, _libzt.zts_multicast_group_t_mac_set) + adi = property(_libzt.zts_multicast_group_t_adi_get, _libzt.zts_multicast_group_t_adi_set) def __init__(self): - _libzt.zts_network_details_swiginit(self, _libzt.new_zts_network_details()) + _libzt.zts_multicast_group_t_swiginit(self, _libzt.new_zts_multicast_group_t()) + __swig_destroy__ = _libzt.delete_zts_multicast_group_t - __swig_destroy__ = _libzt.delete_zts_network_details +# Register zts_multicast_group_t in _libzt: +_libzt.zts_multicast_group_t_swigregister(zts_multicast_group_t) - -# Register zts_network_details in _libzt: -_libzt.zts_network_details_swigregister(zts_network_details) - - -class zts_physical_path(object): - thisown = property( - lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag" - ) +ZTS_PEER_ROLE_LEAF = _libzt.ZTS_PEER_ROLE_LEAF +ZTS_PEER_ROLE_MOON = _libzt.ZTS_PEER_ROLE_MOON +ZTS_PEER_ROLE_PLANET = _libzt.ZTS_PEER_ROLE_PLANET +class zts_net_info_t(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - address = property( - _libzt.zts_physical_path_address_get, _libzt.zts_physical_path_address_set - ) - lastSend = property( - _libzt.zts_physical_path_lastSend_get, _libzt.zts_physical_path_lastSend_set - ) - lastReceive = property( - _libzt.zts_physical_path_lastReceive_get, - _libzt.zts_physical_path_lastReceive_set, - ) - trustedPathId = property( - _libzt.zts_physical_path_trustedPathId_get, - _libzt.zts_physical_path_trustedPathId_set, - ) - expired = property( - _libzt.zts_physical_path_expired_get, _libzt.zts_physical_path_expired_set - ) - preferred = property( - _libzt.zts_physical_path_preferred_get, _libzt.zts_physical_path_preferred_set - ) + net_id = property(_libzt.zts_net_info_t_net_id_get, _libzt.zts_net_info_t_net_id_set) + mac = property(_libzt.zts_net_info_t_mac_get, _libzt.zts_net_info_t_mac_set) + name = property(_libzt.zts_net_info_t_name_get, _libzt.zts_net_info_t_name_set) + status = property(_libzt.zts_net_info_t_status_get, _libzt.zts_net_info_t_status_set) + type = property(_libzt.zts_net_info_t_type_get, _libzt.zts_net_info_t_type_set) + mtu = property(_libzt.zts_net_info_t_mtu_get, _libzt.zts_net_info_t_mtu_set) + dhcp = property(_libzt.zts_net_info_t_dhcp_get, _libzt.zts_net_info_t_dhcp_set) + bridge = property(_libzt.zts_net_info_t_bridge_get, _libzt.zts_net_info_t_bridge_set) + broadcast_enabled = property(_libzt.zts_net_info_t_broadcast_enabled_get, _libzt.zts_net_info_t_broadcast_enabled_set) + port_error = property(_libzt.zts_net_info_t_port_error_get, _libzt.zts_net_info_t_port_error_set) + netconf_rev = property(_libzt.zts_net_info_t_netconf_rev_get, _libzt.zts_net_info_t_netconf_rev_set) + assigned_addr_count = property(_libzt.zts_net_info_t_assigned_addr_count_get, _libzt.zts_net_info_t_assigned_addr_count_set) + assigned_addrs = property(_libzt.zts_net_info_t_assigned_addrs_get, _libzt.zts_net_info_t_assigned_addrs_set) + route_count = property(_libzt.zts_net_info_t_route_count_get, _libzt.zts_net_info_t_route_count_set) + routes = property(_libzt.zts_net_info_t_routes_get, _libzt.zts_net_info_t_routes_set) + multicast_sub_count = property(_libzt.zts_net_info_t_multicast_sub_count_get, _libzt.zts_net_info_t_multicast_sub_count_set) def __init__(self): - _libzt.zts_physical_path_swiginit(self, _libzt.new_zts_physical_path()) + _libzt.zts_net_info_t_swiginit(self, _libzt.new_zts_net_info_t()) + __swig_destroy__ = _libzt.delete_zts_net_info_t - __swig_destroy__ = _libzt.delete_zts_physical_path +# Register zts_net_info_t in _libzt: +_libzt.zts_net_info_t_swigregister(zts_net_info_t) - -# Register zts_physical_path in _libzt: -_libzt.zts_physical_path_swigregister(zts_physical_path) - - -class zts_peer_details(object): - thisown = property( - lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag" - ) +class zts_path_t(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - address = property( - _libzt.zts_peer_details_address_get, _libzt.zts_peer_details_address_set - ) - versionMajor = property( - _libzt.zts_peer_details_versionMajor_get, - _libzt.zts_peer_details_versionMajor_set, - ) - versionMinor = property( - _libzt.zts_peer_details_versionMinor_get, - _libzt.zts_peer_details_versionMinor_set, - ) - versionRev = property( - _libzt.zts_peer_details_versionRev_get, _libzt.zts_peer_details_versionRev_set - ) - latency = property( - _libzt.zts_peer_details_latency_get, _libzt.zts_peer_details_latency_set - ) - role = property(_libzt.zts_peer_details_role_get, _libzt.zts_peer_details_role_set) - pathCount = property( - _libzt.zts_peer_details_pathCount_get, _libzt.zts_peer_details_pathCount_set - ) - paths = property( - _libzt.zts_peer_details_paths_get, _libzt.zts_peer_details_paths_set - ) + address = property(_libzt.zts_path_t_address_get, _libzt.zts_path_t_address_set) + last_tx = property(_libzt.zts_path_t_last_tx_get, _libzt.zts_path_t_last_tx_set) + last_rx = property(_libzt.zts_path_t_last_rx_get, _libzt.zts_path_t_last_rx_set) + trusted_path_id = property(_libzt.zts_path_t_trusted_path_id_get, _libzt.zts_path_t_trusted_path_id_set) + latency = property(_libzt.zts_path_t_latency_get, _libzt.zts_path_t_latency_set) + unused_0 = property(_libzt.zts_path_t_unused_0_get, _libzt.zts_path_t_unused_0_set) + unused_1 = property(_libzt.zts_path_t_unused_1_get, _libzt.zts_path_t_unused_1_set) + unused_2 = property(_libzt.zts_path_t_unused_2_get, _libzt.zts_path_t_unused_2_set) + unused_3 = property(_libzt.zts_path_t_unused_3_get, _libzt.zts_path_t_unused_3_set) + unused_4 = property(_libzt.zts_path_t_unused_4_get, _libzt.zts_path_t_unused_4_set) + unused_5 = property(_libzt.zts_path_t_unused_5_get, _libzt.zts_path_t_unused_5_set) + unused_6 = property(_libzt.zts_path_t_unused_6_get, _libzt.zts_path_t_unused_6_set) + unused_7 = property(_libzt.zts_path_t_unused_7_get, _libzt.zts_path_t_unused_7_set) + ifname = property(_libzt.zts_path_t_ifname_get, _libzt.zts_path_t_ifname_set) + expired = property(_libzt.zts_path_t_expired_get, _libzt.zts_path_t_expired_set) + preferred = property(_libzt.zts_path_t_preferred_get, _libzt.zts_path_t_preferred_set) def __init__(self): - _libzt.zts_peer_details_swiginit(self, _libzt.new_zts_peer_details()) + _libzt.zts_path_t_swiginit(self, _libzt.new_zts_path_t()) + __swig_destroy__ = _libzt.delete_zts_path_t - __swig_destroy__ = _libzt.delete_zts_peer_details +# Register zts_path_t in _libzt: +_libzt.zts_path_t_swigregister(zts_path_t) - -# Register zts_peer_details in _libzt: -_libzt.zts_peer_details_swigregister(zts_peer_details) - - -class zts_peer_list(object): - thisown = property( - lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag" - ) +class zts_peer_info_t(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - peers = property(_libzt.zts_peer_list_peers_get, _libzt.zts_peer_list_peers_set) - peerCount = property( - _libzt.zts_peer_list_peerCount_get, _libzt.zts_peer_list_peerCount_set - ) + peer_id = property(_libzt.zts_peer_info_t_peer_id_get, _libzt.zts_peer_info_t_peer_id_set) + ver_major = property(_libzt.zts_peer_info_t_ver_major_get, _libzt.zts_peer_info_t_ver_major_set) + ver_minor = property(_libzt.zts_peer_info_t_ver_minor_get, _libzt.zts_peer_info_t_ver_minor_set) + ver_rev = property(_libzt.zts_peer_info_t_ver_rev_get, _libzt.zts_peer_info_t_ver_rev_set) + latency = property(_libzt.zts_peer_info_t_latency_get, _libzt.zts_peer_info_t_latency_set) + role = property(_libzt.zts_peer_info_t_role_get, _libzt.zts_peer_info_t_role_set) + path_count = property(_libzt.zts_peer_info_t_path_count_get, _libzt.zts_peer_info_t_path_count_set) + unused_0 = property(_libzt.zts_peer_info_t_unused_0_get, _libzt.zts_peer_info_t_unused_0_set) + paths = property(_libzt.zts_peer_info_t_paths_get, _libzt.zts_peer_info_t_paths_set) def __init__(self): - _libzt.zts_peer_list_swiginit(self, _libzt.new_zts_peer_list()) + _libzt.zts_peer_info_t_swiginit(self, _libzt.new_zts_peer_info_t()) + __swig_destroy__ = _libzt.delete_zts_peer_info_t - __swig_destroy__ = _libzt.delete_zts_peer_list +# Register zts_peer_info_t in _libzt: +_libzt.zts_peer_info_t_swigregister(zts_peer_info_t) +ZTS_MAX_NUM_ROOTS = _libzt.ZTS_MAX_NUM_ROOTS +ZTS_MAX_ENDPOINTS_PER_ROOT = _libzt.ZTS_MAX_ENDPOINTS_PER_ROOT +class zts_root_set_t(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + public_id_str = property(_libzt.zts_root_set_t_public_id_str_get, _libzt.zts_root_set_t_public_id_str_set) + endpoint_ip_str = property(_libzt.zts_root_set_t_endpoint_ip_str_get, _libzt.zts_root_set_t_endpoint_ip_str_set) -# Register zts_peer_list in _libzt: -_libzt.zts_peer_list_swigregister(zts_peer_list) + def __init__(self): + _libzt.zts_root_set_t_swiginit(self, _libzt.new_zts_root_set_t()) + __swig_destroy__ = _libzt.delete_zts_root_set_t +# Register zts_root_set_t in _libzt: +_libzt.zts_root_set_t_swigregister(zts_root_set_t) + +class zts_netif_info_t(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + net_id = property(_libzt.zts_netif_info_t_net_id_get, _libzt.zts_netif_info_t_net_id_set) + mac = property(_libzt.zts_netif_info_t_mac_get, _libzt.zts_netif_info_t_mac_set) + mtu = property(_libzt.zts_netif_info_t_mtu_get, _libzt.zts_netif_info_t_mtu_set) + + def __init__(self): + _libzt.zts_netif_info_t_swiginit(self, _libzt.new_zts_netif_info_t()) + __swig_destroy__ = _libzt.delete_zts_netif_info_t + +# Register zts_netif_info_t in _libzt: +_libzt.zts_netif_info_t_swigregister(zts_netif_info_t) + +class zts_event_msg_t(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + event_code = property(_libzt.zts_event_msg_t_event_code_get, _libzt.zts_event_msg_t_event_code_set) + node = property(_libzt.zts_event_msg_t_node_get, _libzt.zts_event_msg_t_node_set) + network = property(_libzt.zts_event_msg_t_network_get, _libzt.zts_event_msg_t_network_set) + netif = property(_libzt.zts_event_msg_t_netif_get, _libzt.zts_event_msg_t_netif_set) + route = property(_libzt.zts_event_msg_t_route_get, _libzt.zts_event_msg_t_route_set) + peer = property(_libzt.zts_event_msg_t_peer_get, _libzt.zts_event_msg_t_peer_set) + addr = property(_libzt.zts_event_msg_t_addr_get, _libzt.zts_event_msg_t_addr_set) + cache = property(_libzt.zts_event_msg_t_cache_get, _libzt.zts_event_msg_t_cache_set) + len = property(_libzt.zts_event_msg_t_len_get, _libzt.zts_event_msg_t_len_set) + + def __init__(self): + _libzt.zts_event_msg_t_swiginit(self, _libzt.new_zts_event_msg_t()) + __swig_destroy__ = _libzt.delete_zts_event_msg_t + +# Register zts_event_msg_t in _libzt: +_libzt.zts_event_msg_t_swigregister(zts_event_msg_t) class PythonDirectorCallbackClass(object): - thisown = property( - lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag" - ) + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def on_zerotier_event(self, msg): return _libzt.PythonDirectorCallbackClass_on_zerotier_event(self, msg) - __swig_destroy__ = _libzt.delete_PythonDirectorCallbackClass def __init__(self): @@ -654,19 +395,12 @@ class PythonDirectorCallbackClass(object): _self = None else: _self = self - _libzt.PythonDirectorCallbackClass_swiginit( - self, - _libzt.new_PythonDirectorCallbackClass( - _self, - ), - ) - + _libzt.PythonDirectorCallbackClass_swiginit(self, _libzt.new_PythonDirectorCallbackClass(_self, )) def __disown__(self): self.this.disown() _libzt.disown_PythonDirectorCallbackClass(self) return weakref.proxy(self) - # Register PythonDirectorCallbackClass in _libzt: _libzt.PythonDirectorCallbackClass_swigregister(PythonDirectorCallbackClass) @@ -674,139 +408,219 @@ _libzt.PythonDirectorCallbackClass_swigregister(PythonDirectorCallbackClass) def zts_py_bind(fd, family, type, addro): return _libzt.zts_py_bind(fd, family, type, addro) - def zts_py_connect(fd, family, type, addro): return _libzt.zts_py_connect(fd, family, type, addro) - def zts_py_accept(fd): return _libzt.zts_py_accept(fd) - def zts_py_listen(fd, backlog): return _libzt.zts_py_listen(fd, backlog) - def zts_py_recv(fd, len, flags): return _libzt.zts_py_recv(fd, len, flags) - def zts_py_send(fd, buf, flags): return _libzt.zts_py_send(fd, buf, flags) - def zts_py_close(fd): return _libzt.zts_py_close(fd) - def zts_py_setblocking(fd, flag): return _libzt.zts_py_setblocking(fd, flag) - def zts_py_getblocking(fd): return _libzt.zts_py_getblocking(fd) +ZTS_DISABLE_CENTRAL_API = _libzt.ZTS_DISABLE_CENTRAL_API +ZTS_ID_STR_BUF_LEN = _libzt.ZTS_ID_STR_BUF_LEN + +def zts_id_new(key, key_buf_len): + return _libzt.zts_id_new(key, key_buf_len) + +def zts_id_pair_is_valid(key, len): + return _libzt.zts_id_pair_is_valid(key, len) + +def zts_init_from_storage(path): + return _libzt.zts_init_from_storage(path) + +def zts_init_from_memory(key, len): + return _libzt.zts_init_from_memory(key, len) + +def zts_init_set_event_handler(callback): + return _libzt.zts_init_set_event_handler(callback) + +def zts_init_blacklist_if(prefix, len): + return _libzt.zts_init_blacklist_if(prefix, len) + +def zts_init_set_roots(roots_data, len): + return _libzt.zts_init_set_roots(roots_data, len) + +def zts_init_set_port(port): + return _libzt.zts_init_set_port(port) + +def zts_init_allow_net_cache(allowed): + return _libzt.zts_init_allow_net_cache(allowed) + +def zts_init_allow_peer_cache(allowed): + return _libzt.zts_init_allow_peer_cache(allowed) + +def zts_init_allow_roots_cache(allowed): + return _libzt.zts_init_allow_roots_cache(allowed) + +def zts_init_allow_id_cache(allowed): + return _libzt.zts_init_allow_id_cache(allowed) + +def zts_addr_is_assigned(net_id, family): + return _libzt.zts_addr_is_assigned(net_id, family) + +def zts_addr_get(net_id, family, addr): + return _libzt.zts_addr_get(net_id, family, addr) + +def zts_addr_get_str(net_id, family, dst, len): + return _libzt.zts_addr_get_str(net_id, family, dst, len) + +def zts_addr_get_all(net_id, addr, count): + return _libzt.zts_addr_get_all(net_id, addr, count) + +def zts_addr_compute_6plane(net_id, node_id, addr): + return _libzt.zts_addr_compute_6plane(net_id, node_id, addr) + +def zts_addr_compute_rfc4193(net_id, node_id, addr): + return _libzt.zts_addr_compute_rfc4193(net_id, node_id, addr) + +def zts_addr_compute_rfc4193_str(net_id, node_id, dst, len): + return _libzt.zts_addr_compute_rfc4193_str(net_id, node_id, dst, len) + +def zts_addr_compute_6plane_str(net_id, node_id, dst, len): + return _libzt.zts_addr_compute_6plane_str(net_id, node_id, dst, len) + +def zts_net_compute_adhoc_id(start_port, end_port): + return _libzt.zts_net_compute_adhoc_id(start_port, end_port) + +def zts_net_join(net_id): + return _libzt.zts_net_join(net_id) + +def zts_net_leave(net_id): + return _libzt.zts_net_leave(net_id) + +def zts_net_transport_is_ready(net_id): + return _libzt.zts_net_transport_is_ready(net_id) + +def zts_net_get_mac(net_id): + return _libzt.zts_net_get_mac(net_id) + +def zts_net_get_mac_str(net_id, dst, len): + return _libzt.zts_net_get_mac_str(net_id, dst, len) + +def zts_net_get_broadcast(net_id): + return _libzt.zts_net_get_broadcast(net_id) + +def zts_net_get_mtu(net_id): + return _libzt.zts_net_get_mtu(net_id) + +def zts_net_get_name(net_id, dst, len): + return _libzt.zts_net_get_name(net_id, dst, len) + +def zts_net_get_status(net_id): + return _libzt.zts_net_get_status(net_id) + +def zts_net_get_type(net_id): + return _libzt.zts_net_get_type(net_id) + +def zts_route_is_assigned(net_id, family): + return _libzt.zts_route_is_assigned(net_id, family) + +def zts_node_start(): + return _libzt.zts_node_start() + +def zts_node_is_online(): + return _libzt.zts_node_is_online() + +def zts_node_get_id(): + return _libzt.zts_node_get_id() + +def zts_node_get_id_pair(key, key_dst_len): + return _libzt.zts_node_get_id_pair(key, key_dst_len) + +def zts_node_get_port(): + return _libzt.zts_node_get_port() + +def zts_node_stop(): + return _libzt.zts_node_stop() + +def zts_node_free(): + return _libzt.zts_node_free() + +def zts_moon_orbit(moon_roots_id, moon_seed): + return _libzt.zts_moon_orbit(moon_roots_id, moon_seed) + +def zts_moon_deorbit(moon_roots_id): + return _libzt.zts_moon_deorbit(moon_roots_id) +class zts_stats_counter_t(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + link_tx = property(_libzt.zts_stats_counter_t_link_tx_get, _libzt.zts_stats_counter_t_link_tx_set) + link_rx = property(_libzt.zts_stats_counter_t_link_rx_get, _libzt.zts_stats_counter_t_link_rx_set) + link_drop = property(_libzt.zts_stats_counter_t_link_drop_get, _libzt.zts_stats_counter_t_link_drop_set) + link_err = property(_libzt.zts_stats_counter_t_link_err_get, _libzt.zts_stats_counter_t_link_err_set) + etharp_tx = property(_libzt.zts_stats_counter_t_etharp_tx_get, _libzt.zts_stats_counter_t_etharp_tx_set) + etharp_rx = property(_libzt.zts_stats_counter_t_etharp_rx_get, _libzt.zts_stats_counter_t_etharp_rx_set) + etharp_drop = property(_libzt.zts_stats_counter_t_etharp_drop_get, _libzt.zts_stats_counter_t_etharp_drop_set) + etharp_err = property(_libzt.zts_stats_counter_t_etharp_err_get, _libzt.zts_stats_counter_t_etharp_err_set) + ip4_tx = property(_libzt.zts_stats_counter_t_ip4_tx_get, _libzt.zts_stats_counter_t_ip4_tx_set) + ip4_rx = property(_libzt.zts_stats_counter_t_ip4_rx_get, _libzt.zts_stats_counter_t_ip4_rx_set) + ip4_drop = property(_libzt.zts_stats_counter_t_ip4_drop_get, _libzt.zts_stats_counter_t_ip4_drop_set) + ip4_err = property(_libzt.zts_stats_counter_t_ip4_err_get, _libzt.zts_stats_counter_t_ip4_err_set) + ip6_tx = property(_libzt.zts_stats_counter_t_ip6_tx_get, _libzt.zts_stats_counter_t_ip6_tx_set) + ip6_rx = property(_libzt.zts_stats_counter_t_ip6_rx_get, _libzt.zts_stats_counter_t_ip6_rx_set) + ip6_drop = property(_libzt.zts_stats_counter_t_ip6_drop_get, _libzt.zts_stats_counter_t_ip6_drop_set) + ip6_err = property(_libzt.zts_stats_counter_t_ip6_err_get, _libzt.zts_stats_counter_t_ip6_err_set) + icmp4_tx = property(_libzt.zts_stats_counter_t_icmp4_tx_get, _libzt.zts_stats_counter_t_icmp4_tx_set) + icmp4_rx = property(_libzt.zts_stats_counter_t_icmp4_rx_get, _libzt.zts_stats_counter_t_icmp4_rx_set) + icmp4_drop = property(_libzt.zts_stats_counter_t_icmp4_drop_get, _libzt.zts_stats_counter_t_icmp4_drop_set) + icmp4_err = property(_libzt.zts_stats_counter_t_icmp4_err_get, _libzt.zts_stats_counter_t_icmp4_err_set) + icmp6_tx = property(_libzt.zts_stats_counter_t_icmp6_tx_get, _libzt.zts_stats_counter_t_icmp6_tx_set) + icmp6_rx = property(_libzt.zts_stats_counter_t_icmp6_rx_get, _libzt.zts_stats_counter_t_icmp6_rx_set) + icmp6_drop = property(_libzt.zts_stats_counter_t_icmp6_drop_get, _libzt.zts_stats_counter_t_icmp6_drop_set) + icmp6_err = property(_libzt.zts_stats_counter_t_icmp6_err_get, _libzt.zts_stats_counter_t_icmp6_err_set) + udp_tx = property(_libzt.zts_stats_counter_t_udp_tx_get, _libzt.zts_stats_counter_t_udp_tx_set) + udp_rx = property(_libzt.zts_stats_counter_t_udp_rx_get, _libzt.zts_stats_counter_t_udp_rx_set) + udp_drop = property(_libzt.zts_stats_counter_t_udp_drop_get, _libzt.zts_stats_counter_t_udp_drop_set) + udp_err = property(_libzt.zts_stats_counter_t_udp_err_get, _libzt.zts_stats_counter_t_udp_err_set) + tcp_tx = property(_libzt.zts_stats_counter_t_tcp_tx_get, _libzt.zts_stats_counter_t_tcp_tx_set) + tcp_rx = property(_libzt.zts_stats_counter_t_tcp_rx_get, _libzt.zts_stats_counter_t_tcp_rx_set) + tcp_drop = property(_libzt.zts_stats_counter_t_tcp_drop_get, _libzt.zts_stats_counter_t_tcp_drop_set) + tcp_err = property(_libzt.zts_stats_counter_t_tcp_err_get, _libzt.zts_stats_counter_t_tcp_err_set) + nd6_tx = property(_libzt.zts_stats_counter_t_nd6_tx_get, _libzt.zts_stats_counter_t_nd6_tx_set) + nd6_rx = property(_libzt.zts_stats_counter_t_nd6_rx_get, _libzt.zts_stats_counter_t_nd6_rx_set) + nd6_drop = property(_libzt.zts_stats_counter_t_nd6_drop_get, _libzt.zts_stats_counter_t_nd6_drop_set) + nd6_err = property(_libzt.zts_stats_counter_t_nd6_err_get, _libzt.zts_stats_counter_t_nd6_err_set) + + def __init__(self): + _libzt.zts_stats_counter_t_swiginit(self, _libzt.new_zts_stats_counter_t()) + __swig_destroy__ = _libzt.delete_zts_stats_counter_t + +# Register zts_stats_counter_t in _libzt: +_libzt.zts_stats_counter_t_swigregister(zts_stats_counter_t) -def zts_generate_orphan_identity(key_pair_str, key_buf_len): - return _libzt.zts_generate_orphan_identity(key_pair_str, key_buf_len) +def zts_stats_get_all(dst): + return _libzt.zts_stats_get_all(dst) +def zts_bsd_socket(family, type, protocol): + return _libzt.zts_bsd_socket(family, type, protocol) -def zts_verify_identity(key_pair_str): - return _libzt.zts_verify_identity(key_pair_str) +def zts_bsd_connect(fd, addr, addrlen): + return _libzt.zts_bsd_connect(fd, addr, addrlen) +def zts_bsd_bind(fd, addr, addrlen): + return _libzt.zts_bsd_bind(fd, addr, addrlen) -def zts_get_node_identity(key_pair_str, key_buf_len): - return _libzt.zts_get_node_identity(key_pair_str, key_buf_len) - - -def zts_start_with_identity(key_pair_str, key_buf_len, callback, port): - return _libzt.zts_start_with_identity(key_pair_str, key_buf_len, callback, port) - - -def zts_allow_network_caching(allowed): - return _libzt.zts_allow_network_caching(allowed) - - -def zts_allow_peer_caching(allowed): - return _libzt.zts_allow_peer_caching(allowed) - - -def zts_allow_local_conf(allowed): - return _libzt.zts_allow_local_conf(allowed) - - -def zts_disable_local_storage(disabled): - return _libzt.zts_disable_local_storage(disabled) - - -def zts_start(path, callback, port): - return _libzt.zts_start(path, callback, port) - - -def zts_stop(): - return _libzt.zts_stop() - - -def zts_restart(): - return _libzt.zts_restart() - - -def zts_free(): - return _libzt.zts_free() - - -def zts_join(networkId): - return _libzt.zts_join(networkId) - - -def zts_leave(networkId): - return _libzt.zts_leave(networkId) - - -def zts_orbit(moonWorldId, moonSeed): - return _libzt.zts_orbit(moonWorldId, moonSeed) - - -def zts_deorbit(moonWorldId): - return _libzt.zts_deorbit(moonWorldId) - - -def zts_get_6plane_addr(addr, networkId, nodeId): - return _libzt.zts_get_6plane_addr(addr, networkId, nodeId) - - -def zts_get_rfc4193_addr(addr, networkId, nodeId): - return _libzt.zts_get_rfc4193_addr(addr, networkId, nodeId) - - -def zts_generate_adhoc_nwid_from_range(startPortOfRange, endPortOfRange): - return _libzt.zts_generate_adhoc_nwid_from_range(startPortOfRange, endPortOfRange) - - -def zts_delay_ms(interval_ms): - return _libzt.zts_delay_ms(interval_ms) - - -def zts_socket(socket_family, socket_type, protocol): - return _libzt.zts_socket(socket_family, socket_type, protocol) - - -def zts_connect(fd, addr, addrlen): - return _libzt.zts_connect(fd, addr, addrlen) - - -def zts_bind(fd, addr, addrlen): - return _libzt.zts_bind(fd, addr, addrlen) - - -def zts_listen(fd, backlog): - return _libzt.zts_listen(fd, backlog) - - -def zts_accept(fd, addr, addrlen): - return _libzt.zts_accept(fd, addr, addrlen) - +def zts_bsd_listen(fd, backlog): + return _libzt.zts_bsd_listen(fd, backlog) +def zts_bsd_accept(fd, addr, addrlen): + return _libzt.zts_bsd_accept(fd, addr, addrlen) ZTS_SOL_SOCKET = _libzt.ZTS_SOL_SOCKET ZTS_SO_DEBUG = _libzt.ZTS_SO_DEBUG ZTS_SO_ACCEPTCONN = _libzt.ZTS_SO_ACCEPTCONN @@ -866,54 +680,39 @@ ZTS_IPTOS_PREC_IMMEDIATE = _libzt.ZTS_IPTOS_PREC_IMMEDIATE ZTS_IPTOS_PREC_PRIORITY = _libzt.ZTS_IPTOS_PREC_PRIORITY ZTS_IPTOS_PREC_ROUTINE = _libzt.ZTS_IPTOS_PREC_ROUTINE +def zts_bsd_setsockopt(fd, level, optname, optval, optlen): + return _libzt.zts_bsd_setsockopt(fd, level, optname, optval, optlen) -def zts_setsockopt(fd, level, optname, optval, optlen): - return _libzt.zts_setsockopt(fd, level, optname, optval, optlen) +def zts_bsd_getsockopt(fd, level, optname, optval, optlen): + return _libzt.zts_bsd_getsockopt(fd, level, optname, optval, optlen) +def zts_bsd_getsockname(fd, addr, addrlen): + return _libzt.zts_bsd_getsockname(fd, addr, addrlen) -def zts_getsockopt(fd, level, optname, optval, optlen): - return _libzt.zts_getsockopt(fd, level, optname, optval, optlen) - - -def zts_getsockname(fd, addr, addrlen): - return _libzt.zts_getsockname(fd, addr, addrlen) - - -def zts_getpeername(fd, addr, addrlen): - return _libzt.zts_getpeername(fd, addr, addrlen) - - -def zts_close(fd): - return _libzt.zts_close(fd) - +def zts_bsd_getpeername(fd, addr, addrlen): + return _libzt.zts_bsd_getpeername(fd, addr, addrlen) +def zts_bsd_close(fd): + return _libzt.zts_bsd_close(fd) LWIP_SOCKET_OFFSET = _libzt.LWIP_SOCKET_OFFSET MEMP_NUM_NETCONN = _libzt.MEMP_NUM_NETCONN ZTS_FD_SETSIZE = _libzt.ZTS_FD_SETSIZE - - class zts_timeval(object): - thisown = property( - lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag" - ) + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr tv_sec = property(_libzt.zts_timeval_tv_sec_get, _libzt.zts_timeval_tv_sec_set) tv_usec = property(_libzt.zts_timeval_tv_usec_get, _libzt.zts_timeval_tv_usec_set) def __init__(self): _libzt.zts_timeval_swiginit(self, _libzt.new_zts_timeval()) - __swig_destroy__ = _libzt.delete_zts_timeval - # Register zts_timeval in _libzt: _libzt.zts_timeval_swigregister(zts_timeval) -def zts_select(nfds, readfds, writefds, exceptfds, timeout): - return _libzt.zts_select(nfds, readfds, writefds, exceptfds, timeout) - - +def zts_bsd_select(nfds, readfds, writefds, exceptfds, timeout): + return _libzt.zts_bsd_select(nfds, readfds, writefds, exceptfds, timeout) ZTS_F_GETFL = _libzt.ZTS_F_GETFL ZTS_F_SETFL = _libzt.ZTS_F_SETFL ZTS_O_NONBLOCK = _libzt.ZTS_O_NONBLOCK @@ -922,11 +721,8 @@ ZTS_O_RDONLY = _libzt.ZTS_O_RDONLY ZTS_O_WRONLY = _libzt.ZTS_O_WRONLY ZTS_O_RDWR = _libzt.ZTS_O_RDWR - -def zts_fcntl(fd, cmd, flags): - return _libzt.zts_fcntl(fd, cmd, flags) - - +def zts_bsd_fcntl(fd, cmd, flags): + return _libzt.zts_bsd_fcntl(fd, cmd, flags) ZTS_POLLIN = _libzt.ZTS_POLLIN ZTS_POLLOUT = _libzt.ZTS_POLLOUT ZTS_POLLERR = _libzt.ZTS_POLLERR @@ -938,170 +734,207 @@ ZTS_POLLWRNORM = _libzt.ZTS_POLLWRNORM ZTS_POLLWRBAND = _libzt.ZTS_POLLWRBAND ZTS_POLLHUP = _libzt.ZTS_POLLHUP +def zts_bsd_poll(fds, nfds, timeout): + return _libzt.zts_bsd_poll(fds, nfds, timeout) -def zts_poll(fds, nfds, timeout): - return _libzt.zts_poll(fds, nfds, timeout) - - -def zts_ioctl(fd, request, argp): - return _libzt.zts_ioctl(fd, request, argp) - - -def zts_send(fd, buf, len, flags): - return _libzt.zts_send(fd, buf, len, flags) - - -def zts_sendto(fd, buf, len, flags, addr, addrlen): - return _libzt.zts_sendto(fd, buf, len, flags, addr, addrlen) +def zts_bsd_ioctl(fd, request, argp): + return _libzt.zts_bsd_ioctl(fd, request, argp) +def zts_bsd_send(fd, buf, len, flags): + return _libzt.zts_bsd_send(fd, buf, len, flags) +def zts_bsd_sendto(fd, buf, len, flags, addr, addrlen): + return _libzt.zts_bsd_sendto(fd, buf, len, flags, addr, addrlen) class zts_iovec(object): - thisown = property( - lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag" - ) + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr iov_base = property(_libzt.zts_iovec_iov_base_get, _libzt.zts_iovec_iov_base_set) iov_len = property(_libzt.zts_iovec_iov_len_get, _libzt.zts_iovec_iov_len_set) def __init__(self): _libzt.zts_iovec_swiginit(self, _libzt.new_zts_iovec()) - __swig_destroy__ = _libzt.delete_zts_iovec - # Register zts_iovec in _libzt: _libzt.zts_iovec_swigregister(zts_iovec) ZTS_MSG_TRUNC = _libzt.ZTS_MSG_TRUNC ZTS_MSG_CTRUNC = _libzt.ZTS_MSG_CTRUNC +def zts_bsd_sendmsg(fd, msg, flags): + return _libzt.zts_bsd_sendmsg(fd, msg, flags) -def zts_sendmsg(fd, msg, flags): - return _libzt.zts_sendmsg(fd, msg, flags) +def zts_bsd_recv(fd, buf, len, flags): + return _libzt.zts_bsd_recv(fd, buf, len, flags) +def zts_bsd_recvfrom(fd, buf, len, flags, addr, addrlen): + return _libzt.zts_bsd_recvfrom(fd, buf, len, flags, addr, addrlen) -def zts_recv(fd, buf, len, flags): - return _libzt.zts_recv(fd, buf, len, flags) +def zts_bsd_recvmsg(fd, msg, flags): + return _libzt.zts_bsd_recvmsg(fd, msg, flags) +def zts_bsd_read(fd, buf, len): + return _libzt.zts_bsd_read(fd, buf, len) -def zts_recvfrom(fd, buf, len, flags, addr, addrlen): - return _libzt.zts_recvfrom(fd, buf, len, flags, addr, addrlen) - - -def zts_recvmsg(fd, msg, flags): - return _libzt.zts_recvmsg(fd, msg, flags) - - -def zts_read(fd, buf, len): - return _libzt.zts_read(fd, buf, len) - - -def zts_readv(fd, iov, iovcnt): - return _libzt.zts_readv(fd, iov, iovcnt) - - -def zts_write(fd, buf, len): - return _libzt.zts_write(fd, buf, len) - - -def zts_writev(fd, iov, iovcnt): - return _libzt.zts_writev(fd, iov, iovcnt) +def zts_bsd_readv(fd, iov, iovcnt): + return _libzt.zts_bsd_readv(fd, iov, iovcnt) +def zts_bsd_write(fd, buf, len): + return _libzt.zts_bsd_write(fd, buf, len) +def zts_bsd_writev(fd, iov, iovcnt): + return _libzt.zts_bsd_writev(fd, iov, iovcnt) ZTS_SHUT_RD = _libzt.ZTS_SHUT_RD ZTS_SHUT_WR = _libzt.ZTS_SHUT_WR ZTS_SHUT_RDWR = _libzt.ZTS_SHUT_RDWR +def zts_bsd_shutdown(fd, how): + return _libzt.zts_bsd_shutdown(fd, how) -def zts_shutdown(fd, how): - return _libzt.zts_shutdown(fd, how) +def zts_connect(fd, ipstr, port, timeout_ms): + return _libzt.zts_connect(fd, ipstr, port, timeout_ms) +def zts_bind(fd, ipstr, port): + return _libzt.zts_bind(fd, ipstr, port) +def zts_accept(fd, remote_addr, len, port): + return _libzt.zts_accept(fd, remote_addr, len, port) + +def zts_getpeername(fd, remote_addr_str, len, port): + return _libzt.zts_getpeername(fd, remote_addr_str, len, port) + +def zts_getsockname(fd, local_addr_str, len, port): + return _libzt.zts_getsockname(fd, local_addr_str, len, port) + +def zts_tcp_client(remote_ipstr, remote_port): + return _libzt.zts_tcp_client(remote_ipstr, remote_port) + +def zts_tcp_server(local_ipstr, local_port, remote_ipstr, len, remote_port): + return _libzt.zts_tcp_server(local_ipstr, local_port, remote_ipstr, len, remote_port) + +def zts_udp_server(local_ipstr, local_port): + return _libzt.zts_udp_server(local_ipstr, local_port) + +def zts_udp_client(remote_ipstr): + return _libzt.zts_udp_client(remote_ipstr) + +def zts_set_no_delay(fd, enabled): + return _libzt.zts_set_no_delay(fd, enabled) + +def zts_get_no_delay(fd): + return _libzt.zts_get_no_delay(fd) + +def zts_set_linger(fd, enabled, value): + return _libzt.zts_set_linger(fd, enabled, value) + +def zts_get_linger_enabled(fd): + return _libzt.zts_get_linger_enabled(fd) + +def zts_get_linger_value(fd): + return _libzt.zts_get_linger_value(fd) + +def zts_get_pending_data_size(fd): + return _libzt.zts_get_pending_data_size(fd) + +def zts_set_reuse_addr(fd, enabled): + return _libzt.zts_set_reuse_addr(fd, enabled) + +def zts_get_reuse_addr(fd): + return _libzt.zts_get_reuse_addr(fd) + +def zts_set_recv_timeout(fd, seconds, microseconds): + return _libzt.zts_set_recv_timeout(fd, seconds, microseconds) + +def zts_get_recv_timeout(fd): + return _libzt.zts_get_recv_timeout(fd) + +def zts_set_send_timeout(fd, seconds, microseconds): + return _libzt.zts_set_send_timeout(fd, seconds, microseconds) + +def zts_get_send_timeout(fd): + return _libzt.zts_get_send_timeout(fd) + +def zts_set_send_buf_size(fd, size): + return _libzt.zts_set_send_buf_size(fd, size) + +def zts_get_send_buf_size(fd): + return _libzt.zts_get_send_buf_size(fd) + +def zts_set_recv_buf_size(fd, size): + return _libzt.zts_set_recv_buf_size(fd, size) + +def zts_get_recv_buf_size(fd): + return _libzt.zts_get_recv_buf_size(fd) + +def zts_set_ttl(fd, ttl): + return _libzt.zts_set_ttl(fd, ttl) + +def zts_get_ttl(fd): + return _libzt.zts_get_ttl(fd) + +def zts_set_blocking(fd, enabled): + return _libzt.zts_set_blocking(fd, enabled) + +def zts_get_blocking(fd): + return _libzt.zts_get_blocking(fd) + +def zts_set_keepalive(fd, enabled): + return _libzt.zts_set_keepalive(fd, enabled) + +def zts_get_keepalive(fd): + return _libzt.zts_get_keepalive(fd) class zts_hostent(object): - thisown = property( - lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag" - ) + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr h_name = property(_libzt.zts_hostent_h_name_get, _libzt.zts_hostent_h_name_set) - h_aliases = property( - _libzt.zts_hostent_h_aliases_get, _libzt.zts_hostent_h_aliases_set - ) - h_addrtype = property( - _libzt.zts_hostent_h_addrtype_get, _libzt.zts_hostent_h_addrtype_set - ) - h_length = property( - _libzt.zts_hostent_h_length_get, _libzt.zts_hostent_h_length_set - ) - h_addr_list = property( - _libzt.zts_hostent_h_addr_list_get, _libzt.zts_hostent_h_addr_list_set - ) + h_aliases = property(_libzt.zts_hostent_h_aliases_get, _libzt.zts_hostent_h_aliases_set) + h_addrtype = property(_libzt.zts_hostent_h_addrtype_get, _libzt.zts_hostent_h_addrtype_set) + h_length = property(_libzt.zts_hostent_h_length_get, _libzt.zts_hostent_h_length_set) + h_addr_list = property(_libzt.zts_hostent_h_addr_list_get, _libzt.zts_hostent_h_addr_list_set) def __init__(self): _libzt.zts_hostent_swiginit(self, _libzt.new_zts_hostent()) - __swig_destroy__ = _libzt.delete_zts_hostent - # Register zts_hostent in _libzt: _libzt.zts_hostent_swigregister(zts_hostent) -def zts_gethostbyname(name): - return _libzt.zts_gethostbyname(name) - - -ZTS_IPADDR_TYPE_V4 = _libzt.ZTS_IPADDR_TYPE_V4 -ZTS_IPADDR_TYPE_V6 = _libzt.ZTS_IPADDR_TYPE_V6 -ZTS_IPADDR_TYPE_ANY = _libzt.ZTS_IPADDR_TYPE_ANY - - +def zts_bsd_gethostbyname(name): + return _libzt.zts_bsd_gethostbyname(name) class zts_ip4_addr(object): - thisown = property( - lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag" - ) + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr addr = property(_libzt.zts_ip4_addr_addr_get, _libzt.zts_ip4_addr_addr_set) def __init__(self): _libzt.zts_ip4_addr_swiginit(self, _libzt.new_zts_ip4_addr()) - __swig_destroy__ = _libzt.delete_zts_ip4_addr - # Register zts_ip4_addr in _libzt: _libzt.zts_ip4_addr_swigregister(zts_ip4_addr) - class zts_ip6_addr(object): - thisown = property( - lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag" - ) + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr addr = property(_libzt.zts_ip6_addr_addr_get, _libzt.zts_ip6_addr_addr_set) def __init__(self): _libzt.zts_ip6_addr_swiginit(self, _libzt.new_zts_ip6_addr()) - __swig_destroy__ = _libzt.delete_zts_ip6_addr - # Register zts_ip6_addr in _libzt: _libzt.zts_ip6_addr_swigregister(zts_ip6_addr) - class zts_ip_addr(object): - thisown = property( - lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag" - ) + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr type = property(_libzt.zts_ip_addr_type_get, _libzt.zts_ip_addr_type_set) def __init__(self): _libzt.zts_ip_addr_swiginit(self, _libzt.new_zts_ip_addr()) - __swig_destroy__ = _libzt.delete_zts_ip_addr - # Register zts_ip_addr in _libzt: _libzt.zts_ip_addr_swigregister(zts_ip_addr) @@ -1109,22 +942,64 @@ _libzt.zts_ip_addr_swigregister(zts_ip_addr) def zts_dns_set_server(index, addr): return _libzt.zts_dns_set_server(index, addr) - def zts_dns_get_server(index): return _libzt.zts_dns_get_server(index) +def zts_core_lock_obtain(): + return _libzt.zts_core_lock_obtain() + +def zts_core_lock_release(): + return _libzt.zts_core_lock_release() + +def zts_core_query_addr_count(net_id): + return _libzt.zts_core_query_addr_count(net_id) + +def zts_core_query_addr(net_id, idx, addr, len): + return _libzt.zts_core_query_addr(net_id, idx, addr, len) + +def zts_core_query_route_count(net_id): + return _libzt.zts_core_query_route_count(net_id) + +def zts_core_query_route(net_id, idx, target, via, len, flags, metric): + return _libzt.zts_core_query_route(net_id, idx, target, via, len, flags, metric) + +def zts_core_query_path_count(peer_id): + return _libzt.zts_core_query_path_count(peer_id) + +def zts_core_query_path(peer_id, idx, dst, len): + return _libzt.zts_core_query_path(peer_id, idx, dst, len) + +def zts_core_query_mc_count(net_id): + return _libzt.zts_core_query_mc_count(net_id) + +def zts_core_query_mc(net_id, idx, mac, adi): + return _libzt.zts_core_query_mc(net_id, idx, mac, adi) + +def zts_util_sign_root_set(roots_out, roots_len, prev_key, prev_key_len, curr_key, curr_key_len, id, ts, roots_spec): + return _libzt.zts_util_sign_root_set(roots_out, roots_len, prev_key, prev_key_len, curr_key, curr_key_len, id, ts, roots_spec) + +def zts_util_delay(milliseconds): + return _libzt.zts_util_delay(milliseconds) + +def zts_util_get_ip_family(ipstr): + return _libzt.zts_util_get_ip_family(ipstr) + +def zts_util_ipstr_to_saddr(src_ipstr, port, dstaddr, addrlen): + return _libzt.zts_util_ipstr_to_saddr(src_ipstr, port, dstaddr, addrlen) + +def zts_util_ntop(addr, addrlen, dst_str, len, port): + return _libzt.zts_util_ntop(addr, addrlen, dst_str, len, port) def zts_ipaddr_ntoa(addr): return _libzt.zts_ipaddr_ntoa(addr) - def zts_ipaddr_aton(cp, addr): return _libzt.zts_ipaddr_aton(cp, addr) +def zts_inet_ntop(family, src, dst, size): + return _libzt.zts_inet_ntop(family, src, dst, size) -def zts_inet_ntop(af, src, dst, size): - return _libzt.zts_inet_ntop(af, src, dst, size) +def zts_inet_pton(family, src, dst): + return _libzt.zts_inet_pton(family, src, dst) -def zts_inet_pton(af, src, dst): - return _libzt.zts_inet_pton(af, src, dst) diff --git a/src/bindings/python/sockets.py b/src/bindings/python/sockets.py index 5d01947..dd655c8 100755 --- a/src/bindings/python/sockets.py +++ b/src/bindings/python/sockets.py @@ -46,7 +46,7 @@ class socket: # Only create native socket if no fd was provided. We may have # accepted a connection if sock_fd is None: - self._fd = libzt.zts_socket(sock_family, sock_type, sock_proto) + self._fd = libzt.zts_bsd_socket(sock_family, sock_type, sock_proto) def has_dualstack_ipv6(self): """Return whether libzt supports dual stack sockets: yes""" @@ -427,4 +427,4 @@ class socket: - ZTS_SHUT_WR - Shut down writing side of socket. - ZTS_SHUT_RDWR - Both ends of the socket. """ - libzt.zts_shutdown(self._fd, how) + libzt.zts_bsd_shutdown(self._fd, how) diff --git a/src/bindings/python/zt_wrap.cxx b/src/bindings/python/zt_wrap.cxx new file mode 100644 index 0000000..b1e3882 --- /dev/null +++ b/src/bindings/python/zt_wrap.cxx @@ -0,0 +1,23351 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 4.0.2 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + +#define SWIG_PYTHON_CAST_MODE + +#ifndef SWIGPYTHON +#define SWIGPYTHON +#endif + +#define SWIG_DIRECTORS +#define SWIG_PYTHON_DIRECTOR_NO_VTABLE + +#ifdef __cplusplus +/* SwigValueWrapper is described in swig.swg */ +template class SwigValueWrapper { + struct SwigMovePointer { + T* ptr; + SwigMovePointer(T* p) : ptr(p) + { + } + ~SwigMovePointer() + { + delete ptr; + } + SwigMovePointer& operator=(SwigMovePointer& rhs) + { + T* oldptr = ptr; + ptr = 0; + delete oldptr; + ptr = rhs.ptr; + rhs.ptr = 0; + return *this; + } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper(const SwigValueWrapper& rhs); + + public: + SwigValueWrapper() : pointer(0) + { + } + SwigValueWrapper& operator=(const T& t) + { + SwigMovePointer tmp(new T(t)); + pointer = tmp; + return *this; + } + operator T&() const + { + return *pointer.ptr; + } + T* operator&() + { + return pointer.ptr; + } +}; + +template T SwigValueInit() +{ + return T(); +} +#endif + +/* ----------------------------------------------------------------------------- + * This section contains generic SWIG labels for method/variable + * declarations/attributes, and other compiler dependent labels. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +#if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +#define SWIGTEMPLATEDISAMBIGUATOR template +#elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +#define SWIGTEMPLATEDISAMBIGUATOR template +#else +#define SWIGTEMPLATEDISAMBIGUATOR +#endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +#if defined(__cplusplus) || (defined(__GNUC__) && ! defined(__STRICT_ANSI__)) +#define SWIGINLINE inline +#else +#define SWIGINLINE +#endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +#if defined(__GNUC__) +#if ! (defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +#define SWIGUNUSED __attribute__((__unused__)) +#else +#define SWIGUNUSED +#endif +#elif defined(__ICC) +#define SWIGUNUSED __attribute__((__unused__)) +#else +#define SWIGUNUSED +#endif +#endif + +#ifndef SWIG_MSC_UNSUPPRESS_4505 +#if defined(_MSC_VER) +#pragma warning(disable : 4505) /* unreferenced local function has been removed */ +#endif +#endif + +#ifndef SWIGUNUSEDPARM +#ifdef __cplusplus +#define SWIGUNUSEDPARM(p) +#else +#define SWIGUNUSEDPARM(p) p SWIGUNUSED +#endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +#define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +#define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* exporting methods */ +#if defined(__GNUC__) +#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +#ifndef GCC_HASCLASSVISIBILITY +#define GCC_HASCLASSVISIBILITY +#endif +#endif +#endif + +#ifndef SWIGEXPORT +#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +#if defined(STATIC_LINKED) +#define SWIGEXPORT +#else +#define SWIGEXPORT __declspec(dllexport) +#endif +#else +#if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +#define SWIGEXPORT __attribute__((visibility("default"))) +#else +#define SWIGEXPORT +#endif +#endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +#define SWIGSTDCALL __stdcall +#else +#define SWIGSTDCALL +#endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if ! defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && ! defined(_CRT_SECURE_NO_DEPRECATE) +#define _CRT_SECURE_NO_DEPRECATE +#endif + +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if ! defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && ! defined(_SCL_SECURE_NO_DEPRECATE) +#define _SCL_SECURE_NO_DEPRECATE +#endif + +/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ +#if defined(__APPLE__) && ! defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) +#define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 +#endif + +/* Intel's compiler complains if a variable which was never initialised is + * cast to void, which is a common idiom which we use to indicate that we + * are aware a variable isn't used. So we just silence that warning. + * See: https://github.com/swig/swig/issues/192 for more discussion. + */ +#ifdef __INTEL_COMPILER +#pragma warning disable 592 +#endif + +#if defined(__GNUC__) && defined(_WIN32) && ! defined(SWIG_PYTHON_NO_HYPOT_WORKAROUND) +/* Workaround for '::hypot' has not been declared', see https://bugs.python.org/issue11566 */ +#include +#endif + +#if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) +/* Use debug wrappers with the Python release dll */ +#undef _DEBUG +#include +#define _DEBUG 1 +#else +#include +#endif + +/* ----------------------------------------------------------------------------- + * swigrun.swg + * + * This file contains generic C API SWIG runtime support for pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +/* This should only be incremented when either the layout of swig_type_info changes, + or for whatever reason, the runtime changes incompatibly */ +#define SWIG_RUNTIME_VERSION "4" + +/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ +#ifdef SWIG_TYPE_TABLE +#define SWIG_QUOTE_STRING(x) #x +#define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) +#define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) +#else +#define SWIG_TYPE_TABLE_NAME +#endif + +/* + You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for + creating a static or dynamic library from the SWIG runtime code. + In 99.9% of the cases, SWIG just needs to declare them as 'static'. + + But only do this if strictly necessary, ie, if you have problems + with your compiler or suchlike. +*/ + +#ifndef SWIGRUNTIME +#define SWIGRUNTIME SWIGINTERN +#endif + +#ifndef SWIGRUNTIMEINLINE +#define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE +#endif + +/* Generic buffer size */ +#ifndef SWIG_BUFFER_SIZE +#define SWIG_BUFFER_SIZE 1024 +#endif + +/* Flags for pointer conversions */ +#define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 +#define SWIG_POINTER_NO_NULL 0x4 + +/* Flags for new pointer objects */ +#define SWIG_POINTER_OWN 0x1 + +/* + Flags/methods for returning states. + + The SWIG conversion methods, as ConvertPtr, return an integer + that tells if the conversion was successful or not. And if not, + an error code can be returned (see swigerrors.swg for the codes). + + Use the following macros/flags to set or process the returning + states. + + In old versions of SWIG, code such as the following was usually written: + + if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { + // success code + } else { + //fail code + } + + Now you can be more explicit: + + int res = SWIG_ConvertPtr(obj,vptr,ty.flags); + if (SWIG_IsOK(res)) { + // success code + } else { + // fail code + } + + which is the same really, but now you can also do + + Type *ptr; + int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); + if (SWIG_IsOK(res)) { + // success code + if (SWIG_IsNewObj(res) { + ... + delete *ptr; + } else { + ... + } + } else { + // fail code + } + + I.e., now SWIG_ConvertPtr can return new objects and you can + identify the case and take care of the deallocation. Of course that + also requires SWIG_ConvertPtr to return new result values, such as + + int SWIG_ConvertPtr(obj, ptr,...) { + if () { + if () { + *ptr = ; + return SWIG_NEWOBJ; + } else { + *ptr = ; + return SWIG_OLDOBJ; + } + } else { + return SWIG_BADOBJ; + } + } + + Of course, returning the plain '0(success)/-1(fail)' still works, but you can be + more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the + SWIG errors code. + + Finally, if the SWIG_CASTRANK_MODE is enabled, the result code + allows to return the 'cast rank', for example, if you have this + + int food(double) + int fooi(int); + + and you call + + food(1) // cast rank '1' (1 -> 1.0) + fooi(1) // cast rank '0' + + just use the SWIG_AddCast()/SWIG_CheckState() +*/ + +#define SWIG_OK (0) +#define SWIG_ERROR (-1) +#define SWIG_IsOK(r) (r >= 0) +#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) + +/* The CastRankLimit says how many bits are used for the cast rank */ +#define SWIG_CASTRANKLIMIT (1 << 8) +/* The NewMask denotes the object was created (using new/malloc) */ +#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) +/* The TmpMask is for in/out typemaps that use temporal objects */ +#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) +/* Simple returning values */ +#define SWIG_BADOBJ (SWIG_ERROR) +#define SWIG_OLDOBJ (SWIG_OK) +#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) +#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) +/* Check, add and del mask methods */ +#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) +#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) +#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) +#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) +#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) +#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) + +/* Cast-Rank Mode */ +#if defined(SWIG_CASTRANK_MODE) +#ifndef SWIG_TypeRank +#define SWIG_TypeRank unsigned long +#endif +#ifndef SWIG_MAXCASTRANK /* Default cast allowed */ +#define SWIG_MAXCASTRANK (2) +#endif +#define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT)-1) +#define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) +SWIGINTERNINLINE int SWIG_AddCast(int r) +{ + return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; +} +SWIGINTERNINLINE int SWIG_CheckState(int r) +{ + return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; +} +#else /* no cast-rank mode */ +#define SWIG_AddCast(r) (r) +#define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) +#endif + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void* (*swig_converter_func)(void*, int*); +typedef struct swig_type_info* (*swig_dycast_func)(void**); + +/* Structure to store information on one type */ +typedef struct swig_type_info { + const char* name; /* mangled name of this type */ + const char* str; /* human readable name of this type */ + swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ + struct swig_cast_info* cast; /* linked list of types that can cast into this type */ + void* clientdata; /* language specific type data */ + int owndata; /* flag if the structure owns the clientdata */ +} swig_type_info; + +/* Structure to store a type and conversion function used for casting */ +typedef struct swig_cast_info { + swig_type_info* type; /* pointer to type that is equivalent to this type */ + swig_converter_func converter; /* function to cast the void pointers */ + struct swig_cast_info* next; /* pointer to next cast in linked list */ + struct swig_cast_info* prev; /* pointer to the previous cast */ +} swig_cast_info; + +/* Structure used to store module information + * Each module generates one structure like this, and the runtime collects + * all of these structures and stores them in a circularly linked list.*/ +typedef struct swig_module_info { + swig_type_info** types; /* Array of pointers to swig_type_info structures that are in this module */ + size_t size; /* Number of types in this module */ + struct swig_module_info* next; /* Pointer to next element in circularly linked list */ + swig_type_info** type_initial; /* Array of initially generated type structures */ + swig_cast_info** cast_initial; /* Array of initially generated casting structures */ + void* clientdata; /* Language specific module data */ +} swig_module_info; + +/* + Compare two type names skipping the space characters, therefore + "char*" == "char *" and "Class" == "Class", etc. + + Return 0 when the two name types are equivalent, as in + strncmp, but skipping ' '. +*/ +SWIGRUNTIME int SWIG_TypeNameComp(const char* f1, const char* l1, const char* f2, const char* l2) +{ + for (; (f1 != l1) && (f2 != l2); ++f1, ++f2) { + while ((*f1 == ' ') && (f1 != l1)) + ++f1; + while ((*f2 == ' ') && (f2 != l2)) + ++f2; + if (*f1 != *f2) + return (*f1 > *f2) ? 1 : -1; + } + return (int)((l1 - f1) - (l2 - f2)); +} + +/* + Check type equivalence in a name list like ||... + Return 0 if equal, -1 if nb < tb, 1 if nb > tb +*/ +SWIGRUNTIME int SWIG_TypeCmp(const char* nb, const char* tb) +{ + int equiv = 1; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (equiv != 0 && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') + break; + } + equiv = SWIG_TypeNameComp(nb, ne, tb, te); + if (*ne) + ++ne; + } + return equiv; +} + +/* + Check type equivalence in a name list like ||... + Return 0 if not equal, 1 if equal +*/ +SWIGRUNTIME int SWIG_TypeEquiv(const char* nb, const char* tb) +{ + return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0; +} + +/* + Check the typename +*/ +SWIGRUNTIME swig_cast_info* SWIG_TypeCheck(const char* c, swig_type_info* ty) +{ + if (ty) { + swig_cast_info* iter = ty->cast; + while (iter) { + if (strcmp(iter->type->name, c) == 0) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) + ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; +} + +/* + Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison +*/ +SWIGRUNTIME swig_cast_info* SWIG_TypeCheckStruct(swig_type_info* from, swig_type_info* ty) +{ + if (ty) { + swig_cast_info* iter = ty->cast; + while (iter) { + if (iter->type == from) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) + ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; +} + +/* + Cast a pointer up an inheritance hierarchy +*/ +SWIGRUNTIMEINLINE void* SWIG_TypeCast(swig_cast_info* ty, void* ptr, int* newmemory) +{ + return ((! ty) || (! ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); +} + +/* + Dynamic pointer casting. Down an inheritance hierarchy +*/ +SWIGRUNTIME swig_type_info* SWIG_TypeDynamicCast(swig_type_info* ty, void** ptr) +{ + swig_type_info* lastty = ty; + if (! ty || ! ty->dcast) + return ty; + while (ty && (ty->dcast)) { + ty = (*ty->dcast)(ptr); + if (ty) + lastty = ty; + } + return lastty; +} + +/* + Return the name associated with this type +*/ +SWIGRUNTIMEINLINE const char* SWIG_TypeName(const swig_type_info* ty) +{ + return ty->name; +} + +/* + Return the pretty name associated with this type, + that is an unmangled type name in a form presentable to the user. +*/ +SWIGRUNTIME const char* SWIG_TypePrettyName(const swig_type_info* type) +{ + /* The "str" field contains the equivalent pretty names of the + type, separated by vertical-bar characters. We choose + to print the last name, as it is often (?) the most + specific. */ + if (! type) + return NULL; + if (type->str != NULL) { + const char* last_name = type->str; + const char* s; + for (s = type->str; *s; s++) + if (*s == '|') + last_name = s + 1; + return last_name; + } + else + return type->name; +} + +/* + Set the clientdata field for a type +*/ +SWIGRUNTIME void SWIG_TypeClientData(swig_type_info* ti, void* clientdata) +{ + swig_cast_info* cast = ti->cast; + /* if (ti->clientdata == clientdata) return; */ + ti->clientdata = clientdata; + + while (cast) { + if (! cast->converter) { + swig_type_info* tc = cast->type; + if (! tc->clientdata) { + SWIG_TypeClientData(tc, clientdata); + } + } + cast = cast->next; + } +} +SWIGRUNTIME void SWIG_TypeNewClientData(swig_type_info* ti, void* clientdata) +{ + SWIG_TypeClientData(ti, clientdata); + ti->owndata = 1; +} + +/* + Search for a swig_type_info structure only by mangled name + Search is a O(log #types) + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info* +SWIG_MangledTypeQueryModule(swig_module_info* start, swig_module_info* end, const char* name) +{ + swig_module_info* iter = start; + do { + if (iter->size) { + size_t l = 0; + size_t r = iter->size - 1; + do { + /* since l+r >= 0, we can (>> 1) instead (/ 2) */ + size_t i = (l + r) >> 1; + const char* iname = iter->types[i]->name; + if (iname) { + int compare = strcmp(name, iname); + if (compare == 0) { + return iter->types[i]; + } + else if (compare < 0) { + if (i) { + r = i - 1; + } + else { + break; + } + } + else if (compare > 0) { + l = i + 1; + } + } + else { + break; /* should never happen */ + } + } while (l <= r); + } + iter = iter->next; + } while (iter != end); + return 0; +} + +/* + Search for a swig_type_info structure for either a mangled name or a human readable name. + It first searches the mangled names of the types, which is a O(log #types) + If a type is not found it then searches the human readable names, which is O(#types). + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info* SWIG_TypeQueryModule(swig_module_info* start, swig_module_info* end, const char* name) +{ + /* STEP 1: Search the name field using binary search */ + swig_type_info* ret = SWIG_MangledTypeQueryModule(start, end, name); + if (ret) { + return ret; + } + else { + /* STEP 2: If the type hasn't been found, do a complete search + of the str field (the human readable name) */ + swig_module_info* iter = start; + do { + size_t i = 0; + for (; i < iter->size; ++i) { + if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) + return iter->types[i]; + } + iter = iter->next; + } while (iter != end); + } + + /* neither found a match */ + return 0; +} + +/* + Pack binary data into a string +*/ +SWIGRUNTIME char* SWIG_PackData(char* c, void* ptr, size_t sz) +{ + static const char hex[17] = "0123456789abcdef"; + const unsigned char* u = (unsigned char*)ptr; + const unsigned char* eu = u + sz; + for (; u != eu; ++u) { + unsigned char uu = *u; + *(c++) = hex[(uu & 0xf0) >> 4]; + *(c++) = hex[uu & 0xf]; + } + return c; +} + +/* + Unpack binary data from a string +*/ +SWIGRUNTIME const char* SWIG_UnpackData(const char* c, void* ptr, size_t sz) +{ + unsigned char* u = (unsigned char*)ptr; + const unsigned char* eu = u + sz; + for (; u != eu; ++u) { + char d = *(c++); + unsigned char uu; + if ((d >= '0') && (d <= '9')) + uu = (unsigned char)((d - '0') << 4); + else if ((d >= 'a') && (d <= 'f')) + uu = (unsigned char)((d - ('a' - 10)) << 4); + else + return (char*)0; + d = *(c++); + if ((d >= '0') && (d <= '9')) + uu |= (unsigned char)(d - '0'); + else if ((d >= 'a') && (d <= 'f')) + uu |= (unsigned char)(d - ('a' - 10)); + else + return (char*)0; + *u = uu; + } + return c; +} + +/* + Pack 'void *' into a string buffer. +*/ +SWIGRUNTIME char* SWIG_PackVoidPtr(char* buff, void* ptr, const char* name, size_t bsz) +{ + char* r = buff; + if ((2 * sizeof(void*) + 2) > bsz) + return 0; + *(r++) = '_'; + r = SWIG_PackData(r, &ptr, sizeof(void*)); + if (strlen(name) + 1 > (bsz - (r - buff))) + return 0; + strcpy(r, name); + return buff; +} + +SWIGRUNTIME const char* SWIG_UnpackVoidPtr(const char* c, void** ptr, const char* name) +{ + if (*c != '_') { + if (strcmp(c, "NULL") == 0) { + *ptr = (void*)0; + return name; + } + else { + return 0; + } + } + return SWIG_UnpackData(++c, ptr, sizeof(void*)); +} + +SWIGRUNTIME char* SWIG_PackDataName(char* buff, void* ptr, size_t sz, const char* name, size_t bsz) +{ + char* r = buff; + size_t lname = (name ? strlen(name) : 0); + if ((2 * sz + 2 + lname) > bsz) + return 0; + *(r++) = '_'; + r = SWIG_PackData(r, ptr, sz); + if (lname) { + strncpy(r, name, lname + 1); + } + else { + *r = 0; + } + return buff; +} + +SWIGRUNTIME const char* SWIG_UnpackDataName(const char* c, void* ptr, size_t sz, const char* name) +{ + if (*c != '_') { + if (strcmp(c, "NULL") == 0) { + memset(ptr, 0, sz); + return name; + } + else { + return 0; + } + } + return SWIG_UnpackData(++c, ptr, sz); +} + +#ifdef __cplusplus +} +#endif + +/* Errors in SWIG */ +#define SWIG_UnknownError -1 +#define SWIG_IOError -2 +#define SWIG_RuntimeError -3 +#define SWIG_IndexError -4 +#define SWIG_TypeError -5 +#define SWIG_DivisionByZero -6 +#define SWIG_OverflowError -7 +#define SWIG_SyntaxError -8 +#define SWIG_ValueError -9 +#define SWIG_SystemError -10 +#define SWIG_AttributeError -11 +#define SWIG_MemoryError -12 +#define SWIG_NullReferenceError -13 + +/* Compatibility macros for Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + +#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject*)&PyType_Type) +#define PyInt_Check(x) PyLong_Check(x) +#define PyInt_AsLong(x) PyLong_AsLong(x) +#define PyInt_FromLong(x) PyLong_FromLong(x) +#define PyInt_FromSize_t(x) PyLong_FromSize_t(x) +#define PyString_Check(name) PyBytes_Check(name) +#define PyString_FromString(x) PyUnicode_FromString(x) +#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) +#define PyString_AsString(str) PyBytes_AsString(str) +#define PyString_Size(str) PyBytes_Size(str) +#define PyString_InternFromString(key) PyUnicode_InternFromString(key) +#define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE +#define PyString_AS_STRING(x) PyUnicode_AS_STRING(x) +#define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x) + +#endif + +#ifndef Py_TYPE +#define Py_TYPE(op) ((op)->ob_type) +#endif + +/* SWIG APIs for compatibility of both Python 2 & 3 */ + +#if PY_VERSION_HEX >= 0x03000000 +#define SWIG_Python_str_FromFormat PyUnicode_FromFormat +#else +#define SWIG_Python_str_FromFormat PyString_FromFormat +#endif + +/* Warning: This function will allocate a new string in Python 3, + * so please call SWIG_Python_str_DelForPy3(x) to free the space. + */ +SWIGINTERN char* SWIG_Python_str_AsChar(PyObject* str) +{ +#if PY_VERSION_HEX >= 0x03030000 + return (char*)PyUnicode_AsUTF8(str); +#elif PY_VERSION_HEX >= 0x03000000 + char* newstr = 0; + str = PyUnicode_AsUTF8String(str); + if (str) { + char* cstr; + Py_ssize_t len; + if (PyBytes_AsStringAndSize(str, &cstr, &len) != -1) { + newstr = (char*)malloc(len + 1); + if (newstr) + memcpy(newstr, cstr, len + 1); + } + Py_XDECREF(str); + } + return newstr; +#else + return PyString_AsString(str); +#endif +} + +#if PY_VERSION_HEX >= 0x03030000 || PY_VERSION_HEX < 0x03000000 +#define SWIG_Python_str_DelForPy3(x) +#else +#define SWIG_Python_str_DelForPy3(x) free((void*)(x)) +#endif + +SWIGINTERN PyObject* SWIG_Python_str_FromChar(const char* c) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_FromString(c); +#else + return PyString_FromString(c); +#endif +} + +#ifndef PyObject_DEL +#define PyObject_DEL PyObject_Del +#endif + +// SWIGPY_USE_CAPSULE is no longer used within SWIG itself, but some user +// interface files check for it. +#define SWIGPY_USE_CAPSULE +#define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME) + +#if PY_VERSION_HEX < 0x03020000 +#define PyDescr_TYPE(x) (((PyDescrObject*)(x))->d_type) +#define PyDescr_NAME(x) (((PyDescrObject*)(x))->d_name) +#define Py_hash_t long +#endif + +/* ----------------------------------------------------------------------------- + * error manipulation + * ----------------------------------------------------------------------------- */ + +SWIGRUNTIME PyObject* SWIG_Python_ErrorType(int code) +{ + PyObject* type = 0; + switch (code) { + case SWIG_MemoryError: + type = PyExc_MemoryError; + break; + case SWIG_IOError: + type = PyExc_IOError; + break; + case SWIG_RuntimeError: + type = PyExc_RuntimeError; + break; + case SWIG_IndexError: + type = PyExc_IndexError; + break; + case SWIG_TypeError: + type = PyExc_TypeError; + break; + case SWIG_DivisionByZero: + type = PyExc_ZeroDivisionError; + break; + case SWIG_OverflowError: + type = PyExc_OverflowError; + break; + case SWIG_SyntaxError: + type = PyExc_SyntaxError; + break; + case SWIG_ValueError: + type = PyExc_ValueError; + break; + case SWIG_SystemError: + type = PyExc_SystemError; + break; + case SWIG_AttributeError: + type = PyExc_AttributeError; + break; + default: + type = PyExc_RuntimeError; + } + return type; +} + +SWIGRUNTIME void SWIG_Python_AddErrorMsg(const char* mesg) +{ + PyObject* type = 0; + PyObject* value = 0; + PyObject* traceback = 0; + + if (PyErr_Occurred()) + PyErr_Fetch(&type, &value, &traceback); + if (value) { + PyObject* old_str = PyObject_Str(value); + const char* tmp = SWIG_Python_str_AsChar(old_str); + PyErr_Clear(); + Py_XINCREF(type); + if (tmp) + PyErr_Format(type, "%s %s", tmp, mesg); + else + PyErr_Format(type, "%s", mesg); + SWIG_Python_str_DelForPy3(tmp); + Py_DECREF(old_str); + Py_DECREF(value); + } + else { + PyErr_SetString(PyExc_RuntimeError, mesg); + } +} + +SWIGRUNTIME int SWIG_Python_TypeErrorOccurred(PyObject* obj) +{ + PyObject* error; + if (obj) + return 0; + error = PyErr_Occurred(); + return error && PyErr_GivenExceptionMatches(error, PyExc_TypeError); +} + +SWIGRUNTIME void SWIG_Python_RaiseOrModifyTypeError(const char* message) +{ + if (SWIG_Python_TypeErrorOccurred(NULL)) { + /* Use existing TypeError to preserve stacktrace and enhance with given message */ + PyObject* newvalue; + PyObject *type = NULL, *value = NULL, *traceback = NULL; + PyErr_Fetch(&type, &value, &traceback); +#if PY_VERSION_HEX >= 0x03000000 + newvalue = PyUnicode_FromFormat("%S\nAdditional information:\n%s", value, message); +#else + newvalue = PyString_FromFormat("%s\nAdditional information:\n%s", PyString_AsString(value), message); +#endif + Py_XDECREF(value); + PyErr_Restore(type, newvalue, traceback); + } + else { + /* Raise TypeError using given message */ + PyErr_SetString(PyExc_TypeError, message); + } +} + +#if defined(SWIG_PYTHON_NO_THREADS) +#if defined(SWIG_PYTHON_THREADS) +#undef SWIG_PYTHON_THREADS +#endif +#endif +#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */ +#if ! defined(SWIG_PYTHON_USE_GIL) && ! defined(SWIG_PYTHON_NO_USE_GIL) +#define SWIG_PYTHON_USE_GIL +#endif +#if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */ +#ifndef SWIG_PYTHON_INITIALIZE_THREADS +#define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() +#endif +#ifdef __cplusplus /* C++ code */ +class SWIG_Python_Thread_Block { + bool status; + PyGILState_STATE state; + + public: + void end() + { + if (status) { + PyGILState_Release(state); + status = false; + } + } + SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) + { + } + ~SWIG_Python_Thread_Block() + { + end(); + } +}; +class SWIG_Python_Thread_Allow { + bool status; + PyThreadState* save; + + public: + void end() + { + if (status) { + PyEval_RestoreThread(save); + status = false; + } + } + SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) + { + } + ~SWIG_Python_Thread_Allow() + { + end(); + } +}; +#define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block +#define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end() +#define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow +#define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end() +#else /* C code */ +#define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure() +#define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block) +#define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState* _swig_thread_allow = PyEval_SaveThread() +#define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow) +#endif +#else /* Old thread way, not implemented, user must provide it */ +#if ! defined(SWIG_PYTHON_INITIALIZE_THREADS) +#define SWIG_PYTHON_INITIALIZE_THREADS +#endif +#if ! defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK) +#define SWIG_PYTHON_THREAD_BEGIN_BLOCK +#endif +#if ! defined(SWIG_PYTHON_THREAD_END_BLOCK) +#define SWIG_PYTHON_THREAD_END_BLOCK +#endif +#if ! defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW) +#define SWIG_PYTHON_THREAD_BEGIN_ALLOW +#endif +#if ! defined(SWIG_PYTHON_THREAD_END_ALLOW) +#define SWIG_PYTHON_THREAD_END_ALLOW +#endif +#endif +#else /* No thread support */ +#define SWIG_PYTHON_INITIALIZE_THREADS +#define SWIG_PYTHON_THREAD_BEGIN_BLOCK +#define SWIG_PYTHON_THREAD_END_BLOCK +#define SWIG_PYTHON_THREAD_BEGIN_ALLOW +#define SWIG_PYTHON_THREAD_END_ALLOW +#endif + +/* ----------------------------------------------------------------------------- + * Python API portion that goes into the runtime + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* ----------------------------------------------------------------------------- + * Constant declarations + * ----------------------------------------------------------------------------- */ + +/* Constant Types */ +#define SWIG_PY_POINTER 4 +#define SWIG_PY_BINARY 5 + +/* Constant information structure */ +typedef struct swig_const_info { + int type; + const char* name; + long lvalue; + double dvalue; + void* pvalue; + swig_type_info** ptype; +} swig_const_info; + +#ifdef __cplusplus +} +#endif + +/* ----------------------------------------------------------------------------- + * pyrun.swg + * + * This file contains the runtime support for Python modules + * and includes code for managing global variables and pointer + * type checking. + * + * ----------------------------------------------------------------------------- */ + +#if PY_VERSION_HEX < 0x02070000 /* 2.7.0 */ +#error "This version of SWIG only supports Python >= 2.7" +#endif + +#if PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03020000 +#error "This version of SWIG only supports Python 3 >= 3.2" +#endif + +/* Common SWIG API */ + +/* for raw pointers */ +#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0) +#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags) +#define SWIG_ConvertPtrAndOwn(obj, pptr, type, flags, own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own) + +#ifdef SWIGPYTHON_BUILTIN +#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags) +#else +#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) +#endif + +#define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) + +#define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty) +#define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src) +#define swig_owntype int + +/* for raw packed data */ +#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) +#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) + +/* for class or struct pointers */ +#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) +#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) + +/* for C or C++ function pointers */ +#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type) +#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0) + +/* for C++ member pointers, ie, member methods */ +#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) +#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) + +/* Runtime API */ + +#define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata) +#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) +#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) + +#define SWIG_SetErrorObj SWIG_Python_SetErrorObj +#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg +#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code) +#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) +#define SWIG_fail goto fail + +/* Runtime API implementation */ + +/* Error manipulation */ + +SWIGINTERN void SWIG_Python_SetErrorObj(PyObject* errtype, PyObject* obj) +{ + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + PyErr_SetObject(errtype, obj); + Py_DECREF(obj); + SWIG_PYTHON_THREAD_END_BLOCK; +} + +SWIGINTERN void SWIG_Python_SetErrorMsg(PyObject* errtype, const char* msg) +{ + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + PyErr_SetString(errtype, msg); + SWIG_PYTHON_THREAD_END_BLOCK; +} + +#define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj) + +/* Set a constant value */ + +#if defined(SWIGPYTHON_BUILTIN) + +SWIGINTERN void SwigPyBuiltin_AddPublicSymbol(PyObject* seq, const char* key) +{ + PyObject* s = PyString_InternFromString(key); + PyList_Append(seq, s); + Py_DECREF(s); +} + +SWIGINTERN void SWIG_Python_SetConstant(PyObject* d, PyObject* public_interface, const char* name, PyObject* obj) +{ + PyDict_SetItemString(d, name, obj); + Py_DECREF(obj); + if (public_interface) + SwigPyBuiltin_AddPublicSymbol(public_interface, name); +} + +#else + +SWIGINTERN void SWIG_Python_SetConstant(PyObject* d, const char* name, PyObject* obj) +{ + PyDict_SetItemString(d, name, obj); + Py_DECREF(obj); +} + +#endif + +/* Append a value to the result obj */ + +SWIGINTERN PyObject* SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) +{ + if (! result) { + result = obj; + } + else if (result == Py_None) { + Py_DECREF(result); + result = obj; + } + else { + if (! PyList_Check(result)) { + PyObject* o2 = result; + result = PyList_New(1); + PyList_SetItem(result, 0, o2); + } + PyList_Append(result, obj); + Py_DECREF(obj); + } + return result; +} + +/* Unpack the argument tuple */ + +SWIGINTERN Py_ssize_t +SWIG_Python_UnpackTuple(PyObject* args, const char* name, Py_ssize_t min, Py_ssize_t max, PyObject** objs) +{ + if (! args) { + if (! min && ! max) { + return 1; + } + else { + PyErr_Format( + PyExc_TypeError, + "%s expected %s%d arguments, got none", + name, + (min == max ? "" : "at least "), + (int)min); + return 0; + } + } + if (! PyTuple_Check(args)) { + if (min <= 1 && max >= 1) { + Py_ssize_t i; + objs[0] = args; + for (i = 1; i < max; ++i) { + objs[i] = 0; + } + return 2; + } + PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple"); + return 0; + } + else { + Py_ssize_t l = PyTuple_GET_SIZE(args); + if (l < min) { + PyErr_Format( + PyExc_TypeError, + "%s expected %s%d arguments, got %d", + name, + (min == max ? "" : "at least "), + (int)min, + (int)l); + return 0; + } + else if (l > max) { + PyErr_Format( + PyExc_TypeError, + "%s expected %s%d arguments, got %d", + name, + (min == max ? "" : "at most "), + (int)max, + (int)l); + return 0; + } + else { + Py_ssize_t i; + for (i = 0; i < l; ++i) { + objs[i] = PyTuple_GET_ITEM(args, i); + } + for (; l < max; ++l) { + objs[l] = 0; + } + return i + 1; + } + } +} + +SWIGINTERN int SWIG_Python_CheckNoKeywords(PyObject* kwargs, const char* name) +{ + int no_kwargs = 1; + if (kwargs) { + assert(PyDict_Check(kwargs)); + if (PyDict_Size(kwargs) > 0) { + PyErr_Format(PyExc_TypeError, "%s() does not take keyword arguments", name); + no_kwargs = 0; + } + } + return no_kwargs; +} + +/* A functor is a function object with one single object argument */ +#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); + +/* + Helper for static pointer initialization for both C and C++ code, for example + static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...); +*/ +#ifdef __cplusplus +#define SWIG_STATIC_POINTER(var) var +#else +#define SWIG_STATIC_POINTER(var) \ + var = 0; \ + if (! var) \ + var +#endif + +/* ----------------------------------------------------------------------------- + * Pointer declarations + * ----------------------------------------------------------------------------- */ + +/* Flags for new pointer objects */ +#define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1) +#define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN) + +#define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1) + +#define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2) +#define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN) + +#ifdef __cplusplus +extern "C" { +#endif + +/* The python void return value */ + +SWIGRUNTIMEINLINE PyObject* SWIG_Py_Void(void) +{ + PyObject* none = Py_None; + Py_INCREF(none); + return none; +} + +/* SwigPyClientData */ + +typedef struct { + PyObject* klass; + PyObject* newraw; + PyObject* newargs; + PyObject* destroy; + int delargs; + int implicitconv; + PyTypeObject* pytype; +} SwigPyClientData; + +SWIGRUNTIMEINLINE int SWIG_Python_CheckImplicit(swig_type_info* ty) +{ + SwigPyClientData* data = (SwigPyClientData*)ty->clientdata; + int fail = data ? data->implicitconv : 0; + if (fail) + PyErr_SetString(PyExc_TypeError, "Implicit conversion is prohibited for explicit constructors."); + return fail; +} + +SWIGRUNTIMEINLINE PyObject* SWIG_Python_ExceptionType(swig_type_info* desc) +{ + SwigPyClientData* data = desc ? (SwigPyClientData*)desc->clientdata : 0; + PyObject* klass = data ? data->klass : 0; + return (klass ? klass : PyExc_RuntimeError); +} + +SWIGRUNTIME SwigPyClientData* SwigPyClientData_New(PyObject* obj) +{ + if (! obj) { + return 0; + } + else { + SwigPyClientData* data = (SwigPyClientData*)malloc(sizeof(SwigPyClientData)); + /* the klass element */ + data->klass = obj; + Py_INCREF(data->klass); + /* the newraw method and newargs arguments used to create a new raw instance */ + if (PyClass_Check(obj)) { + data->newraw = 0; + data->newargs = obj; + Py_INCREF(obj); + } + else { + data->newraw = PyObject_GetAttrString(data->klass, "__new__"); + if (data->newraw) { + Py_INCREF(data->newraw); + data->newargs = PyTuple_New(1); + PyTuple_SetItem(data->newargs, 0, obj); + } + else { + data->newargs = obj; + } + Py_INCREF(data->newargs); + } + /* the destroy method, aka as the C++ delete method */ + data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__"); + if (PyErr_Occurred()) { + PyErr_Clear(); + data->destroy = 0; + } + if (data->destroy) { + int flags; + Py_INCREF(data->destroy); + flags = PyCFunction_GET_FLAGS(data->destroy); + data->delargs = ! (flags & (METH_O)); + } + else { + data->delargs = 0; + } + data->implicitconv = 0; + data->pytype = 0; + return data; + } +} + +SWIGRUNTIME void SwigPyClientData_Del(SwigPyClientData* data) +{ + Py_XDECREF(data->newraw); + Py_XDECREF(data->newargs); + Py_XDECREF(data->destroy); +} + +/* =============== SwigPyObject =====================*/ + +typedef struct { + PyObject_HEAD void* ptr; + swig_type_info* ty; + int own; + PyObject* next; +#ifdef SWIGPYTHON_BUILTIN + PyObject* dict; +#endif +} SwigPyObject; + +#ifdef SWIGPYTHON_BUILTIN + +SWIGRUNTIME PyObject* SwigPyObject_get___dict__(PyObject* v, PyObject* SWIGUNUSEDPARM(args)) +{ + SwigPyObject* sobj = (SwigPyObject*)v; + + if (! sobj->dict) + sobj->dict = PyDict_New(); + + Py_INCREF(sobj->dict); + return sobj->dict; +} + +#endif + +SWIGRUNTIME PyObject* SwigPyObject_long(SwigPyObject* v) +{ + return PyLong_FromVoidPtr(v->ptr); +} + +SWIGRUNTIME PyObject* SwigPyObject_format(const char* fmt, SwigPyObject* v) +{ + PyObject* res = NULL; + PyObject* args = PyTuple_New(1); + if (args) { + if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) { + PyObject* ofmt = SWIG_Python_str_FromChar(fmt); + if (ofmt) { +#if PY_VERSION_HEX >= 0x03000000 + res = PyUnicode_Format(ofmt, args); +#else + res = PyString_Format(ofmt, args); +#endif + Py_DECREF(ofmt); + } + Py_DECREF(args); + } + } + return res; +} + +SWIGRUNTIME PyObject* SwigPyObject_oct(SwigPyObject* v) +{ + return SwigPyObject_format("%o", v); +} + +SWIGRUNTIME PyObject* SwigPyObject_hex(SwigPyObject* v) +{ + return SwigPyObject_format("%x", v); +} + +SWIGRUNTIME PyObject* SwigPyObject_repr(SwigPyObject* v) +{ + const char* name = SWIG_TypePrettyName(v->ty); + PyObject* repr = + SWIG_Python_str_FromFormat("", (name ? name : "unknown"), (void*)v); + if (v->next) { + PyObject* nrep = SwigPyObject_repr((SwigPyObject*)v->next); +#if PY_VERSION_HEX >= 0x03000000 + PyObject* joined = PyUnicode_Concat(repr, nrep); + Py_DecRef(repr); + Py_DecRef(nrep); + repr = joined; +#else + PyString_ConcatAndDel(&repr, nrep); +#endif + } + return repr; +} + +/* We need a version taking two PyObject* parameters so it's a valid + * PyCFunction to use in swigobject_methods[]. */ +SWIGRUNTIME PyObject* SwigPyObject_repr2(PyObject* v, PyObject* SWIGUNUSEDPARM(args)) +{ + return SwigPyObject_repr((SwigPyObject*)v); +} + +SWIGRUNTIME int SwigPyObject_compare(SwigPyObject* v, SwigPyObject* w) +{ + void* i = v->ptr; + void* j = w->ptr; + return (i < j) ? -1 : ((i > j) ? 1 : 0); +} + +/* Added for Python 3.x, would it also be useful for Python 2.x? */ +SWIGRUNTIME PyObject* SwigPyObject_richcompare(SwigPyObject* v, SwigPyObject* w, int op) +{ + PyObject* res; + if (op != Py_EQ && op != Py_NE) { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + res = PyBool_FromLong((SwigPyObject_compare(v, w) == 0) == (op == Py_EQ) ? 1 : 0); + return res; +} + +SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void); + +#ifdef SWIGPYTHON_BUILTIN +static swig_type_info* SwigPyObject_stype = 0; +SWIGRUNTIME PyTypeObject* SwigPyObject_type(void) +{ + SwigPyClientData* cd; + assert(SwigPyObject_stype); + cd = (SwigPyClientData*)SwigPyObject_stype->clientdata; + assert(cd); + assert(cd->pytype); + return cd->pytype; +} +#else +SWIGRUNTIME PyTypeObject* SwigPyObject_type(void) +{ + static PyTypeObject* SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce(); + return type; +} +#endif + +SWIGRUNTIMEINLINE int SwigPyObject_Check(PyObject* op) +{ +#ifdef SWIGPYTHON_BUILTIN + PyTypeObject* target_tp = SwigPyObject_type(); + if (PyType_IsSubtype(op->ob_type, target_tp)) + return 1; + return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0); +#else + return (Py_TYPE(op) == SwigPyObject_type()) || (strcmp(Py_TYPE(op)->tp_name, "SwigPyObject") == 0); +#endif +} + +SWIGRUNTIME PyObject* SwigPyObject_New(void* ptr, swig_type_info* ty, int own); + +SWIGRUNTIME void SwigPyObject_dealloc(PyObject* v) +{ + SwigPyObject* sobj = (SwigPyObject*)v; + PyObject* next = sobj->next; + if (sobj->own == SWIG_POINTER_OWN) { + swig_type_info* ty = sobj->ty; + SwigPyClientData* data = ty ? (SwigPyClientData*)ty->clientdata : 0; + PyObject* destroy = data ? data->destroy : 0; + if (destroy) { + /* destroy is always a VARARGS method */ + PyObject* res; + + /* PyObject_CallFunction() has the potential to silently drop + the active exception. In cases of unnamed temporary + variable or where we just finished iterating over a generator + StopIteration will be active right now, and this needs to + remain true upon return from SwigPyObject_dealloc. So save + and restore. */ + + PyObject *type = NULL, *value = NULL, *traceback = NULL; + PyErr_Fetch(&type, &value, &traceback); + + if (data->delargs) { + /* we need to create a temporary object to carry the destroy operation */ + PyObject* tmp = SwigPyObject_New(sobj->ptr, ty, 0); + res = SWIG_Python_CallFunctor(destroy, tmp); + Py_DECREF(tmp); + } + else { + PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); + PyObject* mself = PyCFunction_GET_SELF(destroy); + res = ((*meth)(mself, v)); + } + if (! res) + PyErr_WriteUnraisable(destroy); + + PyErr_Restore(type, value, traceback); + + Py_XDECREF(res); + } +#if ! defined(SWIG_PYTHON_SILENT_MEMLEAK) + else { + const char* name = SWIG_TypePrettyName(ty); + printf( + "swig/python detected a memory leak of type '%s', no destructor found.\n", + (name ? name : "unknown")); + } +#endif + } + Py_XDECREF(next); + PyObject_DEL(v); +} + +SWIGRUNTIME PyObject* SwigPyObject_append(PyObject* v, PyObject* next) +{ + SwigPyObject* sobj = (SwigPyObject*)v; + if (! SwigPyObject_Check(next)) { + PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject"); + return NULL; + } + sobj->next = next; + Py_INCREF(next); + return SWIG_Py_Void(); +} + +SWIGRUNTIME PyObject* SwigPyObject_next(PyObject* v, PyObject* SWIGUNUSEDPARM(args)) +{ + SwigPyObject* sobj = (SwigPyObject*)v; + if (sobj->next) { + Py_INCREF(sobj->next); + return sobj->next; + } + else { + return SWIG_Py_Void(); + } +} + +SWIGINTERN PyObject* SwigPyObject_disown(PyObject* v, PyObject* SWIGUNUSEDPARM(args)) +{ + SwigPyObject* sobj = (SwigPyObject*)v; + sobj->own = 0; + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* SwigPyObject_acquire(PyObject* v, PyObject* SWIGUNUSEDPARM(args)) +{ + SwigPyObject* sobj = (SwigPyObject*)v; + sobj->own = SWIG_POINTER_OWN; + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* SwigPyObject_own(PyObject* v, PyObject* args) +{ + PyObject* val = 0; + if (! PyArg_UnpackTuple(args, "own", 0, 1, &val)) { + return NULL; + } + else { + SwigPyObject* sobj = (SwigPyObject*)v; + PyObject* obj = PyBool_FromLong(sobj->own); + if (val) { + if (PyObject_IsTrue(val)) { + SwigPyObject_acquire(v, args); + } + else { + SwigPyObject_disown(v, args); + } + } + return obj; + } +} + +static PyMethodDef swigobject_methods[] = { + { "disown", SwigPyObject_disown, METH_NOARGS, "releases ownership of the pointer" }, + { "acquire", SwigPyObject_acquire, METH_NOARGS, "acquires ownership of the pointer" }, + { "own", SwigPyObject_own, METH_VARARGS, "returns/sets ownership of the pointer" }, + { "append", SwigPyObject_append, METH_O, "appends another 'this' object" }, + { "next", SwigPyObject_next, METH_NOARGS, "returns the next 'this' object" }, + { "__repr__", SwigPyObject_repr2, METH_NOARGS, "returns object representation" }, + { 0, 0, 0, 0 } +}; + +SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void) +{ + static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; + + static PyNumberMethods SwigPyObject_as_number = { + (binaryfunc)0, /*nb_add*/ + (binaryfunc)0, /*nb_subtract*/ + (binaryfunc)0, /*nb_multiply*/ + /* nb_divide removed in Python 3 */ +#if PY_VERSION_HEX < 0x03000000 + (binaryfunc)0, /*nb_divide*/ +#endif + (binaryfunc)0, /*nb_remainder*/ + (binaryfunc)0, /*nb_divmod*/ + (ternaryfunc)0, /*nb_power*/ + (unaryfunc)0, /*nb_negative*/ + (unaryfunc)0, /*nb_positive*/ + (unaryfunc)0, /*nb_absolute*/ + (inquiry)0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ +#if PY_VERSION_HEX < 0x03000000 + 0, /*nb_coerce*/ +#endif + (unaryfunc)SwigPyObject_long, /*nb_int*/ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_long, /*nb_long*/ +#else + 0, /*nb_reserved*/ +#endif + (unaryfunc)0, /*nb_float*/ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_oct, /*nb_oct*/ + (unaryfunc)SwigPyObject_hex, /*nb_hex*/ +#endif +#if PY_VERSION_HEX >= 0x03050000 /* 3.5 */ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 /* nb_inplace_add -> nb_inplace_matrix_multiply */ +#elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ +#else + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 /* nb_inplace_add -> nb_index */ +#endif + }; + + static PyTypeObject swigpyobject_type; + static int type_init = 0; + if (! type_init) { + const PyTypeObject tmp = { +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(NULL, 0) +#else + PyObject_HEAD_INIT(NULL) 0, /* ob_size */ +#endif + "SwigPyObject", /* tp_name */ + sizeof(SwigPyObject), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor)SwigPyObject_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + (getattrfunc)0, /* tp_getattr */ + (setattrfunc)0, /* tp_setattr */ +#if PY_VERSION_HEX >= 0x03000000 + 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ +#else + (cmpfunc)SwigPyObject_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyObject_repr, /* tp_repr */ + &SwigPyObject_as_number, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + (hashfunc)0, /* tp_hash */ + (ternaryfunc)0, /* tp_call */ + 0, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + swigobject_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + (richcmpfunc)SwigPyObject_richcompare, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + swigobject_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ + 0, /* tp_del */ + 0, /* tp_version_tag */ +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ +#endif +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ +#endif +#ifdef COUNT_ALLOCS + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0 /* tp_next */ +#endif + }; + swigpyobject_type = tmp; + type_init = 1; + if (PyType_Ready(&swigpyobject_type) < 0) + return NULL; + } + return &swigpyobject_type; +} + +SWIGRUNTIME PyObject* SwigPyObject_New(void* ptr, swig_type_info* ty, int own) +{ + SwigPyObject* sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); + if (sobj) { + sobj->ptr = ptr; + sobj->ty = ty; + sobj->own = own; + sobj->next = 0; + } + return (PyObject*)sobj; +} + +/* ----------------------------------------------------------------------------- + * Implements a simple Swig Packed type, and use it instead of string + * ----------------------------------------------------------------------------- */ + +typedef struct { + PyObject_HEAD void* pack; + swig_type_info* ty; + size_t size; +} SwigPyPacked; + +SWIGRUNTIME PyObject* SwigPyPacked_repr(SwigPyPacked* v) +{ + char result[SWIG_BUFFER_SIZE]; + if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { + return SWIG_Python_str_FromFormat("", result, v->ty->name); + } + else { + return SWIG_Python_str_FromFormat("", v->ty->name); + } +} + +SWIGRUNTIME PyObject* SwigPyPacked_str(SwigPyPacked* v) +{ + char result[SWIG_BUFFER_SIZE]; + if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { + return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); + } + else { + return SWIG_Python_str_FromChar(v->ty->name); + } +} + +SWIGRUNTIME int SwigPyPacked_compare(SwigPyPacked* v, SwigPyPacked* w) +{ + size_t i = v->size; + size_t j = w->size; + int s = (i < j) ? -1 : ((i > j) ? 1 : 0); + return s ? s : strncmp((const char*)v->pack, (const char*)w->pack, 2 * v->size); +} + +SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void); + +SWIGRUNTIME PyTypeObject* SwigPyPacked_type(void) +{ + static PyTypeObject* SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce(); + return type; +} + +SWIGRUNTIMEINLINE int SwigPyPacked_Check(PyObject* op) +{ + return ((op)->ob_type == SwigPyPacked_TypeOnce()) || (strcmp((op)->ob_type->tp_name, "SwigPyPacked") == 0); +} + +SWIGRUNTIME void SwigPyPacked_dealloc(PyObject* v) +{ + if (SwigPyPacked_Check(v)) { + SwigPyPacked* sobj = (SwigPyPacked*)v; + free(sobj->pack); + } + PyObject_DEL(v); +} + +SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void) +{ + static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; + static PyTypeObject swigpypacked_type; + static int type_init = 0; + if (! type_init) { + const PyTypeObject tmp = { +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(NULL, 0) +#else + PyObject_HEAD_INIT(NULL) 0, /* ob_size */ +#endif + "SwigPyPacked", /* tp_name */ + sizeof(SwigPyPacked), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + (getattrfunc)0, /* tp_getattr */ + (setattrfunc)0, /* tp_setattr */ +#if PY_VERSION_HEX >= 0x03000000 + 0, /* tp_reserved in 3.0.1 */ +#else + (cmpfunc)SwigPyPacked_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyPacked_repr, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + (hashfunc)0, /* tp_hash */ + (ternaryfunc)0, /* tp_call */ + (reprfunc)SwigPyPacked_str, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + swigpacked_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ + 0, /* tp_del */ + 0, /* tp_version_tag */ +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ +#endif +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ +#endif +#ifdef COUNT_ALLOCS + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0 /* tp_next */ +#endif + }; + swigpypacked_type = tmp; + type_init = 1; + if (PyType_Ready(&swigpypacked_type) < 0) + return NULL; + } + return &swigpypacked_type; +} + +SWIGRUNTIME PyObject* SwigPyPacked_New(void* ptr, size_t size, swig_type_info* ty) +{ + SwigPyPacked* sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); + if (sobj) { + void* pack = malloc(size); + if (pack) { + memcpy(pack, ptr, size); + sobj->pack = pack; + sobj->ty = ty; + sobj->size = size; + } + else { + PyObject_DEL((PyObject*)sobj); + sobj = 0; + } + } + return (PyObject*)sobj; +} + +SWIGRUNTIME swig_type_info* SwigPyPacked_UnpackData(PyObject* obj, void* ptr, size_t size) +{ + if (SwigPyPacked_Check(obj)) { + SwigPyPacked* sobj = (SwigPyPacked*)obj; + if (sobj->size != size) + return 0; + memcpy(ptr, sobj->pack, size); + return sobj->ty; + } + else { + return 0; + } +} + +/* ----------------------------------------------------------------------------- + * pointers/data manipulation + * ----------------------------------------------------------------------------- */ + +static PyObject* Swig_This_global = NULL; + +SWIGRUNTIME PyObject* SWIG_This(void) +{ + if (Swig_This_global == NULL) + Swig_This_global = SWIG_Python_str_FromChar("this"); + return Swig_This_global; +} + +/* #define SWIG_PYTHON_SLOW_GETSET_THIS */ + +/* TODO: I don't know how to implement the fast getset in Python 3 right now */ +#if PY_VERSION_HEX >= 0x03000000 +#define SWIG_PYTHON_SLOW_GETSET_THIS +#endif + +SWIGRUNTIME SwigPyObject* SWIG_Python_GetSwigThis(PyObject* pyobj) +{ + PyObject* obj; + + if (SwigPyObject_Check(pyobj)) + return (SwigPyObject*)pyobj; + +#ifdef SWIGPYTHON_BUILTIN + (void)obj; +#ifdef PyWeakref_CheckProxy + if (PyWeakref_CheckProxy(pyobj)) { + pyobj = PyWeakref_GET_OBJECT(pyobj); + if (pyobj && SwigPyObject_Check(pyobj)) + return (SwigPyObject*)pyobj; + } +#endif + return NULL; +#else + + obj = 0; + +#if ! defined(SWIG_PYTHON_SLOW_GETSET_THIS) + if (PyInstance_Check(pyobj)) { + obj = _PyInstance_Lookup(pyobj, SWIG_This()); + } + else { + PyObject** dictptr = _PyObject_GetDictPtr(pyobj); + if (dictptr != NULL) { + PyObject* dict = *dictptr; + obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0; + } + else { +#ifdef PyWeakref_CheckProxy + if (PyWeakref_CheckProxy(pyobj)) { + PyObject* wobj = PyWeakref_GET_OBJECT(pyobj); + return wobj ? SWIG_Python_GetSwigThis(wobj) : 0; + } +#endif + obj = PyObject_GetAttr(pyobj, SWIG_This()); + if (obj) { + Py_DECREF(obj); + } + else { + if (PyErr_Occurred()) + PyErr_Clear(); + return 0; + } + } + } +#else + obj = PyObject_GetAttr(pyobj, SWIG_This()); + if (obj) { + Py_DECREF(obj); + } + else { + if (PyErr_Occurred()) + PyErr_Clear(); + return 0; + } +#endif + if (obj && ! SwigPyObject_Check(obj)) { + /* a PyObject is called 'this', try to get the 'real this' + SwigPyObject from it */ + return SWIG_Python_GetSwigThis(obj); + } + return (SwigPyObject*)obj; +#endif +} + +/* Acquire a pointer value */ + +SWIGRUNTIME int SWIG_Python_AcquirePtr(PyObject* obj, int own) +{ + if (own == SWIG_POINTER_OWN) { + SwigPyObject* sobj = SWIG_Python_GetSwigThis(obj); + if (sobj) { + int oldown = sobj->own; + sobj->own = own; + return oldown; + } + } + return 0; +} + +/* Convert a pointer value */ + +SWIGRUNTIME int SWIG_Python_ConvertPtrAndOwn(PyObject* obj, void** ptr, swig_type_info* ty, int flags, int* own) +{ + int res; + SwigPyObject* sobj; + int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0; + + if (! obj) + return SWIG_ERROR; + if (obj == Py_None && ! implicit_conv) { + if (ptr) + *ptr = 0; + return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; + } + + res = SWIG_ERROR; + + sobj = SWIG_Python_GetSwigThis(obj); + if (own) + *own = 0; + while (sobj) { + void* vptr = sobj->ptr; + if (ty) { + swig_type_info* to = sobj->ty; + if (to == ty) { + /* no type cast needed */ + if (ptr) + *ptr = vptr; + break; + } + else { + swig_cast_info* tc = SWIG_TypeCheck(to->name, ty); + if (! tc) { + sobj = (SwigPyObject*)sobj->next; + } + else { + if (ptr) { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc, vptr, &newmemory); + if (newmemory == SWIG_CAST_NEW_MEMORY) { + assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use + own to delete *ptr */ + if (own) + *own = *own | SWIG_CAST_NEW_MEMORY; + } + } + break; + } + } + } + else { + if (ptr) + *ptr = vptr; + break; + } + } + if (sobj) { + if (own) + *own = *own | sobj->own; + if (flags & SWIG_POINTER_DISOWN) { + sobj->own = 0; + } + res = SWIG_OK; + } + else { + if (implicit_conv) { + SwigPyClientData* data = ty ? (SwigPyClientData*)ty->clientdata : 0; + if (data && ! data->implicitconv) { + PyObject* klass = data->klass; + if (klass) { + PyObject* impconv; + data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/ + impconv = SWIG_Python_CallFunctor(klass, obj); + data->implicitconv = 0; + if (PyErr_Occurred()) { + PyErr_Clear(); + impconv = 0; + } + if (impconv) { + SwigPyObject* iobj = SWIG_Python_GetSwigThis(impconv); + if (iobj) { + void* vptr; + res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); + if (SWIG_IsOK(res)) { + if (ptr) { + *ptr = vptr; + /* transfer the ownership to 'ptr' */ + iobj->own = 0; + res = SWIG_AddCast(res); + res = SWIG_AddNewMask(res); + } + else { + res = SWIG_AddCast(res); + } + } + } + Py_DECREF(impconv); + } + } + } + if (! SWIG_IsOK(res) && obj == Py_None) { + if (ptr) + *ptr = 0; + if (PyErr_Occurred()) + PyErr_Clear(); + res = SWIG_OK; + } + } + } + return res; +} + +/* Convert a function ptr value */ + +SWIGRUNTIME int SWIG_Python_ConvertFunctionPtr(PyObject* obj, void** ptr, swig_type_info* ty) +{ + if (! PyCFunction_Check(obj)) { + return SWIG_ConvertPtr(obj, ptr, ty, 0); + } + else { + void* vptr = 0; + swig_cast_info* tc; + + /* here we get the method pointer for callbacks */ + const char* doc = (((PyCFunctionObject*)obj)->m_ml->ml_doc); + const char* desc = doc ? strstr(doc, "swig_ptr: ") : 0; + if (desc) + desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; + if (! desc) + return SWIG_ERROR; + tc = SWIG_TypeCheck(desc, ty); + if (tc) { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc, vptr, &newmemory); + assert(! newmemory); /* newmemory handling not yet implemented */ + } + else { + return SWIG_ERROR; + } + return SWIG_OK; + } +} + +/* Convert a packed pointer value */ + +SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject* obj, void* ptr, size_t sz, swig_type_info* ty) +{ + swig_type_info* to = SwigPyPacked_UnpackData(obj, ptr, sz); + if (! to) + return SWIG_ERROR; + if (ty) { + if (to != ty) { + /* check type cast? */ + swig_cast_info* tc = SWIG_TypeCheck(to->name, ty); + if (! tc) + return SWIG_ERROR; + } + } + return SWIG_OK; +} + +/* ----------------------------------------------------------------------------- + * Create a new pointer object + * ----------------------------------------------------------------------------- */ + +/* + Create a new instance object, without calling __init__, and set the + 'this' attribute. +*/ + +SWIGRUNTIME PyObject* SWIG_Python_NewShadowInstance(SwigPyClientData* data, PyObject* swig_this) +{ + PyObject* inst = 0; + PyObject* newraw = data->newraw; + if (newraw) { + inst = PyObject_Call(newraw, data->newargs, NULL); + if (inst) { +#if ! defined(SWIG_PYTHON_SLOW_GETSET_THIS) + PyObject** dictptr = _PyObject_GetDictPtr(inst); + if (dictptr != NULL) { + PyObject* dict = *dictptr; + if (dict == NULL) { + dict = PyDict_New(); + *dictptr = dict; + PyDict_SetItem(dict, SWIG_This(), swig_this); + } + } +#else + if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) { + Py_DECREF(inst); + inst = 0; + } +#endif + } + } + else { +#if PY_VERSION_HEX >= 0x03000000 + PyObject* empty_args = PyTuple_New(0); + if (empty_args) { + PyObject* empty_kwargs = PyDict_New(); + if (empty_kwargs) { + inst = ((PyTypeObject*)data->newargs)->tp_new((PyTypeObject*)data->newargs, empty_args, empty_kwargs); + Py_DECREF(empty_kwargs); + if (inst) { + if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) { + Py_DECREF(inst); + inst = 0; + } + else { + Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; + } + } + } + Py_DECREF(empty_args); + } +#else + PyObject* dict = PyDict_New(); + if (dict) { + PyDict_SetItem(dict, SWIG_This(), swig_this); + inst = PyInstance_NewRaw(data->newargs, dict); + Py_DECREF(dict); + } +#endif + } + return inst; +} + +SWIGRUNTIME int SWIG_Python_SetSwigThis(PyObject* inst, PyObject* swig_this) +{ +#if ! defined(SWIG_PYTHON_SLOW_GETSET_THIS) + PyObject** dictptr = _PyObject_GetDictPtr(inst); + if (dictptr != NULL) { + PyObject* dict = *dictptr; + if (dict == NULL) { + dict = PyDict_New(); + *dictptr = dict; + } + return PyDict_SetItem(dict, SWIG_This(), swig_this); + } +#endif + return PyObject_SetAttr(inst, SWIG_This(), swig_this); +} + +SWIGINTERN PyObject* SWIG_Python_InitShadowInstance(PyObject* args) +{ + PyObject* obj[2]; + if (! SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) { + return NULL; + } + else { + SwigPyObject* sthis = SWIG_Python_GetSwigThis(obj[0]); + if (sthis) { + SwigPyObject_append((PyObject*)sthis, obj[1]); + } + else { + if (SWIG_Python_SetSwigThis(obj[0], obj[1]) != 0) + return NULL; + } + return SWIG_Py_Void(); + } +} + +/* Create a new pointer object */ + +SWIGRUNTIME PyObject* SWIG_Python_NewPointerObj(PyObject* self, void* ptr, swig_type_info* type, int flags) +{ + SwigPyClientData* clientdata; + PyObject* robj; + int own; + + if (! ptr) + return SWIG_Py_Void(); + + clientdata = type ? (SwigPyClientData*)(type->clientdata) : 0; + own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; + if (clientdata && clientdata->pytype) { + SwigPyObject* newobj; + if (flags & SWIG_BUILTIN_TP_INIT) { + newobj = (SwigPyObject*)self; + if (newobj->ptr) { + PyObject* next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0); + while (newobj->next) + newobj = (SwigPyObject*)newobj->next; + newobj->next = next_self; + newobj = (SwigPyObject*)next_self; +#ifdef SWIGPYTHON_BUILTIN + newobj->dict = 0; +#endif + } + } + else { + newobj = PyObject_New(SwigPyObject, clientdata->pytype); +#ifdef SWIGPYTHON_BUILTIN + newobj->dict = 0; +#endif + } + if (newobj) { + newobj->ptr = ptr; + newobj->ty = type; + newobj->own = own; + newobj->next = 0; + return (PyObject*)newobj; + } + return SWIG_Py_Void(); + } + + assert(! (flags & SWIG_BUILTIN_TP_INIT)); + + robj = SwigPyObject_New(ptr, type, own); + if (robj && clientdata && ! (flags & SWIG_POINTER_NOSHADOW)) { + PyObject* inst = SWIG_Python_NewShadowInstance(clientdata, robj); + Py_DECREF(robj); + robj = inst; + } + return robj; +} + +/* Create a new packed object */ + +SWIGRUNTIMEINLINE PyObject* SWIG_Python_NewPackedObj(void* ptr, size_t sz, swig_type_info* type) +{ + return ptr ? SwigPyPacked_New((void*)ptr, sz, type) : SWIG_Py_Void(); +} + +/* -----------------------------------------------------------------------------* + * Get type list + * -----------------------------------------------------------------------------*/ + +#ifdef SWIG_LINK_RUNTIME +void* SWIG_ReturnGlobalTypeList(void*); +#endif + +SWIGRUNTIME swig_module_info* SWIG_Python_GetModule(void* SWIGUNUSEDPARM(clientdata)) +{ + static void* type_pointer = (void*)0; + /* first check if module already created */ + if (! type_pointer) { +#ifdef SWIG_LINK_RUNTIME + type_pointer = SWIG_ReturnGlobalTypeList((void*)0); +#else + type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0); + if (PyErr_Occurred()) { + PyErr_Clear(); + type_pointer = (void*)0; + } +#endif + } + return (swig_module_info*)type_pointer; +} + +SWIGRUNTIME void SWIG_Python_DestroyModule(PyObject* obj) +{ + swig_module_info* swig_module = (swig_module_info*)PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME); + swig_type_info** types = swig_module->types; + size_t i; + for (i = 0; i < swig_module->size; ++i) { + swig_type_info* ty = types[i]; + if (ty->owndata) { + SwigPyClientData* data = (SwigPyClientData*)ty->clientdata; + if (data) + SwigPyClientData_Del(data); + } + } + Py_DECREF(SWIG_This()); + Swig_This_global = NULL; +} + +SWIGRUNTIME void SWIG_Python_SetModule(swig_module_info* swig_module) +{ +#if PY_VERSION_HEX >= 0x03000000 + /* Add a dummy module object into sys.modules */ + PyObject* module = PyImport_AddModule("swig_runtime_data" SWIG_RUNTIME_VERSION); +#else + static PyMethodDef swig_empty_runtime_method_table[] = { { NULL, NULL, 0, NULL } }; /* Sentinel */ + PyObject* module = Py_InitModule("swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); +#endif + PyObject* pointer = PyCapsule_New((void*)swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule); + if (pointer && module) { + PyModule_AddObject(module, "type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer); + } + else { + Py_XDECREF(pointer); + } +} + +/* The python cached type query */ +SWIGRUNTIME PyObject* SWIG_Python_TypeCache(void) +{ + static PyObject* SWIG_STATIC_POINTER(cache) = PyDict_New(); + return cache; +} + +SWIGRUNTIME swig_type_info* SWIG_Python_TypeQuery(const char* type) +{ + PyObject* cache = SWIG_Python_TypeCache(); + PyObject* key = SWIG_Python_str_FromChar(type); + PyObject* obj = PyDict_GetItem(cache, key); + swig_type_info* descriptor; + if (obj) { + descriptor = (swig_type_info*)PyCapsule_GetPointer(obj, NULL); + } + else { + swig_module_info* swig_module = SWIG_GetModule(0); + descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); + if (descriptor) { + obj = PyCapsule_New((void*)descriptor, NULL, NULL); + PyDict_SetItem(cache, key, obj); + Py_DECREF(obj); + } + } + Py_DECREF(key); + return descriptor; +} + +/* + For backward compatibility only +*/ +#define SWIG_POINTER_EXCEPTION 0 +#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg) +#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags) + +SWIGRUNTIME int SWIG_Python_AddErrMesg(const char* mesg, int infront) +{ + if (PyErr_Occurred()) { + PyObject* type = 0; + PyObject* value = 0; + PyObject* traceback = 0; + PyErr_Fetch(&type, &value, &traceback); + if (value) { + PyObject* old_str = PyObject_Str(value); + const char* tmp = SWIG_Python_str_AsChar(old_str); + const char* errmesg = tmp ? tmp : "Invalid error message"; + Py_XINCREF(type); + PyErr_Clear(); + if (infront) { + PyErr_Format(type, "%s %s", mesg, errmesg); + } + else { + PyErr_Format(type, "%s %s", errmesg, mesg); + } + SWIG_Python_str_DelForPy3(tmp); + Py_DECREF(old_str); + } + return 1; + } + else { + return 0; + } +} + +SWIGRUNTIME int SWIG_Python_ArgFail(int argnum) +{ + if (PyErr_Occurred()) { + /* add information about failing argument */ + char mesg[256]; + PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum); + return SWIG_Python_AddErrMesg(mesg, 1); + } + else { + return 0; + } +} + +SWIGRUNTIMEINLINE const char* SwigPyObject_GetDesc(PyObject* self) +{ + SwigPyObject* v = (SwigPyObject*)self; + swig_type_info* ty = v ? v->ty : 0; + return ty ? ty->str : ""; +} + +SWIGRUNTIME void SWIG_Python_TypeError(const char* type, PyObject* obj) +{ + if (type) { +#if defined(SWIG_COBJECT_TYPES) + if (obj && SwigPyObject_Check(obj)) { + const char* otype = (const char*)SwigPyObject_GetDesc(obj); + if (otype) { + PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", type, otype); + return; + } + } + else +#endif + { + const char* otype = (obj ? obj->ob_type->tp_name : 0); + if (otype) { + PyObject* str = PyObject_Str(obj); + const char* cstr = str ? SWIG_Python_str_AsChar(str) : 0; + if (cstr) { + PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", type, otype, cstr); + SWIG_Python_str_DelForPy3(cstr); + } + else { + PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); + } + Py_XDECREF(str); + return; + } + } + PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); + } + else { + PyErr_Format(PyExc_TypeError, "unexpected type is received"); + } +} + +/* Convert a pointer value, signal an exception on a type mismatch */ +SWIGRUNTIME void* SWIG_Python_MustGetPtr(PyObject* obj, swig_type_info* ty, int SWIGUNUSEDPARM(argnum), int flags) +{ + void* result; + if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { + PyErr_Clear(); +#if SWIG_POINTER_EXCEPTION + if (flags) { + SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); + SWIG_Python_ArgFail(argnum); + } +#endif + } + return result; +} + +#ifdef SWIGPYTHON_BUILTIN +SWIGRUNTIME int SWIG_Python_NonDynamicSetAttr(PyObject* obj, PyObject* name, PyObject* value) +{ + PyTypeObject* tp = obj->ob_type; + PyObject* descr; + PyObject* encoded_name; + descrsetfunc f; + int res = -1; + +#ifdef Py_USING_UNICODE + if (PyString_Check(name)) { + name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL); + if (! name) + return -1; + } + else if (! PyUnicode_Check(name)) +#else + if (! PyString_Check(name)) +#endif + { + PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name); + return -1; + } + else { + Py_INCREF(name); + } + + if (! tp->tp_dict) { + if (PyType_Ready(tp) < 0) + goto done; + } + + descr = _PyType_Lookup(tp, name); + f = NULL; + if (descr != NULL) + f = descr->ob_type->tp_descr_set; + if (! f) { + if (PyString_Check(name)) { + encoded_name = name; + Py_INCREF(name); + } + else { + encoded_name = PyUnicode_AsUTF8String(name); + if (! encoded_name) + return -1; + } + PyErr_Format( + PyExc_AttributeError, + "'%.100s' object has no attribute '%.200s'", + tp->tp_name, + PyString_AsString(encoded_name)); + Py_DECREF(encoded_name); + } + else { + res = f(descr, obj, value); + } + +done: + Py_DECREF(name); + return res; +} +#endif + +#ifdef __cplusplus +} +#endif + +#define SWIG_exception_fail(code, msg) \ + do { \ + SWIG_Error(code, msg); \ + SWIG_fail; \ + } while (0) + +#define SWIG_contract_assert(expr, msg) \ + if (! (expr)) { \ + SWIG_Error(SWIG_RuntimeError, msg); \ + SWIG_fail; \ + } \ + else + +#ifdef __cplusplus +extern "C" { +#endif + +/* Method creation and docstring support functions */ + +SWIGINTERN PyMethodDef* SWIG_PythonGetProxyDoc(const char* name); +SWIGINTERN PyObject* SWIG_PyInstanceMethod_New(PyObject* SWIGUNUSEDPARM(self), PyObject* func); +SWIGINTERN PyObject* SWIG_PyStaticMethod_New(PyObject* SWIGUNUSEDPARM(self), PyObject* func); + +#ifdef __cplusplus +} +#endif + +/* ----------------------------------------------------------------------------- + * director_common.swg + * + * This file contains support for director classes which is common between + * languages. + * ----------------------------------------------------------------------------- */ + +/* + Use -DSWIG_DIRECTOR_STATIC if you prefer to avoid the use of the + 'Swig' namespace. This could be useful for multi-modules projects. +*/ +#ifdef SWIG_DIRECTOR_STATIC +/* Force anonymous (static) namespace */ +#define Swig +#endif +/* ----------------------------------------------------------------------------- + * director.swg + * + * This file contains support for director classes so that Python proxy + * methods can be called from C++. + * ----------------------------------------------------------------------------- */ + +#ifndef SWIG_DIRECTOR_PYTHON_HEADER_ +#define SWIG_DIRECTOR_PYTHON_HEADER_ + +#include +#include +#include +#include +#include + +/* + Use -DSWIG_PYTHON_DIRECTOR_NO_VTABLE if you don't want to generate a 'virtual + table', and avoid multiple GetAttr calls to retrieve the python + methods. +*/ + +#ifndef SWIG_PYTHON_DIRECTOR_NO_VTABLE +#ifndef SWIG_PYTHON_DIRECTOR_VTABLE +#define SWIG_PYTHON_DIRECTOR_VTABLE +#endif +#endif + +/* + Use -DSWIG_DIRECTOR_NO_UEH if you prefer to avoid the use of the + Undefined Exception Handler provided by swig. +*/ +#ifndef SWIG_DIRECTOR_NO_UEH +#ifndef SWIG_DIRECTOR_UEH +#define SWIG_DIRECTOR_UEH +#endif +#endif + +/* + Use -DSWIG_DIRECTOR_NORTTI if you prefer to avoid the use of the + native C++ RTTI and dynamic_cast<>. But be aware that directors + could stop working when using this option. +*/ +#ifdef SWIG_DIRECTOR_NORTTI +/* + When we don't use the native C++ RTTI, we implement a minimal one + only for Directors. +*/ +#ifndef SWIG_DIRECTOR_RTDIR +#define SWIG_DIRECTOR_RTDIR + +namespace Swig { +class Director; +SWIGINTERN std::map& get_rtdir_map() +{ + static std::map rtdir_map; + return rtdir_map; +} + +SWIGINTERNINLINE void set_rtdir(void* vptr, Director* rtdir) +{ + get_rtdir_map()[vptr] = rtdir; +} + +SWIGINTERNINLINE Director* get_rtdir(void* vptr) +{ + std::map::const_iterator pos = get_rtdir_map().find(vptr); + Director* rtdir = (pos != get_rtdir_map().end()) ? pos->second : 0; + return rtdir; +} +} // namespace Swig +#endif /* SWIG_DIRECTOR_RTDIR */ + +#define SWIG_DIRECTOR_CAST(ARG) Swig::get_rtdir(static_cast(ARG)) +#define SWIG_DIRECTOR_RGTR(ARG1, ARG2) Swig::set_rtdir(static_cast(ARG1), ARG2) + +#else + +#define SWIG_DIRECTOR_CAST(ARG) dynamic_cast(ARG) +#define SWIG_DIRECTOR_RGTR(ARG1, ARG2) + +#endif /* SWIG_DIRECTOR_NORTTI */ + +extern "C" { +struct swig_type_info; +} + +namespace Swig { + +/* memory handler */ +struct GCItem { + virtual ~GCItem() + { + } + + virtual int get_own() const + { + return 0; + } +}; + +struct GCItem_var { + GCItem_var(GCItem* item = 0) : _item(item) + { + } + + GCItem_var& operator=(GCItem* item) + { + GCItem* tmp = _item; + _item = item; + delete tmp; + return *this; + } + + ~GCItem_var() + { + delete _item; + } + + GCItem* operator->() const + { + return _item; + } + + private: + GCItem* _item; +}; + +struct GCItem_Object : GCItem { + GCItem_Object(int own) : _own(own) + { + } + + virtual ~GCItem_Object() + { + } + + int get_own() const + { + return _own; + } + + private: + int _own; +}; + +template struct GCItem_T : GCItem { + GCItem_T(Type* ptr) : _ptr(ptr) + { + } + + virtual ~GCItem_T() + { + delete _ptr; + } + + private: + Type* _ptr; +}; + +template struct GCArray_T : GCItem { + GCArray_T(Type* ptr) : _ptr(ptr) + { + } + + virtual ~GCArray_T() + { + delete[] _ptr; + } + + private: + Type* _ptr; +}; + +/* base class for director exceptions */ +class DirectorException : public std::exception { + protected: + std::string swig_msg; + + public: + DirectorException(PyObject* error, const char* hdr = "", const char* msg = "") : swig_msg(hdr) + { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + if (msg[0]) { + swig_msg += " "; + swig_msg += msg; + } + if (! PyErr_Occurred()) { + PyErr_SetString(error, what()); + } + SWIG_PYTHON_THREAD_END_BLOCK; + } + + virtual ~DirectorException() throw() + { + } + + /* Deprecated, use what() instead */ + const char* getMessage() const + { + return what(); + } + + const char* what() const throw() + { + return swig_msg.c_str(); + } + + static void raise(PyObject* error, const char* msg) + { + throw DirectorException(error, msg); + } + + static void raise(const char* msg) + { + raise(PyExc_RuntimeError, msg); + } +}; + +/* type mismatch in the return value from a python method call */ +class DirectorTypeMismatchException : public DirectorException { + public: + DirectorTypeMismatchException(PyObject* error, const char* msg = "") + : DirectorException(error, "SWIG director type mismatch", msg) + { + } + + DirectorTypeMismatchException(const char* msg = "") + : DirectorException(PyExc_TypeError, "SWIG director type mismatch", msg) + { + } + + static void raise(PyObject* error, const char* msg) + { + throw DirectorTypeMismatchException(error, msg); + } + + static void raise(const char* msg) + { + throw DirectorTypeMismatchException(msg); + } +}; + +/* any python exception that occurs during a director method call */ +class DirectorMethodException : public DirectorException { + public: + DirectorMethodException(const char* msg = "") + : DirectorException(PyExc_RuntimeError, "SWIG director method error.", msg) + { + } + + static void raise(const char* msg) + { + throw DirectorMethodException(msg); + } +}; + +/* attempt to call a pure virtual method via a director method */ +class DirectorPureVirtualException : public DirectorException { + public: + DirectorPureVirtualException(const char* msg = "") + : DirectorException(PyExc_RuntimeError, "SWIG director pure virtual method called", msg) + { + } + + static void raise(const char* msg) + { + throw DirectorPureVirtualException(msg); + } +}; + +#if defined(SWIG_PYTHON_THREADS) +/* __THREAD__ is the old macro to activate some thread support */ +#if ! defined(__THREAD__) +#define __THREAD__ 1 +#endif +#endif + +#ifdef __THREAD__ +#include "pythread.h" +class Guard { + PyThread_type_lock& mutex_; + + public: + Guard(PyThread_type_lock& mutex) : mutex_(mutex) + { + PyThread_acquire_lock(mutex_, WAIT_LOCK); + } + + ~Guard() + { + PyThread_release_lock(mutex_); + } +}; +#define SWIG_GUARD(mutex) Guard _guard(mutex) +#else +#define SWIG_GUARD(mutex) +#endif + +/* director base class */ +class Director { + private: + /* pointer to the wrapped python object */ + PyObject* swig_self; + /* flag indicating whether the object is owned by python or c++ */ + mutable bool swig_disown_flag; + + /* decrement the reference count of the wrapped python object */ + void swig_decref() const + { + if (swig_disown_flag) { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + Py_DECREF(swig_self); + SWIG_PYTHON_THREAD_END_BLOCK; + } + } + + public: + /* wrap a python object. */ + Director(PyObject* self) : swig_self(self), swig_disown_flag(false) + { + } + + /* discard our reference at destruction */ + virtual ~Director() + { + swig_decref(); + } + + /* return a pointer to the wrapped python object */ + PyObject* swig_get_self() const + { + return swig_self; + } + + /* acquire ownership of the wrapped python object (the sense of "disown" is from python) */ + void swig_disown() const + { + if (! swig_disown_flag) { + swig_disown_flag = true; + swig_incref(); + } + } + + /* increase the reference count of the wrapped python object */ + void swig_incref() const + { + if (swig_disown_flag) { + Py_INCREF(swig_self); + } + } + + /* methods to implement pseudo protected director members */ + virtual bool swig_get_inner(const char* /* swig_protected_method_name */) const + { + return true; + } + + virtual void swig_set_inner(const char* /* swig_protected_method_name */, bool /* swig_val */) const + { + } + + /* ownership management */ + private: + typedef std::map swig_ownership_map; + mutable swig_ownership_map swig_owner; +#ifdef __THREAD__ + static PyThread_type_lock swig_mutex_own; +#endif + + public: + template void swig_acquire_ownership_array(Type* vptr) const + { + if (vptr) { + SWIG_GUARD(swig_mutex_own); + swig_owner[vptr] = new GCArray_T(vptr); + } + } + + template void swig_acquire_ownership(Type* vptr) const + { + if (vptr) { + SWIG_GUARD(swig_mutex_own); + swig_owner[vptr] = new GCItem_T(vptr); + } + } + + void swig_acquire_ownership_obj(void* vptr, int own) const + { + if (vptr && own) { + SWIG_GUARD(swig_mutex_own); + swig_owner[vptr] = new GCItem_Object(own); + } + } + + int swig_release_ownership(void* vptr) const + { + int own = 0; + if (vptr) { + SWIG_GUARD(swig_mutex_own); + swig_ownership_map::iterator iter = swig_owner.find(vptr); + if (iter != swig_owner.end()) { + own = iter->second->get_own(); + swig_owner.erase(iter); + } + } + return own; + } + + template static PyObject* swig_pyobj_disown(PyObject* pyobj, PyObject* SWIGUNUSEDPARM(args)) + { + SwigPyObject* sobj = (SwigPyObject*)pyobj; + sobj->own = 0; + Director* d = SWIG_DIRECTOR_CAST(reinterpret_cast(sobj->ptr)); + if (d) + d->swig_disown(); + return PyWeakref_NewProxy(pyobj, NULL); + } +}; + +#ifdef __THREAD__ +PyThread_type_lock Director::swig_mutex_own = PyThread_allocate_lock(); +#endif +} // namespace Swig + +#endif + +/* -------- TYPES TABLE (BEGIN) -------- */ + +#define SWIGTYPE_p_PythonDirectorCallbackClass swig_types[0] +#define SWIGTYPE_p_a_32__p_char swig_types[1] +#define SWIGTYPE_p_char swig_types[2] +#define SWIGTYPE_p_int swig_types[3] +#define SWIGTYPE_p_long_long swig_types[4] +#define SWIGTYPE_p_p_char swig_types[5] +#define SWIGTYPE_p_short swig_types[6] +#define SWIGTYPE_p_signed_char swig_types[7] +#define SWIGTYPE_p_ssize_t swig_types[8] +#define SWIGTYPE_p_unsigned_char swig_types[9] +#define SWIGTYPE_p_unsigned_int swig_types[10] +#define SWIGTYPE_p_unsigned_long_long swig_types[11] +#define SWIGTYPE_p_unsigned_short swig_types[12] +#define SWIGTYPE_p_void swig_types[13] +#define SWIGTYPE_p_zts_addr_info_t swig_types[14] +#define SWIGTYPE_p_zts_errno_t swig_types[15] +#define SWIGTYPE_p_zts_error_t swig_types[16] +#define SWIGTYPE_p_zts_event_msg_t swig_types[17] +#define SWIGTYPE_p_zts_event_t swig_types[18] +#define SWIGTYPE_p_zts_fd_set swig_types[19] +#define SWIGTYPE_p_zts_hostent swig_types[20] +#define SWIGTYPE_p_zts_iovec swig_types[21] +#define SWIGTYPE_p_zts_ip4_addr swig_types[22] +#define SWIGTYPE_p_zts_ip6_addr swig_types[23] +#define SWIGTYPE_p_zts_ip_addr swig_types[24] +#define SWIGTYPE_p_zts_msghdr swig_types[25] +#define SWIGTYPE_p_zts_multicast_group_t swig_types[26] +#define SWIGTYPE_p_zts_net_info_t swig_types[27] +#define SWIGTYPE_p_zts_net_info_type_t swig_types[28] +#define SWIGTYPE_p_zts_netif_info_t swig_types[29] +#define SWIGTYPE_p_zts_network_status_t swig_types[30] +#define SWIGTYPE_p_zts_node_info_t swig_types[31] +#define SWIGTYPE_p_zts_path_t swig_types[32] +#define SWIGTYPE_p_zts_peer_info_t swig_types[33] +#define SWIGTYPE_p_zts_peer_role_t swig_types[34] +#define SWIGTYPE_p_zts_pollfd swig_types[35] +#define SWIGTYPE_p_zts_root_set_t swig_types[36] +#define SWIGTYPE_p_zts_route_info_t swig_types[37] +#define SWIGTYPE_p_zts_sockaddr swig_types[38] +#define SWIGTYPE_p_zts_sockaddr_storage swig_types[39] +#define SWIGTYPE_p_zts_stats_counter_t swig_types[40] +#define SWIGTYPE_p_zts_timeval swig_types[41] +static swig_type_info* swig_types[43]; +static swig_module_info swig_module = { swig_types, 42, 0, 0, 0, 0 }; +#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) +#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) + +/* -------- TYPES TABLE (END) -------- */ + +#ifdef SWIG_TypeQuery +#undef SWIG_TypeQuery +#endif +#define SWIG_TypeQuery SWIG_Python_TypeQuery + +/*----------------------------------------------- + @(target):= _libzt.so + ------------------------------------------------*/ +#if PY_VERSION_HEX >= 0x03000000 +#define SWIG_init PyInit__libzt + +#else +#define SWIG_init init_libzt + +#endif +#define SWIG_name "_libzt" + +#define SWIGVERSION 0x040002 +#define SWIG_VERSION SWIGVERSION + +#define SWIG_as_voidptr(a) const_cast(static_cast(a)) +#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a), reinterpret_cast(a)) + +#include + +namespace swig { +class SwigPtr_PyObject { + protected: + PyObject* _obj; + + public: + SwigPtr_PyObject() : _obj(0) + { + } + + SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj) + { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + Py_XINCREF(_obj); + SWIG_PYTHON_THREAD_END_BLOCK; + } + + SwigPtr_PyObject(PyObject* obj, bool initial_ref = true) : _obj(obj) + { + if (initial_ref) { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + Py_XINCREF(_obj); + SWIG_PYTHON_THREAD_END_BLOCK; + } + } + + SwigPtr_PyObject& operator=(const SwigPtr_PyObject& item) + { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + Py_XINCREF(item._obj); + Py_XDECREF(_obj); + _obj = item._obj; + SWIG_PYTHON_THREAD_END_BLOCK; + return *this; + } + + ~SwigPtr_PyObject() + { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + Py_XDECREF(_obj); + SWIG_PYTHON_THREAD_END_BLOCK; + } + + operator PyObject*() const + { + return _obj; + } + + PyObject* operator->() const + { + return _obj; + } +}; +} // namespace swig + +namespace swig { +struct SwigVar_PyObject : SwigPtr_PyObject { + SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) + { + } + + SwigVar_PyObject& operator=(PyObject* obj) + { + Py_XDECREF(_obj); + _obj = obj; + return *this; + } +}; +} // namespace swig + +#include // Use the C99 official header + +SWIGINTERNINLINE PyObject* SWIG_From_int(int value) +{ + return PyInt_FromLong((long)value); +} + +#include "ZeroTierSockets.h" + +#include +#if ! defined(SWIG_NO_LLONG_MAX) +#if ! defined(LLONG_MAX) && defined(__GNUC__) && defined(__LONG_LONG_MAX__) +#define LLONG_MAX __LONG_LONG_MAX__ +#define LLONG_MIN (-LLONG_MAX - 1LL) +#define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) +#endif +#endif + +SWIGINTERN int SWIG_AsVal_double(PyObject* obj, double* val) +{ + int res = SWIG_TypeError; + if (PyFloat_Check(obj)) { + if (val) + *val = PyFloat_AsDouble(obj); + return SWIG_OK; +#if PY_VERSION_HEX < 0x03000000 + } + else if (PyInt_Check(obj)) { + if (val) + *val = (double)PyInt_AsLong(obj); + return SWIG_OK; +#endif + } + else if (PyLong_Check(obj)) { + double v = PyLong_AsDouble(obj); + if (! PyErr_Occurred()) { + if (val) + *val = v; + return SWIG_OK; + } + else { + PyErr_Clear(); + } + } +#ifdef SWIG_PYTHON_CAST_MODE + { + int dispatch = 0; + double d = PyFloat_AsDouble(obj); + if (! PyErr_Occurred()) { + if (val) + *val = d; + return SWIG_AddCast(SWIG_OK); + } + else { + PyErr_Clear(); + } + if (! dispatch) { + long v = PyLong_AsLong(obj); + if (! PyErr_Occurred()) { + if (val) + *val = v; + return SWIG_AddCast(SWIG_AddCast(SWIG_OK)); + } + else { + PyErr_Clear(); + } + } + } +#endif + return res; +} + +#include +#include + +SWIGINTERNINLINE int SWIG_CanCastAsInteger(double* d, double min, double max) +{ + double x = *d; + if ((min <= x && x <= max)) { + double fx = floor(x); + double cx = ceil(x); + double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */ + if ((errno == EDOM) || (errno == ERANGE)) { + errno = 0; + } + else { + double summ, reps, diff; + if (rd < x) { + diff = x - rd; + } + else if (rd > x) { + diff = rd - x; + } + else { + return 1; + } + summ = rd + x; + reps = diff / summ; + if (reps < 8 * DBL_EPSILON) { + *d = rd; + return 1; + } + } + } + return 0; +} + +SWIGINTERN int SWIG_AsVal_long(PyObject* obj, long* val) +{ +#if PY_VERSION_HEX < 0x03000000 + if (PyInt_Check(obj)) { + if (val) + *val = PyInt_AsLong(obj); + return SWIG_OK; + } + else +#endif + if (PyLong_Check(obj)) { + long v = PyLong_AsLong(obj); + if (! PyErr_Occurred()) { + if (val) + *val = v; + return SWIG_OK; + } + else { + PyErr_Clear(); + return SWIG_OverflowError; + } + } +#ifdef SWIG_PYTHON_CAST_MODE + { + int dispatch = 0; + long v = PyInt_AsLong(obj); + if (! PyErr_Occurred()) { + if (val) + *val = v; + return SWIG_AddCast(SWIG_OK); + } + else { + PyErr_Clear(); + } + if (! dispatch) { + double d; + int res = SWIG_AddCast(SWIG_AsVal_double(obj, &d)); + if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { + if (val) + *val = (long)(d); + return res; + } + } + } +#endif + return SWIG_TypeError; +} + +SWIGINTERN int SWIG_AsVal_int(PyObject* obj, int* val) +{ + long v; + int res = SWIG_AsVal_long(obj, &v); + if (SWIG_IsOK(res)) { + if ((v < INT_MIN || v > INT_MAX)) { + return SWIG_OverflowError; + } + else { + if (val) + *val = static_cast(v); + } + } + return res; +} + +SWIGINTERNINLINE PyObject* SWIG_From_unsigned_SS_int(unsigned int value) +{ + return PyInt_FromSize_t((size_t)value); +} + +#define SWIG_From_long PyInt_FromLong + +SWIGINTERNINLINE PyObject* SWIG_From_unsigned_SS_long(unsigned long value) +{ + return (value > LONG_MAX) ? PyLong_FromUnsignedLong(value) : PyInt_FromLong(static_cast(value)); +} + +SWIGINTERN int SWIG_AsVal_unsigned_SS_long(PyObject* obj, unsigned long* val) +{ +#if PY_VERSION_HEX < 0x03000000 + if (PyInt_Check(obj)) { + long v = PyInt_AsLong(obj); + if (v >= 0) { + if (val) + *val = v; + return SWIG_OK; + } + else { + return SWIG_OverflowError; + } + } + else +#endif + if (PyLong_Check(obj)) { + unsigned long v = PyLong_AsUnsignedLong(obj); + if (! PyErr_Occurred()) { + if (val) + *val = v; + return SWIG_OK; + } + else { + PyErr_Clear(); + return SWIG_OverflowError; + } + } +#ifdef SWIG_PYTHON_CAST_MODE + { + int dispatch = 0; + unsigned long v = PyLong_AsUnsignedLong(obj); + if (! PyErr_Occurred()) { + if (val) + *val = v; + return SWIG_AddCast(SWIG_OK); + } + else { + PyErr_Clear(); + } + if (! dispatch) { + double d; + int res = SWIG_AddCast(SWIG_AsVal_double(obj, &d)); + if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { + if (val) + *val = (unsigned long)(d); + return res; + } + } + } +#endif + return SWIG_TypeError; +} + +#if defined(LLONG_MAX) && ! defined(SWIG_LONG_LONG_AVAILABLE) +#define SWIG_LONG_LONG_AVAILABLE +#endif + +#ifdef SWIG_LONG_LONG_AVAILABLE +SWIGINTERN int SWIG_AsVal_unsigned_SS_long_SS_long(PyObject* obj, unsigned long long* val) +{ + int res = SWIG_TypeError; + if (PyLong_Check(obj)) { + unsigned long long v = PyLong_AsUnsignedLongLong(obj); + if (! PyErr_Occurred()) { + if (val) + *val = v; + return SWIG_OK; + } + else { + PyErr_Clear(); + res = SWIG_OverflowError; + } + } + else { + unsigned long v; + res = SWIG_AsVal_unsigned_SS_long(obj, &v); + if (SWIG_IsOK(res)) { + if (val) + *val = v; + return res; + } + } +#ifdef SWIG_PYTHON_CAST_MODE + { + const double mant_max = 1LL << DBL_MANT_DIG; + double d; + res = SWIG_AsVal_double(obj, &d); + if (SWIG_IsOK(res) && ! SWIG_CanCastAsInteger(&d, 0, mant_max)) + return SWIG_OverflowError; + if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) { + if (val) + *val = (unsigned long long)(d); + return SWIG_AddCast(res); + } + res = SWIG_TypeError; + } +#endif + return res; +} +#endif + +#ifdef SWIG_LONG_LONG_AVAILABLE +SWIGINTERNINLINE PyObject* SWIG_From_unsigned_SS_long_SS_long(unsigned long long value) +{ + return (value > LONG_MAX) ? PyLong_FromUnsignedLongLong(value) : PyInt_FromLong(static_cast(value)); +} +#endif + +SWIGINTERN int SWIG_AsVal_unsigned_SS_short(PyObject* obj, unsigned short* val) +{ + unsigned long v; + int res = SWIG_AsVal_unsigned_SS_long(obj, &v); + if (SWIG_IsOK(res)) { + if ((v > USHRT_MAX)) { + return SWIG_OverflowError; + } + else { + if (val) + *val = static_cast(v); + } + } + return res; +} + +SWIGINTERNINLINE PyObject* SWIG_From_unsigned_SS_short(unsigned short value) +{ + return SWIG_From_unsigned_SS_long(value); +} + +SWIGINTERN int SWIG_AsVal_unsigned_SS_char(PyObject* obj, unsigned char* val) +{ + unsigned long v; + int res = SWIG_AsVal_unsigned_SS_long(obj, &v); + if (SWIG_IsOK(res)) { + if ((v > UCHAR_MAX)) { + return SWIG_OverflowError; + } + else { + if (val) + *val = static_cast(v); + } + } + return res; +} + +SWIGINTERNINLINE PyObject* SWIG_From_unsigned_SS_char(unsigned char value) +{ + return SWIG_From_unsigned_SS_long(value); +} + +SWIGINTERN swig_type_info* SWIG_pchar_descriptor(void) +{ + static int init = 0; + static swig_type_info* info = 0; + if (! init) { + info = SWIG_TypeQuery("_p_char"); + init = 1; + } + return info; +} + +SWIGINTERN int SWIG_AsCharPtrAndSize(PyObject* obj, char** cptr, size_t* psize, int* alloc) +{ +#if PY_VERSION_HEX >= 0x03000000 +#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) + if (PyBytes_Check(obj)) +#else + if (PyUnicode_Check(obj)) +#endif +#else + if (PyString_Check(obj)) +#endif + { + char* cstr; + Py_ssize_t len; + int ret = SWIG_OK; +#if PY_VERSION_HEX >= 0x03000000 +#if ! defined(SWIG_PYTHON_STRICT_BYTE_CHAR) + if (! alloc && cptr) { + /* We can't allow converting without allocation, since the internal + representation of string in Python 3 is UCS-2/UCS-4 but we require + a UTF-8 representation. + TODO(bhy) More detailed explanation */ + return SWIG_RuntimeError; + } + obj = PyUnicode_AsUTF8String(obj); + if (! obj) + return SWIG_TypeError; + if (alloc) + *alloc = SWIG_NEWOBJ; +#endif + if (PyBytes_AsStringAndSize(obj, &cstr, &len) == -1) + return SWIG_TypeError; +#else + if (PyString_AsStringAndSize(obj, &cstr, &len) == -1) + return SWIG_TypeError; +#endif + if (cptr) { + if (alloc) { + if (*alloc == SWIG_NEWOBJ) { + *cptr = reinterpret_cast(memcpy(new char[len + 1], cstr, sizeof(char) * (len + 1))); + *alloc = SWIG_NEWOBJ; + } + else { + *cptr = cstr; + *alloc = SWIG_OLDOBJ; + } + } + else { +#if PY_VERSION_HEX >= 0x03000000 +#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) + *cptr = PyBytes_AsString(obj); +#else + assert(0); /* Should never reach here with Unicode strings in Python 3 */ +#endif +#else + *cptr = SWIG_Python_str_AsChar(obj); + if (! *cptr) + ret = SWIG_TypeError; +#endif + } + } + if (psize) + *psize = len + 1; +#if PY_VERSION_HEX >= 0x03000000 && ! defined(SWIG_PYTHON_STRICT_BYTE_CHAR) + Py_XDECREF(obj); +#endif + return ret; + } + else { +#if defined(SWIG_PYTHON_2_UNICODE) +#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) +#error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once" +#endif +#if PY_VERSION_HEX < 0x03000000 + if (PyUnicode_Check(obj)) { + char* cstr; + Py_ssize_t len; + if (! alloc && cptr) { + return SWIG_RuntimeError; + } + obj = PyUnicode_AsUTF8String(obj); + if (! obj) + return SWIG_TypeError; + if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) { + if (cptr) { + if (alloc) + *alloc = SWIG_NEWOBJ; + *cptr = reinterpret_cast(memcpy(new char[len + 1], cstr, sizeof(char) * (len + 1))); + } + if (psize) + *psize = len + 1; + + Py_XDECREF(obj); + return SWIG_OK; + } + else { + Py_XDECREF(obj); + } + } +#endif +#endif + + swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); + if (pchar_descriptor) { + void* vptr = 0; + if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { + if (cptr) + *cptr = (char*)vptr; + if (psize) + *psize = vptr ? (strlen((char*)vptr) + 1) : 0; + if (alloc) + *alloc = SWIG_OLDOBJ; + return SWIG_OK; + } + } + } + return SWIG_TypeError; +} + +SWIGINTERN int SWIG_AsCharArray(PyObject* obj, char* val, size_t size) +{ + char* cptr = 0; + size_t csize = 0; + int alloc = SWIG_OLDOBJ; + int res = SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc); + if (SWIG_IsOK(res)) { + /* special case of single char conversion when we don't need space for NUL */ + if (size == 1 && csize == 2 && cptr && ! cptr[1]) + --csize; + if (csize <= size) { + if (val) { + if (csize) + memcpy(val, cptr, csize * sizeof(char)); + if (csize < size) + memset(val + csize, 0, (size - csize) * sizeof(char)); + } + if (alloc == SWIG_NEWOBJ) { + delete[] cptr; + res = SWIG_DelNewMask(res); + } + return res; + } + if (alloc == SWIG_NEWOBJ) + delete[] cptr; + } + return SWIG_TypeError; +} + +SWIGINTERNINLINE PyObject* SWIG_FromCharPtrAndSize(const char* carray, size_t size) +{ + if (carray) { + if (size > INT_MAX) { + swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); + return pchar_descriptor ? SWIG_InternalNewPointerObj(const_cast(carray), pchar_descriptor, 0) + : SWIG_Py_Void(); + } + else { +#if PY_VERSION_HEX >= 0x03000000 +#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) + return PyBytes_FromStringAndSize(carray, static_cast(size)); +#else + return PyUnicode_DecodeUTF8(carray, static_cast(size), "surrogateescape"); +#endif +#else + return PyString_FromStringAndSize(carray, static_cast(size)); +#endif + } + } + else { + return SWIG_Py_Void(); + } +} + +SWIGINTERN size_t SWIG_strnlen(const char* s, size_t maxlen) +{ + const char* p; + for (p = s; maxlen-- && *p; p++) + ; + return p - s; +} + +SWIGINTERN int SWIG_AsVal_unsigned_SS_int(PyObject* obj, unsigned int* val) +{ + unsigned long v; + int res = SWIG_AsVal_unsigned_SS_long(obj, &v); + if (SWIG_IsOK(res)) { + if ((v > UINT_MAX)) { + return SWIG_OverflowError; + } + else { + if (val) + *val = static_cast(v); + } + } + return res; +} + +/* Getting isfinite working pre C99 across multiple platforms is non-trivial. Users can provide SWIG_isfinite on older + * platforms. */ +#ifndef SWIG_isfinite +/* isfinite() is a macro for C99 */ +#if defined(isfinite) +#define SWIG_isfinite(X) (isfinite(X)) +#elif defined(__cplusplus) && __cplusplus >= 201103L +/* Use a template so that this works whether isfinite() is std::isfinite() or + * in the global namespace. The reality seems to vary between compiler + * versions. + * + * Make sure namespace std exists to avoid compiler warnings. + * + * extern "C++" is required as this fragment can end up inside an extern "C" { } block + */ +namespace std { +} +extern "C++" template inline int SWIG_isfinite_func(T x) +{ + using namespace std; + return isfinite(x); +} +#define SWIG_isfinite(X) (SWIG_isfinite_func(X)) +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) +#define SWIG_isfinite(X) (__builtin_isfinite(X)) +#elif defined(__clang__) && defined(__has_builtin) +#if __has_builtin(__builtin_isfinite) +#define SWIG_isfinite(X) (__builtin_isfinite(X)) +#endif +#elif defined(_MSC_VER) +#define SWIG_isfinite(X) (_finite(X)) +#elif defined(__sun) && defined(__SVR4) +#include +#define SWIG_isfinite(X) (finite(X)) +#endif +#endif + +/* Accept infinite as a valid float value unless we are unable to check if a value is finite */ +#ifdef SWIG_isfinite +#define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX) && SWIG_isfinite(X)) +#else +#define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX)) +#endif + +SWIGINTERN int SWIG_AsVal_float(PyObject* obj, float* val) +{ + double v; + int res = SWIG_AsVal_double(obj, &v); + if (SWIG_IsOK(res)) { + if (SWIG_Float_Overflow_Check(v)) { + return SWIG_OverflowError; + } + else { + if (val) + *val = static_cast(v); + } + } + return res; +} + +#define SWIG_From_double PyFloat_FromDouble + +SWIGINTERNINLINE PyObject* SWIG_From_float(float value) +{ + return SWIG_From_double(value); +} + +SWIGINTERNINLINE PyObject* SWIG_FromCharPtr(const char* cptr) +{ + return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); +} + +SWIGINTERN int SWIG_AsVal_short(PyObject* obj, short* val) +{ + long v; + int res = SWIG_AsVal_long(obj, &v); + if (SWIG_IsOK(res)) { + if ((v < SHRT_MIN || v > SHRT_MAX)) { + return SWIG_OverflowError; + } + else { + if (val) + *val = static_cast(v); + } + } + return res; +} + +SWIGINTERNINLINE PyObject* SWIG_From_short(short value) +{ + return SWIG_From_long(value); +} + +SWIGINTERNINLINE int SWIG_AsVal_size_t(PyObject* obj, size_t* val) +{ + int res = SWIG_TypeError; +#ifdef SWIG_LONG_LONG_AVAILABLE + if (sizeof(size_t) <= sizeof(unsigned long)) { +#endif + unsigned long v; + res = SWIG_AsVal_unsigned_SS_long(obj, val ? &v : 0); + if (SWIG_IsOK(res) && val) + *val = static_cast(v); +#ifdef SWIG_LONG_LONG_AVAILABLE + } + else if (sizeof(size_t) <= sizeof(unsigned long long)) { + unsigned long long v; + res = SWIG_AsVal_unsigned_SS_long_SS_long(obj, val ? &v : 0); + if (SWIG_IsOK(res) && val) + *val = static_cast(v); + } +#endif + return res; +} + +SWIGINTERNINLINE PyObject* SWIG_From_size_t(size_t value) +{ +#ifdef SWIG_LONG_LONG_AVAILABLE + if (sizeof(size_t) <= sizeof(unsigned long)) { +#endif + return SWIG_From_unsigned_SS_long(static_cast(value)); +#ifdef SWIG_LONG_LONG_AVAILABLE + } + else { + /* assume sizeof(size_t) <= sizeof(unsigned long long) */ + return SWIG_From_unsigned_SS_long_SS_long(static_cast(value)); + } +#endif +} + +/* --------------------------------------------------- + * C++ director class methods + * --------------------------------------------------- */ + +#include "zt_wrap.h" + +SwigDirector_PythonDirectorCallbackClass::SwigDirector_PythonDirectorCallbackClass(PyObject* self) + : PythonDirectorCallbackClass() + , Swig::Director(self) +{ + SWIG_DIRECTOR_RGTR((PythonDirectorCallbackClass*)this, this); +} + +void SwigDirector_PythonDirectorCallbackClass::on_zerotier_event(zts_event_msg_t* msg) +{ + swig::SwigVar_PyObject obj0; + obj0 = SWIG_NewPointerObj(SWIG_as_voidptr(msg), SWIGTYPE_p_zts_event_msg_t, 0); + if (! swig_get_self()) { + Swig::DirectorException::raise( + "'self' uninitialized, maybe you forgot to call PythonDirectorCallbackClass.__init__."); + } +#if defined(SWIG_PYTHON_DIRECTOR_VTABLE) + const size_t swig_method_index = 0; + const char* const swig_method_name = "on_zerotier_event"; + PyObject* method = swig_get_method(swig_method_index, swig_method_name); + swig::SwigVar_PyObject result = PyObject_CallFunctionObjArgs(method, (PyObject*)obj0, NULL); +#else + swig::SwigVar_PyObject swig_method_name = SWIG_Python_str_FromChar("on_zerotier_event"); + swig::SwigVar_PyObject result = + PyObject_CallMethodObjArgs(swig_get_self(), (PyObject*)swig_method_name, (PyObject*)obj0, NULL); +#endif + if (! result) { + PyObject* error = PyErr_Occurred(); + if (error) { + Swig::DirectorMethodException::raise( + "Error detected when calling 'PythonDirectorCallbackClass.on_zerotier_event'"); + } + } +} + +SwigDirector_PythonDirectorCallbackClass::~SwigDirector_PythonDirectorCallbackClass() +{ +} + +#ifdef __cplusplus +extern "C" { +#endif +SWIGINTERN int Swig_var_zts_errno_set(PyObject* _val) +{ + { + int val; + int res = SWIG_AsVal_int(_val, &val); + if (! SWIG_IsOK(res)) { + SWIG_exception_fail( + SWIG_ArgError(res), + "in variable '" + "zts_errno" + "' of type '" + "int" + "'"); + } + zts_errno = static_cast(val); + } + return 0; +fail: + return 1; +} + +SWIGINTERN PyObject* Swig_var_zts_errno_get(void) +{ + PyObject* pyobj = 0; + + pyobj = SWIG_From_int(static_cast(zts_errno)); + return pyobj; +} + +SWIGINTERN PyObject* _wrap_zts_node_info_t_node_id_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_node_info_t* arg1 = (zts_node_info_t*)0; + uint64_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned long long val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_node_info_t_node_id_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_node_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_node_info_t_node_id_set" + "', argument " + "1" + " of type '" + "zts_node_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_node_info_t_node_id_set" + "', argument " + "2" + " of type '" + "uint64_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->node_id = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_node_info_t_node_id_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_node_info_t* arg1 = (zts_node_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint64_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_node_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_node_info_t_node_id_get" + "', argument " + "1" + " of type '" + "zts_node_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint64_t)((arg1)->node_id); + resultobj = SWIG_From_unsigned_SS_long_SS_long(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_node_info_t_port_primary_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_node_info_t* arg1 = (zts_node_info_t*)0; + uint16_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned short val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_node_info_t_port_primary_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_node_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_node_info_t_port_primary_set" + "', argument " + "1" + " of type '" + "zts_node_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_short(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_node_info_t_port_primary_set" + "', argument " + "2" + " of type '" + "uint16_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->port_primary = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_node_info_t_port_primary_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_node_info_t* arg1 = (zts_node_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint16_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_node_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_node_info_t_port_primary_get" + "', argument " + "1" + " of type '" + "zts_node_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint16_t)((arg1)->port_primary); + resultobj = SWIG_From_unsigned_SS_short(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_node_info_t_port_secondary_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_node_info_t* arg1 = (zts_node_info_t*)0; + uint16_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned short val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_node_info_t_port_secondary_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_node_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_node_info_t_port_secondary_set" + "', argument " + "1" + " of type '" + "zts_node_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_short(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_node_info_t_port_secondary_set" + "', argument " + "2" + " of type '" + "uint16_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->port_secondary = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_node_info_t_port_secondary_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_node_info_t* arg1 = (zts_node_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint16_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_node_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_node_info_t_port_secondary_get" + "', argument " + "1" + " of type '" + "zts_node_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint16_t)((arg1)->port_secondary); + resultobj = SWIG_From_unsigned_SS_short(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_node_info_t_port_tertiary_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_node_info_t* arg1 = (zts_node_info_t*)0; + uint16_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned short val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_node_info_t_port_tertiary_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_node_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_node_info_t_port_tertiary_set" + "', argument " + "1" + " of type '" + "zts_node_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_short(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_node_info_t_port_tertiary_set" + "', argument " + "2" + " of type '" + "uint16_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->port_tertiary = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_node_info_t_port_tertiary_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_node_info_t* arg1 = (zts_node_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint16_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_node_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_node_info_t_port_tertiary_get" + "', argument " + "1" + " of type '" + "zts_node_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint16_t)((arg1)->port_tertiary); + resultobj = SWIG_From_unsigned_SS_short(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_node_info_t_ver_major_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_node_info_t* arg1 = (zts_node_info_t*)0; + uint8_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned char val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_node_info_t_ver_major_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_node_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_node_info_t_ver_major_set" + "', argument " + "1" + " of type '" + "zts_node_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_char(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_node_info_t_ver_major_set" + "', argument " + "2" + " of type '" + "uint8_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->ver_major = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_node_info_t_ver_major_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_node_info_t* arg1 = (zts_node_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint8_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_node_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_node_info_t_ver_major_get" + "', argument " + "1" + " of type '" + "zts_node_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint8_t)((arg1)->ver_major); + resultobj = SWIG_From_unsigned_SS_char(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_node_info_t_ver_minor_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_node_info_t* arg1 = (zts_node_info_t*)0; + uint8_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned char val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_node_info_t_ver_minor_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_node_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_node_info_t_ver_minor_set" + "', argument " + "1" + " of type '" + "zts_node_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_char(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_node_info_t_ver_minor_set" + "', argument " + "2" + " of type '" + "uint8_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->ver_minor = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_node_info_t_ver_minor_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_node_info_t* arg1 = (zts_node_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint8_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_node_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_node_info_t_ver_minor_get" + "', argument " + "1" + " of type '" + "zts_node_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint8_t)((arg1)->ver_minor); + resultobj = SWIG_From_unsigned_SS_char(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_node_info_t_ver_rev_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_node_info_t* arg1 = (zts_node_info_t*)0; + uint8_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned char val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_node_info_t_ver_rev_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_node_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_node_info_t_ver_rev_set" + "', argument " + "1" + " of type '" + "zts_node_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_char(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_node_info_t_ver_rev_set" + "', argument " + "2" + " of type '" + "uint8_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->ver_rev = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_node_info_t_ver_rev_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_node_info_t* arg1 = (zts_node_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint8_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_node_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_node_info_t_ver_rev_get" + "', argument " + "1" + " of type '" + "zts_node_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint8_t)((arg1)->ver_rev); + resultobj = SWIG_From_unsigned_SS_char(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_new_zts_node_info_t(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_node_info_t* result = 0; + + if (! SWIG_Python_UnpackTuple(args, "new_zts_node_info_t", 0, 0, 0)) + SWIG_fail; + result = (zts_node_info_t*)new zts_node_info_t(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_node_info_t, SWIG_POINTER_NEW | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_delete_zts_node_info_t(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_node_info_t* arg1 = (zts_node_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_node_info_t, SWIG_POINTER_DISOWN | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "delete_zts_node_info_t" + "', argument " + "1" + " of type '" + "zts_node_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* zts_node_info_t_swigregister(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* obj; + if (! SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) + return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_zts_node_info_t, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* zts_node_info_t_swiginit(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + return SWIG_Python_InitShadowInstance(args); +} + +SWIGINTERN PyObject* _wrap_zts_addr_info_t_net_id_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_addr_info_t* arg1 = (zts_addr_info_t*)0; + uint64_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned long long val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_addr_info_t_net_id_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_addr_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_addr_info_t_net_id_set" + "', argument " + "1" + " of type '" + "zts_addr_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_addr_info_t_net_id_set" + "', argument " + "2" + " of type '" + "uint64_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->net_id = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_addr_info_t_net_id_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_addr_info_t* arg1 = (zts_addr_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint64_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_addr_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_addr_info_t_net_id_get" + "', argument " + "1" + " of type '" + "zts_addr_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint64_t)((arg1)->net_id); + resultobj = SWIG_From_unsigned_SS_long_SS_long(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_addr_info_t_addr_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_addr_info_t* arg1 = (zts_addr_info_t*)0; + zts_sockaddr_storage* arg2 = (zts_sockaddr_storage*)0; + void* argp1 = 0; + int res1 = 0; + void* argp2 = 0; + int res2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_addr_info_t_addr_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_addr_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_addr_info_t_addr_set" + "', argument " + "1" + " of type '" + "zts_addr_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_sockaddr_storage, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_addr_info_t_addr_set" + "', argument " + "2" + " of type '" + "zts_sockaddr_storage *" + "'"); + } + arg2 = reinterpret_cast(argp2); + if (arg1) + (arg1)->addr = *arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_addr_info_t_addr_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_addr_info_t* arg1 = (zts_addr_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + zts_sockaddr_storage* result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_addr_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_addr_info_t_addr_get" + "', argument " + "1" + " of type '" + "zts_addr_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (zts_sockaddr_storage*)&((arg1)->addr); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_sockaddr_storage, 0 | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_new_zts_addr_info_t(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_addr_info_t* result = 0; + + if (! SWIG_Python_UnpackTuple(args, "new_zts_addr_info_t", 0, 0, 0)) + SWIG_fail; + result = (zts_addr_info_t*)new zts_addr_info_t(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_addr_info_t, SWIG_POINTER_NEW | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_delete_zts_addr_info_t(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_addr_info_t* arg1 = (zts_addr_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_addr_info_t, SWIG_POINTER_DISOWN | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "delete_zts_addr_info_t" + "', argument " + "1" + " of type '" + "zts_addr_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* zts_addr_info_t_swigregister(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* obj; + if (! SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) + return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_zts_addr_info_t, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* zts_addr_info_t_swiginit(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + return SWIG_Python_InitShadowInstance(args); +} + +SWIGINTERN PyObject* _wrap_zts_route_info_t_target_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_route_info_t* arg1 = (zts_route_info_t*)0; + zts_sockaddr_storage* arg2 = (zts_sockaddr_storage*)0; + void* argp1 = 0; + int res1 = 0; + void* argp2 = 0; + int res2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_route_info_t_target_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_route_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_route_info_t_target_set" + "', argument " + "1" + " of type '" + "zts_route_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_sockaddr_storage, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_route_info_t_target_set" + "', argument " + "2" + " of type '" + "zts_sockaddr_storage *" + "'"); + } + arg2 = reinterpret_cast(argp2); + if (arg1) + (arg1)->target = *arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_route_info_t_target_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_route_info_t* arg1 = (zts_route_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + zts_sockaddr_storage* result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_route_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_route_info_t_target_get" + "', argument " + "1" + " of type '" + "zts_route_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (zts_sockaddr_storage*)&((arg1)->target); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_sockaddr_storage, 0 | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_route_info_t_via_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_route_info_t* arg1 = (zts_route_info_t*)0; + zts_sockaddr_storage* arg2 = (zts_sockaddr_storage*)0; + void* argp1 = 0; + int res1 = 0; + void* argp2 = 0; + int res2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_route_info_t_via_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_route_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_route_info_t_via_set" + "', argument " + "1" + " of type '" + "zts_route_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_sockaddr_storage, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_route_info_t_via_set" + "', argument " + "2" + " of type '" + "zts_sockaddr_storage *" + "'"); + } + arg2 = reinterpret_cast(argp2); + if (arg1) + (arg1)->via = *arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_route_info_t_via_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_route_info_t* arg1 = (zts_route_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + zts_sockaddr_storage* result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_route_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_route_info_t_via_get" + "', argument " + "1" + " of type '" + "zts_route_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (zts_sockaddr_storage*)&((arg1)->via); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_sockaddr_storage, 0 | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_route_info_t_flags_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_route_info_t* arg1 = (zts_route_info_t*)0; + uint16_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned short val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_route_info_t_flags_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_route_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_route_info_t_flags_set" + "', argument " + "1" + " of type '" + "zts_route_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_short(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_route_info_t_flags_set" + "', argument " + "2" + " of type '" + "uint16_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->flags = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_route_info_t_flags_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_route_info_t* arg1 = (zts_route_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint16_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_route_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_route_info_t_flags_get" + "', argument " + "1" + " of type '" + "zts_route_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint16_t)((arg1)->flags); + resultobj = SWIG_From_unsigned_SS_short(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_route_info_t_metric_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_route_info_t* arg1 = (zts_route_info_t*)0; + uint16_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned short val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_route_info_t_metric_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_route_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_route_info_t_metric_set" + "', argument " + "1" + " of type '" + "zts_route_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_short(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_route_info_t_metric_set" + "', argument " + "2" + " of type '" + "uint16_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->metric = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_route_info_t_metric_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_route_info_t* arg1 = (zts_route_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint16_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_route_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_route_info_t_metric_get" + "', argument " + "1" + " of type '" + "zts_route_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint16_t)((arg1)->metric); + resultobj = SWIG_From_unsigned_SS_short(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_new_zts_route_info_t(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_route_info_t* result = 0; + + if (! SWIG_Python_UnpackTuple(args, "new_zts_route_info_t", 0, 0, 0)) + SWIG_fail; + result = (zts_route_info_t*)new zts_route_info_t(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_route_info_t, SWIG_POINTER_NEW | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_delete_zts_route_info_t(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_route_info_t* arg1 = (zts_route_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_route_info_t, SWIG_POINTER_DISOWN | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "delete_zts_route_info_t" + "', argument " + "1" + " of type '" + "zts_route_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* zts_route_info_t_swigregister(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* obj; + if (! SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) + return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_zts_route_info_t, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* zts_route_info_t_swiginit(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + return SWIG_Python_InitShadowInstance(args); +} + +SWIGINTERN PyObject* _wrap_zts_multicast_group_t_mac_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_multicast_group_t* arg1 = (zts_multicast_group_t*)0; + uint64_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned long long val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_multicast_group_t_mac_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_multicast_group_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_multicast_group_t_mac_set" + "', argument " + "1" + " of type '" + "zts_multicast_group_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_multicast_group_t_mac_set" + "', argument " + "2" + " of type '" + "uint64_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->mac = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_multicast_group_t_mac_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_multicast_group_t* arg1 = (zts_multicast_group_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint64_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_multicast_group_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_multicast_group_t_mac_get" + "', argument " + "1" + " of type '" + "zts_multicast_group_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint64_t)((arg1)->mac); + resultobj = SWIG_From_unsigned_SS_long_SS_long(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_multicast_group_t_adi_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_multicast_group_t* arg1 = (zts_multicast_group_t*)0; + unsigned long arg2; + void* argp1 = 0; + int res1 = 0; + unsigned long val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_multicast_group_t_adi_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_multicast_group_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_multicast_group_t_adi_set" + "', argument " + "1" + " of type '" + "zts_multicast_group_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_long(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_multicast_group_t_adi_set" + "', argument " + "2" + " of type '" + "unsigned long" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->adi = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_multicast_group_t_adi_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_multicast_group_t* arg1 = (zts_multicast_group_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + unsigned long result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_multicast_group_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_multicast_group_t_adi_get" + "', argument " + "1" + " of type '" + "zts_multicast_group_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (unsigned long)((arg1)->adi); + resultobj = SWIG_From_unsigned_SS_long(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_new_zts_multicast_group_t(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_multicast_group_t* result = 0; + + if (! SWIG_Python_UnpackTuple(args, "new_zts_multicast_group_t", 0, 0, 0)) + SWIG_fail; + result = (zts_multicast_group_t*)new zts_multicast_group_t(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_multicast_group_t, SWIG_POINTER_NEW | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_delete_zts_multicast_group_t(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_multicast_group_t* arg1 = (zts_multicast_group_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_multicast_group_t, SWIG_POINTER_DISOWN | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "delete_zts_multicast_group_t" + "', argument " + "1" + " of type '" + "zts_multicast_group_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* zts_multicast_group_t_swigregister(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* obj; + if (! SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) + return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_zts_multicast_group_t, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* zts_multicast_group_t_swiginit(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + return SWIG_Python_InitShadowInstance(args); +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_net_id_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + uint64_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned long long val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_net_info_t_net_id_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_net_id_set" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_net_info_t_net_id_set" + "', argument " + "2" + " of type '" + "uint64_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->net_id = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_net_id_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint64_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_net_id_get" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint64_t)((arg1)->net_id); + resultobj = SWIG_From_unsigned_SS_long_SS_long(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_mac_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + uint64_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned long long val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_net_info_t_mac_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_mac_set" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_net_info_t_mac_set" + "', argument " + "2" + " of type '" + "uint64_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->mac = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_mac_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint64_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_mac_get" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint64_t)((arg1)->mac); + resultobj = SWIG_From_unsigned_SS_long_SS_long(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_name_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + char* arg2; + void* argp1 = 0; + int res1 = 0; + char temp2[127 + 1]; + int res2; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_net_info_t_name_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_name_set" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + res2 = SWIG_AsCharArray(swig_obj[1], temp2, 127 + 1); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_net_info_t_name_set" + "', argument " + "2" + " of type '" + "char [127+1]" + "'"); + } + arg2 = reinterpret_cast(temp2); + if (arg2) + memcpy(arg1->name, arg2, 127 + 1 * sizeof(char)); + else + memset(arg1->name, 0, 127 + 1 * sizeof(char)); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_name_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + char* result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_name_get" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (char*)(char*)((arg1)->name); + { + size_t size = SWIG_strnlen(result, 127 + 1); + + resultobj = SWIG_FromCharPtrAndSize(result, size); + } + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_status_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + zts_network_status_t arg2; + void* argp1 = 0; + int res1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_net_info_t_status_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_status_set" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_net_info_t_status_set" + "', argument " + "2" + " of type '" + "zts_network_status_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->status = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_status_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + zts_network_status_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_status_get" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (zts_network_status_t)((arg1)->status); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_type_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + zts_net_info_type_t arg2; + void* argp1 = 0; + int res1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_net_info_t_type_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_type_set" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_net_info_t_type_set" + "', argument " + "2" + " of type '" + "zts_net_info_type_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->type = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_type_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + zts_net_info_type_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_type_get" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (zts_net_info_type_t)((arg1)->type); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_mtu_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + unsigned int arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_net_info_t_mtu_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_mtu_set" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_net_info_t_mtu_set" + "', argument " + "2" + " of type '" + "unsigned int" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->mtu = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_mtu_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + unsigned int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_mtu_get" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (unsigned int)((arg1)->mtu); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_dhcp_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + int arg2; + void* argp1 = 0; + int res1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_net_info_t_dhcp_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_dhcp_set" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_net_info_t_dhcp_set" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->dhcp = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_dhcp_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_dhcp_get" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (int)((arg1)->dhcp); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_bridge_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + int arg2; + void* argp1 = 0; + int res1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_net_info_t_bridge_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_bridge_set" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_net_info_t_bridge_set" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->bridge = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_bridge_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_bridge_get" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (int)((arg1)->bridge); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_broadcast_enabled_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + int arg2; + void* argp1 = 0; + int res1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_net_info_t_broadcast_enabled_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_broadcast_enabled_set" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_net_info_t_broadcast_enabled_set" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->broadcast_enabled = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_broadcast_enabled_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_broadcast_enabled_get" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (int)((arg1)->broadcast_enabled); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_port_error_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + int arg2; + void* argp1 = 0; + int res1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_net_info_t_port_error_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_port_error_set" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_net_info_t_port_error_set" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->port_error = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_port_error_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_port_error_get" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (int)((arg1)->port_error); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_netconf_rev_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + unsigned long arg2; + void* argp1 = 0; + int res1 = 0; + unsigned long val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_net_info_t_netconf_rev_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_netconf_rev_set" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_long(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_net_info_t_netconf_rev_set" + "', argument " + "2" + " of type '" + "unsigned long" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->netconf_rev = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_netconf_rev_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + unsigned long result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_netconf_rev_get" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (unsigned long)((arg1)->netconf_rev); + resultobj = SWIG_From_unsigned_SS_long(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_assigned_addr_count_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + unsigned int arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_net_info_t_assigned_addr_count_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_assigned_addr_count_set" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_net_info_t_assigned_addr_count_set" + "', argument " + "2" + " of type '" + "unsigned int" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->assigned_addr_count = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_assigned_addr_count_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + unsigned int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_assigned_addr_count_get" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (unsigned int)((arg1)->assigned_addr_count); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_assigned_addrs_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + zts_sockaddr_storage* arg2; + void* argp1 = 0; + int res1 = 0; + void* argp2 = 0; + int res2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_net_info_t_assigned_addrs_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_assigned_addrs_set" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_sockaddr_storage, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_net_info_t_assigned_addrs_set" + "', argument " + "2" + " of type '" + "zts_sockaddr_storage [16]" + "'"); + } + arg2 = reinterpret_cast(argp2); + { + if (arg2) { + size_t ii = 0; + for (; ii < (size_t)16; ++ii) + *(zts_sockaddr_storage*)&arg1->assigned_addrs[ii] = *((zts_sockaddr_storage*)arg2 + ii); + } + else { + SWIG_exception_fail( + SWIG_ValueError, + "invalid null reference " + "in variable '" + "assigned_addrs" + "' of type '" + "zts_sockaddr_storage [16]" + "'"); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_assigned_addrs_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + zts_sockaddr_storage* result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_assigned_addrs_get" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (zts_sockaddr_storage*)(zts_sockaddr_storage*)((arg1)->assigned_addrs); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_sockaddr_storage, 0 | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_route_count_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + unsigned int arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_net_info_t_route_count_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_route_count_set" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_net_info_t_route_count_set" + "', argument " + "2" + " of type '" + "unsigned int" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->route_count = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_route_count_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + unsigned int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_route_count_get" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (unsigned int)((arg1)->route_count); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_routes_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + zts_route_info_t* arg2; + void* argp1 = 0; + int res1 = 0; + void* argp2 = 0; + int res2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_net_info_t_routes_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_routes_set" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_route_info_t, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_net_info_t_routes_set" + "', argument " + "2" + " of type '" + "zts_route_info_t [32]" + "'"); + } + arg2 = reinterpret_cast(argp2); + { + if (arg2) { + size_t ii = 0; + for (; ii < (size_t)32; ++ii) + *(zts_route_info_t*)&arg1->routes[ii] = *((zts_route_info_t*)arg2 + ii); + } + else { + SWIG_exception_fail( + SWIG_ValueError, + "invalid null reference " + "in variable '" + "routes" + "' of type '" + "zts_route_info_t [32]" + "'"); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_routes_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + zts_route_info_t* result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_routes_get" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (zts_route_info_t*)(zts_route_info_t*)((arg1)->routes); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_route_info_t, 0 | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_multicast_sub_count_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + unsigned int arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_net_info_t_multicast_sub_count_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_multicast_sub_count_set" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_net_info_t_multicast_sub_count_set" + "', argument " + "2" + " of type '" + "unsigned int" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->multicast_sub_count = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_info_t_multicast_sub_count_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + unsigned int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_net_info_t_multicast_sub_count_get" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (unsigned int)((arg1)->multicast_sub_count); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_new_zts_net_info_t(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* result = 0; + + if (! SWIG_Python_UnpackTuple(args, "new_zts_net_info_t", 0, 0, 0)) + SWIG_fail; + result = (zts_net_info_t*)new zts_net_info_t(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_net_info_t, SWIG_POINTER_NEW | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_delete_zts_net_info_t(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_net_info_t* arg1 = (zts_net_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_net_info_t, SWIG_POINTER_DISOWN | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "delete_zts_net_info_t" + "', argument " + "1" + " of type '" + "zts_net_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* zts_net_info_t_swigregister(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* obj; + if (! SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) + return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_zts_net_info_t, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* zts_net_info_t_swiginit(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + return SWIG_Python_InitShadowInstance(args); +} + +SWIGINTERN PyObject* _wrap_zts_path_t_address_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + zts_sockaddr_storage* arg2 = (zts_sockaddr_storage*)0; + void* argp1 = 0; + int res1 = 0; + void* argp2 = 0; + int res2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_path_t_address_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_address_set" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_sockaddr_storage, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_path_t_address_set" + "', argument " + "2" + " of type '" + "zts_sockaddr_storage *" + "'"); + } + arg2 = reinterpret_cast(argp2); + if (arg1) + (arg1)->address = *arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_address_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + zts_sockaddr_storage* result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_address_get" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (zts_sockaddr_storage*)&((arg1)->address); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_sockaddr_storage, 0 | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_last_tx_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + uint64_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned long long val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_path_t_last_tx_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_last_tx_set" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_path_t_last_tx_set" + "', argument " + "2" + " of type '" + "uint64_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->last_tx = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_last_tx_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint64_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_last_tx_get" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint64_t)((arg1)->last_tx); + resultobj = SWIG_From_unsigned_SS_long_SS_long(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_last_rx_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + uint64_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned long long val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_path_t_last_rx_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_last_rx_set" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_path_t_last_rx_set" + "', argument " + "2" + " of type '" + "uint64_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->last_rx = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_last_rx_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint64_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_last_rx_get" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint64_t)((arg1)->last_rx); + resultobj = SWIG_From_unsigned_SS_long_SS_long(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_trusted_path_id_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + uint64_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned long long val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_path_t_trusted_path_id_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_trusted_path_id_set" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_path_t_trusted_path_id_set" + "', argument " + "2" + " of type '" + "uint64_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->trusted_path_id = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_trusted_path_id_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint64_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_trusted_path_id_get" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint64_t)((arg1)->trusted_path_id); + resultobj = SWIG_From_unsigned_SS_long_SS_long(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_latency_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + float arg2; + void* argp1 = 0; + int res1 = 0; + float val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_path_t_latency_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_latency_set" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_float(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_path_t_latency_set" + "', argument " + "2" + " of type '" + "float" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->latency = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_latency_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + float result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_latency_get" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (float)((arg1)->latency); + resultobj = SWIG_From_float(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_unused_0_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + float arg2; + void* argp1 = 0; + int res1 = 0; + float val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_path_t_unused_0_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_unused_0_set" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_float(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_path_t_unused_0_set" + "', argument " + "2" + " of type '" + "float" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->unused_0 = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_unused_0_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + float result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_unused_0_get" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (float)((arg1)->unused_0); + resultobj = SWIG_From_float(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_unused_1_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + float arg2; + void* argp1 = 0; + int res1 = 0; + float val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_path_t_unused_1_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_unused_1_set" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_float(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_path_t_unused_1_set" + "', argument " + "2" + " of type '" + "float" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->unused_1 = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_unused_1_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + float result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_unused_1_get" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (float)((arg1)->unused_1); + resultobj = SWIG_From_float(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_unused_2_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + float arg2; + void* argp1 = 0; + int res1 = 0; + float val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_path_t_unused_2_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_unused_2_set" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_float(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_path_t_unused_2_set" + "', argument " + "2" + " of type '" + "float" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->unused_2 = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_unused_2_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + float result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_unused_2_get" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (float)((arg1)->unused_2); + resultobj = SWIG_From_float(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_unused_3_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + float arg2; + void* argp1 = 0; + int res1 = 0; + float val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_path_t_unused_3_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_unused_3_set" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_float(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_path_t_unused_3_set" + "', argument " + "2" + " of type '" + "float" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->unused_3 = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_unused_3_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + float result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_unused_3_get" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (float)((arg1)->unused_3); + resultobj = SWIG_From_float(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_unused_4_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + float arg2; + void* argp1 = 0; + int res1 = 0; + float val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_path_t_unused_4_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_unused_4_set" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_float(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_path_t_unused_4_set" + "', argument " + "2" + " of type '" + "float" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->unused_4 = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_unused_4_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + float result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_unused_4_get" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (float)((arg1)->unused_4); + resultobj = SWIG_From_float(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_unused_5_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + uint64_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned long long val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_path_t_unused_5_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_unused_5_set" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_path_t_unused_5_set" + "', argument " + "2" + " of type '" + "uint64_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->unused_5 = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_unused_5_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint64_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_unused_5_get" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint64_t)((arg1)->unused_5); + resultobj = SWIG_From_unsigned_SS_long_SS_long(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_unused_6_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + uint64_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned long long val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_path_t_unused_6_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_unused_6_set" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_path_t_unused_6_set" + "', argument " + "2" + " of type '" + "uint64_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->unused_6 = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_unused_6_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint64_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_unused_6_get" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint64_t)((arg1)->unused_6); + resultobj = SWIG_From_unsigned_SS_long_SS_long(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_unused_7_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + float arg2; + void* argp1 = 0; + int res1 = 0; + float val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_path_t_unused_7_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_unused_7_set" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_float(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_path_t_unused_7_set" + "', argument " + "2" + " of type '" + "float" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->unused_7 = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_unused_7_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + float result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_unused_7_get" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (float)((arg1)->unused_7); + resultobj = SWIG_From_float(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_ifname_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + char* arg2 = (char*)0; + void* argp1 = 0; + int res1 = 0; + int res2; + char* buf2 = 0; + int alloc2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_path_t_ifname_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_ifname_set" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_path_t_ifname_set" + "', argument " + "2" + " of type '" + "char *" + "'"); + } + arg2 = reinterpret_cast(buf2); + if (arg1->ifname) + delete[] arg1->ifname; + if (arg2) { + size_t size = strlen(reinterpret_cast(arg2)) + 1; + arg1->ifname = (char*)reinterpret_cast( + memcpy(new char[size], reinterpret_cast(arg2), sizeof(char) * (size))); + } + else { + arg1->ifname = 0; + } + resultobj = SWIG_Py_Void(); + if (alloc2 == SWIG_NEWOBJ) + delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) + delete[] buf2; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_ifname_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + char* result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_ifname_get" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (char*)((arg1)->ifname); + resultobj = SWIG_FromCharPtr((const char*)result); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_expired_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + int arg2; + void* argp1 = 0; + int res1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_path_t_expired_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_expired_set" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_path_t_expired_set" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->expired = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_expired_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_expired_get" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (int)((arg1)->expired); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_preferred_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + int arg2; + void* argp1 = 0; + int res1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_path_t_preferred_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_preferred_set" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_path_t_preferred_set" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->preferred = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_path_t_preferred_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_path_t_preferred_get" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (int)((arg1)->preferred); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_new_zts_path_t(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* result = 0; + + if (! SWIG_Python_UnpackTuple(args, "new_zts_path_t", 0, 0, 0)) + SWIG_fail; + result = (zts_path_t*)new zts_path_t(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_path_t, SWIG_POINTER_NEW | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_delete_zts_path_t(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_path_t* arg1 = (zts_path_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_path_t, SWIG_POINTER_DISOWN | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "delete_zts_path_t" + "', argument " + "1" + " of type '" + "zts_path_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* zts_path_t_swigregister(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* obj; + if (! SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) + return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_zts_path_t, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* zts_path_t_swiginit(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + return SWIG_Python_InitShadowInstance(args); +} + +SWIGINTERN PyObject* _wrap_zts_peer_info_t_peer_id_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_peer_info_t* arg1 = (zts_peer_info_t*)0; + uint64_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned long long val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_peer_info_t_peer_id_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_peer_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_peer_info_t_peer_id_set" + "', argument " + "1" + " of type '" + "zts_peer_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_peer_info_t_peer_id_set" + "', argument " + "2" + " of type '" + "uint64_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->peer_id = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_peer_info_t_peer_id_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_peer_info_t* arg1 = (zts_peer_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint64_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_peer_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_peer_info_t_peer_id_get" + "', argument " + "1" + " of type '" + "zts_peer_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint64_t)((arg1)->peer_id); + resultobj = SWIG_From_unsigned_SS_long_SS_long(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_peer_info_t_ver_major_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_peer_info_t* arg1 = (zts_peer_info_t*)0; + int arg2; + void* argp1 = 0; + int res1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_peer_info_t_ver_major_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_peer_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_peer_info_t_ver_major_set" + "', argument " + "1" + " of type '" + "zts_peer_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_peer_info_t_ver_major_set" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->ver_major = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_peer_info_t_ver_major_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_peer_info_t* arg1 = (zts_peer_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_peer_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_peer_info_t_ver_major_get" + "', argument " + "1" + " of type '" + "zts_peer_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (int)((arg1)->ver_major); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_peer_info_t_ver_minor_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_peer_info_t* arg1 = (zts_peer_info_t*)0; + int arg2; + void* argp1 = 0; + int res1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_peer_info_t_ver_minor_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_peer_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_peer_info_t_ver_minor_set" + "', argument " + "1" + " of type '" + "zts_peer_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_peer_info_t_ver_minor_set" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->ver_minor = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_peer_info_t_ver_minor_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_peer_info_t* arg1 = (zts_peer_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_peer_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_peer_info_t_ver_minor_get" + "', argument " + "1" + " of type '" + "zts_peer_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (int)((arg1)->ver_minor); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_peer_info_t_ver_rev_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_peer_info_t* arg1 = (zts_peer_info_t*)0; + int arg2; + void* argp1 = 0; + int res1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_peer_info_t_ver_rev_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_peer_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_peer_info_t_ver_rev_set" + "', argument " + "1" + " of type '" + "zts_peer_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_peer_info_t_ver_rev_set" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->ver_rev = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_peer_info_t_ver_rev_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_peer_info_t* arg1 = (zts_peer_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_peer_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_peer_info_t_ver_rev_get" + "', argument " + "1" + " of type '" + "zts_peer_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (int)((arg1)->ver_rev); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_peer_info_t_latency_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_peer_info_t* arg1 = (zts_peer_info_t*)0; + int arg2; + void* argp1 = 0; + int res1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_peer_info_t_latency_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_peer_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_peer_info_t_latency_set" + "', argument " + "1" + " of type '" + "zts_peer_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_peer_info_t_latency_set" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->latency = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_peer_info_t_latency_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_peer_info_t* arg1 = (zts_peer_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_peer_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_peer_info_t_latency_get" + "', argument " + "1" + " of type '" + "zts_peer_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (int)((arg1)->latency); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_peer_info_t_role_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_peer_info_t* arg1 = (zts_peer_info_t*)0; + zts_peer_role_t arg2; + void* argp1 = 0; + int res1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_peer_info_t_role_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_peer_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_peer_info_t_role_set" + "', argument " + "1" + " of type '" + "zts_peer_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_peer_info_t_role_set" + "', argument " + "2" + " of type '" + "zts_peer_role_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->role = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_peer_info_t_role_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_peer_info_t* arg1 = (zts_peer_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + zts_peer_role_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_peer_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_peer_info_t_role_get" + "', argument " + "1" + " of type '" + "zts_peer_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (zts_peer_role_t)((arg1)->role); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_peer_info_t_path_count_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_peer_info_t* arg1 = (zts_peer_info_t*)0; + unsigned int arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_peer_info_t_path_count_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_peer_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_peer_info_t_path_count_set" + "', argument " + "1" + " of type '" + "zts_peer_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_peer_info_t_path_count_set" + "', argument " + "2" + " of type '" + "unsigned int" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->path_count = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_peer_info_t_path_count_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_peer_info_t* arg1 = (zts_peer_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + unsigned int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_peer_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_peer_info_t_path_count_get" + "', argument " + "1" + " of type '" + "zts_peer_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (unsigned int)((arg1)->path_count); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_peer_info_t_unused_0_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_peer_info_t* arg1 = (zts_peer_info_t*)0; + int arg2; + void* argp1 = 0; + int res1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_peer_info_t_unused_0_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_peer_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_peer_info_t_unused_0_set" + "', argument " + "1" + " of type '" + "zts_peer_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_peer_info_t_unused_0_set" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->unused_0 = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_peer_info_t_unused_0_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_peer_info_t* arg1 = (zts_peer_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_peer_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_peer_info_t_unused_0_get" + "', argument " + "1" + " of type '" + "zts_peer_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (int)((arg1)->unused_0); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_peer_info_t_paths_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_peer_info_t* arg1 = (zts_peer_info_t*)0; + zts_path_t* arg2; + void* argp1 = 0; + int res1 = 0; + void* argp2 = 0; + int res2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_peer_info_t_paths_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_peer_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_peer_info_t_paths_set" + "', argument " + "1" + " of type '" + "zts_peer_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_path_t, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_peer_info_t_paths_set" + "', argument " + "2" + " of type '" + "zts_path_t [16]" + "'"); + } + arg2 = reinterpret_cast(argp2); + { + if (arg2) { + size_t ii = 0; + for (; ii < (size_t)16; ++ii) + *(zts_path_t*)&arg1->paths[ii] = *((zts_path_t*)arg2 + ii); + } + else { + SWIG_exception_fail( + SWIG_ValueError, + "invalid null reference " + "in variable '" + "paths" + "' of type '" + "zts_path_t [16]" + "'"); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_peer_info_t_paths_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_peer_info_t* arg1 = (zts_peer_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + zts_path_t* result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_peer_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_peer_info_t_paths_get" + "', argument " + "1" + " of type '" + "zts_peer_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (zts_path_t*)(zts_path_t*)((arg1)->paths); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_path_t, 0 | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_new_zts_peer_info_t(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_peer_info_t* result = 0; + + if (! SWIG_Python_UnpackTuple(args, "new_zts_peer_info_t", 0, 0, 0)) + SWIG_fail; + result = (zts_peer_info_t*)new zts_peer_info_t(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_peer_info_t, SWIG_POINTER_NEW | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_delete_zts_peer_info_t(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_peer_info_t* arg1 = (zts_peer_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_peer_info_t, SWIG_POINTER_DISOWN | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "delete_zts_peer_info_t" + "', argument " + "1" + " of type '" + "zts_peer_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* zts_peer_info_t_swigregister(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* obj; + if (! SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) + return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_zts_peer_info_t, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* zts_peer_info_t_swiginit(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + return SWIG_Python_InitShadowInstance(args); +} + +SWIGINTERN PyObject* _wrap_zts_root_set_t_public_id_str_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_root_set_t* arg1 = (zts_root_set_t*)0; + char** arg2; + void* argp1 = 0; + int res1 = 0; + void* argp2 = 0; + int res2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_root_set_t_public_id_str_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_root_set_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_root_set_t_public_id_str_set" + "', argument " + "1" + " of type '" + "zts_root_set_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_p_char, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_root_set_t_public_id_str_set" + "', argument " + "2" + " of type '" + "char *[16]" + "'"); + } + arg2 = reinterpret_cast(argp2); + { + if (arg2) { + size_t ii = 0; + for (; ii < (size_t)16; ++ii) + *(char**)&arg1->public_id_str[ii] = *((char**)arg2 + ii); + } + else { + SWIG_exception_fail( + SWIG_ValueError, + "invalid null reference " + "in variable '" + "public_id_str" + "' of type '" + "char *[16]" + "'"); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_root_set_t_public_id_str_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_root_set_t* arg1 = (zts_root_set_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + char** result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_root_set_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_root_set_t_public_id_str_get" + "', argument " + "1" + " of type '" + "zts_root_set_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (char**)(char**)((arg1)->public_id_str); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_char, 0 | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_root_set_t_endpoint_ip_str_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_root_set_t* arg1 = (zts_root_set_t*)0; + char*(*arg2)[32]; + void* argp1 = 0; + int res1 = 0; + void* argp2 = 0; + int res2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_root_set_t_endpoint_ip_str_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_root_set_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_root_set_t_endpoint_ip_str_set" + "', argument " + "1" + " of type '" + "zts_root_set_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_a_32__p_char, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_root_set_t_endpoint_ip_str_set" + "', argument " + "2" + " of type '" + "char *[16][32]" + "'"); + } + arg2 = reinterpret_cast(argp2); + { + if (arg2) { + size_t ii = 0; + for (; ii < (size_t)16; ++ii) { + if (arg2[ii]) { + size_t jj = 0; + for (; jj < (size_t)32; ++jj) + arg1->endpoint_ip_str[ii][jj] = arg2[ii][jj]; + } + else { + SWIG_exception_fail( + SWIG_ValueError, + "invalid null reference " + "in variable '" + "endpoint_ip_str" + "' of type '" + "char *[16][32]" + "'"); + } + } + } + else { + SWIG_exception_fail( + SWIG_ValueError, + "invalid null reference " + "in variable '" + "endpoint_ip_str" + "' of type '" + "char *[16][32]" + "'"); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_root_set_t_endpoint_ip_str_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_root_set_t* arg1 = (zts_root_set_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + char*(*result)[32] = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_root_set_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_root_set_t_endpoint_ip_str_get" + "', argument " + "1" + " of type '" + "zts_root_set_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (char*(*)[32])(char*(*)[32])((arg1)->endpoint_ip_str); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_a_32__p_char, 0 | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_new_zts_root_set_t(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_root_set_t* result = 0; + + if (! SWIG_Python_UnpackTuple(args, "new_zts_root_set_t", 0, 0, 0)) + SWIG_fail; + result = (zts_root_set_t*)new zts_root_set_t(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_root_set_t, SWIG_POINTER_NEW | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_delete_zts_root_set_t(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_root_set_t* arg1 = (zts_root_set_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_root_set_t, SWIG_POINTER_DISOWN | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "delete_zts_root_set_t" + "', argument " + "1" + " of type '" + "zts_root_set_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* zts_root_set_t_swigregister(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* obj; + if (! SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) + return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_zts_root_set_t, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* zts_root_set_t_swiginit(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + return SWIG_Python_InitShadowInstance(args); +} + +SWIGINTERN PyObject* _wrap_zts_netif_info_t_net_id_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_netif_info_t* arg1 = (zts_netif_info_t*)0; + uint64_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned long long val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_netif_info_t_net_id_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_netif_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_netif_info_t_net_id_set" + "', argument " + "1" + " of type '" + "zts_netif_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_netif_info_t_net_id_set" + "', argument " + "2" + " of type '" + "uint64_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->net_id = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_netif_info_t_net_id_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_netif_info_t* arg1 = (zts_netif_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint64_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_netif_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_netif_info_t_net_id_get" + "', argument " + "1" + " of type '" + "zts_netif_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint64_t)((arg1)->net_id); + resultobj = SWIG_From_unsigned_SS_long_SS_long(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_netif_info_t_mac_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_netif_info_t* arg1 = (zts_netif_info_t*)0; + uint64_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned long long val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_netif_info_t_mac_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_netif_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_netif_info_t_mac_set" + "', argument " + "1" + " of type '" + "zts_netif_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_netif_info_t_mac_set" + "', argument " + "2" + " of type '" + "uint64_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->mac = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_netif_info_t_mac_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_netif_info_t* arg1 = (zts_netif_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint64_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_netif_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_netif_info_t_mac_get" + "', argument " + "1" + " of type '" + "zts_netif_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint64_t)((arg1)->mac); + resultobj = SWIG_From_unsigned_SS_long_SS_long(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_netif_info_t_mtu_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_netif_info_t* arg1 = (zts_netif_info_t*)0; + int arg2; + void* argp1 = 0; + int res1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_netif_info_t_mtu_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_netif_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_netif_info_t_mtu_set" + "', argument " + "1" + " of type '" + "zts_netif_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_netif_info_t_mtu_set" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->mtu = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_netif_info_t_mtu_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_netif_info_t* arg1 = (zts_netif_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_netif_info_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_netif_info_t_mtu_get" + "', argument " + "1" + " of type '" + "zts_netif_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (int)((arg1)->mtu); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_new_zts_netif_info_t(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_netif_info_t* result = 0; + + if (! SWIG_Python_UnpackTuple(args, "new_zts_netif_info_t", 0, 0, 0)) + SWIG_fail; + result = (zts_netif_info_t*)new zts_netif_info_t(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_netif_info_t, SWIG_POINTER_NEW | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_delete_zts_netif_info_t(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_netif_info_t* arg1 = (zts_netif_info_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_netif_info_t, SWIG_POINTER_DISOWN | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "delete_zts_netif_info_t" + "', argument " + "1" + " of type '" + "zts_netif_info_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* zts_netif_info_t_swigregister(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* obj; + if (! SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) + return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_zts_netif_info_t, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* zts_netif_info_t_swiginit(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + return SWIG_Python_InitShadowInstance(args); +} + +SWIGINTERN PyObject* _wrap_zts_event_msg_t_event_code_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_event_msg_t* arg1 = (zts_event_msg_t*)0; + int16_t arg2; + void* argp1 = 0; + int res1 = 0; + short val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_event_msg_t_event_code_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_event_msg_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_event_msg_t_event_code_set" + "', argument " + "1" + " of type '" + "zts_event_msg_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_short(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_event_msg_t_event_code_set" + "', argument " + "2" + " of type '" + "int16_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->event_code = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_event_msg_t_event_code_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_event_msg_t* arg1 = (zts_event_msg_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + int16_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_event_msg_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_event_msg_t_event_code_get" + "', argument " + "1" + " of type '" + "zts_event_msg_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (int16_t)((arg1)->event_code); + resultobj = SWIG_From_short(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_event_msg_t_node_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_event_msg_t* arg1 = (zts_event_msg_t*)0; + zts_node_info_t* arg2 = (zts_node_info_t*)0; + void* argp1 = 0; + int res1 = 0; + void* argp2 = 0; + int res2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_event_msg_t_node_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_event_msg_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_event_msg_t_node_set" + "', argument " + "1" + " of type '" + "zts_event_msg_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_node_info_t, SWIG_POINTER_DISOWN | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_event_msg_t_node_set" + "', argument " + "2" + " of type '" + "zts_node_info_t *" + "'"); + } + arg2 = reinterpret_cast(argp2); + if (arg1) + (arg1)->node = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_event_msg_t_node_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_event_msg_t* arg1 = (zts_event_msg_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + zts_node_info_t* result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_event_msg_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_event_msg_t_node_get" + "', argument " + "1" + " of type '" + "zts_event_msg_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (zts_node_info_t*)((arg1)->node); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_node_info_t, 0 | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_event_msg_t_network_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_event_msg_t* arg1 = (zts_event_msg_t*)0; + zts_net_info_t* arg2 = (zts_net_info_t*)0; + void* argp1 = 0; + int res1 = 0; + void* argp2 = 0; + int res2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_event_msg_t_network_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_event_msg_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_event_msg_t_network_set" + "', argument " + "1" + " of type '" + "zts_event_msg_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_net_info_t, SWIG_POINTER_DISOWN | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_event_msg_t_network_set" + "', argument " + "2" + " of type '" + "zts_net_info_t *" + "'"); + } + arg2 = reinterpret_cast(argp2); + if (arg1) + (arg1)->network = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_event_msg_t_network_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_event_msg_t* arg1 = (zts_event_msg_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + zts_net_info_t* result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_event_msg_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_event_msg_t_network_get" + "', argument " + "1" + " of type '" + "zts_event_msg_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (zts_net_info_t*)((arg1)->network); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_net_info_t, 0 | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_event_msg_t_netif_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_event_msg_t* arg1 = (zts_event_msg_t*)0; + zts_netif_info_t* arg2 = (zts_netif_info_t*)0; + void* argp1 = 0; + int res1 = 0; + void* argp2 = 0; + int res2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_event_msg_t_netif_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_event_msg_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_event_msg_t_netif_set" + "', argument " + "1" + " of type '" + "zts_event_msg_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_netif_info_t, SWIG_POINTER_DISOWN | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_event_msg_t_netif_set" + "', argument " + "2" + " of type '" + "zts_netif_info_t *" + "'"); + } + arg2 = reinterpret_cast(argp2); + if (arg1) + (arg1)->netif = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_event_msg_t_netif_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_event_msg_t* arg1 = (zts_event_msg_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + zts_netif_info_t* result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_event_msg_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_event_msg_t_netif_get" + "', argument " + "1" + " of type '" + "zts_event_msg_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (zts_netif_info_t*)((arg1)->netif); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_netif_info_t, 0 | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_event_msg_t_route_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_event_msg_t* arg1 = (zts_event_msg_t*)0; + zts_route_info_t* arg2 = (zts_route_info_t*)0; + void* argp1 = 0; + int res1 = 0; + void* argp2 = 0; + int res2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_event_msg_t_route_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_event_msg_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_event_msg_t_route_set" + "', argument " + "1" + " of type '" + "zts_event_msg_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_route_info_t, SWIG_POINTER_DISOWN | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_event_msg_t_route_set" + "', argument " + "2" + " of type '" + "zts_route_info_t *" + "'"); + } + arg2 = reinterpret_cast(argp2); + if (arg1) + (arg1)->route = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_event_msg_t_route_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_event_msg_t* arg1 = (zts_event_msg_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + zts_route_info_t* result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_event_msg_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_event_msg_t_route_get" + "', argument " + "1" + " of type '" + "zts_event_msg_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (zts_route_info_t*)((arg1)->route); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_route_info_t, 0 | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_event_msg_t_peer_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_event_msg_t* arg1 = (zts_event_msg_t*)0; + zts_peer_info_t* arg2 = (zts_peer_info_t*)0; + void* argp1 = 0; + int res1 = 0; + void* argp2 = 0; + int res2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_event_msg_t_peer_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_event_msg_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_event_msg_t_peer_set" + "', argument " + "1" + " of type '" + "zts_event_msg_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_peer_info_t, SWIG_POINTER_DISOWN | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_event_msg_t_peer_set" + "', argument " + "2" + " of type '" + "zts_peer_info_t *" + "'"); + } + arg2 = reinterpret_cast(argp2); + if (arg1) + (arg1)->peer = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_event_msg_t_peer_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_event_msg_t* arg1 = (zts_event_msg_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + zts_peer_info_t* result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_event_msg_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_event_msg_t_peer_get" + "', argument " + "1" + " of type '" + "zts_event_msg_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (zts_peer_info_t*)((arg1)->peer); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_peer_info_t, 0 | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_event_msg_t_addr_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_event_msg_t* arg1 = (zts_event_msg_t*)0; + zts_addr_info_t* arg2 = (zts_addr_info_t*)0; + void* argp1 = 0; + int res1 = 0; + void* argp2 = 0; + int res2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_event_msg_t_addr_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_event_msg_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_event_msg_t_addr_set" + "', argument " + "1" + " of type '" + "zts_event_msg_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_addr_info_t, SWIG_POINTER_DISOWN | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_event_msg_t_addr_set" + "', argument " + "2" + " of type '" + "zts_addr_info_t *" + "'"); + } + arg2 = reinterpret_cast(argp2); + if (arg1) + (arg1)->addr = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_event_msg_t_addr_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_event_msg_t* arg1 = (zts_event_msg_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + zts_addr_info_t* result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_event_msg_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_event_msg_t_addr_get" + "', argument " + "1" + " of type '" + "zts_event_msg_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (zts_addr_info_t*)((arg1)->addr); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_addr_info_t, 0 | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_event_msg_t_cache_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_event_msg_t* arg1 = (zts_event_msg_t*)0; + void* arg2 = (void*)0; + void* argp1 = 0; + int res1 = 0; + int res2; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_event_msg_t_cache_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_event_msg_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_event_msg_t_cache_set" + "', argument " + "1" + " of type '" + "zts_event_msg_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], SWIG_as_voidptrptr(&arg2), 0, SWIG_POINTER_DISOWN); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_event_msg_t_cache_set" + "', argument " + "2" + " of type '" + "void *" + "'"); + } + if (arg1) + (arg1)->cache = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_event_msg_t_cache_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_event_msg_t* arg1 = (zts_event_msg_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + void* result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_event_msg_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_event_msg_t_cache_get" + "', argument " + "1" + " of type '" + "zts_event_msg_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (void*)((arg1)->cache); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_event_msg_t_len_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_event_msg_t* arg1 = (zts_event_msg_t*)0; + int arg2; + void* argp1 = 0; + int res1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_event_msg_t_len_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_event_msg_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_event_msg_t_len_set" + "', argument " + "1" + " of type '" + "zts_event_msg_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_event_msg_t_len_set" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->len = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_event_msg_t_len_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_event_msg_t* arg1 = (zts_event_msg_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_event_msg_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_event_msg_t_len_get" + "', argument " + "1" + " of type '" + "zts_event_msg_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (int)((arg1)->len); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_new_zts_event_msg_t(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_event_msg_t* result = 0; + + if (! SWIG_Python_UnpackTuple(args, "new_zts_event_msg_t", 0, 0, 0)) + SWIG_fail; + result = (zts_event_msg_t*)new zts_event_msg_t(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_event_msg_t, SWIG_POINTER_NEW | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_delete_zts_event_msg_t(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_event_msg_t* arg1 = (zts_event_msg_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_event_msg_t, SWIG_POINTER_DISOWN | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "delete_zts_event_msg_t" + "', argument " + "1" + " of type '" + "zts_event_msg_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* zts_event_msg_t_swigregister(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* obj; + if (! SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) + return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_zts_event_msg_t, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* zts_event_msg_t_swiginit(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + return SWIG_Python_InitShadowInstance(args); +} + +SWIGINTERN PyObject* _wrap_PythonDirectorCallbackClass_on_zerotier_event(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + PythonDirectorCallbackClass* arg1 = (PythonDirectorCallbackClass*)0; + zts_event_msg_t* arg2 = (zts_event_msg_t*)0; + void* argp1 = 0; + int res1 = 0; + void* argp2 = 0; + int res2 = 0; + PyObject* swig_obj[2]; + Swig::Director* director = 0; + bool upcall = false; + + if (! SWIG_Python_UnpackTuple(args, "PythonDirectorCallbackClass_on_zerotier_event", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_PythonDirectorCallbackClass, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "PythonDirectorCallbackClass_on_zerotier_event" + "', argument " + "1" + " of type '" + "PythonDirectorCallbackClass *" + "'"); + } + arg1 = reinterpret_cast(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_event_msg_t, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "PythonDirectorCallbackClass_on_zerotier_event" + "', argument " + "2" + " of type '" + "zts_event_msg_t *" + "'"); + } + arg2 = reinterpret_cast(argp2); + director = SWIG_DIRECTOR_CAST(arg1); + upcall = (director && (director->swig_get_self() == swig_obj[0])); + try { + if (upcall) { + (arg1)->PythonDirectorCallbackClass::on_zerotier_event(arg2); + } + else { + (arg1)->on_zerotier_event(arg2); + } + } + catch (Swig::DirectorException&) { + SWIG_fail; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_delete_PythonDirectorCallbackClass(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + PythonDirectorCallbackClass* arg1 = (PythonDirectorCallbackClass*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_PythonDirectorCallbackClass, SWIG_POINTER_DISOWN | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "delete_PythonDirectorCallbackClass" + "', argument " + "1" + " of type '" + "PythonDirectorCallbackClass *" + "'"); + } + arg1 = reinterpret_cast(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_new_PythonDirectorCallbackClass(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + PyObject* arg1 = (PyObject*)0; + PyObject* swig_obj[1]; + PythonDirectorCallbackClass* result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + arg1 = swig_obj[0]; + if (arg1 != Py_None) { + /* subclassed */ + result = (PythonDirectorCallbackClass*)new SwigDirector_PythonDirectorCallbackClass(arg1); + } + else { + result = (PythonDirectorCallbackClass*)new PythonDirectorCallbackClass(); + } + + resultobj = + SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PythonDirectorCallbackClass, SWIG_POINTER_NEW | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_disown_PythonDirectorCallbackClass(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + PythonDirectorCallbackClass* arg1 = (PythonDirectorCallbackClass*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_PythonDirectorCallbackClass, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "disown_PythonDirectorCallbackClass" + "', argument " + "1" + " of type '" + "PythonDirectorCallbackClass *" + "'"); + } + arg1 = reinterpret_cast(argp1); + { + Swig::Director* director = SWIG_DIRECTOR_CAST(arg1); + if (director) + director->swig_disown(); + } + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* PythonDirectorCallbackClass_swigregister(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* obj; + if (! SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) + return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_PythonDirectorCallbackClass, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* PythonDirectorCallbackClass_swiginit(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + return SWIG_Python_InitShadowInstance(args); +} + +SWIGINTERN int Swig_var__userEventCallback_set(PyObject* _val) +{ + { + void* argp = 0; + int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PythonDirectorCallbackClass, 0); + if (! SWIG_IsOK(res)) { + SWIG_exception_fail( + SWIG_ArgError(res), + "in variable '" + "_userEventCallback" + "' of type '" + "PythonDirectorCallbackClass *" + "'"); + } + _userEventCallback = reinterpret_cast(argp); + } + return 0; +fail: + return 1; +} + +SWIGINTERN PyObject* Swig_var__userEventCallback_get(void) +{ + PyObject* pyobj = 0; + + pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_userEventCallback), SWIGTYPE_p_PythonDirectorCallbackClass, 0); + return pyobj; +} + +SWIGINTERN PyObject* _wrap_zts_py_bind(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int arg2; + int arg3; + PyObject* arg4 = (PyObject*)0; + int val1; + int ecode1 = 0; + int val2; + int ecode2 = 0; + int val3; + int ecode3 = 0; + PyObject* swig_obj[4]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_py_bind", 4, 4, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_py_bind" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_py_bind" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_py_bind" + "', argument " + "3" + " of type '" + "int" + "'"); + } + arg3 = static_cast(val3); + arg4 = swig_obj[3]; + result = (int)zts_py_bind(arg1, arg2, arg3, arg4); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_py_connect(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int arg2; + int arg3; + PyObject* arg4 = (PyObject*)0; + int val1; + int ecode1 = 0; + int val2; + int ecode2 = 0; + int val3; + int ecode3 = 0; + PyObject* swig_obj[4]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_py_connect", 4, 4, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_py_connect" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_py_connect" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_py_connect" + "', argument " + "3" + " of type '" + "int" + "'"); + } + arg3 = static_cast(val3); + arg4 = swig_obj[3]; + result = (int)zts_py_connect(arg1, arg2, arg3, arg4); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_py_accept(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + PyObject* result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_py_accept" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + result = (PyObject*)zts_py_accept(arg1); + resultobj = result; + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_py_listen(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int arg2; + int val1; + int ecode1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_py_listen", 2, 2, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_py_listen" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_py_listen" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + result = (int)zts_py_listen(arg1, arg2); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_py_recv(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int arg2; + int arg3; + int val1; + int ecode1 = 0; + int val2; + int ecode2 = 0; + int val3; + int ecode3 = 0; + PyObject* swig_obj[3]; + PyObject* result = 0; + + if (! SWIG_Python_UnpackTuple(args, "zts_py_recv", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_py_recv" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_py_recv" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_py_recv" + "', argument " + "3" + " of type '" + "int" + "'"); + } + arg3 = static_cast(val3); + result = (PyObject*)zts_py_recv(arg1, arg2, arg3); + resultobj = result; + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_py_send(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + PyObject* arg2 = (PyObject*)0; + int arg3; + int val1; + int ecode1 = 0; + int val3; + int ecode3 = 0; + PyObject* swig_obj[3]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_py_send", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_py_send" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + arg2 = swig_obj[1]; + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_py_send" + "', argument " + "3" + " of type '" + "int" + "'"); + } + arg3 = static_cast(val3); + result = (int)zts_py_send(arg1, arg2, arg3); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_py_close(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_py_close" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_py_close(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_py_setblocking(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int arg2; + int val1; + int ecode1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_py_setblocking", 2, 2, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_py_setblocking" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_py_setblocking" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + result = (int)zts_py_setblocking(arg1, arg2); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_py_getblocking(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_py_getblocking" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_py_getblocking(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_id_new(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + char* arg1 = (char*)0; + unsigned int* arg2 = (unsigned int*)0; + int res1; + char* buf1 = 0; + int alloc1 = 0; + void* argp2 = 0; + int res2 = 0; + PyObject* swig_obj[2]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_id_new", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_id_new" + "', argument " + "1" + " of type '" + "char *" + "'"); + } + arg1 = reinterpret_cast(buf1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_unsigned_int, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_id_new" + "', argument " + "2" + " of type '" + "unsigned int *" + "'"); + } + arg2 = reinterpret_cast(argp2); + result = (int)zts_id_new(arg1, arg2); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_id_pair_is_valid(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + char* arg1 = (char*)0; + unsigned int arg2; + int res1; + char* buf1 = 0; + int alloc1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_id_pair_is_valid", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_id_pair_is_valid" + "', argument " + "1" + " of type '" + "char const *" + "'"); + } + arg1 = reinterpret_cast(buf1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_id_pair_is_valid" + "', argument " + "2" + " of type '" + "unsigned int" + "'"); + } + arg2 = static_cast(val2); + result = (int)zts_id_pair_is_valid((char const*)arg1, arg2); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_init_from_storage(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + char* arg1 = (char*)0; + int res1; + char* buf1 = 0; + int alloc1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_init_from_storage" + "', argument " + "1" + " of type '" + "char const *" + "'"); + } + arg1 = reinterpret_cast(buf1); + result = (int)zts_init_from_storage((char const*)arg1); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_init_from_memory(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + char* arg1 = (char*)0; + unsigned int arg2; + int res1; + char* buf1 = 0; + int alloc1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_init_from_memory", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_init_from_memory" + "', argument " + "1" + " of type '" + "char const *" + "'"); + } + arg1 = reinterpret_cast(buf1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_init_from_memory" + "', argument " + "2" + " of type '" + "unsigned int" + "'"); + } + arg2 = static_cast(val2); + result = (int)zts_init_from_memory((char const*)arg1, arg2); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_init_set_event_handler(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + PythonDirectorCallbackClass* arg1 = (PythonDirectorCallbackClass*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_PythonDirectorCallbackClass, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_init_set_event_handler" + "', argument " + "1" + " of type '" + "PythonDirectorCallbackClass *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (int)zts_init_set_event_handler(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_init_blacklist_if(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + char* arg1 = (char*)0; + unsigned int arg2; + int res1; + char* buf1 = 0; + int alloc1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_init_blacklist_if", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_init_blacklist_if" + "', argument " + "1" + " of type '" + "char const *" + "'"); + } + arg1 = reinterpret_cast(buf1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_init_blacklist_if" + "', argument " + "2" + " of type '" + "unsigned int" + "'"); + } + arg2 = static_cast(val2); + result = (int)zts_init_blacklist_if((char const*)arg1, arg2); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_init_set_roots(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + void* arg1 = (void*)0; + unsigned int arg2; + int res1; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_init_set_roots", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], SWIG_as_voidptrptr(&arg1), 0, 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_init_set_roots" + "', argument " + "1" + " of type '" + "void const *" + "'"); + } + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_init_set_roots" + "', argument " + "2" + " of type '" + "unsigned int" + "'"); + } + arg2 = static_cast(val2); + result = (int)zts_init_set_roots((void const*)arg1, arg2); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_init_set_port(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + unsigned short arg1; + unsigned short val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_unsigned_SS_short(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_init_set_port" + "', argument " + "1" + " of type '" + "unsigned short" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_init_set_port(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_init_allow_net_cache(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + unsigned int arg1; + unsigned int val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_unsigned_SS_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_init_allow_net_cache" + "', argument " + "1" + " of type '" + "unsigned int" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_init_allow_net_cache(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_init_allow_peer_cache(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + unsigned int arg1; + unsigned int val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_unsigned_SS_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_init_allow_peer_cache" + "', argument " + "1" + " of type '" + "unsigned int" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_init_allow_peer_cache(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_init_allow_roots_cache(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + unsigned int arg1; + unsigned int val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_unsigned_SS_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_init_allow_roots_cache" + "', argument " + "1" + " of type '" + "unsigned int" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_init_allow_roots_cache(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_init_allow_id_cache(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + unsigned int arg1; + unsigned int val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_unsigned_SS_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_init_allow_id_cache" + "', argument " + "1" + " of type '" + "unsigned int" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_init_allow_id_cache(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_addr_is_assigned(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + unsigned int arg2; + unsigned long long val1; + int ecode1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_addr_is_assigned", 2, 2, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_addr_is_assigned" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_addr_is_assigned" + "', argument " + "2" + " of type '" + "unsigned int" + "'"); + } + arg2 = static_cast(val2); + result = (int)zts_addr_is_assigned(arg1, arg2); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_addr_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + unsigned int arg2; + zts_sockaddr_storage* arg3 = (zts_sockaddr_storage*)0; + unsigned long long val1; + int ecode1 = 0; + unsigned int val2; + int ecode2 = 0; + void* argp3 = 0; + int res3 = 0; + PyObject* swig_obj[3]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_addr_get", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_addr_get" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_addr_get" + "', argument " + "2" + " of type '" + "unsigned int" + "'"); + } + arg2 = static_cast(val2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_zts_sockaddr_storage, 0 | 0); + if (! SWIG_IsOK(res3)) { + SWIG_exception_fail( + SWIG_ArgError(res3), + "in method '" + "zts_addr_get" + "', argument " + "3" + " of type '" + "zts_sockaddr_storage *" + "'"); + } + arg3 = reinterpret_cast(argp3); + result = (int)zts_addr_get(arg1, arg2, arg3); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_addr_get_str(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + unsigned int arg2; + char* arg3 = (char*)0; + unsigned int arg4; + unsigned long long val1; + int ecode1 = 0; + unsigned int val2; + int ecode2 = 0; + int res3; + char* buf3 = 0; + int alloc3 = 0; + unsigned int val4; + int ecode4 = 0; + PyObject* swig_obj[4]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_addr_get_str", 4, 4, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_addr_get_str" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_addr_get_str" + "', argument " + "2" + " of type '" + "unsigned int" + "'"); + } + arg2 = static_cast(val2); + res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3); + if (! SWIG_IsOK(res3)) { + SWIG_exception_fail( + SWIG_ArgError(res3), + "in method '" + "zts_addr_get_str" + "', argument " + "3" + " of type '" + "char *" + "'"); + } + arg3 = reinterpret_cast(buf3); + ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val4); + if (! SWIG_IsOK(ecode4)) { + SWIG_exception_fail( + SWIG_ArgError(ecode4), + "in method '" + "zts_addr_get_str" + "', argument " + "4" + " of type '" + "unsigned int" + "'"); + } + arg4 = static_cast(val4); + result = (int)zts_addr_get_str(arg1, arg2, arg3, arg4); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc3 == SWIG_NEWOBJ) + delete[] buf3; + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) + delete[] buf3; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_addr_get_all(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + zts_sockaddr_storage* arg2 = (zts_sockaddr_storage*)0; + unsigned int* arg3 = (unsigned int*)0; + unsigned long long val1; + int ecode1 = 0; + void* argp2 = 0; + int res2 = 0; + void* argp3 = 0; + int res3 = 0; + PyObject* swig_obj[3]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_addr_get_all", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_addr_get_all" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_sockaddr_storage, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_addr_get_all" + "', argument " + "2" + " of type '" + "zts_sockaddr_storage *" + "'"); + } + arg2 = reinterpret_cast(argp2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_unsigned_int, 0 | 0); + if (! SWIG_IsOK(res3)) { + SWIG_exception_fail( + SWIG_ArgError(res3), + "in method '" + "zts_addr_get_all" + "', argument " + "3" + " of type '" + "unsigned int *" + "'"); + } + arg3 = reinterpret_cast(argp3); + result = (int)zts_addr_get_all(arg1, arg2, arg3); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_addr_compute_6plane(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + uint64_t arg2; + zts_sockaddr_storage* arg3 = (zts_sockaddr_storage*)0; + unsigned long long val1; + int ecode1 = 0; + unsigned long long val2; + int ecode2 = 0; + void* argp3 = 0; + int res3 = 0; + PyObject* swig_obj[3]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_addr_compute_6plane", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_addr_compute_6plane" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_addr_compute_6plane" + "', argument " + "2" + " of type '" + "uint64_t" + "'"); + } + arg2 = static_cast(val2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_zts_sockaddr_storage, 0 | 0); + if (! SWIG_IsOK(res3)) { + SWIG_exception_fail( + SWIG_ArgError(res3), + "in method '" + "zts_addr_compute_6plane" + "', argument " + "3" + " of type '" + "zts_sockaddr_storage *" + "'"); + } + arg3 = reinterpret_cast(argp3); + result = (int)zts_addr_compute_6plane(arg1, arg2, arg3); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_addr_compute_rfc4193(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + uint64_t arg2; + zts_sockaddr_storage* arg3 = (zts_sockaddr_storage*)0; + unsigned long long val1; + int ecode1 = 0; + unsigned long long val2; + int ecode2 = 0; + void* argp3 = 0; + int res3 = 0; + PyObject* swig_obj[3]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_addr_compute_rfc4193", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_addr_compute_rfc4193" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_addr_compute_rfc4193" + "', argument " + "2" + " of type '" + "uint64_t" + "'"); + } + arg2 = static_cast(val2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_zts_sockaddr_storage, 0 | 0); + if (! SWIG_IsOK(res3)) { + SWIG_exception_fail( + SWIG_ArgError(res3), + "in method '" + "zts_addr_compute_rfc4193" + "', argument " + "3" + " of type '" + "zts_sockaddr_storage *" + "'"); + } + arg3 = reinterpret_cast(argp3); + result = (int)zts_addr_compute_rfc4193(arg1, arg2, arg3); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_addr_compute_rfc4193_str(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + uint64_t arg2; + char* arg3 = (char*)0; + unsigned int arg4; + unsigned long long val1; + int ecode1 = 0; + unsigned long long val2; + int ecode2 = 0; + int res3; + char* buf3 = 0; + int alloc3 = 0; + unsigned int val4; + int ecode4 = 0; + PyObject* swig_obj[4]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_addr_compute_rfc4193_str", 4, 4, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_addr_compute_rfc4193_str" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_addr_compute_rfc4193_str" + "', argument " + "2" + " of type '" + "uint64_t" + "'"); + } + arg2 = static_cast(val2); + res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3); + if (! SWIG_IsOK(res3)) { + SWIG_exception_fail( + SWIG_ArgError(res3), + "in method '" + "zts_addr_compute_rfc4193_str" + "', argument " + "3" + " of type '" + "char *" + "'"); + } + arg3 = reinterpret_cast(buf3); + ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val4); + if (! SWIG_IsOK(ecode4)) { + SWIG_exception_fail( + SWIG_ArgError(ecode4), + "in method '" + "zts_addr_compute_rfc4193_str" + "', argument " + "4" + " of type '" + "unsigned int" + "'"); + } + arg4 = static_cast(val4); + result = (int)zts_addr_compute_rfc4193_str(arg1, arg2, arg3, arg4); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc3 == SWIG_NEWOBJ) + delete[] buf3; + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) + delete[] buf3; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_addr_compute_6plane_str(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + uint64_t arg2; + char* arg3 = (char*)0; + unsigned int arg4; + unsigned long long val1; + int ecode1 = 0; + unsigned long long val2; + int ecode2 = 0; + int res3; + char* buf3 = 0; + int alloc3 = 0; + unsigned int val4; + int ecode4 = 0; + PyObject* swig_obj[4]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_addr_compute_6plane_str", 4, 4, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_addr_compute_6plane_str" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_addr_compute_6plane_str" + "', argument " + "2" + " of type '" + "uint64_t" + "'"); + } + arg2 = static_cast(val2); + res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3); + if (! SWIG_IsOK(res3)) { + SWIG_exception_fail( + SWIG_ArgError(res3), + "in method '" + "zts_addr_compute_6plane_str" + "', argument " + "3" + " of type '" + "char *" + "'"); + } + arg3 = reinterpret_cast(buf3); + ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val4); + if (! SWIG_IsOK(ecode4)) { + SWIG_exception_fail( + SWIG_ArgError(ecode4), + "in method '" + "zts_addr_compute_6plane_str" + "', argument " + "4" + " of type '" + "unsigned int" + "'"); + } + arg4 = static_cast(val4); + result = (int)zts_addr_compute_6plane_str(arg1, arg2, arg3, arg4); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc3 == SWIG_NEWOBJ) + delete[] buf3; + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) + delete[] buf3; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_compute_adhoc_id(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint16_t arg1; + uint16_t arg2; + unsigned short val1; + int ecode1 = 0; + unsigned short val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + uint64_t result; + + if (! SWIG_Python_UnpackTuple(args, "zts_net_compute_adhoc_id", 2, 2, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_unsigned_SS_short(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_net_compute_adhoc_id" + "', argument " + "1" + " of type '" + "uint16_t" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_unsigned_SS_short(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_net_compute_adhoc_id" + "', argument " + "2" + " of type '" + "uint16_t" + "'"); + } + arg2 = static_cast(val2); + result = (uint64_t)zts_net_compute_adhoc_id(arg1, arg2); + resultobj = SWIG_From_unsigned_SS_long_SS_long(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_join(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + unsigned long long val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_net_join" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_net_join(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_leave(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + unsigned long long val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_net_leave" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_net_leave(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_transport_is_ready(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + unsigned long long val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_net_transport_is_ready" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_net_transport_is_ready(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_get_mac(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + unsigned long long val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + uint64_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_net_get_mac" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + result = (uint64_t)zts_net_get_mac(arg1); + resultobj = SWIG_From_unsigned_SS_long_SS_long(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_get_mac_str(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + char* arg2 = (char*)0; + unsigned int arg3; + unsigned long long val1; + int ecode1 = 0; + int res2; + char* buf2 = 0; + int alloc2 = 0; + unsigned int val3; + int ecode3 = 0; + PyObject* swig_obj[3]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_net_get_mac_str", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_net_get_mac_str" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_net_get_mac_str" + "', argument " + "2" + " of type '" + "char *" + "'"); + } + arg2 = reinterpret_cast(buf2); + ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_net_get_mac_str" + "', argument " + "3" + " of type '" + "unsigned int" + "'"); + } + arg3 = static_cast(val3); + result = (int)zts_net_get_mac_str(arg1, arg2, arg3); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc2 == SWIG_NEWOBJ) + delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) + delete[] buf2; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_get_broadcast(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + unsigned long long val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_net_get_broadcast" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_net_get_broadcast(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_get_mtu(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + unsigned long long val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_net_get_mtu" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_net_get_mtu(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_get_name(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + char* arg2 = (char*)0; + unsigned int arg3; + unsigned long long val1; + int ecode1 = 0; + int res2; + char* buf2 = 0; + int alloc2 = 0; + unsigned int val3; + int ecode3 = 0; + PyObject* swig_obj[3]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_net_get_name", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_net_get_name" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_net_get_name" + "', argument " + "2" + " of type '" + "char *" + "'"); + } + arg2 = reinterpret_cast(buf2); + ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_net_get_name" + "', argument " + "3" + " of type '" + "unsigned int" + "'"); + } + arg3 = static_cast(val3); + result = (int)zts_net_get_name(arg1, arg2, arg3); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc2 == SWIG_NEWOBJ) + delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) + delete[] buf2; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_get_status(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + unsigned long long val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_net_get_status" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_net_get_status(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_net_get_type(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + unsigned long long val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_net_get_type" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_net_get_type(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_route_is_assigned(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + unsigned int arg2; + unsigned long long val1; + int ecode1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_route_is_assigned", 2, 2, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_route_is_assigned" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_route_is_assigned" + "', argument " + "2" + " of type '" + "unsigned int" + "'"); + } + arg2 = static_cast(val2); + result = (int)zts_route_is_assigned(arg1, arg2); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_node_start(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_node_start", 0, 0, 0)) + SWIG_fail; + result = (int)zts_node_start(); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_node_is_online(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_node_is_online", 0, 0, 0)) + SWIG_fail; + result = (int)zts_node_is_online(); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_node_get_id(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t result; + + if (! SWIG_Python_UnpackTuple(args, "zts_node_get_id", 0, 0, 0)) + SWIG_fail; + result = (uint64_t)zts_node_get_id(); + resultobj = SWIG_From_unsigned_SS_long_SS_long(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_node_get_id_pair(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + char* arg1 = (char*)0; + unsigned int* arg2 = (unsigned int*)0; + int res1; + char* buf1 = 0; + int alloc1 = 0; + void* argp2 = 0; + int res2 = 0; + PyObject* swig_obj[2]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_node_get_id_pair", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_node_get_id_pair" + "', argument " + "1" + " of type '" + "char *" + "'"); + } + arg1 = reinterpret_cast(buf1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_unsigned_int, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_node_get_id_pair" + "', argument " + "2" + " of type '" + "unsigned int *" + "'"); + } + arg2 = reinterpret_cast(argp2); + result = (int)zts_node_get_id_pair(arg1, arg2); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_node_get_port(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_node_get_port", 0, 0, 0)) + SWIG_fail; + result = (int)zts_node_get_port(); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_node_stop(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_node_stop", 0, 0, 0)) + SWIG_fail; + result = (int)zts_node_stop(); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_node_free(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_node_free", 0, 0, 0)) + SWIG_fail; + result = (int)zts_node_free(); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_moon_orbit(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + uint64_t arg2; + unsigned long long val1; + int ecode1 = 0; + unsigned long long val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_moon_orbit", 2, 2, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_moon_orbit" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_moon_orbit" + "', argument " + "2" + " of type '" + "uint64_t" + "'"); + } + arg2 = static_cast(val2); + result = (int)zts_moon_orbit(arg1, arg2); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_moon_deorbit(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + unsigned long long val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_moon_deorbit" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_moon_deorbit(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_link_tx_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_link_tx_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_link_tx_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_link_tx_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->link_tx = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_link_tx_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_link_tx_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->link_tx); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_link_rx_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_link_rx_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_link_rx_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_link_rx_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->link_rx = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_link_rx_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_link_rx_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->link_rx); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_link_drop_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_link_drop_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_link_drop_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_link_drop_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->link_drop = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_link_drop_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_link_drop_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->link_drop); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_link_err_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_link_err_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_link_err_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_link_err_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->link_err = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_link_err_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_link_err_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->link_err); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_etharp_tx_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_etharp_tx_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_etharp_tx_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_etharp_tx_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->etharp_tx = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_etharp_tx_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_etharp_tx_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->etharp_tx); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_etharp_rx_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_etharp_rx_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_etharp_rx_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_etharp_rx_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->etharp_rx = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_etharp_rx_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_etharp_rx_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->etharp_rx); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_etharp_drop_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_etharp_drop_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_etharp_drop_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_etharp_drop_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->etharp_drop = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_etharp_drop_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_etharp_drop_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->etharp_drop); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_etharp_err_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_etharp_err_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_etharp_err_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_etharp_err_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->etharp_err = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_etharp_err_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_etharp_err_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->etharp_err); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_ip4_tx_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_ip4_tx_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_ip4_tx_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_ip4_tx_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->ip4_tx = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_ip4_tx_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_ip4_tx_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->ip4_tx); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_ip4_rx_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_ip4_rx_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_ip4_rx_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_ip4_rx_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->ip4_rx = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_ip4_rx_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_ip4_rx_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->ip4_rx); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_ip4_drop_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_ip4_drop_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_ip4_drop_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_ip4_drop_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->ip4_drop = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_ip4_drop_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_ip4_drop_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->ip4_drop); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_ip4_err_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_ip4_err_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_ip4_err_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_ip4_err_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->ip4_err = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_ip4_err_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_ip4_err_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->ip4_err); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_ip6_tx_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_ip6_tx_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_ip6_tx_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_ip6_tx_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->ip6_tx = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_ip6_tx_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_ip6_tx_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->ip6_tx); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_ip6_rx_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_ip6_rx_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_ip6_rx_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_ip6_rx_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->ip6_rx = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_ip6_rx_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_ip6_rx_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->ip6_rx); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_ip6_drop_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_ip6_drop_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_ip6_drop_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_ip6_drop_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->ip6_drop = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_ip6_drop_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_ip6_drop_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->ip6_drop); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_ip6_err_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_ip6_err_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_ip6_err_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_ip6_err_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->ip6_err = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_ip6_err_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_ip6_err_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->ip6_err); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_icmp4_tx_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_icmp4_tx_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_icmp4_tx_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_icmp4_tx_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->icmp4_tx = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_icmp4_tx_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_icmp4_tx_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->icmp4_tx); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_icmp4_rx_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_icmp4_rx_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_icmp4_rx_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_icmp4_rx_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->icmp4_rx = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_icmp4_rx_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_icmp4_rx_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->icmp4_rx); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_icmp4_drop_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_icmp4_drop_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_icmp4_drop_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_icmp4_drop_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->icmp4_drop = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_icmp4_drop_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_icmp4_drop_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->icmp4_drop); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_icmp4_err_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_icmp4_err_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_icmp4_err_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_icmp4_err_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->icmp4_err = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_icmp4_err_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_icmp4_err_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->icmp4_err); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_icmp6_tx_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_icmp6_tx_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_icmp6_tx_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_icmp6_tx_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->icmp6_tx = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_icmp6_tx_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_icmp6_tx_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->icmp6_tx); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_icmp6_rx_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_icmp6_rx_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_icmp6_rx_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_icmp6_rx_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->icmp6_rx = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_icmp6_rx_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_icmp6_rx_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->icmp6_rx); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_icmp6_drop_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_icmp6_drop_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_icmp6_drop_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_icmp6_drop_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->icmp6_drop = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_icmp6_drop_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_icmp6_drop_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->icmp6_drop); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_icmp6_err_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_icmp6_err_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_icmp6_err_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_icmp6_err_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->icmp6_err = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_icmp6_err_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_icmp6_err_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->icmp6_err); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_udp_tx_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_udp_tx_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_udp_tx_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_udp_tx_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->udp_tx = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_udp_tx_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_udp_tx_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->udp_tx); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_udp_rx_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_udp_rx_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_udp_rx_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_udp_rx_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->udp_rx = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_udp_rx_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_udp_rx_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->udp_rx); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_udp_drop_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_udp_drop_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_udp_drop_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_udp_drop_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->udp_drop = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_udp_drop_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_udp_drop_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->udp_drop); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_udp_err_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_udp_err_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_udp_err_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_udp_err_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->udp_err = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_udp_err_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_udp_err_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->udp_err); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_tcp_tx_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_tcp_tx_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_tcp_tx_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_tcp_tx_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->tcp_tx = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_tcp_tx_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_tcp_tx_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->tcp_tx); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_tcp_rx_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_tcp_rx_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_tcp_rx_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_tcp_rx_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->tcp_rx = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_tcp_rx_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_tcp_rx_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->tcp_rx); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_tcp_drop_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_tcp_drop_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_tcp_drop_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_tcp_drop_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->tcp_drop = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_tcp_drop_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_tcp_drop_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->tcp_drop); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_tcp_err_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_tcp_err_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_tcp_err_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_tcp_err_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->tcp_err = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_tcp_err_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_tcp_err_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->tcp_err); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_nd6_tx_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_nd6_tx_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_nd6_tx_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_nd6_tx_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->nd6_tx = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_nd6_tx_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_nd6_tx_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->nd6_tx); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_nd6_rx_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_nd6_rx_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_nd6_rx_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_nd6_rx_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->nd6_rx = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_nd6_rx_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_nd6_rx_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->nd6_rx); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_nd6_drop_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_nd6_drop_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_nd6_drop_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_nd6_drop_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->nd6_drop = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_nd6_drop_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_nd6_drop_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->nd6_drop); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_nd6_err_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_stats_counter_t_nd6_err_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_nd6_err_set" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_stats_counter_t_nd6_err_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->nd6_err = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_stats_counter_t_nd6_err_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_counter_t_nd6_err_get" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->nd6_err); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_new_zts_stats_counter_t(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* result = 0; + + if (! SWIG_Python_UnpackTuple(args, "new_zts_stats_counter_t", 0, 0, 0)) + SWIG_fail; + result = (zts_stats_counter_t*)new zts_stats_counter_t(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_stats_counter_t, SWIG_POINTER_NEW | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_delete_zts_stats_counter_t(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, SWIG_POINTER_DISOWN | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "delete_zts_stats_counter_t" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* zts_stats_counter_t_swigregister(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* obj; + if (! SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) + return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_zts_stats_counter_t, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* zts_stats_counter_t_swiginit(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + return SWIG_Python_InitShadowInstance(args); +} + +SWIGINTERN PyObject* _wrap_zts_stats_get_all(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_stats_counter_t* arg1 = (zts_stats_counter_t*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_stats_counter_t, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_stats_get_all" + "', argument " + "1" + " of type '" + "zts_stats_counter_t *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (int)zts_stats_get_all(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_bsd_socket(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int arg2; + int arg3; + int val1; + int ecode1 = 0; + int val2; + int ecode2 = 0; + int val3; + int ecode3 = 0; + PyObject* swig_obj[3]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bsd_socket", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bsd_socket" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_bsd_socket" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_bsd_socket" + "', argument " + "3" + " of type '" + "int" + "'"); + } + arg3 = static_cast(val3); + result = (int)zts_bsd_socket(arg1, arg2, arg3); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_bsd_connect(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + zts_sockaddr* arg2 = (zts_sockaddr*)0; + zts_socklen_t arg3; + int val1; + int ecode1 = 0; + void* argp2 = 0; + int res2 = 0; + unsigned int val3; + int ecode3 = 0; + PyObject* swig_obj[3]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bsd_connect", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bsd_connect" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_sockaddr, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_bsd_connect" + "', argument " + "2" + " of type '" + "zts_sockaddr const *" + "'"); + } + arg2 = reinterpret_cast(argp2); + ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_bsd_connect" + "', argument " + "3" + " of type '" + "zts_socklen_t" + "'"); + } + arg3 = static_cast(val3); + result = (int)zts_bsd_connect(arg1, (zts_sockaddr const*)arg2, arg3); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_bsd_bind(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + zts_sockaddr* arg2 = (zts_sockaddr*)0; + zts_socklen_t arg3; + int val1; + int ecode1 = 0; + void* argp2 = 0; + int res2 = 0; + unsigned int val3; + int ecode3 = 0; + PyObject* swig_obj[3]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bsd_bind", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bsd_bind" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_sockaddr, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_bsd_bind" + "', argument " + "2" + " of type '" + "zts_sockaddr const *" + "'"); + } + arg2 = reinterpret_cast(argp2); + ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_bsd_bind" + "', argument " + "3" + " of type '" + "zts_socklen_t" + "'"); + } + arg3 = static_cast(val3); + result = (int)zts_bsd_bind(arg1, (zts_sockaddr const*)arg2, arg3); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_bsd_listen(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int arg2; + int val1; + int ecode1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bsd_listen", 2, 2, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bsd_listen" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_bsd_listen" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + result = (int)zts_bsd_listen(arg1, arg2); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_bsd_accept(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + zts_sockaddr* arg2 = (zts_sockaddr*)0; + zts_socklen_t* arg3 = (zts_socklen_t*)0; + int val1; + int ecode1 = 0; + void* argp2 = 0; + int res2 = 0; + void* argp3 = 0; + int res3 = 0; + PyObject* swig_obj[3]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bsd_accept", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bsd_accept" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_sockaddr, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_bsd_accept" + "', argument " + "2" + " of type '" + "zts_sockaddr *" + "'"); + } + arg2 = reinterpret_cast(argp2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_unsigned_int, 0 | 0); + if (! SWIG_IsOK(res3)) { + SWIG_exception_fail( + SWIG_ArgError(res3), + "in method '" + "zts_bsd_accept" + "', argument " + "3" + " of type '" + "zts_socklen_t *" + "'"); + } + arg3 = reinterpret_cast(argp3); + result = (int)zts_bsd_accept(arg1, arg2, arg3); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_bsd_setsockopt(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int arg2; + int arg3; + void* arg4 = (void*)0; + zts_socklen_t arg5; + int val1; + int ecode1 = 0; + int val2; + int ecode2 = 0; + int val3; + int ecode3 = 0; + int res4; + unsigned int val5; + int ecode5 = 0; + PyObject* swig_obj[5]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bsd_setsockopt", 5, 5, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bsd_setsockopt" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_bsd_setsockopt" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_bsd_setsockopt" + "', argument " + "3" + " of type '" + "int" + "'"); + } + arg3 = static_cast(val3); + res4 = SWIG_ConvertPtr(swig_obj[3], SWIG_as_voidptrptr(&arg4), 0, 0); + if (! SWIG_IsOK(res4)) { + SWIG_exception_fail( + SWIG_ArgError(res4), + "in method '" + "zts_bsd_setsockopt" + "', argument " + "4" + " of type '" + "void const *" + "'"); + } + ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val5); + if (! SWIG_IsOK(ecode5)) { + SWIG_exception_fail( + SWIG_ArgError(ecode5), + "in method '" + "zts_bsd_setsockopt" + "', argument " + "5" + " of type '" + "zts_socklen_t" + "'"); + } + arg5 = static_cast(val5); + result = (int)zts_bsd_setsockopt(arg1, arg2, arg3, (void const*)arg4, arg5); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_bsd_getsockopt(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int arg2; + int arg3; + void* arg4 = (void*)0; + zts_socklen_t* arg5 = (zts_socklen_t*)0; + int val1; + int ecode1 = 0; + int val2; + int ecode2 = 0; + int val3; + int ecode3 = 0; + int res4; + void* argp5 = 0; + int res5 = 0; + PyObject* swig_obj[5]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bsd_getsockopt", 5, 5, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bsd_getsockopt" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_bsd_getsockopt" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_bsd_getsockopt" + "', argument " + "3" + " of type '" + "int" + "'"); + } + arg3 = static_cast(val3); + res4 = SWIG_ConvertPtr(swig_obj[3], SWIG_as_voidptrptr(&arg4), 0, 0); + if (! SWIG_IsOK(res4)) { + SWIG_exception_fail( + SWIG_ArgError(res4), + "in method '" + "zts_bsd_getsockopt" + "', argument " + "4" + " of type '" + "void *" + "'"); + } + res5 = SWIG_ConvertPtr(swig_obj[4], &argp5, SWIGTYPE_p_unsigned_int, 0 | 0); + if (! SWIG_IsOK(res5)) { + SWIG_exception_fail( + SWIG_ArgError(res5), + "in method '" + "zts_bsd_getsockopt" + "', argument " + "5" + " of type '" + "zts_socklen_t *" + "'"); + } + arg5 = reinterpret_cast(argp5); + result = (int)zts_bsd_getsockopt(arg1, arg2, arg3, arg4, arg5); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_bsd_getsockname(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + zts_sockaddr* arg2 = (zts_sockaddr*)0; + zts_socklen_t* arg3 = (zts_socklen_t*)0; + int val1; + int ecode1 = 0; + void* argp2 = 0; + int res2 = 0; + void* argp3 = 0; + int res3 = 0; + PyObject* swig_obj[3]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bsd_getsockname", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bsd_getsockname" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_sockaddr, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_bsd_getsockname" + "', argument " + "2" + " of type '" + "zts_sockaddr *" + "'"); + } + arg2 = reinterpret_cast(argp2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_unsigned_int, 0 | 0); + if (! SWIG_IsOK(res3)) { + SWIG_exception_fail( + SWIG_ArgError(res3), + "in method '" + "zts_bsd_getsockname" + "', argument " + "3" + " of type '" + "zts_socklen_t *" + "'"); + } + arg3 = reinterpret_cast(argp3); + result = (int)zts_bsd_getsockname(arg1, arg2, arg3); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_bsd_getpeername(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + zts_sockaddr* arg2 = (zts_sockaddr*)0; + zts_socklen_t* arg3 = (zts_socklen_t*)0; + int val1; + int ecode1 = 0; + void* argp2 = 0; + int res2 = 0; + void* argp3 = 0; + int res3 = 0; + PyObject* swig_obj[3]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bsd_getpeername", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bsd_getpeername" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_sockaddr, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_bsd_getpeername" + "', argument " + "2" + " of type '" + "zts_sockaddr *" + "'"); + } + arg2 = reinterpret_cast(argp2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_unsigned_int, 0 | 0); + if (! SWIG_IsOK(res3)) { + SWIG_exception_fail( + SWIG_ArgError(res3), + "in method '" + "zts_bsd_getpeername" + "', argument " + "3" + " of type '" + "zts_socklen_t *" + "'"); + } + arg3 = reinterpret_cast(argp3); + result = (int)zts_bsd_getpeername(arg1, arg2, arg3); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_bsd_close(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bsd_close" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_bsd_close(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_timeval_tv_sec_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_timeval* arg1 = (zts_timeval*)0; + long arg2; + void* argp1 = 0; + int res1 = 0; + long val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_timeval_tv_sec_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_timeval, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_timeval_tv_sec_set" + "', argument " + "1" + " of type '" + "zts_timeval *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_long(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_timeval_tv_sec_set" + "', argument " + "2" + " of type '" + "long" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->tv_sec = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_timeval_tv_sec_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_timeval* arg1 = (zts_timeval*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + long result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_timeval, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_timeval_tv_sec_get" + "', argument " + "1" + " of type '" + "zts_timeval *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (long)((arg1)->tv_sec); + resultobj = SWIG_From_long(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_timeval_tv_usec_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_timeval* arg1 = (zts_timeval*)0; + long arg2; + void* argp1 = 0; + int res1 = 0; + long val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_timeval_tv_usec_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_timeval, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_timeval_tv_usec_set" + "', argument " + "1" + " of type '" + "zts_timeval *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_long(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_timeval_tv_usec_set" + "', argument " + "2" + " of type '" + "long" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->tv_usec = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_timeval_tv_usec_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_timeval* arg1 = (zts_timeval*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + long result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_timeval, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_timeval_tv_usec_get" + "', argument " + "1" + " of type '" + "zts_timeval *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (long)((arg1)->tv_usec); + resultobj = SWIG_From_long(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_new_zts_timeval(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_timeval* result = 0; + + if (! SWIG_Python_UnpackTuple(args, "new_zts_timeval", 0, 0, 0)) + SWIG_fail; + result = (zts_timeval*)new zts_timeval(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_timeval, SWIG_POINTER_NEW | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_delete_zts_timeval(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_timeval* arg1 = (zts_timeval*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_timeval, SWIG_POINTER_DISOWN | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "delete_zts_timeval" + "', argument " + "1" + " of type '" + "zts_timeval *" + "'"); + } + arg1 = reinterpret_cast(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* zts_timeval_swigregister(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* obj; + if (! SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) + return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_zts_timeval, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* zts_timeval_swiginit(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + return SWIG_Python_InitShadowInstance(args); +} + +SWIGINTERN PyObject* _wrap_zts_bsd_select(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + zts_fd_set* arg2 = (zts_fd_set*)0; + zts_fd_set* arg3 = (zts_fd_set*)0; + zts_fd_set* arg4 = (zts_fd_set*)0; + zts_timeval* arg5 = (zts_timeval*)0; + int val1; + int ecode1 = 0; + void* argp2 = 0; + int res2 = 0; + void* argp3 = 0; + int res3 = 0; + void* argp4 = 0; + int res4 = 0; + void* argp5 = 0; + int res5 = 0; + PyObject* swig_obj[5]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bsd_select", 5, 5, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bsd_select" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_fd_set, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_bsd_select" + "', argument " + "2" + " of type '" + "zts_fd_set *" + "'"); + } + arg2 = reinterpret_cast(argp2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_zts_fd_set, 0 | 0); + if (! SWIG_IsOK(res3)) { + SWIG_exception_fail( + SWIG_ArgError(res3), + "in method '" + "zts_bsd_select" + "', argument " + "3" + " of type '" + "zts_fd_set *" + "'"); + } + arg3 = reinterpret_cast(argp3); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4, SWIGTYPE_p_zts_fd_set, 0 | 0); + if (! SWIG_IsOK(res4)) { + SWIG_exception_fail( + SWIG_ArgError(res4), + "in method '" + "zts_bsd_select" + "', argument " + "4" + " of type '" + "zts_fd_set *" + "'"); + } + arg4 = reinterpret_cast(argp4); + res5 = SWIG_ConvertPtr(swig_obj[4], &argp5, SWIGTYPE_p_zts_timeval, 0 | 0); + if (! SWIG_IsOK(res5)) { + SWIG_exception_fail( + SWIG_ArgError(res5), + "in method '" + "zts_bsd_select" + "', argument " + "5" + " of type '" + "zts_timeval *" + "'"); + } + arg5 = reinterpret_cast(argp5); + result = (int)zts_bsd_select(arg1, arg2, arg3, arg4, arg5); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_bsd_fcntl(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int arg2; + int arg3; + int val1; + int ecode1 = 0; + int val2; + int ecode2 = 0; + int val3; + int ecode3 = 0; + PyObject* swig_obj[3]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bsd_fcntl", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bsd_fcntl" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_bsd_fcntl" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_bsd_fcntl" + "', argument " + "3" + " of type '" + "int" + "'"); + } + arg3 = static_cast(val3); + result = (int)zts_bsd_fcntl(arg1, arg2, arg3); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_bsd_poll(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_pollfd* arg1 = (zts_pollfd*)0; + zts_nfds_t arg2; + int arg3; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + int val3; + int ecode3 = 0; + PyObject* swig_obj[3]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bsd_poll", 3, 3, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_pollfd, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_bsd_poll" + "', argument " + "1" + " of type '" + "zts_pollfd *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_bsd_poll" + "', argument " + "2" + " of type '" + "zts_nfds_t" + "'"); + } + arg2 = static_cast(val2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_bsd_poll" + "', argument " + "3" + " of type '" + "int" + "'"); + } + arg3 = static_cast(val3); + result = (int)zts_bsd_poll(arg1, arg2, arg3); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_bsd_ioctl(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + unsigned long arg2; + void* arg3 = (void*)0; + int val1; + int ecode1 = 0; + unsigned long val2; + int ecode2 = 0; + int res3; + PyObject* swig_obj[3]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bsd_ioctl", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bsd_ioctl" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_unsigned_SS_long(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_bsd_ioctl" + "', argument " + "2" + " of type '" + "unsigned long" + "'"); + } + arg2 = static_cast(val2); + res3 = SWIG_ConvertPtr(swig_obj[2], SWIG_as_voidptrptr(&arg3), 0, 0); + if (! SWIG_IsOK(res3)) { + SWIG_exception_fail( + SWIG_ArgError(res3), + "in method '" + "zts_bsd_ioctl" + "', argument " + "3" + " of type '" + "void *" + "'"); + } + result = (int)zts_bsd_ioctl(arg1, arg2, arg3); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_bsd_send(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + void* arg2 = (void*)0; + size_t arg3; + int arg4; + int val1; + int ecode1 = 0; + int res2; + size_t val3; + int ecode3 = 0; + int val4; + int ecode4 = 0; + PyObject* swig_obj[4]; + ssize_t result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bsd_send", 4, 4, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bsd_send" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], SWIG_as_voidptrptr(&arg2), 0, 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_bsd_send" + "', argument " + "2" + " of type '" + "void const *" + "'"); + } + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_bsd_send" + "', argument " + "3" + " of type '" + "size_t" + "'"); + } + arg3 = static_cast(val3); + ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); + if (! SWIG_IsOK(ecode4)) { + SWIG_exception_fail( + SWIG_ArgError(ecode4), + "in method '" + "zts_bsd_send" + "', argument " + "4" + " of type '" + "int" + "'"); + } + arg4 = static_cast(val4); + result = zts_bsd_send(arg1, (void const*)arg2, arg3, arg4); + resultobj = SWIG_NewPointerObj( + (new ssize_t(static_cast(result))), + SWIGTYPE_p_ssize_t, + SWIG_POINTER_OWN | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_bsd_sendto(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + void* arg2 = (void*)0; + size_t arg3; + int arg4; + zts_sockaddr* arg5 = (zts_sockaddr*)0; + zts_socklen_t arg6; + int val1; + int ecode1 = 0; + int res2; + size_t val3; + int ecode3 = 0; + int val4; + int ecode4 = 0; + void* argp5 = 0; + int res5 = 0; + unsigned int val6; + int ecode6 = 0; + PyObject* swig_obj[6]; + ssize_t result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bsd_sendto", 6, 6, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bsd_sendto" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], SWIG_as_voidptrptr(&arg2), 0, 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_bsd_sendto" + "', argument " + "2" + " of type '" + "void const *" + "'"); + } + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_bsd_sendto" + "', argument " + "3" + " of type '" + "size_t" + "'"); + } + arg3 = static_cast(val3); + ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); + if (! SWIG_IsOK(ecode4)) { + SWIG_exception_fail( + SWIG_ArgError(ecode4), + "in method '" + "zts_bsd_sendto" + "', argument " + "4" + " of type '" + "int" + "'"); + } + arg4 = static_cast(val4); + res5 = SWIG_ConvertPtr(swig_obj[4], &argp5, SWIGTYPE_p_zts_sockaddr, 0 | 0); + if (! SWIG_IsOK(res5)) { + SWIG_exception_fail( + SWIG_ArgError(res5), + "in method '" + "zts_bsd_sendto" + "', argument " + "5" + " of type '" + "zts_sockaddr const *" + "'"); + } + arg5 = reinterpret_cast(argp5); + ecode6 = SWIG_AsVal_unsigned_SS_int(swig_obj[5], &val6); + if (! SWIG_IsOK(ecode6)) { + SWIG_exception_fail( + SWIG_ArgError(ecode6), + "in method '" + "zts_bsd_sendto" + "', argument " + "6" + " of type '" + "zts_socklen_t" + "'"); + } + arg6 = static_cast(val6); + result = zts_bsd_sendto(arg1, (void const*)arg2, arg3, arg4, (zts_sockaddr const*)arg5, arg6); + resultobj = SWIG_NewPointerObj( + (new ssize_t(static_cast(result))), + SWIGTYPE_p_ssize_t, + SWIG_POINTER_OWN | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_iovec_iov_base_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_iovec* arg1 = (zts_iovec*)0; + void* arg2 = (void*)0; + void* argp1 = 0; + int res1 = 0; + int res2; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_iovec_iov_base_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_iovec, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_iovec_iov_base_set" + "', argument " + "1" + " of type '" + "zts_iovec *" + "'"); + } + arg1 = reinterpret_cast(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], SWIG_as_voidptrptr(&arg2), 0, SWIG_POINTER_DISOWN); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_iovec_iov_base_set" + "', argument " + "2" + " of type '" + "void *" + "'"); + } + if (arg1) + (arg1)->iov_base = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_iovec_iov_base_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_iovec* arg1 = (zts_iovec*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + void* result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_iovec, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_iovec_iov_base_get" + "', argument " + "1" + " of type '" + "zts_iovec *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (void*)((arg1)->iov_base); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_iovec_iov_len_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_iovec* arg1 = (zts_iovec*)0; + size_t arg2; + void* argp1 = 0; + int res1 = 0; + size_t val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_iovec_iov_len_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_iovec, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_iovec_iov_len_set" + "', argument " + "1" + " of type '" + "zts_iovec *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_iovec_iov_len_set" + "', argument " + "2" + " of type '" + "size_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->iov_len = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_iovec_iov_len_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_iovec* arg1 = (zts_iovec*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + size_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_iovec, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_iovec_iov_len_get" + "', argument " + "1" + " of type '" + "zts_iovec *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = ((arg1)->iov_len); + resultobj = SWIG_From_size_t(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_new_zts_iovec(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_iovec* result = 0; + + if (! SWIG_Python_UnpackTuple(args, "new_zts_iovec", 0, 0, 0)) + SWIG_fail; + result = (zts_iovec*)new zts_iovec(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_iovec, SWIG_POINTER_NEW | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_delete_zts_iovec(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_iovec* arg1 = (zts_iovec*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_iovec, SWIG_POINTER_DISOWN | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "delete_zts_iovec" + "', argument " + "1" + " of type '" + "zts_iovec *" + "'"); + } + arg1 = reinterpret_cast(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* zts_iovec_swigregister(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* obj; + if (! SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) + return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_zts_iovec, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* zts_iovec_swiginit(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + return SWIG_Python_InitShadowInstance(args); +} + +SWIGINTERN PyObject* _wrap_zts_bsd_sendmsg(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + zts_msghdr* arg2 = (zts_msghdr*)0; + int arg3; + int val1; + int ecode1 = 0; + void* argp2 = 0; + int res2 = 0; + int val3; + int ecode3 = 0; + PyObject* swig_obj[3]; + ssize_t result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bsd_sendmsg", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bsd_sendmsg" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_msghdr, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_bsd_sendmsg" + "', argument " + "2" + " of type '" + "zts_msghdr const *" + "'"); + } + arg2 = reinterpret_cast(argp2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_bsd_sendmsg" + "', argument " + "3" + " of type '" + "int" + "'"); + } + arg3 = static_cast(val3); + result = zts_bsd_sendmsg(arg1, (zts_msghdr const*)arg2, arg3); + resultobj = SWIG_NewPointerObj( + (new ssize_t(static_cast(result))), + SWIGTYPE_p_ssize_t, + SWIG_POINTER_OWN | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_bsd_recv(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + void* arg2 = (void*)0; + size_t arg3; + int arg4; + int val1; + int ecode1 = 0; + int res2; + size_t val3; + int ecode3 = 0; + int val4; + int ecode4 = 0; + PyObject* swig_obj[4]; + ssize_t result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bsd_recv", 4, 4, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bsd_recv" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], SWIG_as_voidptrptr(&arg2), 0, 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_bsd_recv" + "', argument " + "2" + " of type '" + "void *" + "'"); + } + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_bsd_recv" + "', argument " + "3" + " of type '" + "size_t" + "'"); + } + arg3 = static_cast(val3); + ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); + if (! SWIG_IsOK(ecode4)) { + SWIG_exception_fail( + SWIG_ArgError(ecode4), + "in method '" + "zts_bsd_recv" + "', argument " + "4" + " of type '" + "int" + "'"); + } + arg4 = static_cast(val4); + result = zts_bsd_recv(arg1, arg2, arg3, arg4); + resultobj = SWIG_NewPointerObj( + (new ssize_t(static_cast(result))), + SWIGTYPE_p_ssize_t, + SWIG_POINTER_OWN | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_bsd_recvfrom(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + void* arg2 = (void*)0; + size_t arg3; + int arg4; + zts_sockaddr* arg5 = (zts_sockaddr*)0; + zts_socklen_t* arg6 = (zts_socklen_t*)0; + int val1; + int ecode1 = 0; + int res2; + size_t val3; + int ecode3 = 0; + int val4; + int ecode4 = 0; + void* argp5 = 0; + int res5 = 0; + void* argp6 = 0; + int res6 = 0; + PyObject* swig_obj[6]; + ssize_t result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bsd_recvfrom", 6, 6, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bsd_recvfrom" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], SWIG_as_voidptrptr(&arg2), 0, 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_bsd_recvfrom" + "', argument " + "2" + " of type '" + "void *" + "'"); + } + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_bsd_recvfrom" + "', argument " + "3" + " of type '" + "size_t" + "'"); + } + arg3 = static_cast(val3); + ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); + if (! SWIG_IsOK(ecode4)) { + SWIG_exception_fail( + SWIG_ArgError(ecode4), + "in method '" + "zts_bsd_recvfrom" + "', argument " + "4" + " of type '" + "int" + "'"); + } + arg4 = static_cast(val4); + res5 = SWIG_ConvertPtr(swig_obj[4], &argp5, SWIGTYPE_p_zts_sockaddr, 0 | 0); + if (! SWIG_IsOK(res5)) { + SWIG_exception_fail( + SWIG_ArgError(res5), + "in method '" + "zts_bsd_recvfrom" + "', argument " + "5" + " of type '" + "zts_sockaddr *" + "'"); + } + arg5 = reinterpret_cast(argp5); + res6 = SWIG_ConvertPtr(swig_obj[5], &argp6, SWIGTYPE_p_unsigned_int, 0 | 0); + if (! SWIG_IsOK(res6)) { + SWIG_exception_fail( + SWIG_ArgError(res6), + "in method '" + "zts_bsd_recvfrom" + "', argument " + "6" + " of type '" + "zts_socklen_t *" + "'"); + } + arg6 = reinterpret_cast(argp6); + result = zts_bsd_recvfrom(arg1, arg2, arg3, arg4, arg5, arg6); + resultobj = SWIG_NewPointerObj( + (new ssize_t(static_cast(result))), + SWIGTYPE_p_ssize_t, + SWIG_POINTER_OWN | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_bsd_recvmsg(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + zts_msghdr* arg2 = (zts_msghdr*)0; + int arg3; + int val1; + int ecode1 = 0; + void* argp2 = 0; + int res2 = 0; + int val3; + int ecode3 = 0; + PyObject* swig_obj[3]; + ssize_t result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bsd_recvmsg", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bsd_recvmsg" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_msghdr, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_bsd_recvmsg" + "', argument " + "2" + " of type '" + "zts_msghdr *" + "'"); + } + arg2 = reinterpret_cast(argp2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_bsd_recvmsg" + "', argument " + "3" + " of type '" + "int" + "'"); + } + arg3 = static_cast(val3); + result = zts_bsd_recvmsg(arg1, arg2, arg3); + resultobj = SWIG_NewPointerObj( + (new ssize_t(static_cast(result))), + SWIGTYPE_p_ssize_t, + SWIG_POINTER_OWN | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_bsd_read(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + void* arg2 = (void*)0; + size_t arg3; + int val1; + int ecode1 = 0; + int res2; + size_t val3; + int ecode3 = 0; + PyObject* swig_obj[3]; + ssize_t result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bsd_read", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bsd_read" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], SWIG_as_voidptrptr(&arg2), 0, 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_bsd_read" + "', argument " + "2" + " of type '" + "void *" + "'"); + } + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_bsd_read" + "', argument " + "3" + " of type '" + "size_t" + "'"); + } + arg3 = static_cast(val3); + result = zts_bsd_read(arg1, arg2, arg3); + resultobj = SWIG_NewPointerObj( + (new ssize_t(static_cast(result))), + SWIGTYPE_p_ssize_t, + SWIG_POINTER_OWN | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_bsd_readv(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + zts_iovec* arg2 = (zts_iovec*)0; + int arg3; + int val1; + int ecode1 = 0; + void* argp2 = 0; + int res2 = 0; + int val3; + int ecode3 = 0; + PyObject* swig_obj[3]; + ssize_t result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bsd_readv", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bsd_readv" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_iovec, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_bsd_readv" + "', argument " + "2" + " of type '" + "zts_iovec const *" + "'"); + } + arg2 = reinterpret_cast(argp2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_bsd_readv" + "', argument " + "3" + " of type '" + "int" + "'"); + } + arg3 = static_cast(val3); + result = zts_bsd_readv(arg1, (zts_iovec const*)arg2, arg3); + resultobj = SWIG_NewPointerObj( + (new ssize_t(static_cast(result))), + SWIGTYPE_p_ssize_t, + SWIG_POINTER_OWN | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_bsd_write(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + void* arg2 = (void*)0; + size_t arg3; + int val1; + int ecode1 = 0; + int res2; + size_t val3; + int ecode3 = 0; + PyObject* swig_obj[3]; + ssize_t result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bsd_write", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bsd_write" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], SWIG_as_voidptrptr(&arg2), 0, 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_bsd_write" + "', argument " + "2" + " of type '" + "void const *" + "'"); + } + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_bsd_write" + "', argument " + "3" + " of type '" + "size_t" + "'"); + } + arg3 = static_cast(val3); + result = zts_bsd_write(arg1, (void const*)arg2, arg3); + resultobj = SWIG_NewPointerObj( + (new ssize_t(static_cast(result))), + SWIGTYPE_p_ssize_t, + SWIG_POINTER_OWN | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_bsd_writev(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + zts_iovec* arg2 = (zts_iovec*)0; + int arg3; + int val1; + int ecode1 = 0; + void* argp2 = 0; + int res2 = 0; + int val3; + int ecode3 = 0; + PyObject* swig_obj[3]; + ssize_t result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bsd_writev", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bsd_writev" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_iovec, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_bsd_writev" + "', argument " + "2" + " of type '" + "zts_iovec const *" + "'"); + } + arg2 = reinterpret_cast(argp2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_bsd_writev" + "', argument " + "3" + " of type '" + "int" + "'"); + } + arg3 = static_cast(val3); + result = zts_bsd_writev(arg1, (zts_iovec const*)arg2, arg3); + resultobj = SWIG_NewPointerObj( + (new ssize_t(static_cast(result))), + SWIGTYPE_p_ssize_t, + SWIG_POINTER_OWN | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_bsd_shutdown(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int arg2; + int val1; + int ecode1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bsd_shutdown", 2, 2, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bsd_shutdown" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_bsd_shutdown" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + result = (int)zts_bsd_shutdown(arg1, arg2); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_connect(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + char* arg2 = (char*)0; + unsigned short arg3; + int arg4; + int val1; + int ecode1 = 0; + int res2; + char* buf2 = 0; + int alloc2 = 0; + unsigned short val3; + int ecode3 = 0; + int val4; + int ecode4 = 0; + PyObject* swig_obj[4]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_connect", 4, 4, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_connect" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_connect" + "', argument " + "2" + " of type '" + "char const *" + "'"); + } + arg2 = reinterpret_cast(buf2); + ecode3 = SWIG_AsVal_unsigned_SS_short(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_connect" + "', argument " + "3" + " of type '" + "unsigned short" + "'"); + } + arg3 = static_cast(val3); + ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); + if (! SWIG_IsOK(ecode4)) { + SWIG_exception_fail( + SWIG_ArgError(ecode4), + "in method '" + "zts_connect" + "', argument " + "4" + " of type '" + "int" + "'"); + } + arg4 = static_cast(val4); + result = (int)zts_connect(arg1, (char const*)arg2, arg3, arg4); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc2 == SWIG_NEWOBJ) + delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) + delete[] buf2; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_bind(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + char* arg2 = (char*)0; + unsigned short arg3; + int val1; + int ecode1 = 0; + int res2; + char* buf2 = 0; + int alloc2 = 0; + unsigned short val3; + int ecode3 = 0; + PyObject* swig_obj[3]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_bind", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_bind" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_bind" + "', argument " + "2" + " of type '" + "char const *" + "'"); + } + arg2 = reinterpret_cast(buf2); + ecode3 = SWIG_AsVal_unsigned_SS_short(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_bind" + "', argument " + "3" + " of type '" + "unsigned short" + "'"); + } + arg3 = static_cast(val3); + result = (int)zts_bind(arg1, (char const*)arg2, arg3); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc2 == SWIG_NEWOBJ) + delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) + delete[] buf2; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_accept(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + char* arg2 = (char*)0; + int arg3; + unsigned short* arg4 = (unsigned short*)0; + int val1; + int ecode1 = 0; + int res2; + char* buf2 = 0; + int alloc2 = 0; + int val3; + int ecode3 = 0; + void* argp4 = 0; + int res4 = 0; + PyObject* swig_obj[4]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_accept", 4, 4, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_accept" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_accept" + "', argument " + "2" + " of type '" + "char *" + "'"); + } + arg2 = reinterpret_cast(buf2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_accept" + "', argument " + "3" + " of type '" + "int" + "'"); + } + arg3 = static_cast(val3); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4, SWIGTYPE_p_unsigned_short, 0 | 0); + if (! SWIG_IsOK(res4)) { + SWIG_exception_fail( + SWIG_ArgError(res4), + "in method '" + "zts_accept" + "', argument " + "4" + " of type '" + "unsigned short *" + "'"); + } + arg4 = reinterpret_cast(argp4); + result = (int)zts_accept(arg1, arg2, arg3, arg4); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc2 == SWIG_NEWOBJ) + delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) + delete[] buf2; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_getpeername(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + char* arg2 = (char*)0; + int arg3; + unsigned short* arg4 = (unsigned short*)0; + int val1; + int ecode1 = 0; + int res2; + char* buf2 = 0; + int alloc2 = 0; + int val3; + int ecode3 = 0; + void* argp4 = 0; + int res4 = 0; + PyObject* swig_obj[4]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_getpeername", 4, 4, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_getpeername" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_getpeername" + "', argument " + "2" + " of type '" + "char *" + "'"); + } + arg2 = reinterpret_cast(buf2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_getpeername" + "', argument " + "3" + " of type '" + "int" + "'"); + } + arg3 = static_cast(val3); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4, SWIGTYPE_p_unsigned_short, 0 | 0); + if (! SWIG_IsOK(res4)) { + SWIG_exception_fail( + SWIG_ArgError(res4), + "in method '" + "zts_getpeername" + "', argument " + "4" + " of type '" + "unsigned short *" + "'"); + } + arg4 = reinterpret_cast(argp4); + result = (int)zts_getpeername(arg1, arg2, arg3, arg4); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc2 == SWIG_NEWOBJ) + delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) + delete[] buf2; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_getsockname(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + char* arg2 = (char*)0; + int arg3; + unsigned short* arg4 = (unsigned short*)0; + int val1; + int ecode1 = 0; + int res2; + char* buf2 = 0; + int alloc2 = 0; + int val3; + int ecode3 = 0; + void* argp4 = 0; + int res4 = 0; + PyObject* swig_obj[4]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_getsockname", 4, 4, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_getsockname" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_getsockname" + "', argument " + "2" + " of type '" + "char *" + "'"); + } + arg2 = reinterpret_cast(buf2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_getsockname" + "', argument " + "3" + " of type '" + "int" + "'"); + } + arg3 = static_cast(val3); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4, SWIGTYPE_p_unsigned_short, 0 | 0); + if (! SWIG_IsOK(res4)) { + SWIG_exception_fail( + SWIG_ArgError(res4), + "in method '" + "zts_getsockname" + "', argument " + "4" + " of type '" + "unsigned short *" + "'"); + } + arg4 = reinterpret_cast(argp4); + result = (int)zts_getsockname(arg1, arg2, arg3, arg4); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc2 == SWIG_NEWOBJ) + delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) + delete[] buf2; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_tcp_client(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + char* arg1 = (char*)0; + unsigned short arg2; + int res1; + char* buf1 = 0; + int alloc1 = 0; + unsigned short val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_tcp_client", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_tcp_client" + "', argument " + "1" + " of type '" + "char const *" + "'"); + } + arg1 = reinterpret_cast(buf1); + ecode2 = SWIG_AsVal_unsigned_SS_short(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_tcp_client" + "', argument " + "2" + " of type '" + "unsigned short" + "'"); + } + arg2 = static_cast(val2); + result = (int)zts_tcp_client((char const*)arg1, arg2); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_tcp_server(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + char* arg1 = (char*)0; + unsigned short arg2; + char* arg3 = (char*)0; + int arg4; + unsigned short* arg5 = (unsigned short*)0; + int res1; + char* buf1 = 0; + int alloc1 = 0; + unsigned short val2; + int ecode2 = 0; + int res3; + char* buf3 = 0; + int alloc3 = 0; + int val4; + int ecode4 = 0; + void* argp5 = 0; + int res5 = 0; + PyObject* swig_obj[5]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_tcp_server", 5, 5, swig_obj)) + SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_tcp_server" + "', argument " + "1" + " of type '" + "char const *" + "'"); + } + arg1 = reinterpret_cast(buf1); + ecode2 = SWIG_AsVal_unsigned_SS_short(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_tcp_server" + "', argument " + "2" + " of type '" + "unsigned short" + "'"); + } + arg2 = static_cast(val2); + res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3); + if (! SWIG_IsOK(res3)) { + SWIG_exception_fail( + SWIG_ArgError(res3), + "in method '" + "zts_tcp_server" + "', argument " + "3" + " of type '" + "char *" + "'"); + } + arg3 = reinterpret_cast(buf3); + ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); + if (! SWIG_IsOK(ecode4)) { + SWIG_exception_fail( + SWIG_ArgError(ecode4), + "in method '" + "zts_tcp_server" + "', argument " + "4" + " of type '" + "int" + "'"); + } + arg4 = static_cast(val4); + res5 = SWIG_ConvertPtr(swig_obj[4], &argp5, SWIGTYPE_p_unsigned_short, 0 | 0); + if (! SWIG_IsOK(res5)) { + SWIG_exception_fail( + SWIG_ArgError(res5), + "in method '" + "zts_tcp_server" + "', argument " + "5" + " of type '" + "unsigned short *" + "'"); + } + arg5 = reinterpret_cast(argp5); + result = (int)zts_tcp_server((char const*)arg1, arg2, arg3, arg4, arg5); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + if (alloc3 == SWIG_NEWOBJ) + delete[] buf3; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + if (alloc3 == SWIG_NEWOBJ) + delete[] buf3; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_udp_server(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + char* arg1 = (char*)0; + unsigned short arg2; + int res1; + char* buf1 = 0; + int alloc1 = 0; + unsigned short val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_udp_server", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_udp_server" + "', argument " + "1" + " of type '" + "char const *" + "'"); + } + arg1 = reinterpret_cast(buf1); + ecode2 = SWIG_AsVal_unsigned_SS_short(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_udp_server" + "', argument " + "2" + " of type '" + "unsigned short" + "'"); + } + arg2 = static_cast(val2); + result = (int)zts_udp_server((char const*)arg1, arg2); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_udp_client(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + char* arg1 = (char*)0; + int res1; + char* buf1 = 0; + int alloc1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_udp_client" + "', argument " + "1" + " of type '" + "char const *" + "'"); + } + arg1 = reinterpret_cast(buf1); + result = (int)zts_udp_client((char const*)arg1); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_set_no_delay(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int arg2; + int val1; + int ecode1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_set_no_delay", 2, 2, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_set_no_delay" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_set_no_delay" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + result = (int)zts_set_no_delay(arg1, arg2); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_get_no_delay(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_get_no_delay" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_get_no_delay(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_set_linger(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int arg2; + int arg3; + int val1; + int ecode1 = 0; + int val2; + int ecode2 = 0; + int val3; + int ecode3 = 0; + PyObject* swig_obj[3]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_set_linger", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_set_linger" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_set_linger" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_set_linger" + "', argument " + "3" + " of type '" + "int" + "'"); + } + arg3 = static_cast(val3); + result = (int)zts_set_linger(arg1, arg2, arg3); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_get_linger_enabled(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_get_linger_enabled" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_get_linger_enabled(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_get_linger_value(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_get_linger_value" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_get_linger_value(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_get_pending_data_size(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_get_pending_data_size" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_get_pending_data_size(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_set_reuse_addr(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int arg2; + int val1; + int ecode1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_set_reuse_addr", 2, 2, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_set_reuse_addr" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_set_reuse_addr" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + result = (int)zts_set_reuse_addr(arg1, arg2); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_get_reuse_addr(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_get_reuse_addr" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_get_reuse_addr(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_set_recv_timeout(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int arg2; + int arg3; + int val1; + int ecode1 = 0; + int val2; + int ecode2 = 0; + int val3; + int ecode3 = 0; + PyObject* swig_obj[3]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_set_recv_timeout", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_set_recv_timeout" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_set_recv_timeout" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_set_recv_timeout" + "', argument " + "3" + " of type '" + "int" + "'"); + } + arg3 = static_cast(val3); + result = (int)zts_set_recv_timeout(arg1, arg2, arg3); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_get_recv_timeout(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_get_recv_timeout" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_get_recv_timeout(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_set_send_timeout(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int arg2; + int arg3; + int val1; + int ecode1 = 0; + int val2; + int ecode2 = 0; + int val3; + int ecode3 = 0; + PyObject* swig_obj[3]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_set_send_timeout", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_set_send_timeout" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_set_send_timeout" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (! SWIG_IsOK(ecode3)) { + SWIG_exception_fail( + SWIG_ArgError(ecode3), + "in method '" + "zts_set_send_timeout" + "', argument " + "3" + " of type '" + "int" + "'"); + } + arg3 = static_cast(val3); + result = (int)zts_set_send_timeout(arg1, arg2, arg3); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_get_send_timeout(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_get_send_timeout" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_get_send_timeout(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_set_send_buf_size(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int arg2; + int val1; + int ecode1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_set_send_buf_size", 2, 2, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_set_send_buf_size" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_set_send_buf_size" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + result = (int)zts_set_send_buf_size(arg1, arg2); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_get_send_buf_size(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_get_send_buf_size" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_get_send_buf_size(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_set_recv_buf_size(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int arg2; + int val1; + int ecode1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_set_recv_buf_size", 2, 2, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_set_recv_buf_size" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_set_recv_buf_size" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + result = (int)zts_set_recv_buf_size(arg1, arg2); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_get_recv_buf_size(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_get_recv_buf_size" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_get_recv_buf_size(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_set_ttl(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int arg2; + int val1; + int ecode1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_set_ttl", 2, 2, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_set_ttl" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_set_ttl" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + result = (int)zts_set_ttl(arg1, arg2); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_get_ttl(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_get_ttl" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_get_ttl(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_set_blocking(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int arg2; + int val1; + int ecode1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_set_blocking", 2, 2, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_set_blocking" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_set_blocking" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + result = (int)zts_set_blocking(arg1, arg2); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_get_blocking(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_get_blocking" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_get_blocking(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_set_keepalive(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int arg2; + int val1; + int ecode1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_set_keepalive", 2, 2, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_set_keepalive" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_set_keepalive" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + result = (int)zts_set_keepalive(arg1, arg2); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_get_keepalive(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + int val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_get_keepalive" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_get_keepalive(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_hostent_h_name_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_hostent* arg1 = (zts_hostent*)0; + char* arg2 = (char*)0; + void* argp1 = 0; + int res1 = 0; + int res2; + char* buf2 = 0; + int alloc2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_hostent_h_name_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_hostent, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_hostent_h_name_set" + "', argument " + "1" + " of type '" + "zts_hostent *" + "'"); + } + arg1 = reinterpret_cast(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_hostent_h_name_set" + "', argument " + "2" + " of type '" + "char *" + "'"); + } + arg2 = reinterpret_cast(buf2); + if (arg1->h_name) + delete[] arg1->h_name; + if (arg2) { + size_t size = strlen(reinterpret_cast(arg2)) + 1; + arg1->h_name = (char*)reinterpret_cast( + memcpy(new char[size], reinterpret_cast(arg2), sizeof(char) * (size))); + } + else { + arg1->h_name = 0; + } + resultobj = SWIG_Py_Void(); + if (alloc2 == SWIG_NEWOBJ) + delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) + delete[] buf2; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_hostent_h_name_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_hostent* arg1 = (zts_hostent*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + char* result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_hostent, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_hostent_h_name_get" + "', argument " + "1" + " of type '" + "zts_hostent *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (char*)((arg1)->h_name); + resultobj = SWIG_FromCharPtr((const char*)result); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_hostent_h_aliases_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_hostent* arg1 = (zts_hostent*)0; + char** arg2 = (char**)0; + void* argp1 = 0; + int res1 = 0; + void* argp2 = 0; + int res2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_hostent_h_aliases_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_hostent, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_hostent_h_aliases_set" + "', argument " + "1" + " of type '" + "zts_hostent *" + "'"); + } + arg1 = reinterpret_cast(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_p_char, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_hostent_h_aliases_set" + "', argument " + "2" + " of type '" + "char **" + "'"); + } + arg2 = reinterpret_cast(argp2); + if (arg1) + (arg1)->h_aliases = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_hostent_h_aliases_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_hostent* arg1 = (zts_hostent*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + char** result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_hostent, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_hostent_h_aliases_get" + "', argument " + "1" + " of type '" + "zts_hostent *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (char**)((arg1)->h_aliases); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_char, 0 | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_hostent_h_addrtype_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_hostent* arg1 = (zts_hostent*)0; + int arg2; + void* argp1 = 0; + int res1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_hostent_h_addrtype_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_hostent, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_hostent_h_addrtype_set" + "', argument " + "1" + " of type '" + "zts_hostent *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_hostent_h_addrtype_set" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->h_addrtype = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_hostent_h_addrtype_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_hostent* arg1 = (zts_hostent*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_hostent, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_hostent_h_addrtype_get" + "', argument " + "1" + " of type '" + "zts_hostent *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (int)((arg1)->h_addrtype); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_hostent_h_length_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_hostent* arg1 = (zts_hostent*)0; + int arg2; + void* argp1 = 0; + int res1 = 0; + int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_hostent_h_length_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_hostent, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_hostent_h_length_set" + "', argument " + "1" + " of type '" + "zts_hostent *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_hostent_h_length_set" + "', argument " + "2" + " of type '" + "int" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->h_length = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_hostent_h_length_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_hostent* arg1 = (zts_hostent*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_hostent, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_hostent_h_length_get" + "', argument " + "1" + " of type '" + "zts_hostent *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (int)((arg1)->h_length); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_hostent_h_addr_list_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_hostent* arg1 = (zts_hostent*)0; + char** arg2 = (char**)0; + void* argp1 = 0; + int res1 = 0; + void* argp2 = 0; + int res2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_hostent_h_addr_list_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_hostent, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_hostent_h_addr_list_set" + "', argument " + "1" + " of type '" + "zts_hostent *" + "'"); + } + arg1 = reinterpret_cast(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_p_char, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_hostent_h_addr_list_set" + "', argument " + "2" + " of type '" + "char **" + "'"); + } + arg2 = reinterpret_cast(argp2); + if (arg1) + (arg1)->h_addr_list = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_hostent_h_addr_list_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_hostent* arg1 = (zts_hostent*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + char** result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_hostent, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_hostent_h_addr_list_get" + "', argument " + "1" + " of type '" + "zts_hostent *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (char**)((arg1)->h_addr_list); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_char, 0 | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_new_zts_hostent(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_hostent* result = 0; + + if (! SWIG_Python_UnpackTuple(args, "new_zts_hostent", 0, 0, 0)) + SWIG_fail; + result = (zts_hostent*)new zts_hostent(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_hostent, SWIG_POINTER_NEW | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_delete_zts_hostent(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_hostent* arg1 = (zts_hostent*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_hostent, SWIG_POINTER_DISOWN | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "delete_zts_hostent" + "', argument " + "1" + " of type '" + "zts_hostent *" + "'"); + } + arg1 = reinterpret_cast(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* zts_hostent_swigregister(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* obj; + if (! SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) + return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_zts_hostent, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* zts_hostent_swiginit(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + return SWIG_Python_InitShadowInstance(args); +} + +SWIGINTERN PyObject* _wrap_zts_bsd_gethostbyname(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + char* arg1 = (char*)0; + int res1; + char* buf1 = 0; + int alloc1 = 0; + PyObject* swig_obj[1]; + zts_hostent* result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_bsd_gethostbyname" + "', argument " + "1" + " of type '" + "char const *" + "'"); + } + arg1 = reinterpret_cast(buf1); + result = (zts_hostent*)zts_bsd_gethostbyname((char const*)arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_hostent, 0 | 0); + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_ip4_addr_addr_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_ip4_addr* arg1 = (zts_ip4_addr*)0; + uint32_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_ip4_addr_addr_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_ip4_addr, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_ip4_addr_addr_set" + "', argument " + "1" + " of type '" + "zts_ip4_addr *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_ip4_addr_addr_set" + "', argument " + "2" + " of type '" + "uint32_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->addr = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_ip4_addr_addr_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_ip4_addr* arg1 = (zts_ip4_addr*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_ip4_addr, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_ip4_addr_addr_get" + "', argument " + "1" + " of type '" + "zts_ip4_addr *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t)((arg1)->addr); + resultobj = SWIG_From_unsigned_SS_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_new_zts_ip4_addr(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_ip4_addr* result = 0; + + if (! SWIG_Python_UnpackTuple(args, "new_zts_ip4_addr", 0, 0, 0)) + SWIG_fail; + result = (zts_ip4_addr*)new zts_ip4_addr(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_ip4_addr, SWIG_POINTER_NEW | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_delete_zts_ip4_addr(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_ip4_addr* arg1 = (zts_ip4_addr*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_ip4_addr, SWIG_POINTER_DISOWN | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "delete_zts_ip4_addr" + "', argument " + "1" + " of type '" + "zts_ip4_addr *" + "'"); + } + arg1 = reinterpret_cast(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* zts_ip4_addr_swigregister(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* obj; + if (! SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) + return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_zts_ip4_addr, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* zts_ip4_addr_swiginit(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + return SWIG_Python_InitShadowInstance(args); +} + +SWIGINTERN PyObject* _wrap_zts_ip6_addr_addr_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_ip6_addr* arg1 = (zts_ip6_addr*)0; + uint32_t* arg2; + void* argp1 = 0; + int res1 = 0; + void* argp2 = 0; + int res2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_ip6_addr_addr_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_ip6_addr, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_ip6_addr_addr_set" + "', argument " + "1" + " of type '" + "zts_ip6_addr *" + "'"); + } + arg1 = reinterpret_cast(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_unsigned_int, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_ip6_addr_addr_set" + "', argument " + "2" + " of type '" + "uint32_t [4]" + "'"); + } + arg2 = reinterpret_cast(argp2); + { + if (arg2) { + size_t ii = 0; + for (; ii < (size_t)4; ++ii) + *(uint32_t*)&arg1->addr[ii] = *((uint32_t*)arg2 + ii); + } + else { + SWIG_exception_fail( + SWIG_ValueError, + "invalid null reference " + "in variable '" + "addr" + "' of type '" + "uint32_t [4]" + "'"); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_ip6_addr_addr_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_ip6_addr* arg1 = (zts_ip6_addr*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint32_t* result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_ip6_addr, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_ip6_addr_addr_get" + "', argument " + "1" + " of type '" + "zts_ip6_addr *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint32_t*)(uint32_t*)((arg1)->addr); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_int, 0 | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_new_zts_ip6_addr(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_ip6_addr* result = 0; + + if (! SWIG_Python_UnpackTuple(args, "new_zts_ip6_addr", 0, 0, 0)) + SWIG_fail; + result = (zts_ip6_addr*)new zts_ip6_addr(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_ip6_addr, SWIG_POINTER_NEW | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_delete_zts_ip6_addr(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_ip6_addr* arg1 = (zts_ip6_addr*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_ip6_addr, SWIG_POINTER_DISOWN | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "delete_zts_ip6_addr" + "', argument " + "1" + " of type '" + "zts_ip6_addr *" + "'"); + } + arg1 = reinterpret_cast(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* zts_ip6_addr_swigregister(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* obj; + if (! SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) + return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_zts_ip6_addr, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* zts_ip6_addr_swiginit(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + return SWIG_Python_InitShadowInstance(args); +} + +SWIGINTERN PyObject* _wrap_zts_ip_addr_type_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_ip_addr* arg1 = (zts_ip_addr*)0; + uint8_t arg2; + void* argp1 = 0; + int res1 = 0; + unsigned char val2; + int ecode2 = 0; + PyObject* swig_obj[2]; + + if (! SWIG_Python_UnpackTuple(args, "zts_ip_addr_type_set", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_ip_addr, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_ip_addr_type_set" + "', argument " + "1" + " of type '" + "zts_ip_addr *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_char(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_ip_addr_type_set" + "', argument " + "2" + " of type '" + "uint8_t" + "'"); + } + arg2 = static_cast(val2); + if (arg1) + (arg1)->type = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_ip_addr_type_get(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_ip_addr* arg1 = (zts_ip_addr*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + uint8_t result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_ip_addr, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_ip_addr_type_get" + "', argument " + "1" + " of type '" + "zts_ip_addr *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (uint8_t)((arg1)->type); + resultobj = SWIG_From_unsigned_SS_char(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_new_zts_ip_addr(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_ip_addr* result = 0; + + if (! SWIG_Python_UnpackTuple(args, "new_zts_ip_addr", 0, 0, 0)) + SWIG_fail; + result = (zts_ip_addr*)new zts_ip_addr(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_ip_addr, SWIG_POINTER_NEW | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_delete_zts_ip_addr(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_ip_addr* arg1 = (zts_ip_addr*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_ip_addr, SWIG_POINTER_DISOWN | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "delete_zts_ip_addr" + "', argument " + "1" + " of type '" + "zts_ip_addr *" + "'"); + } + arg1 = reinterpret_cast(argp1); + delete arg1; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* zts_ip_addr_swigregister(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* obj; + if (! SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) + return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_zts_ip_addr, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* zts_ip_addr_swiginit(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + return SWIG_Python_InitShadowInstance(args); +} + +SWIGINTERN PyObject* _wrap_zts_dns_set_server(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint8_t arg1; + zts_ip_addr* arg2 = (zts_ip_addr*)0; + unsigned char val1; + int ecode1 = 0; + void* argp2 = 0; + int res2 = 0; + PyObject* swig_obj[2]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_dns_set_server", 2, 2, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_unsigned_SS_char(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_dns_set_server" + "', argument " + "1" + " of type '" + "uint8_t" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_ip_addr, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_dns_set_server" + "', argument " + "2" + " of type '" + "zts_ip_addr const *" + "'"); + } + arg2 = reinterpret_cast(argp2); + result = (int)zts_dns_set_server(arg1, (zts_ip_addr const*)arg2); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_dns_get_server(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint8_t arg1; + unsigned char val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + zts_ip_addr* result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_unsigned_SS_char(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_dns_get_server" + "', argument " + "1" + " of type '" + "uint8_t" + "'"); + } + arg1 = static_cast(val1); + result = (zts_ip_addr*)zts_dns_get_server(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_zts_ip_addr, 0 | 0); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_core_lock_obtain(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_core_lock_obtain", 0, 0, 0)) + SWIG_fail; + result = (int)zts_core_lock_obtain(); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_core_lock_release(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_core_lock_release", 0, 0, 0)) + SWIG_fail; + result = (int)zts_core_lock_release(); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_core_query_addr_count(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + unsigned long long val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_core_query_addr_count" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_core_query_addr_count(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_core_query_addr(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + unsigned int arg2; + char* arg3 = (char*)0; + unsigned int arg4; + unsigned long long val1; + int ecode1 = 0; + unsigned int val2; + int ecode2 = 0; + int res3; + char* buf3 = 0; + int alloc3 = 0; + unsigned int val4; + int ecode4 = 0; + PyObject* swig_obj[4]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_core_query_addr", 4, 4, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_core_query_addr" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_core_query_addr" + "', argument " + "2" + " of type '" + "unsigned int" + "'"); + } + arg2 = static_cast(val2); + res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3); + if (! SWIG_IsOK(res3)) { + SWIG_exception_fail( + SWIG_ArgError(res3), + "in method '" + "zts_core_query_addr" + "', argument " + "3" + " of type '" + "char *" + "'"); + } + arg3 = reinterpret_cast(buf3); + ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val4); + if (! SWIG_IsOK(ecode4)) { + SWIG_exception_fail( + SWIG_ArgError(ecode4), + "in method '" + "zts_core_query_addr" + "', argument " + "4" + " of type '" + "unsigned int" + "'"); + } + arg4 = static_cast(val4); + result = (int)zts_core_query_addr(arg1, arg2, arg3, arg4); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc3 == SWIG_NEWOBJ) + delete[] buf3; + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) + delete[] buf3; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_core_query_route_count(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + unsigned long long val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_core_query_route_count" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_core_query_route_count(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_core_query_route(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + unsigned int arg2; + char* arg3 = (char*)0; + char* arg4 = (char*)0; + unsigned int arg5; + uint16_t* arg6 = (uint16_t*)0; + uint16_t* arg7 = (uint16_t*)0; + unsigned long long val1; + int ecode1 = 0; + unsigned int val2; + int ecode2 = 0; + int res3; + char* buf3 = 0; + int alloc3 = 0; + int res4; + char* buf4 = 0; + int alloc4 = 0; + unsigned int val5; + int ecode5 = 0; + void* argp6 = 0; + int res6 = 0; + void* argp7 = 0; + int res7 = 0; + PyObject* swig_obj[7]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_core_query_route", 7, 7, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_core_query_route" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_core_query_route" + "', argument " + "2" + " of type '" + "unsigned int" + "'"); + } + arg2 = static_cast(val2); + res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3); + if (! SWIG_IsOK(res3)) { + SWIG_exception_fail( + SWIG_ArgError(res3), + "in method '" + "zts_core_query_route" + "', argument " + "3" + " of type '" + "char *" + "'"); + } + arg3 = reinterpret_cast(buf3); + res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, NULL, &alloc4); + if (! SWIG_IsOK(res4)) { + SWIG_exception_fail( + SWIG_ArgError(res4), + "in method '" + "zts_core_query_route" + "', argument " + "4" + " of type '" + "char *" + "'"); + } + arg4 = reinterpret_cast(buf4); + ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val5); + if (! SWIG_IsOK(ecode5)) { + SWIG_exception_fail( + SWIG_ArgError(ecode5), + "in method '" + "zts_core_query_route" + "', argument " + "5" + " of type '" + "unsigned int" + "'"); + } + arg5 = static_cast(val5); + res6 = SWIG_ConvertPtr(swig_obj[5], &argp6, SWIGTYPE_p_unsigned_short, 0 | 0); + if (! SWIG_IsOK(res6)) { + SWIG_exception_fail( + SWIG_ArgError(res6), + "in method '" + "zts_core_query_route" + "', argument " + "6" + " of type '" + "uint16_t *" + "'"); + } + arg6 = reinterpret_cast(argp6); + res7 = SWIG_ConvertPtr(swig_obj[6], &argp7, SWIGTYPE_p_unsigned_short, 0 | 0); + if (! SWIG_IsOK(res7)) { + SWIG_exception_fail( + SWIG_ArgError(res7), + "in method '" + "zts_core_query_route" + "', argument " + "7" + " of type '" + "uint16_t *" + "'"); + } + arg7 = reinterpret_cast(argp7); + result = (int)zts_core_query_route(arg1, arg2, arg3, arg4, arg5, arg6, arg7); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc3 == SWIG_NEWOBJ) + delete[] buf3; + if (alloc4 == SWIG_NEWOBJ) + delete[] buf4; + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) + delete[] buf3; + if (alloc4 == SWIG_NEWOBJ) + delete[] buf4; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_core_query_path_count(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + unsigned long long val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_core_query_path_count" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_core_query_path_count(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_core_query_path(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + unsigned int arg2; + char* arg3 = (char*)0; + unsigned int arg4; + unsigned long long val1; + int ecode1 = 0; + unsigned int val2; + int ecode2 = 0; + int res3; + char* buf3 = 0; + int alloc3 = 0; + unsigned int val4; + int ecode4 = 0; + PyObject* swig_obj[4]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_core_query_path", 4, 4, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_core_query_path" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_core_query_path" + "', argument " + "2" + " of type '" + "unsigned int" + "'"); + } + arg2 = static_cast(val2); + res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3); + if (! SWIG_IsOK(res3)) { + SWIG_exception_fail( + SWIG_ArgError(res3), + "in method '" + "zts_core_query_path" + "', argument " + "3" + " of type '" + "char *" + "'"); + } + arg3 = reinterpret_cast(buf3); + ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val4); + if (! SWIG_IsOK(ecode4)) { + SWIG_exception_fail( + SWIG_ArgError(ecode4), + "in method '" + "zts_core_query_path" + "', argument " + "4" + " of type '" + "unsigned int" + "'"); + } + arg4 = static_cast(val4); + result = (int)zts_core_query_path(arg1, arg2, arg3, arg4); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc3 == SWIG_NEWOBJ) + delete[] buf3; + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) + delete[] buf3; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_core_query_mc_count(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + unsigned long long val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_core_query_mc_count" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + result = (int)zts_core_query_mc_count(arg1); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_core_query_mc(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + uint64_t arg1; + unsigned int arg2; + uint64_t* arg3 = (uint64_t*)0; + uint32_t* arg4 = (uint32_t*)0; + unsigned long long val1; + int ecode1 = 0; + unsigned int val2; + int ecode2 = 0; + void* argp3 = 0; + int res3 = 0; + void* argp4 = 0; + int res4 = 0; + PyObject* swig_obj[4]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_core_query_mc", 4, 4, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_core_query_mc" + "', argument " + "1" + " of type '" + "uint64_t" + "'"); + } + arg1 = static_cast(val1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_core_query_mc" + "', argument " + "2" + " of type '" + "unsigned int" + "'"); + } + arg2 = static_cast(val2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_unsigned_long_long, 0 | 0); + if (! SWIG_IsOK(res3)) { + SWIG_exception_fail( + SWIG_ArgError(res3), + "in method '" + "zts_core_query_mc" + "', argument " + "3" + " of type '" + "uint64_t *" + "'"); + } + arg3 = reinterpret_cast(argp3); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4, SWIGTYPE_p_unsigned_int, 0 | 0); + if (! SWIG_IsOK(res4)) { + SWIG_exception_fail( + SWIG_ArgError(res4), + "in method '" + "zts_core_query_mc" + "', argument " + "4" + " of type '" + "uint32_t *" + "'"); + } + arg4 = reinterpret_cast(argp4); + result = (int)zts_core_query_mc(arg1, arg2, arg3, arg4); + resultobj = SWIG_From_int(static_cast(result)); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_util_sign_root_set(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + char* arg1 = (char*)0; + unsigned int* arg2 = (unsigned int*)0; + char* arg3 = (char*)0; + unsigned int* arg4 = (unsigned int*)0; + char* arg5 = (char*)0; + unsigned int* arg6 = (unsigned int*)0; + uint64_t arg7; + uint64_t arg8; + zts_root_set_t* arg9 = (zts_root_set_t*)0; + int res1; + char* buf1 = 0; + int alloc1 = 0; + void* argp2 = 0; + int res2 = 0; + int res3; + char* buf3 = 0; + int alloc3 = 0; + void* argp4 = 0; + int res4 = 0; + int res5; + char* buf5 = 0; + int alloc5 = 0; + void* argp6 = 0; + int res6 = 0; + unsigned long long val7; + int ecode7 = 0; + unsigned long long val8; + int ecode8 = 0; + void* argp9 = 0; + int res9 = 0; + PyObject* swig_obj[9]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_util_sign_root_set", 9, 9, swig_obj)) + SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_util_sign_root_set" + "', argument " + "1" + " of type '" + "char *" + "'"); + } + arg1 = reinterpret_cast(buf1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_unsigned_int, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_util_sign_root_set" + "', argument " + "2" + " of type '" + "unsigned int *" + "'"); + } + arg2 = reinterpret_cast(argp2); + res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3); + if (! SWIG_IsOK(res3)) { + SWIG_exception_fail( + SWIG_ArgError(res3), + "in method '" + "zts_util_sign_root_set" + "', argument " + "3" + " of type '" + "char *" + "'"); + } + arg3 = reinterpret_cast(buf3); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4, SWIGTYPE_p_unsigned_int, 0 | 0); + if (! SWIG_IsOK(res4)) { + SWIG_exception_fail( + SWIG_ArgError(res4), + "in method '" + "zts_util_sign_root_set" + "', argument " + "4" + " of type '" + "unsigned int *" + "'"); + } + arg4 = reinterpret_cast(argp4); + res5 = SWIG_AsCharPtrAndSize(swig_obj[4], &buf5, NULL, &alloc5); + if (! SWIG_IsOK(res5)) { + SWIG_exception_fail( + SWIG_ArgError(res5), + "in method '" + "zts_util_sign_root_set" + "', argument " + "5" + " of type '" + "char *" + "'"); + } + arg5 = reinterpret_cast(buf5); + res6 = SWIG_ConvertPtr(swig_obj[5], &argp6, SWIGTYPE_p_unsigned_int, 0 | 0); + if (! SWIG_IsOK(res6)) { + SWIG_exception_fail( + SWIG_ArgError(res6), + "in method '" + "zts_util_sign_root_set" + "', argument " + "6" + " of type '" + "unsigned int *" + "'"); + } + arg6 = reinterpret_cast(argp6); + ecode7 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[6], &val7); + if (! SWIG_IsOK(ecode7)) { + SWIG_exception_fail( + SWIG_ArgError(ecode7), + "in method '" + "zts_util_sign_root_set" + "', argument " + "7" + " of type '" + "uint64_t" + "'"); + } + arg7 = static_cast(val7); + ecode8 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[7], &val8); + if (! SWIG_IsOK(ecode8)) { + SWIG_exception_fail( + SWIG_ArgError(ecode8), + "in method '" + "zts_util_sign_root_set" + "', argument " + "8" + " of type '" + "uint64_t" + "'"); + } + arg8 = static_cast(val8); + res9 = SWIG_ConvertPtr(swig_obj[8], &argp9, SWIGTYPE_p_zts_root_set_t, 0 | 0); + if (! SWIG_IsOK(res9)) { + SWIG_exception_fail( + SWIG_ArgError(res9), + "in method '" + "zts_util_sign_root_set" + "', argument " + "9" + " of type '" + "zts_root_set_t *" + "'"); + } + arg9 = reinterpret_cast(argp9); + result = (int)zts_util_sign_root_set(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + if (alloc3 == SWIG_NEWOBJ) + delete[] buf3; + if (alloc5 == SWIG_NEWOBJ) + delete[] buf5; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + if (alloc3 == SWIG_NEWOBJ) + delete[] buf3; + if (alloc5 == SWIG_NEWOBJ) + delete[] buf5; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_util_delay(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + unsigned long arg1; + unsigned long val1; + int ecode1 = 0; + PyObject* swig_obj[1]; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_unsigned_SS_long(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_util_delay" + "', argument " + "1" + " of type '" + "unsigned long" + "'"); + } + arg1 = static_cast(val1); + zts_util_delay(arg1); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_util_get_ip_family(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + char* arg1 = (char*)0; + int res1; + char* buf1 = 0; + int alloc1 = 0; + PyObject* swig_obj[1]; + int result; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_util_get_ip_family" + "', argument " + "1" + " of type '" + "char const *" + "'"); + } + arg1 = reinterpret_cast(buf1); + result = (int)zts_util_get_ip_family((char const*)arg1); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_util_ipstr_to_saddr(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + char* arg1 = (char*)0; + unsigned short arg2; + zts_sockaddr* arg3 = (zts_sockaddr*)0; + zts_socklen_t* arg4 = (zts_socklen_t*)0; + int res1; + char* buf1 = 0; + int alloc1 = 0; + unsigned short val2; + int ecode2 = 0; + void* argp3 = 0; + int res3 = 0; + void* argp4 = 0; + int res4 = 0; + PyObject* swig_obj[4]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_util_ipstr_to_saddr", 4, 4, swig_obj)) + SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_util_ipstr_to_saddr" + "', argument " + "1" + " of type '" + "char const *" + "'"); + } + arg1 = reinterpret_cast(buf1); + ecode2 = SWIG_AsVal_unsigned_SS_short(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_util_ipstr_to_saddr" + "', argument " + "2" + " of type '" + "unsigned short" + "'"); + } + arg2 = static_cast(val2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_zts_sockaddr, 0 | 0); + if (! SWIG_IsOK(res3)) { + SWIG_exception_fail( + SWIG_ArgError(res3), + "in method '" + "zts_util_ipstr_to_saddr" + "', argument " + "3" + " of type '" + "zts_sockaddr *" + "'"); + } + arg3 = reinterpret_cast(argp3); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4, SWIGTYPE_p_unsigned_int, 0 | 0); + if (! SWIG_IsOK(res4)) { + SWIG_exception_fail( + SWIG_ArgError(res4), + "in method '" + "zts_util_ipstr_to_saddr" + "', argument " + "4" + " of type '" + "zts_socklen_t *" + "'"); + } + arg4 = reinterpret_cast(argp4); + result = (int)zts_util_ipstr_to_saddr((char const*)arg1, arg2, arg3, arg4); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_util_ntop(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_sockaddr* arg1 = (zts_sockaddr*)0; + zts_socklen_t arg2; + char* arg3 = (char*)0; + int arg4; + unsigned short* arg5 = (unsigned short*)0; + void* argp1 = 0; + int res1 = 0; + unsigned int val2; + int ecode2 = 0; + int res3; + char* buf3 = 0; + int alloc3 = 0; + int val4; + int ecode4 = 0; + void* argp5 = 0; + int res5 = 0; + PyObject* swig_obj[5]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_util_ntop", 5, 5, swig_obj)) + SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_sockaddr, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_util_ntop" + "', argument " + "1" + " of type '" + "zts_sockaddr *" + "'"); + } + arg1 = reinterpret_cast(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (! SWIG_IsOK(ecode2)) { + SWIG_exception_fail( + SWIG_ArgError(ecode2), + "in method '" + "zts_util_ntop" + "', argument " + "2" + " of type '" + "zts_socklen_t" + "'"); + } + arg2 = static_cast(val2); + res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3); + if (! SWIG_IsOK(res3)) { + SWIG_exception_fail( + SWIG_ArgError(res3), + "in method '" + "zts_util_ntop" + "', argument " + "3" + " of type '" + "char *" + "'"); + } + arg3 = reinterpret_cast(buf3); + ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); + if (! SWIG_IsOK(ecode4)) { + SWIG_exception_fail( + SWIG_ArgError(ecode4), + "in method '" + "zts_util_ntop" + "', argument " + "4" + " of type '" + "int" + "'"); + } + arg4 = static_cast(val4); + res5 = SWIG_ConvertPtr(swig_obj[4], &argp5, SWIGTYPE_p_unsigned_short, 0 | 0); + if (! SWIG_IsOK(res5)) { + SWIG_exception_fail( + SWIG_ArgError(res5), + "in method '" + "zts_util_ntop" + "', argument " + "5" + " of type '" + "unsigned short *" + "'"); + } + arg5 = reinterpret_cast(argp5); + result = (int)zts_util_ntop(arg1, arg2, arg3, arg4, arg5); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc3 == SWIG_NEWOBJ) + delete[] buf3; + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) + delete[] buf3; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_ipaddr_ntoa(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + zts_ip_addr* arg1 = (zts_ip_addr*)0; + void* argp1 = 0; + int res1 = 0; + PyObject* swig_obj[1]; + char* result = 0; + + if (! args) + SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_zts_ip_addr, 0 | 0); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_ipaddr_ntoa" + "', argument " + "1" + " of type '" + "zts_ip_addr const *" + "'"); + } + arg1 = reinterpret_cast(argp1); + result = (char*)zts_ipaddr_ntoa((zts_ip_addr const*)arg1); + resultobj = SWIG_FromCharPtr((const char*)result); + return resultobj; +fail: + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_ipaddr_aton(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + char* arg1 = (char*)0; + zts_ip_addr* arg2 = (zts_ip_addr*)0; + int res1; + char* buf1 = 0; + int alloc1 = 0; + void* argp2 = 0; + int res2 = 0; + PyObject* swig_obj[2]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_ipaddr_aton", 2, 2, swig_obj)) + SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); + if (! SWIG_IsOK(res1)) { + SWIG_exception_fail( + SWIG_ArgError(res1), + "in method '" + "zts_ipaddr_aton" + "', argument " + "1" + " of type '" + "char const *" + "'"); + } + arg1 = reinterpret_cast(buf1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_zts_ip_addr, 0 | 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_ipaddr_aton" + "', argument " + "2" + " of type '" + "zts_ip_addr *" + "'"); + } + arg2 = reinterpret_cast(argp2); + result = (int)zts_ipaddr_aton((char const*)arg1, arg2); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) + delete[] buf1; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_inet_ntop(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + void* arg2 = (void*)0; + char* arg3 = (char*)0; + zts_socklen_t arg4; + int val1; + int ecode1 = 0; + int res2; + int res3; + char* buf3 = 0; + int alloc3 = 0; + unsigned int val4; + int ecode4 = 0; + PyObject* swig_obj[4]; + char* result = 0; + + if (! SWIG_Python_UnpackTuple(args, "zts_inet_ntop", 4, 4, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_inet_ntop" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], SWIG_as_voidptrptr(&arg2), 0, 0); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_inet_ntop" + "', argument " + "2" + " of type '" + "void const *" + "'"); + } + res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3); + if (! SWIG_IsOK(res3)) { + SWIG_exception_fail( + SWIG_ArgError(res3), + "in method '" + "zts_inet_ntop" + "', argument " + "3" + " of type '" + "char *" + "'"); + } + arg3 = reinterpret_cast(buf3); + ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val4); + if (! SWIG_IsOK(ecode4)) { + SWIG_exception_fail( + SWIG_ArgError(ecode4), + "in method '" + "zts_inet_ntop" + "', argument " + "4" + " of type '" + "zts_socklen_t" + "'"); + } + arg4 = static_cast(val4); + result = (char*)zts_inet_ntop(arg1, (void const*)arg2, arg3, arg4); + resultobj = SWIG_FromCharPtr((const char*)result); + if (alloc3 == SWIG_NEWOBJ) + delete[] buf3; + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) + delete[] buf3; + return NULL; +} + +SWIGINTERN PyObject* _wrap_zts_inet_pton(PyObject* SWIGUNUSEDPARM(self), PyObject* args) +{ + PyObject* resultobj = 0; + int arg1; + char* arg2 = (char*)0; + void* arg3 = (void*)0; + int val1; + int ecode1 = 0; + int res2; + char* buf2 = 0; + int alloc2 = 0; + int res3; + PyObject* swig_obj[3]; + int result; + + if (! SWIG_Python_UnpackTuple(args, "zts_inet_pton", 3, 3, swig_obj)) + SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (! SWIG_IsOK(ecode1)) { + SWIG_exception_fail( + SWIG_ArgError(ecode1), + "in method '" + "zts_inet_pton" + "', argument " + "1" + " of type '" + "int" + "'"); + } + arg1 = static_cast(val1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); + if (! SWIG_IsOK(res2)) { + SWIG_exception_fail( + SWIG_ArgError(res2), + "in method '" + "zts_inet_pton" + "', argument " + "2" + " of type '" + "char const *" + "'"); + } + arg2 = reinterpret_cast(buf2); + res3 = SWIG_ConvertPtr(swig_obj[2], SWIG_as_voidptrptr(&arg3), 0, 0); + if (! SWIG_IsOK(res3)) { + SWIG_exception_fail( + SWIG_ArgError(res3), + "in method '" + "zts_inet_pton" + "', argument " + "3" + " of type '" + "void *" + "'"); + } + result = (int)zts_inet_pton(arg1, (char const*)arg2, arg3); + resultobj = SWIG_From_int(static_cast(result)); + if (alloc2 == SWIG_NEWOBJ) + delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) + delete[] buf2; + return NULL; +} + +static PyMethodDef SwigMethods[] = { + { "SWIG_PyInstanceMethod_New", SWIG_PyInstanceMethod_New, METH_O, NULL }, + { "zts_node_info_t_node_id_set", _wrap_zts_node_info_t_node_id_set, METH_VARARGS, NULL }, + { "zts_node_info_t_node_id_get", _wrap_zts_node_info_t_node_id_get, METH_O, NULL }, + { "zts_node_info_t_port_primary_set", _wrap_zts_node_info_t_port_primary_set, METH_VARARGS, NULL }, + { "zts_node_info_t_port_primary_get", _wrap_zts_node_info_t_port_primary_get, METH_O, NULL }, + { "zts_node_info_t_port_secondary_set", _wrap_zts_node_info_t_port_secondary_set, METH_VARARGS, NULL }, + { "zts_node_info_t_port_secondary_get", _wrap_zts_node_info_t_port_secondary_get, METH_O, NULL }, + { "zts_node_info_t_port_tertiary_set", _wrap_zts_node_info_t_port_tertiary_set, METH_VARARGS, NULL }, + { "zts_node_info_t_port_tertiary_get", _wrap_zts_node_info_t_port_tertiary_get, METH_O, NULL }, + { "zts_node_info_t_ver_major_set", _wrap_zts_node_info_t_ver_major_set, METH_VARARGS, NULL }, + { "zts_node_info_t_ver_major_get", _wrap_zts_node_info_t_ver_major_get, METH_O, NULL }, + { "zts_node_info_t_ver_minor_set", _wrap_zts_node_info_t_ver_minor_set, METH_VARARGS, NULL }, + { "zts_node_info_t_ver_minor_get", _wrap_zts_node_info_t_ver_minor_get, METH_O, NULL }, + { "zts_node_info_t_ver_rev_set", _wrap_zts_node_info_t_ver_rev_set, METH_VARARGS, NULL }, + { "zts_node_info_t_ver_rev_get", _wrap_zts_node_info_t_ver_rev_get, METH_O, NULL }, + { "new_zts_node_info_t", _wrap_new_zts_node_info_t, METH_NOARGS, NULL }, + { "delete_zts_node_info_t", _wrap_delete_zts_node_info_t, METH_O, NULL }, + { "zts_node_info_t_swigregister", zts_node_info_t_swigregister, METH_O, NULL }, + { "zts_node_info_t_swiginit", zts_node_info_t_swiginit, METH_VARARGS, NULL }, + { "zts_addr_info_t_net_id_set", _wrap_zts_addr_info_t_net_id_set, METH_VARARGS, NULL }, + { "zts_addr_info_t_net_id_get", _wrap_zts_addr_info_t_net_id_get, METH_O, NULL }, + { "zts_addr_info_t_addr_set", _wrap_zts_addr_info_t_addr_set, METH_VARARGS, NULL }, + { "zts_addr_info_t_addr_get", _wrap_zts_addr_info_t_addr_get, METH_O, NULL }, + { "new_zts_addr_info_t", _wrap_new_zts_addr_info_t, METH_NOARGS, NULL }, + { "delete_zts_addr_info_t", _wrap_delete_zts_addr_info_t, METH_O, NULL }, + { "zts_addr_info_t_swigregister", zts_addr_info_t_swigregister, METH_O, NULL }, + { "zts_addr_info_t_swiginit", zts_addr_info_t_swiginit, METH_VARARGS, NULL }, + { "zts_route_info_t_target_set", _wrap_zts_route_info_t_target_set, METH_VARARGS, NULL }, + { "zts_route_info_t_target_get", _wrap_zts_route_info_t_target_get, METH_O, NULL }, + { "zts_route_info_t_via_set", _wrap_zts_route_info_t_via_set, METH_VARARGS, NULL }, + { "zts_route_info_t_via_get", _wrap_zts_route_info_t_via_get, METH_O, NULL }, + { "zts_route_info_t_flags_set", _wrap_zts_route_info_t_flags_set, METH_VARARGS, NULL }, + { "zts_route_info_t_flags_get", _wrap_zts_route_info_t_flags_get, METH_O, NULL }, + { "zts_route_info_t_metric_set", _wrap_zts_route_info_t_metric_set, METH_VARARGS, NULL }, + { "zts_route_info_t_metric_get", _wrap_zts_route_info_t_metric_get, METH_O, NULL }, + { "new_zts_route_info_t", _wrap_new_zts_route_info_t, METH_NOARGS, NULL }, + { "delete_zts_route_info_t", _wrap_delete_zts_route_info_t, METH_O, NULL }, + { "zts_route_info_t_swigregister", zts_route_info_t_swigregister, METH_O, NULL }, + { "zts_route_info_t_swiginit", zts_route_info_t_swiginit, METH_VARARGS, NULL }, + { "zts_multicast_group_t_mac_set", _wrap_zts_multicast_group_t_mac_set, METH_VARARGS, NULL }, + { "zts_multicast_group_t_mac_get", _wrap_zts_multicast_group_t_mac_get, METH_O, NULL }, + { "zts_multicast_group_t_adi_set", _wrap_zts_multicast_group_t_adi_set, METH_VARARGS, NULL }, + { "zts_multicast_group_t_adi_get", _wrap_zts_multicast_group_t_adi_get, METH_O, NULL }, + { "new_zts_multicast_group_t", _wrap_new_zts_multicast_group_t, METH_NOARGS, NULL }, + { "delete_zts_multicast_group_t", _wrap_delete_zts_multicast_group_t, METH_O, NULL }, + { "zts_multicast_group_t_swigregister", zts_multicast_group_t_swigregister, METH_O, NULL }, + { "zts_multicast_group_t_swiginit", zts_multicast_group_t_swiginit, METH_VARARGS, NULL }, + { "zts_net_info_t_net_id_set", _wrap_zts_net_info_t_net_id_set, METH_VARARGS, NULL }, + { "zts_net_info_t_net_id_get", _wrap_zts_net_info_t_net_id_get, METH_O, NULL }, + { "zts_net_info_t_mac_set", _wrap_zts_net_info_t_mac_set, METH_VARARGS, NULL }, + { "zts_net_info_t_mac_get", _wrap_zts_net_info_t_mac_get, METH_O, NULL }, + { "zts_net_info_t_name_set", _wrap_zts_net_info_t_name_set, METH_VARARGS, NULL }, + { "zts_net_info_t_name_get", _wrap_zts_net_info_t_name_get, METH_O, NULL }, + { "zts_net_info_t_status_set", _wrap_zts_net_info_t_status_set, METH_VARARGS, NULL }, + { "zts_net_info_t_status_get", _wrap_zts_net_info_t_status_get, METH_O, NULL }, + { "zts_net_info_t_type_set", _wrap_zts_net_info_t_type_set, METH_VARARGS, NULL }, + { "zts_net_info_t_type_get", _wrap_zts_net_info_t_type_get, METH_O, NULL }, + { "zts_net_info_t_mtu_set", _wrap_zts_net_info_t_mtu_set, METH_VARARGS, NULL }, + { "zts_net_info_t_mtu_get", _wrap_zts_net_info_t_mtu_get, METH_O, NULL }, + { "zts_net_info_t_dhcp_set", _wrap_zts_net_info_t_dhcp_set, METH_VARARGS, NULL }, + { "zts_net_info_t_dhcp_get", _wrap_zts_net_info_t_dhcp_get, METH_O, NULL }, + { "zts_net_info_t_bridge_set", _wrap_zts_net_info_t_bridge_set, METH_VARARGS, NULL }, + { "zts_net_info_t_bridge_get", _wrap_zts_net_info_t_bridge_get, METH_O, NULL }, + { "zts_net_info_t_broadcast_enabled_set", _wrap_zts_net_info_t_broadcast_enabled_set, METH_VARARGS, NULL }, + { "zts_net_info_t_broadcast_enabled_get", _wrap_zts_net_info_t_broadcast_enabled_get, METH_O, NULL }, + { "zts_net_info_t_port_error_set", _wrap_zts_net_info_t_port_error_set, METH_VARARGS, NULL }, + { "zts_net_info_t_port_error_get", _wrap_zts_net_info_t_port_error_get, METH_O, NULL }, + { "zts_net_info_t_netconf_rev_set", _wrap_zts_net_info_t_netconf_rev_set, METH_VARARGS, NULL }, + { "zts_net_info_t_netconf_rev_get", _wrap_zts_net_info_t_netconf_rev_get, METH_O, NULL }, + { "zts_net_info_t_assigned_addr_count_set", _wrap_zts_net_info_t_assigned_addr_count_set, METH_VARARGS, NULL }, + { "zts_net_info_t_assigned_addr_count_get", _wrap_zts_net_info_t_assigned_addr_count_get, METH_O, NULL }, + { "zts_net_info_t_assigned_addrs_set", _wrap_zts_net_info_t_assigned_addrs_set, METH_VARARGS, NULL }, + { "zts_net_info_t_assigned_addrs_get", _wrap_zts_net_info_t_assigned_addrs_get, METH_O, NULL }, + { "zts_net_info_t_route_count_set", _wrap_zts_net_info_t_route_count_set, METH_VARARGS, NULL }, + { "zts_net_info_t_route_count_get", _wrap_zts_net_info_t_route_count_get, METH_O, NULL }, + { "zts_net_info_t_routes_set", _wrap_zts_net_info_t_routes_set, METH_VARARGS, NULL }, + { "zts_net_info_t_routes_get", _wrap_zts_net_info_t_routes_get, METH_O, NULL }, + { "zts_net_info_t_multicast_sub_count_set", _wrap_zts_net_info_t_multicast_sub_count_set, METH_VARARGS, NULL }, + { "zts_net_info_t_multicast_sub_count_get", _wrap_zts_net_info_t_multicast_sub_count_get, METH_O, NULL }, + { "new_zts_net_info_t", _wrap_new_zts_net_info_t, METH_NOARGS, NULL }, + { "delete_zts_net_info_t", _wrap_delete_zts_net_info_t, METH_O, NULL }, + { "zts_net_info_t_swigregister", zts_net_info_t_swigregister, METH_O, NULL }, + { "zts_net_info_t_swiginit", zts_net_info_t_swiginit, METH_VARARGS, NULL }, + { "zts_path_t_address_set", _wrap_zts_path_t_address_set, METH_VARARGS, NULL }, + { "zts_path_t_address_get", _wrap_zts_path_t_address_get, METH_O, NULL }, + { "zts_path_t_last_tx_set", _wrap_zts_path_t_last_tx_set, METH_VARARGS, NULL }, + { "zts_path_t_last_tx_get", _wrap_zts_path_t_last_tx_get, METH_O, NULL }, + { "zts_path_t_last_rx_set", _wrap_zts_path_t_last_rx_set, METH_VARARGS, NULL }, + { "zts_path_t_last_rx_get", _wrap_zts_path_t_last_rx_get, METH_O, NULL }, + { "zts_path_t_trusted_path_id_set", _wrap_zts_path_t_trusted_path_id_set, METH_VARARGS, NULL }, + { "zts_path_t_trusted_path_id_get", _wrap_zts_path_t_trusted_path_id_get, METH_O, NULL }, + { "zts_path_t_latency_set", _wrap_zts_path_t_latency_set, METH_VARARGS, NULL }, + { "zts_path_t_latency_get", _wrap_zts_path_t_latency_get, METH_O, NULL }, + { "zts_path_t_unused_0_set", _wrap_zts_path_t_unused_0_set, METH_VARARGS, NULL }, + { "zts_path_t_unused_0_get", _wrap_zts_path_t_unused_0_get, METH_O, NULL }, + { "zts_path_t_unused_1_set", _wrap_zts_path_t_unused_1_set, METH_VARARGS, NULL }, + { "zts_path_t_unused_1_get", _wrap_zts_path_t_unused_1_get, METH_O, NULL }, + { "zts_path_t_unused_2_set", _wrap_zts_path_t_unused_2_set, METH_VARARGS, NULL }, + { "zts_path_t_unused_2_get", _wrap_zts_path_t_unused_2_get, METH_O, NULL }, + { "zts_path_t_unused_3_set", _wrap_zts_path_t_unused_3_set, METH_VARARGS, NULL }, + { "zts_path_t_unused_3_get", _wrap_zts_path_t_unused_3_get, METH_O, NULL }, + { "zts_path_t_unused_4_set", _wrap_zts_path_t_unused_4_set, METH_VARARGS, NULL }, + { "zts_path_t_unused_4_get", _wrap_zts_path_t_unused_4_get, METH_O, NULL }, + { "zts_path_t_unused_5_set", _wrap_zts_path_t_unused_5_set, METH_VARARGS, NULL }, + { "zts_path_t_unused_5_get", _wrap_zts_path_t_unused_5_get, METH_O, NULL }, + { "zts_path_t_unused_6_set", _wrap_zts_path_t_unused_6_set, METH_VARARGS, NULL }, + { "zts_path_t_unused_6_get", _wrap_zts_path_t_unused_6_get, METH_O, NULL }, + { "zts_path_t_unused_7_set", _wrap_zts_path_t_unused_7_set, METH_VARARGS, NULL }, + { "zts_path_t_unused_7_get", _wrap_zts_path_t_unused_7_get, METH_O, NULL }, + { "zts_path_t_ifname_set", _wrap_zts_path_t_ifname_set, METH_VARARGS, NULL }, + { "zts_path_t_ifname_get", _wrap_zts_path_t_ifname_get, METH_O, NULL }, + { "zts_path_t_expired_set", _wrap_zts_path_t_expired_set, METH_VARARGS, NULL }, + { "zts_path_t_expired_get", _wrap_zts_path_t_expired_get, METH_O, NULL }, + { "zts_path_t_preferred_set", _wrap_zts_path_t_preferred_set, METH_VARARGS, NULL }, + { "zts_path_t_preferred_get", _wrap_zts_path_t_preferred_get, METH_O, NULL }, + { "new_zts_path_t", _wrap_new_zts_path_t, METH_NOARGS, NULL }, + { "delete_zts_path_t", _wrap_delete_zts_path_t, METH_O, NULL }, + { "zts_path_t_swigregister", zts_path_t_swigregister, METH_O, NULL }, + { "zts_path_t_swiginit", zts_path_t_swiginit, METH_VARARGS, NULL }, + { "zts_peer_info_t_peer_id_set", _wrap_zts_peer_info_t_peer_id_set, METH_VARARGS, NULL }, + { "zts_peer_info_t_peer_id_get", _wrap_zts_peer_info_t_peer_id_get, METH_O, NULL }, + { "zts_peer_info_t_ver_major_set", _wrap_zts_peer_info_t_ver_major_set, METH_VARARGS, NULL }, + { "zts_peer_info_t_ver_major_get", _wrap_zts_peer_info_t_ver_major_get, METH_O, NULL }, + { "zts_peer_info_t_ver_minor_set", _wrap_zts_peer_info_t_ver_minor_set, METH_VARARGS, NULL }, + { "zts_peer_info_t_ver_minor_get", _wrap_zts_peer_info_t_ver_minor_get, METH_O, NULL }, + { "zts_peer_info_t_ver_rev_set", _wrap_zts_peer_info_t_ver_rev_set, METH_VARARGS, NULL }, + { "zts_peer_info_t_ver_rev_get", _wrap_zts_peer_info_t_ver_rev_get, METH_O, NULL }, + { "zts_peer_info_t_latency_set", _wrap_zts_peer_info_t_latency_set, METH_VARARGS, NULL }, + { "zts_peer_info_t_latency_get", _wrap_zts_peer_info_t_latency_get, METH_O, NULL }, + { "zts_peer_info_t_role_set", _wrap_zts_peer_info_t_role_set, METH_VARARGS, NULL }, + { "zts_peer_info_t_role_get", _wrap_zts_peer_info_t_role_get, METH_O, NULL }, + { "zts_peer_info_t_path_count_set", _wrap_zts_peer_info_t_path_count_set, METH_VARARGS, NULL }, + { "zts_peer_info_t_path_count_get", _wrap_zts_peer_info_t_path_count_get, METH_O, NULL }, + { "zts_peer_info_t_unused_0_set", _wrap_zts_peer_info_t_unused_0_set, METH_VARARGS, NULL }, + { "zts_peer_info_t_unused_0_get", _wrap_zts_peer_info_t_unused_0_get, METH_O, NULL }, + { "zts_peer_info_t_paths_set", _wrap_zts_peer_info_t_paths_set, METH_VARARGS, NULL }, + { "zts_peer_info_t_paths_get", _wrap_zts_peer_info_t_paths_get, METH_O, NULL }, + { "new_zts_peer_info_t", _wrap_new_zts_peer_info_t, METH_NOARGS, NULL }, + { "delete_zts_peer_info_t", _wrap_delete_zts_peer_info_t, METH_O, NULL }, + { "zts_peer_info_t_swigregister", zts_peer_info_t_swigregister, METH_O, NULL }, + { "zts_peer_info_t_swiginit", zts_peer_info_t_swiginit, METH_VARARGS, NULL }, + { "zts_root_set_t_public_id_str_set", _wrap_zts_root_set_t_public_id_str_set, METH_VARARGS, NULL }, + { "zts_root_set_t_public_id_str_get", _wrap_zts_root_set_t_public_id_str_get, METH_O, NULL }, + { "zts_root_set_t_endpoint_ip_str_set", _wrap_zts_root_set_t_endpoint_ip_str_set, METH_VARARGS, NULL }, + { "zts_root_set_t_endpoint_ip_str_get", _wrap_zts_root_set_t_endpoint_ip_str_get, METH_O, NULL }, + { "new_zts_root_set_t", _wrap_new_zts_root_set_t, METH_NOARGS, NULL }, + { "delete_zts_root_set_t", _wrap_delete_zts_root_set_t, METH_O, NULL }, + { "zts_root_set_t_swigregister", zts_root_set_t_swigregister, METH_O, NULL }, + { "zts_root_set_t_swiginit", zts_root_set_t_swiginit, METH_VARARGS, NULL }, + { "zts_netif_info_t_net_id_set", _wrap_zts_netif_info_t_net_id_set, METH_VARARGS, NULL }, + { "zts_netif_info_t_net_id_get", _wrap_zts_netif_info_t_net_id_get, METH_O, NULL }, + { "zts_netif_info_t_mac_set", _wrap_zts_netif_info_t_mac_set, METH_VARARGS, NULL }, + { "zts_netif_info_t_mac_get", _wrap_zts_netif_info_t_mac_get, METH_O, NULL }, + { "zts_netif_info_t_mtu_set", _wrap_zts_netif_info_t_mtu_set, METH_VARARGS, NULL }, + { "zts_netif_info_t_mtu_get", _wrap_zts_netif_info_t_mtu_get, METH_O, NULL }, + { "new_zts_netif_info_t", _wrap_new_zts_netif_info_t, METH_NOARGS, NULL }, + { "delete_zts_netif_info_t", _wrap_delete_zts_netif_info_t, METH_O, NULL }, + { "zts_netif_info_t_swigregister", zts_netif_info_t_swigregister, METH_O, NULL }, + { "zts_netif_info_t_swiginit", zts_netif_info_t_swiginit, METH_VARARGS, NULL }, + { "zts_event_msg_t_event_code_set", _wrap_zts_event_msg_t_event_code_set, METH_VARARGS, NULL }, + { "zts_event_msg_t_event_code_get", _wrap_zts_event_msg_t_event_code_get, METH_O, NULL }, + { "zts_event_msg_t_node_set", _wrap_zts_event_msg_t_node_set, METH_VARARGS, NULL }, + { "zts_event_msg_t_node_get", _wrap_zts_event_msg_t_node_get, METH_O, NULL }, + { "zts_event_msg_t_network_set", _wrap_zts_event_msg_t_network_set, METH_VARARGS, NULL }, + { "zts_event_msg_t_network_get", _wrap_zts_event_msg_t_network_get, METH_O, NULL }, + { "zts_event_msg_t_netif_set", _wrap_zts_event_msg_t_netif_set, METH_VARARGS, NULL }, + { "zts_event_msg_t_netif_get", _wrap_zts_event_msg_t_netif_get, METH_O, NULL }, + { "zts_event_msg_t_route_set", _wrap_zts_event_msg_t_route_set, METH_VARARGS, NULL }, + { "zts_event_msg_t_route_get", _wrap_zts_event_msg_t_route_get, METH_O, NULL }, + { "zts_event_msg_t_peer_set", _wrap_zts_event_msg_t_peer_set, METH_VARARGS, NULL }, + { "zts_event_msg_t_peer_get", _wrap_zts_event_msg_t_peer_get, METH_O, NULL }, + { "zts_event_msg_t_addr_set", _wrap_zts_event_msg_t_addr_set, METH_VARARGS, NULL }, + { "zts_event_msg_t_addr_get", _wrap_zts_event_msg_t_addr_get, METH_O, NULL }, + { "zts_event_msg_t_cache_set", _wrap_zts_event_msg_t_cache_set, METH_VARARGS, NULL }, + { "zts_event_msg_t_cache_get", _wrap_zts_event_msg_t_cache_get, METH_O, NULL }, + { "zts_event_msg_t_len_set", _wrap_zts_event_msg_t_len_set, METH_VARARGS, NULL }, + { "zts_event_msg_t_len_get", _wrap_zts_event_msg_t_len_get, METH_O, NULL }, + { "new_zts_event_msg_t", _wrap_new_zts_event_msg_t, METH_NOARGS, NULL }, + { "delete_zts_event_msg_t", _wrap_delete_zts_event_msg_t, METH_O, NULL }, + { "zts_event_msg_t_swigregister", zts_event_msg_t_swigregister, METH_O, NULL }, + { "zts_event_msg_t_swiginit", zts_event_msg_t_swiginit, METH_VARARGS, NULL }, + { "PythonDirectorCallbackClass_on_zerotier_event", + _wrap_PythonDirectorCallbackClass_on_zerotier_event, + METH_VARARGS, + NULL }, + { "delete_PythonDirectorCallbackClass", _wrap_delete_PythonDirectorCallbackClass, METH_O, NULL }, + { "new_PythonDirectorCallbackClass", _wrap_new_PythonDirectorCallbackClass, METH_O, NULL }, + { "disown_PythonDirectorCallbackClass", _wrap_disown_PythonDirectorCallbackClass, METH_O, NULL }, + { "PythonDirectorCallbackClass_swigregister", PythonDirectorCallbackClass_swigregister, METH_O, NULL }, + { "PythonDirectorCallbackClass_swiginit", PythonDirectorCallbackClass_swiginit, METH_VARARGS, NULL }, + { "zts_py_bind", _wrap_zts_py_bind, METH_VARARGS, NULL }, + { "zts_py_connect", _wrap_zts_py_connect, METH_VARARGS, NULL }, + { "zts_py_accept", _wrap_zts_py_accept, METH_O, NULL }, + { "zts_py_listen", _wrap_zts_py_listen, METH_VARARGS, NULL }, + { "zts_py_recv", _wrap_zts_py_recv, METH_VARARGS, NULL }, + { "zts_py_send", _wrap_zts_py_send, METH_VARARGS, NULL }, + { "zts_py_close", _wrap_zts_py_close, METH_O, NULL }, + { "zts_py_setblocking", _wrap_zts_py_setblocking, METH_VARARGS, NULL }, + { "zts_py_getblocking", _wrap_zts_py_getblocking, METH_O, NULL }, + { "zts_id_new", _wrap_zts_id_new, METH_VARARGS, NULL }, + { "zts_id_pair_is_valid", _wrap_zts_id_pair_is_valid, METH_VARARGS, NULL }, + { "zts_init_from_storage", _wrap_zts_init_from_storage, METH_O, NULL }, + { "zts_init_from_memory", _wrap_zts_init_from_memory, METH_VARARGS, NULL }, + { "zts_init_set_event_handler", _wrap_zts_init_set_event_handler, METH_O, NULL }, + { "zts_init_blacklist_if", _wrap_zts_init_blacklist_if, METH_VARARGS, NULL }, + { "zts_init_set_roots", _wrap_zts_init_set_roots, METH_VARARGS, NULL }, + { "zts_init_set_port", _wrap_zts_init_set_port, METH_O, NULL }, + { "zts_init_allow_net_cache", _wrap_zts_init_allow_net_cache, METH_O, NULL }, + { "zts_init_allow_peer_cache", _wrap_zts_init_allow_peer_cache, METH_O, NULL }, + { "zts_init_allow_roots_cache", _wrap_zts_init_allow_roots_cache, METH_O, NULL }, + { "zts_init_allow_id_cache", _wrap_zts_init_allow_id_cache, METH_O, NULL }, + { "zts_addr_is_assigned", _wrap_zts_addr_is_assigned, METH_VARARGS, NULL }, + { "zts_addr_get", _wrap_zts_addr_get, METH_VARARGS, NULL }, + { "zts_addr_get_str", _wrap_zts_addr_get_str, METH_VARARGS, NULL }, + { "zts_addr_get_all", _wrap_zts_addr_get_all, METH_VARARGS, NULL }, + { "zts_addr_compute_6plane", _wrap_zts_addr_compute_6plane, METH_VARARGS, NULL }, + { "zts_addr_compute_rfc4193", _wrap_zts_addr_compute_rfc4193, METH_VARARGS, NULL }, + { "zts_addr_compute_rfc4193_str", _wrap_zts_addr_compute_rfc4193_str, METH_VARARGS, NULL }, + { "zts_addr_compute_6plane_str", _wrap_zts_addr_compute_6plane_str, METH_VARARGS, NULL }, + { "zts_net_compute_adhoc_id", _wrap_zts_net_compute_adhoc_id, METH_VARARGS, NULL }, + { "zts_net_join", _wrap_zts_net_join, METH_O, NULL }, + { "zts_net_leave", _wrap_zts_net_leave, METH_O, NULL }, + { "zts_net_transport_is_ready", _wrap_zts_net_transport_is_ready, METH_O, NULL }, + { "zts_net_get_mac", _wrap_zts_net_get_mac, METH_O, NULL }, + { "zts_net_get_mac_str", _wrap_zts_net_get_mac_str, METH_VARARGS, NULL }, + { "zts_net_get_broadcast", _wrap_zts_net_get_broadcast, METH_O, NULL }, + { "zts_net_get_mtu", _wrap_zts_net_get_mtu, METH_O, NULL }, + { "zts_net_get_name", _wrap_zts_net_get_name, METH_VARARGS, NULL }, + { "zts_net_get_status", _wrap_zts_net_get_status, METH_O, NULL }, + { "zts_net_get_type", _wrap_zts_net_get_type, METH_O, NULL }, + { "zts_route_is_assigned", _wrap_zts_route_is_assigned, METH_VARARGS, NULL }, + { "zts_node_start", _wrap_zts_node_start, METH_NOARGS, NULL }, + { "zts_node_is_online", _wrap_zts_node_is_online, METH_NOARGS, NULL }, + { "zts_node_get_id", _wrap_zts_node_get_id, METH_NOARGS, NULL }, + { "zts_node_get_id_pair", _wrap_zts_node_get_id_pair, METH_VARARGS, NULL }, + { "zts_node_get_port", _wrap_zts_node_get_port, METH_NOARGS, NULL }, + { "zts_node_stop", _wrap_zts_node_stop, METH_NOARGS, NULL }, + { "zts_node_free", _wrap_zts_node_free, METH_NOARGS, NULL }, + { "zts_moon_orbit", _wrap_zts_moon_orbit, METH_VARARGS, NULL }, + { "zts_moon_deorbit", _wrap_zts_moon_deorbit, METH_O, NULL }, + { "zts_stats_counter_t_link_tx_set", _wrap_zts_stats_counter_t_link_tx_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_link_tx_get", _wrap_zts_stats_counter_t_link_tx_get, METH_O, NULL }, + { "zts_stats_counter_t_link_rx_set", _wrap_zts_stats_counter_t_link_rx_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_link_rx_get", _wrap_zts_stats_counter_t_link_rx_get, METH_O, NULL }, + { "zts_stats_counter_t_link_drop_set", _wrap_zts_stats_counter_t_link_drop_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_link_drop_get", _wrap_zts_stats_counter_t_link_drop_get, METH_O, NULL }, + { "zts_stats_counter_t_link_err_set", _wrap_zts_stats_counter_t_link_err_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_link_err_get", _wrap_zts_stats_counter_t_link_err_get, METH_O, NULL }, + { "zts_stats_counter_t_etharp_tx_set", _wrap_zts_stats_counter_t_etharp_tx_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_etharp_tx_get", _wrap_zts_stats_counter_t_etharp_tx_get, METH_O, NULL }, + { "zts_stats_counter_t_etharp_rx_set", _wrap_zts_stats_counter_t_etharp_rx_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_etharp_rx_get", _wrap_zts_stats_counter_t_etharp_rx_get, METH_O, NULL }, + { "zts_stats_counter_t_etharp_drop_set", _wrap_zts_stats_counter_t_etharp_drop_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_etharp_drop_get", _wrap_zts_stats_counter_t_etharp_drop_get, METH_O, NULL }, + { "zts_stats_counter_t_etharp_err_set", _wrap_zts_stats_counter_t_etharp_err_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_etharp_err_get", _wrap_zts_stats_counter_t_etharp_err_get, METH_O, NULL }, + { "zts_stats_counter_t_ip4_tx_set", _wrap_zts_stats_counter_t_ip4_tx_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_ip4_tx_get", _wrap_zts_stats_counter_t_ip4_tx_get, METH_O, NULL }, + { "zts_stats_counter_t_ip4_rx_set", _wrap_zts_stats_counter_t_ip4_rx_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_ip4_rx_get", _wrap_zts_stats_counter_t_ip4_rx_get, METH_O, NULL }, + { "zts_stats_counter_t_ip4_drop_set", _wrap_zts_stats_counter_t_ip4_drop_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_ip4_drop_get", _wrap_zts_stats_counter_t_ip4_drop_get, METH_O, NULL }, + { "zts_stats_counter_t_ip4_err_set", _wrap_zts_stats_counter_t_ip4_err_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_ip4_err_get", _wrap_zts_stats_counter_t_ip4_err_get, METH_O, NULL }, + { "zts_stats_counter_t_ip6_tx_set", _wrap_zts_stats_counter_t_ip6_tx_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_ip6_tx_get", _wrap_zts_stats_counter_t_ip6_tx_get, METH_O, NULL }, + { "zts_stats_counter_t_ip6_rx_set", _wrap_zts_stats_counter_t_ip6_rx_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_ip6_rx_get", _wrap_zts_stats_counter_t_ip6_rx_get, METH_O, NULL }, + { "zts_stats_counter_t_ip6_drop_set", _wrap_zts_stats_counter_t_ip6_drop_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_ip6_drop_get", _wrap_zts_stats_counter_t_ip6_drop_get, METH_O, NULL }, + { "zts_stats_counter_t_ip6_err_set", _wrap_zts_stats_counter_t_ip6_err_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_ip6_err_get", _wrap_zts_stats_counter_t_ip6_err_get, METH_O, NULL }, + { "zts_stats_counter_t_icmp4_tx_set", _wrap_zts_stats_counter_t_icmp4_tx_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_icmp4_tx_get", _wrap_zts_stats_counter_t_icmp4_tx_get, METH_O, NULL }, + { "zts_stats_counter_t_icmp4_rx_set", _wrap_zts_stats_counter_t_icmp4_rx_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_icmp4_rx_get", _wrap_zts_stats_counter_t_icmp4_rx_get, METH_O, NULL }, + { "zts_stats_counter_t_icmp4_drop_set", _wrap_zts_stats_counter_t_icmp4_drop_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_icmp4_drop_get", _wrap_zts_stats_counter_t_icmp4_drop_get, METH_O, NULL }, + { "zts_stats_counter_t_icmp4_err_set", _wrap_zts_stats_counter_t_icmp4_err_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_icmp4_err_get", _wrap_zts_stats_counter_t_icmp4_err_get, METH_O, NULL }, + { "zts_stats_counter_t_icmp6_tx_set", _wrap_zts_stats_counter_t_icmp6_tx_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_icmp6_tx_get", _wrap_zts_stats_counter_t_icmp6_tx_get, METH_O, NULL }, + { "zts_stats_counter_t_icmp6_rx_set", _wrap_zts_stats_counter_t_icmp6_rx_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_icmp6_rx_get", _wrap_zts_stats_counter_t_icmp6_rx_get, METH_O, NULL }, + { "zts_stats_counter_t_icmp6_drop_set", _wrap_zts_stats_counter_t_icmp6_drop_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_icmp6_drop_get", _wrap_zts_stats_counter_t_icmp6_drop_get, METH_O, NULL }, + { "zts_stats_counter_t_icmp6_err_set", _wrap_zts_stats_counter_t_icmp6_err_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_icmp6_err_get", _wrap_zts_stats_counter_t_icmp6_err_get, METH_O, NULL }, + { "zts_stats_counter_t_udp_tx_set", _wrap_zts_stats_counter_t_udp_tx_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_udp_tx_get", _wrap_zts_stats_counter_t_udp_tx_get, METH_O, NULL }, + { "zts_stats_counter_t_udp_rx_set", _wrap_zts_stats_counter_t_udp_rx_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_udp_rx_get", _wrap_zts_stats_counter_t_udp_rx_get, METH_O, NULL }, + { "zts_stats_counter_t_udp_drop_set", _wrap_zts_stats_counter_t_udp_drop_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_udp_drop_get", _wrap_zts_stats_counter_t_udp_drop_get, METH_O, NULL }, + { "zts_stats_counter_t_udp_err_set", _wrap_zts_stats_counter_t_udp_err_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_udp_err_get", _wrap_zts_stats_counter_t_udp_err_get, METH_O, NULL }, + { "zts_stats_counter_t_tcp_tx_set", _wrap_zts_stats_counter_t_tcp_tx_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_tcp_tx_get", _wrap_zts_stats_counter_t_tcp_tx_get, METH_O, NULL }, + { "zts_stats_counter_t_tcp_rx_set", _wrap_zts_stats_counter_t_tcp_rx_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_tcp_rx_get", _wrap_zts_stats_counter_t_tcp_rx_get, METH_O, NULL }, + { "zts_stats_counter_t_tcp_drop_set", _wrap_zts_stats_counter_t_tcp_drop_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_tcp_drop_get", _wrap_zts_stats_counter_t_tcp_drop_get, METH_O, NULL }, + { "zts_stats_counter_t_tcp_err_set", _wrap_zts_stats_counter_t_tcp_err_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_tcp_err_get", _wrap_zts_stats_counter_t_tcp_err_get, METH_O, NULL }, + { "zts_stats_counter_t_nd6_tx_set", _wrap_zts_stats_counter_t_nd6_tx_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_nd6_tx_get", _wrap_zts_stats_counter_t_nd6_tx_get, METH_O, NULL }, + { "zts_stats_counter_t_nd6_rx_set", _wrap_zts_stats_counter_t_nd6_rx_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_nd6_rx_get", _wrap_zts_stats_counter_t_nd6_rx_get, METH_O, NULL }, + { "zts_stats_counter_t_nd6_drop_set", _wrap_zts_stats_counter_t_nd6_drop_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_nd6_drop_get", _wrap_zts_stats_counter_t_nd6_drop_get, METH_O, NULL }, + { "zts_stats_counter_t_nd6_err_set", _wrap_zts_stats_counter_t_nd6_err_set, METH_VARARGS, NULL }, + { "zts_stats_counter_t_nd6_err_get", _wrap_zts_stats_counter_t_nd6_err_get, METH_O, NULL }, + { "new_zts_stats_counter_t", _wrap_new_zts_stats_counter_t, METH_NOARGS, NULL }, + { "delete_zts_stats_counter_t", _wrap_delete_zts_stats_counter_t, METH_O, NULL }, + { "zts_stats_counter_t_swigregister", zts_stats_counter_t_swigregister, METH_O, NULL }, + { "zts_stats_counter_t_swiginit", zts_stats_counter_t_swiginit, METH_VARARGS, NULL }, + { "zts_stats_get_all", _wrap_zts_stats_get_all, METH_O, NULL }, + { "zts_bsd_socket", _wrap_zts_bsd_socket, METH_VARARGS, NULL }, + { "zts_bsd_connect", _wrap_zts_bsd_connect, METH_VARARGS, NULL }, + { "zts_bsd_bind", _wrap_zts_bsd_bind, METH_VARARGS, NULL }, + { "zts_bsd_listen", _wrap_zts_bsd_listen, METH_VARARGS, NULL }, + { "zts_bsd_accept", _wrap_zts_bsd_accept, METH_VARARGS, NULL }, + { "zts_bsd_setsockopt", _wrap_zts_bsd_setsockopt, METH_VARARGS, NULL }, + { "zts_bsd_getsockopt", _wrap_zts_bsd_getsockopt, METH_VARARGS, NULL }, + { "zts_bsd_getsockname", _wrap_zts_bsd_getsockname, METH_VARARGS, NULL }, + { "zts_bsd_getpeername", _wrap_zts_bsd_getpeername, METH_VARARGS, NULL }, + { "zts_bsd_close", _wrap_zts_bsd_close, METH_O, NULL }, + { "zts_timeval_tv_sec_set", _wrap_zts_timeval_tv_sec_set, METH_VARARGS, NULL }, + { "zts_timeval_tv_sec_get", _wrap_zts_timeval_tv_sec_get, METH_O, NULL }, + { "zts_timeval_tv_usec_set", _wrap_zts_timeval_tv_usec_set, METH_VARARGS, NULL }, + { "zts_timeval_tv_usec_get", _wrap_zts_timeval_tv_usec_get, METH_O, NULL }, + { "new_zts_timeval", _wrap_new_zts_timeval, METH_NOARGS, NULL }, + { "delete_zts_timeval", _wrap_delete_zts_timeval, METH_O, NULL }, + { "zts_timeval_swigregister", zts_timeval_swigregister, METH_O, NULL }, + { "zts_timeval_swiginit", zts_timeval_swiginit, METH_VARARGS, NULL }, + { "zts_bsd_select", _wrap_zts_bsd_select, METH_VARARGS, NULL }, + { "zts_bsd_fcntl", _wrap_zts_bsd_fcntl, METH_VARARGS, NULL }, + { "zts_bsd_poll", _wrap_zts_bsd_poll, METH_VARARGS, NULL }, + { "zts_bsd_ioctl", _wrap_zts_bsd_ioctl, METH_VARARGS, NULL }, + { "zts_bsd_send", _wrap_zts_bsd_send, METH_VARARGS, NULL }, + { "zts_bsd_sendto", _wrap_zts_bsd_sendto, METH_VARARGS, NULL }, + { "zts_iovec_iov_base_set", _wrap_zts_iovec_iov_base_set, METH_VARARGS, NULL }, + { "zts_iovec_iov_base_get", _wrap_zts_iovec_iov_base_get, METH_O, NULL }, + { "zts_iovec_iov_len_set", _wrap_zts_iovec_iov_len_set, METH_VARARGS, NULL }, + { "zts_iovec_iov_len_get", _wrap_zts_iovec_iov_len_get, METH_O, NULL }, + { "new_zts_iovec", _wrap_new_zts_iovec, METH_NOARGS, NULL }, + { "delete_zts_iovec", _wrap_delete_zts_iovec, METH_O, NULL }, + { "zts_iovec_swigregister", zts_iovec_swigregister, METH_O, NULL }, + { "zts_iovec_swiginit", zts_iovec_swiginit, METH_VARARGS, NULL }, + { "zts_bsd_sendmsg", _wrap_zts_bsd_sendmsg, METH_VARARGS, NULL }, + { "zts_bsd_recv", _wrap_zts_bsd_recv, METH_VARARGS, NULL }, + { "zts_bsd_recvfrom", _wrap_zts_bsd_recvfrom, METH_VARARGS, NULL }, + { "zts_bsd_recvmsg", _wrap_zts_bsd_recvmsg, METH_VARARGS, NULL }, + { "zts_bsd_read", _wrap_zts_bsd_read, METH_VARARGS, NULL }, + { "zts_bsd_readv", _wrap_zts_bsd_readv, METH_VARARGS, NULL }, + { "zts_bsd_write", _wrap_zts_bsd_write, METH_VARARGS, NULL }, + { "zts_bsd_writev", _wrap_zts_bsd_writev, METH_VARARGS, NULL }, + { "zts_bsd_shutdown", _wrap_zts_bsd_shutdown, METH_VARARGS, NULL }, + { "zts_connect", _wrap_zts_connect, METH_VARARGS, NULL }, + { "zts_bind", _wrap_zts_bind, METH_VARARGS, NULL }, + { "zts_accept", _wrap_zts_accept, METH_VARARGS, NULL }, + { "zts_getpeername", _wrap_zts_getpeername, METH_VARARGS, NULL }, + { "zts_getsockname", _wrap_zts_getsockname, METH_VARARGS, NULL }, + { "zts_tcp_client", _wrap_zts_tcp_client, METH_VARARGS, NULL }, + { "zts_tcp_server", _wrap_zts_tcp_server, METH_VARARGS, NULL }, + { "zts_udp_server", _wrap_zts_udp_server, METH_VARARGS, NULL }, + { "zts_udp_client", _wrap_zts_udp_client, METH_O, NULL }, + { "zts_set_no_delay", _wrap_zts_set_no_delay, METH_VARARGS, NULL }, + { "zts_get_no_delay", _wrap_zts_get_no_delay, METH_O, NULL }, + { "zts_set_linger", _wrap_zts_set_linger, METH_VARARGS, NULL }, + { "zts_get_linger_enabled", _wrap_zts_get_linger_enabled, METH_O, NULL }, + { "zts_get_linger_value", _wrap_zts_get_linger_value, METH_O, NULL }, + { "zts_get_pending_data_size", _wrap_zts_get_pending_data_size, METH_O, NULL }, + { "zts_set_reuse_addr", _wrap_zts_set_reuse_addr, METH_VARARGS, NULL }, + { "zts_get_reuse_addr", _wrap_zts_get_reuse_addr, METH_O, NULL }, + { "zts_set_recv_timeout", _wrap_zts_set_recv_timeout, METH_VARARGS, NULL }, + { "zts_get_recv_timeout", _wrap_zts_get_recv_timeout, METH_O, NULL }, + { "zts_set_send_timeout", _wrap_zts_set_send_timeout, METH_VARARGS, NULL }, + { "zts_get_send_timeout", _wrap_zts_get_send_timeout, METH_O, NULL }, + { "zts_set_send_buf_size", _wrap_zts_set_send_buf_size, METH_VARARGS, NULL }, + { "zts_get_send_buf_size", _wrap_zts_get_send_buf_size, METH_O, NULL }, + { "zts_set_recv_buf_size", _wrap_zts_set_recv_buf_size, METH_VARARGS, NULL }, + { "zts_get_recv_buf_size", _wrap_zts_get_recv_buf_size, METH_O, NULL }, + { "zts_set_ttl", _wrap_zts_set_ttl, METH_VARARGS, NULL }, + { "zts_get_ttl", _wrap_zts_get_ttl, METH_O, NULL }, + { "zts_set_blocking", _wrap_zts_set_blocking, METH_VARARGS, NULL }, + { "zts_get_blocking", _wrap_zts_get_blocking, METH_O, NULL }, + { "zts_set_keepalive", _wrap_zts_set_keepalive, METH_VARARGS, NULL }, + { "zts_get_keepalive", _wrap_zts_get_keepalive, METH_O, NULL }, + { "zts_hostent_h_name_set", _wrap_zts_hostent_h_name_set, METH_VARARGS, NULL }, + { "zts_hostent_h_name_get", _wrap_zts_hostent_h_name_get, METH_O, NULL }, + { "zts_hostent_h_aliases_set", _wrap_zts_hostent_h_aliases_set, METH_VARARGS, NULL }, + { "zts_hostent_h_aliases_get", _wrap_zts_hostent_h_aliases_get, METH_O, NULL }, + { "zts_hostent_h_addrtype_set", _wrap_zts_hostent_h_addrtype_set, METH_VARARGS, NULL }, + { "zts_hostent_h_addrtype_get", _wrap_zts_hostent_h_addrtype_get, METH_O, NULL }, + { "zts_hostent_h_length_set", _wrap_zts_hostent_h_length_set, METH_VARARGS, NULL }, + { "zts_hostent_h_length_get", _wrap_zts_hostent_h_length_get, METH_O, NULL }, + { "zts_hostent_h_addr_list_set", _wrap_zts_hostent_h_addr_list_set, METH_VARARGS, NULL }, + { "zts_hostent_h_addr_list_get", _wrap_zts_hostent_h_addr_list_get, METH_O, NULL }, + { "new_zts_hostent", _wrap_new_zts_hostent, METH_NOARGS, NULL }, + { "delete_zts_hostent", _wrap_delete_zts_hostent, METH_O, NULL }, + { "zts_hostent_swigregister", zts_hostent_swigregister, METH_O, NULL }, + { "zts_hostent_swiginit", zts_hostent_swiginit, METH_VARARGS, NULL }, + { "zts_bsd_gethostbyname", _wrap_zts_bsd_gethostbyname, METH_O, NULL }, + { "zts_ip4_addr_addr_set", _wrap_zts_ip4_addr_addr_set, METH_VARARGS, NULL }, + { "zts_ip4_addr_addr_get", _wrap_zts_ip4_addr_addr_get, METH_O, NULL }, + { "new_zts_ip4_addr", _wrap_new_zts_ip4_addr, METH_NOARGS, NULL }, + { "delete_zts_ip4_addr", _wrap_delete_zts_ip4_addr, METH_O, NULL }, + { "zts_ip4_addr_swigregister", zts_ip4_addr_swigregister, METH_O, NULL }, + { "zts_ip4_addr_swiginit", zts_ip4_addr_swiginit, METH_VARARGS, NULL }, + { "zts_ip6_addr_addr_set", _wrap_zts_ip6_addr_addr_set, METH_VARARGS, NULL }, + { "zts_ip6_addr_addr_get", _wrap_zts_ip6_addr_addr_get, METH_O, NULL }, + { "new_zts_ip6_addr", _wrap_new_zts_ip6_addr, METH_NOARGS, NULL }, + { "delete_zts_ip6_addr", _wrap_delete_zts_ip6_addr, METH_O, NULL }, + { "zts_ip6_addr_swigregister", zts_ip6_addr_swigregister, METH_O, NULL }, + { "zts_ip6_addr_swiginit", zts_ip6_addr_swiginit, METH_VARARGS, NULL }, + { "zts_ip_addr_type_set", _wrap_zts_ip_addr_type_set, METH_VARARGS, NULL }, + { "zts_ip_addr_type_get", _wrap_zts_ip_addr_type_get, METH_O, NULL }, + { "new_zts_ip_addr", _wrap_new_zts_ip_addr, METH_NOARGS, NULL }, + { "delete_zts_ip_addr", _wrap_delete_zts_ip_addr, METH_O, NULL }, + { "zts_ip_addr_swigregister", zts_ip_addr_swigregister, METH_O, NULL }, + { "zts_ip_addr_swiginit", zts_ip_addr_swiginit, METH_VARARGS, NULL }, + { "zts_dns_set_server", _wrap_zts_dns_set_server, METH_VARARGS, NULL }, + { "zts_dns_get_server", _wrap_zts_dns_get_server, METH_O, NULL }, + { "zts_core_lock_obtain", _wrap_zts_core_lock_obtain, METH_NOARGS, NULL }, + { "zts_core_lock_release", _wrap_zts_core_lock_release, METH_NOARGS, NULL }, + { "zts_core_query_addr_count", _wrap_zts_core_query_addr_count, METH_O, NULL }, + { "zts_core_query_addr", _wrap_zts_core_query_addr, METH_VARARGS, NULL }, + { "zts_core_query_route_count", _wrap_zts_core_query_route_count, METH_O, NULL }, + { "zts_core_query_route", _wrap_zts_core_query_route, METH_VARARGS, NULL }, + { "zts_core_query_path_count", _wrap_zts_core_query_path_count, METH_O, NULL }, + { "zts_core_query_path", _wrap_zts_core_query_path, METH_VARARGS, NULL }, + { "zts_core_query_mc_count", _wrap_zts_core_query_mc_count, METH_O, NULL }, + { "zts_core_query_mc", _wrap_zts_core_query_mc, METH_VARARGS, NULL }, + { "zts_util_sign_root_set", _wrap_zts_util_sign_root_set, METH_VARARGS, NULL }, + { "zts_util_delay", _wrap_zts_util_delay, METH_O, NULL }, + { "zts_util_get_ip_family", _wrap_zts_util_get_ip_family, METH_O, NULL }, + { "zts_util_ipstr_to_saddr", _wrap_zts_util_ipstr_to_saddr, METH_VARARGS, NULL }, + { "zts_util_ntop", _wrap_zts_util_ntop, METH_VARARGS, NULL }, + { "zts_ipaddr_ntoa", _wrap_zts_ipaddr_ntoa, METH_O, NULL }, + { "zts_ipaddr_aton", _wrap_zts_ipaddr_aton, METH_VARARGS, NULL }, + { "zts_inet_ntop", _wrap_zts_inet_ntop, METH_VARARGS, NULL }, + { "zts_inet_pton", _wrap_zts_inet_pton, METH_VARARGS, NULL }, + { NULL, NULL, 0, NULL } +}; + +static PyMethodDef SwigMethods_proxydocs[] = { { NULL, NULL, 0, NULL } }; + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ + +static swig_type_info _swigt__p_PythonDirectorCallbackClass = { + "_p_PythonDirectorCallbackClass", "PythonDirectorCallbackClass *", 0, 0, (void*)0, 0 +}; +static swig_type_info _swigt__p_a_32__p_char = { "_p_a_32__p_char", "char *(*)[32]", 0, 0, (void*)0, 0 }; +static swig_type_info _swigt__p_char = { "_p_char", "char *", 0, 0, (void*)0, 0 }; +static swig_type_info _swigt__p_int = { + "_p_int", "intptr_t *|int *|int_least32_t *|int_fast32_t *|int32_t *|int_fast16_t *", 0, 0, (void*)0, 0 +}; +static swig_type_info _swigt__p_long_long = { + "_p_long_long", "int_least64_t *|int_fast64_t *|int64_t *|long long *|intmax_t *", 0, 0, (void*)0, 0 +}; +static swig_type_info _swigt__p_p_char = { "_p_p_char", "char **", 0, 0, (void*)0, 0 }; +static swig_type_info _swigt__p_short = { "_p_short", "short *|int_least16_t *|int16_t *", 0, 0, (void*)0, 0 }; +static swig_type_info _swigt__p_signed_char = { + "_p_signed_char", "signed char *|int_least8_t *|int_fast8_t *|int8_t *", 0, 0, (void*)0, 0 +}; +static swig_type_info _swigt__p_ssize_t = { "_p_ssize_t", "ssize_t *", 0, 0, (void*)0, 0 }; +static swig_type_info _swigt__p_unsigned_char = { + "_p_unsigned_char", "unsigned char *|zts_sa_family_t *|uint_least8_t *|uint_fast8_t *|uint8_t *", 0, 0, (void*)0, 0 +}; +static swig_type_info _swigt__p_unsigned_int = { "_p_unsigned_int", + "uintptr_t *|uint_least32_t *|uint_fast32_t *|uint32_t *|unsigned int " + "*|zts_in_addr_t *|zts_socklen_t *|uint_fast16_t *", + 0, + 0, + (void*)0, + 0 }; +static swig_type_info _swigt__p_unsigned_long_long = { + "_p_unsigned_long_long", + "uint_least64_t *|uint_fast64_t *|uint64_t *|unsigned long long *|uintmax_t *", + 0, + 0, + (void*)0, + 0 +}; +static swig_type_info _swigt__p_unsigned_short = { + "_p_unsigned_short", "unsigned short *|zts_in_port_t *|uint_least16_t *|uint16_t *", 0, 0, (void*)0, 0 +}; +static swig_type_info _swigt__p_void = { "_p_void", "void *", 0, 0, (void*)0, 0 }; +static swig_type_info _swigt__p_zts_addr_info_t = { "_p_zts_addr_info_t", "zts_addr_info_t *", 0, 0, (void*)0, 0 }; +static swig_type_info _swigt__p_zts_errno_t = { + "_p_zts_errno_t", "enum zts_errno_t *|zts_errno_t *", 0, 0, (void*)0, 0 +}; +static swig_type_info _swigt__p_zts_error_t = { + "_p_zts_error_t", "enum zts_error_t *|zts_error_t *", 0, 0, (void*)0, 0 +}; +static swig_type_info _swigt__p_zts_event_msg_t = { "_p_zts_event_msg_t", "zts_event_msg_t *", 0, 0, (void*)0, 0 }; +static swig_type_info _swigt__p_zts_event_t = { + "_p_zts_event_t", "enum zts_event_t *|zts_event_t *", 0, 0, (void*)0, 0 +}; +static swig_type_info _swigt__p_zts_fd_set = { "_p_zts_fd_set", "zts_fd_set *", 0, 0, (void*)0, 0 }; +static swig_type_info _swigt__p_zts_hostent = { "_p_zts_hostent", "zts_hostent *", 0, 0, (void*)0, 0 }; +static swig_type_info _swigt__p_zts_iovec = { "_p_zts_iovec", "zts_iovec *", 0, 0, (void*)0, 0 }; +static swig_type_info _swigt__p_zts_ip4_addr = { "_p_zts_ip4_addr", "zts_ip4_addr *", 0, 0, (void*)0, 0 }; +static swig_type_info _swigt__p_zts_ip6_addr = { "_p_zts_ip6_addr", "zts_ip6_addr *", 0, 0, (void*)0, 0 }; +static swig_type_info _swigt__p_zts_ip_addr = { "_p_zts_ip_addr", "zts_ip_addr *", 0, 0, (void*)0, 0 }; +static swig_type_info _swigt__p_zts_msghdr = { "_p_zts_msghdr", "zts_msghdr *", 0, 0, (void*)0, 0 }; +static swig_type_info _swigt__p_zts_multicast_group_t = { + "_p_zts_multicast_group_t", "zts_multicast_group_t *", 0, 0, (void*)0, 0 +}; +static swig_type_info _swigt__p_zts_net_info_t = { "_p_zts_net_info_t", "zts_net_info_t *", 0, 0, (void*)0, 0 }; +static swig_type_info _swigt__p_zts_net_info_type_t = { + "_p_zts_net_info_type_t", "enum zts_net_info_type_t *|zts_net_info_type_t *", 0, 0, (void*)0, 0 +}; +static swig_type_info _swigt__p_zts_netif_info_t = { "_p_zts_netif_info_t", "zts_netif_info_t *", 0, 0, (void*)0, 0 }; +static swig_type_info _swigt__p_zts_network_status_t = { + "_p_zts_network_status_t", "enum zts_network_status_t *|zts_network_status_t *", 0, 0, (void*)0, 0 +}; +static swig_type_info _swigt__p_zts_node_info_t = { "_p_zts_node_info_t", "zts_node_info_t *", 0, 0, (void*)0, 0 }; +static swig_type_info _swigt__p_zts_path_t = { "_p_zts_path_t", "zts_path_t *", 0, 0, (void*)0, 0 }; +static swig_type_info _swigt__p_zts_peer_info_t = { "_p_zts_peer_info_t", "zts_peer_info_t *", 0, 0, (void*)0, 0 }; +static swig_type_info _swigt__p_zts_peer_role_t = { + "_p_zts_peer_role_t", "enum zts_peer_role_t *|zts_peer_role_t *", 0, 0, (void*)0, 0 +}; +static swig_type_info _swigt__p_zts_pollfd = { "_p_zts_pollfd", "zts_pollfd *", 0, 0, (void*)0, 0 }; +static swig_type_info _swigt__p_zts_root_set_t = { "_p_zts_root_set_t", "zts_root_set_t *", 0, 0, (void*)0, 0 }; +static swig_type_info _swigt__p_zts_route_info_t = { "_p_zts_route_info_t", "zts_route_info_t *", 0, 0, (void*)0, 0 }; +static swig_type_info _swigt__p_zts_sockaddr = { "_p_zts_sockaddr", "zts_sockaddr *", 0, 0, (void*)0, 0 }; +static swig_type_info _swigt__p_zts_sockaddr_storage = { + "_p_zts_sockaddr_storage", "zts_sockaddr_storage *", 0, 0, (void*)0, 0 +}; +static swig_type_info _swigt__p_zts_stats_counter_t = { + "_p_zts_stats_counter_t", "zts_stats_counter_t *", 0, 0, (void*)0, 0 +}; +static swig_type_info _swigt__p_zts_timeval = { "_p_zts_timeval", "zts_timeval *", 0, 0, (void*)0, 0 }; + +static swig_type_info* swig_type_initial[] = { + &_swigt__p_PythonDirectorCallbackClass, + &_swigt__p_a_32__p_char, + &_swigt__p_char, + &_swigt__p_int, + &_swigt__p_long_long, + &_swigt__p_p_char, + &_swigt__p_short, + &_swigt__p_signed_char, + &_swigt__p_ssize_t, + &_swigt__p_unsigned_char, + &_swigt__p_unsigned_int, + &_swigt__p_unsigned_long_long, + &_swigt__p_unsigned_short, + &_swigt__p_void, + &_swigt__p_zts_addr_info_t, + &_swigt__p_zts_errno_t, + &_swigt__p_zts_error_t, + &_swigt__p_zts_event_msg_t, + &_swigt__p_zts_event_t, + &_swigt__p_zts_fd_set, + &_swigt__p_zts_hostent, + &_swigt__p_zts_iovec, + &_swigt__p_zts_ip4_addr, + &_swigt__p_zts_ip6_addr, + &_swigt__p_zts_ip_addr, + &_swigt__p_zts_msghdr, + &_swigt__p_zts_multicast_group_t, + &_swigt__p_zts_net_info_t, + &_swigt__p_zts_net_info_type_t, + &_swigt__p_zts_netif_info_t, + &_swigt__p_zts_network_status_t, + &_swigt__p_zts_node_info_t, + &_swigt__p_zts_path_t, + &_swigt__p_zts_peer_info_t, + &_swigt__p_zts_peer_role_t, + &_swigt__p_zts_pollfd, + &_swigt__p_zts_root_set_t, + &_swigt__p_zts_route_info_t, + &_swigt__p_zts_sockaddr, + &_swigt__p_zts_sockaddr_storage, + &_swigt__p_zts_stats_counter_t, + &_swigt__p_zts_timeval, +}; + +static swig_cast_info _swigc__p_PythonDirectorCallbackClass[] = { { &_swigt__p_PythonDirectorCallbackClass, 0, 0, 0 }, + { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_a_32__p_char[] = { { &_swigt__p_a_32__p_char, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_char[] = { { &_swigt__p_char, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_int[] = { { &_swigt__p_int, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_long_long[] = { { &_swigt__p_long_long, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_p_char[] = { { &_swigt__p_p_char, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_short[] = { { &_swigt__p_short, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_signed_char[] = { { &_swigt__p_signed_char, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_ssize_t[] = { { &_swigt__p_ssize_t, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_unsigned_char[] = { { &_swigt__p_unsigned_char, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_unsigned_int[] = { { &_swigt__p_unsigned_int, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_unsigned_long_long[] = { { &_swigt__p_unsigned_long_long, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_unsigned_short[] = { { &_swigt__p_unsigned_short, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_void[] = { { &_swigt__p_void, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_addr_info_t[] = { { &_swigt__p_zts_addr_info_t, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_errno_t[] = { { &_swigt__p_zts_errno_t, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_error_t[] = { { &_swigt__p_zts_error_t, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_event_msg_t[] = { { &_swigt__p_zts_event_msg_t, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_event_t[] = { { &_swigt__p_zts_event_t, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_fd_set[] = { { &_swigt__p_zts_fd_set, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_hostent[] = { { &_swigt__p_zts_hostent, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_iovec[] = { { &_swigt__p_zts_iovec, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_ip4_addr[] = { { &_swigt__p_zts_ip4_addr, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_ip6_addr[] = { { &_swigt__p_zts_ip6_addr, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_ip_addr[] = { { &_swigt__p_zts_ip_addr, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_msghdr[] = { { &_swigt__p_zts_msghdr, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_multicast_group_t[] = { { &_swigt__p_zts_multicast_group_t, 0, 0, 0 }, + { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_net_info_t[] = { { &_swigt__p_zts_net_info_t, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_net_info_type_t[] = { { &_swigt__p_zts_net_info_type_t, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_netif_info_t[] = { { &_swigt__p_zts_netif_info_t, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_network_status_t[] = { { &_swigt__p_zts_network_status_t, 0, 0, 0 }, + { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_node_info_t[] = { { &_swigt__p_zts_node_info_t, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_path_t[] = { { &_swigt__p_zts_path_t, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_peer_info_t[] = { { &_swigt__p_zts_peer_info_t, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_peer_role_t[] = { { &_swigt__p_zts_peer_role_t, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_pollfd[] = { { &_swigt__p_zts_pollfd, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_root_set_t[] = { { &_swigt__p_zts_root_set_t, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_route_info_t[] = { { &_swigt__p_zts_route_info_t, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_sockaddr[] = { { &_swigt__p_zts_sockaddr, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_sockaddr_storage[] = { { &_swigt__p_zts_sockaddr_storage, 0, 0, 0 }, + { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_stats_counter_t[] = { { &_swigt__p_zts_stats_counter_t, 0, 0, 0 }, { 0, 0, 0, 0 } }; +static swig_cast_info _swigc__p_zts_timeval[] = { { &_swigt__p_zts_timeval, 0, 0, 0 }, { 0, 0, 0, 0 } }; + +static swig_cast_info* swig_cast_initial[] = { + _swigc__p_PythonDirectorCallbackClass, + _swigc__p_a_32__p_char, + _swigc__p_char, + _swigc__p_int, + _swigc__p_long_long, + _swigc__p_p_char, + _swigc__p_short, + _swigc__p_signed_char, + _swigc__p_ssize_t, + _swigc__p_unsigned_char, + _swigc__p_unsigned_int, + _swigc__p_unsigned_long_long, + _swigc__p_unsigned_short, + _swigc__p_void, + _swigc__p_zts_addr_info_t, + _swigc__p_zts_errno_t, + _swigc__p_zts_error_t, + _swigc__p_zts_event_msg_t, + _swigc__p_zts_event_t, + _swigc__p_zts_fd_set, + _swigc__p_zts_hostent, + _swigc__p_zts_iovec, + _swigc__p_zts_ip4_addr, + _swigc__p_zts_ip6_addr, + _swigc__p_zts_ip_addr, + _swigc__p_zts_msghdr, + _swigc__p_zts_multicast_group_t, + _swigc__p_zts_net_info_t, + _swigc__p_zts_net_info_type_t, + _swigc__p_zts_netif_info_t, + _swigc__p_zts_network_status_t, + _swigc__p_zts_node_info_t, + _swigc__p_zts_path_t, + _swigc__p_zts_peer_info_t, + _swigc__p_zts_peer_role_t, + _swigc__p_zts_pollfd, + _swigc__p_zts_root_set_t, + _swigc__p_zts_route_info_t, + _swigc__p_zts_sockaddr, + _swigc__p_zts_sockaddr_storage, + _swigc__p_zts_stats_counter_t, + _swigc__p_zts_timeval, +}; + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ + +static swig_const_info swig_const_table[] = { { 0, 0, 0, 0.0, 0, 0 } }; + +#ifdef __cplusplus +} +#endif +/* ----------------------------------------------------------------------------- + * Type initialization: + * This problem is tough by the requirement that no dynamic + * memory is used. Also, since swig_type_info structures store pointers to + * swig_cast_info structures and swig_cast_info structures store pointers back + * to swig_type_info structures, we need some lookup code at initialization. + * The idea is that swig generates all the structures that are needed. + * The runtime then collects these partially filled structures. + * The SWIG_InitializeModule function takes these initial arrays out of + * swig_module, and does all the lookup, filling in the swig_module.types + * array with the correct data and linking the correct swig_cast_info + * structures together. + * + * The generated swig_type_info structures are assigned statically to an initial + * array. We just loop through that array, and handle each type individually. + * First we lookup if this type has been already loaded, and if so, use the + * loaded structure instead of the generated one. Then we have to fill in the + * cast linked list. The cast data is initially stored in something like a + * two-dimensional array. Each row corresponds to a type (there are the same + * number of rows as there are in the swig_type_initial array). Each entry in + * a column is one of the swig_cast_info structures for that type. + * The cast_initial array is actually an array of arrays, because each row has + * a variable number of columns. So to actually build the cast linked list, + * we find the array of casts associated with the type, and loop through it + * adding the casts to the list. The one last trick we need to do is making + * sure the type pointer in the swig_cast_info struct is correct. + * + * First off, we lookup the cast->type name to see if it is already loaded. + * There are three cases to handle: + * 1) If the cast->type has already been loaded AND the type we are adding + * casting info to has not been loaded (it is in this module), THEN we + * replace the cast->type pointer with the type pointer that has already + * been loaded. + * 2) If BOTH types (the one we are adding casting info to, and the + * cast->type) are loaded, THEN the cast info has already been loaded by + * the previous module so we just ignore it. + * 3) Finally, if cast->type has not already been loaded, then we add that + * swig_cast_info to the linked list (because the cast->type) pointer will + * be correct. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#if 0 +} /* c-mode */ +#endif +#endif + +#if 0 +#define SWIGRUNTIME_DEBUG +#endif + +SWIGRUNTIME void SWIG_InitializeModule(void* clientdata) +{ + size_t i; + swig_module_info *module_head, *iter; + int init; + + /* check to see if the circular list has been setup, if not, set it up */ + if (swig_module.next == 0) { + /* Initialize the swig_module */ + swig_module.type_initial = swig_type_initial; + swig_module.cast_initial = swig_cast_initial; + swig_module.next = &swig_module; + init = 1; + } + else { + init = 0; + } + + /* Try and load any already created modules */ + module_head = SWIG_GetModule(clientdata); + if (! module_head) { + /* This is the first module loaded for this interpreter */ + /* so set the swig module into the interpreter */ + SWIG_SetModule(clientdata, &swig_module); + } + else { + /* the interpreter has loaded a SWIG module, but has it loaded this one? */ + iter = module_head; + do { + if (iter == &swig_module) { + /* Our module is already in the list, so there's nothing more to do. */ + return; + } + iter = iter->next; + } while (iter != module_head); + + /* otherwise we must add our module into the list */ + swig_module.next = module_head->next; + module_head->next = &swig_module; + } + + /* When multiple interpreters are used, a module could have already been initialized in + a different interpreter, but not yet have a pointer in this interpreter. + In this case, we do not want to continue adding types... everything should be + set up already */ + if (init == 0) + return; + + /* Now work on filling in swig_module.types */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size); +#endif + for (i = 0; i < swig_module.size; ++i) { + swig_type_info* type = 0; + swig_type_info* ret; + swig_cast_info* cast; + +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name); +#endif + + /* if there is another module already loaded */ + if (swig_module.next != &swig_module) { + type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); + } + if (type) { + /* Overwrite clientdata field */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found type %s\n", type->name); +#endif + if (swig_module.type_initial[i]->clientdata) { + type->clientdata = swig_module.type_initial[i]->clientdata; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); +#endif + } + } + else { + type = swig_module.type_initial[i]; + } + + /* Insert casting types */ + cast = swig_module.cast_initial[i]; + while (cast->type) { + /* Don't need to add information already in the list */ + ret = 0; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); +#endif + if (swig_module.next != &swig_module) { + ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); +#ifdef SWIGRUNTIME_DEBUG + if (ret) + printf("SWIG_InitializeModule: found cast %s\n", ret->name); +#endif + } + if (ret) { + if (type == swig_module.type_initial[i]) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: skip old type %s\n", ret->name); +#endif + cast->type = ret; + ret = 0; + } + else { + /* Check for casting already in the list */ + swig_cast_info* ocast = SWIG_TypeCheck(ret->name, type); +#ifdef SWIGRUNTIME_DEBUG + if (ocast) + printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); +#endif + if (! ocast) + ret = 0; + } + } + + if (! ret) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); +#endif + if (type->cast) { + type->cast->prev = cast; + cast->next = type->cast; + } + type->cast = cast; + } + cast++; + } + /* Set entry in modules->types array equal to the type */ + swig_module.types[i] = type; + } + swig_module.types[i] = 0; + +#ifdef SWIGRUNTIME_DEBUG + printf("**** SWIG_InitializeModule: Cast List ******\n"); + for (i = 0; i < swig_module.size; ++i) { + int j = 0; + swig_cast_info* cast = swig_module.cast_initial[i]; + printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name); + while (cast->type) { + printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); + cast++; + ++j; + } + printf("---- Total casts: %d\n", j); + } + printf("**** SWIG_InitializeModule: Cast List ******\n"); +#endif +} + +/* This function will propagate the clientdata field of type to + * any new swig_type_info structures that have been added into the list + * of equivalent types. It is like calling + * SWIG_TypeClientData(type, clientdata) a second time. + */ +SWIGRUNTIME void SWIG_PropagateClientData(void) +{ + size_t i; + swig_cast_info* equiv; + static int init_run = 0; + + if (init_run) + return; + init_run = 1; + + for (i = 0; i < swig_module.size; i++) { + if (swig_module.types[i]->clientdata) { + equiv = swig_module.types[i]->cast; + while (equiv) { + if (! equiv->converter) { + if (equiv->type && ! equiv->type->clientdata) + SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); + } + equiv = equiv->next; + } + } + } +} + +#ifdef __cplusplus +#if 0 +{ + /* c-mode */ +#endif +} +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Python-specific SWIG API */ +#define SWIG_newvarlink() SWIG_Python_newvarlink() +#define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr) +#define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants) + +/* ----------------------------------------------------------------------------- + * global variable support code. + * ----------------------------------------------------------------------------- */ + +typedef struct swig_globalvar { + char* name; /* Name of global variable */ + PyObject* (*get_attr)(void); /* Return the current value */ + int (*set_attr)(PyObject*); /* Set the value */ + struct swig_globalvar* next; +} swig_globalvar; + +typedef struct swig_varlinkobject { + PyObject_HEAD swig_globalvar* vars; +} swig_varlinkobject; + +SWIGINTERN PyObject* swig_varlink_repr(swig_varlinkobject* SWIGUNUSEDPARM(v)) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_InternFromString(""); +#else + return PyString_FromString(""); +#endif +} + +SWIGINTERN PyObject* swig_varlink_str(swig_varlinkobject* v) +{ +#if PY_VERSION_HEX >= 0x03000000 + PyObject* str = PyUnicode_InternFromString("("); + PyObject* tail; + PyObject* joined; + swig_globalvar* var; + for (var = v->vars; var; var = var->next) { + tail = PyUnicode_FromString(var->name); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + if (var->next) { + tail = PyUnicode_InternFromString(", "); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + } + } + tail = PyUnicode_InternFromString(")"); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; +#else + PyObject* str = PyString_FromString("("); + swig_globalvar* var; + for (var = v->vars; var; var = var->next) { + PyString_ConcatAndDel(&str, PyString_FromString(var->name)); + if (var->next) + PyString_ConcatAndDel(&str, PyString_FromString(", ")); + } + PyString_ConcatAndDel(&str, PyString_FromString(")")); +#endif + return str; +} + +SWIGINTERN void swig_varlink_dealloc(swig_varlinkobject* v) +{ + swig_globalvar* var = v->vars; + while (var) { + swig_globalvar* n = var->next; + free(var->name); + free(var); + var = n; + } +} + +SWIGINTERN PyObject* swig_varlink_getattr(swig_varlinkobject* v, char* n) +{ + PyObject* res = NULL; + swig_globalvar* var = v->vars; + while (var) { + if (strcmp(var->name, n) == 0) { + res = (*var->get_attr)(); + break; + } + var = var->next; + } + if (res == NULL && ! PyErr_Occurred()) { + PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); + } + return res; +} + +SWIGINTERN int swig_varlink_setattr(swig_varlinkobject* v, char* n, PyObject* p) +{ + int res = 1; + swig_globalvar* var = v->vars; + while (var) { + if (strcmp(var->name, n) == 0) { + res = (*var->set_attr)(p); + break; + } + var = var->next; + } + if (res == 1 && ! PyErr_Occurred()) { + PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); + } + return res; +} + +SWIGINTERN PyTypeObject* swig_varlink_type(void) +{ + static char varlink__doc__[] = "Swig var link object"; + static PyTypeObject varlink_type; + static int type_init = 0; + if (! type_init) { + const PyTypeObject tmp = { +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(NULL, 0) +#else + PyObject_HEAD_INIT(NULL) 0, /* ob_size */ +#endif + "swigvarlink", /* tp_name */ + sizeof(swig_varlinkobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor)swig_varlink_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + (getattrfunc)swig_varlink_getattr, /* tp_getattr */ + (setattrfunc)swig_varlink_setattr, /* tp_setattr */ + 0, /* tp_compare */ + (reprfunc)swig_varlink_repr, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + (reprfunc)swig_varlink_str, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + 0, /* tp_flags */ + varlink__doc__, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, /* tp_iter -> tp_weaklist */ + 0, /* tp_del */ + 0, /* tp_version_tag */ +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ +#endif +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ +#endif +#ifdef COUNT_ALLOCS + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0 /* tp_next */ +#endif + }; + varlink_type = tmp; + type_init = 1; + if (PyType_Ready(&varlink_type) < 0) + return NULL; + } + return &varlink_type; +} + +/* Create a variable linking object for use later */ +SWIGINTERN PyObject* SWIG_Python_newvarlink(void) +{ + swig_varlinkobject* result = PyObject_NEW(swig_varlinkobject, swig_varlink_type()); + if (result) { + result->vars = 0; + } + return ((PyObject*)result); +} + +SWIGINTERN void +SWIG_Python_addvarlink(PyObject* p, const char* name, PyObject* (*get_attr)(void), int (*set_attr)(PyObject* p)) +{ + swig_varlinkobject* v = (swig_varlinkobject*)p; + swig_globalvar* gv = (swig_globalvar*)malloc(sizeof(swig_globalvar)); + if (gv) { + size_t size = strlen(name) + 1; + gv->name = (char*)malloc(size); + if (gv->name) { + memcpy(gv->name, name, size); + gv->get_attr = get_attr; + gv->set_attr = set_attr; + gv->next = v->vars; + } + } + v->vars = gv; +} + +SWIGINTERN PyObject* SWIG_globals(void) +{ + static PyObject* globals = 0; + if (! globals) { + globals = SWIG_newvarlink(); + } + return globals; +} + +/* ----------------------------------------------------------------------------- + * constants/methods manipulation + * ----------------------------------------------------------------------------- */ + +/* Install Constants */ +SWIGINTERN void SWIG_Python_InstallConstants(PyObject* d, swig_const_info constants[]) +{ + PyObject* obj = 0; + size_t i; + for (i = 0; constants[i].type; ++i) { + switch (constants[i].type) { + case SWIG_PY_POINTER: + obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype, 0); + break; + case SWIG_PY_BINARY: + obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); + break; + default: + obj = 0; + break; + } + if (obj) { + PyDict_SetItemString(d, constants[i].name, obj); + Py_DECREF(obj); + } + } +} + +/* -----------------------------------------------------------------------------*/ +/* Fix SwigMethods to carry the callback ptrs when needed */ +/* -----------------------------------------------------------------------------*/ + +SWIGINTERN void SWIG_Python_FixMethods( + PyMethodDef* methods, + swig_const_info* const_table, + swig_type_info** types, + swig_type_info** types_initial) +{ + size_t i; + for (i = 0; methods[i].ml_name; ++i) { + const char* c = methods[i].ml_doc; + if (! c) + continue; + c = strstr(c, "swig_ptr: "); + if (c) { + int j; + swig_const_info* ci = 0; + const char* name = c + 10; + for (j = 0; const_table[j].type; ++j) { + if (strncmp(const_table[j].name, name, strlen(const_table[j].name)) == 0) { + ci = &(const_table[j]); + break; + } + } + if (ci) { + void* ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0; + if (ptr) { + size_t shift = (ci->ptype) - types; + swig_type_info* ty = types_initial[shift]; + size_t ldoc = (c - methods[i].ml_doc); + size_t lptr = strlen(ty->name) + 2 * sizeof(void*) + 2; + char* ndoc = (char*)malloc(ldoc + lptr + 10); + if (ndoc) { + char* buff = ndoc; + memcpy(buff, methods[i].ml_doc, ldoc); + buff += ldoc; + memcpy(buff, "swig_ptr: ", 10); + buff += 10; + SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); + methods[i].ml_doc = ndoc; + } + } + } + } + } +} + +/* ----------------------------------------------------------------------------- + * Method creation and docstring support functions + * ----------------------------------------------------------------------------- */ + +/* ----------------------------------------------------------------------------- + * Function to find the method definition with the correct docstring for the + * proxy module as opposed to the low-level API + * ----------------------------------------------------------------------------- */ + +SWIGINTERN PyMethodDef* SWIG_PythonGetProxyDoc(const char* name) +{ + /* Find the function in the modified method table */ + size_t offset = 0; + int found = 0; + while (SwigMethods_proxydocs[offset].ml_meth != NULL) { + if (strcmp(SwigMethods_proxydocs[offset].ml_name, name) == 0) { + found = 1; + break; + } + offset++; + } + /* Use the copy with the modified docstring if available */ + return found ? &SwigMethods_proxydocs[offset] : NULL; +} + +/* ----------------------------------------------------------------------------- + * Wrapper of PyInstanceMethod_New() used in Python 3 + * It is exported to the generated module, used for -fastproxy + * ----------------------------------------------------------------------------- */ + +SWIGINTERN PyObject* SWIG_PyInstanceMethod_New(PyObject* SWIGUNUSEDPARM(self), PyObject* func) +{ + if (PyCFunction_Check(func)) { + PyCFunctionObject* funcobj = (PyCFunctionObject*)func; + PyMethodDef* ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name); + if (ml) + func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module); + } +#if PY_VERSION_HEX >= 0x03000000 + return PyInstanceMethod_New(func); +#else + return PyMethod_New(func, NULL, NULL); +#endif +} + +/* ----------------------------------------------------------------------------- + * Wrapper of PyStaticMethod_New() + * It is exported to the generated module, used for -fastproxy + * ----------------------------------------------------------------------------- */ + +SWIGINTERN PyObject* SWIG_PyStaticMethod_New(PyObject* SWIGUNUSEDPARM(self), PyObject* func) +{ + if (PyCFunction_Check(func)) { + PyCFunctionObject* funcobj = (PyCFunctionObject*)func; + PyMethodDef* ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name); + if (ml) + func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module); + } + return PyStaticMethod_New(func); +} + +#ifdef __cplusplus +} +#endif + +/* -----------------------------------------------------------------------------* + * Partial Init method + * -----------------------------------------------------------------------------*/ + +#ifdef __cplusplus +extern "C" +#endif + + SWIGEXPORT +#if PY_VERSION_HEX >= 0x03000000 + PyObject* +#else +void +#endif + SWIG_init(void) +{ + PyObject *m, *d, *md, *globals; + +#if PY_VERSION_HEX >= 0x03000000 + static struct PyModuleDef SWIG_module = { + PyModuleDef_HEAD_INIT, SWIG_name, NULL, -1, SwigMethods, NULL, NULL, NULL, NULL + }; +#endif + +#if defined(SWIGPYTHON_BUILTIN) + static SwigPyClientData SwigPyObject_clientdata = { 0, 0, 0, 0, 0, 0, 0 }; + static PyGetSetDef this_getset_def = { (char*)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL }; + static SwigPyGetSet thisown_getset_closure = { SwigPyObject_own, SwigPyObject_own }; + static PyGetSetDef thisown_getset_def = { (char*)"thisown", + SwigPyBuiltin_GetterClosure, + SwigPyBuiltin_SetterClosure, + NULL, + &thisown_getset_closure }; + PyTypeObject* builtin_pytype; + int builtin_base_count; + swig_type_info* builtin_basetype; + PyObject* tuple; + PyGetSetDescrObject* static_getset; + PyTypeObject* metatype; + PyTypeObject* swigpyobject; + SwigPyClientData* cd; + PyObject *public_interface, *public_symbol; + PyObject* this_descr; + PyObject* thisown_descr; + PyObject* self = 0; + int i; + + (void)builtin_pytype; + (void)builtin_base_count; + (void)builtin_basetype; + (void)tuple; + (void)static_getset; + (void)self; + + /* Metaclass is used to implement static member variables */ + metatype = SwigPyObjectType(); + assert(metatype); +#endif + + (void)globals; + + /* Create singletons now to avoid potential deadlocks with multi-threaded usage after module initialization */ + SWIG_This(); + SWIG_Python_TypeCache(); + SwigPyPacked_type(); +#ifndef SWIGPYTHON_BUILTIN + SwigPyObject_type(); +#endif + + /* Fix SwigMethods to carry the callback ptrs when needed */ + SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); + +#if PY_VERSION_HEX >= 0x03000000 + m = PyModule_Create(&SWIG_module); +#else + m = Py_InitModule(SWIG_name, SwigMethods); +#endif + + md = d = PyModule_GetDict(m); + (void)md; + + SWIG_InitializeModule(0); + +#ifdef SWIGPYTHON_BUILTIN + swigpyobject = SwigPyObject_TypeOnce(); + + SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject"); + assert(SwigPyObject_stype); + cd = (SwigPyClientData*)SwigPyObject_stype->clientdata; + if (! cd) { + SwigPyObject_stype->clientdata = &SwigPyObject_clientdata; + SwigPyObject_clientdata.pytype = swigpyobject; + } + else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) { + PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules."); +#if PY_VERSION_HEX >= 0x03000000 + return NULL; +#else + return; +#endif + } + + /* All objects have a 'this' attribute */ + this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def); + (void)this_descr; + + /* All objects have a 'thisown' attribute */ + thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def); + (void)thisown_descr; + + public_interface = PyList_New(0); + public_symbol = 0; + (void)public_symbol; + + PyDict_SetItemString(md, "__all__", public_interface); + Py_DECREF(public_interface); + for (i = 0; SwigMethods[i].ml_name != NULL; ++i) + SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name); + for (i = 0; swig_const_table[i].name != 0; ++i) + SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name); +#endif + + SWIG_InstallConstants(d, swig_const_table); + + SWIG_Python_SetConstant(d, "ZTS_ENABLE_PYTHON", SWIG_From_int(static_cast(1))); + SWIG_Python_SetConstant(d, "ZTS_ERR_OK", SWIG_From_int(static_cast(ZTS_ERR_OK))); + SWIG_Python_SetConstant(d, "ZTS_ERR_SOCKET", SWIG_From_int(static_cast(ZTS_ERR_SOCKET))); + SWIG_Python_SetConstant(d, "ZTS_ERR_SERVICE", SWIG_From_int(static_cast(ZTS_ERR_SERVICE))); + SWIG_Python_SetConstant(d, "ZTS_ERR_ARG", SWIG_From_int(static_cast(ZTS_ERR_ARG))); + SWIG_Python_SetConstant(d, "ZTS_ERR_NO_RESULT", SWIG_From_int(static_cast(ZTS_ERR_NO_RESULT))); + SWIG_Python_SetConstant(d, "ZTS_ERR_GENERAL", SWIG_From_int(static_cast(ZTS_ERR_GENERAL))); + SWIG_Python_SetConstant(d, "ZTS_EVENT_NODE_UP", SWIG_From_int(static_cast(ZTS_EVENT_NODE_UP))); + SWIG_Python_SetConstant(d, "ZTS_EVENT_NODE_ONLINE", SWIG_From_int(static_cast(ZTS_EVENT_NODE_ONLINE))); + SWIG_Python_SetConstant(d, "ZTS_EVENT_NODE_OFFLINE", SWIG_From_int(static_cast(ZTS_EVENT_NODE_OFFLINE))); + SWIG_Python_SetConstant(d, "ZTS_EVENT_NODE_DOWN", SWIG_From_int(static_cast(ZTS_EVENT_NODE_DOWN))); + SWIG_Python_SetConstant( + d, + "ZTS_EVENT_NODE_FATAL_ERROR", + SWIG_From_int(static_cast(ZTS_EVENT_NODE_FATAL_ERROR))); + SWIG_Python_SetConstant( + d, + "ZTS_EVENT_NETWORK_NOT_FOUND", + SWIG_From_int(static_cast(ZTS_EVENT_NETWORK_NOT_FOUND))); + SWIG_Python_SetConstant( + d, + "ZTS_EVENT_NETWORK_CLIENT_TOO_OLD", + SWIG_From_int(static_cast(ZTS_EVENT_NETWORK_CLIENT_TOO_OLD))); + SWIG_Python_SetConstant( + d, + "ZTS_EVENT_NETWORK_REQ_CONFIG", + SWIG_From_int(static_cast(ZTS_EVENT_NETWORK_REQ_CONFIG))); + SWIG_Python_SetConstant(d, "ZTS_EVENT_NETWORK_OK", SWIG_From_int(static_cast(ZTS_EVENT_NETWORK_OK))); + SWIG_Python_SetConstant( + d, + "ZTS_EVENT_NETWORK_ACCESS_DENIED", + SWIG_From_int(static_cast(ZTS_EVENT_NETWORK_ACCESS_DENIED))); + SWIG_Python_SetConstant( + d, + "ZTS_EVENT_NETWORK_READY_IP4", + SWIG_From_int(static_cast(ZTS_EVENT_NETWORK_READY_IP4))); + SWIG_Python_SetConstant( + d, + "ZTS_EVENT_NETWORK_READY_IP6", + SWIG_From_int(static_cast(ZTS_EVENT_NETWORK_READY_IP6))); + SWIG_Python_SetConstant( + d, + "ZTS_EVENT_NETWORK_READY_IP4_IP6", + SWIG_From_int(static_cast(ZTS_EVENT_NETWORK_READY_IP4_IP6))); + SWIG_Python_SetConstant(d, "ZTS_EVENT_NETWORK_DOWN", SWIG_From_int(static_cast(ZTS_EVENT_NETWORK_DOWN))); + SWIG_Python_SetConstant(d, "ZTS_EVENT_NETWORK_UPDATE", SWIG_From_int(static_cast(ZTS_EVENT_NETWORK_UPDATE))); + SWIG_Python_SetConstant(d, "ZTS_EVENT_STACK_UP", SWIG_From_int(static_cast(ZTS_EVENT_STACK_UP))); + SWIG_Python_SetConstant(d, "ZTS_EVENT_STACK_DOWN", SWIG_From_int(static_cast(ZTS_EVENT_STACK_DOWN))); + SWIG_Python_SetConstant(d, "ZTS_EVENT_NETIF_UP", SWIG_From_int(static_cast(ZTS_EVENT_NETIF_UP))); + SWIG_Python_SetConstant(d, "ZTS_EVENT_NETIF_DOWN", SWIG_From_int(static_cast(ZTS_EVENT_NETIF_DOWN))); + SWIG_Python_SetConstant(d, "ZTS_EVENT_NETIF_REMOVED", SWIG_From_int(static_cast(ZTS_EVENT_NETIF_REMOVED))); + SWIG_Python_SetConstant(d, "ZTS_EVENT_NETIF_LINK_UP", SWIG_From_int(static_cast(ZTS_EVENT_NETIF_LINK_UP))); + SWIG_Python_SetConstant(d, "ZTS_EVENT_NETIF_LINK_DOWN", SWIG_From_int(static_cast(ZTS_EVENT_NETIF_LINK_DOWN))); + SWIG_Python_SetConstant(d, "ZTS_EVENT_PEER_DIRECT", SWIG_From_int(static_cast(ZTS_EVENT_PEER_DIRECT))); + SWIG_Python_SetConstant(d, "ZTS_EVENT_PEER_RELAY", SWIG_From_int(static_cast(ZTS_EVENT_PEER_RELAY))); + SWIG_Python_SetConstant( + d, + "ZTS_EVENT_PEER_UNREACHABLE", + SWIG_From_int(static_cast(ZTS_EVENT_PEER_UNREACHABLE))); + SWIG_Python_SetConstant( + d, + "ZTS_EVENT_PEER_PATH_DISCOVERED", + SWIG_From_int(static_cast(ZTS_EVENT_PEER_PATH_DISCOVERED))); + SWIG_Python_SetConstant(d, "ZTS_EVENT_PEER_PATH_DEAD", SWIG_From_int(static_cast(ZTS_EVENT_PEER_PATH_DEAD))); + SWIG_Python_SetConstant(d, "ZTS_EVENT_ROUTE_ADDED", SWIG_From_int(static_cast(ZTS_EVENT_ROUTE_ADDED))); + SWIG_Python_SetConstant(d, "ZTS_EVENT_ROUTE_REMOVED", SWIG_From_int(static_cast(ZTS_EVENT_ROUTE_REMOVED))); + SWIG_Python_SetConstant(d, "ZTS_EVENT_ADDR_ADDED_IP4", SWIG_From_int(static_cast(ZTS_EVENT_ADDR_ADDED_IP4))); + SWIG_Python_SetConstant( + d, + "ZTS_EVENT_ADDR_REMOVED_IP4", + SWIG_From_int(static_cast(ZTS_EVENT_ADDR_REMOVED_IP4))); + SWIG_Python_SetConstant(d, "ZTS_EVENT_ADDR_ADDED_IP6", SWIG_From_int(static_cast(ZTS_EVENT_ADDR_ADDED_IP6))); + SWIG_Python_SetConstant( + d, + "ZTS_EVENT_ADDR_REMOVED_IP6", + SWIG_From_int(static_cast(ZTS_EVENT_ADDR_REMOVED_IP6))); + SWIG_Python_SetConstant( + d, + "ZTS_EVENT_STORE_IDENTITY_SECRET", + SWIG_From_int(static_cast(ZTS_EVENT_STORE_IDENTITY_SECRET))); + SWIG_Python_SetConstant( + d, + "ZTS_EVENT_STORE_IDENTITY_PUBLIC", + SWIG_From_int(static_cast(ZTS_EVENT_STORE_IDENTITY_PUBLIC))); + SWIG_Python_SetConstant(d, "ZTS_EVENT_STORE_PLANET", SWIG_From_int(static_cast(ZTS_EVENT_STORE_PLANET))); + SWIG_Python_SetConstant(d, "ZTS_EVENT_STORE_PEER", SWIG_From_int(static_cast(ZTS_EVENT_STORE_PEER))); + SWIG_Python_SetConstant(d, "ZTS_EVENT_STORE_NETWORK", SWIG_From_int(static_cast(ZTS_EVENT_STORE_NETWORK))); + globals = SWIG_globals(); + if (! globals) { + PyErr_SetString(PyExc_TypeError, "Failure to create SWIG globals."); +#if PY_VERSION_HEX >= 0x03000000 + return NULL; +#else + return; +#endif + } + PyDict_SetItemString(md, "cvar", globals); + Py_DECREF(globals); + SWIG_addvarlink(globals, "zts_errno", Swig_var_zts_errno_get, Swig_var_zts_errno_set); + SWIG_Python_SetConstant(d, "ZTS_EPERM", SWIG_From_int(static_cast(ZTS_EPERM))); + SWIG_Python_SetConstant(d, "ZTS_ENOENT", SWIG_From_int(static_cast(ZTS_ENOENT))); + SWIG_Python_SetConstant(d, "ZTS_ESRCH", SWIG_From_int(static_cast(ZTS_ESRCH))); + SWIG_Python_SetConstant(d, "ZTS_EINTR", SWIG_From_int(static_cast(ZTS_EINTR))); + SWIG_Python_SetConstant(d, "ZTS_EIO", SWIG_From_int(static_cast(ZTS_EIO))); + SWIG_Python_SetConstant(d, "ZTS_ENXIO", SWIG_From_int(static_cast(ZTS_ENXIO))); + SWIG_Python_SetConstant(d, "ZTS_EBADF", SWIG_From_int(static_cast(ZTS_EBADF))); + SWIG_Python_SetConstant(d, "ZTS_EAGAIN", SWIG_From_int(static_cast(ZTS_EAGAIN))); + SWIG_Python_SetConstant(d, "ZTS_EWOULDBLOCK", SWIG_From_int(static_cast(ZTS_EWOULDBLOCK))); + SWIG_Python_SetConstant(d, "ZTS_ENOMEM", SWIG_From_int(static_cast(ZTS_ENOMEM))); + SWIG_Python_SetConstant(d, "ZTS_EACCES", SWIG_From_int(static_cast(ZTS_EACCES))); + SWIG_Python_SetConstant(d, "ZTS_EFAULT", SWIG_From_int(static_cast(ZTS_EFAULT))); + SWIG_Python_SetConstant(d, "ZTS_EBUSY", SWIG_From_int(static_cast(ZTS_EBUSY))); + SWIG_Python_SetConstant(d, "ZTS_EEXIST", SWIG_From_int(static_cast(ZTS_EEXIST))); + SWIG_Python_SetConstant(d, "ZTS_ENODEV", SWIG_From_int(static_cast(ZTS_ENODEV))); + SWIG_Python_SetConstant(d, "ZTS_EINVAL", SWIG_From_int(static_cast(ZTS_EINVAL))); + SWIG_Python_SetConstant(d, "ZTS_ENFILE", SWIG_From_int(static_cast(ZTS_ENFILE))); + SWIG_Python_SetConstant(d, "ZTS_EMFILE", SWIG_From_int(static_cast(ZTS_EMFILE))); + SWIG_Python_SetConstant(d, "ZTS_ENOSYS", SWIG_From_int(static_cast(ZTS_ENOSYS))); + SWIG_Python_SetConstant(d, "ZTS_ENOTSOCK", SWIG_From_int(static_cast(ZTS_ENOTSOCK))); + SWIG_Python_SetConstant(d, "ZTS_EDESTADDRREQ", SWIG_From_int(static_cast(ZTS_EDESTADDRREQ))); + SWIG_Python_SetConstant(d, "ZTS_EMSGSIZE", SWIG_From_int(static_cast(ZTS_EMSGSIZE))); + SWIG_Python_SetConstant(d, "ZTS_EPROTOTYPE", SWIG_From_int(static_cast(ZTS_EPROTOTYPE))); + SWIG_Python_SetConstant(d, "ZTS_ENOPROTOOPT", SWIG_From_int(static_cast(ZTS_ENOPROTOOPT))); + SWIG_Python_SetConstant(d, "ZTS_EPROTONOSUPPORT", SWIG_From_int(static_cast(ZTS_EPROTONOSUPPORT))); + SWIG_Python_SetConstant(d, "ZTS_ESOCKTNOSUPPORT", SWIG_From_int(static_cast(ZTS_ESOCKTNOSUPPORT))); + SWIG_Python_SetConstant(d, "ZTS_EOPNOTSUPP", SWIG_From_int(static_cast(ZTS_EOPNOTSUPP))); + SWIG_Python_SetConstant(d, "ZTS_EPFNOSUPPORT", SWIG_From_int(static_cast(ZTS_EPFNOSUPPORT))); + SWIG_Python_SetConstant(d, "ZTS_EAFNOSUPPORT", SWIG_From_int(static_cast(ZTS_EAFNOSUPPORT))); + SWIG_Python_SetConstant(d, "ZTS_EADDRINUSE", SWIG_From_int(static_cast(ZTS_EADDRINUSE))); + SWIG_Python_SetConstant(d, "ZTS_EADDRNOTAVAIL", SWIG_From_int(static_cast(ZTS_EADDRNOTAVAIL))); + SWIG_Python_SetConstant(d, "ZTS_ENETDOWN", SWIG_From_int(static_cast(ZTS_ENETDOWN))); + SWIG_Python_SetConstant(d, "ZTS_ENETUNREACH", SWIG_From_int(static_cast(ZTS_ENETUNREACH))); + SWIG_Python_SetConstant(d, "ZTS_ECONNABORTED", SWIG_From_int(static_cast(ZTS_ECONNABORTED))); + SWIG_Python_SetConstant(d, "ZTS_ECONNRESET", SWIG_From_int(static_cast(ZTS_ECONNRESET))); + SWIG_Python_SetConstant(d, "ZTS_ENOBUFS", SWIG_From_int(static_cast(ZTS_ENOBUFS))); + SWIG_Python_SetConstant(d, "ZTS_EISCONN", SWIG_From_int(static_cast(ZTS_EISCONN))); + SWIG_Python_SetConstant(d, "ZTS_ENOTCONN", SWIG_From_int(static_cast(ZTS_ENOTCONN))); + SWIG_Python_SetConstant(d, "ZTS_ETIMEDOUT", SWIG_From_int(static_cast(ZTS_ETIMEDOUT))); + SWIG_Python_SetConstant(d, "ZTS_EHOSTUNREACH", SWIG_From_int(static_cast(ZTS_EHOSTUNREACH))); + SWIG_Python_SetConstant(d, "ZTS_EALREADY", SWIG_From_int(static_cast(ZTS_EALREADY))); + SWIG_Python_SetConstant(d, "ZTS_EINPROGRESS", SWIG_From_int(static_cast(ZTS_EINPROGRESS))); + SWIG_Python_SetConstant(d, "ZTS_MAC_ADDRSTRLEN", SWIG_From_int(static_cast(18))); + SWIG_Python_SetConstant(d, "ZTS_INET_ADDRSTRLEN", SWIG_From_int(static_cast(16))); + SWIG_Python_SetConstant(d, "ZTS_INET6_ADDRSTRLEN", SWIG_From_int(static_cast(46))); + SWIG_Python_SetConstant(d, "ZTS_IP_MAX_STR_LEN", SWIG_From_int(static_cast(46))); + SWIG_Python_SetConstant(d, "ZTS_STORE_DATA_LEN", SWIG_From_int(static_cast(4096))); + SWIG_Python_SetConstant(d, "ZTS_MAX_NETWORK_SHORT_NAME_LENGTH", SWIG_From_int(static_cast(127))); + SWIG_Python_SetConstant(d, "ZTS_MAX_NETWORK_ROUTES", SWIG_From_int(static_cast(32))); + SWIG_Python_SetConstant(d, "ZTS_MAX_ASSIGNED_ADDRESSES", SWIG_From_int(static_cast(16))); + SWIG_Python_SetConstant(d, "ZTS_MAX_PEER_NETWORK_PATHS", SWIG_From_int(static_cast(16))); + SWIG_Python_SetConstant(d, "ZTS_MAX_MULTICAST_SUBSCRIPTIONS", SWIG_From_int(static_cast(1024))); + SWIG_Python_SetConstant(d, "ZTS_MAX_ENDPOINT_STR_LEN", SWIG_From_int(static_cast(46 + 6))); + SWIG_Python_SetConstant(d, "ZTS_SOCK_STREAM", SWIG_From_int(static_cast(0x0001))); + SWIG_Python_SetConstant(d, "ZTS_SOCK_DGRAM", SWIG_From_int(static_cast(0x0002))); + SWIG_Python_SetConstant(d, "ZTS_SOCK_RAW", SWIG_From_int(static_cast(0x0003))); + SWIG_Python_SetConstant(d, "ZTS_AF_UNSPEC", SWIG_From_int(static_cast(0x0000))); + SWIG_Python_SetConstant(d, "ZTS_AF_INET", SWIG_From_int(static_cast(0x0002))); + SWIG_Python_SetConstant(d, "ZTS_AF_INET6", SWIG_From_int(static_cast(0x000a))); + SWIG_Python_SetConstant(d, "ZTS_PF_INET", SWIG_From_int(static_cast(0x0002))); + SWIG_Python_SetConstant(d, "ZTS_PF_INET6", SWIG_From_int(static_cast(0x000a))); + SWIG_Python_SetConstant(d, "ZTS_PF_UNSPEC", SWIG_From_int(static_cast(0x0000))); + SWIG_Python_SetConstant(d, "ZTS_IPPROTO_IP", SWIG_From_int(static_cast(0x0000))); + SWIG_Python_SetConstant(d, "ZTS_IPPROTO_ICMP", SWIG_From_int(static_cast(0x0001))); + SWIG_Python_SetConstant(d, "ZTS_IPPROTO_TCP", SWIG_From_int(static_cast(0x0006))); + SWIG_Python_SetConstant(d, "ZTS_IPPROTO_UDP", SWIG_From_int(static_cast(0x0011))); + SWIG_Python_SetConstant(d, "ZTS_IPPROTO_IPV6", SWIG_From_int(static_cast(0x0029))); + SWIG_Python_SetConstant(d, "ZTS_IPPROTO_ICMPV6", SWIG_From_int(static_cast(0x003a))); + SWIG_Python_SetConstant(d, "ZTS_IPPROTO_UDPLITE", SWIG_From_int(static_cast(0x0088))); + SWIG_Python_SetConstant(d, "ZTS_IPPROTO_RAW", SWIG_From_int(static_cast(0x00ff))); + SWIG_Python_SetConstant(d, "ZTS_MSG_PEEK", SWIG_From_int(static_cast(0x0001))); + SWIG_Python_SetConstant(d, "ZTS_MSG_WAITALL", SWIG_From_int(static_cast(0x0002))); + SWIG_Python_SetConstant(d, "ZTS_MSG_OOB", SWIG_From_int(static_cast(0x0004))); + SWIG_Python_SetConstant(d, "ZTS_MSG_DONTWAIT", SWIG_From_int(static_cast(0x0008))); + SWIG_Python_SetConstant(d, "ZTS_MSG_MORE", SWIG_From_int(static_cast(0x0010))); + SWIG_Python_SetConstant(d, "ZTS_IOCPARM_MASK", SWIG_From_unsigned_SS_int(static_cast(0x7fU))); + SWIG_Python_SetConstant(d, "ZTS_IOC_VOID", SWIG_From_unsigned_SS_long(static_cast(0x20000000UL))); + SWIG_Python_SetConstant(d, "ZTS_IOC_OUT", SWIG_From_unsigned_SS_long(static_cast(0x40000000UL))); + SWIG_Python_SetConstant(d, "ZTS_IOC_IN", SWIG_From_unsigned_SS_long(static_cast(0x80000000UL))); + SWIG_Python_SetConstant( + d, + "ZTS_IOC_INOUT", + SWIG_From_unsigned_SS_long(static_cast((0x80000000UL | 0x40000000UL)))); + SWIG_Python_SetConstant( + d, + "ZTS_NETWORK_STATUS_REQUESTING_CONFIGURATION", + SWIG_From_int(static_cast(ZTS_NETWORK_STATUS_REQUESTING_CONFIGURATION))); + SWIG_Python_SetConstant(d, "ZTS_NETWORK_STATUS_OK", SWIG_From_int(static_cast(ZTS_NETWORK_STATUS_OK))); + SWIG_Python_SetConstant( + d, + "ZTS_NETWORK_STATUS_ACCESS_DENIED", + SWIG_From_int(static_cast(ZTS_NETWORK_STATUS_ACCESS_DENIED))); + SWIG_Python_SetConstant( + d, + "ZTS_NETWORK_STATUS_NOT_FOUND", + SWIG_From_int(static_cast(ZTS_NETWORK_STATUS_NOT_FOUND))); + SWIG_Python_SetConstant( + d, + "ZTS_NETWORK_STATUS_PORT_ERROR", + SWIG_From_int(static_cast(ZTS_NETWORK_STATUS_PORT_ERROR))); + SWIG_Python_SetConstant( + d, + "ZTS_NETWORK_STATUS_CLIENT_TOO_OLD", + SWIG_From_int(static_cast(ZTS_NETWORK_STATUS_CLIENT_TOO_OLD))); + SWIG_Python_SetConstant(d, "ZTS_NETWORK_TYPE_PRIVATE", SWIG_From_int(static_cast(ZTS_NETWORK_TYPE_PRIVATE))); + SWIG_Python_SetConstant(d, "ZTS_NETWORK_TYPE_PUBLIC", SWIG_From_int(static_cast(ZTS_NETWORK_TYPE_PUBLIC))); + SWIG_Python_SetConstant(d, "ZTS_PEER_ROLE_LEAF", SWIG_From_int(static_cast(ZTS_PEER_ROLE_LEAF))); + SWIG_Python_SetConstant(d, "ZTS_PEER_ROLE_MOON", SWIG_From_int(static_cast(ZTS_PEER_ROLE_MOON))); + SWIG_Python_SetConstant(d, "ZTS_PEER_ROLE_PLANET", SWIG_From_int(static_cast(ZTS_PEER_ROLE_PLANET))); + SWIG_Python_SetConstant(d, "ZTS_MAX_NUM_ROOTS", SWIG_From_int(static_cast(16))); + SWIG_Python_SetConstant(d, "ZTS_MAX_ENDPOINTS_PER_ROOT", SWIG_From_int(static_cast(32))); + SWIG_addvarlink(globals, "_userEventCallback", Swig_var__userEventCallback_get, Swig_var__userEventCallback_set); + SWIG_Python_SetConstant(d, "ZTS_DISABLE_CENTRAL_API", SWIG_From_int(static_cast(1))); + SWIG_Python_SetConstant(d, "ZTS_ID_STR_BUF_LEN", SWIG_From_int(static_cast(384))); + SWIG_Python_SetConstant(d, "ZTS_SOL_SOCKET", SWIG_From_int(static_cast(0x0fff))); + SWIG_Python_SetConstant(d, "ZTS_SO_DEBUG", SWIG_From_int(static_cast(0x0001))); + SWIG_Python_SetConstant(d, "ZTS_SO_ACCEPTCONN", SWIG_From_int(static_cast(0x0002))); + SWIG_Python_SetConstant(d, "ZTS_SO_REUSEADDR", SWIG_From_int(static_cast(0x0004))); + SWIG_Python_SetConstant(d, "ZTS_SO_KEEPALIVE", SWIG_From_int(static_cast(0x0008))); + SWIG_Python_SetConstant(d, "ZTS_SO_DONTROUTE", SWIG_From_int(static_cast(0x0010))); + SWIG_Python_SetConstant(d, "ZTS_SO_BROADCAST", SWIG_From_int(static_cast(0x0020))); + SWIG_Python_SetConstant(d, "ZTS_SO_USELOOPBACK", SWIG_From_int(static_cast(0x0040))); + SWIG_Python_SetConstant(d, "ZTS_SO_LINGER", SWIG_From_int(static_cast(0x0080))); + SWIG_Python_SetConstant(d, "ZTS_SO_OOBINLINE", SWIG_From_int(static_cast(0x0100))); + SWIG_Python_SetConstant(d, "ZTS_SO_REUSEPORT", SWIG_From_int(static_cast(0x0200))); + SWIG_Python_SetConstant(d, "ZTS_SO_SNDBUF", SWIG_From_int(static_cast(0x1001))); + SWIG_Python_SetConstant(d, "ZTS_SO_RCVBUF", SWIG_From_int(static_cast(0x1002))); + SWIG_Python_SetConstant(d, "ZTS_SO_SNDLOWAT", SWIG_From_int(static_cast(0x1003))); + SWIG_Python_SetConstant(d, "ZTS_SO_RCVLOWAT", SWIG_From_int(static_cast(0x1004))); + SWIG_Python_SetConstant(d, "ZTS_SO_SNDTIMEO", SWIG_From_int(static_cast(0x1005))); + SWIG_Python_SetConstant(d, "ZTS_SO_RCVTIMEO", SWIG_From_int(static_cast(0x1006))); + SWIG_Python_SetConstant(d, "ZTS_SO_ERROR", SWIG_From_int(static_cast(0x1007))); + SWIG_Python_SetConstant(d, "ZTS_SO_TYPE", SWIG_From_int(static_cast(0x1008))); + SWIG_Python_SetConstant(d, "ZTS_SO_CONTIMEO", SWIG_From_int(static_cast(0x1009))); + SWIG_Python_SetConstant(d, "ZTS_SO_NO_CHECK", SWIG_From_int(static_cast(0x100a))); + SWIG_Python_SetConstant(d, "ZTS_SO_BINDTODEVICE", SWIG_From_int(static_cast(0x100b))); + SWIG_Python_SetConstant(d, "ZTS_IP_TOS", SWIG_From_int(static_cast(0x0001))); + SWIG_Python_SetConstant(d, "ZTS_IP_TTL", SWIG_From_int(static_cast(0x0002))); + SWIG_Python_SetConstant(d, "ZTS_IP_PKTINFO", SWIG_From_int(static_cast(0x0008))); + SWIG_Python_SetConstant(d, "ZTS_TCP_NODELAY", SWIG_From_int(static_cast(0x0001))); + SWIG_Python_SetConstant(d, "ZTS_TCP_KEEPALIVE", SWIG_From_int(static_cast(0x0002))); + SWIG_Python_SetConstant(d, "ZTS_TCP_KEEPIDLE", SWIG_From_int(static_cast(0x0003))); + SWIG_Python_SetConstant(d, "ZTS_TCP_KEEPINTVL", SWIG_From_int(static_cast(0x0004))); + SWIG_Python_SetConstant(d, "ZTS_TCP_KEEPCNT", SWIG_From_int(static_cast(0x0005))); + SWIG_Python_SetConstant(d, "ZTS_IPV6_CHECKSUM", SWIG_From_int(static_cast(0x0007))); + SWIG_Python_SetConstant(d, "ZTS_IPV6_V6ONLY", SWIG_From_int(static_cast(0x001b))); + SWIG_Python_SetConstant(d, "ZTS_UDPLITE_SEND_CSCOV", SWIG_From_int(static_cast(0x01))); + SWIG_Python_SetConstant(d, "ZTS_UDPLITE_RECV_CSCOV", SWIG_From_int(static_cast(0x02))); + SWIG_Python_SetConstant(d, "ZTS_IP_MULTICAST_TTL", SWIG_From_int(static_cast(5))); + SWIG_Python_SetConstant(d, "ZTS_IP_MULTICAST_IF", SWIG_From_int(static_cast(6))); + SWIG_Python_SetConstant(d, "ZTS_IP_MULTICAST_LOOP", SWIG_From_int(static_cast(7))); + SWIG_Python_SetConstant(d, "ZTS_IP_ADD_MEMBERSHIP", SWIG_From_int(static_cast(3))); + SWIG_Python_SetConstant(d, "ZTS_IP_DROP_MEMBERSHIP", SWIG_From_int(static_cast(4))); + SWIG_Python_SetConstant(d, "ZTS_IPV6_JOIN_GROUP", SWIG_From_int(static_cast(12))); + SWIG_Python_SetConstant(d, "ZTS_IPV6_ADD_MEMBERSHIP", SWIG_From_int(static_cast(12))); + SWIG_Python_SetConstant(d, "ZTS_IPV6_LEAVE_GROUP", SWIG_From_int(static_cast(13))); + SWIG_Python_SetConstant(d, "ZTS_IPV6_DROP_MEMBERSHIP", SWIG_From_int(static_cast(13))); + SWIG_Python_SetConstant(d, "ZTS_IPTOS_TOS_MASK", SWIG_From_int(static_cast(0x1E))); + SWIG_Python_SetConstant(d, "ZTS_IPTOS_LOWDELAY", SWIG_From_int(static_cast(0x10))); + SWIG_Python_SetConstant(d, "ZTS_IPTOS_THROUGHPUT", SWIG_From_int(static_cast(0x08))); + SWIG_Python_SetConstant(d, "ZTS_IPTOS_RELIABILITY", SWIG_From_int(static_cast(0x04))); + SWIG_Python_SetConstant(d, "ZTS_IPTOS_LOWCOST", SWIG_From_int(static_cast(0x02))); + SWIG_Python_SetConstant(d, "ZTS_IPTOS_MINCOST", SWIG_From_int(static_cast(0x02))); + SWIG_Python_SetConstant(d, "ZTS_IPTOS_PREC_MASK", SWIG_From_int(static_cast(0xe0))); + SWIG_Python_SetConstant(d, "ZTS_IPTOS_PREC_NETCONTROL", SWIG_From_int(static_cast(0xe0))); + SWIG_Python_SetConstant(d, "ZTS_IPTOS_PREC_INTERNETCONTROL", SWIG_From_int(static_cast(0xc0))); + SWIG_Python_SetConstant(d, "ZTS_IPTOS_PREC_CRITIC_ECP", SWIG_From_int(static_cast(0xa0))); + SWIG_Python_SetConstant(d, "ZTS_IPTOS_PREC_FLASHOVERRIDE", SWIG_From_int(static_cast(0x80))); + SWIG_Python_SetConstant(d, "ZTS_IPTOS_PREC_FLASH", SWIG_From_int(static_cast(0x60))); + SWIG_Python_SetConstant(d, "ZTS_IPTOS_PREC_IMMEDIATE", SWIG_From_int(static_cast(0x40))); + SWIG_Python_SetConstant(d, "ZTS_IPTOS_PREC_PRIORITY", SWIG_From_int(static_cast(0x20))); + SWIG_Python_SetConstant(d, "ZTS_IPTOS_PREC_ROUTINE", SWIG_From_int(static_cast(0x00))); + SWIG_Python_SetConstant(d, "LWIP_SOCKET_OFFSET", SWIG_From_int(static_cast(0))); + SWIG_Python_SetConstant(d, "MEMP_NUM_NETCONN", SWIG_From_int(static_cast(1024))); + SWIG_Python_SetConstant(d, "ZTS_FD_SETSIZE", SWIG_From_int(static_cast(1024))); + SWIG_Python_SetConstant(d, "ZTS_F_GETFL", SWIG_From_int(static_cast(0x0003))); + SWIG_Python_SetConstant(d, "ZTS_F_SETFL", SWIG_From_int(static_cast(0x0004))); + SWIG_Python_SetConstant(d, "ZTS_O_NONBLOCK", SWIG_From_int(static_cast(1))); + SWIG_Python_SetConstant(d, "ZTS_O_NDELAY", SWIG_From_int(static_cast(1))); + SWIG_Python_SetConstant(d, "ZTS_O_RDONLY", SWIG_From_int(static_cast(2))); + SWIG_Python_SetConstant(d, "ZTS_O_WRONLY", SWIG_From_int(static_cast(4))); + SWIG_Python_SetConstant(d, "ZTS_O_RDWR", SWIG_From_int(static_cast((2 | 4)))); + SWIG_Python_SetConstant(d, "ZTS_POLLIN", SWIG_From_int(static_cast(0x001))); + SWIG_Python_SetConstant(d, "ZTS_POLLOUT", SWIG_From_int(static_cast(0x002))); + SWIG_Python_SetConstant(d, "ZTS_POLLERR", SWIG_From_int(static_cast(0x004))); + SWIG_Python_SetConstant(d, "ZTS_POLLNVAL", SWIG_From_int(static_cast(0x008))); + SWIG_Python_SetConstant(d, "ZTS_POLLRDNORM", SWIG_From_int(static_cast(0x010))); + SWIG_Python_SetConstant(d, "ZTS_POLLRDBAND", SWIG_From_int(static_cast(0x020))); + SWIG_Python_SetConstant(d, "ZTS_POLLPRI", SWIG_From_int(static_cast(0x040))); + SWIG_Python_SetConstant(d, "ZTS_POLLWRNORM", SWIG_From_int(static_cast(0x080))); + SWIG_Python_SetConstant(d, "ZTS_POLLWRBAND", SWIG_From_int(static_cast(0x100))); + SWIG_Python_SetConstant(d, "ZTS_POLLHUP", SWIG_From_int(static_cast(0x200))); + SWIG_Python_SetConstant(d, "ZTS_MSG_TRUNC", SWIG_From_int(static_cast(0x04))); + SWIG_Python_SetConstant(d, "ZTS_MSG_CTRUNC", SWIG_From_int(static_cast(0x08))); + SWIG_Python_SetConstant(d, "ZTS_SHUT_RD", SWIG_From_int(static_cast(0x0))); + SWIG_Python_SetConstant(d, "ZTS_SHUT_WR", SWIG_From_int(static_cast(0x1))); + SWIG_Python_SetConstant(d, "ZTS_SHUT_RDWR", SWIG_From_int(static_cast(0x2))); +#if PY_VERSION_HEX >= 0x03000000 + return m; +#else + return; +#endif +} diff --git a/src/bindings/python/zt_wrap.h b/src/bindings/python/zt_wrap.h new file mode 100644 index 0000000..dc5ed95 --- /dev/null +++ b/src/bindings/python/zt_wrap.h @@ -0,0 +1,63 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 4.0.2 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + +#ifndef SWIG_libzt_WRAP_H_ +#define SWIG_libzt_WRAP_H_ + +#include +#include + +class SwigDirector_PythonDirectorCallbackClass + : public PythonDirectorCallbackClass + , public Swig::Director { + public: + SwigDirector_PythonDirectorCallbackClass(PyObject* self); + virtual void on_zerotier_event(zts_event_msg_t* msg); + virtual ~SwigDirector_PythonDirectorCallbackClass(); + + /* Internal director utilities */ + public: + bool swig_get_inner(const char* swig_protected_method_name) const + { + std::map::const_iterator iv = swig_inner.find(swig_protected_method_name); + return (iv != swig_inner.end() ? iv->second : false); + } + void swig_set_inner(const char* swig_protected_method_name, bool swig_val) const + { + swig_inner[swig_protected_method_name] = swig_val; + } + + private: + mutable std::map swig_inner; + +#if defined(SWIG_PYTHON_DIRECTOR_VTABLE) + /* VTable implementation */ + PyObject* swig_get_method(size_t method_index, const char* method_name) const + { + PyObject* method = vtable[method_index]; + if (! method) { + swig::SwigVar_PyObject name = SWIG_Python_str_FromChar(method_name); + method = PyObject_GetAttr(swig_get_self(), name); + if (! method) { + std::string msg = "Method in class PythonDirectorCallbackClass doesn't exist, undefined "; + msg += method_name; + Swig::DirectorMethodException::raise(msg.c_str()); + } + vtable[method_index] = method; + } + return method; + } + + private: + mutable swig::SwigVar_PyObject vtable[1]; +#endif +}; + +#endif