VLC  3.0.0-git
Modules | Files | Macros | Functions
Collaboration diagram for Networking:

Modules

 Internet sockets
 
 Transport layer sockets
 Network stream abstraction.
 

Files

file  vlc_network.h
 Definitions for sockets and low-level networking.
 

Macros

#define NI_MAXNUMERICHOST   64
 
#define AI_NUMERICSERV   0
 
#define AI_IDN   0 /* GNU/libc extension */
 

Functions

int vlc_getnameinfo (const struct sockaddr *, int, char *, int, int *, int)
 
int vlc_getaddrinfo (const char *, unsigned, const struct addrinfo *, struct addrinfo **)
 Resolves a host name to a list of socket addresses (like getaddrinfo()). More...
 
int vlc_getaddrinfo_i11e (const char *, unsigned, const struct addrinfo *, 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)
 
char * vlc_getProxyUrl (const char *)
 Determines the network proxy server to use (if any). More...
 

Detailed Description

Macro Definition Documentation

◆ AI_IDN

#define AI_IDN   0 /* GNU/libc extension */

◆ AI_NUMERICSERV

#define AI_NUMERICSERV   0

◆ NI_MAXNUMERICHOST

#define NI_MAXNUMERICHOST   64

Function Documentation

◆ net_GetPeerAddress()

static int net_GetPeerAddress ( int  fd,
char *  address,
int *  port 
)
inlinestatic

< Unspecified error

References NI_MAXNUMERICHOST, VLC_EGENERIC, and vlc_getnameinfo().

Referenced by httpd_ClientIP().

◆ net_GetPort()

static uint16_t net_GetPort ( const struct sockaddr *  addr)
inlinestatic

◆ net_GetSockAddress()

static int net_GetSockAddress ( int  fd,
char *  address,
int *  port 
)
inlinestatic

< Unspecified error

References NI_MAXNUMERICHOST, VLC_EGENERIC, and vlc_getnameinfo().

Referenced by httpd_ServerIP().

◆ net_SetPort()

static void net_SetPort ( struct sockaddr *  addr,
uint16_t  port 
)
inlinestatic

References VLC_API, and vlc_getProxyUrl().

◆ net_SockAddrIsMulticast()

static bool net_SockAddrIsMulticast ( const struct sockaddr *  addr,
socklen_t  len 
)
inlinestatic

◆ vlc_getaddrinfo()

int vlc_getaddrinfo ( const char *  node,
unsigned  port,
const struct addrinfo *  hints,
struct addrinfo **  res 
)

Resolves a host name to a list of socket addresses (like getaddrinfo()).

Parameters
nodehost name to resolve (encoded as UTF-8), or NULL
i_portport number for the socket addresses
p_hintsparameters (see getaddrinfo() manual page)
respointer set to the resulting chained list.
Returns
0 on success, a getaddrinfo() error otherwise. On failure, *res is undefined. On success, it must be freed with freeaddrinfo().

References getaddrinfo(), vlc_getaddrinfo(), and vlc_getaddrinfo_i11e().

Referenced by net_ConnectDgram(), net_Listen(), net_ListenSingle(), net_OpenDgram(), sout_AnnounceRegisterSDP(), and vlc_getaddrinfo().

◆ vlc_getaddrinfo_i11e()

int vlc_getaddrinfo_i11e ( const char *  ,
unsigned  ,
const struct addrinfo *  ,
struct addrinfo **   
)

◆ vlc_getnameinfo()

int vlc_getnameinfo ( const struct sockaddr *  ,
int  ,
char *  ,
int  ,
int *  ,
int   
)

◆ vlc_getProxyUrl()

char* vlc_getProxyUrl ( const char *  url)

Determines the network proxy server to use (if any).

This function fetch the Android proxy using the System.getProperty() method with "http.proxyHost" and "http.proxyPort" keys. This is working only for Android 4.0 and after.

Parameters
urlabsolute URL for which to get the proxy server (unused)
Returns
proxy URL, NULL if no proxy or error
Parameters
urlabsolute URL for which to get the proxy server (not used)
Returns
proxy URL, NULL if no proxy or error
Parameters
urlabsolute URL for which to get the proxy server
Returns
proxy URL, NULL if no proxy or error

References asprintf(), environ, fields, get_env(), getenv(), release_env(), strdup(), vlc_close(), vlc_pipe(), and VLC_UNUSED.

Referenced by net_SetPort(), and vlc_http_proxy_find().