ongrep

A cleaned up fork of ngrep for OpenBSD
git clone git://git.sgregoratto.me/ongrep
Log | Files | Refs | README | LICENSE

commit ba65100428c8af3b8347b183350fa0571a02a702
parent adfeb84cb5fe5f9da70bc487e399a8cb97e71658
Author: Stephen Gregoratto <dev@sgregoratto.me>
Date:   Tue, 15 Sep 2020 17:48:41 +1000

replace custom rtaphdr_t with base radiotap_header

Diffstat:
Mngrep.c | 6+++++-
Mngrep.h | 7-------
2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/ngrep.c b/ngrep.c @@ -22,6 +22,8 @@ #include <netinet/tcp.h> #include <netinet/udp.h> +#include <net80211/ieee80211_radiotap.h> + #include <arpa/inet.h> #include <ctype.h> #include <err.h> @@ -641,7 +643,9 @@ process(UNUSED u_char *d, struct pcap_pkthdr *h, u_char *p) seen_frames++; if (radiotap_present) { - uint16_t radio_len = ((struct NGREP_rtaphdr_t *)p)->it_len; + struct ieee80211_radiotap_header *rh = + (struct ieee80211_radiotap_header*)p; + uint16_t radio_len = rh->it_len; ip4_pkt = (struct ip *)(p + link_offset + radio_len); len -= radio_len; } diff --git a/ngrep.h b/ngrep.h @@ -101,13 +101,6 @@ uint8_t strishex(char *); void drop_privs(void); -struct NGREP_rtaphdr_t { - uint8_t it_version; - uint8_t it_pad; - uint16_t it_len; - uint32_t it_present; -}; - /* ANSI color/hilite stuff. */ const char ANSI_red[] = "\33[01;31m"; const char ANSI_bold[] = "\33[01m";