Commit b935afa1 authored by 's avatar
Browse files

Section for DiMAPI added

git-svn-id: file:///home/svn/mapi/trunk@319 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 1f5e8195
......@@ -286,6 +286,7 @@ number of hosts that sent results and the \textit{res} field is a table from
The field \textit{result} gives the actual result, the \textit{host\_dev} field gives the name of the
host including its monitoring interface, and finally the fields \textit{t\_produced} and \textit{t\_received}
are 64 bits timestamps for the production and reception of the results respectively.
The necessary memory for these structs has been allocated, once per every function applied.
The other MAPI function that returns data from the monitoring sensors is the
\textit{mapi\_get\_next\_pkt} function. In DiMAPI, the \textit{mapi\_get\_next\_pkt} returns packets from
the monitoring sensors in a round-robin way, if it is possible.
......@@ -905,17 +906,22 @@ Description
els, MAPI gives the network flow a first class status: flows are named
entities, and users may create or destroy flows, read, sample or count
packets of a flow, apply functions to flows, and retrieve other traffic
statistics from a flow. This page provides a description of the main
operations provided by MAPI. For information regarding the functions
that can be applied to network flows please refer to the mapi_stdlib(3)
page.
statistics from a flow. Furthermore, MAPI allows the correlation of a
network flow with a set of remote and distributed monitoring sensors.
This page provides a description of the main operations provided by
MAPI. For information regarding the functions that can be applied to
network flows please refer to the mapi_stdlib(3) page.
Routines
int mapi_create_flow(char *dev);
mapi_create_flow() is used to create a new network flow. The flow con-
sists of all packets that arrive in the device dev. Upon successful
creation, it returns a unique flow descriptor for the newly created
flow, otherwise returns -1.
mapi_create_flow() is used to create a new network flow. The flow con-
sists of all packets that arrive in the device dev. Instead of using a
local device, a set of remote monitoring sensors can also be defined.
In that case, the argument should contain the hostname (or IP address)
and the monitoring interface of every monitoring sensor using the for-
mat "host1:dev1, host2:dev2, host3:dev3". Upon successful creation, it
returns a unique flow descriptor for the newly created flow, otherwise
returns -1.
int mapi_create_offline_flow(char *path, int format, int speed);
mapi_create_offline_flow() is used to read packets from a trace file.
......@@ -979,6 +985,28 @@ Routines
tion. Thus, the application may access future results through the same
pointer without having to invoke mapi_read_results() again.
In case that we use more than one monitoring sensors,
mapi_read_results() returns a vector that contains the results from all
the monitoring sensors. The return value is a dmapi_results struct as
specified in mapi.h:
struct dmapi_results {
struct host_results* res;
unsigned int cnt;
}
struct host_results {
void *result;
char *host_dev;
unsigned long long t_produced;
unsigned long long t_received;
}
The res field is a vector of cnt items (host_results struct) that con-
tain the actual result and information about the monitoring sensor and
the time produced and received. The necessary memory for these structs
has been already allocated, once per every function applied.
int mapi_read_error(int *err_no, char *err_str);
mapi_read_error() is used in order to read the description of the last
error-code set by MAPI daemon or MAPI. mapi_read_error() fills err_str
......
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