Commit 5a2cc740 authored by Arne Øslebø's avatar Arne Øslebø

added documentation about management functions

git-svn-id: file:///home/svn/mapi/trunk@767 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 8e3e8cae
......@@ -311,6 +311,49 @@ the monitoring sensors in a round-robin way, if it is possible.
Finally, in order to terminate, cleanup and close a network flow the \textit{mapi\_close\_flow}
fucntion is used.
\section{Management function calls}
MAPI contains various management function calls that provides information about
a running MAPI daemon (MAPId). These function calls provides information about
available devices and libraries as well as active flows and functions applied to
The available function calls are:
int mapi_get_device_info(int devicenumber, mapi_device_info_t* info);
int mapi_get_next_device_info(int devicenumber, mapi_device_info_t* info);
int mapi_get_library_info(int libnum, mapi_lib_info_t *info);
int mapi_get_next_library_info(int libnum, mapi_lib_info_t* info);
int mapi_get_libfunct_info(int libnum, mapi_libfunct_info_t *info);
int mapi_get_libfunct_next_info(int libnum, mapi_libfunct_info_t *info);
int mapi_get_flow_info(int fd, mapi_flow_info_t *info);
int mapi_get_next_flow_info(int fd, mapi_flow_info_t *info);
int mapi_get_function_info(int fd, int fid, mapi_function_info_t *info);
int mapi_get_next_function_info(int fd, int fid, mapi_function_info_t *info);
The mapi\_get\_?\_info calls, retrieves information about one specific resource
identified by an integer ID. The mapi\_get\_next\_?\_info calls returns information
about the next resource with a hight ID than the one specified. This is used for
looping through all available resources.
The following code is an example on how the management functions can be used for listing all available libraries and the functions in each library:
\begin{Verbatim}[numbersep=12pt, numbers=left, baselinestretch=1.0, fontsize=\small]
int id=-1,fid;
mapi_lib_info_t info;
mapi_libfunct_info_t finfo;
printf("ID\tName\t# functions\n");
while(mapi_get_next_library_info(id++,&info)==0) {
This code uses mapi\_get\_next\_library\_info to loop through all available libraries and print out the id and name of the library and the number of functions. It then uses the mapi\_get\_next\_libfunct\_info to loop through and print information about all the available functions in each library.
MAPI is available from {\tt} as a source
......@@ -1102,6 +1145,7 @@ For this example, the \textit{anonflib} library should be used.
So, MAPI should be configured with \textit{--enable-anonflib}.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment