2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 * Copyright (c) 2009 The FreeBSD Foundation
7 * This software was developed by Rui Paulo under sponsorship from the
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 #ifndef _NET80211_IEEE80211_MESH_H_
34 #define _NET80211_IEEE80211_MESH_H_
36 #define IEEE80211_MESH_DEFAULT_TTL 31
37 #define IEEE80211_MESH_MAX_NEIGHBORS 15
40 * NB: all structures are __packed so sizeof works on arm, et. al.
43 * 802.11s Information Elements.
45 /* Mesh Configuration */
46 #define IEEE80211_MESH_CONF_SZ (7)
47 struct ieee80211_meshconf_ie {
48 uint8_t conf_ie; /* IEEE80211_ELEMID_MESHCONF */
50 uint8_t conf_pselid; /* Active Path Sel. Proto. ID */
51 uint8_t conf_pmetid; /* Active Metric Identifier */
52 uint8_t conf_ccid; /* Congestion Control Mode ID */
53 uint8_t conf_syncid; /* Sync. Protocol ID */
54 uint8_t conf_authid; /* Auth. Protocol ID */
55 uint8_t conf_form; /* Formation Information */
59 /* Hybrid Wireless Mesh Protocol */
62 IEEE80211_MESHCONF_PATH_HWMP = 1,
64 IEEE80211_MESHCONF_PATH_VENDOR = 255,
67 /* Airtime Link Metric */
70 IEEE80211_MESHCONF_METRIC_AIRTIME = 1,
72 IEEE80211_MESHCONF_METRIC_VENDOR = 255,
75 /* Congestion Control */
77 IEEE80211_MESHCONF_CC_DISABLED = 0,
78 IEEE80211_MESHCONF_CC_SIG = 1,
80 IEEE80211_MESHCONF_CC_VENDOR = 255,
83 /* Neighbour Offset */
86 IEEE80211_MESHCONF_SYNC_NEIGHOFF = 1,
88 IEEE80211_MESHCONF_SYNC_VENDOR = 255,
91 /* Authentication Protocol Identifier */
94 IEEE80211_MESHCONF_AUTH_DISABLED = 0,
95 /* Simultaneous Authenticaction of Equals */
96 IEEE80211_MESHCONF_AUTH_SEA = 1,
97 IEEE80211_MESHCONF_AUTH_8021X = 2, /* IEEE 802.1X */
99 IEEE80211_MESHCONF_AUTH_VENDOR = 255,
102 /* Mesh Formation Info */
103 #define IEEE80211_MESHCONF_FORM_GATE 0x01 /* Connected to Gate */
104 #define IEEE80211_MESHCONF_FORM_NNEIGH_MASK 0x7E /* Number of Neighbours */
105 #define IEEE80211_MESHCONF_FORM_SA 0xF0 /* indicating 802.1X auth */
107 /* Mesh Capability */
108 #define IEEE80211_MESHCONF_CAP_AP 0x01 /* Accepting Peers */
109 #define IEEE80211_MESHCONF_CAP_MCCAS 0x02 /* MCCA supported */
110 #define IEEE80211_MESHCONF_CAP_MCCAE 0x04 /* MCCA enabled */
111 #define IEEE80211_MESHCONF_CAP_FWRD 0x08 /* forwarding enabled */
112 #define IEEE80211_MESHCONF_CAP_BTR 0x10 /* Beacon Timing Report Enab */
113 #define IEEE80211_MESHCONF_CAP_TBTT 0x20 /* TBTT Adjusting */
114 #define IEEE80211_MESHCONF_CAP_PSL 0x40 /* Power Save Level */
117 /* Mesh Identifier */
118 struct ieee80211_meshid_ie {
119 uint8_t id_ie; /* IEEE80211_ELEMID_MESHID */
123 /* Link Metric Report */
124 struct ieee80211_meshlmetric_ie {
125 uint8_t lm_ie; /* IEEE80211_ACTION_MESH_LMETRIC */
128 #define IEEE80211_MESH_LMETRIC_FLAGS_REQ 0x01 /* Request */
130 * XXX: this field should be variable in size and depend on
131 * the active active path selection metric identifier
134 #define IEEE80211_MESHLMETRIC_INITIALVAL 0
137 /* Congestion Notification */
138 struct ieee80211_meshcngst_ie {
139 uint8_t cngst_ie; /* IEEE80211_ELEMID_MESHCNGST */
141 uint16_t cngst_timer[4]; /* Expiration Timers: AC_BK,
142 AC_BE, AC_VI, AC_VO */
145 /* Peer Link Management */
146 #define IEEE80211_MPM_BASE_SZ (4)
147 #define IEEE80211_MPM_MAX_SZ (8)
148 struct ieee80211_meshpeer_ie {
149 uint8_t peer_ie; /* IEEE80211_ELEMID_MESHPEER */
151 uint16_t peer_proto; /* Peer Management Protocol */
152 uint16_t peer_llinkid; /* Local Link ID */
153 uint16_t peer_linkid; /* Peer Link ID */
157 /* Mesh Peering Protocol Identifier field value */
159 IEEE80211_MPPID_MPM = 0, /* Mesh peering management */
160 IEEE80211_MPPID_AUTH_MPM = 1, /* Auth. mesh peering exchange */
161 /* 2-65535 reserved */
165 /* Mesh Channel Switch Annoucement */
166 struct ieee80211_meshcsa_ie {
167 uint8_t csa_ie; /* IEEE80211_ELEMID_MESHCSA */
170 uint8_t csa_newclass; /* New Regulatory Class */
172 uint8_t csa_precvalue; /* Precedence Value */
177 /* Equal to the non Mesh version */
179 /* Mesh Awake Window */
180 struct ieee80211_meshawakew_ie {
181 uint8_t awakew_ie; /* IEEE80211_ELEMID_MESHAWAKEW */
183 uint8_t awakew_windowlen; /* in TUs */
186 /* Mesh Beacon Timing */
187 struct ieee80211_meshbeacont_ie {
188 uint8_t beacont_ie; /* IEEE80211_ELEMID_MESHBEACONT */
191 uint8_t mp_aid; /* Least Octet of AID */
192 uint16_t mp_btime; /* Beacon Time */
193 uint16_t mp_bint; /* Beacon Interval */
194 } __packed mp[1]; /* NB: variable size */
198 /* Gate (GANN) Annoucement */
200 * NB: these macros used for the length in the IEs does not include 2 bytes
201 * for _ie and _len fields as is defined by the standard.
203 #define IEEE80211_MESHGANN_BASE_SZ (15)
204 struct ieee80211_meshgann_ie {
205 uint8_t gann_ie; /* IEEE80211_ELEMID_MESHGANN */
208 uint8_t gann_hopcount;
210 uint8_t gann_addr[IEEE80211_ADDR_LEN];
211 uint32_t gann_seq; /* GANN Sequence Number */
212 uint16_t gann_interval; /* GANN Interval */
215 /* Root (MP) Annoucement */
216 #define IEEE80211_MESHRANN_BASE_SZ (21)
217 struct ieee80211_meshrann_ie {
218 uint8_t rann_ie; /* IEEE80211_ELEMID_MESHRANN */
221 #define IEEE80211_MESHRANN_FLAGS_GATE 0x01 /* Mesh Gate */
222 uint8_t rann_hopcount;
224 uint8_t rann_addr[IEEE80211_ADDR_LEN];
225 uint32_t rann_seq; /* HWMP Sequence Number */
226 uint32_t rann_interval;
227 uint32_t rann_metric;
230 /* Mesh Path Request */
231 #define IEEE80211_MESHPREQ_BASE_SZ (26)
232 #define IEEE80211_MESHPREQ_BASE_SZ_AE (32)
233 #define IEEE80211_MESHPREQ_TRGT_SZ (11)
234 #define IEEE80211_MESHPREQ_TCNT_OFFSET (27)
235 #define IEEE80211_MESHPREQ_TCNT_OFFSET_AE (33)
236 struct ieee80211_meshpreq_ie {
237 uint8_t preq_ie; /* IEEE80211_ELEMID_MESHPREQ */
240 #define IEEE80211_MESHPREQ_FLAGS_GATE 0x01 /* Mesh Gate */
241 #define IEEE80211_MESHPREQ_FLAGS_AM 0x02 /* 0 = bcast / 1 = ucast */
242 #define IEEE80211_MESHPREQ_FLAGS_PP 0x04 /* Proactive PREP */
243 #define IEEE80211_MESHPREQ_FLAGS_AE 0x40 /* Address Extension */
244 uint8_t preq_hopcount;
247 uint8_t preq_origaddr[IEEE80211_ADDR_LEN];
248 uint32_t preq_origseq; /* HWMP Sequence Number */
249 /* NB: may have Originator External Address */
250 uint8_t preq_orig_ext_addr[IEEE80211_ADDR_LEN];
251 uint32_t preq_lifetime;
252 uint32_t preq_metric;
253 uint8_t preq_tcount; /* target count */
255 uint8_t target_flags;
256 #define IEEE80211_MESHPREQ_TFLAGS_TO 0x01 /* Target Only */
257 #define IEEE80211_MESHPREQ_TFLAGS_USN 0x04 /* Unknown HWMP seq number */
258 uint8_t target_addr[IEEE80211_ADDR_LEN];
259 uint32_t target_seq; /* HWMP Sequence Number */
260 } __packed preq_targets[1]; /* NB: variable size */
263 /* Mesh Path Reply */
264 #define IEEE80211_MESHPREP_BASE_SZ (31)
265 #define IEEE80211_MESHPREP_BASE_SZ_AE (37)
266 struct ieee80211_meshprep_ie {
267 uint8_t prep_ie; /* IEEE80211_ELEMID_MESHPREP */
270 #define IEEE80211_MESHPREP_FLAGS_AE 0x40 /* Address Extension */
271 uint8_t prep_hopcount;
273 uint8_t prep_targetaddr[IEEE80211_ADDR_LEN];
274 uint32_t prep_targetseq;
275 /* NB: May have Target External Address */
276 uint8_t prep_target_ext_addr[IEEE80211_ADDR_LEN];
277 uint32_t prep_lifetime;
278 uint32_t prep_metric;
279 uint8_t prep_origaddr[IEEE80211_ADDR_LEN];
280 uint32_t prep_origseq; /* HWMP Sequence Number */
283 /* Mesh Path Error */
284 #define IEEE80211_MESHPERR_MAXDEST (19)
285 #define IEEE80211_MESHPERR_NDEST_OFFSET (3)
286 #define IEEE80211_MESHPERR_BASE_SZ (2)
287 #define IEEE80211_MESHPERR_DEST_SZ (13)
288 #define IEEE80211_MESHPERR_DEST_SZ_AE (19)
289 struct ieee80211_meshperr_ie {
290 uint8_t perr_ie; /* IEEE80211_ELEMID_MESHPERR */
293 uint8_t perr_ndests; /* Number of Destinations */
296 #define IEEE80211_MESHPERR_DFLAGS_USN 0x01 /* XXX: not part of standard */
297 #define IEEE80211_MESHPERR_DFLAGS_RC 0x02 /* XXX: not part of standard */
298 #define IEEE80211_MESHPERR_FLAGS_AE 0x40 /* Address Extension */
299 uint8_t dest_addr[IEEE80211_ADDR_LEN];
300 uint32_t dest_seq; /* HWMP Sequence Number */
301 /* NB: May have Destination External Address */
302 uint8_t dest_ext_addr[IEEE80211_ADDR_LEN];
304 } __packed perr_dests[1]; /* NB: variable size */
308 /* Mesh Proxy Update */
309 struct ieee80211_meshpu_ie {
310 uint8_t pu_ie; /* IEEE80211_ELEMID_MESHPU */
313 #define IEEE80211_MESHPU_FLAGS_MASK 0x1
314 #define IEEE80211_MESHPU_FLAGS_DEL 0x0
315 #define IEEE80211_MESHPU_FLAGS_ADD 0x1
316 uint8_t pu_seq; /* PU Sequence Number */
317 uint8_t pu_addr[IEEE80211_ADDR_LEN];
318 uint8_t pu_naddr; /* Number of Proxied Addresses */
319 /* NB: proxied address follows */
322 /* Mesh Proxy Update Confirmation */
323 struct ieee80211_meshpuc_ie {
324 uint8_t puc_ie; /* IEEE80211_ELEMID_MESHPUC */
327 uint8_t puc_seq; /* PU Sequence Number */
328 uint8_t puc_daddr[IEEE80211_ADDR_LEN];
333 * 802.11s Action Frames
334 * XXX: these are wrong, and some of them should be
335 * under MESH category while PROXY is under MULTIHOP category.
337 #define IEEE80211_ACTION_CAT_INTERWORK 15
338 #define IEEE80211_ACTION_CAT_RESOURCE 16
339 #define IEEE80211_ACTION_CAT_PROXY 17
342 * Mesh Peering Action codes.
346 IEEE80211_ACTION_MESHPEERING_OPEN = 1,
347 IEEE80211_ACTION_MESHPEERING_CONFIRM = 2,
348 IEEE80211_ACTION_MESHPEERING_CLOSE = 3,
356 IEEE80211_ACTION_MESH_LMETRIC = 0, /* Mesh Link Metric Report */
357 IEEE80211_ACTION_MESH_HWMP = 1, /* HWMP Mesh Path Selection */
358 IEEE80211_ACTION_MESH_GANN = 2, /* Gate Announcement */
359 IEEE80211_ACTION_MESH_CC = 3, /* Congestion Control */
360 IEEE80211_ACTION_MESH_MCCA_SREQ = 4, /* MCCA Setup Request */
361 IEEE80211_ACTION_MESH_MCCA_SREP = 5, /* MCCA Setup Reply */
362 IEEE80211_ACTION_MESH_MCCA_AREQ = 6, /* MCCA Advertisement Req. */
363 IEEE80211_ACTION_MESH_MCCA_ADVER =7, /* MCCA Advertisement */
364 IEEE80211_ACTION_MESH_MCCA_TRDOWN = 8, /* MCCA Teardown */
365 IEEE80211_ACTION_MESH_TBTT_REQ = 9, /* TBTT Adjustment Request */
366 IEEE80211_ACTION_MESH_TBTT_RES = 10, /* TBTT Adjustment Response */
367 /* 11-255 reserved */
371 * Different mesh control structures based on the AE
372 * (Address Extension) bits.
374 struct ieee80211_meshcntl {
375 uint8_t mc_flags; /* Address Extension 00 */
376 uint8_t mc_ttl; /* TTL */
377 uint8_t mc_seq[4]; /* Sequence No. */
378 /* NB: more addresses may follow */
381 struct ieee80211_meshcntl_ae01 {
382 uint8_t mc_flags; /* Address Extension 01 */
383 uint8_t mc_ttl; /* TTL */
384 uint8_t mc_seq[4]; /* Sequence No. */
385 uint8_t mc_addr4[IEEE80211_ADDR_LEN];
388 struct ieee80211_meshcntl_ae10 {
389 uint8_t mc_flags; /* Address Extension 10 */
390 uint8_t mc_ttl; /* TTL */
391 uint8_t mc_seq[4]; /* Sequence No. */
392 uint8_t mc_addr5[IEEE80211_ADDR_LEN];
393 uint8_t mc_addr6[IEEE80211_ADDR_LEN];
396 #define IEEE80211_MESH_AE_MASK 0x03
398 IEEE80211_MESH_AE_00 = 0, /* MC has no AE subfield */
399 IEEE80211_MESH_AE_01 = 1, /* MC contain addr4 */
400 IEEE80211_MESH_AE_10 = 2, /* MC contain addr5 & addr6 */
401 IEEE80211_MESH_AE_11 = 3, /* RESERVED */
405 MALLOC_DECLARE(M_80211_MESH_PREQ);
406 MALLOC_DECLARE(M_80211_MESH_PREP);
407 MALLOC_DECLARE(M_80211_MESH_PERR);
409 MALLOC_DECLARE(M_80211_MESH_RT);
410 MALLOC_DECLARE(M_80211_MESH_GT_RT);
412 * Basic forwarding information:
415 * o Precursor list (not implemented yet)
417 * The rest is part of the active Mesh path selection protocol.
418 * XXX: to be moved out later.
420 struct ieee80211_mesh_route {
421 TAILQ_ENTRY(ieee80211_mesh_route) rt_next;
422 struct ieee80211vap *rt_vap;
423 ieee80211_rte_lock_t rt_lock; /* fine grained route lock */
424 struct callout rt_discovery; /* discovery timeout */
425 int rt_updtime; /* last update time */
426 uint8_t rt_dest[IEEE80211_ADDR_LEN];
427 uint8_t rt_mesh_gate[IEEE80211_ADDR_LEN]; /* meshDA */
428 uint8_t rt_nexthop[IEEE80211_ADDR_LEN];
429 uint32_t rt_metric; /* path metric */
430 uint16_t rt_nhops; /* number of hops */
432 #define IEEE80211_MESHRT_FLAGS_DISCOVER 0x01 /* path discovery */
433 #define IEEE80211_MESHRT_FLAGS_VALID 0x02 /* path discovery complete */
434 #define IEEE80211_MESHRT_FLAGS_PROXY 0x04 /* proxy entry */
435 #define IEEE80211_MESHRT_FLAGS_GATE 0x08 /* mesh gate entry */
436 uint32_t rt_lifetime; /* route timeout */
437 uint32_t rt_lastmseq; /* last seq# seen dest */
438 uint32_t rt_ext_seq; /* proxy seq number */
439 void *rt_priv; /* private data */
441 #define IEEE80211_MESH_ROUTE_PRIV(rt, cast) ((cast *)rt->rt_priv)
444 * Stored information about known mesh gates.
446 struct ieee80211_mesh_gate_route {
447 TAILQ_ENTRY(ieee80211_mesh_gate_route) gr_next;
448 uint8_t gr_addr[IEEE80211_ADDR_LEN];
450 struct ieee80211_mesh_route *gr_route;
453 #define IEEE80211_MESH_PROTO_DSZ 12 /* description size */
455 * Mesh Path Selection Protocol.
457 enum ieee80211_state;
458 struct ieee80211_mesh_proto_path {
460 char mpp_descr[IEEE80211_MESH_PROTO_DSZ];
462 struct ieee80211_node *
463 (*mpp_discover)(struct ieee80211vap *,
464 const uint8_t [IEEE80211_ADDR_LEN],
466 void (*mpp_peerdown)(struct ieee80211_node *);
467 void (*mpp_senderror)(struct ieee80211vap *,
468 const uint8_t [IEEE80211_ADDR_LEN],
469 struct ieee80211_mesh_route *, int);
470 void (*mpp_vattach)(struct ieee80211vap *);
471 void (*mpp_vdetach)(struct ieee80211vap *);
472 int (*mpp_newstate)(struct ieee80211vap *,
473 enum ieee80211_state, int);
474 const size_t mpp_privlen; /* size required in the routing table
476 int mpp_inact; /* inact. timeout for invalid routes
481 * Mesh Link Metric Report Protocol.
483 struct ieee80211_mesh_proto_metric {
485 char mpm_descr[IEEE80211_MESH_PROTO_DSZ];
487 uint32_t (*mpm_metric)(struct ieee80211_node *);
492 * Mesh Authentication Protocol.
494 struct ieee80211_mesh_proto_auth {
498 struct ieee80211_mesh_proto_congestion {
501 struct ieee80211_mesh_proto_sync {
505 typedef uint32_t ieee80211_mesh_seq;
506 #define IEEE80211_MESH_SEQ_LEQ(a, b) ((int32_t)((a)-(b)) <= 0)
507 #define IEEE80211_MESH_SEQ_GEQ(a, b) ((int32_t)((a)-(b)) >= 0)
509 struct ieee80211_mesh_state {
511 uint8_t ms_id[IEEE80211_MESHID_LEN];
512 ieee80211_mesh_seq ms_seq; /* seq no for meshcntl */
513 uint16_t ms_neighbors;
514 uint8_t ms_ttl; /* mesh ttl set in packets */
515 #define IEEE80211_MESHFLAGS_AP 0x01 /* accept peers */
516 #define IEEE80211_MESHFLAGS_GATE 0x02 /* mesh gate role */
517 #define IEEE80211_MESHFLAGS_FWD 0x04 /* forward packets */
518 #define IEEE80211_MESHFLAGS_ROOT 0x08 /* configured as root */
520 ieee80211_rt_lock_t ms_rt_lock;
521 struct callout ms_cleantimer;
522 struct callout ms_gatetimer;
523 ieee80211_mesh_seq ms_gateseq;
524 TAILQ_HEAD(, ieee80211_mesh_gate_route) ms_known_gates;
525 TAILQ_HEAD(, ieee80211_mesh_route) ms_routes;
526 struct ieee80211_mesh_proto_metric *ms_pmetric;
527 struct ieee80211_mesh_proto_path *ms_ppath;
529 void ieee80211_mesh_attach(struct ieee80211com *);
530 void ieee80211_mesh_detach(struct ieee80211com *);
532 struct ieee80211_mesh_route *
533 ieee80211_mesh_rt_find(struct ieee80211vap *,
534 const uint8_t [IEEE80211_ADDR_LEN]);
535 struct ieee80211_mesh_route *
536 ieee80211_mesh_rt_add(struct ieee80211vap *,
537 const uint8_t [IEEE80211_ADDR_LEN]);
538 void ieee80211_mesh_rt_del(struct ieee80211vap *,
539 const uint8_t [IEEE80211_ADDR_LEN]);
540 void ieee80211_mesh_rt_flush(struct ieee80211vap *);
541 void ieee80211_mesh_rt_flush_peer(struct ieee80211vap *,
542 const uint8_t [IEEE80211_ADDR_LEN]);
543 int ieee80211_mesh_rt_update(struct ieee80211_mesh_route *rt, int);
544 void ieee80211_mesh_proxy_check(struct ieee80211vap *,
545 const uint8_t [IEEE80211_ADDR_LEN]);
547 int ieee80211_mesh_register_proto_path(const
548 struct ieee80211_mesh_proto_path *);
549 int ieee80211_mesh_register_proto_metric(const
550 struct ieee80211_mesh_proto_metric *);
552 uint8_t * ieee80211_add_meshid(uint8_t *, struct ieee80211vap *);
553 uint8_t * ieee80211_add_meshconf(uint8_t *, struct ieee80211vap *);
554 uint8_t * ieee80211_add_meshpeer(uint8_t *, uint8_t, uint16_t, uint16_t,
556 uint8_t * ieee80211_add_meshlmetric(uint8_t *, uint8_t, uint32_t);
557 uint8_t * ieee80211_add_meshgate(uint8_t *,
558 struct ieee80211_meshgann_ie *);
560 void ieee80211_mesh_node_init(struct ieee80211vap *,
561 struct ieee80211_node *);
562 void ieee80211_mesh_node_cleanup(struct ieee80211_node *);
563 void ieee80211_parse_meshid(struct ieee80211_node *,
565 struct ieee80211_scanparams;
566 void ieee80211_mesh_init_neighbor(struct ieee80211_node *,
567 const struct ieee80211_frame *,
568 const struct ieee80211_scanparams *);
569 void ieee80211_mesh_update_beacon(struct ieee80211vap *,
570 struct ieee80211_beacon_offsets *);
571 struct ieee80211_mesh_gate_route *
572 ieee80211_mesh_mark_gate(struct ieee80211vap *,
573 const uint8_t *, struct ieee80211_mesh_route *);
574 void ieee80211_mesh_forward_to_gates(struct ieee80211vap *,
575 struct ieee80211_mesh_route *);
576 struct ieee80211_node *
577 ieee80211_mesh_find_txnode(struct ieee80211vap *,
578 const uint8_t [IEEE80211_ADDR_LEN]);
581 * Return non-zero if proxy operation is enabled.
584 ieee80211_mesh_isproxyena(struct ieee80211vap *vap)
586 struct ieee80211_mesh_state *ms = vap->iv_mesh;
587 return (ms->ms_flags &
588 (IEEE80211_MESHFLAGS_AP | IEEE80211_MESHFLAGS_GATE)) != 0;
592 * Process an outbound frame: if a path is known to the
593 * destination then return a reference to the next hop
594 * for immediate transmission. Otherwise initiate path
595 * discovery and, if possible queue the packet to be
596 * sent when path discovery completes.
598 static __inline struct ieee80211_node *
599 ieee80211_mesh_discover(struct ieee80211vap *vap,
600 const uint8_t dest[IEEE80211_ADDR_LEN], struct mbuf *m)
602 struct ieee80211_mesh_state *ms = vap->iv_mesh;
603 return ms->ms_ppath->mpp_discover(vap, dest, m);
607 #endif /* !_NET80211_IEEE80211_MESH_H_ */