Deleted Added
full compact
ieee80211_node.c (139524) ieee80211_node.c (139528)
1/*-
2 * Copyright (c) 2001 Atsushi Onoe
3 * Copyright (c) 2002-2004 Sam Leffler, Errno Consulting
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 17 unchanged lines hidden (view full) ---

26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2001 Atsushi Onoe
3 * Copyright (c) 2002-2004 Sam Leffler, Errno Consulting
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 17 unchanged lines hidden (view full) ---

26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_node.c 139524 2004-12-31 21:28:41Z sam $");
34__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_node.c 139528 2004-12-31 22:05:13Z sam $");
35
36#include <sys/param.h>
37#include <sys/systm.h>
38#include <sys/mbuf.h>
39#include <sys/malloc.h>
40#include <sys/kernel.h>
41
42#include <sys/socket.h>

--- 150 unchanged lines hidden (view full) ---

193/*
194 * Port authorize/unauthorize interfaces for use by an authenticator.
195 */
196
197void
198ieee80211_node_authorize(struct ieee80211com *ic, struct ieee80211_node *ni)
199{
200 ni->ni_flags |= IEEE80211_NODE_AUTH;
35
36#include <sys/param.h>
37#include <sys/systm.h>
38#include <sys/mbuf.h>
39#include <sys/malloc.h>
40#include <sys/kernel.h>
41
42#include <sys/socket.h>

--- 150 unchanged lines hidden (view full) ---

193/*
194 * Port authorize/unauthorize interfaces for use by an authenticator.
195 */
196
197void
198ieee80211_node_authorize(struct ieee80211com *ic, struct ieee80211_node *ni)
199{
200 ni->ni_flags |= IEEE80211_NODE_AUTH;
201 ni->ni_inact_reload = ic->ic_inact_run;
201}
202
203void
204ieee80211_node_unauthorize(struct ieee80211com *ic, struct ieee80211_node *ni)
205{
206 ni->ni_flags &= ~IEEE80211_NODE_AUTH;
207}
208

--- 697 unchanged lines hidden (view full) ---

906
907 IEEE80211_ADDR_COPY(ni->ni_macaddr, macaddr);
908 hash = IEEE80211_NODE_HASH(macaddr);
909 ieee80211_node_initref(ni); /* mark referenced */
910 ni->ni_chan = IEEE80211_CHAN_ANYC;
911 ni->ni_authmode = IEEE80211_AUTH_OPEN;
912 ni->ni_txpower = ic->ic_txpowlimit; /* max power */
913 ieee80211_crypto_resetkey(ic, &ni->ni_ucastkey, IEEE80211_KEYIX_NONE);
202}
203
204void
205ieee80211_node_unauthorize(struct ieee80211com *ic, struct ieee80211_node *ni)
206{
207 ni->ni_flags &= ~IEEE80211_NODE_AUTH;
208}
209

--- 697 unchanged lines hidden (view full) ---

907
908 IEEE80211_ADDR_COPY(ni->ni_macaddr, macaddr);
909 hash = IEEE80211_NODE_HASH(macaddr);
910 ieee80211_node_initref(ni); /* mark referenced */
911 ni->ni_chan = IEEE80211_CHAN_ANYC;
912 ni->ni_authmode = IEEE80211_AUTH_OPEN;
913 ni->ni_txpower = ic->ic_txpowlimit; /* max power */
914 ieee80211_crypto_resetkey(ic, &ni->ni_ucastkey, IEEE80211_KEYIX_NONE);
914 ni->ni_inact = ni->ni_inact_reload = nt->nt_inact_init;
915 ni->ni_inact_reload = nt->nt_inact_init;
916 ni->ni_inact = ni->ni_inact_reload;
915 IEEE80211_NODE_SAVEQ_INIT(ni, "unknown");
916
917 IEEE80211_NODE_LOCK(nt);
918 TAILQ_INSERT_TAIL(&nt->nt_node, ni, ni_list);
919 LIST_INSERT_HEAD(&nt->nt_hash[hash], ni, ni_hash);
920 ni->ni_table = nt;
921 ni->ni_ic = ic;
922 IEEE80211_NODE_UNLOCK(nt);

