Commit db02bb6c authored by 's avatar
Browse files

Section for DiMAPI added

git-svn-id: file:///home/svn/mapi/trunk@321 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 5110f81d
No preview for this file type
......@@ -799,7 +799,8 @@ int main() {
signal(SIGTERM, terminate);
/* create a flow using a scope of three monitoring sensors */
fd = mapi_create_flow("sensor.uninett.no:/dev/dag0, mon1.ics.forth.gr:eth0, 123.45.6.7:eth2");
fd = mapi_create_flow("sensor.uninett.no:/dev/dag0,
mon1.ics.forth.gr:eth0, 123.45.6.7:eth2");
if (fd < 0) {
printf("Could not create flow\n");
exit(EXIT_FAILURE);
......@@ -824,22 +825,23 @@ int main() {
exit(EXIT_FAILURE);
}
/* read the results of the applied PKT_COUNTER function from all hosts every 1 sec */
/* read the results of the applied PKT_COUNTER function from all
hosts every 1 sec */
while(loop--){
sleep(1);
dres = (struct dmapi_results*) mapi_read_results(fd,fid,MAPI_COPY);
dres = (struct dmapi_results*) mapi_read_results(fd, fid, MAPI_COPY);
for (i=0; i<dres->cnt; i++) {
count=*((unsigned long long*)dres->res[i].result);
count = *( (unsigned long long*) dres->res[i].result );
printf("web packets in host %s: %llu\n",dres->res[i].host_dev, count);
total_count+=count;
total_count += count;
}
printf("Total web packets: %llu\n",total_count);
}
cnt = (unsigned long long *)mapi_read_results(fd, fid, MAPI_COPY);
cnt = (unsigned long long *) mapi_read_results(fd, fid, MAPI_COPY);
printf("pkts:%llu\n", *cnt);
return 0;
......
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