pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/wpa_supplicant Import new package: wpa_supplicant.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/02f811dff68d
branches:  trunk
changeset: 551285:02f811dff68d
user:      reed <reed%pkgsrc.org@localhost>
date:      Thu Dec 11 21:18:41 2008 +0000

description:
Import new package: wpa_supplicant.
Note this is the development version and this package is not marked
-devel.
(The version in NetBSD -current is also a development version.)
The patch is based on changes as seen in NetBSD's custom driver_netbsd.c
(as compared to driver_bsd.c).

The wpa_supplicant package provides a wireless client daemon that supports
WPA, WPA2 (IEEE 802.11i / RSN), and WEP.  It implements key
negotiation with a WPA Authenticator and it controls the roaming
and IEEE 802.11 authentication/association of the wlan driver.  It
supports several EAP authentication methods.

This package also includes the wpa_cli console frontend.

diffstat:

 net/wpa_supplicant/DESCR                  |    7 +
 net/wpa_supplicant/Makefile               |   41 ++++
 net/wpa_supplicant/PLIST                  |    8 +
 net/wpa_supplicant/distinfo               |    6 +
 net/wpa_supplicant/files/defconfig.NetBSD |    4 +
 net/wpa_supplicant/patches/patch-aa       |  277 ++++++++++++++++++++++++++++++
 6 files changed, 343 insertions(+), 0 deletions(-)

diffs (truncated from 367 to 300 lines):

