tcpflow  1.6.1
About: tcpflow is a TCP/IP packet demultiplexer that captures data transmitted as part of TCP connections (flows), and stores the data in a way that is convenient for protocol analysis and debugging.
  Fossies Dox: tcpflow-1.6.1.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

datalink_wifi.cpp
Go to the documentation of this file.
1 /**
2  * wifi datalink function and callbacks to handle 802.11
3  * In addition to calling process_packet_info() for the packets,
4  * it maintains some 802.11 specific databases.
5  */
6 
7 #include "tcpflow.h"
8 #include "datalink_wifi.h"
9 
10 /**
11  * TFCB --- TCPFLOW callbacks for wifippcap
12  */
13 
14 void TFCB::Handle80211(const WifiPacket &p, u_int16_t fc, const MAC& sa, const MAC& da, const MAC& ra, const MAC& ta, const u_char *ptr, size_t len)
15 {
16 }
17 
18 void TFCB::HandleLLC(const WifiPacket &p, const struct llc_hdr_t *hdr, const u_char *rest, size_t len) {
19  sbuf_t sb(pos0_t(),rest,len,len,0,false,false,false);
20  struct timeval tv;
21  be13::packet_info pi(p.header_type,p.header,p.packet,tvshift(tv,p.header->ts),rest,len);
23 }
24 
25 void TFCB::Handle80211MgmtBeacon(const WifiPacket &p, const mgmt_header_t *hdr, const mgmt_body_t *body)
26 {
27 #ifdef DEBUG_WIFI
28  std::cerr << " " << "802.11 mgmt: " << hdr->sa << " beacon " << body->ssid.ssid << "\"";
29 #endif
30  mac_ssid bcn(hdr->sa,std::string(body->ssid.ssid));
31  mac_to_ssid[bcn] += 1;
32 }
33 
34 
35 /* Entrance point */
36 TFCB TFCB::theTFCB; // singleton
38 void dl_ieee802_11_radio(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
39 {
41 }
42 
43 void dl_prism(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
44 {
45 #ifdef DLT_PRISM_HEADER
46  theWcap.handle_packet(&TFCB::theTFCB,DLT_PRISM_HEADER,h,p);
47 #endif
48 }
void HandleLLC(const WifiPacket &p, const struct llc_hdr_t *hdr, const u_char *rest, size_t len)
void Handle80211MgmtBeacon(const WifiPacket &p, const mgmt_header_t *hdr, const mgmt_body_t *body)
static TFCB theTFCB
Definition: datalink_wifi.h:38
virtual void Handle80211(const WifiPacket &p, u_int16_t fc, const MAC &sa, const MAC &da, const MAC &ra, const MAC &ta, const u_char *ptr, size_t len)
mac_ssid_map_t mac_to_ssid
Definition: datalink_wifi.h:36
void handle_packet(WifipcapCallbacks *cbs, int header_type, const struct pcap_pkthdr *header, const u_char *packet)
Definition: wifipcap.cpp:1690
Definition: sbuf.h:70
Definition: sbuf.h:221
static void process_packet(const be13::packet_info &pi)
Definition: plugin.cpp:707
Definition: wifipcap.h:118
const u_char * packet
Definition: wifipcap.h:600
const int header_type
Definition: wifipcap.h:598
const struct pcap_pkthdr * header
Definition: wifipcap.h:599
Definition: llc.h:125
struct ssid_t ssid
Definition: wifipcap.h:486
struct timeval ts
Definition: pcap_fake.h:36
char ssid[33]
Definition: wifipcap.h:176
const timeval & tvshift(struct timeval &tv, const struct timeval &tv_)
Definition: tcpflow.h:293