File: 0004-include-pcap.h-outside-namespace.patch

package info (click to toggle)
pktanon 2~git20160407.0.2bde4f2%2Bdfsg-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,592 kB
  • sloc: cpp: 5,509; xml: 828; exp: 767; makefile: 121; ansic: 16; sh: 12
file content (29 lines) | stat: -rw-r--r-- 962 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Description: Move #include <pcap.h> outside namespace
 Utils.h includes pcap.h from within the pktannon namespace, this causes system
 structures to be incorrectly placed in the pktanon namespace breaking stuff
 later. This patch moves the include outside of the namespace.
Author: Peter Michael Green <plugwash@debian.org>

--- pktanon-2~git20160407.0.2bde4f2+dfsg.orig/src/Utils.h
+++ pktanon-2~git20160407.0.2bde4f2+dfsg/src/Utils.h
@@ -13,6 +13,11 @@
 #include <PktAnon.h>
 // #include <transformations/ErrorCodes.h>
 
+# ifdef HAVE_LIBPCAP
+
+# include <pcap.h>
+# endif
+
 namespace pktanon
 {
 
@@ -35,8 +40,6 @@ inline void transform_packet ( PCAP_REC_
 
 # ifdef HAVE_LIBPCAP
 
-# include <pcap.h>
-
 inline void transform_packet ( struct pcap_pkthdr* pkt_header, const uint8_t* original_packet, uint8_t* transformed_packet, Stats& stats )
 {
   auto new_pkt_len = PktAnon::transform_packet ( original_packet, transformed_packet,  pkt_header->caplen );