1138568Ssam/*- 2138568Ssam * Copyright (c) 2004 Video54 Technologies, Inc. 3178354Ssam * Copyright (c) 2004-2008 Sam Leffler, Errno Consulting 4138568Ssam * All rights reserved. 5138568Ssam * 6138568Ssam * Redistribution and use in source and binary forms, with or without 7138568Ssam * modification, are permitted provided that the following conditions 8138568Ssam * are met: 9138568Ssam * 1. Redistributions of source code must retain the above copyright 10138568Ssam * notice, this list of conditions and the following disclaimer. 11138568Ssam * 2. Redistributions in binary form must reproduce the above copyright 12138568Ssam * notice, this list of conditions and the following disclaimer in the 13138568Ssam * documentation and/or other materials provided with the distribution. 14138568Ssam * 15138568Ssam * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16138568Ssam * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17138568Ssam * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18138568Ssam * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19138568Ssam * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20138568Ssam * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21138568Ssam * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22138568Ssam * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23138568Ssam * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24138568Ssam * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25138568Ssam */ 26138568Ssam 27138568Ssam#include <sys/cdefs.h> 28138568Ssam__FBSDID("$FreeBSD$"); 29138568Ssam 30138568Ssam/* 31138568Ssam * External authenticator placeholder module. 32138568Ssam * 33138568Ssam * This support is optional; it is only used when the 802.11 layer's 34138568Ssam * authentication mode is set to use 802.1x or WPA is enabled separately 35138568Ssam * (for WPA-PSK). If compiled as a module this code does not need 36138568Ssam * to be present unless 802.1x/WPA is in use. 37138568Ssam * 38138568Ssam * The authenticator hooks into the 802.11 layer. At present we use none 39138568Ssam * of the available callbacks--the user mode authenticator process works 40138568Ssam * entirely from messages about stations joining and leaving. 41138568Ssam */ 42178354Ssam#include "opt_wlan.h" 43178354Ssam 44138568Ssam#include <sys/param.h> 45138568Ssam#include <sys/kernel.h> 46138568Ssam#include <sys/systm.h> 47138568Ssam#include <sys/mbuf.h> 48138568Ssam#include <sys/module.h> 49138568Ssam 50138568Ssam#include <sys/socket.h> 51138568Ssam 52138568Ssam#include <net/if.h> 53138568Ssam#include <net/if_media.h> 54138568Ssam#include <net/ethernet.h> 55138568Ssam#include <net/route.h> 56138568Ssam 57138568Ssam#include <net80211/ieee80211_var.h> 58138568Ssam 59178354Ssam/* XXX number of references from net80211 layer; needed for module code */ 60178354Ssamstatic int nrefs = 0; 61178354Ssam 62138568Ssam/* 63138568Ssam * One module handles everything for now. May want 64138568Ssam * to split things up for embedded applications. 65138568Ssam */ 66138568Ssamstatic const struct ieee80211_authenticator xauth = { 67138568Ssam .ia_name = "external", 68138568Ssam .ia_attach = NULL, 69138568Ssam .ia_detach = NULL, 70138568Ssam .ia_node_join = NULL, 71138568Ssam .ia_node_leave = NULL, 72138568Ssam}; 73138568Ssam 74178354SsamIEEE80211_AUTH_MODULE(xauth, 1); 75178354SsamIEEE80211_AUTH_ALG(x8021x, IEEE80211_AUTH_8021X, xauth); 76178354SsamIEEE80211_AUTH_ALG(wpa, IEEE80211_AUTH_WPA, xauth); 77