1 /* Copyright (C) 2016-2017 B.A.T.M.A.N. contributors:
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 #ifndef _UAPI_LINUX_BATMAN_ADV_H_
19 #define _UAPI_LINUX_BATMAN_ADV_H_
21 #define BATADV_NL_NAME "batadv"
23 #define BATADV_NL_MCAST_GROUP_TPMETER "tpmeter"
26 * enum batadv_tt_client_flags - TT client specific flags
28 * Bits from 0 to 7 are called _remote flags_ because they are sent on the wire.
29 * Bits from 8 to 15 are called _local flags_ because they are used for local
32 * Bits from 4 to 7 - a subset of remote flags - are ensured to be in sync with
33 * the other nodes in the network. To achieve this goal these flags are included
34 * in the TT CRC computation.
36 enum batadv_tt_client_flags
{
38 * @BATADV_TT_CLIENT_DEL: the client has to be deleted from the table
40 BATADV_TT_CLIENT_DEL
= (1 << 0),
43 * @BATADV_TT_CLIENT_ROAM: the client roamed to/from another node and
44 * the new update telling its new real location has not been
47 BATADV_TT_CLIENT_ROAM
= (1 << 1),
50 * @BATADV_TT_CLIENT_WIFI: this client is connected through a wifi
51 * interface. This information is used by the "AP Isolation" feature
53 BATADV_TT_CLIENT_WIFI
= (1 << 4),
56 * @BATADV_TT_CLIENT_ISOLA: this client is considered "isolated". This
57 * information is used by the Extended Isolation feature
59 BATADV_TT_CLIENT_ISOLA
= (1 << 5),
62 * @BATADV_TT_CLIENT_NOPURGE: this client should never be removed from
65 BATADV_TT_CLIENT_NOPURGE
= (1 << 8),
68 * @BATADV_TT_CLIENT_NEW: this client has been added to the local table
69 * but has not been announced yet
71 BATADV_TT_CLIENT_NEW
= (1 << 9),
74 * @BATADV_TT_CLIENT_PENDING: this client is marked for removal but it
75 * is kept in the table for one more originator interval for consistency
78 BATADV_TT_CLIENT_PENDING
= (1 << 10),
81 * @BATADV_TT_CLIENT_TEMP: this global client has been detected to be
82 * part of the network but no nnode has already announced it
84 BATADV_TT_CLIENT_TEMP
= (1 << 11),
88 * enum batadv_nl_attrs - batman-adv netlink attributes
90 enum batadv_nl_attrs
{
92 * @BATADV_ATTR_UNSPEC: unspecified attribute to catch errors
97 * @BATADV_ATTR_VERSION: batman-adv version string
102 * @BATADV_ATTR_ALGO_NAME: name of routing algorithm
104 BATADV_ATTR_ALGO_NAME
,
107 * @BATADV_ATTR_MESH_IFINDEX: index of the batman-adv interface
109 BATADV_ATTR_MESH_IFINDEX
,
112 * @BATADV_ATTR_MESH_IFNAME: name of the batman-adv interface
114 BATADV_ATTR_MESH_IFNAME
,
117 * @BATADV_ATTR_MESH_ADDRESS: mac address of the batman-adv interface
119 BATADV_ATTR_MESH_ADDRESS
,
122 * @BATADV_ATTR_HARD_IFINDEX: index of the non-batman-adv interface
124 BATADV_ATTR_HARD_IFINDEX
,
127 * @BATADV_ATTR_HARD_IFNAME: name of the non-batman-adv interface
129 BATADV_ATTR_HARD_IFNAME
,
132 * @BATADV_ATTR_HARD_ADDRESS: mac address of the non-batman-adv
135 BATADV_ATTR_HARD_ADDRESS
,
138 * @BATADV_ATTR_ORIG_ADDRESS: originator mac address
140 BATADV_ATTR_ORIG_ADDRESS
,
143 * @BATADV_ATTR_TPMETER_RESULT: result of run (see
144 * batadv_tp_meter_status)
146 BATADV_ATTR_TPMETER_RESULT
,
149 * @BATADV_ATTR_TPMETER_TEST_TIME: time (msec) the run took
151 BATADV_ATTR_TPMETER_TEST_TIME
,
154 * @BATADV_ATTR_TPMETER_BYTES: amount of acked bytes during run
156 BATADV_ATTR_TPMETER_BYTES
,
159 * @BATADV_ATTR_TPMETER_COOKIE: session cookie to match tp_meter session
161 BATADV_ATTR_TPMETER_COOKIE
,
164 * @BATADV_ATTR_PAD: attribute used for padding for 64-bit alignment
169 * @BATADV_ATTR_ACTIVE: Flag indicating if the hard interface is active
174 * @BATADV_ATTR_TT_ADDRESS: Client MAC address
176 BATADV_ATTR_TT_ADDRESS
,
179 * @BATADV_ATTR_TT_TTVN: Translation table version
184 * @BATADV_ATTR_TT_LAST_TTVN: Previous translation table version
186 BATADV_ATTR_TT_LAST_TTVN
,
189 * @BATADV_ATTR_TT_CRC32: CRC32 over translation table
191 BATADV_ATTR_TT_CRC32
,
194 * @BATADV_ATTR_TT_VID: VLAN ID
199 * @BATADV_ATTR_TT_FLAGS: Translation table client flags
201 BATADV_ATTR_TT_FLAGS
,
204 * @BATADV_ATTR_FLAG_BEST: Flags indicating entry is the best
206 BATADV_ATTR_FLAG_BEST
,
209 * @BATADV_ATTR_LAST_SEEN_MSECS: Time in milliseconds since last seen
211 BATADV_ATTR_LAST_SEEN_MSECS
,
214 * @BATADV_ATTR_NEIGH_ADDRESS: Neighbour MAC address
216 BATADV_ATTR_NEIGH_ADDRESS
,
219 * @BATADV_ATTR_TQ: TQ to neighbour
224 * @BATADV_ATTR_THROUGHPUT: Estimated throughput to Neighbour
226 BATADV_ATTR_THROUGHPUT
,
229 * @BATADV_ATTR_BANDWIDTH_UP: Reported uplink bandwidth
231 BATADV_ATTR_BANDWIDTH_UP
,
234 * @BATADV_ATTR_BANDWIDTH_DOWN: Reported downlink bandwidth
236 BATADV_ATTR_BANDWIDTH_DOWN
,
239 * @BATADV_ATTR_ROUTER: Gateway router MAC address
244 * @BATADV_ATTR_BLA_OWN: Flag indicating own originator
249 * @BATADV_ATTR_BLA_ADDRESS: Bridge loop avoidance claim MAC address
251 BATADV_ATTR_BLA_ADDRESS
,
254 * @BATADV_ATTR_BLA_VID: BLA VLAN ID
259 * @BATADV_ATTR_BLA_BACKBONE: BLA gateway originator MAC address
261 BATADV_ATTR_BLA_BACKBONE
,
264 * @BATADV_ATTR_BLA_CRC: BLA CRC
268 /* add attributes above here, update the policy in netlink.c */
271 * @__BATADV_ATTR_AFTER_LAST: internal use
273 __BATADV_ATTR_AFTER_LAST
,
276 * @NUM_BATADV_ATTR: total number of batadv_nl_attrs available
278 NUM_BATADV_ATTR
= __BATADV_ATTR_AFTER_LAST
,
281 * @BATADV_ATTR_MAX: highest attribute number currently defined
283 BATADV_ATTR_MAX
= __BATADV_ATTR_AFTER_LAST
- 1
287 * enum batadv_nl_commands - supported batman-adv netlink commands
289 enum batadv_nl_commands
{
291 * @BATADV_CMD_UNSPEC: unspecified command to catch errors
296 * @BATADV_CMD_GET_MESH_INFO: Query basic information about batman-adv
299 BATADV_CMD_GET_MESH_INFO
,
302 * @BATADV_CMD_TP_METER: Start a tp meter session
307 * @BATADV_CMD_TP_METER_CANCEL: Cancel a tp meter session
309 BATADV_CMD_TP_METER_CANCEL
,
312 * @BATADV_CMD_GET_ROUTING_ALGOS: Query the list of routing algorithms.
314 BATADV_CMD_GET_ROUTING_ALGOS
,
317 * @BATADV_CMD_GET_HARDIFS: Query list of hard interfaces
319 BATADV_CMD_GET_HARDIFS
,
322 * @BATADV_CMD_GET_TRANSTABLE_LOCAL: Query list of local translations
324 BATADV_CMD_GET_TRANSTABLE_LOCAL
,
327 * @BATADV_CMD_GET_TRANSTABLE_GLOBAL: Query list of global translations
329 BATADV_CMD_GET_TRANSTABLE_GLOBAL
,
332 * @BATADV_CMD_GET_ORIGINATORS: Query list of originators
334 BATADV_CMD_GET_ORIGINATORS
,
337 * @BATADV_CMD_GET_NEIGHBORS: Query list of neighbours
339 BATADV_CMD_GET_NEIGHBORS
,
342 * @BATADV_CMD_GET_GATEWAYS: Query list of gateways
344 BATADV_CMD_GET_GATEWAYS
,
347 * @BATADV_CMD_GET_BLA_CLAIM: Query list of bridge loop avoidance claims
349 BATADV_CMD_GET_BLA_CLAIM
,
352 * @BATADV_CMD_GET_BLA_BACKBONE: Query list of bridge loop avoidance
355 BATADV_CMD_GET_BLA_BACKBONE
,
357 /* add new commands above here */
360 * @__BATADV_CMD_AFTER_LAST: internal use
362 __BATADV_CMD_AFTER_LAST
,
365 * @BATADV_CMD_MAX: highest used command number
367 BATADV_CMD_MAX
= __BATADV_CMD_AFTER_LAST
- 1
371 * enum batadv_tp_meter_reason - reason of a tp meter test run stop
373 enum batadv_tp_meter_reason
{
375 * @BATADV_TP_REASON_COMPLETE: sender finished tp run
377 BATADV_TP_REASON_COMPLETE
= 3,
380 * @BATADV_TP_REASON_CANCEL: sender was stopped during run
382 BATADV_TP_REASON_CANCEL
= 4,
384 /* error status >= 128 */
387 * @BATADV_TP_REASON_DST_UNREACHABLE: receiver could not be reached or
390 BATADV_TP_REASON_DST_UNREACHABLE
= 128,
393 * @BATADV_TP_REASON_RESEND_LIMIT: (unused) sender retry reached limit
395 BATADV_TP_REASON_RESEND_LIMIT
= 129,
398 * @BATADV_TP_REASON_ALREADY_ONGOING: test to or from the same node
401 BATADV_TP_REASON_ALREADY_ONGOING
= 130,
404 * @BATADV_TP_REASON_MEMORY_ERROR: test was stopped due to low memory
406 BATADV_TP_REASON_MEMORY_ERROR
= 131,
409 * @BATADV_TP_REASON_CANT_SEND: failed to send via outgoing interface
411 BATADV_TP_REASON_CANT_SEND
= 132,
414 * @BATADV_TP_REASON_TOO_MANY: too many ongoing sessions
416 BATADV_TP_REASON_TOO_MANY
= 133,
419 #endif /* _UAPI_LINUX_BATMAN_ADV_H_ */