21 #ifndef AVFORMAT_NETWORK_H 22 #define AVFORMAT_NETWORK_H 41 #ifndef EPROTONOSUPPORT 42 #define EPROTONOSUPPORT WSAEPROTONOSUPPORT 45 #define ETIMEDOUT WSAETIMEDOUT 48 #define ECONNREFUSED WSAECONNREFUSED 51 #define EINPROGRESS WSAEINPROGRESS 54 #define getsockopt(a, b, c, d, e) getsockopt(a, b, c, (char*) d, e) 55 #define setsockopt(a, b, c, d, e) setsockopt(a, b, c, (const char*) d, e) 57 int ff_neterrno(
void);
59 #include <sys/types.h> 60 #include <sys/socket.h> 61 #include <netinet/in.h> 62 #include <netinet/tcp.h> 65 #define ff_neterrno() AVERROR(errno) 69 #include <arpa/inet.h> 76 int ff_socket_nonblock(
int socket,
int enable);
78 int ff_network_init(
void);
79 void ff_network_close(
void);
81 int ff_tls_init(
void);
82 void ff_tls_deinit(
void);
84 int ff_network_wait_fd(
int fd,
int write);
96 int ff_network_wait_fd_timeout(
int fd,
int write, int64_t timeout,
AVIOInterruptCB *int_cb);
105 int ff_network_sleep_interruptible(int64_t timeout,
AVIOInterruptCB *int_cb);
107 #if !HAVE_STRUCT_SOCKADDR_STORAGE 109 #if HAVE_STRUCT_SOCKADDR_SA_LEN 123 struct sockaddr_in in;
124 #if HAVE_STRUCT_SOCKADDR_IN6 125 struct sockaddr_in6 in6;
130 #define MSG_NOSIGNAL 0 133 #if !HAVE_STRUCT_ADDRINFO 140 struct sockaddr *ai_addr;
151 #define EAI_BADFLAGS 3 169 #define EAI_SERVICE 9 172 #define EAI_SOCKTYPE 10 180 #define AI_CANONNAME 2 183 #ifndef AI_NUMERICHOST 184 #define AI_NUMERICHOST 4 191 #ifndef NI_NUMERICHOST 192 #define NI_NUMERICHOST 2 199 #ifndef NI_NUMERICSERV 200 #define NI_NUMERICSERV 8 207 #if !HAVE_GETADDRINFO 208 int ff_getaddrinfo(
const char *node,
const char *service,
210 void ff_freeaddrinfo(
struct addrinfo *res);
211 int ff_getnameinfo(
const struct sockaddr *sa,
int salen,
212 char *host,
int hostlen,
213 char *serv,
int servlen,
int flags);
214 #define getaddrinfo ff_getaddrinfo 215 #define freeaddrinfo ff_freeaddrinfo 216 #define getnameinfo ff_getnameinfo 219 #if !HAVE_GETADDRINFO || HAVE_WINSOCK2_H 220 const char *ff_gai_strerror(
int ecode);
222 #define gai_strerror ff_gai_strerror 225 #ifndef INADDR_LOOPBACK 226 #define INADDR_LOOPBACK 0x7f000001 229 #ifndef INET_ADDRSTRLEN 230 #define INET_ADDRSTRLEN 16 233 #ifndef INET6_ADDRSTRLEN 234 #define INET6_ADDRSTRLEN INET_ADDRSTRLEN 238 #define IN_MULTICAST(a) ((((uint32_t)(a)) & 0xf0000000) == 0xe0000000) 240 #ifndef IN6_IS_ADDR_MULTICAST 241 #define IN6_IS_ADDR_MULTICAST(a) (((uint8_t *) (a))[0] == 0xff) 244 int ff_is_multicast_address(
struct sockaddr *addr);
246 #define POLLING_TIME 100 260 int ff_listen_bind(
int fd,
const struct sockaddr *addr,
261 socklen_t addrlen,
int timeout,
271 int ff_listen(
int fd,
const struct sockaddr *addr, socklen_t addrlen);
282 int ff_accept(
int fd,
int timeout,
URLContext *h);
299 int ff_listen_connect(
int fd,
const struct sockaddr *addr,
300 socklen_t addrlen,
int timeout,
303 int ff_http_match_no_proxy(
const char *no_proxy,
const char *hostname);
305 int ff_socket(
int domain,
int type,
int protocol);
miscellaneous OS support macros and functions.
Callback for checking whether to abort blocking functions.
Definition: avio.h:58
Definition: network.h:108
Definition: network.h:121
Definition: network.h:134
unbuffered private I/O API