diff -r 7411755e9195 -r 02f811dff68d net/wpa_supplicant/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/wpa_supplicant/DESCR  Thu Dec 11 21:18:41 2008 +0000
@@ -0,0 +1,7 @@
+The wpa_supplicant package provides a wireless client daemon that supports
+WPA, WPA2 (IEEE 802.11i / RSN), and WEP.  It implements key
+negotiation with a WPA Authenticator and it controls the roaming
+and IEEE 802.11 authentication/association of the wlan driver.  It
+supports several EAP authentication methods.
+
+This package also includes the wpa_cli console frontend.
diff -r 7411755e9195 -r 02f811dff68d net/wpa_supplicant/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/wpa_supplicant/Makefile       Thu Dec 11 21:18:41 2008 +0000
@@ -0,0 +1,41 @@
+# $NetBSD: Makefile,v 1.1.1.1 2008/12/11 21:18:41 reed Exp $
+#
+
+DISTNAME=      wpa_supplicant-0.6.6
+CATEGORIES=    net
+MASTER_SITES=  http://hostap.epitest.fi/releases/
+
+MAINTAINER=    reed%reedmedia.net@localhost
+HOMEPAGE=      http://hostap.epitest.fi/wpa_supplicant/
+COMMENT=       Wireless connection client daemon for WPA, WPA2, and WEP
+
+USE_LANGUAGES= c
+USE_TOOLS+=    gmake
+
+INSTALLATION_DIRS=     sbin ${PKGMANDIR}/man5 ${PKGMANDIR}/man8
+
+post-extract:
+       cp ${FILESDIR}/defconfig.${OPSYS} ${WRKSRC}/wpa_supplicant/.config
+
+do-build:
+       cd ${WRKSRC}/wpa_supplicant && ${SETENV} ${MAKE_ENV} ${GMAKE} all
+
+do-install:
+       ${INSTALL_PROGRAM} ${WRKSRC}/wpa_supplicant/wpa_cli \
+               ${DESTDIR}/${PREFIX}/sbin/
+       ${INSTALL_PROGRAM} ${WRKSRC}/wpa_supplicant/wpa_passphrase \
+               ${DESTDIR}/${PREFIX}/sbin/
+       ${INSTALL_PROGRAM} ${WRKSRC}/wpa_supplicant/wpa_supplicant \
+               ${DESTDIR}/${PREFIX}/sbin/
+       ${INSTALL_MAN} ${WRKSRC}/wpa_supplicant/doc/docbook/wpa_supplicant.conf.5 \
+               ${DESTDIR}/${PREFIX}/${PKGMANDIR}/man5/
+       ${INSTALL_MAN} ${WRKSRC}/wpa_supplicant/doc/docbook/wpa_cli.8 \
+               ${DESTDIR}/${PREFIX}/${PKGMANDIR}/man8/
+       ${INSTALL_MAN} ${WRKSRC}/wpa_supplicant/doc/docbook/wpa_passphrase.8 \
+               ${DESTDIR}/${PREFIX}/${PKGMANDIR}/man8/
+       ${INSTALL_MAN} ${WRKSRC}/wpa_supplicant/doc/docbook/wpa_supplicant.8 \
+               ${DESTDIR}/${PREFIX}/${PKGMANDIR}/man8/
+
+.include "../../net/libpcap/buildlink3.mk"
+
+.include "../../mk/bsd.pkg.mk"
diff -r 7411755e9195 -r 02f811dff68d net/wpa_supplicant/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/wpa_supplicant/PLIST  Thu Dec 11 21:18:41 2008 +0000
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2008/12/11 21:18:41 reed Exp $
+man/man5/wpa_supplicant.conf.5
+man/man8/wpa_cli.8
+man/man8/wpa_passphrase.8
+man/man8/wpa_supplicant.8
+sbin/wpa_cli
+sbin/wpa_passphrase
+sbin/wpa_supplicant
diff -r 7411755e9195 -r 02f811dff68d net/wpa_supplicant/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/wpa_supplicant/distinfo       Thu Dec 11 21:18:41 2008 +0000
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.1.1.1 2008/12/11 21:18:41 reed Exp $
+
+SHA1 (wpa_supplicant-0.6.6.tar.gz) = 28109b6ec134a846cba87b3a57145ac3ec63dc57
+RMD160 (wpa_supplicant-0.6.6.tar.gz) = 30c23fac6e553193817fbf0a48d25da28bf8eb09
+Size (wpa_supplicant-0.6.6.tar.gz) = 1024724 bytes
+SHA1 (patch-aa) = fe22c4096983f7ab3f9e690abb69e324c228fb6c
diff -r 7411755e9195 -r 02f811dff68d net/wpa_supplicant/files/defconfig.NetBSD
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/wpa_supplicant/files/defconfig.NetBSD Thu Dec 11 21:18:41 2008 +0000
@@ -0,0 +1,4 @@
+# for NetBSD
+CONFIG_DRIVER_BSD=y
+CONFIG_DRIVER_WIRED=y
+CONFIG_CTRL_IFACE=y
diff -r 7411755e9195 -r 02f811dff68d net/wpa_supplicant/patches/patch-aa
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/wpa_supplicant/patches/patch-aa       Thu Dec 11 21:18:41 2008 +0000
@@ -0,0 +1,277 @@
+$NetBSD: patch-aa,v 1.1.1.1 2008/12/11 21:18:41 reed Exp $
+
+--- src/drivers/driver_bsd.c.orig      2008-11-23 07:02:06.000000000 -0800
++++ src/drivers/driver_bsd.c   2008-12-11 12:30:26.000000000 -0800
+@@ -21,7 +21,13 @@
+ #include "ieee802_11_defs.h"
+ 
+ #include <net/if.h>
++
++#ifdef __NetBSD__
++#include <net/if_ether.h>
++#define COMPAT_FREEBSD_NET80211
++#else
+ #include <net/ethernet.h>
++#endif
+ 
+ #include <net80211/ieee80211.h>
+ #include <net80211/ieee80211_crypto.h>
+@@ -32,6 +38,7 @@
+       int     route;                  /* routing socket for events */
+       char    ifname[IFNAMSIZ+1];     /* interface name */
+       unsigned int ifindex;           /* interface index */
++      int flags;                      /* interface flags */
+       void    *ctx;
+       int     prev_roaming;           /* roaming state to restore on deinit */
+       int     prev_privacy;           /* privacy state to restore on deinit */
+@@ -145,9 +152,18 @@
+ wpa_driver_bsd_get_bssid(void *priv, u8 *bssid)
+ {
+       struct wpa_driver_bsd_data *drv = priv;
++#ifdef __NetBSD__
++      struct ieee80211_bssid bs;
+ 
++      strncpy(bs.i_name, drv->ifname, sizeof(bs.i_name));
++      if (ioctl(drv->sock, SIOCG80211BSSID, &bs) < 0)
++              return -1;
++      memcpy(bssid, bs.i_bssid, sizeof(bs.i_bssid));
++      return 0;
++#else
+       return get80211var(drv, IEEE80211_IOC_BSSID,
+               bssid, IEEE80211_ADDR_LEN) < 0 ? -1 : 0;
++#endif
+ }
+ 
+ #if 0
+@@ -155,6 +171,7 @@
+ wpa_driver_bsd_set_bssid(void *priv, const char *bssid)
+ {
+       struct wpa_driver_bsd_data *drv = priv;
++      struct ieee80211_bssid bs;
+ 
+       return set80211var(drv, IEEE80211_IOC_BSSID,
+               bssid, IEEE80211_ADDR_LEN);
+@@ -165,9 +182,22 @@
+ wpa_driver_bsd_get_ssid(void *priv, u8 *ssid)
+ {
+       struct wpa_driver_bsd_data *drv = priv;
++#ifdef __NetBSD__
++      struct ieee80211_nwid nwid;
++      struct ifreq ifr;
+ 
++      memset(&ifr, 0, sizeof(ifr));
++      strncpy(ifr.ifr_name, drv->ifname, sizeof(ifr.ifr_name));
++      ifr.ifr_data = (void *)&nwid;
++      if (ioctl(drv->sock, SIOCG80211NWID, &ifr) < 0 ||
++          nwid.i_len > IEEE80211_NWID_LEN)
++              return -1;
++      memcpy(ssid, nwid.i_nwid, nwid.i_len);
++      return nwid.i_len;
++#else
+       return get80211var(drv, IEEE80211_IOC_SSID,
+               ssid, IEEE80211_NWID_LEN);
++#endif
+ }
+ 
+ static int
+@@ -175,8 +205,19 @@
+                            size_t ssid_len)
+ {
+       struct wpa_driver_bsd_data *drv = priv;
+-
++#ifdef __NetBSD__
++      struct ieee80211_nwid nwid;
++      struct ifreq ifr;
++ 
++      memcpy(nwid.i_nwid, ssid, ssid_len);
++      nwid.i_len = ssid_len;
++      memset(&ifr, 0, sizeof(ifr));
++      (void)strncpy(ifr.ifr_name, drv->ifname, sizeof(ifr.ifr_name));
++      ifr.ifr_data = (void *)&nwid;
++      return ioctl(drv->sock, SIOCS80211NWID, &ifr);
++#else
+       return set80211var(drv, IEEE80211_IOC_SSID, ssid, ssid_len);
++#endif
+ }
+ 
+ static int
+@@ -301,13 +342,23 @@
+       if (bcmp(addr, "\xff\xff\xff\xff\xff\xff", IEEE80211_ADDR_LEN) == 0) {
+               wk.ik_flags |= IEEE80211_KEY_GROUP;
+               wk.ik_keyix = key_idx;
++#ifdef __NetBSD__
++              if (set_tx)
++                      wk.ik_flags |= IEEE80211_KEY_DEFAULT;
++      } else
++              wk.ik_keyix = IEEE80211_KEYIX_NONE;
++#else
+       } else {
+               wk.ik_keyix = (key_idx == 0 ? IEEE80211_KEYIX_NONE : key_idx);
+       }
+       if (wk.ik_keyix != IEEE80211_KEYIX_NONE && set_tx)
+               wk.ik_flags |= IEEE80211_KEY_DEFAULT;
++#endif
+       wk.ik_keylen = key_len;
+       os_memcpy(&wk.ik_keyrsc, seq, seq_len);
++#ifdef __NetBSD__
++      wk.ik_keyrsc = le64toh(wk.ik_keyrsc);
++#endif
+       os_memcpy(wk.ik_keydata, key, key_len);
+ 
+       return set80211var(drv, IEEE80211_IOC_WPAKEY, &wk, sizeof(wk));
+@@ -380,10 +431,12 @@
+       /* XXX error handling is wrong but unclear what to do... */
+       if (wpa_driver_bsd_set_wpa_ie(drv, params->wpa_ie, params->wpa_ie_len) < 0)
+               return -1;
++#ifndef __NetBSD
+ #ifndef NEW_FREEBSD_MLME_ASSOC
+       if (wpa_driver_bsd_set_ssid(drv, params->ssid, params->ssid_len) < 0)
+               return -1;
+ #endif
++#endif
+ 
+       privacy = !(params->pairwise_suite == CIPHER_NONE &&
+           params->group_suite == CIPHER_NONE &&
+@@ -449,7 +502,12 @@
+ }
+ 
+ #include <net/route.h>
++#if __FreeBSD__
+ #include <net80211/ieee80211_freebsd.h>
++#endif
++#if __NetBSD__
++#include <net80211/ieee80211_netbsd.h>
++#endif
+ 
+ static void
+ wpa_driver_bsd_event_receive(int sock, void *ctx, void *sock_ctx)
+@@ -487,15 +545,23 @@
+               switch (ifan->ifan_what) {
+               case IFAN_DEPARTURE:
+                       event.interface_status.ievent = EVENT_INTERFACE_REMOVED;
++#ifdef __NetBSD__
++                      break;
++#endif
+               default:
++#ifdef __NetBSD__
++                      event.interface_status.ievent = EVENT_INTERFACE_ADDED;
++                      break;
++#else
+                       return;
++#endif
+               }
+-              wpa_printf(MSG_DEBUG, "RTM_IFANNOUNCE: Interface '%s' %s",
++              wpa_printf(MSG_DEBUG, "RTM_IFANNOUNCE: Interface '%s' %s (%d)",
+                          event.interface_status.ifname,
+                          ifan->ifan_what == IFAN_DEPARTURE ?
+-                              "removed" : "added");
++                              "removed" : "added", ifan->ifan_what);
+               wpa_supplicant_event(ctx, EVENT_INTERFACE_STATUS, &event);
+-              break;
++              return;
+       case RTM_IEEE80211:
+               ifan = (struct if_announcemsghdr *) rtm;
+               if (ifan->ifan_index != drv->ifindex)
+@@ -503,15 +569,23 @@
+               switch (ifan->ifan_what) {
+               case RTM_IEEE80211_ASSOC:
+               case RTM_IEEE80211_REASSOC:
++                      wpa_printf(MSG_DEBUG, "RTM_IEEE80211: (re)assoc (%d)",
++                          ifan->ifan_what);
+                       wpa_supplicant_event(ctx, EVENT_ASSOC, NULL);
+                       break;
+               case RTM_IEEE80211_DISASSOC:
++                      wpa_printf(MSG_DEBUG, "RTM_IEEE80211: disassoc (%d)",
++                          ifan->ifan_what);
+                       wpa_supplicant_event(ctx, EVENT_DISASSOC, NULL);
+                       break;
+               case RTM_IEEE80211_SCAN:
++                      wpa_printf(MSG_DEBUG, "RTM_IEEE80211: scan result (%d)",
++                          ifan->ifan_what);
+                       wpa_supplicant_event(ctx, EVENT_SCAN_RESULTS, NULL);
+                       break;
+               case RTM_IEEE80211_REPLAY:
++                      wpa_printf(MSG_DEBUG, "RTM_IEEE80211: replay (%d)",
++                          ifan->ifan_what);
+                       /* ignore */
+                       break;
+               case RTM_IEEE80211_MICHAEL:
+@@ -527,20 +601,48 @@
+                       wpa_supplicant_event(ctx, EVENT_MICHAEL_MIC_FAILURE,
+                               &event);
+                       break;
++              default:
++                      wpa_printf(MSG_DEBUG, "RTM_IEEE80211: ??? (%d)",
++                          ifan->ifan_what);
++                      break;
+               }
+               break;
+       case RTM_IFINFO:
+               ifm = (struct if_msghdr *) rtm;



Home | Main Index | Thread Index | Old Index