MobilityFirst's API.
More...
Go to the source code of this file.
|
int | mfopen (struct Handle *h, const char *profile, mfflag_t opts, const int src_GUID) |
|
int | mfsend (struct Handle *h, void *buffer, u_int size, const int dst_GUID, mfflag_t opts) |
|
int | mfrecv (struct Handle *h, int *sGUID, void *buffer, u_int size, const int *src_GUID, const int n_GUID) |
|
int | mfrecv_blk (struct Handle *h, int *sGUID, void *buffer, u_int size, const int *src_GUID, const int n_GUID) |
|
int | mfattach (struct Handle *h, const int *GUIDs, const int nGUID) |
|
int | mfdetach (struct Handle *h, const int *GUIDs, const int nGUID) |
|
int | mfget (struct Handle *h, void *request, u_int bufSize, void *buffer, u_int size, const char *opts) |
|
int | mfdo_get (struct Handle *h, const int *dst_GUID, void *request, u_int size) |
|
int | mfget_response (struct Handle *h, void *buffer, u_int size, const char *opts) |
|
int | mfclose (struct Handle *h) |
|
MobilityFirst's API.
- Author
- wontoniii (bronz.nosp@m.ino@.nosp@m.winla.nosp@m.b.ru.nosp@m.tgers.nosp@m..edu), czhang
- Date
- July, 2011 C/C++ MobilityFirst API. Used to communicate with MobilityFirst's network protocol stack
int mfattach |
( |
struct Handle * |
h, |
|
|
const int * |
GUIDs, |
|
|
const int |
nGUID |
|
) |
| |
The attach function provides the functionalities to add additional GUIDs at the the one originally identified during the open call. GUID-set represents the set of GUIDs that the application wants to add at the set that it is listening at.
- Parameters
-
h | Handle of the socket |
GUIDs | array of GUIDs to attach |
nGUID | number of GUIDs in the array |
- Returns
- 0 if completed succesfully, an error code otherwise
int mfclose |
( |
struct Handle * |
h | ) |
|
The close function shall close the session initiated with an open call and clear the resources that were allocated.
- Parameters
-
- Returns
- 0 if the socket was closed succesfully, an error code otherwise
int mfdetach |
( |
struct Handle * |
h, |
|
|
const int * |
GUIDs, |
|
|
const int |
nGUID |
|
) |
| |
The detach function shall provide a way of removing GUIDs form the one originally identified during the open call or the ones added through the use of "attach". GUID-set represents the set of GUIDs that the application wants to remove from the set that it is listening at.
- Parameters
-
h | Handle of the socket |
GUIDs | GUIDs array of GUIDs to detach |
nGUID | number of GUIDs in the array |
- Returns
- 0 if completed succesfully, an error code otherwise
int mfopen |
( |
struct Handle * |
h, |
|
|
const char * |
profile, |
|
|
mfflag_t |
opts, |
|
|
const int |
src_GUID |
|
) |
| |
The open function shall define the initialization of a communication session between the application layer and the underneath layers. On doing so the system is informed of the intent of the application and can choose the appropriate transportation service and initialize the needed resources.
- Parameters
-
h | Handle of the socket |
profile | Descriptive element (a string) that informs the system about the intent of the application |
opts | is optional are additional parameters that can be provided to request additional services expressed as flags. If no value is provided, the system will make the initialization based on the sole Profile |
src_GUID | is optional and represents the set of GUIDs that the application is willing of listening at. If no value is provided, the system should select the system default GUID identifier for the application. |
- Returns
- 0 if the socket was opened succesfully, an error code otherwise (look at error.h for error definitions)
int mfrecv |
( |
struct Handle * |
h, |
|
|
int * |
sGUID, |
|
|
void * |
buffer, |
|
|
u_int |
size, |
|
|
const int * |
src_GUID, |
|
|
const int |
n_GUID |
|
) |
| |
The recv operation shall write into the buffer passed the oldest not read message received. If no message is available then returns an error
- Parameters
-
h | Handle of the socket |
sGUID | pointer to GUID. If pointer is not NULL it will be written the GUID of the sender of the received message. |
buffer | Buffer used to pass the message to the application |
opts | Size of the provided buffer |
src_GUID | Array of source GUIDs to listen messages from. If NULL, any GUID is considered. |
n_GUID | Number of GUIDs passed with src_GUID |
- Returns
- The number of passed bytes if succesfully exectued, an error code otherwise
int mfrecv_blk |
( |
struct Handle * |
h, |
|
|
int * |
sGUID, |
|
|
void * |
buffer, |
|
|
u_int |
size, |
|
|
const int * |
src_GUID, |
|
|
const int |
n_GUID |
|
) |
| |
The recv operation shall write into the buffer passed the oldest not read message received. If no message is available then waits for a new message to be received.
- Parameters
-
h | Handle of the socket |
sGUID | pointer to GUID. If pointer is not NULL it will be written the GUID of the sender of the received message. |
buffer | Buffer used to pass the message to the application |
opts | Size of the provided buffer |
src_GUID | Array of source GUIDs to listen messages from. If NULL, any GUID is considered. |
n_GUID | Number of GUIDs passed with src_GUID |
- Returns
- The number of passed bytes if succesfully exectued, an error code otherwise
int mfsend |
( |
struct Handle * |
h, |
|
|
void * |
buffer, |
|
|
u_int |
size, |
|
|
const int |
dst_GUID, |
|
|
mfflag_t |
opts |
|
) |
| |
The send operation shall send data to a destination GUID as messages with no size limits except for the ones defined by system resources. The way the message is delivered to the entity defined by the GUID is determined by the session characteristics defined during the open call and eventually by additional service options.
- Parameters
-
h | Handle of the socket |
buffer | Data message to be sent |
size | Size of the message to be sent (smaller or equal to the size of buffer) |
dst_GUID | Destination GUID |
opts | Additional service options used to determine how the message is delivered expressed as flags |
- Returns
- The number of sent bytes if succesfully executed, an error code otherwise