Now inbound_cap_ls() can enable extensions when a bouncer uses a namespace for the...
[rofl0r-ixchat.git] / src / common / network.h
blobf45f210ab75037f5b2177dcff2a1abf57fa26cf3
1 #ifndef XCHAT_NETWORK_H
2 #define XCHAT_NETWORK_H
4 typedef struct netstore_
6 #ifdef NETWORK_PRIVATE
7 #ifdef USE_IPV6
8 struct addrinfo *ip6_hostent;
9 #else
10 struct hostent *ip4_hostent;
11 struct sockaddr_in addr;
12 #endif
13 #else
14 int _dummy; /* some compilers don't like empty structs */
15 #endif
16 } netstore;
18 #define MAX_HOSTNAME 128
20 netstore *net_store_new (void);
21 void net_store_destroy (netstore *ns);
22 int net_connect (netstore *ns, int sok4, int sok6, int *sok_return);
23 char *net_resolve (netstore *ns, char *hostname, int port, char **real_host);
24 void net_bind (netstore *tobindto, int sok4, int sok6);
25 char *net_ip (guint32 addr);
26 void net_sockets (int *sok4, int *sok6);
27 /* functions for MSPROXY only! */
28 void udp_sockets (int *sok4, int *sok6);
29 void net_store_fill_any (netstore *ns);
30 void net_store_fill_v4 (netstore *ns, guint32 addr, int port);
31 guint32 net_getsockaddr_v4 (netstore *ns);
32 int net_getsockport(int sok4, int sok6);
34 #endif