From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Nov 4 06:40:01 2007 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A66A16A419 for ; Sun, 4 Nov 2007 06:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 1CA1813C4B6 for ; Sun, 4 Nov 2007 06:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id lA46e07Q033420 for ; Sun, 4 Nov 2007 06:40:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id lA46e0UU033419; Sun, 4 Nov 2007 06:40:00 GMT (envelope-from gnats) Resent-Date: Sun, 4 Nov 2007 06:40:00 GMT Resent-Message-Id: <200711040640.lA46e0UU033419@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Yonatan Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74DA816A419 for ; Sun, 4 Nov 2007 06:31:50 +0000 (UTC) (envelope-from yonatan@laptop.afarsec.com) Received: from laptop.afarsec.com (80.178.234.56.forward.012.net.il [80.178.234.56]) by mx1.freebsd.org (Postfix) with ESMTP id 73BB913C480 for ; Sun, 4 Nov 2007 06:31:48 +0000 (UTC) (envelope-from yonatan@laptop.afarsec.com) Received: by laptop.afarsec.com (Postfix, from userid 1001) id E74D31703A; Sun, 4 Nov 2007 07:54:21 +0200 (IST) Message-Id: <20071104055421.E74D31703A@laptop.afarsec.com> Date: Sun, 4 Nov 2007 07:54:21 +0200 (IST) From: Yonatan To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/117803: Fix net-mgmt/kismet for FreeBSD 7.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Yonatan List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2007 06:40:01 -0000 >Number: 117803 >Category: ports >Synopsis: Fix net-mgmt/kismet for FreeBSD 7.0 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Nov 04 06:40:00 UTC 2007 >Closed-Date: >Last-Modified: >Originator: Yonatan >Release: FreeBSD 7.0-BETA1 i386 >Organization: Afarsec >Environment: System: FreeBSD laptop.afarsec.com 7.0-BETA1 FreeBSD 7.0-BETA1 #1: Thu Nov 1 23:06:58 IST 2007 yonatan@laptop.afarsec.com:/usr/obj/usr/src/sys/LOCAL i386 >Description: Kismet redefines some thins that are already there. It also doesn't include bpf when it should. >How-To-Repeat: Try building the port, see it break. >Fix: --- patch-pcapsource.cc begins here --- --- pcapsource.cc.orig 2007-11-04 07:30:21.000000000 +0200 +++ pcapsource.cc 2007-11-04 07:45:15.000000000 +0200 @@ -74,6 +74,10 @@ #include #include #include +#include +#include +#include +#include #ifdef HAVE_RADIOTAP #include @@ -93,29 +97,29 @@ #ifdef HAVE_RADIOTAP // Hack around some headers that don't seem to define all of these -#ifndef IEEE80211_CHAN_TURBO -#define IEEE80211_CHAN_TURBO 0x0010 /* Turbo channel */ +#ifndef KISMET_IEEE80211_CHAN_TURBO +#define KISMET_IEEE80211_CHAN_TURBO 0x0010 /* Turbo channel */ #endif -#ifndef IEEE80211_CHAN_CCK -#define IEEE80211_CHAN_CCK 0x0020 /* CCK channel */ +#ifndef KISMET_IEEE80211_CHAN_CCK +#define KISMET_IEEE80211_CHAN_CCK 0x0020 /* CCK channel */ #endif -#ifndef IEEE80211_CHAN_OFDM -#define IEEE80211_CHAN_OFDM 0x0040 /* OFDM channel */ +#ifndef KISMET_IEEE80211_CHAN_OFDM +#define KISMET_IEEE80211_CHAN_OFDM 0x0040 /* OFDM channel */ #endif -#ifndef IEEE80211_CHAN_2GHZ -#define IEEE80211_CHAN_2GHZ 0x0080 /* 2 GHz spectrum channel. */ +#ifndef KISMET_IEEE80211_CHAN_2GHZ +#define KISMET_IEEE80211_CHAN_2GHZ 0x0080 /* 2 GHz spectrum channel. */ #endif -#ifndef IEEE80211_CHAN_5GHZ -#define IEEE80211_CHAN_5GHZ 0x0100 /* 5 GHz spectrum channel */ +#ifndef KISMET_IEEE80211_CHAN_5GHZ +#define KISMET_IEEE80211_CHAN_5GHZ 0x0100 /* 5 GHz spectrum channel */ #endif -#ifndef IEEE80211_CHAN_PASSIVE -#define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */ +#ifndef KISMET_IEEE80211_CHAN_PASSIVE +#define KISMET_IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */ #endif -#ifndef IEEE80211_CHAN_DYN -#define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */ +#ifndef KISMET_IEEE80211_CHAN_DYN +#define KISMET_IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */ #endif -#ifndef IEEE80211_CHAN_GFSK -#define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */ +#ifndef KISMET_IEEE80211_CHAN_GFSK +#define KISMET_IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */ #endif #include "tcpdump-extract.h" @@ -801,14 +805,14 @@ * Convert MHz frequency to IEEE channel number. */ static u_int ieee80211_mhz2ieee(u_int freq, u_int flags) { - if (flags & IEEE80211_CHAN_2GHZ) { /* 2GHz band */ + if (flags & KISMET_IEEE80211_CHAN_2GHZ) { /* 2GHz band */ if (freq == 2484) return 14; if (freq < 2484) return (freq - 2407) / 5; else return 15 + ((freq - 2512) / 20); - } else if (flags & IEEE80211_CHAN_5GHZ) { /* 5Ghz band */ + } else if (flags & KISMET_IEEE80211_CHAN_5GHZ) { /* 5Ghz band */ return (freq - 5000) / 5; } else { /* either, guess */ if (freq == 2484) @@ -824,31 +828,31 @@ /* * Useful combinations of channel characteristics. */ -#define IEEE80211_CHAN_FHSS \ - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_GFSK) -#define IEEE80211_CHAN_A \ - (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM) -#define IEEE80211_CHAN_B \ - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_CCK) -#define IEEE80211_CHAN_PUREG \ - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM) -#define IEEE80211_CHAN_G \ - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_DYN) -#define IEEE80211_CHAN_T \ - (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO) - -#define IEEE80211_IS_CHAN_FHSS(_flags) \ - ((_flags & IEEE80211_CHAN_FHSS) == IEEE80211_CHAN_FHSS) -#define IEEE80211_IS_CHAN_A(_flags) \ - ((_flags & IEEE80211_CHAN_A) == IEEE80211_CHAN_A) -#define IEEE80211_IS_CHAN_B(_flags) \ - ((_flags & IEEE80211_CHAN_B) == IEEE80211_CHAN_B) -#define IEEE80211_IS_CHAN_PUREG(_flags) \ - ((_flags & IEEE80211_CHAN_PUREG) == IEEE80211_CHAN_PUREG) -#define IEEE80211_IS_CHAN_G(_flags) \ - ((_flags & IEEE80211_CHAN_G) == IEEE80211_CHAN_G) -#define IEEE80211_IS_CHAN_T(_flags) \ - ((_flags & IEEE80211_CHAN_T) == IEEE80211_CHAN_T) +#define KISMET_IEEE80211_CHAN_FHSS \ + (KISMET_IEEE80211_CHAN_2GHZ | KISMET_IEEE80211_CHAN_GFSK) +#define KISMET_IEEE80211_CHAN_A \ + (KISMET_IEEE80211_CHAN_5GHZ | KISMET_IEEE80211_CHAN_OFDM) +#define KISMET_IEEE80211_CHAN_B \ + (KISMET_IEEE80211_CHAN_2GHZ | KISMET_IEEE80211_CHAN_CCK) +#define KISMET_IEEE80211_CHAN_PUREG \ + (KISMET_IEEE80211_CHAN_2GHZ | KISMET_IEEE80211_CHAN_OFDM) +#define KISMET_IEEE80211_CHAN_G \ + (KISMET_IEEE80211_CHAN_2GHZ | KISMET_IEEE80211_CHAN_DYN) +#define KISMET_IEEE80211_CHAN_T \ + (KISMET_IEEE80211_CHAN_5GHZ | KISMET_IEEE80211_CHAN_OFDM | KISMET_IEEE80211_CHAN_TURBO) + +#define KISMET_IEEE80211_IS_CHAN_FHSS(_flags) \ + ((_flags & KISMET_IEEE80211_CHAN_FHSS) == KISMET_IEEE80211_CHAN_FHSS) +#define KISMET_IEEE80211_IS_CHAN_A(_flags) \ + ((_flags & KISMET_IEEE80211_CHAN_A) == KISMET_IEEE80211_CHAN_A) +#define KISMET_IEEE80211_IS_CHAN_B(_flags) \ + ((_flags & KISMET_IEEE80211_CHAN_B) == KISMET_IEEE80211_CHAN_B) +#define KISMET_IEEE80211_IS_CHAN_PUREG(_flags) \ + ((_flags & KISMET_IEEE80211_CHAN_PUREG) == KISMET_IEEE80211_CHAN_PUREG) +#define KISMET_IEEE80211_IS_CHAN_G(_flags) \ + ((_flags & KISMET_IEEE80211_CHAN_G) == KISMET_IEEE80211_CHAN_G) +#define KISMET_IEEE80211_IS_CHAN_T(_flags) \ + ((_flags & KISMET_IEEE80211_CHAN_T) == KISMET_IEEE80211_CHAN_T) int PcapSource::Radiotap2KisPack(kis_packet *packet, uint8_t *data, uint8_t *moddata) { #define BITNO_32(x) (((x) >> 16) ? 16 + BITNO_16((x) >> 16) : BITNO_16((x))) @@ -972,17 +976,17 @@ switch (bit) { case IEEE80211_RADIOTAP_CHANNEL: packet->channel = ieee80211_mhz2ieee(u.u16, u2.u16); - if (IEEE80211_IS_CHAN_FHSS(u2.u16)) + if (KISMET_IEEE80211_IS_CHAN_FHSS(u2.u16)) packet->carrier = carrier_80211dsss; - else if (IEEE80211_IS_CHAN_A(u2.u16)) + else if (KISMET_IEEE80211_IS_CHAN_A(u2.u16)) packet->carrier = carrier_80211a; - else if (IEEE80211_IS_CHAN_B(u2.u16)) + else if (KISMET_IEEE80211_IS_CHAN_B(u2.u16)) packet->carrier = carrier_80211b; - else if (IEEE80211_IS_CHAN_PUREG(u2.u16)) + else if (KISMET_IEEE80211_IS_CHAN_PUREG(u2.u16)) packet->carrier = carrier_80211g; - else if (IEEE80211_IS_CHAN_G(u2.u16)) + else if (KISMET_IEEE80211_IS_CHAN_G(u2.u16)) packet->carrier = carrier_80211g; - else if (IEEE80211_IS_CHAN_T(u2.u16)) + else if (KISMET_IEEE80211_IS_CHAN_T(u2.u16)) packet->carrier = carrier_80211a;/*XXX*/ else packet->carrier = carrier_unknown; --- patch-pcapsource.cc ends here --- >Release-Note: >Audit-Trail: >Unformatted: