diff options
Diffstat (limited to 'plugins/netutils.h')
-rw-r--r-- | plugins/netutils.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/plugins/netutils.h b/plugins/netutils.h index c6fce901..d7ee0ddd 100644 --- a/plugins/netutils.h +++ b/plugins/netutils.h @@ -45,6 +45,10 @@ # endif /* UNIX_PATH_MAX */ #endif /* HAVE_SYS_UN_H */ +#ifndef HOST_MAX_BYTES +# define HOST_MAX_BYTES 255 +#endif + /* process_request and wrapper macros */ #define process_tcp_request(addr, port, sbuf, rbuf, rsize) \ process_request(addr, port, IPPROTO_TCP, sbuf, rbuf, rsize) @@ -71,8 +75,9 @@ int send_request (int sd, int proto, const char *send_buffer, char *recv_buffer, /* "is_*" wrapper macros and functions */ int is_host (const char *); int is_addr (const char *); -int resolve_host_or_addr (const char *, int); +int dns_lookup (const char *, struct sockaddr_storage *, int); void host_or_die(const char *str); +#define resolve_host_or_addr(addr, family) dns_lookup(addr, NULL, family) #define is_inet_addr(addr) resolve_host_or_addr(addr, AF_INET) #ifdef USE_IPV6 # define is_inet6_addr(addr) resolve_host_or_addr(addr, AF_INET6) @@ -91,6 +96,16 @@ RETSIGTYPE socket_timeout_alarm_handler (int) __attribute__((noreturn)); /* SSL-Related functionality */ #ifdef HAVE_SSL +# define MP_SSLv2 1 +# define MP_SSLv3 2 +# define MP_TLSv1 3 +# define MP_TLSv1_1 4 +# define MP_TLSv1_2 5 +# define MP_SSLv2_OR_NEWER 6 +# define MP_SSLv3_OR_NEWER 7 +# define MP_TLSv1_OR_NEWER 8 +# define MP_TLSv1_1_OR_NEWER 9 +# define MP_TLSv1_2_OR_NEWER 10 /* maybe this could be merged with the above np_net_connect, via some flags */ int np_net_ssl_init(int sd); int np_net_ssl_init_with_hostname(int sd, char *host_name); |