NUTSS Socket API


Data Structures

struct  sockaddr_ns

Typedefs

typedef enum nutss_configopt nutss_configopt_t

Enumerations

enum  nutss_configopt {
  NUTSS_CONFIG_USERNAME = 0x00, NUTSS_CONFIG_DOMAINNAME, NUTSS_CONFIG_PROXYUSERNAME, NUTSS_CONFIG_PROXYPASSWORD,
  NUTSS_CONFIG_SVCUSERNAME, NUTSS_CONFIG_SVCDOMAINNAME, NUTSS_CONFIG_SIGPROXY = 0x20, NUTSS_CONFIG_REGINTERVAL,
  NUTSS_CONFIG_SSLCONTEXT, NUTSS_CONFIG_OPT_DEBUG = 0x40, NUTSS_CONFIG_OPT_BIND, NUTSS_CONFIG_OPT_TRANSPORT,
  NUTSS_CONFIG_OPT_STUNT, NUTSS_CONFIG_OPT_STUNTD, NUTSS_CONFIG_OPT_TURN, NUTSS_CONFIG_OPT_TURND,
  NUTSS_CONFIG_OPT_SWAPLINKS, NUTSS_CONFIG_OPT_SWAPLINKSD, NUTSS_CONFIG_OPT_XAUTHCLIENT, NUTSS_CONFIG_OPT_XAUTHSERVER,
  NUTSS_CONFIG_OPT_SECURE = 0x60, NUTSS_CONFIG_OPT_SIGTCP, NUTSS_CONFIG_OPT_PERSIST
}

Functions

int inet_uton (struct sockaddr_ns *sns, const char *uri)
 Decode a string-encoded URI to a NUTSS address.
char * inet_ntou (int af, const struct sockaddr_ns *sns, char *uri, socklen_t cnt)
 Encodes a NUTSS address as a string.
int nutss_init (void)
 Initializes NUTSS.
int nutss_shutdown (void)
 Shuts down NUTSS.
int nutss_config_set (nutss_configopt_t prop, void *ptr, size_t size)
 Sets a NUTSS config.
int nutss_config_get (nutss_configopt_t prop, void *ptr, size_t size)
 Retrieves a NUTSS config.
int nutss_bind (int s, const struct sockaddr *my_addr, socklen_t addrlen)
 Bind to a NUTSS address. Called from application thread context.
int nutss_connect (int s, const struct sockaddr *serv_addr, socklen_t addrlen)
 Connect to a NUTSS address. Called from application thread context.
int nutss_accept (int s, struct sockaddr *addr, socklen_t *addrlen)
 Accept a socket.
int nutss_getpeername (int s, struct sockaddr *addr, socklen_t *addrlen)
 Get remote peername.

Typedef Documentation

typedef enum nutss_configopt nutss_configopt_t

Configuration options


Enumeration Type Documentation

enum nutss_configopt

Configuration options