--- 483 unchanged lines hidden (view full) ---

1406 }
1407 }
1408 /*
1409 * Probe the station before time it out. We
1410 * send a null data frame which may not be
1411 * universally supported by drivers (need it
1412 * for ps-poll support so it should be...).
1413 */
917 IEEE80211_NODE_SAVEQ_INIT(ni, "unknown");
918
919 IEEE80211_NODE_LOCK(nt);
920 TAILQ_INSERT_TAIL(&nt->nt_node, ni, ni_list);
921 LIST_INSERT_HEAD(&nt->nt_hash[hash], ni, ni_hash);
922 ni->ni_table = nt;
923 ni->ni_ic = ic;
924 IEEE80211_NODE_UNLOCK(nt);

--- 483 unchanged lines hidden (view full) ---

1408 }
1409 }
1410 /*
1411 * Probe the station before time it out. We
1412 * send a null data frame which may not be
1413 * universally supported by drivers (need it
1414 * for ps-poll support so it should be...).
1415 */
1414 if (ni->ni_inact == ic->ic_inact_probe) {
1416 if (0 < ni->ni_inact &&
1417 ni->ni_inact <= ic->ic_inact_probe) {
1415 IEEE80211_DPRINTF(ic, IEEE80211_MSG_NODE,
1416 "[%s] probe station due to inactivity\n",
1417 ether_sprintf(ni->ni_macaddr));
1418 IEEE80211_NODE_UNLOCK(nt);
1419 ieee80211_send_nulldata(ic, ni);
1420 /* XXX stat? */
1421 goto restart;
1422 }

--- 191 unchanged lines hidden (view full) ---

1614 ic->ic_flags & IEEE80211_F_SHSLOT ? "short" : "long",
1615 ic->ic_flags & IEEE80211_F_USEPROT ? ", protection" : "",
1616 ni->ni_flags & IEEE80211_NODE_QOS ? ", QoS" : ""
1617 );
1618
1619 /* give driver a chance to setup state like ni_txrate */
1620 if (ic->ic_newassoc != NULL)
1621 ic->ic_newassoc(ic, ni, newassoc);
1418 IEEE80211_DPRINTF(ic, IEEE80211_MSG_NODE,
1419 "[%s] probe station due to inactivity\n",
1420 ether_sprintf(ni->ni_macaddr));
1421 IEEE80211_NODE_UNLOCK(nt);
1422 ieee80211_send_nulldata(ic, ni);
1423 /* XXX stat? */
1424 goto restart;
1425 }

--- 191 unchanged lines hidden (view full) ---

1617 ic->ic_flags & IEEE80211_F_SHSLOT ? "short" : "long",
1618 ic->ic_flags & IEEE80211_F_USEPROT ? ", protection" : "",
1619 ni->ni_flags & IEEE80211_NODE_QOS ? ", QoS" : ""
1620 );
1621
1622 /* give driver a chance to setup state like ni_txrate */
1623 if (ic->ic_newassoc != NULL)
1624 ic->ic_newassoc(ic, ni, newassoc);
1622 ni->ni_inact_reload = ic->ic_inact_run;
1625 ni->ni_inact_reload = ic->ic_inact_auth;
1626 ni->ni_inact = ni->ni_inact_reload;
1623 IEEE80211_SEND_MGMT(ic, ni, resp, IEEE80211_STATUS_SUCCESS);
1624 /* tell the authenticator about new station */
1625 if (ic->ic_auth->ia_node_join != NULL)
1626 ic->ic_auth->ia_node_join(ic, ni);
1627 ieee80211_notify_node_join(ic, ni, newassoc);
1628}
1629
1630/*

--- 278 unchanged lines hidden ---
1627 IEEE80211_SEND_MGMT(ic, ni, resp, IEEE80211_STATUS_SUCCESS);
1628 /* tell the authenticator about new station */
1629 if (ic->ic_auth->ia_node_join != NULL)
1630 ic->ic_auth->ia_node_join(ic, ni);
1631 ieee80211_notify_node_join(ic, ni, newassoc);
1632}
1633
1634/*

--- 278 unchanged lines hidden ---