2 * networking.h: Portable networking functions
5 * Rodrigo Kumpera (kumpera@gmail.com)
11 #ifndef __MONO_NETWORKING_H__
12 #define __MONO_NETWORKING_H__
16 #ifdef HAVE_ARPA_INET_H
17 #include <arpa/inet.h>
19 #include <sys/types.h>
20 #ifdef HAVE_SYS_SOCKET_H
21 #include <sys/socket.h>
29 #include <mono/utils/mono-compiler.h>
32 MONO_HINT_UNSPECIFIED = 0,
35 MONO_HINT_CANONICAL_NAME = 4,
36 MONO_HINT_CONFIGURED_ONLY = 8,
37 } MonoGetAddressHints;
39 typedef struct _MonoAddressEntry MonoAddressEntry;
41 struct _MonoAddressEntry {
50 const char *canonical_name;
51 MonoAddressEntry *next;
55 MonoAddressEntry *entries;
60 struct sockaddr_in v4;
61 struct sockaddr_in6 v6;
65 /* This only supports IPV4 / IPV6 and tcp */
66 int mono_get_address_info (const char *hostname, int port, int flags, MonoAddressInfo **res) MONO_INTERNAL;
68 void mono_free_address_info (MonoAddressInfo *ai) MONO_INTERNAL;
70 void mono_socket_address_init (MonoSocketAddress *sa, socklen_t *len, int family, const void *address, int port) MONO_INTERNAL;
72 void *mono_get_local_interfaces (int family, int *interface_count) MONO_INTERNAL;
74 #ifndef HAVE_INET_PTON
75 int inet_pton (int family, const char *address, void *inaddrp) MONO_INTERNAL;
78 int mono_networking_get_tcp_protocol (void) MONO_INTERNAL;
79 int mono_networking_get_ip_protocol (void) MONO_INTERNAL;
80 int mono_networking_get_ipv6_protocol (void) MONO_INTERNAL;