Commit 60cd80af authored by 's avatar

mapi_read_error correct prototype (remove the useless fd argument)


git-svn-id: file:///home/svn/mapi/trunk@789 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 44609e28
......@@ -54,7 +54,7 @@ Regular expression pattern matching, using the \fIreg_expr\fP regular expression
Type of results: \fBunsigned long long\fP.
.\"--------------------------------------------------------
.IP "\fBTOP\fP (int \fIX\fP, int \fIprotocol\fP, int \fIfield\fP)"
Return TOP \fIX\fP values of the \fIfiled\fP field of the \fIprotocol\fP protocol.
Return TOP \fIX\fP values of the \fIfieled\fP field of the \fIprotocol\fP protocol.
Type of results: \fBunsigned int[]\fP.
.SH BUGS
......
......@@ -22,11 +22,11 @@ MAPI stdflib \- Standard MAPI Function Library
\fBBINOP\fP Adds or subtracts values from two other MAPI functions
\fBDIST\fP Returns the distribution of results from another MAPI function
\fBGAP\fP Returns the time delay between two consecutive packets in a flow
\fBPKT_INFO\fP Returns information about a packet
\fBPKTINFO\fP Returns information about a packet
\fBPROTINFO\fP Returns a specific protocol field
\fBRES2FILE\fP Stores results from other MAPI functions to a file
\fBSTARTSTOP\fP Starts and/or stops measurements at a specific time
\fBSTAT\fP Returns statistical information about results from other MAPI functions
\fBSTATS\fP Returns statistical information about results from other MAPI functions
.fi
.SH DESCRIPTION
......@@ -251,7 +251,7 @@ Returns the time delay between two consecutive packets in a flow.
Type of results: \fBunsigned long long\fP.
.\"--------------------------------------------------------
.IP "\fBPKT_INFO\fP (int \fIinfo\fP)"
.IP "\fBPKTINFO\fP (int \fIinfo\fP)"
Returns information about a packet.
If \fIinfo\fP is \fBPKT_TS\fP, it gives the packet timestamp.
Else, if \fIinfo\fP is \fBPKT_SIZE\fP, it returns the packet size.
......@@ -289,7 +289,7 @@ is the relative time from the first captured packet.
Type of results: \fBnone\fP.
.\"--------------------------------------------------------
.IP "\fBSTAT\fP (int \fIflow\fP, int \fIfunction\fP, int \fIskip\fP)"
.IP "\fBSTATS\fP (int \fIflow\fP, int \fIfunction\fP, int \fIskip\fP)"
Returns statistical information about results from MAPI function with fid
\fIfunction\fP. \fIskip\fP is the number of packets to skip before reading the first result.
......
......@@ -237,7 +237,7 @@ Returns information about a packet<br>
<b>Return value:</b> unsigned long long<br>
<b>Exapmle:</b><br>
<font color="grey" face="courier">
<pre><strong>fid=mapi_apply_function(fd,"PKT_INFO",PKT_SIZE);</strong></pre></font>
<pre><strong>fid=mapi_apply_function(fd,"PKTINFO",PKT_SIZE);</strong></pre></font>
<H3>sample</h3>
Performs sampling<br>
......
No preview for this file type
......@@ -2132,7 +2132,7 @@ int mapi_loop(int fd, int fid, int cnt, mapi_handler callback){
/*
* Very simple function. Just reads the last error that was set.
*/
int mapi_read_error(MAPI_UNUSED int fd, int* err_no, char* errorstr)
int mapi_read_error(int* err_no, char* errorstr)
{
int i =0;
if(err_no == NULL || errorstr == NULL){
......
......@@ -189,7 +189,7 @@ extern int mapi_close_flow(int fd);
//Read the last error-code set by mapid or mapi-api
//err_no and errorstr should be allocated, the function won't allocate memory
//errorstr is always < 512 bytes
extern int mapi_read_error(int fd, int* err_no, char* errorstr);
extern int mapi_read_error(int* err_no, char* errorstr);
extern int mapi_set_authdata(int fd,const char *pub,const char *priv,const char *creds);
......
......@@ -261,7 +261,7 @@ void *handle_request(void *arg) {
fprintf(stdout,"CREATE_FLOW (%s, %d)\n",dbuf->data, mapid_result);
if(mapid_result <0) {
dbuf->cmd = ERROR_ACK;
mapi_read_error(0, &errno, errorstr);
mapi_read_error(&errno, errorstr);
memcpy(dbuf->data, &errno, sizeof(int));
}
else {
......@@ -295,7 +295,7 @@ void *handle_request(void *arg) {
}
else{
dbuf->cmd = ERROR_ACK;
mapi_read_error(dbuf->fd, &errno, errorstr);
mapi_read_error(&errno, errorstr);
memcpy(dbuf->data, &errno, sizeof(int));
fprintf(stdout," FAILED\n");
dbuf->length = BASIC_SIZE+sizeof(int);
......@@ -309,7 +309,7 @@ void *handle_request(void *arg) {
}
else{
dbuf->cmd = ERROR_ACK;
mapi_read_error(dbuf->fd, &errno, errorstr);
mapi_read_error(&errno, errorstr);
memcpy(dbuf->data, &errno, sizeof(int));
dbuf->length = BASIC_SIZE+sizeof(int);
}
......@@ -326,7 +326,7 @@ void *handle_request(void *arg) {
else{
fprintf(stdout,"mapi_read_results failed...\n");
dbuf->cmd = ERROR_ACK;
mapi_read_error(dbuf->fd, &errno, errorstr);
mapi_read_error(&errno, errorstr);
memcpy(dbuf->data, &errno, sizeof(int));
dbuf->length = BASIC_SIZE+sizeof(int);
}
......
......@@ -30,35 +30,35 @@ int main(int argc, char *argv[])
if ((fd = mapi_create_flow(argv[1])) < 0) {
fprintf(stderr, "Could not create flow using '%s'\n", argv[1]);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
DOT;
if ((fidc=mapi_apply_function(fd,"PKT_COUNTER")) < 0) {
fprintf(stderr, "Could not apply PKT_COUNTER to flow %d\n", fd);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
DOT;
if ((fid=mapi_apply_function(fd,"BPF_FILTER", "tcp")) < 0) {
fprintf(stderr, "Could not apply BPF_FILTER to flow %d\n", fd);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
DOT;
if ((fidf=mapi_apply_function(fd,"PKT_COUNTER")) < 0) {
fprintf(stderr, "Could not apply PKT_COUNTER to flow %d\n", fd);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
DOT;
if (mapi_connect(fd) < 0) {
fprintf(stderr, "Could not connect to flow %d\n", fd);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
......@@ -83,7 +83,7 @@ DOT;
if(mapi_close_flow(fd)<0){
fprintf(stderr,"Close flow failed\n");
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
......@@ -96,14 +96,14 @@ DOT;
if ((fd = mapi_create_flow(argv[1])) < 0) {
fprintf(stderr, "Could not create flow using '%s'\n", argv[1]);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
DOT;
if((fid = mapi_apply_function(fd , "BPF_FILTER" , "RANDOM DATA:1231sad12e1ed2ed:")) == -1) {
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
printf("Testing error case1. Errorcode: %d description: %s\n\n" ,err_no, error);
if(err_no!=1025){
fprintf(stderr, "\nWARNING: mapi_apply_function returned wrong errorcode %d\n" , err_no);
......@@ -112,7 +112,7 @@ DOT;
}
DOT;
if((cntc = mapi_read_results(fd,fidc)) == NULL){
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
printf("Testing error case2. Errrorcode: %d description:%s\n\n" ,err_no, error);
if(err_no!=6145){
fprintf(stderr, "\nWARNING: mapi_read_results returned wrong errorcode\n");
......@@ -122,7 +122,7 @@ DOT;
DOT;
if(mapi_close_flow(fd)<0){
fprintf(stderr,"Close flow failed\n");
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
......@@ -135,28 +135,28 @@ DOT;
fd =0;
if( (fd=mapi_create_offline_flow("./tracefile", MFF_PCAP)) <0){
fprintf(stderr,"Could not create offline flow\n");
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
DOT;
if( (fidc=mapi_apply_function(fd,"PKT_COUNTER")) < 0) {
fprintf(stderr, "Could not apply PKT_COUNTER to flow %d\n", fd);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
DOT;
if( (fid=mapi_apply_function(fd,"BPF_FILTER", "tcp")) < 0) {
fprintf(stderr, "Could not apply BPF_FILTER to flow %d\n", fd);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
DOT;
if( (fidf=mapi_apply_function(fd,"PKT_COUNTER")) < 0) {
fprintf(stderr, "Could not apply PKT_COUNTER to flow %d\n", fd);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
......@@ -164,7 +164,7 @@ DOT;
if (mapi_connect(fd) < 0) {
fprintf(stderr, "Could not connect to flow %d\n", fd);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
......@@ -189,7 +189,7 @@ DOT;
}
DOT;
if( (fid = mapi_apply_function(fd , "BPF_FILTER" , "RANDOM DATA:1231sad12e1ed2ed:")) == -1) {
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
printf("Testing error case2. Errorcode: %d description: %s\n\n" ,err_no, error);
if(err_no!=7006){
fprintf(stderr, "\nWARNING: mapi_apply_function returned wrong errorcode\n");
......@@ -199,7 +199,7 @@ DOT;
DOT;
if(mapi_close_flow(fd)<0){
fprintf(stderr,"Close flow failed\n");
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
......
......@@ -21,7 +21,7 @@ int main(int argc, char *argv[])
if ((fd = mapi_create_flow(argv[1])) < 0) {
fprintf(stderr, "Could not create flow using '%s'\n", argv[1]);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
......@@ -29,14 +29,14 @@ DOT;
if ((fid = mapi_apply_function(fd, "BYTE_COUNTER")) == -1) {
fprintf(stderr, "Count not apply function BYTE_COUNTER to flow %d\n", fd);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
DOT;
if (mapi_connect(fd) < 0) {
fprintf(stderr, "Could not connect to flow %d\n", fd);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
......@@ -59,7 +59,7 @@ DOT;
if(mapi_close_flow(fd)<0){
fprintf(stderr,"Close flow failed\n");
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
......@@ -71,20 +71,20 @@ DOT;
*/
if ((fd = mapi_create_flow(argv[1])) < 0) {
fprintf(stderr, "Could not create flow using '%s'\n", argv[1]);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
DOT;
if (mapi_connect(fd) < 0) {
fprintf(stderr, "Could not connect to flow %d\n", fd);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
DOT;
if( ( fid = mapi_apply_function(fd,"BYTE_COUNTER", NULL , "ANOTHER1" , 453) ) == -1){
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
printf("Testing error case1: Erorcode :%d description: %s \n" ,err_no, error);
if(err_no != 7006){
fprintf(stderr, "\nWARNING: mapi_apply_function returned wrong errorcode\n");
......@@ -94,7 +94,7 @@ DOT;
DOT;
if(mapi_close_flow(fd)<0){
fprintf(stderr,"Close flow failed\n");
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
......@@ -103,7 +103,7 @@ DOT;
fd =0;
if ((fd = mapi_create_offline_flow("./tracefile" , MFF_PCAP)) < 0) {
fprintf(stderr, "Could not create flow using '%s'\n", argv[1]);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
......@@ -111,14 +111,14 @@ DOT;
if ((fid = mapi_apply_function(fd, "BYTE_COUNTER")) == -1) {
fprintf(stderr, "Count not apply function BYTE_COUNTER to flow %d\n", fd);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
DOT;
if (mapi_connect(fd) < 0) {
fprintf(stderr, "Could not connect to flow %d\n", fd);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
......@@ -147,7 +147,7 @@ DOT;
DOT;
if(mapi_close_flow(fd)<0){
fprintf(stderr,"Close flow failed\n");
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
......@@ -159,20 +159,20 @@ DOT;
*/
if ((fd = mapi_create_offline_flow("./tracefile", MFF_PCAP)) < 0) {
fprintf(stderr, "Could not create flow using '%s'\n", argv[1]);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
DOT;
if (mapi_connect(fd) < 0) {
fprintf(stderr, "Could not connect to flow %d\n", fd);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
DOT;
if( ( fid = mapi_apply_function(fd,"BYTE_COUNTER", NULL , "ANOTHER1" , 453) ) == -1){
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
printf("Testing error case1: Erorcode :%d description: %s \n" ,err_no, error);
if(err_no != 7006){
fprintf(stderr, "\nWARNING: mapi_apply_function returned wrong errorcode\n");
......@@ -182,7 +182,7 @@ DOT;
DOT;
if(mapi_close_flow(fd)<0){
fprintf(stderr,"Close flow failed\n");
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
......
......@@ -18,14 +18,14 @@ int main(MAPI_UNUSED int argc, char *argv[])
if ((fd = mapi_create_flow(argv[1]))<0){
fprintf(stderr, "Could not create flow using '%s'\n", argv[1]);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
DOT;
if((fid=mapi_apply_function(fd, "PKT_COUNTER"))<0){
fprintf(stderr, "Could not apply PKT_COUNTER to flow %d\n", fd);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
......@@ -33,7 +33,7 @@ DOT;
DOT;
if(mapi_connect(fd)<0){
fprintf(stderr, "Connecting to flow failed %d\n", fd);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
......@@ -41,7 +41,7 @@ DOT;
DOT;
if( (fd = mapi_close_flow(fd))<0){
fprintf(stderr, "Mapi Close flow failed %d\n", fd);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
......@@ -56,7 +56,7 @@ DOT;
fd =0;
if( (fd = mapi_close_flow(13244)) == -1){
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
printf("Testing error case1: Erorcode :%d description: %s \n" ,err_no, error);
if(err_no != 6145){
printf(" Wrong ERRORCODE returned\n");
......@@ -67,14 +67,14 @@ DOT;
if ((fd = mapi_create_offline_flow("./tracefile" , MFF_PCAP))<0){
fprintf(stderr, "Could not create flow using '%s'\n", argv[1]);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
DOT;
if((fid=mapi_apply_function(fd, "PKT_COUNTER"))<0){
fprintf(stderr, "Could not apply PKT_COUNTER to flow %d\n", fd);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
......@@ -82,7 +82,7 @@ DOT;
DOT;
if(mapi_connect(fd)<0){
fprintf(stderr, "Connecting to flow failed %d\n", fd);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
......@@ -90,7 +90,7 @@ DOT;
DOT;
if( (fd = mapi_close_flow(fd))<0){
fprintf(stderr, "Mapi Close flow failed %d\n", fd);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
......@@ -105,7 +105,7 @@ DOT;
fd =0;
if( (fd = mapi_close_flow(13144)) == -1){
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
printf("Testing error case1: Erorcode :%d description: %s \n" ,err_no, error);
if(err_no != 6145){
printf(" Wrong ERRORCODE returned\n");
......
......@@ -18,14 +18,14 @@ int main(int argc, char *argv[])
if ((fd = mapi_create_flow(argv[1]))<0){
fprintf(stderr, "Could not create flow using '%s'\n", argv[1]);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
DOT;
if(mapi_connect(fd)<0){
fprintf(stderr, "Connecting to flow failed %d\n", fd);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
......@@ -33,7 +33,7 @@ DOT;
DOT;
if( (fd = mapi_close_flow(fd))<0){
fprintf(stderr, "Mapi Close flow failed %d\n", fd);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
......@@ -45,7 +45,7 @@ DOT;
fd =0;
if( (fd = mapi_create_flow("HOW CARES")) == -1){
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
printf("Testing error case1: Erorcode :%d description: %s \n" ,err_no, error);
if(err_no != 6145){
printf(" Wrong ERRORCODE returned\n");
......@@ -56,14 +56,14 @@ DOT;
if ((fd = mapi_create_offline_flow("./tracefile" , MFF_PCAP))<0){
fprintf(stderr, "Could not create flow using './tracefile'\n");
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
DOT;
if(mapi_connect(fd)<0){
fprintf(stderr, "Connecting to flow failed %d\n", fd);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
......@@ -71,7 +71,7 @@ DOT;
DOT;
if( (fd = mapi_close_flow(fd))<0){
fprintf(stderr, "Mapi Close flow failed %d\n", fd);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
......
......@@ -20,7 +20,7 @@ int main(MAPI_UNUSED int argc, char *argv[])
{
char err_buffer[1024];
int err_no;
mapi_read_error(fd, &err_no,err_buffer);
mapi_read_error( &err_no,err_buffer);
printf("1. Error: %d - %s\n", err_no, err_buffer);
}
......@@ -28,7 +28,7 @@ int main(MAPI_UNUSED int argc, char *argv[])
{
char err_buffer[1024];
int err_no;
mapi_read_error(fd, &err_no,err_buffer);
mapi_read_error( &err_no,err_buffer);
printf("2. Error: %d - %s\n", err_no, err_buffer);
}
......@@ -36,7 +36,7 @@ int main(MAPI_UNUSED int argc, char *argv[])
{
char err_buffer[1024];
int err_no;
mapi_read_error(fd, &err_no, err_buffer);
mapi_read_error( &err_no, err_buffer);
printf("3. Error: %d - %s\n", err_no, err_buffer);
}
......@@ -44,7 +44,7 @@ int main(MAPI_UNUSED int argc, char *argv[])
{
char err_buffer[1024];
int err_no;
mapi_read_error(fd, &err_no, err_buffer);
mapi_read_error( &err_no, err_buffer);
printf("4. Error: %d - %s\n", err_no, err_buffer);
}
......@@ -53,7 +53,7 @@ int main(MAPI_UNUSED int argc, char *argv[])
{
char err_buffer[1024];
int err_no;
mapi_read_error(fd, &err_no, err_buffer);
mapi_read_error( &err_no, err_buffer);
printf("5. Error: %d - %s\n", err_no, err_buffer);
}
......@@ -61,7 +61,7 @@ int main(MAPI_UNUSED int argc, char *argv[])
{
char err_buffer[1024];
int err_no;
mapi_read_error(fd, &err_no, err_buffer);
mapi_read_error( &err_no, err_buffer);
printf("6. Error: %d - %s\n", err_no, err_buffer);
}
mapi_close_flow(fd);
......@@ -70,7 +70,7 @@ int main(MAPI_UNUSED int argc, char *argv[])
{
char err_buffer[1024];
int err_no;
mapi_read_error(fd, &err_no, err_buffer);
mapi_read_error( &err_no, err_buffer);
printf("7. Error: %d - %s\n", err_no, err_buffer);
}
......@@ -80,7 +80,7 @@ int main(MAPI_UNUSED int argc, char *argv[])
{
char err_buffer[1024];
int err_no;
mapi_read_error(fd, &err_no, err_buffer);
mapi_read_error( &err_no, err_buffer);
printf("8. Error: %d - %s\n", err_no, err_buffer);
}
......@@ -88,7 +88,7 @@ int main(MAPI_UNUSED int argc, char *argv[])
{
char err_buffer[1024];
int err_no;
mapi_read_error(fd, &err_no, err_buffer);
mapi_read_error( &err_no, err_buffer);
printf("9. Error: %d - %s\n", err_no, err_buffer);
}
......
......@@ -19,84 +19,84 @@ int main(MAPI_UNUSED int argc, char *argv[])
if ((fd = mapi_create_flow(argv[1]))<0){
fprintf(stderr, "Could not create flow using '%s'\n", argv[1]);
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
DOT;
if((ok = mapi_apply_function(fd, "PKT_COUNTER"))<0){
fprintf(stderr,"Could not apply function PKT_COUNTER\n");
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
DOT;
if((ok = mapi_apply_function(fd, "BYTE_COUNTER"))<0){
fprintf(stderr,"Could not apply function BYTE_COUNTER\n");
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);
fprintf(stderr,"Erorcode :%d description: %s \n" ,err_no, error);
return -1;
}
DOT;
if((ok = mapi_apply_function(fd, "PKT_COUNTER"))<0){
fprintf(stderr,"Could not apply function PKT_COUNTER\n");
mapi_read_error(fd, &err_no, error);
mapi_read_error( &err_no, error);