
Go to the source code of this file.
Data Structures | |
| struct | virtual_socket_t |
| struct | pollfd |
| struct | addrinfo |
Defines | |
| #define | net_errno errno |
| #define | net_Connect(a, b, c, d, e) __net_Connect(VLC_OBJECT(a), b, c, d, e) |
| #define | net_ListenTCP(a, b, c) net_Listen(VLC_OBJECT(a), b, c, IPPROTO_TCP) |
| #define | net_ConnectTCP(a, b, c) __net_ConnectTCP(VLC_OBJECT(a), b, c) |
| #define | net_Accept(a, b) net_Accept(VLC_OBJECT(a), b) |
| #define | net_ConnectDgram(a, b, c, d, e) __net_ConnectDgram(VLC_OBJECT(a), b, c, d, e) |
| #define | net_OpenDgram(a, b, c, d, e, g, h) __net_OpenDgram(VLC_OBJECT(a), b, c, d, e, g, h) |
| #define | net_Read(a, b, c, d, e, f) __net_Read(VLC_OBJECT(a),b,c,d,e,f) |
| #define | net_Write(a, b, c, d, e) __net_Write(VLC_OBJECT(a),b,c,d,e) |
| #define | net_Gets(a, b, c) __net_Gets(VLC_OBJECT(a),b,c) |
| #define | net_vaPrintf(a, b, c, d, e) __net_vaPrintf(VLC_OBJECT(a),b,c,d,e) |
| #define | inet_pton vlc_inet_pton |
| #define | inet_ntop vlc_inet_ntop |
| #define | poll(a, b, c) vlc_poll(a, b, c) |
| #define | net_Close(fd) (void)close (fd) |
| #define | EAI_BADFLAGS -1 |
| #define | EAI_NONAME -2 |
| #define | EAI_AGAIN -3 |
| #define | EAI_FAIL -4 |
| #define | EAI_NODATA -5 |
| #define | EAI_FAMILY -6 |
| #define | EAI_SOCKTYPE -7 |
| #define | EAI_SERVICE -8 |
| #define | EAI_ADDRFAMILY -9 |
| #define | EAI_MEMORY -10 |
| #define | EAI_OVERFLOW -11 |
| #define | EAI_SYSTEM -12 |
| #define | NI_MAXHOST 1025 |
| #define | NI_MAXSERV 32 |
| #define | NI_MAXNUMERICHOST 64 |
| #define | NI_NUMERICHOST 0x01 |
| #define | NI_NUMERICSERV 0x02 |
| #define | NI_NOFQDN 0x04 |
| #define | NI_NAMEREQD 0x08 |
| #define | NI_DGRAM 0x10 |
| #define | AI_PASSIVE 1 |
| #define | AI_CANONNAME 2 |
| #define | AI_NUMERICHOST 4 |
| #define | AI_NUMERICSERV 0 |
Enumerations | |
| enum | { POLLIN = 1, POLLOUT = 2, POLLPRI = 4, POLLERR = 8, POLLHUP = 16, POLLNVAL = 32 } |
Functions | |
| int | net_Socket (vlc_object_t *obj, int family, int socktype, int proto) |
| int | net_SetupSocket (int fd) |
| int | __net_Connect (vlc_object_t *p_this, const char *psz_host, int i_port, int socktype, int protocol) |
| int * | net_Listen (vlc_object_t *p_this, const char *psz_host, int i_port, int protocol) |
| static int | __net_ConnectTCP (vlc_object_t *obj, const char *host, int port) |
| int | net_AcceptSingle (vlc_object_t *obj, int lfd) |
| int | net_Accept (vlc_object_t *, int *) |
| Accepts an new connection on a set of listening sockets. | |
| int | __net_ConnectDgram (vlc_object_t *p_this, const char *psz_host, int i_port, int hlim, int proto) |
| static int | net_ConnectUDP (vlc_object_t *obj, const char *host, int port, int hlim) |
| int | __net_OpenDgram (vlc_object_t *p_this, const char *psz_bind, int i_bind, const char *psz_server, int i_server, int family, int proto) |
| static int | net_ListenUDP1 (vlc_object_t *obj, const char *host, int port) |
| void | net_ListenClose (int *fd) |
| int | net_Subscribe (vlc_object_t *obj, int fd, const struct sockaddr *addr, socklen_t addrlen) |
| int | net_SetCSCov (int fd, int sendcov, int recvcov) |
| net_SetCSCov: Sets the send and receive checksum coverage of a socket: | |
| ssize_t | __net_Read (vlc_object_t *p_this, int fd, const v_socket_t *, void *p_data, size_t i_data, bool b_retry) |
| ssize_t | __net_Write (vlc_object_t *p_this, int fd, const v_socket_t *, const void *p_data, size_t i_data) |
| char * | __net_Gets (vlc_object_t *p_this, int fd, const v_socket_t *) |
| Reads a line from a file descriptor. | |
| ssize_t | net_Printf (vlc_object_t *p_this, int fd, const v_socket_t *, const char *psz_fmt,...) |
| ssize_t | __net_vaPrintf (vlc_object_t *p_this, int fd, const v_socket_t *, const char *psz_fmt, va_list args) |
| int | vlc_inet_pton (int af, const char *src, void *dst) |
| inet_pton() replacement | |
| const char * | vlc_inet_ntop (int af, const void *src, char *dst, socklen_t cnt) |
| inet_ntop() replacement | |
| int | vlc_poll (struct pollfd *fds, unsigned nfds, int timeout) |
| const char * | vlc_gai_strerror (int) |
| int | vlc_getnameinfo (const struct sockaddr *, int, char *, int, int *, int) |
| int | vlc_getaddrinfo (vlc_object_t *, const char *, int, const struct addrinfo *, struct addrinfo **) |
| Resolves a host name to a list of socket addresses (like getaddrinfo()). | |
| void | vlc_freeaddrinfo (struct addrinfo *) |
| static bool | net_SockAddrIsMulticast (const struct sockaddr *addr, socklen_t len) |
| static int | net_GetSockAddress (int fd, char *address, int *port) |
| static int | net_GetPeerAddress (int fd, char *address, int *port) |
| static uint16_t | net_GetPort (const struct sockaddr *addr) |
| static void | net_SetPort (struct sockaddr *addr, uint16_t port) |
| #define AI_CANONNAME 2 |
Referenced by stub_getaddrinfo(), and vlc_getaddrinfo().
| #define AI_NUMERICHOST 4 |
Referenced by __net_Connect(), ACL_Resolve(), stub_getaddrinfo(), vlc_getaddrinfo(), and vlc_inet_pton().
| #define AI_NUMERICSERV 0 |
Referenced by vlc_getaddrinfo().
| #define AI_PASSIVE 1 |
Referenced by __net_OpenDgram(), net_Listen(), net_ListenSingle(), stub_getaddrinfo(), and vlc_getaddrinfo().
| #define EAI_ADDRFAMILY -9 |
| #define EAI_AGAIN -3 |
Referenced by gai_error_from_herrno().
| #define EAI_BADFLAGS -1 |
Referenced by stub_getaddrinfo(), stub_getnameinfo(), and vlc_getaddrinfo().
| #define EAI_FAIL -4 |
Referenced by gai_error_from_herrno().
| #define EAI_FAMILY -6 |
Referenced by stub_getaddrinfo(), stub_getnameinfo(), and vlc_inet_ntop().
| #define EAI_MEMORY -10 |
| #define EAI_NODATA -5 |
Referenced by gai_error_from_herrno().
| #define EAI_NONAME -2 |
Referenced by gai_error_from_herrno(), stub_getaddrinfo(), and stub_getnameinfo().
| #define EAI_OVERFLOW -11 |
Referenced by stub_getnameinfo().
| #define EAI_SERVICE -8 |
Referenced by stub_getaddrinfo(), and vlc_getaddrinfo().
| #define EAI_SOCKTYPE -7 |
Referenced by stub_getaddrinfo().
| #define EAI_SYSTEM -12 |
Referenced by gai_error_from_herrno(), and stub_getaddrinfo().
| #define inet_ntop vlc_inet_ntop |
Referenced by ParseConnection(), and vlc_inet_ntop().
| #define inet_pton vlc_inet_pton |
Referenced by net_IPv4Join(), net_SetMcastOut(), ParseConnection(), ParseSDPConnection(), and vlc_inet_pton().
| #define net_Accept | ( | a, | |||
| b | ) | net_Accept(VLC_OBJECT(a), b) |
Referenced by Open(), Run(), and vlclua_net_accept().
| #define net_Close | ( | fd | ) | (void)close (fd) |
Referenced by __net_Connect(), __net_ConnectDgram(), __net_OpenDgram(), Activate(), CheckAndSend(), Close(), CloseRTCP(), Connect(), Deactivate(), Describe(), Disconnect(), FreeSys(), ftp_StopStream(), InOpen(), MMSClose(), MMSOpen(), net_Listen(), net_ListenClose(), net_ListenSingle(), net_SetupDgramSocket(), Open(), OpenRTCP(), OutOpen(), ReadCommand(), RtspDelId(), RtspDisconnect(), Run(), Stop(), vlclua_net_close(), and vnc_worker_thread().
| #define net_Connect | ( | a, | |||
| b, | |||||
| c, | |||||
| d, | |||||
| e | ) | __net_Connect(VLC_OBJECT(a), b, c, d, e) |
Referenced by Open().
| #define net_ConnectDgram | ( | a, | |||
| b, | |||||
| c, | |||||
| d, | |||||
| e | ) | __net_ConnectDgram(VLC_OBJECT(a), b, c, d, e) |
Referenced by net_ConnectUDP(), Open(), and RtspHandler().
| #define net_ConnectTCP | ( | a, | |||
| b, | |||||
| c | ) | __net_ConnectTCP(VLC_OBJECT(a), b, c) |
Referenced by Connect(), ftp_StartStream(), Login(), MMSOpen(), Open(), open_vnc_connection(), OpenConnection(), RtspConnect(), and Run().
| #define net_errno errno |
Referenced by __net_Connect(), net_Accept(), net_AcceptSingle(), net_Socket(), Run(), and ThreadSend().
| #define net_Gets | ( | a, | |||
| b, | |||||
| c | ) | __net_Gets(VLC_OBJECT(a),b,c) |
Referenced by Describe(), ftp_ReadCommand(), Read(), ReadHeader(), ReadStatusLine(), Request(), RtspReadLine(), and Start().
| #define net_ListenTCP | ( | a, | |||
| b, | |||||
| c | ) | net_Listen(VLC_OBJECT(a), b, c, IPPROTO_TCP) |
Referenced by Activate(), httpd_TLSHostNew(), Open(), and vlclua_net_listen_tcp().
| #define net_OpenDgram | ( | a, | |||
| b, | |||||
| c, | |||||
| d, | |||||
| e, | |||||
| g, | |||||
| h | ) | __net_OpenDgram(VLC_OBJECT(a), b, c, d, e, g, h) |
Referenced by net_ListenUDP1(), Open(), and OpenRTCP().
| #define net_Read | ( | a, | |||
| b, | |||||
| c, | |||||
| d, | |||||
| e, | |||||
| f | ) | __net_Read(VLC_OBJECT(a),b,c,d,e,f) |
| #define net_vaPrintf | ( | a, | |||
| b, | |||||
| c, | |||||
| d, | |||||
| e | ) | __net_vaPrintf(VLC_OBJECT(a),b,c,d,e) |
Referenced by __msg_rc(), and net_Printf().
| #define net_Write | ( | a, | |||
| b, | |||||
| c, | |||||
| d, | |||||
| e | ) | __net_Write(VLC_OBJECT(a),b,c,d,e) |
| #define NI_DGRAM 0x10 |
| #define NI_MAXHOST 1025 |
Referenced by vlc_getaddrinfo().
| #define NI_MAXNUMERICHOST 64 |
Referenced by net_GetPeerAddress(), net_GetSockAddress(), Open(), OpenRTCP(), RtspCallback(), RtspCallbackES(), RtspHandler(), Run(), and SDPGenerate().
| #define NI_MAXSERV 32 |
| #define NI_NAMEREQD 0x08 |
Referenced by stub_getnameinfo().
| #define NI_NOFQDN 0x04 |
| #define NI_NUMERICHOST 0x01 |
Referenced by AddressToSDP(), net_GetPeerAddress(), net_GetSockAddress(), ParseConnection(), stub_getnameinfo(), and vlc_inet_ntop().
| #define NI_NUMERICSERV 0x02 |
Referenced by vlc_getnameinfo().
| #define poll | ( | a, | |||
| b, | |||||
| c | ) | vlc_poll(a, b, c) |
Referenced by __net_Connect(), __net_Read(), __net_Write(), AccessRead(), AccessReadStream(), ALSAFill(), Block(), BlockScan(), Demux(), fd_dead(), net_Accept(), NetFillBuffer(), Read(), Run(), Thread(), and TPDURecv().
| int __net_Connect | ( | vlc_object_t * | p_this, | |
| const char * | psz_host, | |||
| int | i_port, | |||
| int | socktype, | |||
| int | protocol | |||
| ) |
References addrinfo::ai_addr, addrinfo::ai_addrlen, addrinfo::ai_family, addrinfo::ai_flags, addrinfo::ai_next, AI_NUMERICHOST, addrinfo::ai_protocol, addrinfo::ai_socktype, pollfd::fd, msg_Dbg, msg_Err, msg_Warn, net_Close, net_errno, net_Socket(), poll, POLLIN, POLLOUT, pollfd::revents, SocksHandshakeTCP(), var_CreateGetInteger, var_CreateGetNonEmptyString, vlc_freeaddrinfo(), vlc_gai_strerror(), vlc_getaddrinfo(), and vlc_object_waitpipe().
Referenced by __net_ConnectTCP().
| int __net_ConnectDgram | ( | vlc_object_t * | p_this, | |
| const char * | psz_host, | |||
| int | i_port, | |||
| int | hlim, | |||
| int | proto | |||
| ) |
References addrinfo::ai_addr, addrinfo::ai_addrlen, addrinfo::ai_family, addrinfo::ai_next, addrinfo::ai_protocol, addrinfo::ai_socktype, msg_Dbg, msg_Err, msg_Warn, net_Close, net_SetDSCP(), net_SetMcastHopLimit(), net_SetMcastOut(), net_Socket(), gen_builder::str, var_CreateGetInteger, var_CreateGetNonEmptyString, vlc_freeaddrinfo(), vlc_gai_strerror(), and vlc_getaddrinfo().
| static int __net_ConnectTCP | ( | vlc_object_t * | obj, | |
| const char * | host, | |||
| int | port | |||
| ) | [inline, static] |
References __net_Connect().
| char* __net_Gets | ( | vlc_object_t * | p_this, | |
| int | fd, | |||
| const v_socket_t * | p_vs | |||
| ) |
Reads a line from a file descriptor.
This function is not thread-safe; the same file descriptor cI/O annot be read by another thread at the same time (although it can be written to).
References net_Read.
| int __net_OpenDgram | ( | vlc_object_t * | p_this, | |
| const char * | psz_bind, | |||
| int | i_bind, | |||
| const char * | psz_server, | |||
| int | i_server, | |||
| int | family, | |||
| int | proto | |||
| ) |
References addrinfo::ai_addr, addrinfo::ai_addrlen, addrinfo::ai_family, addrinfo::ai_flags, addrinfo::ai_next, AI_PASSIVE, addrinfo::ai_protocol, addrinfo::ai_socktype, msg_Dbg, msg_Err, net_Close, net_ListenSingle(), net_SetupDgramSocket(), net_SockAddrIsMulticast(), net_Socket(), net_SourceSubscribe(), vlc_freeaddrinfo(), vlc_gai_strerror(), and vlc_getaddrinfo().
| ssize_t __net_Read | ( | vlc_object_t * | p_this, | |
| int | fd, | |||
| const v_socket_t * | , | |||
| void * | p_data, | |||
| size_t | i_data, | |||
| bool | b_retry | |||
| ) |
| ssize_t __net_vaPrintf | ( | vlc_object_t * | p_this, | |
| int | fd, | |||
| const v_socket_t * | , | |||
| const char * | psz_fmt, | |||
| va_list | args | |||
| ) |
References __net_Write(), and vasprintf().
| ssize_t __net_Write | ( | vlc_object_t * | p_this, | |
| int | fd, | |||
| const v_socket_t * | , | |||
| const void * | p_data, | |||
| size_t | i_data | |||
| ) |
| int net_Accept | ( | vlc_object_t * | p_this, | |
| int * | pi_fd | |||
| ) |
Accepts an new connection on a set of listening sockets.
If there are no pending connections, this function will wait.
| p_this | VLC object for logging and object kill signal | |
| pi_fd | listening socket set |
References pollfd::events, pollfd::fd, i, msg_Err, net_AcceptSingle(), net_errno, poll, POLLIN, pollfd::revents, and vlc_object_waitpipe().
| int net_AcceptSingle | ( | vlc_object_t * | obj, | |
| int | lfd | |||
| ) |
References pollfd::fd, msg_Dbg, msg_Err, net_errno, and net_SetupSocket().
Referenced by net_Accept(), and Run().
| static int net_ConnectUDP | ( | vlc_object_t * | obj, | |
| const char * | host, | |||
| int | port, | |||
| int | hlim | |||
| ) | [inline, static] |
| static int net_GetPeerAddress | ( | int | fd, | |
| char * | address, | |||
| int * | port | |||
| ) | [inline, static] |
References NI_MAXNUMERICHOST, NI_NUMERICHOST, VLC_EGENERIC, and vlc_getnameinfo().
Referenced by Connect(), httpd_ClientModeBidir(), Open(), and OpenRTCP().
| static uint16_t net_GetPort | ( | const struct sockaddr * | addr | ) | [inline, static] |
| static int net_GetSockAddress | ( | int | fd, | |
| char * | address, | |||
| int * | port | |||
| ) | [inline, static] |
References NI_MAXNUMERICHOST, NI_NUMERICHOST, VLC_EGENERIC, and vlc_getnameinfo().
Referenced by httpd_ClientIP(), MMSOpen(), Open(), OpenRTCP(), and RtspHandler().
| int* net_Listen | ( | vlc_object_t * | p_this, | |
| const char * | psz_host, | |||
| int | i_port, | |||
| int | protocol | |||
| ) |
| void net_ListenClose | ( | int * | fd | ) |
References net_Close.
Referenced by Deactivate(), httpd_TLSHostNew(), Open(), and vlclua_net_listen_close().
| static int net_ListenUDP1 | ( | vlc_object_t * | obj, | |
| const char * | host, | |||
| int | port | |||
| ) | [inline, static] |
| ssize_t net_Printf | ( | vlc_object_t * | p_this, | |
| int | fd, | |||
| const v_socket_t * | , | |||
| const char * | psz_fmt, | |||
| ... | ||||
| ) |
References net_vaPrintf.
Referenced by AuthReply(), Describe(), ftp_SendCommand(), OpenConnection(), Request(), RtspWrite(), Run(), SendRequest(), Start(), and WriteAuxHeaders().
| int net_SetCSCov | ( | int | fd, | |
| int | sendcov, | |||
| int | recvcov | |||
| ) |
net_SetCSCov: Sets the send and receive checksum coverage of a socket:
| fd | socket | |
| sendcov | payload coverage of sent packets (bytes), -1 for full | |
| recvcov | minimum payload coverage of received packets, -1 for full |
References SOL_DCCP, SOL_UDPLITE, VLC_EGENERIC, VLC_SUCCESS, and VLC_UNUSED.
Referenced by Open().
| static void net_SetPort | ( | struct sockaddr * | addr, | |
| uint16_t | port | |||
| ) | [inline, static] |
Referenced by ParseSDP().
| int net_SetupSocket | ( | int | fd | ) |
Referenced by net_AcceptSingle(), and net_Socket().
| static bool net_SockAddrIsMulticast | ( | const struct sockaddr * | addr, | |
| socklen_t | len | |||
| ) | [inline, static] |
Referenced by __net_OpenDgram(), AddressToSDP(), net_Listen(), net_ListenSingle(), and net_SetupDgramSocket().
| int net_Socket | ( | vlc_object_t * | obj, | |
| int | family, | |||
| int | socktype, | |||
| int | proto | |||
| ) |
References IPPROTO_IPV6, msg_Err, net_errno, net_SetupSocket(), SOL_DCCP, and var_CreateGetNonEmptyString.
Referenced by __net_Connect(), __net_ConnectDgram(), __net_OpenDgram(), net_Listen(), and net_ListenSingle().
| int net_Subscribe | ( | vlc_object_t * | obj, | |
| int | fd, | |||
| const struct sockaddr * | addr, | |||
| socklen_t | addrlen | |||
| ) |
References net_SourceSubscribe().
Referenced by net_Listen(), net_ListenSingle(), and net_SourceSubscribe().
| void vlc_freeaddrinfo | ( | struct addrinfo * | ) |
| const char* vlc_gai_strerror | ( | int | ) |
References code, gai_errlist, gai_unknownerr, and i.
Referenced by __net_Connect(), __net_ConnectDgram(), __net_OpenDgram(), net_Listen(), and net_ListenSingle().
| int vlc_getaddrinfo | ( | vlc_object_t * | p_this, | |
| const char * | node, | |||
| int | i_port, | |||
| const struct addrinfo * | p_hints, | |||
| struct addrinfo ** | res | |||
| ) |
Resolves a host name to a list of socket addresses (like getaddrinfo()).
| p_this | a VLC object | |
| node | host name to resolve (encoded as UTF-8), or NULL | |
| i_port | port number for the socket addresses | |
| p_hints | parameters (see getaddrinfo() manual page) | |
| res | pointer set to the resulting chained list. |
References AF_UNSPEC, AI_CANONNAME, addrinfo::ai_family, addrinfo::ai_flags, AI_NUMERICHOST, AI_NUMERICSERV, AI_PASSIVE, addrinfo::ai_protocol, addrinfo::ai_socktype, EAI_BADFLAGS, EAI_SERVICE, LocaleFree(), msg_Err, NI_MAXHOST, ToLocale(), and var_CreateGetBool.
Referenced by __net_Connect(), __net_ConnectDgram(), __net_OpenDgram(), ACL_Resolve(), net_Listen(), net_ListenSingle(), SocksHandshakeTCP(), and sout_AnnounceRegisterSDP().
| int vlc_getnameinfo | ( | const struct sockaddr * | , | |
| int | , | |||
| char * | , | |||
| int | , | |||
| int * | , | |||
| int | ||||
| ) |
References NI_NUMERICSERV.
Referenced by AddressToSDP(), net_GetPeerAddress(), net_GetSockAddress(), and ParseConnection().
| const char* vlc_inet_ntop | ( | int | af, | |
| const void * | src, | |||
| char * | dst, | |||
| socklen_t | cnt | |||
| ) |
| int vlc_inet_pton | ( | int | af, | |
| const char * | src, | |||
| void * | dst | |||
| ) |
| int vlc_poll | ( | struct pollfd * | fds, | |
| unsigned | nfds, | |||
| int | timeout | |||
| ) |
References pollfd::fd, i, POLLIN, POLLOUT, POLLPRI, pollfd::revents, and vlc_testcancel().
1.5.6