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 */
93 IEEE80211_MESHCONF_AUTH_DISABLED = 0,
94 /* Simultaneous Authenticaction of Equals */
95 IEEE80211_MESHCONF_AUTH_SEA = 1,
96 IEEE80211_MESHCONF_AUTH_8021X = 2, /* IEEE 802.1X */
98 IEEE80211_MESHCONF_AUTH_VENDOR = 255,
101 /* Mesh Formation Info */
102 #define IEEE80211_MESHCONF_FORM_GATE 0x01 /* Connected to Gate */
103 #define IEEE80211_MESHCONF_FORM_NNEIGH_MASK 0x7E /* Number of Neighbours */
104 #define IEEE80211_MESHCONF_FORM_SA 0xF0 /* indicating 802.1X auth */
106 /* Mesh Capability */
107 #define IEEE80211_MESHCONF_CAP_AP 0x01 /* Accepting Peers */
108 #define IEEE80211_MESHCONF_CAP_MCCAS 0x02 /* MCCA supported */
109 #define IEEE80211_MESHCONF_CAP_MCCAE 0x04 /* MCCA enabled */
110 #define IEEE80211_MESHCONF_CAP_FWRD 0x08 /* forwarding enabled */
111 #define IEEE80211_MESHCONF_CAP_BTR 0x10 /* Beacon Timing Report Enab */
112 #define IEEE80211_MESHCONF_CAP_TBTT 0x20 /* TBTT Adjusting */
113 #define IEEE80211_MESHCONF_CAP_PSL 0x40 /* Power Save Level */
116 /* Mesh Identifier */
117 struct ieee80211_meshid_ie {
118 uint8_t id_ie; /* IEEE80211_ELEMID_MESHID */
122 /* Link Metric Report */
123 struct ieee80211_meshlmetric_ie {
124 uint8_t lm_ie; /* IEEE80211_ACTION_MESH_LMETRIC */
127 #define IEEE80211_MESH_LMETRIC_FLAGS_REQ 0x01 /* Request */
129 * XXX: this field should be variable in size and depend on
130 * the active active path selection metric identifier
133 #define IEEE80211_MESHLMETRIC_INITIALVAL 0
136 /* Congestion Notification */
137 struct ieee80211_meshcngst_ie {
138 uint8_t cngst_ie; /* IEEE80211_ELEMID_MESHCNGST */
140 uint16_t cngst_timer[4]; /* Expiration Timers: AC_BK,
141 AC_BE, AC_VI, AC_VO */
144 /* Peer Link Management */
145 #define IEEE80211_MPM_BASE_SZ (4)
146 #define IEEE80211_MPM_MAX_SZ (8)
147 struct ieee80211_meshpeer_ie {
148 uint8_t peer_ie; /* IEEE80211_ELEMID_MESHPEER */
150 uint16_t peer_proto; /* Peer Management Protocol */
151 uint16_t peer_llinkid; /* Local Link ID */
152 uint16_t peer_linkid; /* Peer Link ID */
156 /* Mesh Peering Protocol Identifier field value */
158 IEEE80211_MPPID_MPM = 0, /* Mesh peering management */
159 IEEE80211_MPPID_AUTH_MPM = 1, /* Auth. mesh peering exchange */
160 /* 2-65535 reserved */
164 /* Mesh Channel Switch Annoucement */
165 struct ieee80211_meshcsa_ie {
166 uint8_t csa_ie; /* IEEE80211_ELEMID_MESHCSA */
169 uint8_t csa_newclass; /* New Regulatory Class */
171 uint8_t csa_precvalue; /* Precedence Value */
176 /* Equal to the non Mesh version */
178 /* Mesh Awake Window */
179 struct ieee80211_meshawakew_ie {
180 uint8_t awakew_ie; /* IEEE80211_ELEMID_MESHAWAKEW */
182 uint8_t awakew_windowlen; /* in TUs */
185 /* Mesh Beacon Timing */
186 struct ieee80211_meshbeacont_ie {
187 uint8_t beacont_ie; /* IEEE80211_ELEMID_MESHBEACONT */
190 uint8_t mp_aid; /* Least Octet of AID */
191 uint16_t mp_btime; /* Beacon Time */
192 uint16_t mp_bint; /* Beacon Interval */
193 } __packed mp[1]; /* NB: variable size */
197 /* Gate (GANN) Annoucement */
199 * NB: these macros used for the length in the IEs does not include 2 bytes
200 * for _ie and _len fields as is defined by the standard.
202 #define IEEE80211_MESHGANN_BASE_SZ (15)
203 struct ieee80211_meshgann_ie {
204 uint8_t gann_ie; /* IEEE80211_ELEMID_MESHGANN */
207 uint8_t gann_hopcount;
209 uint8_t gann_addr[IEEE80211_ADDR_LEN];
210 uint32_t gann_seq; /* GANN Sequence Number */
211 uint16_t gann_interval; /* GANN Interval */
214 /* Root (MP) Annoucement */
215 #define IEEE80211_MESHRANN_BASE_SZ (21)
216 struct ieee80211_meshrann_ie {
217 uint8_t rann_ie; /* IEEE80211_ELEMID_MESHRANN */
220 #define IEEE80211_MESHRANN_FLAGS_GATE 0x01 /* Mesh Gate */
221 uint8_t rann_hopcount;
223 uint8_t rann_addr[IEEE80211_ADDR_LEN];
224 uint32_t rann_seq; /* HWMP Sequence Number */
225 uint32_t rann_interval;
226 uint32_t rann_metric;
229 /* Mesh Path Request */
230 #define IEEE80211_MESHPREQ_BASE_SZ (26)
231 #define IEEE80211_MESHPREQ_BASE_SZ_AE (32)
232 #define IEEE80211_MESHPREQ_TRGT_SZ (11)
233 #define IEEE80211_MESHPREQ_TCNT_OFFSET (27)
234 #define IEEE80211_MESHPREQ_TCNT_OFFSET_AE (33)
235 struct ieee80211_meshpreq_ie {
236 uint8_t preq_ie; /* IEEE80211_ELEMID_MESHPREQ */
239 #define IEEE80211_MESHPREQ_FLAGS_GATE 0x01 /* Mesh Gate */
240 #define IEEE80211_MESHPREQ_FLAGS_AM 0x02 /* 0 = bcast / 1 = ucast */
241 #define IEEE80211_MESHPREQ_FLAGS_PP 0x04 /* Proactive PREP */
242 #define IEEE80211_MESHPREQ_FLAGS_AE 0x40 /* Address Extension */
243 uint8_t preq_hopcount;
246 uint8_t preq_origaddr[IEEE80211_ADDR_LEN];
247 uint32_t preq_origseq; /* HWMP Sequence Number */
248 /* NB: may have Originator External Address */
249 uint8_t preq_orig_ext_addr[IEEE80211_ADDR_LEN];
250 uint32_t preq_lifetime;
251 uint32_t preq_metric;
252 uint8_t preq_tcount; /* target count */
254 uint8_t target_flags;
255 #define IEEE80211_MESHPREQ_TFLAGS_TO 0x01 /* Target Only */
256 #define IEEE80211_MESHPREQ_TFLAGS_USN 0x04 /* Unknown HWMP seq number */
257 uint8_t target_addr[IEEE80211_ADDR_LEN];
258 uint32_t target_seq; /* HWMP Sequence Number */
259 } __packed preq_targets[1]; /* NB: variable size */
262 /* Mesh Path Reply */
263 #define IEEE80211_MESHPREP_BASE_SZ (31)
264 #define IEEE80211_MESHPREP_BASE_SZ_AE (37)
265 struct ieee80211_meshprep_ie {
266 uint8_t prep_ie; /* IEEE80211_ELEMID_MESHPREP */
269 #define IEEE80211_MESHPREP_FLAGS_AE 0x40 /* Address Extension */
270 uint8_t prep_hopcount;
272 uint8_t prep_targetaddr[IEEE80211_ADDR_LEN];
273 uint32_t prep_targetseq;
274 /* NB: May have Target External Address */
275 uint8_t prep_target_ext_addr[IEEE80211_ADDR_LEN];
276 uint32_t prep_lifetime;
277 uint32_t prep_metric;
278 uint8_t prep_origaddr[IEEE80211_ADDR_LEN];
279 uint32_t prep_origseq; /* HWMP Sequence Number */
282 /* Mesh Path Error */
283 #define IEEE80211_MESHPERR_MAXDEST (19)
284 #define IEEE80211_MESHPERR_NDEST_OFFSET (3)
285 #define IEEE80211_MESHPERR_BASE_SZ (2)
286 #define IEEE80211_MESHPERR_DEST_SZ (13)
287 #define IEEE80211_MESHPERR_DEST_SZ_AE (19)
288 struct ieee80211_meshperr_ie {
289 uint8_t perr_ie; /* IEEE80211_ELEMID_MESHPERR */
292 uint8_t perr_ndests; /* Number of Destinations */
295 #define IEEE80211_MESHPERR_DFLAGS_USN 0x01 /* XXX: not part of standard */
296 #define IEEE80211_MESHPERR_DFLAGS_RC 0x02 /* XXX: not part of standard */
297 #define IEEE80211_MESHPERR_FLAGS_AE 0x40 /* Address Extension */
298 uint8_t dest_addr[IEEE80211_ADDR_LEN];
299 uint32_t dest_seq; /* HWMP Sequence Number */
300 /* NB: May have Destination External Address */
301 uint8_t dest_ext_addr[IEEE80211_ADDR_LEN];
303 } __packed perr_dests[1]; /* NB: variable size */
307 /* Mesh Proxy Update */
308 struct ieee80211_meshpu_ie {
309 uint8_t pu_ie; /* IEEE80211_ELEMID_MESHPU */
312 #define IEEE80211_MESHPU_FLAGS_MASK 0x1
313 #define IEEE80211_MESHPU_FLAGS_DEL 0x0
314 #define IEEE80211_MESHPU_FLAGS_ADD 0x1
315 uint8_t pu_seq; /* PU Sequence Number */
316 uint8_t pu_addr[IEEE80211_ADDR_LEN];
317 uint8_t pu_naddr; /* Number of Proxied Addresses */
318 /* NB: proxied address follows */
321 /* Mesh Proxy Update Confirmation */
322 struct ieee80211_meshpuc_ie {
323 uint8_t puc_ie; /* IEEE80211_ELEMID_MESHPUC */
326 uint8_t puc_seq; /* PU Sequence Number */
327 uint8_t puc_daddr[IEEE80211_ADDR_LEN];
332 * 802.11s Action Frames
333 * XXX: these are wrong, and some of them should be
334 * under MESH category while PROXY is under MULTIHOP category.
336 #define IEEE80211_ACTION_CAT_INTERWORK 15
337 #define IEEE80211_ACTION_CAT_RESOURCE 16
338 #define IEEE80211_ACTION_CAT_PROXY 17
341 * Mesh Peering Action codes.
345 IEEE80211_ACTION_MESHPEERING_OPEN = 1,
346 IEEE80211_ACTION_MESHPEERING_CONFIRM = 2,
347 IEEE80211_ACTION_MESHPEERING_CLOSE = 3,
355 IEEE80211_ACTION_MESH_LMETRIC = 0, /* Mesh Link Metric Report */
356 IEEE80211_ACTION_MESH_HWMP = 1, /* HWMP Mesh Path Selection */
357 IEEE80211_ACTION_MESH_GANN = 2, /* Gate Announcement */
358 IEEE80211_ACTION_MESH_CC = 3, /* Congestion Control */
359 IEEE80211_ACTION_MESH_MCCA_SREQ = 4, /* MCCA Setup Request */
360 IEEE80211_ACTION_MESH_MCCA_SREP = 5, /* MCCA Setup Reply */
361 IEEE80211_ACTION_MESH_MCCA_AREQ = 6, /* MCCA Advertisement Req. */
362 IEEE80211_ACTION_MESH_MCCA_ADVER =7, /* MCCA Advertisement */
363 IEEE80211_ACTION_MESH_MCCA_TRDOWN = 8, /* MCCA Teardown */
364 IEEE80211_ACTION_MESH_TBTT_REQ = 9, /* TBTT Adjustment Request */
365 IEEE80211_ACTION_MESH_TBTT_RES = 10, /* TBTT Adjustment Response */
366 /* 11-255 reserved */
370 * Different mesh control structures based on the AE
371 * (Address Extension) bits.
373 struct ieee80211_meshcntl {
374 uint8_t mc_flags; /* Address Extension 00 */
375 uint8_t mc_ttl; /* TTL */
376 uint8_t mc_seq[4]; /* Sequence No. */
377 /* NB: more addresses may follow */
380 struct ieee80211_meshcntl_ae01 {
381 uint8_t mc_flags; /* Address Extension 01 */
382 uint8_t mc_ttl; /* TTL */
383 uint8_t mc_seq[4]; /* Sequence No. */
384 uint8_t mc_addr4[IEEE80211_ADDR_LEN];
387 struct ieee80211_meshcntl_ae10 {
388 uint8_t mc_flags; /* Address Extension 10 */
389 uint8_t mc_ttl; /* TTL */
390 uint8_t mc_seq[4]; /* Sequence No. */
391 uint8_t mc_addr5[IEEE80211_ADDR_LEN];
392 uint8_t mc_addr6[IEEE80211_ADDR_LEN];
395 #define IEEE80211_MESH_AE_MASK 0x03
397 IEEE80211_MESH_AE_00 = 0, /* MC has no AE subfield */
398 IEEE80211_MESH_AE_01 = 1, /* MC contain addr4 */
399 IEEE80211_MESH_AE_10 = 2, /* MC contain addr5 & addr6 */
400 IEEE80211_MESH_AE_11 = 3, /* RESERVED */
404 MALLOC_DECLARE(M_80211_MESH_PREQ);
405 MALLOC_DECLARE(M_80211_MESH_PREP);
406 MALLOC_DECLARE(M_80211_MESH_PERR);
408 MALLOC_DECLARE(M_80211_MESH_RT);
409 MALLOC_DECLARE(M_80211_MESH_GT_RT);
411 * Basic forwarding information:
414 * o Precursor list (not implemented yet)
416 * The rest is part of the active Mesh path selection protocol.
417 * XXX: to be moved out later.
419 struct ieee80211_mesh_route {
420 TAILQ_ENTRY(ieee80211_mesh_route) rt_next;
421 struct ieee80211vap *rt_vap;
422 ieee80211_rte_lock_t rt_lock; /* fine grained route lock */
423 struct callout rt_discovery; /* discovery timeout */
424 int rt_updtime; /* last update time */
425 uint8_t rt_dest[IEEE80211_ADDR_LEN];
426 uint8_t rt_mesh_gate[IEEE80211_ADDR_LEN]; /* meshDA */
427 uint8_t rt_nexthop[IEEE80211_ADDR_LEN];
428 uint32_t rt_metric; /* path metric */
429 uint16_t rt_nhops; /* number of hops */
431 #define IEEE80211_MESHRT_FLAGS_DISCOVER 0x01 /* path discovery */
432 #define IEEE80211_MESHRT_FLAGS_VALID 0x02 /* path discovery complete */
433 #define IEEE80211_MESHRT_FLAGS_PROXY 0x04 /* proxy entry */
434 #define IEEE80211_MESHRT_FLAGS_GATE 0x08 /* mesh gate entry */
435 uint32_t rt_lifetime; /* route timeout */
436 uint32_t rt_lastmseq; /* last seq# seen dest */
437 uint32_t rt_ext_seq; /* proxy seq number */
438 void *rt_priv; /* private data */
440 #define IEEE80211_MESH_ROUTE_PRIV(rt, cast) ((cast *)rt->rt_priv)
443 * Stored information about known mesh gates.
445 struct ieee80211_mesh_gate_route {
446 TAILQ_ENTRY(ieee80211_mesh_gate_route) gr_next;
447 uint8_t gr_addr[IEEE80211_ADDR_LEN];
449 struct ieee80211_mesh_route *gr_route;
452 #define IEEE80211_MESH_PROTO_DSZ 12 /* description size */
454 * Mesh Path Selection Protocol.
456 enum ieee80211_state;
457 struct ieee80211_mesh_proto_path {
459 char mpp_descr[IEEE80211_MESH_PROTO_DSZ];
461 struct ieee80211_node *
462 (*mpp_discover)(struct ieee80211vap *,
463 const uint8_t [IEEE80211_ADDR_LEN],
465 void (*mpp_peerdown)(struct ieee80211_node *);
466 void (*mpp_senderror)(struct ieee80211vap *,
467 const uint8_t [IEEE80211_ADDR_LEN],
468 struct ieee80211_mesh_route *, int);
469 void (*mpp_vattach)(struct ieee80211vap *);
470 void (*mpp_vdetach)(struct ieee80211vap *);
471 int (*mpp_newstate)(struct ieee80211vap *,
472 enum ieee80211_state, int);
473 const size_t mpp_privlen; /* size required in the routing table
475 int mpp_inact; /* inact. timeout for invalid routes
480 * Mesh Link Metric Report Protocol.
482 struct ieee80211_mesh_proto_metric {
484 char mpm_descr[IEEE80211_MESH_PROTO_DSZ];
486 uint32_t (*mpm_metric)(struct ieee80211_node *);
491 * Mesh Authentication Protocol.
493 struct ieee80211_mesh_proto_auth {
497 struct ieee80211_mesh_proto_congestion {
500 struct ieee80211_mesh_proto_sync {
504 typedef uint32_t ieee80211_mesh_seq;
505 #define IEEE80211_MESH_SEQ_LEQ(a, b) ((int32_t)((a)-(b)) <= 0)
506 #define IEEE80211_MESH_SEQ_GEQ(a, b) ((int32_t)((a)-(b)) >= 0)
508 struct ieee80211_mesh_state {
510 uint8_t ms_id[IEEE80211_MESHID_LEN];
511 ieee80211_mesh_seq ms_seq; /* seq no for meshcntl */
512 uint16_t ms_neighbors;
513 uint8_t ms_ttl; /* mesh ttl set in packets */
514 #define IEEE80211_MESHFLAGS_AP 0x01 /* accept peers */
515 #define IEEE80211_MESHFLAGS_GATE 0x02 /* mesh gate role */
516 #define IEEE80211_MESHFLAGS_FWD 0x04 /* forward packets */
517 #define IEEE80211_MESHFLAGS_ROOT 0x08 /* configured as root */
519 ieee80211_rt_lock_t ms_rt_lock;
520 struct callout ms_cleantimer;
521 struct callout ms_gatetimer;
522 ieee80211_mesh_seq ms_gateseq;
523 TAILQ_HEAD(, ieee80211_mesh_gate_route) ms_known_gates;
524 TAILQ_HEAD(, ieee80211_mesh_route) ms_routes;
525 struct ieee80211_mesh_proto_metric *ms_pmetric;
526 struct ieee80211_mesh_proto_path *ms_ppath;
528 void ieee80211_mesh_attach(struct ieee80211com *);
529 void ieee80211_mesh_detach(struct ieee80211com *);
531 struct ieee80211_mesh_route *
532 ieee80211_mesh_rt_find(struct ieee80211vap *,
533 const uint8_t [IEEE80211_ADDR_LEN]);
534 struct ieee80211_mesh_route *
535 ieee80211_mesh_rt_add(struct ieee80211vap *,
536 const uint8_t [IEEE80211_ADDR_LEN]);
537 void ieee80211_mesh_rt_del(struct ieee80211vap *,
538 const uint8_t [IEEE80211_ADDR_LEN]);
539 void ieee80211_mesh_rt_flush(struct ieee80211vap *);
540 void ieee80211_mesh_rt_flush_peer(struct ieee80211vap *,
541 const uint8_t [IEEE80211_ADDR_LEN]);
542 int ieee80211_mesh_rt_update(struct ieee80211_mesh_route *rt, int);
543 void ieee80211_mesh_proxy_check(struct ieee80211vap *,
544 const uint8_t [IEEE80211_ADDR_LEN]);
546 int ieee80211_mesh_register_proto_path(const
547 struct ieee80211_mesh_proto_path *);
548 int ieee80211_mesh_register_proto_metric(const
549 struct ieee80211_mesh_proto_metric *);
551 uint8_t * ieee80211_add_meshid(uint8_t *, struct ieee80211vap *);
552 uint8_t * ieee80211_add_meshconf(uint8_t *, struct ieee80211vap *);
553 uint8_t * ieee80211_add_meshpeer(uint8_t *, uint8_t, uint16_t, uint16_t,
555 uint8_t * ieee80211_add_meshlmetric(uint8_t *, uint8_t, uint32_t);
556 uint8_t * ieee80211_add_meshgate(uint8_t *,
557 struct ieee80211_meshgann_ie *);
559 void ieee80211_mesh_node_init(struct ieee80211vap *,
560 struct ieee80211_node *);
561 void ieee80211_mesh_node_cleanup(struct ieee80211_node *);
562 void ieee80211_parse_meshid(struct ieee80211_node *,
564 struct ieee80211_scanparams;
565 void ieee80211_mesh_init_neighbor(struct ieee80211_node *,
566 const struct ieee80211_frame *,
567 const struct ieee80211_scanparams *);
568 void ieee80211_mesh_update_beacon(struct ieee80211vap *,
569 struct ieee80211_beacon_offsets *);
570 struct ieee80211_mesh_gate_route *
571 ieee80211_mesh_mark_gate(struct ieee80211vap *,
572 const uint8_t *, struct ieee80211_mesh_route *);
573 void ieee80211_mesh_forward_to_gates(struct ieee80211vap *,
574 struct ieee80211_mesh_route *);
575 struct ieee80211_node *
576 ieee80211_mesh_find_txnode(struct ieee80211vap *,
577 const uint8_t [IEEE80211_ADDR_LEN]);
580 * Return non-zero if proxy operation is enabled.
583 ieee80211_mesh_isproxyena(struct ieee80211vap *vap)
585 struct ieee80211_mesh_state *ms = vap->iv_mesh;
586 return (ms->ms_flags &
587 (IEEE80211_MESHFLAGS_AP | IEEE80211_MESHFLAGS_GATE)) != 0;
591 * Process an outbound frame: if a path is known to the
592 * destination then return a reference to the next hop
593 * for immediate transmission. Otherwise initiate path
594 * discovery and, if possible queue the packet to be
595 * sent when path discovery completes.
597 static __inline struct ieee80211_node *
598 ieee80211_mesh_discover(struct ieee80211vap *vap,
599 const uint8_t dest[IEEE80211_ADDR_LEN], struct mbuf *m)
601 struct ieee80211_mesh_state *ms = vap->iv_mesh;
602 return ms->ms_ppath->mpp_discover(vap, dest, m);
606 #endif /* !_NET80211_IEEE80211_MESH_H_ */