Commit 7e0db22b authored by 's avatar
Browse files

various fixes



git-svn-id: file:///home/svn/mapi/trunk@189 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 82d8d289
......@@ -6,7 +6,7 @@ CFLAGS=-g -O2 $(C_WARNINGS) $(C_FEATURES)
TARGETS= mapi.so mapid build_tests build_dmapi_tests build_agent mapinicdrv.so mapinicdrv_buf.so mapidstdflib.so anonlib.so flist.o list.o parseconf.o priorities.o $(ADMCTRLCL_TARGETS)
.PHONY: build_stdlib build_combo6lib build_daglib build_ipfixlib build_etherlib
.PHONY: build_stdlib build_anonlib build_combo6lib build_daglib build_ipfixlib build_etherlib
DAG=
ifeq ($(WITH_DAG),1)
......@@ -132,7 +132,7 @@ mapicombo6drv.so: mapicombo6drv.o mapidlib.o flist.o mapiipc.o mstring.o mapilib
mapidstdflib.so: build_stdlib
cd stdlib && make
anonlib.so:
anonlib.so: build_anonlib
cd anonymization && make
combo6flib.so: build_combo6lib
......
......@@ -8,7 +8,7 @@ TARGETS= anonlib.so
all: $(TARGETS)
anonlib.o: anonlib.c ../mapidflib.h ../mapi.h
gcc $(CFLAGS) -c $<
anonlib.so: anonlib.o anonymize.o uncook.o ../mapiipc.o decoders.o anon_snort_decode.o anon_print_packet.o anon_checksums.o anon_prefix_preserving.o md5.o sha1.o sha256.o anonymization_functions.o prefix_preserving_map.o print_packet.o crc32.o des.o aes.o pcre/libpcre.a
anonlib.so: anonlib.o anonymize.o uncook.o ../mapiipc.o ../flist.o decoders.o anon_snort_decode.o anon_print_packet.o anon_checksums.o anon_prefix_preserving.o md5.o sha1.o sha256.o anonymization_functions.o prefix_preserving_map.o print_packet.o crc32.o des.o aes.o pcre/libpcre.a
gcc $(CFLAGS) -shared -o $@ $^ -lfl -lrt -lpcap -lm -L../ -L. $(LIB_DIR)
cp $@ ..
......
No preview for this file type
......@@ -923,7 +923,7 @@ void anonymize_field(int protocol, int field, int function,mapipacket *packet,st
mapid_pkthdr_t *last_header_seen=NULL;
mapipacket decoded_packet;
extern int client_size;
extern unsigned int client_size;
int anonymize_stream(mapidflib_function_instance_t *instance,struct mapidlibflow *flow,struct anonymize_data *params,mapid_pkthdr_t* pkt_head) {
struct pcap_pkthdr pkthdr;
......@@ -938,13 +938,12 @@ int anonymize_stream(mapidflib_function_instance_t *instance,struct mapidlibflow
flow->decoded_packet=&decoded_packet;
decode_packet(instance->hwinfo->link_type,instance->hwinfo->cap_length,&pkthdr,flow->mod_pkt,flow->decoded_packet);
((mapipacket *)flow->decoded_packet)->dsize=client_size;
((mapipacket *)flow->decoded_packet)->dsize=get_client_size();
if(((mapipacket *)flow->decoded_packet)->data==NULL) { //decoder does not work well above 65536
((mapipacket *)flow->decoded_packet)->data = ((mapipacket *)flow->decoded_packet)->pkt+(mapi_head->caplen - client_size);
((mapipacket *)flow->decoded_packet)->data = ((mapipacket *)flow->decoded_packet)->pkt+(mapi_head->caplen - get_client_size());
}
last_header_seen = mapi_head;
//fprintf(stderr,"anonymize_stream:: %d %d %d\n",mapi_head->caplen,flow->decoded_packet->dsize,client_size);
anonymize_field(params->protocol,params->field,params->function,flow->decoded_packet,params);
......
......@@ -60,6 +60,12 @@ int callbacks=0;
struct mapidlibflow *cook_tmp_flow;
int get_client_size();
int get_client_size() {
return client_size;
}
static int cook_instance(mapidflib_function_instance_t* instance, flist_t *flist, mapidflib_flow_mod_t *flow_mod,function_manipulation_t* manip)
{
......@@ -134,6 +140,10 @@ void create_mod_pkt(unsigned char *dev_pkt,struct mapidlibflow *flow,mapid_pkthd
pkt_head->wlen = client_size + ether_len + ip_len + tcp_len;
}
void process_flushed_data(struct mapidlibflow *flow) {
}
void tcp_callback(struct tcp_stream *ns, void **param)
{
callbacks++;
......
......@@ -643,3 +643,38 @@ generated by GNU Autoconf 2.57. Invocation command line was
on atropos
config.status:680: creating include/libnet.h
## ---------------------- ##
## Running config.status. ##
## ---------------------- ##
This file was extended by config.status, which was
generated by GNU Autoconf 2.57. Invocation command line was
CONFIG_FILES =
CONFIG_HEADERS =
CONFIG_LINKS =
CONFIG_COMMANDS =
$ ./config.status include/config.h
on atropos
config.status:784: creating include/config.h
config.status:905: include/config.h is unchanged
## ---------------------- ##
## Running config.status. ##
## ---------------------- ##
This file was extended by config.status, which was
generated by GNU Autoconf 2.57. Invocation command line was
CONFIG_FILES =
CONFIG_HEADERS =
CONFIG_LINKS =
CONFIG_COMMANDS =
$ ./config.status include/libnet.h
on atropos
config.status:680: creating include/libnet.h
No preview for this file type
Supports Markdown
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