Date: Wed, 27 May 2009 00:20:33 +0000 (UTC) From: Rui Paulo <rpaulo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r192866 - projects/mesh11s/sys/net80211 Message-ID: <200905270020.n4R0KXXO078315@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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. + */ + }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905270020.n4R0KXXO078315>