26#ifndef _ASTERISK_NETWORK_H
27#define _ASTERISK_NETWORK_H
29#if defined(__cplusplus) || defined(c_plusplus)
40#ifdef HAVE_ARPA_INET_H
41#include <netinet/in.h>
43#include <netinet/in_systm.h>
44#include <netinet/ip.h>
45#include <netinet/tcp.h>
47#include <sys/socket.h>
50#elif defined(HAVE_WINSOCK_H)
53#elif defined(HAVE_WINSOCK2_H)
57#error "don't know how to handle network functions here."
69#define MAXHOSTNAMELEN 256
87#define inet_ntoa __dont__use__inet_ntoa__use__ast_inet_ntoa__instead__
92#define getprotobyname __getprotobyname_is_not_threadsafe__do_not_use__
97 return ((sin1->sin_addr.s_addr != sin2->sin_addr.s_addr)
98 || (sin1->sin_port != sin2->sin_port));
101#if defined(__cplusplus) || defined(c_plusplus)
static force_inline int inaddrcmp(const struct sockaddr_in *sin1, const struct sockaddr_in *sin2)
Compares the source address and port of two sockaddr_in.
int inet_aton(const char *cp, struct in_addr *pin)
const char * ast_inet_ntoa(struct in_addr ia)
thread-safe replacement for inet_ntoa().