diff --git a/platform/netsim/Makefile.netsim b/platform/netsim/Makefile.netsim index 4ed8a13d2..b69f3e686 100644 --- a/platform/netsim/Makefile.netsim +++ b/platform/netsim/Makefile.netsim @@ -9,10 +9,10 @@ CONTIKI_TARGET_DIRS = . dev apps net SENSORS = sensors.c beep.c button-sensor.c pir-sensor.c vib-sensor.c \ radio-sensor.c irq.c eeprom.c \ dummy-sensors.c leds.c leds-arch.c esb-sensors.c -NETSIM = ether.c ethernode.c ethernode-drv.c tr1001.c tr1001-drv.c lpm.c \ +NETSIM = ether.c ethernode.c ethernode-drv.c lpm.c \ tapdev-drv.c tapdev-service.c tapdev.c rs232.c flash.c \ node.c nodes.c sensor.c display.c random.c radio.c \ - dlloader.c main.c init.c contiki-main.c symtab.c symbols.c + dlloader.c main.c init.c contiki-main.c symtab.c symbols.c #tr1001.c tr1001-drv.c CONTIKI_TARGET_SOURCEFILES = $(NETSIM) $(SENSORS) diff --git a/platform/netsim/net/ethernode-drv.c b/platform/netsim/net/ethernode-drv.c index 094397507..99a4c9e37 100644 --- a/platform/netsim/net/ethernode-drv.c +++ b/platform/netsim/net/ethernode-drv.c @@ -30,7 +30,7 @@ * * Author: Adam Dunkels * - * $Id: ethernode-drv.c,v 1.2 2006/10/06 08:25:31 adamdunkels Exp $ + * $Id: ethernode-drv.c,v 1.3 2006/10/09 11:56:49 adamdunkels Exp $ */ #include "contiki.h" @@ -50,7 +50,7 @@ enum { NULLEVENT }; u8_t ethernode_drv_send(void) { - uip_len = hc_compress(); + uip_len = hc_compress(&uip_buf[UIP_LLH_LEN], uip_len); return ethernode_send(); } @@ -73,9 +73,16 @@ PROCESS_THREAD(ethernode_drv_process, ev, data) /* if((random_rand() % drop) <= drop / 2) { printf("Bropp\n"); } else*/ { - - uip_len = hc_inflate(); - + + uip_len = hc_inflate(&uip_buf[UIP_LLH_LEN], uip_len); + + { + char buf[40]; + tcpdump_format(&uip_buf[UIP_LLH_LEN], uip_len, buf, sizeof(buf)); + printf("radio_sniffer: packet length %d, %s\n", uip_len, buf); + + } + tapdev_send_raw(); /* if(uip_fw_forward() == UIP_FW_LOCAL)*/ { /* A frame was avaliable (and is now read into the uip_buf), so