GNU Radio's FOO Package
wireshark_connector_impl.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2013 Bastian Bloessl <bloessl@ccs-labs.org>
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef INCLUDED_FOO_WIRESHARK_CONNECTOR_IMPL_H
18#define INCLUDED_FOO_WIRESHARK_CONNECTOR_IMPL_H
19
21#include <boost/cstdint.hpp>
22
23namespace gr {
24namespace foo {
25
27 private:
28 uint8_t encoding_to_rate(uint64_t encoding);
29 void handle_pdu(pmt::pmt_t pdu);
30
31 bool d_debug;
32 int d_msg_offset;
33 int d_msg_len;
34 char* d_msg;
35 LinkType d_link;
36 public:
38 int general_work(int noutput, gr_vector_int& ninput_items,
39 gr_vector_const_void_star& input_items,
40 gr_vector_void_star& output_items );
41 };
42
43 #pragma pack(push, 1)
45 uint32_t magic_number; /* magic number */
46 uint16_t version_major; /* major version number */
47 uint16_t version_minor; /* minor version number */
48 int32_t thiszone; /* GMT to local correction */
49 uint32_t sigfigs; /* accuracy of timestamps */
50 uint32_t snaplen; /* max length of captured packets, in octets */
51 uint32_t network; /* data link type */
52 };
53 #pragma pack(pop)
54
55 #pragma pack(push, 1)
56 struct pcap_hdr {
57 uint32_t ts_sec; /* timestamp seconds */
58 uint32_t ts_usec; /* timestamp microseconds */
59 uint32_t incl_len; /* number of octets of packet saved in file */
60 uint32_t orig_len; /* actual length of packet */
61 };
62 #pragma pack(pop)
63
64 #pragma pack(push, 1)
65 struct radiotap_hdr {
66 uint16_t version;
67 uint16_t hdr_length;
68 uint32_t bitmap;
69 uint8_t flags;
70 uint8_t rate;
71 uint32_t channel;
72 uint8_t signal;
73 uint8_t noise;
74 uint8_t antenna;
75 };
76 #pragma pack(pop)
77
78 #pragma pack(push, 1)
79 // An 802.15.4 TAP header as defined in https://gitlab.com/exegin/ieee802-15-4-tap/
80 struct tap_hdr {
81 uint8_t version;
82 uint8_t reserved;
83 uint16_t length;
84 };
85 #pragma pack(pop)
86
87
88 #pragma pack(push, 1)
89 struct tap_tlv_fcs {
90 uint16_t type; // FCS_TYPE = 0
91 uint16_t length; // 1
92 uint8_t fcs_type; // 0 = None, 1 = 16-bit CRC, 2 = 32-bit CRC
93 uint8_t padding[3]; // Should be 0 padded
94 };
95 #pragma pack(pop)
96
97 #pragma pack(push, 1)
99 uint16_t type; // CHANNEL_ASSIGNMENT = 3
100 uint16_t length; // 3
103 uint8_t padding; // Should be 0 padded
104 };
105 #pragma pack(pop)
106
107 #pragma pack(push, 1)
108 struct tap_tlv_lqi {
109 uint16_t type; // LQI_TYPE = 10
110 uint16_t length; // 1
111 uint8_t lqi;
112 uint8_t padding[3]; // Should be 0 padded
113 };
114 #pragma pack(pop)
115
116} // namespace foo
117} // namespace gr
118
119#endif /* INCLUDED_FOO_WIRESHARK_CONNECTOR_IMPL_H */
wireshark_connector_impl(LinkType type, bool debug)
int general_work(int noutput, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
Definition wireshark_connector.h:33
Definition burst_tagger.h:28
LinkType
Definition wireshark_connector.h:26
Definition burst_tagger.h:27
Definition wireshark_connector_impl.h:44
uint16_t version_major
Definition wireshark_connector_impl.h:46
uint32_t snaplen
Definition wireshark_connector_impl.h:50
uint32_t network
Definition wireshark_connector_impl.h:51
int32_t thiszone
Definition wireshark_connector_impl.h:48
uint32_t magic_number
Definition wireshark_connector_impl.h:45
uint16_t version_minor
Definition wireshark_connector_impl.h:47
uint32_t sigfigs
Definition wireshark_connector_impl.h:49
Definition wireshark_connector_impl.h:56
uint32_t ts_sec
Definition wireshark_connector_impl.h:57
uint32_t incl_len
Definition wireshark_connector_impl.h:59
uint32_t orig_len
Definition wireshark_connector_impl.h:60
uint32_t ts_usec
Definition wireshark_connector_impl.h:58
Definition wireshark_connector_impl.h:65
uint8_t signal
Definition wireshark_connector_impl.h:72
uint16_t hdr_length
Definition wireshark_connector_impl.h:67
uint32_t channel
Definition wireshark_connector_impl.h:71
uint8_t rate
Definition wireshark_connector_impl.h:70
uint32_t bitmap
Definition wireshark_connector_impl.h:68
uint8_t noise
Definition wireshark_connector_impl.h:73
uint16_t version
Definition wireshark_connector_impl.h:66
uint8_t flags
Definition wireshark_connector_impl.h:69
uint8_t antenna
Definition wireshark_connector_impl.h:74
Definition wireshark_connector_impl.h:80
uint16_t length
Definition wireshark_connector_impl.h:83
uint8_t reserved
Definition wireshark_connector_impl.h:82
uint8_t version
Definition wireshark_connector_impl.h:81
Definition wireshark_connector_impl.h:98
uint16_t channel_number
Definition wireshark_connector_impl.h:101
uint16_t length
Definition wireshark_connector_impl.h:100
uint8_t padding
Definition wireshark_connector_impl.h:103
uint8_t channel_page
Definition wireshark_connector_impl.h:102
uint16_t type
Definition wireshark_connector_impl.h:99
Definition wireshark_connector_impl.h:89
uint8_t padding[3]
Definition wireshark_connector_impl.h:93
uint16_t length
Definition wireshark_connector_impl.h:91
uint16_t type
Definition wireshark_connector_impl.h:90
uint8_t fcs_type
Definition wireshark_connector_impl.h:92
Definition wireshark_connector_impl.h:108
uint16_t length
Definition wireshark_connector_impl.h:110
uint16_t type
Definition wireshark_connector_impl.h:109
uint8_t padding[3]
Definition wireshark_connector_impl.h:112
uint8_t lqi
Definition wireshark_connector_impl.h:111