Lines Matching full:prep
332 * Verify the length of an HWMP PREP and returns 1 on success,
348 wh, NULL, "PREP (AE=%s) with wrong len", in verify_mesh_prep_len()
402 struct ieee80211_meshprep_ie *prep; in hwmp_recv_action_meshpath() local
471 prep = IEEE80211_MALLOC(sizeof(*prep), in hwmp_recv_action_meshpath()
474 KASSERT(prep != NULL, ("prep == NULL")); in hwmp_recv_action_meshpath()
476 prep->prep_ie = *iefrm_t++; in hwmp_recv_action_meshpath()
477 prep->prep_len = *iefrm_t++; in hwmp_recv_action_meshpath()
478 prep->prep_flags = *iefrm_t++; in hwmp_recv_action_meshpath()
479 prep->prep_hopcount = *iefrm_t++; in hwmp_recv_action_meshpath()
480 prep->prep_ttl = *iefrm_t++; in hwmp_recv_action_meshpath()
481 IEEE80211_ADDR_COPY(prep->prep_targetaddr, iefrm_t); in hwmp_recv_action_meshpath()
483 prep->prep_targetseq = le32dec(iefrm_t); iefrm_t += 4; in hwmp_recv_action_meshpath()
485 if (prep->prep_flags & IEEE80211_MESHPREP_FLAGS_AE) { in hwmp_recv_action_meshpath()
487 prep->prep_target_ext_addr, iefrm_t); in hwmp_recv_action_meshpath()
490 prep->prep_lifetime = le32dec(iefrm_t); iefrm_t += 4; in hwmp_recv_action_meshpath()
491 prep->prep_metric = le32dec(iefrm_t); iefrm_t += 4; in hwmp_recv_action_meshpath()
492 IEEE80211_ADDR_COPY(prep->prep_origaddr, iefrm_t); in hwmp_recv_action_meshpath()
494 prep->prep_origseq = le32dec(iefrm_t); iefrm_t += 4; in hwmp_recv_action_meshpath()
496 hwmp_recv_prep(vap, ni, wh, prep); in hwmp_recv_action_meshpath()
497 IEEE80211_FREE(prep, M_80211_MESH_PREP); in hwmp_recv_action_meshpath()
725 hwmp_add_meshprep(uint8_t *frm, const struct ieee80211_meshprep_ie *prep) in hwmp_add_meshprep() argument
728 *frm++ = prep->prep_len; /* len already calculated */ in hwmp_add_meshprep()
729 *frm++ = prep->prep_flags; in hwmp_add_meshprep()
730 *frm++ = prep->prep_hopcount; in hwmp_add_meshprep()
731 *frm++ = prep->prep_ttl; in hwmp_add_meshprep()
732 IEEE80211_ADDR_COPY(frm, prep->prep_targetaddr); frm += 6; in hwmp_add_meshprep()
733 ADDWORD(frm, prep->prep_targetseq); in hwmp_add_meshprep()
734 if (prep->prep_flags & IEEE80211_MESHPREP_FLAGS_AE) { in hwmp_add_meshprep()
735 IEEE80211_ADDR_COPY(frm, prep->prep_target_ext_addr); in hwmp_add_meshprep()
738 ADDWORD(frm, prep->prep_lifetime); in hwmp_add_meshprep()
739 ADDWORD(frm, prep->prep_metric); in hwmp_add_meshprep()
740 IEEE80211_ADDR_COPY(frm, prep->prep_origaddr); frm += 6; in hwmp_add_meshprep()
741 ADDWORD(frm, prep->prep_origseq); in hwmp_add_meshprep()
1063 struct ieee80211_meshprep_ie prep; in hwmp_recv_preq() local
1071 prep.prep_flags = 0; in hwmp_recv_preq()
1072 prep.prep_hopcount = 0; in hwmp_recv_preq()
1073 prep.prep_metric = IEEE80211_MESHLMETRIC_INITIALVAL; in hwmp_recv_preq()
1074 IEEE80211_ADDR_COPY(prep.prep_targetaddr, vap->iv_myaddr); in hwmp_recv_preq()
1079 prep.prep_flags |= IEEE80211_MESHPREP_FLAGS_AE; in hwmp_recv_preq()
1080 IEEE80211_ADDR_COPY(prep.prep_target_ext_addr, in hwmp_recv_preq()
1084 prep.prep_hopcount = rttarg->rt_nhops; in hwmp_recv_preq()
1085 prep.prep_metric = rttarg->rt_metric; in hwmp_recv_preq()
1086 IEEE80211_ADDR_COPY(prep.prep_targetaddr, rttarg->rt_mesh_gate); in hwmp_recv_preq()
1089 * Build and send a PREP frame. in hwmp_recv_preq()
1091 prep.prep_ttl = ms->ms_ttl; in hwmp_recv_preq()
1092 prep.prep_targetseq = hs->hs_seq; in hwmp_recv_preq()
1093 prep.prep_lifetime = preq->preq_lifetime; in hwmp_recv_preq()
1094 IEEE80211_ADDR_COPY(prep.prep_origaddr, preq->preq_origaddr); in hwmp_recv_preq()
1095 prep.prep_origseq = preq->preq_origseq; in hwmp_recv_preq()
1099 hwmp_send_prep(vap, wh->i_addr2, &prep); in hwmp_recv_preq()
1123 * Proactive PREQ: reply with a proactive PREP to the in hwmp_recv_preq()
1142 * Reply with a PREP if we don't have a path to the root in hwmp_recv_preq()
1147 struct ieee80211_meshprep_ie prep; in hwmp_recv_preq() local
1149 prep.prep_flags = 0; in hwmp_recv_preq()
1150 prep.prep_hopcount = 0; in hwmp_recv_preq()
1151 prep.prep_ttl = ms->ms_ttl; in hwmp_recv_preq()
1152 IEEE80211_ADDR_COPY(prep.prep_origaddr, in hwmp_recv_preq()
1154 prep.prep_origseq = preq->preq_origseq; in hwmp_recv_preq()
1155 prep.prep_lifetime = preq->preq_lifetime; in hwmp_recv_preq()
1156 prep.prep_metric = IEEE80211_MESHLMETRIC_INITIALVAL; in hwmp_recv_preq()
1157 IEEE80211_ADDR_COPY(prep.prep_targetaddr, in hwmp_recv_preq()
1159 prep.prep_targetseq = ++hs->hs_seq; in hwmp_recv_preq()
1160 hwmp_send_prep(vap, rtorig->rt_nexthop, &prep); in hwmp_recv_preq()
1187 struct ieee80211_meshprep_ie prep; in hwmp_recv_preq() local
1192 prep.prep_flags = 0; in hwmp_recv_preq()
1193 prep.prep_hopcount = rttarg->rt_nhops; in hwmp_recv_preq()
1194 prep.prep_ttl = ms->ms_ttl; in hwmp_recv_preq()
1195 IEEE80211_ADDR_COPY(&prep.prep_targetaddr, in hwmp_recv_preq()
1197 prep.prep_targetseq = hrtarg->hr_seq; in hwmp_recv_preq()
1198 prep.prep_lifetime = preq->preq_lifetime; in hwmp_recv_preq()
1199 prep.prep_metric =rttarg->rt_metric; in hwmp_recv_preq()
1200 IEEE80211_ADDR_COPY(&prep.prep_origaddr, in hwmp_recv_preq()
1202 prep.prep_origseq = hrorig->hr_seq; in hwmp_recv_preq()
1203 hwmp_send_prep(vap, rtorig->rt_nexthop, &prep); in hwmp_recv_preq()
1207 * sent a PREP. in hwmp_recv_preq()
1264 const struct ieee80211_frame *wh, const struct ieee80211_meshprep_ie *prep) in hwmp_recv_prep() argument
1281 "received PREP, orig %6D, targ %6D", prep->prep_origaddr, ":", in hwmp_recv_prep()
1282 prep->prep_targetaddr, ":"); in hwmp_recv_prep()
1285 * Acceptance criteria: (If the corresponding PREP was not generated in hwmp_recv_prep()
1287 * AND forwarding is disabled, discard this PREP. in hwmp_recv_prep()
1289 rtorig = ieee80211_mesh_rt_find(vap, prep->prep_origaddr); in hwmp_recv_prep()
1290 if ((!IEEE80211_ADDR_EQ(vap->iv_myaddr, prep->prep_origaddr) || in hwmp_recv_prep()
1294 "discard PREP, orig(%6D) not proxied or generated by us", in hwmp_recv_prep()
1295 prep->prep_origaddr, ":"); in hwmp_recv_prep()
1299 /* PREP ACCEPTED */ in hwmp_recv_prep()
1303 * it maintains for the target mesh STA of the PREP (according to the in hwmp_recv_prep()
1306 * rules, no further steps are applied to the PREP. in hwmp_recv_prep()
1308 rt = ieee80211_mesh_rt_find(vap, prep->prep_targetaddr); in hwmp_recv_prep()
1310 rt = ieee80211_mesh_rt_add(vap, prep->prep_targetaddr); in hwmp_recv_prep()
1313 "unable to add PREP path to %6D", in hwmp_recv_prep()
1314 prep->prep_targetaddr, ":"); in hwmp_recv_prep()
1319 "adding target %6D", prep->prep_targetaddr, ":"); in hwmp_recv_prep()
1323 metric = prep->prep_metric + ms->ms_pmetric->mpm_metric(ni); in hwmp_recv_prep()
1325 if (HWMP_SEQ_LT(prep->prep_targetseq, hr->hr_seq)) { in hwmp_recv_prep()
1327 "discard PREP from %6D, old seq no %u < %u", in hwmp_recv_prep()
1328 prep->prep_targetaddr, ":", in hwmp_recv_prep()
1329 prep->prep_targetseq, hr->hr_seq); in hwmp_recv_prep()
1331 } else if (HWMP_SEQ_LEQ(prep->prep_targetseq, hr->hr_seq) && in hwmp_recv_prep()
1334 "discard PREP from %6D, new metric %u > %u", in hwmp_recv_prep()
1335 prep->prep_targetaddr, ":", in hwmp_recv_prep()
1345 prep->prep_targetaddr, ":", in hwmp_recv_prep()
1346 rt->rt_nhops, prep->prep_hopcount + 1, in hwmp_recv_prep()
1349 hr->hr_seq = prep->prep_targetseq; in hwmp_recv_prep()
1353 rt->rt_nhops = prep->prep_hopcount + 1; in hwmp_recv_prep()
1354 ieee80211_mesh_rt_update(rt, prep->prep_lifetime); in hwmp_recv_prep()
1362 hwmp_update_transmitter(vap, ni, "PREP"); in hwmp_recv_prep()
1365 * If it's NOT for us, propagate the PREP in hwmp_recv_prep()
1367 if (!IEEE80211_ADDR_EQ(vap->iv_myaddr, prep->prep_origaddr) && in hwmp_recv_prep()
1368 prep->prep_ttl > 1 && in hwmp_recv_prep()
1369 prep->prep_hopcount < hs->hs_maxhops) { in hwmp_recv_prep()
1370 struct ieee80211_meshprep_ie pprep; /* propagated PREP */ in hwmp_recv_prep()
1374 * no PREP is generated without a corresponding PREQ. in hwmp_recv_prep()
1379 "received PREP for an unknown orig(%6D)", in hwmp_recv_prep()
1380 prep->prep_origaddr, ":"); in hwmp_recv_prep()
1385 "propagate PREP from %6D", in hwmp_recv_prep()
1386 prep->prep_targetaddr, ":"); in hwmp_recv_prep()
1388 memcpy(&pprep, prep, sizeof(pprep)); in hwmp_recv_prep()
1398 * Check if we received a PREP w/ AE and store target external address. in hwmp_recv_prep()
1399 * We may store target external address if received PREP w/ AE in hwmp_recv_prep()
1402 if (prep->prep_flags & IEEE80211_MESHPREP_FLAGS_AE) { in hwmp_recv_prep()
1404 prep->prep_target_ext_addr); in hwmp_recv_prep()
1407 prep->prep_target_ext_addr); in hwmp_recv_prep()
1410 "unable to add PREP path to proxy %6D", in hwmp_recv_prep()
1411 prep->prep_targetaddr, ":"); in hwmp_recv_prep()
1420 prep->prep_target_ext_addr, ":", in hwmp_recv_prep()
1421 rtext->rt_nhops, prep->prep_hopcount + 1, in hwmp_recv_prep()
1427 prep->prep_target_ext_addr); in hwmp_recv_prep()
1429 prep->prep_targetaddr); in hwmp_recv_prep()
1432 rtext->rt_lifetime = prep->prep_lifetime; in hwmp_recv_prep()
1433 rtext->rt_nhops = prep->prep_hopcount + 1; in hwmp_recv_prep()
1434 rtext->rt_ext_seq = prep->prep_origseq; /* new proxy seq */ in hwmp_recv_prep()
1447 addr = prep->prep_flags & IEEE80211_MESHPREP_FLAGS_AE ? in hwmp_recv_prep()
1448 prep->prep_target_ext_addr : prep->prep_targetaddr; in hwmp_recv_prep()
1475 struct ieee80211_meshprep_ie *prep) in hwmp_send_prep() argument
1477 /* NB: there's no PREP minimum interval. */ in hwmp_send_prep()
1480 * mesh prep action frame format in hwmp_send_prep()
1488 prep->prep_ie = IEEE80211_ELEMID_MESHPREP; in hwmp_send_prep()
1489 prep->prep_len = prep->prep_flags & IEEE80211_MESHPREP_FLAGS_AE ? in hwmp_send_prep()
1491 return hwmp_send_action(vap, da, (uint8_t *)prep, prep->prep_len + 2); in hwmp_send_prep()