21 #ifndef AVFORMAT_NETWORK_H
22 #define AVFORMAT_NETWORK_H
39 #ifndef EPROTONOSUPPORT
40 #define EPROTONOSUPPORT WSAEPROTONOSUPPORT
43 #define ETIMEDOUT WSAETIMEDOUT
46 #define ECONNREFUSED WSAECONNREFUSED
49 #define EINPROGRESS WSAEINPROGRESS
52 #define getsockopt(a, b, c, d, e) getsockopt(a, b, c, (char*) d, e)
53 #define setsockopt(a, b, c, d, e) setsockopt(a, b, c, (const char*) d, e)
57 #include <sys/types.h>
58 #include <sys/socket.h>
59 #include <netinet/in.h>
62 #define ff_neterrno() AVERROR(errno)
66 #include <arpa/inet.h>
84 int ff_inet_aton (
const char * str,
struct in_addr * add);
86 #if !HAVE_STRUCT_SOCKADDR_STORAGE
88 #if HAVE_STRUCT_SOCKADDR_SA_LEN
100 #if !HAVE_STRUCT_ADDRINFO
118 #define EAI_BADFLAGS 3
136 #define EAI_SERVICE 9
139 #define EAI_SOCKTYPE 10
147 #define AI_CANONNAME 2
150 #ifndef AI_NUMERICHOST
151 #define AI_NUMERICHOST 4
158 #ifndef NI_NUMERICHOST
159 #define NI_NUMERICHOST 2
166 #ifndef NI_NUMERICSERV
167 #define NI_NUMERICSERV 8
174 #if !HAVE_GETADDRINFO
179 char *host,
int hostlen,
180 char *serv,
int servlen,
int flags);
181 #define getaddrinfo ff_getaddrinfo
182 #define freeaddrinfo ff_freeaddrinfo
183 #define getnameinfo ff_getnameinfo
185 #if !HAVE_GETADDRINFO || HAVE_WINSOCK2_H
188 #define gai_strerror ff_gai_strerror
191 #ifndef INADDR_LOOPBACK
192 #define INADDR_LOOPBACK 0x7f000001
195 #ifndef INET_ADDRSTRLEN
196 #define INET_ADDRSTRLEN 16
199 #ifndef INET6_ADDRSTRLEN
200 #define INET6_ADDRSTRLEN INET_ADDRSTRLEN
204 #define IN_MULTICAST(a) ((((uint32_t)(a)) & 0xf0000000) == 0xe0000000)
206 #ifndef IN6_IS_ADDR_MULTICAST
207 #define IN6_IS_ADDR_MULTICAST(a) (((uint8_t *) (a))[0] == 0xff)
int ff_network_wait_fd(int fd, int write)
int ff_getnameinfo(const struct sockaddr *sa, int salen, char *host, int hostlen, char *serv, int servlen, int flags)
int ff_is_multicast_address(struct sockaddr *addr)
miscellaneous OS support macros and functions.
void ff_network_close(void)
const char * ff_gai_strerror(int ecode)
void ff_freeaddrinfo(struct addrinfo *res)
int ff_inet_aton(const char *str, struct in_addr *add)
int ff_socket_nonblock(int socket, int enable)
int ff_network_inited_globally
struct addrinfo * ai_next
int ff_network_init(void)
int ff_getaddrinfo(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res)
struct sockaddr * ai_addr