@@ -24,12 +24,9 @@ void process_frame(pibs_t* pibs, wtap *wth,
24
24
uint8_t * eth )
25
25
{
26
26
struct ip * ipv4 ;
27
- uint32_t ip ;
28
27
struct tcphdr * tcp ;
29
- int_fast64_t lastseen ;
30
28
unsigned char * buf ;
31
29
size_t length ;
32
- struct pcap_pkthdr pchdr ;
33
30
34
31
buf = eth + 14 ;
35
32
length = wth -> rec .rec_header .packet_header .caplen - 14 ;
@@ -46,37 +43,9 @@ void process_frame(pibs_t* pibs, wtap *wth,
46
43
47
44
tcp = (struct tcphdr * )(buf + sizeof (struct ip ));
48
45
49
- memcpy (& ip , & ipv4 -> ip_src , 4 );
50
- // Record only source ips where syn flag is set
51
- // TODO check other connection establishment alternatives
52
- if (tcp -> th_flags == 2 ){
53
- insert_ip (pibs , ip , wth -> rec .ts .secs );
54
- return ;
55
- }
46
+ synseen_process_frame (pibs , wth , eth , ipv4 , tcp );
56
47
57
- lastseen = get_last_timestamp (pibs , ip );
58
-
59
- if (lastseen > 0 ){
60
- HDBG ("IP %x %s was already seen before at %ld. Time difference %ld.\n"
61
- , ip , inet_ntoa (ipv4 -> ip_src ), lastseen , wth -> rec .ts .secs - lastseen );
62
- return ;
63
- }
64
- // TODO keep these IPs in a hashtable and rank them
65
- if (pibs -> show_backscatter ) {
66
- printf ("%ld,%s,%d,%d\n" ,
67
- wth -> rec .ts .secs , inet_ntoa (ipv4 -> ip_src ), tcp -> th_flags ,
68
- ntohs (tcp -> th_sport ));
69
- }
70
- //TODO relative time
71
- //Purge old ips?
72
- if (pibs -> should_writepcap ) {
73
- pchdr .ts .tv_sec = wth -> rec .ts .secs ;
74
- //TODO other part of the timestamp
75
- pchdr .ts .tv_usec = wth -> rec .ts .nsecs / 1000 ;
76
- pchdr .caplen = wth -> rec .rec_header .packet_header .caplen ;
77
- pchdr .len = wth -> rec .rec_header .packet_header .len ;
78
- pcap_dump ((u_char * )pibs -> dumper , & pchdr , eth );
79
- }
48
+ //Put other frame processing activities here
80
49
}
81
50
82
51
void process_file (pibs_t * pibs )
0 commit comments