Change how we enforce PREQ minimum interval.

* Moved hs_lastpreq to be hr_lastpreq cause this rate check should be per
target mesh STA according to amendment (NB: not applicable for PERR);
* Modified hwmp_send_preq to use two extra arguments for last sent PREQ and
minimum PREQ interval;
* hwmp_send_preq is called with last two arguments equal to NULL when sending
Proactive PREQs cause the call back task enforces the rate check;

Approved by: adrian


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234882 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
* Added a mesh max PREQ retires sysctl that governous how many times
we try to discover an address;
* Added a mesh net travelse time across an MBSS, which is used to enforce
discovery rate check;

Approved by: adrian


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234883 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
* Fixed PREQ flag field Adressing mode subfiled according to amendment specs;

Approved by: adria


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234884 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
* Fixed hwmp_discover code to populate a PREQ packet correctly;
* Removed IEEE80211_MESHPREQ_TFLAGS_RF which is no longer part of the
amendment spec;

Approved by: adrian


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234885 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
* Proactive PREQ (original transmission) must also set
IEEE80211_MESHPREQ_TFLAGS_USN flag in target_flag field;

Approved by: adrian


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234886 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
* PREQ acceptance criteria updated to check for proxy condition as in amendment;

Approved by: adrian


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234887 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Updated PREQ propagation code;

* When receiving a Proactive PREQ dont return after processing it but propagate;
* When we propagate we should not enforce ratechecking;
* Added checking for multiple pred ID detection;
* Storing proxy orig address when PREQ is not for us;

Approved by: adrian


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234888 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
* Modified PERR acceptance criteria according to amendment;
* Modified how PERR is handled and propagated according to amendment;

Approved by: adrian


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234889 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
PERR update to be called from mesh code.

* Added mpp_senderror for Mesh Path Selection protocol;
* Added hwmp_senderror that will send an HWMP PERR according to the
supplied reason code;
* Call mpp_senderror when deleting a route with correct reason code
for whether the route is marked proxy or not;
* Call mpp_senderror when trying to forward an individually addressed
frame and there is no forwarding information;

Approved by: adrian


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

* Introduced a new HWMP sysctl, Root Confirmation Interval;
* Added hr_lastrootconf to hwmp_route, is for ratecheck for a specific ROOT;
* We missed reading RANN.interval subfield from a RANN frame before;
* Updated hwmp_recv_rann according to amendment, see comments;

Approved by: adrian


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234891 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Net80211s update: Mesh Gate Announcement and removal of Portal Announcement.

 * Renamed IEEE80211_ELEMID_MESHPANN to IEEE80211_ELEMID_MESHGANN according to
 amendment;
 * Added IEEE80211_IOC_MESH_GATE that controls whether Mesh Gate Announcement
 is activated or not;
 * Renamed all flags from Portal to Gate in HWMP frames;
 * Removed IEEE80211_ACTION_MESHPANN enum cause its part of the Mesh Action
 category now as per amendment;
 * Renamed IEEE80211_MESHFLAGS_PORTAL to IEEE80211_MESHFLAGS_GATE in
 ieee80211_mesh_state flags;
 * Modified ieee80211_hwmp.c/ieee80211_mesh.c to use new GATE flags;

Approved by: adrian


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234892 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
* Added new command to ifconfig to activate Mesh Gate Announcement called
meshgate with corresponding explanation;

Approved by: adrian


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

* Added a new discovery flag IEEE80211_MESHRT_FLAGS_DISCOVER;
* Modified ieee80211_ioctl.h to include IEEE80211_MESHRT_FLAGS_DISCOVER;
* Added hwmp_rediscover_cb, which will be called by a timeout to do
rediscovery if we have not reach max number of preq discovery;
* Modified hwmp_discover to setup a callout for path rediscovery;
* Added to ieee80211req_mesh_route to have a back pointer to ieee80211vap
for the discovery callout context;
* Modified mesh_rt_add_locked arguemnt from ieee80211_mesh_state to
ieee80211vap, this because we have to initialize the above back pointer;

Approved by: adrian


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234894 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
* Modified ifconfig to show the IEEE80211_MESHRT_FLAGS_DISCOVER flag with a 'D';

Approved by: adrian


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234895 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Update HWMP Proactive code and mesh route flags.

* Modified hwmp_recv_preq:
    o cleaned up code, removed rootmac variable because preq->origaddr
      is the root when we recevie a Proactive PREQ;
    o Modified so that a PREP in response of a Proactive PREQ is unicast,
      a PREP is ALWAYS unicast;
* Modified hwmp_recv_prep:
    o Before we mark a route to be valid we should remove the discovery
      flag and then mark it valid in such a way we wont lose the isgate flag;

Approved by: adrian


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