Commit 649e16ac authored by 's avatar
Browse files

Support large (cooked) packets in DiMAPI mapi_get_next_pkt

git-svn-id: file:///home/svn/mapi/trunk@583 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 0aa51e55
......@@ -451,7 +451,7 @@ static void delete_remote_flow(remote_flowdescr_t* rflow)
free(hflow->functions);
free(hflow->dev);
free(hflow->dbuf);
free(hflow->pkt);
if (hflow->pkt!=NULL) free(hflow->pkt);
flist_remove(rflow->host_flowlist,hflow->id,FLIST_FREE_DATA);
free(hflow);
}
......@@ -577,7 +577,8 @@ int mapi_create_flow(const char *dev)
flist_append(h->flows, --negfdseed, hflow);
hflow->fd=negfdseed;
hflow->dbuf=(struct dmapiipcbuf *)malloc(sizeof(struct dmapiipcbuf));
hflow->pkt=(struct mapipkt*)malloc(sizeof(struct mapipkt)+PKT_LENGTH);
//hflow->pkt=(struct mapipkt*)malloc(sizeof(struct mapipkt)+PKT_LENGTH); DELETE
hflow->pkt=NULL;
hflow->rhost=h;
hflow->functions=(flist_t *)malloc(sizeof(flist_t));
flist_init(hflow->functions);
......@@ -1737,6 +1738,7 @@ mapi_get_next_pkt(int fd,int fid)
flist_init(rflow->pkt_list);
for (fnode=flist_head(rflow->host_flowlist); fnode!=NULL; fnode=flist_next(fnode)) {
hflow=(host_flow*)fnode->data;
hflow->pkt=(struct mapipkt*)malloc(sizeof(struct mapipkt)+PKT_LENGTH);
hflow->dbuf->cmd=GET_NEXT_PKT;
hflow->dbuf->fd=hflow->fd;
hflow->dbuf->fid=((function_data*)flist_get(hflow->functions, fid))->fid;
......
......@@ -145,7 +145,7 @@ struct dmapiipcbuf {
};
#define BASIC_SIZE (sizeof(struct dmapiipcbuf) - DIMAPI_DATA_SIZE)
#define PKT_LENGTH 1600 //pkt info and actual pkt
#define PKT_LENGTH 131072 //pkt info and actual pkt
typedef struct host_flow {
struct host *rhost;
......
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