mUPnP for C
|
#include <mupnp/net/interface.h>
#include <mupnp/net/socket.h>
#include <mupnp/util/time.h>
#include <mupnp/util/log.h>
#include <string.h>
#include <errno.h>
#include <arpa/inet.h>
#include <fcntl.h>
#include <netdb.h>
#include <netinet/in.h>
#include <signal.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
Macros | |
#define | mupnp_socket_getrawtype(socket) |
#define | MUPNP_NET_SOCKET_SEND_RETRY_CNT 10 |
#define | MUPNP_NET_SOCKET_SEND_RETRY_WAIT_MSEC 20 |
Functions | |
bool | mupnp_socket_tosockaddrin (const char *addr, int port, struct sockaddr_in *sockaddr, bool isBindAddr) |
bool | mupnp_socket_tosockaddrinfo (int sockType, const char *addr, int port, struct addrinfo **addrInfo, bool isBindAddr) |
void | mupnp_socket_startup () |
void | mupnp_socket_cleanup () |
mUpnpSocket * | mupnp_socket_new (int type) |
bool | mupnp_socket_delete (mUpnpSocket *sock) |
bool | mupnp_socket_isbound (mUpnpSocket *sock) |
void | mupnp_socket_setid (mUpnpSocket *socket, SOCKET value) |
bool | mupnp_socket_close (mUpnpSocket *sock) |
bool | mupnp_socket_listen (mUpnpSocket *sock) |
bool | mupnp_socket_bind (mUpnpSocket *sock, int bindPort, const char *bindAddr, bool bindFlag, bool reuseFlag) |
bool | mupnp_socket_accept (mUpnpSocket *serverSock, mUpnpSocket *clientSock) |
bool | mupnp_socket_connect (mUpnpSocket *sock, const char *addr, int port) |
ssize_t | mupnp_socket_read (mUpnpSocket *sock, char *buffer, size_t bufferLen) |
size_t | mupnp_socket_write (mUpnpSocket *sock, const char *cmd, size_t cmdLen) |
ssize_t | mupnp_socket_readline (mUpnpSocket *sock, char *buffer, size_t bufferLen) |
size_t | mupnp_socket_skip (mUpnpSocket *sock, size_t skipLen) |
size_t | mupnp_socket_sendto (mUpnpSocket *sock, const char *addr, int port, const char *data, size_t dataLen) |
ssize_t | mupnp_socket_recv (mUpnpSocket *sock, mUpnpDatagramPacket *dgmPkt) |
bool | mupnp_socket_setreuseaddress (mUpnpSocket *sock, bool flag) |
bool | mupnp_socket_setmulticastttl (mUpnpSocket *sock, int ttl) |
bool | mupnp_socket_settimeout (mUpnpSocket *sock, int sec) |
bool | mupnp_socket_joingroup (mUpnpSocket *sock, const char *mcastAddr, const char *ifAddr) |
Variables | |
static int | socketCnt = 0 |
#define MUPNP_NET_SOCKET_SEND_RETRY_CNT 10 |
#define MUPNP_NET_SOCKET_SEND_RETRY_WAIT_MSEC 20 |
#define mupnp_socket_getrawtype | ( | socket | ) |
bool mupnp_socket_accept | ( | mUpnpSocket * | serverSock, |
mUpnpSocket * | clientSock ) |
bool mupnp_socket_bind | ( | mUpnpSocket * | sock, |
int | bindPort, | ||
const char * | bindAddr, | ||
bool | bindFlag, | ||
bool | reuseFlag ) |
void mupnp_socket_cleanup | ( | void | ) |
bool mupnp_socket_close | ( | mUpnpSocket * | sock | ) |
bool mupnp_socket_connect | ( | mUpnpSocket * | sock, |
const char * | addr, | ||
int | port ) |
bool mupnp_socket_delete | ( | mUpnpSocket * | sock | ) |
bool mupnp_socket_isbound | ( | mUpnpSocket * | sock | ) |
bool mupnp_socket_joingroup | ( | mUpnpSocket * | sock, |
const char * | mcastAddr, | ||
const char * | ifAddr ) |
bool mupnp_socket_listen | ( | mUpnpSocket * | sock | ) |
mUpnpSocket * mupnp_socket_new | ( | int | type | ) |
ssize_t mupnp_socket_read | ( | mUpnpSocket * | sock, |
char * | buffer, | ||
size_t | bufferLen ) |
ssize_t mupnp_socket_readline | ( | mUpnpSocket * | sock, |
char * | buffer, | ||
size_t | bufferLen ) |
ssize_t mupnp_socket_recv | ( | mUpnpSocket * | sock, |
mUpnpDatagramPacket * | dgmPkt ) |
size_t mupnp_socket_sendto | ( | mUpnpSocket * | sock, |
const char * | addr, | ||
int | port, | ||
const char * | data, | ||
size_t | dataLen ) |
void mupnp_socket_setid | ( | mUpnpSocket * | socket, |
SOCKET | value ) |
bool mupnp_socket_setmulticastttl | ( | mUpnpSocket * | sock, |
int | ttl ) |
bool mupnp_socket_setreuseaddress | ( | mUpnpSocket * | sock, |
bool | flag ) |
bool mupnp_socket_settimeout | ( | mUpnpSocket * | sock, |
int | sec ) |
size_t mupnp_socket_skip | ( | mUpnpSocket * | sock, |
size_t | skipLen ) |
void mupnp_socket_startup | ( | void | ) |
bool mupnp_socket_tosockaddrin | ( | const char * | addr, |
int | port, | ||
struct sockaddr_in * | sockaddr, | ||
bool | isBindAddr ) |
bool mupnp_socket_tosockaddrinfo | ( | int | sockType, |
const char * | addr, | ||
int | port, | ||
struct addrinfo ** | addrInfo, | ||
bool | isBindAddr ) |
size_t mupnp_socket_write | ( | mUpnpSocket * | sock, |
const char * | cmd, | ||
size_t | cmdLen ) |
|
static |