21 #ifndef AVFORMAT_NETWORK_H 22 #define AVFORMAT_NETWORK_H 40 #ifndef EPROTONOSUPPORT 41 #define EPROTONOSUPPORT WSAEPROTONOSUPPORT 44 #define ETIMEDOUT WSAETIMEDOUT 47 #define ECONNREFUSED WSAECONNREFUSED 50 #define EINPROGRESS WSAEINPROGRESS 53 #define getsockopt(a, b, c, d, e) getsockopt(a, b, c, (char*) d, e) 54 #define setsockopt(a, b, c, d, e) setsockopt(a, b, c, (const char*) d, e) 58 #include <sys/types.h> 59 #include <sys/socket.h> 60 #include <netinet/in.h> 63 #define ff_neterrno() AVERROR(errno) 67 #include <arpa/inet.h> 85 int ff_inet_aton (
const char * str,
struct in_addr * add);
87 #if !HAVE_STRUCT_SOCKADDR_STORAGE 89 #if HAVE_STRUCT_SOCKADDR_SA_LEN 101 #if !HAVE_STRUCT_ADDRINFO 119 #define EAI_BADFLAGS 3 137 #define EAI_SERVICE 9 140 #define EAI_SOCKTYPE 10 148 #define AI_CANONNAME 2 151 #ifndef AI_NUMERICHOST 152 #define AI_NUMERICHOST 4 159 #ifndef NI_NUMERICHOST 160 #define NI_NUMERICHOST 2 167 #ifndef NI_NUMERICSERV 168 #define NI_NUMERICSERV 8 175 #if !HAVE_GETADDRINFO 180 char *host,
int hostlen,
181 char *serv,
int servlen,
int flags);
182 #define getaddrinfo ff_getaddrinfo 183 #define freeaddrinfo ff_freeaddrinfo 184 #define getnameinfo ff_getnameinfo 187 #if !HAVE_GETADDRINFO || HAVE_WINSOCK2_H 190 #define gai_strerror ff_gai_strerror 193 #ifndef INADDR_LOOPBACK 194 #define INADDR_LOOPBACK 0x7f000001 197 #ifndef INET_ADDRSTRLEN 198 #define INET_ADDRSTRLEN 16 201 #ifndef INET6_ADDRSTRLEN 202 #define INET6_ADDRSTRLEN INET_ADDRSTRLEN 206 #define IN_MULTICAST(a) ((((uint32_t)(a)) & 0xf0000000) == 0xe0000000) 208 #ifndef IN6_IS_ADDR_MULTICAST 209 #define IN6_IS_ADDR_MULTICAST(a) (((uint8_t *) (a))[0] == 0xff) 214 #define POLLING_TIME 100 229 socklen_t addrlen,
int timeout,
248 socklen_t addrlen,
int timeout,
253 int ff_socket(
int domain,
int type,
int protocol);
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.
int ff_http_match_no_proxy(const char *no_proxy, const char *hostname)
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_listen_connect(int fd, const struct sockaddr *addr, socklen_t addrlen, int timeout, URLContext *h, int will_try_next)
Connect to a file descriptor and poll for result.
int ff_socket_nonblock(int socket, int enable)
int ff_listen_bind(int fd, const struct sockaddr *addr, socklen_t addrlen, int timeout, URLContext *h)
Bind to a file descriptor and poll for a connection.
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)
int ff_socket(int domain, int type, int protocol)
unbuffered private I/O API
struct sockaddr * ai_addr