Hi Mohan On 2014-08-21 at 02:00:33 +0200, Mohan Kannekanti <[email protected]> wrote: > Hi All, > > I am trying to compile netsniff-ng for our powerpc based platform. > > I am running into below issues, Can you please help me here??
The problem seems to be an issue of your compiler with the binary constants used in proto_80211_mac_hdr, since this is not proper C99, but a GCC extension. As I'm currently on holiday and don't have access to my development machine to test a fix. However, I quickly hacked together a patch (attached) which should fix the compilation errors you see. Care to give it a try? Thanks Tobias > > > $ make ARCH=powerpc CROSS_COMPILE=powerpc-linux- -C user/netsniff > make[1]: Entering directory `user/netsniff' > Cross compiling netsniff-ng toolkit (0.5.9-rc3+) for powerpc-linux: > Cross compiling netsniff-ng: > ccache powerpc-linux-gcc -std=gnu99 -dD -pipe -O2 -g -fomit-frame-pointer > -fno-strict-aliasing -fasynchronous-unwind-tables > -fno-delete-null-pointer-checks -Wall -D_REENTRANT -D_BSD_SOURCE > -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 > -DVERSION_STRING=\""0.5.9-rc3"+""\" -DVERSION_LONG=\""0.5.9-rc3"+" > (Cilonen)"\" -DETCDIRE_STRING=\"/etc/netsniff-ng\" -I. -I. > -DNEED_TCPDUMP_LIKE_FILTER -I. -DNEED_TCPDUMP_LIKE_FILTER -o > netsniff-ng/proto_80211_mac_hdr.o -c proto_80211_mac_hdr.c > proto_80211_mac_hdr.c: In function `meas_type': proto_80211_mac_hdr.c:1704: > warning: control reaches end of non-void function > proto_80211_mac_hdr.c:2876:13: invalid suffix "b0000000000000001" on > integer constant proto_80211_mac_hdr.c:2878:13: invalid suffix > "b0000000000000010" on integer constant proto_80211_mac_hdr.c:2880:13: > invalid suffix "b0000000000000100" on integer constant > proto_80211_mac_hdr.c:2882:13: invalid suffix "b0000000000001000" on > integer constant proto_80211_mac_hdr.c:2884:13: invalid suffix > "b0000000000010000" on integer constant proto_80211_mac_hdr.c:2886:13: > invalid suffix "b0000000000100000" on integer constant > proto_80211_mac_hdr.c:2888:13: invalid suffix "b0000000001000000" on > integer constant proto_80211_mac_hdr.c:2890:13: invalid suffix > "b0000000010000000" on integer constant proto_80211_mac_hdr.c:2892:13: > invalid suffix "b0000000100000000" on integer constant > proto_80211_mac_hdr.c:2894:13: invalid suffix "b0000001000000000" on > integer constant proto_80211_mac_hdr.c:2896:13: invalid suffix > "b0000010000000000" on integer constant proto_80211_mac_hdr.c:2898:13: > invalid suffix "b0000100000000000" on integer constant > proto_80211_mac_hdr.c:2900:13: invalid suffix "b0001000000000000" on > integer constant > > Thanks, > Mohan. > > -- > You received this message because you are subscribed to the Google Groups > "netsniff-ng" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "netsniff-ng" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
>From 98b22bf75a217430e27785c288a0dbc0c71706c5 Mon Sep 17 00:00:00 2001 From: Tobias Klauser <[email protected]> Date: Mon, 25 Aug 2014 18:44:16 +0200 Subject: [PATCH] dissectors: 80211_mac_hdr: Remove usage of binary constants Binary constants are not C99, but a GCC extension. Moreover, Mohan reports compilation errors resulting from these constructs when using a PowerPC cross-compiler. Threfor, replace them by the corresponding hex constants. Reported-by: Mohan Kannekanti <[email protected]> Signed-off-by: Tobias Klauser <[email protected]> --- proto_80211_mac_hdr.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/proto_80211_mac_hdr.c b/proto_80211_mac_hdr.c index b3cc3ca..d61bfe4 100644 --- a/proto_80211_mac_hdr.c +++ b/proto_80211_mac_hdr.c @@ -2854,22 +2854,22 @@ static int8_t inf_elements(struct pkt_buff *pkt) return 0; } -#define ESS 0b0000000000000001 -#define IBSS 0b0000000000000010 -#define CF_Pollable 0b0000000000000100 -#define CF_Poll_Req 0b0000000000001000 -#define Privacy 0b0000000000010000 -#define Short_Pre 0b0000000000100000 -#define PBCC 0b0000000001000000 -#define Ch_Agility 0b0000000010000000 -#define Spec_Mgmt 0b0000000100000000 -#define QoS 0b0000001000000000 -#define Short_Slot_t 0b0000010000000000 -#define APSD 0b0000100000000000 -#define Radio_Meas 0b0001000000000000 -#define DSSS_OFDM 0b0010000000000000 -#define Del_Block_ACK 0b0100000000000000 -#define Imm_Block_ACK 0b1000000000000000 +#define ESS 0x0001 +#define IBSS 0x0002 +#define CF_Pollable 0x0004 +#define CF_Poll_Req 0x0008 +#define Privacy 0x0010 +#define Short_Pre 0x0020 +#define PBCC 0x0040 +#define Ch_Agility 0x0080 +#define Spec_Mgmt 0x0100 +#define QoS 0x0200 +#define Short_Slot_t 0x0400 +#define APSD 0x0800 +#define Radio_Meas 0x1000 +#define DSSS_OFDM 0x2000 +#define Del_Block_ACK 0x4000 +#define Imm_Block_ACK 0x8000 static int8_t cap_field(u16 cap_inf) { -- 1.7.10.4
