Commit efe517aa authored by 's avatar
Browse files

Debuging in cooking function


git-svn-id: file:///home/svn/mapi/trunk@355 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent a47272c4
......@@ -15,6 +15,42 @@
#include "mapidevices.h"
#include "debug.h"
//Stores information about flows in mapidlib
typedef struct mapidlibflow {
int fd;
// short active;
enum mapi_flow_status status;
short delete;
flist_t *functionlist;
flist_t *procfunctionlist;
mapid_funct_info_t *funct_info_list;
mapid_hw_info_t *hwinfo; //Information about hardware using mapidlib
char devtype[MAPI_STR_LENGTH];
void* adapterinfo; //Pointer to adapter specific information
char *shm; //Pointer to start of shared memory
unsigned long long shm_size; //Size of shared memory
key_t shm_key;
int shm_id;
char shm_fname[MAPI_STR_LENGTH];
time_t start;
time_t end;
int err_no;
#ifdef WITH_MODIFY_PKTS
short modifies; //1 if a function in the flow modifies packets
unsigned char *mod_pkt; //Modified packet
mapid_pkthdr_t mod_pkt_head;
short mod_pkt_init; // 1 if allocated space for current modpkt
#endif
#ifdef WITH_PRIORITIES
int priority;
#endif
} mapidlibflow_t;
#ifdef WITH_MODIFY_PKTS
#define NIC_PKTCAP_LEN 1514
unsigned char modified_packet_buf[NIC_PKTCAP_LEN];
#endif
short libs_loaded=0; //1 if function libraries are loaded
char *libpath;
......@@ -223,7 +259,12 @@ static void delete_flow(mapidlib_instance_t *i,struct mapidlibflow *flow) {
//Check to see if other functions references this function
fix_funct_ref(flow->hwinfo->gflist,funct);
}
#ifdef WITH_MODIFY_PKTS
if(flow->mod_pkt != NULL && flow->mod_pkt != (unsigned char *)&modified_packet_buf[0]) {
// free(flow->mod_pkt);
}
#endif
lock=&flow->hwinfo->gflist->lock;
pthread_spin_lock(lock);
......@@ -633,7 +674,7 @@ mapid_funct_info_t* mapid_get_flow_functions(mapidlib_instance_t *i,int fd)
//Finds and identical function that can be used for global optimization
static mapidflib_function_instance_t *find_identical_function(mapidlib_instance_t *i,global_function_list_t *gflist, int fd, char *name, char *args, int devid) {
static mapidflib_function_instance_t *find_identical_function(MAPI_UNUSED mapidlib_instance_t *i,global_function_list_t *gflist, int fd, char *name, char *args, int devid) {
flist_node_t *flow;
flist_node_t *fnode,*fnode2;
mapidflib_function_t *funct,*funct2;
......@@ -932,15 +973,11 @@ mapid_get_lib_name(int libnumber)
return mapidflib_get_lib_name(libnumber);
}
#ifdef WITH_MODIFY_PKTS
#define NIC_PKTCAP_LEN 1514
unsigned char modified_packet_buf[NIC_PKTCAP_LEN];
#endif
void mapid_process_pkt(mapidlib_instance_t *i,
const unsigned char* dev_pkt,
const unsigned char* link_pkt,
unsigned char* dev_pkt,
unsigned char* link_pkt,
mapid_pkthdr_t* pkt_head)
//Process a single packet by applying functions to it
//pkt = pointer to packet
......@@ -968,24 +1005,22 @@ void mapid_process_pkt(mapidlib_instance_t *i,
if(flow->status==FLOW_ACTIVE) {
#ifdef WITH_MODIFY_PKTS
flow->decoded_packet=NULL;
flow->client_headers=NULL;
flow->server_headers=NULL;
if(flow->modifies==1) {
if(flow->mod_pkt!=(unsigned char *)(&modified_packet_buf[0])) {
free(flow->mod_pkt);
flow->mod_pkt=&modified_packet_buf[0];
if(flow->mod_pkt_init == 0) {
if(flow->mod_pkt != NULL){
free(flow->mod_pkt);
flow->mod_pkt = NULL;
}
flow->mod_pkt = malloc(sizeof(char) * flow->hwinfo->cap_length);
flow->mod_pkt_init = 1;
}
memcpy(modified_packet_buf,link_pkt,pkt_head->caplen);
memcpy(flow->mod_pkt, link_pkt, pkt_head->caplen);
memcpy(&flow->mod_pkt_head,pkt_head,sizeof(mapid_pkthdr_t));
flow->mod_pkt =&modified_packet_buf[0];
if(flow->server_mod_pkt) {
free(flow->server_mod_pkt);
flow->server_mod_pkt=NULL;
}
}
#endif
n2=flist_head(flow->procfunctionlist);
ret=1;
......
......@@ -84,8 +84,8 @@ int mapid_apply_function(mapidlib_instance_t *i,
char* function,
mapiFunctArg *fargs);
void mapid_process_pkt(mapidlib_instance_t *i,
const unsigned char* dev_pkt,
const unsigned char* link_pkt,
unsigned char* dev_pkt,
unsigned char* link_pkt,
mapid_pkthdr_t* pkt_head);
int mapid_get_errno(mapidlib_instance_t *i,int fid);
int mapid_get_devid(mapidlib_instance_t *i,int fd);
......@@ -102,49 +102,4 @@ mapi_function_def_mini_t* mapid_get_function_info(int libnumber,int functionnumb
char* mapid_get_lib_name(int libnumber);
//Stores information about flows in mapidlib
typedef struct mapidlibflow {
int fd;
// short active;
enum mapi_flow_status status;
short delete;
flist_t *functionlist;
flist_t *procfunctionlist;
mapid_funct_info_t *funct_info_list;
mapid_hw_info_t *hwinfo; //Information about hardware using mapidlib
char devtype[MAPI_STR_LENGTH];
void* adapterinfo; //Pointer to adapter specific information
char *shm; //Pointer to start of shared memory
unsigned long long shm_size; //Size of shared memory
key_t shm_key;
int shm_id;
char shm_fname[MAPI_STR_LENGTH];
time_t start;
time_t end;
int err_no;
#ifdef WITH_MODIFY_PKTS
short modifies; //1 if a function in the flow modifies packets
unsigned char *mod_pkt; //Modified packet
unsigned char *server_mod_pkt;
mapid_pkthdr_t mod_pkt_head;
mapid_pkthdr_t server_mod_pkt_head;
flist_t *client_headers;
flist_t *server_headers;
unsigned int client_size;
unsigned int server_size;
flist_t *ret_client_headers;
flist_t *ret_server_headers;
unsigned char* ret_client_data;
unsigned char* ret_server_data;
char uncook_ready;
void *decoded_packet;
#endif
#ifdef WITH_PRIORITIES
int priority;
#endif
} mapidlibflow_t;
#endif
......@@ -141,7 +141,7 @@ process_pkts(void *buf,unsigned len, nic_instance_t *i,MAPI_UNUSED int devid, in
unsigned c = 0;
int rlen = 0;
struct pcap_pkthdr *rec;
const unsigned char *packet;
unsigned char *packet;
mapid_pkthdr_t mhdr;
rec = (struct pcap_pkthdr *) buf;
......@@ -221,7 +221,7 @@ mapidrv_offline_proc_loop(int devid)
static void
mapidrv_proc_loop (int devid)
{
const u_char *packet;
u_char *packet;
struct pcap_pkthdr phdr;
mapid_pkthdr_t mhdr;
nic_instance_t *i=flist_get(devlist,devid);
......@@ -239,7 +239,7 @@ mapidrv_proc_loop (int devid)
while (1)
{
while( (packet = pcap_next(i->pcap,&phdr)) == NULL );
while( (packet = (u_char *)pcap_next(i->pcap,&phdr)) == NULL );
// Transform header
// This is only for backward compatibility
......
......@@ -32,8 +32,8 @@ static int binop_init(mapidflib_function_instance_t *instance,
}
static int binop_process_add(mapidflib_function_instance_t *instance,
MAPI_UNUSED const unsigned char* dev_pkt,
MAPI_UNUSED const unsigned char* link_pkt,
MAPI_UNUSED unsigned char* dev_pkt,
MAPI_UNUSED unsigned char* link_pkt,
MAPI_UNUSED mapid_pkthdr_t* pkt_head)
{
unsigned long long *res,*left,*right;
......@@ -49,8 +49,8 @@ static int binop_process_add(mapidflib_function_instance_t *instance,
}
static int binop_process_sub(mapidflib_function_instance_t *instance,
MAPI_UNUSED const unsigned char* dev_pkt,
MAPI_UNUSED const unsigned char* link_pkt,
MAPI_UNUSED unsigned char* dev_pkt,
MAPI_UNUSED unsigned char* link_pkt,
MAPI_UNUSED mapid_pkthdr_t* pkt_head)
{
unsigned long long *res,*left,*right;
......
......@@ -62,8 +62,8 @@ static int bpf_init(mapidflib_function_instance_t *instance,
}
static int bpf_process(mapidflib_function_instance_t *instance,
MAPI_UNUSED const unsigned char* dev_pkt,
const unsigned char* link_pkt,
MAPI_UNUSED unsigned char* dev_pkt,
unsigned char* link_pkt,
mapid_pkthdr_t* pkt_head)
{
return bpf_filter(((struct bpf_program)((struct bpf_filter*)instance->internal_data)->compiled).bf_insns, (unsigned char *)link_pkt,pkt_head->caplen,pkt_head->wlen);
......
......@@ -93,8 +93,8 @@ static int bucket_init(mapidflib_function_instance_t *instance,
}
static int bucket_process(mapidflib_function_instance_t *instance,
MAPI_UNUSED const unsigned char* dev_pkt,
MAPI_UNUSED const unsigned char* link_pkt,
MAPI_UNUSED unsigned char* dev_pkt,
MAPI_UNUSED unsigned char* link_pkt,
mapid_pkthdr_t* pkt_head)
{
struct bucket_function_data* fdata;
......
......@@ -10,8 +10,8 @@
#include "fhelp.h"
static int bytec_process(mapidflib_function_instance_t *instance,
MAPI_UNUSED const unsigned char* dev_pkt,
MAPI_UNUSED const unsigned char* link_pkt,
MAPI_UNUSED unsigned char* dev_pkt,
MAPI_UNUSED unsigned char* link_pkt,
mapid_pkthdr_t* pkt_head)
{
unsigned long long *counter;
......
......@@ -41,47 +41,29 @@ unsigned char *last_dev_pkt;
static int cooking_id=0;
extern struct tcp_stream *find_stream(struct tcphdr * this_tcphdr, struct ip * this_iphdr,int *from_client,int id);
void create_mod_pkt(unsigned char *dev_pkt,struct mapidlibflow *flow,mapid_pkthdr_t *pkt_head);
void create_mod_pkt(unsigned char *dev_pkt,struct cooking_data *flow,mapid_pkthdr_t *pkt_head);
//void process_flushed_data(struct mapidlibflow *flow);
void tcp_callback(struct tcp_stream *ns, void **param);
static int cook_instance(mapidflib_function_instance_t* instance,MAPI_UNUSED int fd, mapidflib_flow_mod_t *flow_mod)
static int cook_instance(mapidflib_function_instance_t* instance,MAPI_UNUSED int fd, MAPI_UNUSED mapidflib_flow_mod_t *flow_mod)
{
flist_node_t *n;
struct mapidlibflow *flow=NULL;
mapidlib_instance_t *i;
struct cooking_data* data;
/*
i = flow_mod->mi;
n = flist_head(i->flowlist);
while(n)
{
flow = flist_data(n);
if(flow->fd == instance->fd)
{
break;
}
n = flist_next(n);
} */
struct cooking_data* data = NULL;
data= (struct cooking_data*)malloc(sizeof(struct cooking_data));
data->flow=flow;
data = (struct cooking_data*)malloc(sizeof(struct cooking_data));
memset(data, 0, sizeof(struct cooking_data));
instance->internal_data=data;
return 0;
}
void create_mod_pkt(unsigned char *dev_pkt,struct mapidlibflow *flow,mapid_pkthdr_t *pkt_head) {
void create_mod_pkt(unsigned char *dev_pkt,struct cooking_data *flow,mapid_pkthdr_t *pkt_head) {
ether_header* eth = NULL;
ip_header* ip = NULL;
tcp_header* tcp = NULL;
int ether_len = 0, ip_len = 0, tcp_len = 0;
eth = (ether_header*)dev_pkt;
ether_len = sizeof(ether_header);
ip = (ip_header*)(dev_pkt + ether_len);
......@@ -92,8 +74,17 @@ void create_mod_pkt(unsigned char *dev_pkt,struct mapidlibflow *flow,mapid_pkthd
tcp->seq = 0;
ip->tlen = ntohs(flow->client_size + ip_len + tcp_len);
flow->mod_pkt = malloc(sizeof(char) * (flow->client_size + ether_len + ip_len + tcp_len));
printf("flow->mod_pkt_size %d addition %d\n", flow->mod_pkt_size , (sizeof(char) * (flow->client_size +ether_len + ip_len + tcp_len)));
if(flow->mod_pkt == NULL) {
flow->mod_pkt = malloc(sizeof(char) * (flow->client_size + ether_len + ip_len + tcp_len));
flow->mod_pkt_size = (sizeof(char) * (flow->client_size + ether_len + ip_len + tcp_len));
}
else if(flow->mod_pkt_size < (sizeof(char)*(flow->client_size + ether_len + ip_len + tcp_len))) {
flow->mod_pkt = realloc(flow->mod_pkt,(sizeof(char)*(flow->client_size + ether_len + ip_len + tcp_len)));
flow->mod_pkt_size = (sizeof(char) * (flow->client_size + ether_len + ip_len + tcp_len));
}
memset(flow->mod_pkt, 0, (sizeof(char) * (flow->client_size + ether_len + ip_len + tcp_len)));
assert(flow->mod_pkt!=NULL);
memcpy(flow->mod_pkt, eth, ether_len);
memcpy(&flow->mod_pkt[ether_len], ip, ip_len);
......@@ -122,7 +113,7 @@ void create_mod_pkt(unsigned char *dev_pkt,struct mapidlibflow *flow,mapid_pkthd
void tcp_callback(struct tcp_stream *ns, MAPI_UNUSED void **param)
{
struct mapidlibflow *flow;
struct cooking_data *flow;
flow=ns->flow;
......@@ -177,8 +168,8 @@ void tcp_callback(struct tcp_stream *ns, MAPI_UNUSED void **param)
flow->ret_client_headers = ns->client.headers;
flow->ret_server_headers = ns->server.headers;
flow=(struct mapidlibflow *)(ns->flow);
create_mod_pkt(last_dev_pkt,flow,&flow->mod_pkt_head);
flow=(struct cooking_data *)(ns->flow);
create_mod_pkt(last_dev_pkt,flow,flow->mod_pkt_head);
//process_flushed_data(flow);
return;
}
......@@ -353,6 +344,8 @@ static int cook_init(mapidflib_function_instance_t *instance,MAPI_UNUSED int fd)
data->timeout=getargint(&fargs);
data->id=cooking_id;
cooking_id++;
instance->hwinfo->cap_length = data->threshold + 1000; // adding 1000 in order to avoid overflowing the buffer
desc.fd = 1;
desc.linktype = instance->hwinfo->link_type;
......@@ -376,22 +369,20 @@ static int cook_init(mapidflib_function_instance_t *instance,MAPI_UNUSED int fd)
// return 1 in order for processing to continue in other functions
// return 0 not to
static int cook_process(mapidflib_function_instance_t *instance,MAPI_UNUSED const unsigned char* dev_pkt,const unsigned char* link_pkt, mapid_pkthdr_t* pkt_head)
static int cook_process(mapidflib_function_instance_t *instance,MAPI_UNUSED unsigned char* dev_pkt,unsigned char* link_pkt, mapid_pkthdr_t* pkt_head)
{
struct pcap_pkthdr h;
ether_header* eth = NULL;
struct ip *iph;
struct tcphdr *tcph;
struct ip *iph = NULL;
struct tcphdr *tcph = NULL;
int ether_len = 0, ip_len = 0;
struct mapidlibflow *flow;
struct cooking_data* data;
struct headers_data *headers;
struct cooking_data* flow=NULL;
struct headers_data *headers = NULL;
data= (struct cooking_data*)(instance->internal_data);
threshold = data->threshold;
timeout = data->timeout;
flow=data->flow;
flow = (struct cooking_data*)(instance->internal_data);
threshold = flow->threshold;
timeout = flow->timeout;
//fprintf(stderr,"I am COOKING\n");
......@@ -408,6 +399,7 @@ static int cook_process(mapidflib_function_instance_t *instance,MAPI_UNUSED cons
flow->ret_client_data = NULL;
flow->ret_server_data = NULL;
flow->client_size=flow->server_size=0;
flow->decoded_packet = NULL;
eth = (ether_header*)link_pkt;
ether_len = sizeof(ether_header);
......@@ -417,19 +409,19 @@ static int cook_process(mapidflib_function_instance_t *instance,MAPI_UNUSED cons
return 1;
//printf("i got a packet %d\n",data->id);
nids_mapi_next(&h, (unsigned char *)link_pkt,data->id);
nids_mapi_next(&h, (unsigned char *)link_pkt,flow->id);
if(status == NON_CHECKED)
{
//fprintf(stderr,"\tnon check report\n");
fprintf(stderr,"\tnon check report\n");
struct tcp_stream *stream;
int from_client;
tcph = (struct tcphdr *)(link_pkt + ether_len + ip_len);
stream= find_stream(tcph,iph,&from_client,data->id);
stream= find_stream(tcph,iph,&from_client,flow->id);
if(stream) {
//fprintf(stderr,"\tStream found\n");
fprintf(stderr,"\tStream found\n");
headers = malloc(sizeof(struct headers_data));
headers->header = malloc(pkt_head->caplen); //added 100 more bytes
memcpy(headers->header,link_pkt,pkt_head->caplen);
......@@ -454,19 +446,29 @@ static int cook_process(mapidflib_function_instance_t *instance,MAPI_UNUSED cons
stream->flow=(void *)flow;
}
else { //unsolicited data
//fprintf(stderr,"Stream not found\n");
else { // unsolicited data
fprintf(stderr,"Stream not found\n");
return 1;
}
printf("here come a packet 1\n");
return 0;
}
else {
struct tcp_stream *stream;
int from_client;
//fprintf(stderr,"\tcheck report %d\n",flow->client_size);
fprintf(stderr,"\tcheck report %d caplen %d\n",flow->client_size, pkt_head->caplen);
tcph = (struct tcphdr *)(link_pkt + ether_len + ip_len);
if(headers != NULL) {
if(headers->header != NULL) {
free(headers->header);
headers->header = NULL;
}
free(headers);
headers = NULL;
}
headers = malloc(sizeof(struct headers_data));
headers->header = malloc(pkt_head->caplen);
memcpy(headers->header, link_pkt,pkt_head->caplen);
......@@ -475,11 +477,12 @@ static int cook_process(mapidflib_function_instance_t *instance,MAPI_UNUSED cons
headers->ts.tv_sec = pkt_head->ts; //XXX
headers->ts.tv_usec = pkt_head->ts;
stream= find_stream(tcph,iph,&from_client,data->id);
stream= find_stream(tcph,iph,&from_client,flow->id);
if(stream==NULL) {
//fprintf(stderr,"\tNULL stream %d %d\n",headers->ts.tv_sec,headers->ts.tv_usec);
// fprintf(stderr,"\tNULL stream %d %d\n",headers->ts.tv_sec,headers->ts.tv_usec);
create_mod_pkt((unsigned char *)link_pkt,flow,pkt_head);
flist_append(flow->server_headers,0, (void *)headers);
memcpy(link_pkt, flow->mod_pkt, pkt_head->caplen);
flow->cooked = 1;
return 1;
}
......@@ -505,6 +508,10 @@ static int cook_process(mapidflib_function_instance_t *instance,MAPI_UNUSED cons
{
// Set pseudoheader and new cooked packet to return to the daemon
create_mod_pkt((unsigned char *)link_pkt,flow,pkt_head);
memcpy(link_pkt, flow->mod_pkt, pkt_head->caplen);
printf("packet came from here 2----------------------------------------------- %d %d\n", pkt_head->caplen, sizeof(link_pkt));
flow->cooked = 1;
return 1;
}
......
......@@ -11,7 +11,25 @@ struct cooking_data
int threshold;
int timeout;
int id;
struct mapidlibflow *flow;
mapid_pkthdr_t *mod_pkt_head;
unsigned char *mod_pkt;
unsigned int mod_pkt_size;
unsigned char *server_mod_pkt;
mapid_pkthdr_t server_mod_pkt_head;
flist_t *client_headers;
flist_t *server_headers;
unsigned int client_size;
unsigned int server_size;
flist_t *ret_client_headers;
flist_t *ret_server_headers;
unsigned char* ret_client_data;
unsigned char* ret_server_data;
char uncook_ready;
void *decoded_packet;
char cooked;
};
struct headers_data {
......
......@@ -85,8 +85,8 @@ static int dist_init(mapidflib_function_instance_t *instance,
}
static int dist_process(mapidflib_function_instance_t *instance,
MAPI_UNUSED const unsigned char* dev_pkt,
MAPI_UNUSED const unsigned char* link_pkt,
MAPI_UNUSED unsigned char* dev_pkt,
MAPI_UNUSED unsigned char* link_pkt,
MAPI_UNUSED mapid_pkthdr_t* pkt_head)
{
unsigned long long *res;
......
......@@ -20,8 +20,8 @@ static int gap_init(mapidflib_function_instance_t *instance,
}
static int gap_process(mapidflib_function_instance_t *instance,
MAPI_UNUSED const unsigned char* dev_pkt,
MAPI_UNUSED const unsigned char* link_pkt,
MAPI_UNUSED unsigned char* dev_pkt,
MAPI_UNUSED unsigned char* link_pkt,
mapid_pkthdr_t* pkt_head)
{
unsigned long long *gap,*old;
......
......@@ -51,8 +51,8 @@ static int getres_init(mapidflib_function_instance_t *instance,
}
static int getres_process(mapidflib_function_instance_t *instance,
MAPI_UNUSED const unsigned char* dev_pkt,
MAPI_UNUSED const unsigned char* link_pkt,
MAPI_UNUSED unsigned char* dev_pkt,
MAPI_UNUSED unsigned char* link_pkt,
MAPI_UNUSED mapid_pkthdr_t* pkt_head)
{
getres_internal_t *i=instance->internal_data;
......
......@@ -22,8 +22,8 @@ static int hash_init(mapidflib_function_instance_t *instance,
}
static int hash_process(mapidflib_function_instance_t *instance,
const unsigned char* dev_pkt,
MAPI_UNUSED const unsigned char* link_pkt,
unsigned char* dev_pkt,
MAPI_UNUSED unsigned char* link_pkt,
mapid_pkthdr_t* pkt_head)
{
int len,i,prime=500009;
......
......@@ -169,8 +169,8 @@ static int hashsamp_init(mapidflib_function_instance_t *instance,
}
static int hashsamp_process(mapidflib_function_instance_t *instance,
MAPI_UNUSED const unsigned char* dev_pkt,
const unsigned char* pkt,
MAPI_UNUSED unsigned char* dev_pkt,
unsigned char* pkt,
mapid_pkthdr_t* pkt_head)
{
samp_buffer_t *mbuf=instance->internal_data;
......
......@@ -119,8 +119,8 @@ static int bpf_init(mapidflib_function_instance_t *instance,
}
static int bpf_process(mapidflib_function_instance_t *instance,
const unsigned char* dev_pkt,
const unsigned char* link_pkt,
unsigned char* dev_pkt,
unsigned char* link_pkt,
mapid_pkthdr_t* pkt_head)
{
int res;
......
......@@ -9,8 +9,8 @@
#include "fhelp.h"
static int pktc_process(mapidflib_function_instance_t *instance,
MAPI_UNUSED const unsigned char* dev_pkt,
MAPI_UNUSED const unsigned char* link_pkt,
MAPI_UNUSED unsigned char* dev_pkt,
MAPI_UNUSED unsigned char* link_pkt,
MAPI_UNUSED mapid_pkthdr_t* pkt_head)
{
(*(unsigned long long*)instance->result.data)++;
......
......@@ -29,8 +29,8 @@ static int pktinfo_instance(mapidflib_function_instance_t *instance,
};
static int pktinfo_process_size(mapidflib_function_instance_t *instance,
MAPI_UNUSED const unsigned char* dev_pkt,
MAPI_UNUSED const unsigned char* link_pkt,
MAPI_UNUSED unsigned char* dev_pkt,
MAPI_UNUSED unsigned char* link_pkt,
mapid_pkthdr_t* pkt_head)
{
(*(unsigned long long*)instance->result.data)=(unsigned long long)pkt_head->wlen;
......@@ -57,8 +57,8 @@ static int pktinfo_init(mapidflib_function_instance_t *instance,
}