Added Self-protected action category (including MPM).

* Added new action category IEEE80211_ACTION_CAT_SELF_PROT which is used by 11s
for Mesh Peering Management;
* Updated Self protected enum Action codes to start from 1 instead of 0
according to the standard spec;
* Removed old and wrong action categories IEEE80211_ACTION_CAT_MESHPEERING;
* Modified ieee80211_mesh.c and ieee80211_action.c to use the new action
category code;
* Added earlier verification code in ieee80211_input;

Approved by: adrian


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234874 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Modified structure and code that handles Mesh peering management.

 * Old struct ieee80211_meshpeer_ie had wrong peer_proto field size;
 * Added IEEE80211_MPM_* size macros;
 * Created an enum for the Mesh Peering Protocol Identifier field according
 to the standard spec and removed old defines;
 * Abbreviated Handshake Protocol is not used by the standard anymore;
 * Modified mesh_verify_meshpeer to use IEEE80211_MPM_* macros for verification;
 * Modified mesh_parse_meshpeering_action to parse complete frame, also to parse
 it according to the standard spec;
 * Modified ieee80211_add_meshpeer to construct correct MPM frames according to
 the standard spec;

Approved by: adrian


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234875 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fixed some MPM reason codes and max number of neighbors check

 * Added IEEE80211_MESH_MAX_NEIGHBORS and it is set to 15, same as before;
 * Modified mesh_parse_meshpeering_action to verify MPM frame and send
 correct reason code for when a frame is rejected according to standard spec;
 * Modified mesh_recv_action_meshpeering_* according to the standard spec;
 * Modified mesh_peer_timeout_cb to always send CLOSE frame when in CONFIRMRCV
 state according to the standard spec;

Approved by: adrian


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234876 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Implemented so that Mesh forwarding information lifetime is dynamic.

 * Introduced ieee80211_mesh_rt_update that updates a route with the
 maximum(lifetime left, new lifetime);
 * Modified ieee80211_mesh_route struct by adding a lock that will be used
 by both ieee80211_mesh_rt_update and precursor code (added in future commit);
 * Modified in ieee80211_hwmp.c HWMP code to use new ieee80211_mesh_rt_update;
 * Modified mesh_rt_flush_invalid to use new ieee80211_mesh_rt_update;
 * mesh_rt_flush also checks that lifetime == 0, this gives route discovery
 a change to complete;
 * Modified mesh_recv_mgmt case IEEE80211_FC0_SUBTYPE_BEACON:
 when ever we received a beacon from a neighbor we update route lifetime;

Approved by: adrian


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234877 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Mesh forwarding with proxy support.

* Modified HWMP PREP/PREQ to contain a proxy entry and also changed PREP
frame processing according to amendment as following:
        o Fixed PREP to always update/create if acceptance criteria is meet;
        o PREQ processing to reply if request is for a proxy entry that is
          proxied by us;
        o Removed hwmp_discover call from PREQ, because sending a PREP will
          build the forward path, and by receving and accepting a PREQ we
          have already built the reverse path (non-proactive code);
* Disabled code for pro-active in PREP for now (will make a separate patch for
pro-active HWMP routing later)
* Added proxy information for a Mesh route, mesh gate to use and proxy seqno;
* Modified ieee80211_encap according to amendment;
* Introduced Mesh control address extension enum and removed unused struct,
also rename some structure element names.
* Modified mesh_input and added mesh_recv_* that should verify and process mesh
data frames according to 9.32 Mesh forwarding framework in amendment;
* Modified mesh_decap accordingly to changes done in mesh control AE struct;

Approved by: adrian


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234878 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Added route lifetime update for destination and source mesh along a mesh path;

 * In mesh_recv_indiv_data_to_fwd update route entry for both meshDA and meshSA;
 * In mesh_recv_indiv_data_to_me update route entry for meshSA;
 * in ieee80211_mesh_rt_update put code so that a proxy entry that is gated
 by us (number of hops == 0) is never invalidated;
 * Fixed so that we always call ieee80211_mesh_rt_update with lifetime in ms;

Approved by: adrian


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234879 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
* MeshForwarding update mesh_recv_indiv_data_to_fwrd to silently discard
unknown meshDA instead of panic, which is allowed per amendment spec;

Approved by: adrian


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234880 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
PREP update

* Added assertion in mesh_rt_update;
* Fixed some prep propagation that where multicast, ALL PREPS ARE UNICAST;
* Fixed PREP acceptance criteria;
* Fixed some PREP debug messages;
* HWMP intermediate reply (PREP) should only be sent if we have newer
forwarding infomration (FI) about target;
* Fixed PREP propagation condition and PREP w/ AE handling;
* Ignore PREPs that have unknown originator.
* Removed old code inside PREP that was for proactive path building
to root mesh;

Other errors include:
* use seq number of target and not orig mesh STA;
* Metric is what we have stored in our FI;
* Error in amendment, Hop count is not 0 but equals FI hopcount for target;

Approved by: adrian


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234881 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f