about summary refs log tree commit diff stats
path: root/examples
diff options
context:
space:
mode:
authorMarc <foxtrot@malloc.me>2021-12-11 15:24:52 +0000
committerMarc <foxtrot@malloc.me>2021-12-11 15:24:52 +0000
commit8e09d29df19312583747a3de00fe4269c17e6586 (patch)
tree335d413c994671515ef971a4c42ed6048deacf3a /examples
parentd40ddfe15dacab59b2911b59adb0d087b94ccc03 (diff)
downloadlibwifi-8e09d29df19312583747a3de00fe4269c17e6586.tar.gz
libwifi-8e09d29df19312583747a3de00fe4269c17e6586.tar.bz2
libwifi-8e09d29df19312583747a3de00fe4269c17e6586.zip
examples: Remove capture filter from parser examples
Diffstat (limited to 'examples')
-rw-r--r--examples/parse_beacon/parse_beacon.c9
-rw-r--r--examples/parse_eapol/parse_eapol.c7
2 files changed, 1 insertions, 15 deletions
diff --git a/examples/parse_beacon/parse_beacon.c b/examples/parse_beacon/parse_beacon.c index 4e320b7..2a61c5f 100644 --- a/examples/parse_beacon/parse_beacon.c +++ b/examples/parse_beacon/parse_beacon.c
@@ -109,12 +109,11 @@ void handle_pkt(unsigned char *args, const struct pcap_pkthdr *header, const uns
109} 109}
110 110
111void helpexit() { 111void helpexit() {
112 fprintf(stderr, "[!] Usage: ./parse_eapol --file <file.pcap>\n"); 112 fprintf(stderr, "[!] Usage: ./parse_beacon --file <file.pcap>\n");
113 exit(EXIT_FAILURE); 113 exit(EXIT_FAILURE);
114} 114}
115 115
116int main(int argc, char **argv) { 116int main(int argc, char **argv) {
117 struct bpf_program *filter = NULL;
118 pcap_t *handle = NULL; 117 pcap_t *handle = NULL;
119 pcap_dumper_t *dumper = NULL; 118 pcap_dumper_t *dumper = NULL;
120 char errbuf[PCAP_ERRBUF_SIZE]; 119 char errbuf[PCAP_ERRBUF_SIZE];
@@ -141,12 +140,6 @@ int main(int argc, char **argv) {
141 exit(EXIT_FAILURE); 140 exit(EXIT_FAILURE);
142 } 141 }
143 142
144 if ((filter = malloc(sizeof(struct bpf_program))) == NULL) {
145 fprintf(stderr, "[!] There was an error allocating memory for the filter.\n");
146 pcap_close(handle);
147 exit(EXIT_FAILURE);
148 }
149
150 printf("[+] Setup Complete\n"); 143 printf("[+] Setup Complete\n");
151 144
152 dumper = pcap_dump_open(handle, "/tmp/parse_beacon.pcap"); 145 dumper = pcap_dump_open(handle, "/tmp/parse_beacon.pcap");
diff --git a/examples/parse_eapol/parse_eapol.c b/examples/parse_eapol/parse_eapol.c index 259ee5f..cf35a6f 100644 --- a/examples/parse_eapol/parse_eapol.c +++ b/examples/parse_eapol/parse_eapol.c
@@ -95,7 +95,6 @@ void helpexit() {
95} 95}
96 96
97int main(int argc, char **argv) { 97int main(int argc, char **argv) {
98 struct bpf_program *filter = NULL;
99 pcap_t *handle = NULL; 98 pcap_t *handle = NULL;
100 pcap_dumper_t *dumper = NULL; 99 pcap_dumper_t *dumper = NULL;
101 char errbuf[PCAP_ERRBUF_SIZE]; 100 char errbuf[PCAP_ERRBUF_SIZE];
@@ -122,12 +121,6 @@ int main(int argc, char **argv) {
122 exit(EXIT_FAILURE); 121 exit(EXIT_FAILURE);
123 } 122 }
124 123
125 if ((filter = malloc(sizeof(struct bpf_program))) == NULL) {
126 fprintf(stderr, "[!] There was an error allocating memory for the filter.\n");
127 pcap_close(handle);
128 exit(EXIT_FAILURE);
129 }
130
131 printf("[+] Setup Complete\n"); 124 printf("[+] Setup Complete\n");
132 125
133 dumper = pcap_dump_open(handle, "/tmp/parse_eapol.pcap"); 126 dumper = pcap_dump_open(handle, "/tmp/parse_eapol.pcap");