Commit 1d1a0064 authored by 's avatar
Browse files

various fixes


git-svn-id: file:///home/svn/mapi/trunk@799 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent d15e7376
...@@ -54,7 +54,7 @@ Regular expression pattern matching, using the \fIreg_expr\fP regular expression ...@@ -54,7 +54,7 @@ Regular expression pattern matching, using the \fIreg_expr\fP regular expression
Type of results: \fBunsigned long long\fP. Type of results: \fBunsigned long long\fP.
.\"-------------------------------------------------------- .\"--------------------------------------------------------
.IP "\fBTOP\fP (int \fIX\fP, int \fIprotocol\fP, int \fIfield\fP)" .IP "\fBTOP\fP (int \fIX\fP, int \fIprotocol\fP, int \fIfield\fP)"
Return TOP \fIX\fP values of the \fIfieled\fP field of the \fIprotocol\fP protocol. Return TOP \fIX\fP values of the \fIfield\fP field of the \fIprotocol\fP protocol.
Type of results: \fBunsigned int[]\fP. Type of results: \fBunsigned int[]\fP.
.SH BUGS .SH BUGS
......
...@@ -340,7 +340,7 @@ int main(int argc,char *argv[]) { ...@@ -340,7 +340,7 @@ int main(int argc,char *argv[]) {
mapi_connect(fd); mapi_connect(fd);
while(1) { while(1) {
results = mapi_read_results(fd, counter, MAPI_REF); results = mapi_read_results(fd, counter);
total_packets = (unsigned long long*)results->res; total_packets = (unsigned long long*)results->res;
printf("total_packets: %lld\\n", *total_packets); printf("total_packets: %lld\\n", *total_packets);
sleep(1); sleep(1);
......
...@@ -70,7 +70,7 @@ int main(int argc,char *argv[]) { ...@@ -70,7 +70,7 @@ int main(int argc,char *argv[]) {
mapi_connect(fd); mapi_connect(fd);
while(1) { while(1) {
result = mapi_read_results(fd, counter, MAPI_REF); result = mapi_read_results(fd, counter);
total_packets = (unsigned long long*)result->res; total_packets = (unsigned long long*)result->res;
printf("total_packets: %lld\\n", *total_packets); printf("total_packets: %lld\\n", *total_packets);
sleep(1); sleep(1);
......
No preview for this file type
...@@ -2135,10 +2135,11 @@ int mapi_loop(int fd, int fid, int cnt, mapi_handler callback){ ...@@ -2135,10 +2135,11 @@ int mapi_loop(int fd, int fid, int cnt, mapi_handler callback){
int mapi_read_error(int* err_no, char* errorstr) int mapi_read_error(int* err_no, char* errorstr)
{ {
int i =0; int i =0;
//if(err_no == NULL || errorstr == NULL){
// strcpy(errorstr,"Error in mapi_read_error: null argument given\n"); if(err_no == NULL && errorstr == NULL){
// return -1; return -1;
//} }
if (err_no!=NULL) *err_no = local_err; if (err_no!=NULL) *err_no = local_err;
if (errorstr!=NULL) { if (errorstr!=NULL) {
...@@ -2302,7 +2303,7 @@ int mapi_get_function_info(int fd,int fid, mapi_function_info_t *info) ...@@ -2302,7 +2303,7 @@ int mapi_get_function_info(int fd,int fid, mapi_function_info_t *info)
hflow->dbuf->cmd=GET_FUNCTION_INFO; hflow->dbuf->cmd=GET_FUNCTION_INFO;
hflow->dbuf->fd=hflow->fd; hflow->dbuf->fd=hflow->fd;
if ( (fdata=(function_data*)flist_get(hflow->functions, fid))==NULL ) { if ( (fdata=(function_data*)flist_get(hflow->functions, fid))==NULL ) {
local_err = MAPI_INVALID_FID_FUNCID; local_err = MAPI_FUNCTION_INFO_ERR;
return -1; return -1;
} }
hflow->dbuf->fid = fdata->fid; hflow->dbuf->fid = fdata->fid;
...@@ -2408,7 +2409,7 @@ int mapi_get_next_function_info(int fd,int fid, mapi_function_info_t *info) ...@@ -2408,7 +2409,7 @@ int mapi_get_next_function_info(int fd,int fid, mapi_function_info_t *info)
hflow->dbuf->cmd=GET_NEXT_FUNCTION_INFO; hflow->dbuf->cmd=GET_NEXT_FUNCTION_INFO;
hflow->dbuf->fd=hflow->fd; hflow->dbuf->fd=hflow->fd;
if ( (fdata=(function_data*)flist_get(hflow->functions, fid))==NULL ) { if ( (fdata=(function_data*)flist_get(hflow->functions, fid))==NULL ) {
local_err = MAPI_INVALID_FID_FUNCID; local_err = MAPI_FUNCTION_INFO_ERR;
return -1; return -1;
} }
hflow->dbuf->fid = fdata->fid; hflow->dbuf->fid = fdata->fid;
......
...@@ -133,7 +133,7 @@ DOT; ...@@ -133,7 +133,7 @@ DOT;
} while(info.status!=FLOW_FINISHED); } while(info.status!=FLOW_FINISHED);
res = mapi_read_results(fd, fid); res = mapi_read_results(fd, fid);
printf("\nBytes till now : %llu\n", *((unsigned long long*)res->res)); printf("\nPackets till now : %llu\n", *((unsigned long long*)res->res));
/* /*
* sanity checks * sanity checks
...@@ -188,11 +188,11 @@ DOT; ...@@ -188,11 +188,11 @@ DOT;
DOT; DOT;
if (!flag) { if (!flag) {
printf("\nByte Counter Error Checking OK\n"); printf("\nPacket Counter Error Checking OK\n");
return 0; return 0;
} }
else{ else{
fprintf(stderr,"\nByte Counter Error Checking :FAILED:\n"); fprintf(stderr,"\nPacket Counter Error Checking :FAILED:\n");
return -1; return -1;
} }
} }
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