XSocket API  2.0
XIA Socket Library
Macros | Functions
XupdateDAG.c File Reference

Implements XreadLocalHostAddr() More...

#include <errno.h>
#include "Xsocket.h"
#include "Xinit.h"
#include "Xutil.h"

Macros

#define MAX_RV_DAG_SIZE   1024
 

Functions

int XupdateDAG (int sockfd, int interface, const char *rdag, const char *r4id)
 update the DAG for an interface More...
 
int XupdateRV (int sockfd, int interface)
 update the rendezvous service of our new address More...
 
int XreadLocalHostAddr (int sockfd, char *localhostDAG, unsigned lenDAG, char *local4ID, unsigned len4ID)
 retrieve the DAG and 4ID associated with this socket. More...
 
int XisDualStackRouter (int sockfd)
 

Macro Definition Documentation

#define MAX_RV_DAG_SIZE   1024

Function Documentation

int XisDualStackRouter ( int  sockfd)
int XreadLocalHostAddr ( int  sockfd,
char *  localhostDAG,
unsigned  lenDAG,
char *  local4ID,
unsigned  len4ID 
)

The DAG and 4ID assigned by the XIA stack. This call retrieves them so that they can be used for creating DAGs or for other purposes in user applications.

Parameters
sockfdan Xsocket (may be of any type XSOCK_STREAM, etc...)
localhostDAGbuffer to receive the default DAG for this host
lenDAGsize of the localhostDAG buffer
local4IDbuffer to receive 4ID for this host (if known)
len4IDsize of the 4ID buffer
Returns
0 on success
-1 on failure with errno set
int XupdateDAG ( int  sockfd,
int  interface,
const char *  rdag,
const char *  r4id 
)

Each interface has a DAG associated with it. This API allows a user space application to change the DAG for a given interface

Parameters
sockfda previously allocated Xsocket
interfacethe interface whose DAG needs to be changed
rdagthe router's DAG
r4idthe router's 4ID
Returns
-1 on failure
0 on success
int XupdateRV ( int  sockfd,
int  interface 
)

When we join a new network, if there is a rendezvous service associated with the interface that migrated, we send a notification to the service of our new address.

Todo:
require feedback response from the rendezvous service control plane

This is a one time message with no feedback. So if the message is lost the rendezvous service won't be able to forward packets.

Parameters
sockfda previously created XSocket
interfacethe interface that just joined a new network or came up
Returns
0 on success
-1 on failure