|
|
@ -1,5 +1,8 @@
|
|
|
|
#ifndef EASYSOCK_HPP_
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#define EASYSOCK_HPP_
|
|
|
|
extern "C" {
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef EASYSOCK_H_
|
|
|
|
|
|
|
|
#define EASYSOCK_H_
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
#ifdef _WIN32
|
|
|
|
#include <winsock2.h>
|
|
|
|
#include <winsock2.h>
|
|
|
@ -70,6 +73,12 @@ IPv6 address (returns 6) or neither (returns -1). */
|
|
|
|
|
|
|
|
|
|
|
|
int check_ip_ver(const char* address);
|
|
|
|
int check_ip_ver(const char* address);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* port_to_num - Converts a string representing a port, into a numeric value.
|
|
|
|
|
|
|
|
Returns -1 if the string is not numeric, or exceeds the maximum port length.
|
|
|
|
|
|
|
|
Returns -2 if the string is lower than 1024, This serves as a warning, as ports less
|
|
|
|
|
|
|
|
than 1023 are reserved. */
|
|
|
|
|
|
|
|
int port_to_num(const char* port_str);
|
|
|
|
|
|
|
|
|
|
|
|
/* int_to_inet - Takes an int value (4 for IPv4, 6 for IPv6) and returns AF_INET or
|
|
|
|
/* int_to_inet - Takes an int value (4 for IPv4, 6 for IPv6) and returns AF_INET or
|
|
|
|
AF_INET6 respectively. */
|
|
|
|
AF_INET6 respectively. */
|
|
|
|
|
|
|
|
|
|
|
@ -92,3 +101,6 @@ int sock_quit(void);
|
|
|
|
int sock_close(SOCKET);
|
|
|
|
int sock_close(SOCKET);
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|