1 #ifndef XCHAT_NETWORK_H
2 #define XCHAT_NETWORK_H
4 typedef struct netstore_
8 struct addrinfo
*ip6_hostent
;
10 struct hostent
*ip4_hostent
;
11 struct sockaddr_in addr
;
14 int _dummy
; /* some compilers don't like empty structs */
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
);