libgpac
Documentation of the core library of GPAC
|
#include <unistd.h>
#include <fcntl.h>
#include <netdb.h>
#include <errno.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <gpac/network.h>
Data Structures | |
struct | GF_Socket |
abstracted socket object More... | |
Macros | |
#define | INVALID_SOCKET -1 |
#define | SOCKET_ERROR -1 |
#define | LASTSOCKERROR errno |
#define | closesocket(v) close(v) |
#define | SSO_CAST (const char *) |
#define | SOCK_MICROSEC_WAIT 500 |
Typedefs | |
typedef s32 | SOCKET |
Enumerations | |
enum | { GF_SOCK_IS_TCP = 1<<9 , GF_SOCK_IS_IPV6 = 1<<10 , GF_SOCK_NON_BLOCKING = 1<<11 , GF_SOCK_IS_MULTICAST = 1<<12 , GF_SOCK_IS_LISTENING = 1<<13 , GF_SOCK_HAS_SOURCE = 1<<14 } |
Functions | |
void | gf_net_get_ntp (u32 *sec, u32 *frac) |
gets NTP time More... | |
u32 | gf_net_has_ipv6 () |
gets ipv6 support More... | |
GF_Err | gf_sk_get_host_name (char *buffer) |
get local host name More... | |
GF_Err | gf_sk_get_local_ip (GF_Socket *sock, char *buffer) |
get local IP More... | |
GF_Socket * | gf_sk_new (u32 SocketType) |
socket constructor More... | |
GF_Err | gf_sk_set_buffer_size (GF_Socket *sock, Bool SendBuffer, u32 NewSize) |
socket buffer size control More... | |
GF_Err | gf_sk_set_block_mode (GF_Socket *sock, u32 NonBlockingOn) |
static void | gf_sk_gf_free (GF_Socket *sock) |
void | gf_sk_del (GF_Socket *sock) |
socket destructor More... | |
void | gf_sk_reset (GF_Socket *sock) |
reset internal buffer More... | |
s32 | gf_sk_get_handle (GF_Socket *sock) |
gets socket handle More... | |
GF_Err | gf_sk_connect (GF_Socket *sock, char *PeerName, u16 PortNumber, char *local_ip) |
GF_Err | gf_sk_bind (GF_Socket *sock, char *local_ip, u16 port, char *peer_name, u16 peer_port, u32 options) |
GF_Err | gf_sk_send (GF_Socket *sock, char *buffer, u32 length) |
GF_EXPORT u32 | gf_sk_is_multicast_address (char *multi_IPAdd) |
GF_Err | gf_sk_setup_multicast (GF_Socket *sock, char *multi_IPAdd, u16 MultiPortNumber, u32 TTL, Bool NoBind, char *local_interface_ip) |
GF_Err | gf_sk_receive (GF_Socket *sock, char *buffer, u32 length, u32 startFrom, u32 *BytesRead) |
GF_Err | gf_sk_listen (GF_Socket *sock, u32 MaxConnection) |
socket listening More... | |
GF_Err | gf_sk_accept (GF_Socket *sock, GF_Socket **newConnection) |
socket accept More... | |
GF_Err | gf_sk_get_local_info (GF_Socket *sock, u16 *Port, u32 *Familly) |
get local info More... | |
GF_Err | gf_sk_server_mode (GF_Socket *sock, Bool serverOn) |
server socket mode More... | |
GF_Err | gf_sk_get_remote_address (GF_Socket *sock, char *buf) |
get remote address More... | |
GF_Err | gf_sk_send_to (GF_Socket *sock, char *buffer, u32 length, char *remoteHost, u16 remotePort) |
GF_Err | gf_sk_receive_wait (GF_Socket *sock, char *buffer, u32 length, u32 startFrom, u32 *BytesRead, u32 Second) |
GF_Err | gf_sk_send_wait (GF_Socket *sock, char *buffer, u32 length, u32 Second) |
struct __tag_socket |
The abstracted socket object allows you to build client and server applications very simply with support for unicast and multicast Available tools are socket and socket groups and some helper functions for network time
Data Fields | ||
---|---|---|
u32 | flags | |
SOCKET | socket | |
struct sockaddr_in | dest_addr | |
u32 | dest_addr_len | |
u32 | usec_wait | |
NetCapInfo * | cap_info |
#define INVALID_SOCKET -1 |
#define SOCKET_ERROR -1 |
#define LASTSOCKERROR errno |
#define closesocket | ( | v | ) | close(v) |
#define SSO_CAST (const char *) |
#define SOCK_MICROSEC_WAIT 500 |
anonymous enum |
|
static |
GF_Err gf_sk_bind | ( | GF_Socket * | sock, |
char * | local_ip, | ||
u16 | port, | ||
char * | peer_name, | ||
u16 | peer_port, | ||
u32 | options | ||
) |
GF_Err gf_sk_setup_multicast | ( | GF_Socket * | sock, |
char * | multi_IPAdd, | ||
u16 | MultiPortNumber, | ||
u32 | TTL, | ||
Bool | NoBind, | ||
char * | local_interface_ip | ||
) |
GF_Err gf_sk_receive | ( | GF_Socket * | sock, |
char * | buffer, | ||
u32 | length, | ||
u32 | startFrom, | ||
u32 * | BytesRead | ||
) |
GF_Err gf_sk_send_to | ( | GF_Socket * | sock, |
char * | buffer, | ||
u32 | length, | ||
char * | remoteHost, | ||
u16 | remotePort | ||
) |
GF_Err gf_sk_receive_wait | ( | GF_Socket * | sock, |
char * | buffer, | ||
u32 | length, | ||
u32 | startFrom, | ||
u32 * | BytesRead, | ||
u32 | Second | ||
) |