svn commit: r192866 - projects/mesh11s/sys/net80211
Rui Paulo
rpaulo at FreeBSD.org
Wed May 27 00:20:34 UTC 2009
Author: rpaulo
Date: Wed May 27 00:20:33 2009
New Revision: 192866
URL: http://svn.freebsd.org/changeset/base/192866
Log:
Initial handling of PREPs.
Sponsored by: The FreeBSD Foundation
Modified:
projects/mesh11s/sys/net80211/ieee80211_hwmp.c
Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_hwmp.c Wed May 27 00:06:19 2009 (r192865)
+++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c Wed May 27 00:20:33 2009 (r192866)
@@ -295,10 +295,8 @@ hwmp_recv_preq(struct ieee80211vap *vap,
/* XXX */
prep.prep_origseq = 1;
vargs.ptrarg = &prep;
- ieee80211_send_action(ni,
- IEEE80211_ACTION_CAT_MESHPATH,
- IEEE80211_ACTION_MESHPATH_REP,
- vargs);
+ ieee80211_send_action(ni, IEEE80211_ACTION_CAT_MESHPATH,
+ IEEE80211_ACTION_MESHPATH_REP, vargs);
return;
}
@@ -339,6 +337,55 @@ static void
hwmp_recv_prep(struct ieee80211vap *vap, struct ieee80211_node *ni,
const struct ieee80211_meshprep_ie *prep)
{
+ union ieee80211_send_action_args vargs;
+
+ /*
+ * Acceptance criteria: if the PREP was not generated by us and
+ * forwarding is disabled, discard this PREP.
+ */
+ if (!IEEE80211_ADDR_EQ(vap->iv_myaddr, prep->prep_origaddr) &&
+ !ieee80211_mesh_forwarding)
+ return;
+
+ /*
+ * Step 1: Update the Forwarding Information.
+ */
+
+ /*
+ * Step 2: If it's NOT for us, propagate the PREP if TTL is
+ * greater than 1.
+ */
+ if (!IEEE80211_ADDR_EQ(vap->iv_myaddr, prep->prep_targetaddr) &&
+ prep->prep_ttl > 1) {
+ struct ieee80211_meshprep_ie pprep; /* propagated PREP */
+
+ memcpy(&pprep, prep, sizeof(pprep));
+ pprep.prep_hopcount += 1;
+ pprep.prep_ttl -= 1;
+ pprep.prep_metric += ieee80211_airtime_calc(vap, ni);
+ IEEE80211_ADDR_COPY(pprep.prep_origaddr, vap->iv_myaddr);
+ pprep.prep_origseq = 1; /* XXX */
+
+ vargs.ptrarg = &pprep;
+ ieee80211_send_action(ni, IEEE80211_ACTION_CAT_MESHPATH,
+ IEEE80211_ACTION_MESHPATH_REQ, vargs);
+
+ /*
+ * XXX: Step 5: update the precursor list.
+ */
+ return;
+ }
+
+ /*
+ * XXX: Step 3: If it's for us and the AE bit is set, update the
+ * proxy information table.
+ */
+
+ /*
+ * XXX: Step 4: If it's NOT for us and the AE bit is set,
+ * update the proxy information table.
+ */
+
}
More information about the svn-src-projects
mailing list