Commit 01608a97 authored by 's avatar

Finished INTERFACE function, sw implemented. Here an interface is an...

Finished INTERFACE function, sw implemented. Here an interface is an equivalent to a channel in nt terminology.


git-svn-id: file:///home/svn/mapi/trunk@1484 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 903a04d2
This diff is collapsed.
......@@ -13,6 +13,9 @@
#include "fhelp.h"
#include "mapi_errors.h"
#define bool_t unsigned int
#include <packetdescriptor.h>
typedef struct {
int ifindex;
} interface_instance_t;
......@@ -23,21 +26,14 @@ static int interface_instance(mapidflib_function_instance_t *instance,
{
mapiFunctArg* fargs;
int ifindex;
int interface_f;
fargs = instance->args;
ifindex = getargint(&fargs);
/* refuse: bad port specification */
if(ifindex < 0)
return MFUNCT_INVALID_ARGUMENT;
/* refuse: the same function was already applied to this flow */
/*fhlp_filtering_funct_is_in_list_but_INTERFACE(instance->hwinfo->gflist, fd, &interface_f);
if (interface_f == INTERFACE_FUNCT_EXISTS)
return MFUNCT_COULD_NOT_APPLY_FUNCT;*/
return 0;
}
......@@ -64,17 +60,17 @@ static int interface_init(mapidflib_function_instance_t *instance,
}
static int interface_process(mapidflib_function_instance_t *instance,
unsigned char* dev_pkt,
MAPI_UNUSED unsigned char* dev_pkt,
MAPI_UNUSED unsigned char* link_pkt,
MAPI_UNUSED mapid_pkthdr_t* pkt_head)
mapid_pkthdr_t* pkt_head)
{
interface_instance_t *internal_data_ptr;
internal_data_ptr = (interface_instance_t *) (instance->internal_data);
return 1;
if (pkt_head->ifindex == internal_data_ptr->ifindex)
return 1;
//return 0;
return 0;
}
static int interface_cleanup(mapidflib_function_instance_t* instance)
......
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