Commit f75f7987 authored by Arne Øslebø's avatar Arne Øslebø
Browse files

various bug fixes

git-svn-id: file:///home/svn/mapi/trunk@347 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent b4f3c8c1
......@@ -109,8 +109,8 @@ mapi_function.o: mapi_function.c mapi_function.h
mapidagdrv.o: mapidagdrv.c mapi.h mapidrv.h mapidlib.h mapid.h
$(CC) $(CFLAGS) -fPIC -c $<
mapidagdrv.so: mapidagdrv.o $(DAGAPI) mapidlib.o flist.o mapiipc.o mstring.o mapilibhandler.o parseconf.o priorities.o
$(CC) $(CFLAGS) -shared -o $@ $^ -lpcap -lfl -lrt
mapidagdrv.so: mapidagdrv.o mapidlib.o flist.o mapiipc.o mstring.o mapilibhandler.o parseconf.o priorities.o
$(CC) $(CFLAGS) -shared -o $@ $^ -lpcap -lfl -lrt $(DAGAPI)
mapinicdrv.o: mapinicdrv.c mapi.h mapidrv.h mapidlib.h mapid.h mapi_errors.h
$(CC) $(CFLAGS) -fPIC -c $<
......
......@@ -83,7 +83,7 @@ int mapidrv_add_device(mapi_offline_device_status_t *olstatus,char *devname, int
}
int mapidrv_delete_device(int devid)
{
{
dag_instance_t *i=flist_remove(devlist,devid,FLIST_LEAVE_DATA);
if (i!=NULL) {
......@@ -442,7 +442,8 @@ int
mapidrv_connect (int devid,int fd)
{
dag_instance_t *i=flist_get(devlist,devid);
if(i==NULL)
return;
return mapid_connect(&i->mapidlib,fd);
}
......
......@@ -245,6 +245,7 @@ void mapid_destroy(mapidlib_instance_t *i)
struct mapidlibflow *f;
if (i!=NULL) {
mapid_lock(i);
// n=flist_head(i->flowlist);
#ifdef WITH_PRIORITIES
int j = 0;
......@@ -270,6 +271,8 @@ void mapid_destroy(mapidlib_instance_t *i)
flist_destroy(i->flowlist,FLIST_FREE_DATA);
#endif
free(i->flowlist);
mapid_unlock(i);
}
else if (libs_loaded>0) {
mapilh_free_libraries();
......
......@@ -478,6 +478,8 @@ int
mapidrv_close_flow (int devid,int fd)
{
nic_instance_t *i=flist_get(devlist,devid);
if(i==NULL)
return;
return mapid_close_flow(&i->mapidlib,fd);
}
......
......@@ -79,7 +79,7 @@ static int binop_instance(mapidflib_function_instance_t *instance,
fargs=instance->args;
type = getargint(&fargs);
i->left=
i->left= fhlp_get_function_instance(instance->hwinfo->gflist,getargint(&fargs),getargint(&fargs));
i->right=fhlp_get_function_instance(instance->hwinfo->gflist,getargint(&fargs),getargint(&fargs));
if(type==BINOP_SUB)
......
......@@ -34,7 +34,6 @@ static int pktinfo_process_size(mapidflib_function_instance_t *instance,
mapid_pkthdr_t* pkt_head)
{
(*(unsigned long long*)instance->result.data)=(unsigned long long)pkt_head->wlen;
return 1;
}
......
......@@ -143,7 +143,9 @@ static int res2file_process(mapidflib_function_instance_t *instance,
s=1;
i->last+=i->ticks;
while(i->last+i->ticks<pkt_head->ts) {
write(i->file,"0\n",2);
for(c=0;c<i->numfuncts;c++)
write(i->file,"0 ",2);
write(i->file,"\n",1);
i->last+=i->ticks;
}
}
......
......@@ -99,7 +99,7 @@ static int stats_process(mapidflib_function_instance_t *instance,
if(s->min>*res || s->min==0) {
s->min=*res;
}
s->count++;
s->sum+=*res;
s->sum2+=((long double)*res*(long double)*res);
......
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