FFmpeg
|
#include <errno.h>
#include <stdint.h>
#include "config.h"
#include "libavutil/error.h"
#include "os_support.h"
#include "avio.h"
#include "url.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
Go to the source code of this file.
Data Structures | |
struct | sockaddr_storage |
struct | addrinfo |
Macros | |
#define | ff_neterrno() AVERROR(errno) |
#define | EAI_AGAIN 2 |
#define | EAI_BADFLAGS 3 |
#define | EAI_FAIL 4 |
#define | EAI_FAMILY 5 |
#define | EAI_MEMORY 6 |
#define | EAI_NODATA 7 |
#define | EAI_NONAME 8 |
#define | EAI_SERVICE 9 |
#define | EAI_SOCKTYPE 10 |
#define | AI_PASSIVE 1 |
#define | AI_CANONNAME 2 |
#define | AI_NUMERICHOST 4 |
#define | NI_NOFQDN 1 |
#define | NI_NUMERICHOST 2 |
#define | NI_NAMERQD 4 |
#define | NI_NUMERICSERV 8 |
#define | NI_DGRAM 16 |
#define | getaddrinfo ff_getaddrinfo |
#define | freeaddrinfo ff_freeaddrinfo |
#define | getnameinfo ff_getnameinfo |
#define | gai_strerror ff_gai_strerror |
#define | INADDR_LOOPBACK 0x7f000001 |
#define | INET_ADDRSTRLEN 16 |
#define | INET6_ADDRSTRLEN INET_ADDRSTRLEN |
#define | IN_MULTICAST(a) ((((uint32_t)(a)) & 0xf0000000) == 0xe0000000) |
#define | IN6_IS_ADDR_MULTICAST(a) (((uint8_t *) (a))[0] == 0xff) |
#define | POLLING_TIME 100 |
Functions | |
int | ff_socket_nonblock (int socket, int enable) |
int | ff_network_init (void) |
void | ff_network_close (void) |
void | ff_tls_init (void) |
void | ff_tls_deinit (void) |
int | ff_network_wait_fd (int fd, int write) |
int | ff_network_wait_fd_timeout (int fd, int write, int64_t timeout, AVIOInterruptCB *int_cb) |
This works similarly to ff_network_wait_fd, but waits up to 'timeout' microseconds Uses ff_network_wait_fd in a loop. | |
int | ff_inet_aton (const char *str, struct in_addr *add) |
int | ff_getaddrinfo (const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res) |
void | ff_freeaddrinfo (struct addrinfo *res) |
int | ff_getnameinfo (const struct sockaddr *sa, int salen, char *host, int hostlen, char *serv, int servlen, int flags) |
const char * | ff_gai_strerror (int ecode) |
int | ff_is_multicast_address (struct sockaddr *addr) |
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_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_http_match_no_proxy (const char *no_proxy, const char *hostname) |
int | ff_socket (int domain, int type, int protocol) |
Variables | |
int | ff_network_inited_globally |
#define ff_neterrno | ( | ) | AVERROR(errno) |
Definition at line 64 of file network.h.
Referenced by ff_listen_bind(), ff_listen_connect(), ff_network_wait_fd(), handle_connection(), http_receive_data(), http_send_data(), http_server(), log_net_error(), rtp_read(), rtp_write(), sctp_read(), sctp_wait_fd(), sctp_write(), tcp_open(), tcp_read(), tcp_write(), udp_read(), udp_set_multicast_sources(), udp_write(), unix_open(), unix_read(), and unix_write().
#define AI_PASSIVE 1 |
Definition at line 157 of file network.h.
Referenced by tcp_open(), and udp_socket_create().
#define AI_NUMERICHOST 4 |
Definition at line 165 of file network.h.
Referenced by ff_url_join(), get_sockaddr(), and tls_open().
#define NI_NUMERICSERV 8 |
Definition at line 181 of file network.h.
Referenced by udp_port().
#define getaddrinfo ff_getaddrinfo |
Definition at line 195 of file network.h.
Referenced by ff_url_join(), get_sockaddr(), resolve_host(), rtp_resolve_host(), sap_write_header(), sctp_open(), tcp_open(), tls_open(), and udp_resolve_host().
#define freeaddrinfo ff_freeaddrinfo |
Definition at line 196 of file network.h.
Referenced by ff_url_join(), get_sockaddr(), resolve_host(), rtp_parse_addr_list(), sap_write_header(), sctp_open(), tcp_open(), tls_open(), udp_set_multicast_sources(), udp_set_url(), and udp_socket_create().
#define getnameinfo ff_getnameinfo |
Definition at line 197 of file network.h.
Referenced by udp_port().
#define gai_strerror ff_gai_strerror |
Definition at line 203 of file network.h.
Referenced by rtp_resolve_host(), sctp_open(), tcp_open(), udp_port(), and udp_resolve_host().
#define INET6_ADDRSTRLEN INET_ADDRSTRLEN |
Definition at line 219 of file network.h.
Referenced by ff_is_multicast_address().
Definition at line 222 of file network.h.
Referenced by ff_is_multicast_address().
#define POLLING_TIME 100 |
Definition at line 227 of file network.h.
Referenced by ff_poll_interrupt().
int ff_socket_nonblock | ( | int | socket, |
int | enable | ||
) |
Referenced by ff_listen_bind(), ff_listen_connect(), new_connection(), sctp_open(), socket_open_listen(), and udp_open().
int ff_network_init | ( | void | ) |
Definition at line 126 of file network.c.
Referenced by avformat_network_init(), sap_read_header(), sap_write_header(), and url_alloc_for_protocol().
Definition at line 173 of file network.c.
Referenced by avformat_network_deinit(), ffurl_closep(), rtsp_read_close(), rtsp_write_close(), sap_read_close(), sap_write_close(), and url_alloc_for_protocol().
Definition at line 69 of file network.c.
Referenced by avformat_network_init(), and tls_open().
Definition at line 101 of file network.c.
Referenced by avformat_network_deinit(), tls_close(), and tls_open().
int ff_network_wait_fd | ( | int | fd, |
int | write | ||
) |
Definition at line 144 of file network.c.
Referenced by ff_network_wait_fd_timeout(), rtp_write(), udp_read(), udp_write(), unix_read(), and unix_write().
int ff_network_wait_fd_timeout | ( | int | fd, |
int | write, | ||
int64_t | timeout, | ||
AVIOInterruptCB * | int_cb | ||
) |
This works similarly to ff_network_wait_fd, but waits up to 'timeout' microseconds Uses ff_network_wait_fd in a loop.
Socket descriptor Set 1 to wait for socket able to be read, 0 to be written Timeout interval, in microseconds. Actual precision is 100000 mcs, due to ff_network_wait_fd usage
int_cb | Interrupt callback, is checked before each ff_network_wait_fd call |
Definition at line 153 of file network.c.
Referenced by tcp_read(), and tcp_write().
int ff_inet_aton | ( | const char * | str, |
struct in_addr * | add | ||
) |
Referenced by resolve_host().
int ff_getaddrinfo | ( | const char * | node, |
const char * | service, | ||
const struct addrinfo * | hints, | ||
struct addrinfo ** | res | ||
) |
int ff_getnameinfo | ( | const struct sockaddr * | sa, |
int | salen, | ||
char * | host, | ||
int | hostlen, | ||
char * | serv, | ||
int | servlen, | ||
int | flags | ||
) |
const char* ff_gai_strerror | ( | int | ecode | ) |
int ff_is_multicast_address | ( | struct sockaddr * | addr | ) |
Definition at line 202 of file network.c.
Referenced by ff_udp_set_remote_url().
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.
fd | First argument of bind(). |
addr | Second argument of bind(). |
addrlen | Third argument of bind(). |
timeout | Polling timeout in milliseconds. |
h | URLContext providing interrupt check callback and logging context. |
Definition at line 257 of file network.c.
Referenced by tcp_open(), and unix_open().
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.
fd | First argument of connect(), will be set as non-blocking. |
addr | Second argument of connect(). |
addrlen | Third argument of connect(). |
timeout | Polling timeout in milliseconds. |
h | URLContext providing interrupt check callback and logging context. |
will_try_next | Whether the caller will try to connect to another address for the same host name, affecting the form of logged errors. |
Definition at line 290 of file network.c.
Referenced by tcp_open(), and unix_open().
int ff_http_match_no_proxy | ( | const char * | no_proxy, |
const char * | hostname | ||
) |
Definition at line 359 of file network.c.
Referenced by http_open_cnx(), test(), and tls_open().
int ff_socket | ( | int | domain, |
int | type, | ||
int | protocol | ||
) |
Definition at line 237 of file network.c.
Referenced by sctp_open(), tcp_open(), udp_socket_create(), and unix_open().
int ff_network_inited_globally |
Definition at line 124 of file network.c.
Referenced by avformat_network_init().