Enumerator:
NUTSS_CONFIG_USERNAME  Default endpoint username. set(char *), get(char *)
NUTSS_CONFIG_DOMAINNAME  Default endpoint domainname. set(char *), get(char *)
NUTSS_CONFIG_PROXYUSERNAME  Authentication username at proxy. set(char *), get(char *)
NUTSS_CONFIG_PROXYPASSWORD  Authentication password at proxy. set(char *), get(char *)
NUTSS_CONFIG_SVCUSERNAME  Service endpoint username. set(char *), get(char *)
NUTSS_CONFIG_SVCDOMAINNAME  Service endpoint domainname. set(char *), get(char *)
NUTSS_CONFIG_SIGPROXY  Proxy address and port. set(char *), get(char *)
NUTSS_CONFIG_REGINTERVAL  Registration interval in seconds. set(int *), get()
NUTSS_CONFIG_SSLCONTEXT  Initialized SSL context. set(SSL_CTX *), get(SSL_CTX **)
NUTSS_CONFIG_OPT_DEBUG  Enable or disable debugging. set(int *), get()
NUTSS_CONFIG_OPT_BIND  Enable or disable bind extension. set(int *), get()
NUTSS_CONFIG_OPT_TRANSPORT  Enable or disable transport extension. set(int *), get()
NUTSS_CONFIG_OPT_STUNT  Enable or disable STUNT client. set(int *), get()
NUTSS_CONFIG_OPT_STUNTD  Enable or disable STUNT server. set(int *), get()
NUTSS_CONFIG_OPT_TURN  Enable or disable TURN client. set(int *), get()
NUTSS_CONFIG_OPT_TURND  Enable or disable TURN server. set(int *), get()
NUTSS_CONFIG_OPT_SWAPLINKS  Enable or disable swaplinks client. set(int *), get()
NUTSS_CONFIG_OPT_SWAPLINKSD  Enable or disable Swaplinks registrar. set(int *), get()
NUTSS_CONFIG_OPT_XAUTHCLIENT  Enable or disable Xauth client. set(int *), get()
NUTSS_CONFIG_OPT_XAUTHSERVER  Enable or disable Xauth server. Must be linked with a xserver. set(int *), get()
NUTSS_CONFIG_OPT_SECURE  Enable or disable secure connections. set(int *), get()
NUTSS_CONFIG_OPT_SIGTCP  Enable or disable TCP signaling. set(int *), get()
NUTSS_CONFIG_OPT_PERSIST  Enable or disable persistant TCP. set(int *), get()


Function Documentation

char* inet_ntou ( int  af,
const struct sockaddr_ns sns,
char *  uri,
socklen_t  cnt 
)

Encodes a NUTSS address as a string.

Parameters:
af AF_NUTSS
sns NUTSS address
uri buffer
cnt buffer length
Returns:
0 on success, -1 on failure

int inet_uton ( struct sockaddr_ns sns,
const char *  uri 
)

Decode a string-encoded URI to a NUTSS address.

Parameters:
sns NUTSS address
uri string of the form user@domain;uuid=abc;service=xyz
Returns:
0 on success, -1 on failure

int nutss_accept ( int  s,
struct sockaddr *  addr,
socklen_t *  addrlen 
)

Accept a socket.

Parameters:
s listen mode socket
addr remote address
addrlen address length
Returns:
accepted socket on success, -1 on failure

int nutss_bind ( int  s,
const struct sockaddr *  my_addr,
socklen_t  addrlen 
)

Bind to a NUTSS address. Called from application thread context.

Parameters:
s socket
my_addr local address
addrlen address length
Returns:
0 on success, -1 on failure

int nutss_config_get ( nutss_configopt_t  prop,
void *  ptr,
size_t  size 
)

Retrieves a NUTSS config.

Parameters:
prop name of property
ptr buffer
size length of buffer
Returns:
0 or 1 for boolean properties; 0 on success for other properties, -1 on failure

int nutss_config_set ( nutss_configopt_t  prop,
void *  ptr,
size_t  size 
)

Sets a NUTSS config.

Parameters:
prop name of property
ptr buffer
size length of buffer
Returns:
0 on success, -1 on failure

int nutss_connect ( int  s,
const struct sockaddr *  serv_addr,
socklen_t  addrlen 
)

Connect to a NUTSS address. Called from application thread context.

Parameters:
s socket
serv_addr remote address
addrlen address length
Returns:
0 on success, -1 on failure

int nutss_getpeername ( int  s,
struct sockaddr *  addr,
socklen_t *  addrlen 
)

Get remote peername.

Parameters:
s connected socket
addr peer address
addrlen address length
Returns:
0 on success, -1 on failure

int nutss_init ( void   ) 

Initializes NUTSS.

Returns:
0 on success, -1 on failure

int nutss_shutdown ( void   ) 

Shuts down NUTSS.

This call may block until all connections are cleanly shutdown.

Returns:
0 on success, -1 on failure


Generated on Sun Apr 29 06:52:04 2007 for nutss-0.1.0 by  doxygen 1.5.2