Expose lwIP's DNS API in zts_* API. Fix preprocessor build bug
This commit is contained in:
@@ -161,7 +161,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Android")
|
|||||||
set(BUILD_ANDROID TRUE)
|
set(BUILD_ANDROID TRUE)
|
||||||
set(BUILD_STATIC_LIB FALSE)
|
set(BUILD_STATIC_LIB FALSE)
|
||||||
set(BUILD_SHARED_LIB TRUE)
|
set(BUILD_SHARED_LIB TRUE)
|
||||||
set(BUILD_SELFTEST FALSE)
|
set(BUILD_HOST_SELFTEST FALSE)
|
||||||
set(BUILD_EXAMPLES FALSE)
|
set(BUILD_EXAMPLES FALSE)
|
||||||
set(ALLOW_INSTALL_TARGET FALSE)
|
set(ALLOW_INSTALL_TARGET FALSE)
|
||||||
endif()
|
endif()
|
||||||
@@ -169,9 +169,10 @@ endif()
|
|||||||
if(BUILD_MACOS_FRAMEWORK)
|
if(BUILD_MACOS_FRAMEWORK)
|
||||||
set(BUILD_STATIC_LIB TRUE)
|
set(BUILD_STATIC_LIB TRUE)
|
||||||
set(BUILD_SHARED_LIB TRUE)
|
set(BUILD_SHARED_LIB TRUE)
|
||||||
set(BUILD_SELFTEST FALSE)
|
set(BUILD_HOST_SELFTEST FALSE)
|
||||||
set(BUILD_EXAMPLES FALSE)
|
set(BUILD_EXAMPLES FALSE)
|
||||||
set(ALLOW_INSTALL_TARGET FALSE)
|
set(ALLOW_INSTALL_TARGET FALSE)
|
||||||
|
set(ZTS_ENABLE_CENTRAL_API FALSE)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOMIT_JSON_SUPPORT=1")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOMIT_JSON_SUPPORT=1")
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DOMIT_JSON_SUPPORT=1")
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DOMIT_JSON_SUPPORT=1")
|
||||||
set(CMAKE_XCODE_ATTRIBUTE_ARCHS "$(ARCHS_STANDARD)")
|
set(CMAKE_XCODE_ATTRIBUTE_ARCHS "$(ARCHS_STANDARD)")
|
||||||
@@ -183,9 +184,10 @@ endif()
|
|||||||
if(BUILD_IOS_FRAMEWORK)
|
if(BUILD_IOS_FRAMEWORK)
|
||||||
set(BUILD_STATIC_LIB TRUE)
|
set(BUILD_STATIC_LIB TRUE)
|
||||||
set(BUILD_SHARED_LIB TRUE)
|
set(BUILD_SHARED_LIB TRUE)
|
||||||
set(BUILD_SELFTEST FALSE)
|
set(BUILD_HOST_SELFTEST FALSE)
|
||||||
set(BUILD_EXAMPLES FALSE)
|
set(BUILD_EXAMPLES FALSE)
|
||||||
set(ALLOW_INSTALL_TARGET FALSE)
|
set(ALLOW_INSTALL_TARGET FALSE)
|
||||||
|
set(ZTS_ENABLE_CENTRAL_API FALSE)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOMIT_JSON_SUPPORT=1")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOMIT_JSON_SUPPORT=1")
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DOMIT_JSON_SUPPORT=1")
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DOMIT_JSON_SUPPORT=1")
|
||||||
set(DEVROOT
|
set(DEVROOT
|
||||||
|
|||||||
@@ -24,15 +24,6 @@
|
|||||||
// Configuration Options //
|
// Configuration Options //
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef ZTS_ENABLE_PYTHON
|
|
||||||
/**
|
|
||||||
* In some situations (Python comes to mind) a signal may not make its
|
|
||||||
* way to libzt, for this reason we make sure to define a custom signal
|
|
||||||
* handler that can at least process SIGTERMs
|
|
||||||
*/
|
|
||||||
#define ZTS_ENABLE_CUSTOM_SIGNAL_HANDLERS 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(ZTS_ENABLE_PYTHON) && !defined(ZTS_ENABLE_PINVOKE)
|
#if !defined(ZTS_ENABLE_PYTHON) && !defined(ZTS_ENABLE_PINVOKE)
|
||||||
#define ZTS_C_API_ONLY 1
|
#define ZTS_C_API_ONLY 1
|
||||||
#endif
|
#endif
|
||||||
@@ -1914,21 +1905,100 @@ ZTS_API ssize_t ZTCALL zts_writev(int fd, const struct zts_iovec *iov, int iovcn
|
|||||||
*/
|
*/
|
||||||
ZTS_API int ZTCALL zts_shutdown(int fd, int how);
|
ZTS_API int ZTCALL zts_shutdown(int fd, int how);
|
||||||
|
|
||||||
/**
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
* @brief Add a DNS nameserver for the network stack to use
|
// DNS //
|
||||||
*
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
* @param addr Address for DNS nameserver
|
|
||||||
* @return ZTS_ERR_SERVICE
|
struct zts_hostent {
|
||||||
*/
|
char *h_name; /* Official name of the host. */
|
||||||
ZTS_API int ZTCALL zts_add_dns_nameserver(struct zts_sockaddr *addr);
|
char **h_aliases; /* A pointer to an array of pointers to alternative host names,
|
||||||
|
terminated by a null pointer. */
|
||||||
|
int h_addrtype; /* Address type. */
|
||||||
|
int h_length; /* The length, in bytes, of the address. */
|
||||||
|
char **h_addr_list; /* A pointer to an array of pointers to network addresses (in
|
||||||
|
network byte order) for the host, terminated by a null pointer. */
|
||||||
|
#define h_addr h_addr_list[0] /* for backward compatibility */
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Remove a DNS nameserver
|
* @brief Resolve a hostname
|
||||||
*
|
*
|
||||||
* @param addr Address for DNS nameserver
|
* @param name A null-terminated string representating the name of the host
|
||||||
* @return ZTS_ERR_SERVICE
|
* @return Pointer to struct zts_hostent if successful, NULL otherwise
|
||||||
*/
|
*/
|
||||||
ZTS_API int ZTCALL zts_del_dns_nameserver(struct zts_sockaddr *addr);
|
struct zts_hostent *zts_gethostbyname(const char *name);
|
||||||
|
|
||||||
|
enum zts_ip_addr_type {
|
||||||
|
ZTS_IPADDR_TYPE_V4 = 0U,
|
||||||
|
ZTS_IPADDR_TYPE_V6 = 6U,
|
||||||
|
ZTS_IPADDR_TYPE_ANY = 46U // Dual stack
|
||||||
|
};
|
||||||
|
|
||||||
|
struct zts_ip4_addr {
|
||||||
|
uint32_t addr;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** This is the aligned version of ip6_addr_t,
|
||||||
|
used as local variable, on the stack, etc. */
|
||||||
|
struct zts_ip6_addr {
|
||||||
|
uint32_t addr[4];
|
||||||
|
#if LWIP_IPV6_SCOPES
|
||||||
|
uint8_t zone;
|
||||||
|
#endif /* LWIP_IPV6_SCOPES */
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A union struct for both IP version's addresses.
|
||||||
|
* ATTENTION: watch out for its size when adding IPv6 address scope!
|
||||||
|
*/
|
||||||
|
typedef struct zts_ip_addr {
|
||||||
|
union {
|
||||||
|
zts_ip6_addr ip6;
|
||||||
|
zts_ip4_addr ip4;
|
||||||
|
} u_addr;
|
||||||
|
uint8_t type; // ZTS_IPADDR_TYPE_V4, ZTS_IPADDR_TYPE_V6
|
||||||
|
} zts_ip_addr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize one of the DNS servers.
|
||||||
|
*
|
||||||
|
* @param index the index of the DNS server to set must be < DNS_MAX_SERVERS
|
||||||
|
* @param addr IP address of the DNS server to set
|
||||||
|
*/
|
||||||
|
ZTS_API int ZTCALL zts_dns_set_server(uint8_t index, const zts_ip_addr *addr);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain one of the currently configured DNS server.
|
||||||
|
*
|
||||||
|
* @param index the index of the DNS server
|
||||||
|
* @return IP address of the indexed DNS server or "ip_addr_any" if the DNS
|
||||||
|
* server has not been configured.
|
||||||
|
*/
|
||||||
|
ZTS_API const zts_ip_addr * ZTCALL zts_dns_get_server(uint8_t index);
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Convenience functions pulled from lwIP //
|
||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert numeric IP address (both versions) into ASCII representation.
|
||||||
|
* returns ptr to static buffer; not reentrant!
|
||||||
|
*
|
||||||
|
* @param addr ip address in network order to convert
|
||||||
|
* @return pointer to a global static (!) buffer that holds the ASCII
|
||||||
|
* representation of addr
|
||||||
|
*/
|
||||||
|
char *zts_ipaddr_ntoa(const zts_ip_addr *addr);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert IP address string (both versions) to numeric.
|
||||||
|
* The version is auto-detected from the string.
|
||||||
|
*
|
||||||
|
* @param cp IP address string to convert
|
||||||
|
* @param addr conversion result is stored here
|
||||||
|
* @return 1 on success, 0 on error
|
||||||
|
*/
|
||||||
|
int zts_ipaddr_aton(const char *cp, zts_ip_addr *addr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert IPv4 and IPv6 address structures to human-readable text form.
|
* Convert IPv4 and IPv6 address structures to human-readable text form.
|
||||||
@@ -1939,7 +2009,8 @@ ZTS_API int ZTCALL zts_del_dns_nameserver(struct zts_sockaddr *addr);
|
|||||||
* @param size Size of the destination buffer
|
* @param size Size of the destination buffer
|
||||||
* @return On success, returns a non-null pointer to the destination character array
|
* @return On success, returns a non-null pointer to the destination character array
|
||||||
*/
|
*/
|
||||||
ZTS_API const char * ZTCALL zts_inet_ntop(int af, const void *src, char *dst, zts_socklen_t size);
|
ZTS_API const char * ZTCALL zts_inet_ntop(
|
||||||
|
int af, const void *src, char *dst, zts_socklen_t size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert C-string IPv4 and IPv6 addresses to binary form.
|
* Convert C-string IPv4 and IPv6 addresses to binary form.
|
||||||
|
|||||||
@@ -17,11 +17,20 @@
|
|||||||
* Custom signal handler
|
* Custom signal handler
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ZeroTierSockets.h"
|
#ifdef ZTS_ENABLE_PYTHON
|
||||||
#include "Signals.hpp"
|
/**
|
||||||
|
* In some situations (Python comes to mind) a signal may not make its
|
||||||
|
* way to libzt, for this reason we make sure to define a custom signal
|
||||||
|
* handler that can at least process SIGTERMs
|
||||||
|
*/
|
||||||
|
#define ZTS_ENABLE_CUSTOM_SIGNAL_HANDLERS 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ZTS_ENABLE_CUSTOM_SIGNAL_HANDLERS
|
#ifdef ZTS_ENABLE_CUSTOM_SIGNAL_HANDLERS
|
||||||
|
|
||||||
|
#include "ZeroTierSockets.h"
|
||||||
|
#include "Signals.hpp"
|
||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <execinfo.h>
|
#include <execinfo.h>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|||||||
@@ -21,6 +21,9 @@
|
|||||||
#include "lwip/def.h"
|
#include "lwip/def.h"
|
||||||
#include "lwip/inet.h"
|
#include "lwip/inet.h"
|
||||||
#include "lwip/stats.h"
|
#include "lwip/stats.h"
|
||||||
|
#include "lwip/netdb.h"
|
||||||
|
#include "lwip/dns.h"
|
||||||
|
#include "lwip/ip_addr.h"
|
||||||
|
|
||||||
#include "ZeroTierSockets.h"
|
#include "ZeroTierSockets.h"
|
||||||
|
|
||||||
@@ -294,23 +297,54 @@ int zts_shutdown(int fd, int how)
|
|||||||
return lwip_shutdown(fd, how);
|
return lwip_shutdown(fd, how);
|
||||||
}
|
}
|
||||||
|
|
||||||
int zts_add_dns_nameserver(struct zts_sockaddr *addr)
|
struct zts_hostent *zts_gethostbyname(const char *name)
|
||||||
|
{
|
||||||
|
if (!(_serviceStateFlags & ZTS_STATE_NET_SERVICE_RUNNING)) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
if (!name) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
return (struct zts_hostent *)lwip_gethostbyname(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
int zts_dns_set_server(uint8_t index, const zts_ip_addr *addr)
|
||||||
{
|
{
|
||||||
if (!(_serviceStateFlags & ZTS_STATE_NET_SERVICE_RUNNING)) {
|
if (!(_serviceStateFlags & ZTS_STATE_NET_SERVICE_RUNNING)) {
|
||||||
return ZTS_ERR_SERVICE;
|
return ZTS_ERR_SERVICE;
|
||||||
}
|
}
|
||||||
return ZTS_ERR_SERVICE; // TODO
|
if (index >= DNS_MAX_SERVERS) {
|
||||||
|
return ZTS_ERR_ARG;
|
||||||
|
}
|
||||||
|
if (!addr) {
|
||||||
|
return ZTS_ERR_ARG;
|
||||||
|
}
|
||||||
|
dns_setserver(index, (const ip_addr_t *)addr);
|
||||||
|
return ZTS_ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int zts_del_dns_nameserver(struct zts_sockaddr *addr)
|
const zts_ip_addr *zts_dns_get_server(uint8_t index)
|
||||||
{
|
{
|
||||||
if (!(_serviceStateFlags & ZTS_STATE_NET_SERVICE_RUNNING)) {
|
if (!(_serviceStateFlags & ZTS_STATE_NET_SERVICE_RUNNING)) {
|
||||||
return ZTS_ERR_SERVICE;
|
return NULL;
|
||||||
}
|
}
|
||||||
return ZTS_ERR_SERVICE; // TODO
|
if (index >= DNS_MAX_SERVERS) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
return (const zts_ip_addr *)dns_getserver(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *zts_inet_ntop(int af, const void *src, char *dst,zts_socklen_t size)
|
char *zts_ipaddr_ntoa(const zts_ip_addr *addr)
|
||||||
|
{
|
||||||
|
return ipaddr_ntoa((ip_addr_t *)addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
int zts_ipaddr_aton(const char *cp, zts_ip_addr *addr)
|
||||||
|
{
|
||||||
|
return ipaddr_aton(cp, (ip_addr_t *)addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *zts_inet_ntop(int af, const void *src, char *dst, zts_socklen_t size)
|
||||||
{
|
{
|
||||||
return lwip_inet_ntop(af,src,dst,size);
|
return lwip_inet_ntop(af,src,dst,size);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -224,11 +224,6 @@ void _lwip_driver_shutdown();
|
|||||||
*/
|
*/
|
||||||
void _lwip_remove_netif(void *netif);
|
void _lwip_remove_netif(void *netif);
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Initialize and start the DNS client
|
|
||||||
*/
|
|
||||||
void _lwip_dns_init();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Starts DHCP timers
|
* @brief Starts DHCP timers
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -887,14 +887,14 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_zts_sendto(int jarg1, void * jarg2, unsigne
|
|||||||
SWIGEXPORT void * SWIGSTDCALL CSharp_zts_sendmsg(int jarg1, void * jarg2, int jarg3) {
|
SWIGEXPORT void * SWIGSTDCALL CSharp_zts_sendmsg(int jarg1, void * jarg2, int jarg3) {
|
||||||
void * jresult ;
|
void * jresult ;
|
||||||
int arg1 ;
|
int arg1 ;
|
||||||
msghdr *arg2 = (msghdr *) 0 ;
|
zts_msghdr *arg2 = (zts_msghdr *) 0 ;
|
||||||
int arg3 ;
|
int arg3 ;
|
||||||
ssize_t result;
|
ssize_t result;
|
||||||
|
|
||||||
arg1 = (int)jarg1;
|
arg1 = (int)jarg1;
|
||||||
arg2 = (msghdr *)jarg2;
|
arg2 = (zts_msghdr *)jarg2;
|
||||||
arg3 = (int)jarg3;
|
arg3 = (int)jarg3;
|
||||||
result = zts_sendmsg(arg1,(msghdr const *)arg2,arg3);
|
result = zts_sendmsg(arg1,(zts_msghdr const *)arg2,arg3);
|
||||||
jresult = new ssize_t((const ssize_t &)result);
|
jresult = new ssize_t((const ssize_t &)result);
|
||||||
return jresult;
|
return jresult;
|
||||||
}
|
}
|
||||||
@@ -942,12 +942,12 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_zts_recvfrom(int jarg1, void * jarg2, unsig
|
|||||||
SWIGEXPORT void * SWIGSTDCALL CSharp_zts_recvmsg(int jarg1, void * jarg2, int jarg3) {
|
SWIGEXPORT void * SWIGSTDCALL CSharp_zts_recvmsg(int jarg1, void * jarg2, int jarg3) {
|
||||||
void * jresult ;
|
void * jresult ;
|
||||||
int arg1 ;
|
int arg1 ;
|
||||||
msghdr *arg2 = (msghdr *) 0 ;
|
zts_msghdr *arg2 = (zts_msghdr *) 0 ;
|
||||||
int arg3 ;
|
int arg3 ;
|
||||||
ssize_t result;
|
ssize_t result;
|
||||||
|
|
||||||
arg1 = (int)jarg1;
|
arg1 = (int)jarg1;
|
||||||
arg2 = (msghdr *)jarg2;
|
arg2 = (zts_msghdr *)jarg2;
|
||||||
arg3 = (int)jarg3;
|
arg3 = (int)jarg3;
|
||||||
result = zts_recvmsg(arg1,arg2,arg3);
|
result = zts_recvmsg(arg1,arg2,arg3);
|
||||||
jresult = new ssize_t((const ssize_t &)result);
|
jresult = new ssize_t((const ssize_t &)result);
|
||||||
@@ -1032,8 +1032,8 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_shutdown(int jarg1, int jarg2) {
|
|||||||
return jresult;
|
return jresult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
SWIGEXPORT int SWIGSTDCALL CSharp_zts_add_dns_nameserver(zts_sockaddr* jarg1) {
|
SWIGEXPORT int SWIGSTDCALL CSharp_zts_dns_set_server(zts_sockaddr* jarg1) {
|
||||||
int jresult ;
|
int jresult ;
|
||||||
zts_sockaddr *arg1 = (zts_sockaddr *) 0 ;
|
zts_sockaddr *arg1 = (zts_sockaddr *) 0 ;
|
||||||
int result;
|
int result;
|
||||||
@@ -1045,7 +1045,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_add_dns_nameserver(zts_sockaddr* jarg1) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWIGEXPORT int SWIGSTDCALL CSharp_zts_del_dns_nameserver(zts_sockaddr* jarg1) {
|
SWIGEXPORT int SWIGSTDCALL CSharp_zts_dns_get_server(zts_sockaddr* jarg1) {
|
||||||
int jresult ;
|
int jresult ;
|
||||||
zts_sockaddr *arg1 = (zts_sockaddr *) 0 ;
|
zts_sockaddr *arg1 = (zts_sockaddr *) 0 ;
|
||||||
int result;
|
int result;
|
||||||
@@ -1055,6 +1055,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_zts_del_dns_nameserver(zts_sockaddr* jarg1) {
|
|||||||
jresult = result;
|
jresult = result;
|
||||||
return jresult;
|
return jresult;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
SWIGEXPORT char * SWIGSTDCALL CSharp_zts_inet_ntop(int jarg1, void * jarg2, char * jarg3, unsigned short jarg4) {
|
SWIGEXPORT char * SWIGSTDCALL CSharp_zts_inet_ntop(int jarg1, void * jarg2, char * jarg3, unsigned short jarg4) {
|
||||||
|
|||||||
@@ -64,7 +64,6 @@ class _SwigNonDynamicMeta(type):
|
|||||||
import weakref
|
import weakref
|
||||||
|
|
||||||
ZTS_ENABLE_PYTHON = _libzt.ZTS_ENABLE_PYTHON
|
ZTS_ENABLE_PYTHON = _libzt.ZTS_ENABLE_PYTHON
|
||||||
ZTS_ENABLE_CUSTOM_SIGNAL_HANDLERS = _libzt.ZTS_ENABLE_CUSTOM_SIGNAL_HANDLERS
|
|
||||||
ZTS_EVENT_NODE_UP = _libzt.ZTS_EVENT_NODE_UP
|
ZTS_EVENT_NODE_UP = _libzt.ZTS_EVENT_NODE_UP
|
||||||
ZTS_EVENT_NODE_ONLINE = _libzt.ZTS_EVENT_NODE_ONLINE
|
ZTS_EVENT_NODE_ONLINE = _libzt.ZTS_EVENT_NODE_ONLINE
|
||||||
ZTS_EVENT_NODE_OFFLINE = _libzt.ZTS_EVENT_NODE_OFFLINE
|
ZTS_EVENT_NODE_OFFLINE = _libzt.ZTS_EVENT_NODE_OFFLINE
|
||||||
@@ -740,12 +739,76 @@ ZTS_SHUT_RDWR = _libzt.ZTS_SHUT_RDWR
|
|||||||
|
|
||||||
def zts_shutdown(fd, how):
|
def zts_shutdown(fd, how):
|
||||||
return _libzt.zts_shutdown(fd, how)
|
return _libzt.zts_shutdown(fd, how)
|
||||||
|
class zts_hostent(object):
|
||||||
|
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)
|
||||||
|
|
||||||
def zts_add_dns_nameserver(addr):
|
def __init__(self):
|
||||||
return _libzt.zts_add_dns_nameserver(addr)
|
_libzt.zts_hostent_swiginit(self, _libzt.new_zts_hostent())
|
||||||
|
__swig_destroy__ = _libzt.delete_zts_hostent
|
||||||
|
|
||||||
def zts_del_dns_nameserver(addr):
|
# Register zts_hostent in _libzt:
|
||||||
return _libzt.zts_del_dns_nameserver(addr)
|
_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
|
||||||
|
class zts_ip4_addr(object):
|
||||||
|
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")
|
||||||
|
__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")
|
||||||
|
__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)
|
||||||
|
|
||||||
|
|
||||||
|
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_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(af, src, dst, size):
|
def zts_inet_ntop(af, src, dst, size):
|
||||||
return _libzt.zts_inet_ntop(af, src, dst, size)
|
return _libzt.zts_inet_ntop(af, src, dst, size)
|
||||||
|
|||||||
@@ -1199,7 +1199,7 @@ happening sooner than they should.
|
|||||||
* transport.
|
* transport.
|
||||||
*/
|
*/
|
||||||
#if !defined LWIP_DNS || defined __DOXYGEN__
|
#if !defined LWIP_DNS || defined __DOXYGEN__
|
||||||
#define LWIP_DNS 0
|
#define LWIP_DNS 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** DNS maximum number of entries to maintain locally. */
|
/** DNS maximum number of entries to maintain locally. */
|
||||||
|
|||||||
Reference in New Issue
Block a user