Matthias Schiffer | 09748a2 | 2016-05-09 18:41:08 +0200 | [diff] [blame] | 1 | /* Copyright (C) 2016 B.A.T.M.A.N. contributors: |
| 2 | * |
| 3 | * Matthias Schiffer |
| 4 | * |
| 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. |
| 8 | * |
| 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. |
| 16 | */ |
| 17 | |
| 18 | #ifndef _UAPI_LINUX_BATMAN_ADV_H_ |
| 19 | #define _UAPI_LINUX_BATMAN_ADV_H_ |
| 20 | |
| 21 | #define BATADV_NL_NAME "batadv" |
| 22 | |
Antonio Quartulli | 33a3bb4 | 2016-05-05 13:09:43 +0200 | [diff] [blame] | 23 | #define BATADV_NL_MCAST_GROUP_TPMETER "tpmeter" |
| 24 | |
Matthias Schiffer | 09748a2 | 2016-05-09 18:41:08 +0200 | [diff] [blame] | 25 | /** |
Matthias Schiffer | d34f055 | 2016-07-03 13:31:37 +0200 | [diff] [blame] | 26 | * enum batadv_tt_client_flags - TT client specific flags |
| 27 | * @BATADV_TT_CLIENT_DEL: the client has to be deleted from the table |
| 28 | * @BATADV_TT_CLIENT_ROAM: the client roamed to/from another node and the new |
| 29 | * update telling its new real location has not been received/sent yet |
| 30 | * @BATADV_TT_CLIENT_WIFI: this client is connected through a wifi interface. |
| 31 | * This information is used by the "AP Isolation" feature |
| 32 | * @BATADV_TT_CLIENT_ISOLA: this client is considered "isolated". This |
| 33 | * information is used by the Extended Isolation feature |
| 34 | * @BATADV_TT_CLIENT_NOPURGE: this client should never be removed from the table |
| 35 | * @BATADV_TT_CLIENT_NEW: this client has been added to the local table but has |
| 36 | * not been announced yet |
| 37 | * @BATADV_TT_CLIENT_PENDING: this client is marked for removal but it is kept |
| 38 | * in the table for one more originator interval for consistency purposes |
| 39 | * @BATADV_TT_CLIENT_TEMP: this global client has been detected to be part of |
| 40 | * the network but no nnode has already announced it |
| 41 | * |
| 42 | * Bits from 0 to 7 are called _remote flags_ because they are sent on the wire. |
| 43 | * Bits from 8 to 15 are called _local flags_ because they are used for local |
| 44 | * computations only. |
| 45 | * |
| 46 | * Bits from 4 to 7 - a subset of remote flags - are ensured to be in sync with |
| 47 | * the other nodes in the network. To achieve this goal these flags are included |
| 48 | * in the TT CRC computation. |
| 49 | */ |
| 50 | enum batadv_tt_client_flags { |
| 51 | BATADV_TT_CLIENT_DEL = (1 << 0), |
| 52 | BATADV_TT_CLIENT_ROAM = (1 << 1), |
| 53 | BATADV_TT_CLIENT_WIFI = (1 << 4), |
| 54 | BATADV_TT_CLIENT_ISOLA = (1 << 5), |
| 55 | BATADV_TT_CLIENT_NOPURGE = (1 << 8), |
| 56 | BATADV_TT_CLIENT_NEW = (1 << 9), |
| 57 | BATADV_TT_CLIENT_PENDING = (1 << 10), |
| 58 | BATADV_TT_CLIENT_TEMP = (1 << 11), |
| 59 | }; |
| 60 | |
| 61 | /** |
Matthias Schiffer | 09748a2 | 2016-05-09 18:41:08 +0200 | [diff] [blame] | 62 | * enum batadv_nl_attrs - batman-adv netlink attributes |
| 63 | * |
| 64 | * @BATADV_ATTR_UNSPEC: unspecified attribute to catch errors |
Matthias Schiffer | 5da0aef | 2016-05-09 18:41:09 +0200 | [diff] [blame] | 65 | * @BATADV_ATTR_VERSION: batman-adv version string |
| 66 | * @BATADV_ATTR_ALGO_NAME: name of routing algorithm |
| 67 | * @BATADV_ATTR_MESH_IFINDEX: index of the batman-adv interface |
| 68 | * @BATADV_ATTR_MESH_IFNAME: name of the batman-adv interface |
| 69 | * @BATADV_ATTR_MESH_ADDRESS: mac address of the batman-adv interface |
| 70 | * @BATADV_ATTR_HARD_IFINDEX: index of the non-batman-adv interface |
| 71 | * @BATADV_ATTR_HARD_IFNAME: name of the non-batman-adv interface |
| 72 | * @BATADV_ATTR_HARD_ADDRESS: mac address of the non-batman-adv interface |
Antonio Quartulli | 33a3bb4 | 2016-05-05 13:09:43 +0200 | [diff] [blame] | 73 | * @BATADV_ATTR_ORIG_ADDRESS: originator mac address |
| 74 | * @BATADV_ATTR_TPMETER_RESULT: result of run (see batadv_tp_meter_status) |
| 75 | * @BATADV_ATTR_TPMETER_TEST_TIME: time (msec) the run took |
| 76 | * @BATADV_ATTR_TPMETER_BYTES: amount of acked bytes during run |
| 77 | * @BATADV_ATTR_TPMETER_COOKIE: session cookie to match tp_meter session |
| 78 | * @BATADV_ATTR_PAD: attribute used for padding for 64-bit alignment |
Matthias Schiffer | b60620c | 2016-07-03 13:31:36 +0200 | [diff] [blame] | 79 | * @BATADV_ATTR_ACTIVE: Flag indicating if the hard interface is active |
Matthias Schiffer | d34f055 | 2016-07-03 13:31:37 +0200 | [diff] [blame] | 80 | * @BATADV_ATTR_TT_ADDRESS: Client MAC address |
| 81 | * @BATADV_ATTR_TT_TTVN: Translation table version |
| 82 | * @BATADV_ATTR_TT_LAST_TTVN: Previous translation table version |
| 83 | * @BATADV_ATTR_TT_CRC32: CRC32 over translation table |
| 84 | * @BATADV_ATTR_TT_VID: VLAN ID |
| 85 | * @BATADV_ATTR_TT_FLAGS: Translation table client flags |
| 86 | * @BATADV_ATTR_FLAG_BEST: Flags indicating entry is the best |
| 87 | * @BATADV_ATTR_LAST_SEEN_MSECS: Time in milliseconds since last seen |
Matthias Schiffer | 024f99c | 2016-07-03 13:31:40 +0200 | [diff] [blame] | 88 | * @BATADV_ATTR_NEIGH_ADDRESS: Neighbour MAC address |
| 89 | * @BATADV_ATTR_TQ: TQ to neighbour |
Matthias Schiffer | f02a478 | 2016-07-03 13:31:41 +0200 | [diff] [blame] | 90 | * @BATADV_ATTR_THROUGHPUT: Estimated throughput to Neighbour |
Sven Eckelmann | d7129da | 2016-07-03 13:31:42 +0200 | [diff] [blame] | 91 | * @BATADV_ATTR_BANDWIDTH_UP: Reported uplink bandwidth |
| 92 | * @BATADV_ATTR_BANDWIDTH_DOWN: Reported downlink bandwidth |
| 93 | * @BATADV_ATTR_ROUTER: Gateway router MAC address |
Andrew Lunn | 04f3f5b | 2016-07-03 13:31:45 +0200 | [diff] [blame] | 94 | * @BATADV_ATTR_BLA_OWN: Flag indicating own originator |
| 95 | * @BATADV_ATTR_BLA_ADDRESS: Bridge loop avoidance claim MAC address |
| 96 | * @BATADV_ATTR_BLA_VID: BLA VLAN ID |
| 97 | * @BATADV_ATTR_BLA_BACKBONE: BLA gateway originator MAC address |
| 98 | * @BATADV_ATTR_BLA_CRC: BLA CRC |
Matthias Schiffer | 09748a2 | 2016-05-09 18:41:08 +0200 | [diff] [blame] | 99 | * @__BATADV_ATTR_AFTER_LAST: internal use |
| 100 | * @NUM_BATADV_ATTR: total number of batadv_nl_attrs available |
| 101 | * @BATADV_ATTR_MAX: highest attribute number currently defined |
| 102 | */ |
| 103 | enum batadv_nl_attrs { |
| 104 | BATADV_ATTR_UNSPEC, |
Matthias Schiffer | 5da0aef | 2016-05-09 18:41:09 +0200 | [diff] [blame] | 105 | BATADV_ATTR_VERSION, |
| 106 | BATADV_ATTR_ALGO_NAME, |
| 107 | BATADV_ATTR_MESH_IFINDEX, |
| 108 | BATADV_ATTR_MESH_IFNAME, |
| 109 | BATADV_ATTR_MESH_ADDRESS, |
| 110 | BATADV_ATTR_HARD_IFINDEX, |
| 111 | BATADV_ATTR_HARD_IFNAME, |
| 112 | BATADV_ATTR_HARD_ADDRESS, |
Antonio Quartulli | 33a3bb4 | 2016-05-05 13:09:43 +0200 | [diff] [blame] | 113 | BATADV_ATTR_ORIG_ADDRESS, |
| 114 | BATADV_ATTR_TPMETER_RESULT, |
| 115 | BATADV_ATTR_TPMETER_TEST_TIME, |
| 116 | BATADV_ATTR_TPMETER_BYTES, |
| 117 | BATADV_ATTR_TPMETER_COOKIE, |
| 118 | BATADV_ATTR_PAD, |
Matthias Schiffer | b60620c | 2016-07-03 13:31:36 +0200 | [diff] [blame] | 119 | BATADV_ATTR_ACTIVE, |
Matthias Schiffer | d34f055 | 2016-07-03 13:31:37 +0200 | [diff] [blame] | 120 | BATADV_ATTR_TT_ADDRESS, |
| 121 | BATADV_ATTR_TT_TTVN, |
| 122 | BATADV_ATTR_TT_LAST_TTVN, |
| 123 | BATADV_ATTR_TT_CRC32, |
| 124 | BATADV_ATTR_TT_VID, |
| 125 | BATADV_ATTR_TT_FLAGS, |
| 126 | BATADV_ATTR_FLAG_BEST, |
| 127 | BATADV_ATTR_LAST_SEEN_MSECS, |
Matthias Schiffer | 024f99c | 2016-07-03 13:31:40 +0200 | [diff] [blame] | 128 | BATADV_ATTR_NEIGH_ADDRESS, |
| 129 | BATADV_ATTR_TQ, |
Matthias Schiffer | f02a478 | 2016-07-03 13:31:41 +0200 | [diff] [blame] | 130 | BATADV_ATTR_THROUGHPUT, |
Sven Eckelmann | d7129da | 2016-07-03 13:31:42 +0200 | [diff] [blame] | 131 | BATADV_ATTR_BANDWIDTH_UP, |
| 132 | BATADV_ATTR_BANDWIDTH_DOWN, |
| 133 | BATADV_ATTR_ROUTER, |
Andrew Lunn | 04f3f5b | 2016-07-03 13:31:45 +0200 | [diff] [blame] | 134 | BATADV_ATTR_BLA_OWN, |
| 135 | BATADV_ATTR_BLA_ADDRESS, |
| 136 | BATADV_ATTR_BLA_VID, |
| 137 | BATADV_ATTR_BLA_BACKBONE, |
| 138 | BATADV_ATTR_BLA_CRC, |
Matthias Schiffer | 09748a2 | 2016-05-09 18:41:08 +0200 | [diff] [blame] | 139 | /* add attributes above here, update the policy in netlink.c */ |
| 140 | __BATADV_ATTR_AFTER_LAST, |
| 141 | NUM_BATADV_ATTR = __BATADV_ATTR_AFTER_LAST, |
| 142 | BATADV_ATTR_MAX = __BATADV_ATTR_AFTER_LAST - 1 |
| 143 | }; |
| 144 | |
| 145 | /** |
| 146 | * enum batadv_nl_commands - supported batman-adv netlink commands |
| 147 | * |
| 148 | * @BATADV_CMD_UNSPEC: unspecified command to catch errors |
Matthias Schiffer | 5da0aef | 2016-05-09 18:41:09 +0200 | [diff] [blame] | 149 | * @BATADV_CMD_GET_MESH_INFO: Query basic information about batman-adv device |
Antonio Quartulli | 33a3bb4 | 2016-05-05 13:09:43 +0200 | [diff] [blame] | 150 | * @BATADV_CMD_TP_METER: Start a tp meter session |
| 151 | * @BATADV_CMD_TP_METER_CANCEL: Cancel a tp meter session |
Matthias Schiffer | 07a3061 | 2016-07-03 13:31:35 +0200 | [diff] [blame] | 152 | * @BATADV_CMD_GET_ROUTING_ALGOS: Query the list of routing algorithms. |
Matthias Schiffer | b60620c | 2016-07-03 13:31:36 +0200 | [diff] [blame] | 153 | * @BATADV_CMD_GET_HARDIFS: Query list of hard interfaces |
Matthias Schiffer | d34f055 | 2016-07-03 13:31:37 +0200 | [diff] [blame] | 154 | * @BATADV_CMD_GET_TRANSTABLE_LOCAL: Query list of local translations |
| 155 | * @BATADV_CMD_GET_TRANSTABLE_GLOBAL Query list of global translations |
Matthias Schiffer | 85cf8c8 | 2016-07-03 13:31:39 +0200 | [diff] [blame] | 156 | * @BATADV_CMD_GET_ORIGINATORS: Query list of originators |
| 157 | * @BATADV_CMD_GET_NEIGHBORS: Query list of neighbours |
Sven Eckelmann | d7129da | 2016-07-03 13:31:42 +0200 | [diff] [blame] | 158 | * @BATADV_CMD_GET_GATEWAYS: Query list of gateways |
Andrew Lunn | 04f3f5b | 2016-07-03 13:31:45 +0200 | [diff] [blame] | 159 | * @BATADV_CMD_GET_BLA_CLAIM: Query list of bridge loop avoidance claims |
Simon Wunderlich | ea4152e | 2016-07-03 13:31:47 +0200 | [diff] [blame] | 160 | * @BATADV_CMD_GET_BLA_BACKBONE: Query list of bridge loop avoidance backbones |
Matthias Schiffer | 09748a2 | 2016-05-09 18:41:08 +0200 | [diff] [blame] | 161 | * @__BATADV_CMD_AFTER_LAST: internal use |
| 162 | * @BATADV_CMD_MAX: highest used command number |
| 163 | */ |
| 164 | enum batadv_nl_commands { |
| 165 | BATADV_CMD_UNSPEC, |
Matthias Schiffer | 5da0aef | 2016-05-09 18:41:09 +0200 | [diff] [blame] | 166 | BATADV_CMD_GET_MESH_INFO, |
Antonio Quartulli | 33a3bb4 | 2016-05-05 13:09:43 +0200 | [diff] [blame] | 167 | BATADV_CMD_TP_METER, |
| 168 | BATADV_CMD_TP_METER_CANCEL, |
Matthias Schiffer | 07a3061 | 2016-07-03 13:31:35 +0200 | [diff] [blame] | 169 | BATADV_CMD_GET_ROUTING_ALGOS, |
Matthias Schiffer | b60620c | 2016-07-03 13:31:36 +0200 | [diff] [blame] | 170 | BATADV_CMD_GET_HARDIFS, |
Matthias Schiffer | d34f055 | 2016-07-03 13:31:37 +0200 | [diff] [blame] | 171 | BATADV_CMD_GET_TRANSTABLE_LOCAL, |
| 172 | BATADV_CMD_GET_TRANSTABLE_GLOBAL, |
Matthias Schiffer | 85cf8c8 | 2016-07-03 13:31:39 +0200 | [diff] [blame] | 173 | BATADV_CMD_GET_ORIGINATORS, |
| 174 | BATADV_CMD_GET_NEIGHBORS, |
Sven Eckelmann | d7129da | 2016-07-03 13:31:42 +0200 | [diff] [blame] | 175 | BATADV_CMD_GET_GATEWAYS, |
Andrew Lunn | 04f3f5b | 2016-07-03 13:31:45 +0200 | [diff] [blame] | 176 | BATADV_CMD_GET_BLA_CLAIM, |
Simon Wunderlich | ea4152e | 2016-07-03 13:31:47 +0200 | [diff] [blame] | 177 | BATADV_CMD_GET_BLA_BACKBONE, |
Matthias Schiffer | 09748a2 | 2016-05-09 18:41:08 +0200 | [diff] [blame] | 178 | /* add new commands above here */ |
| 179 | __BATADV_CMD_AFTER_LAST, |
| 180 | BATADV_CMD_MAX = __BATADV_CMD_AFTER_LAST - 1 |
| 181 | }; |
| 182 | |
Antonio Quartulli | 33a3bb4 | 2016-05-05 13:09:43 +0200 | [diff] [blame] | 183 | /** |
| 184 | * enum batadv_tp_meter_reason - reason of a tp meter test run stop |
| 185 | * @BATADV_TP_REASON_COMPLETE: sender finished tp run |
| 186 | * @BATADV_TP_REASON_CANCEL: sender was stopped during run |
| 187 | * @BATADV_TP_REASON_DST_UNREACHABLE: receiver could not be reached or didn't |
| 188 | * answer |
| 189 | * @BATADV_TP_REASON_RESEND_LIMIT: (unused) sender retry reached limit |
| 190 | * @BATADV_TP_REASON_ALREADY_ONGOING: test to or from the same node already |
| 191 | * ongoing |
| 192 | * @BATADV_TP_REASON_MEMORY_ERROR: test was stopped due to low memory |
| 193 | * @BATADV_TP_REASON_CANT_SEND: failed to send via outgoing interface |
| 194 | * @BATADV_TP_REASON_TOO_MANY: too many ongoing sessions |
| 195 | */ |
| 196 | enum batadv_tp_meter_reason { |
| 197 | BATADV_TP_REASON_COMPLETE = 3, |
| 198 | BATADV_TP_REASON_CANCEL = 4, |
| 199 | /* error status >= 128 */ |
| 200 | BATADV_TP_REASON_DST_UNREACHABLE = 128, |
| 201 | BATADV_TP_REASON_RESEND_LIMIT = 129, |
| 202 | BATADV_TP_REASON_ALREADY_ONGOING = 130, |
| 203 | BATADV_TP_REASON_MEMORY_ERROR = 131, |
| 204 | BATADV_TP_REASON_CANT_SEND = 132, |
| 205 | BATADV_TP_REASON_TOO_MANY = 133, |
| 206 | }; |
| 207 | |
Matthias Schiffer | 09748a2 | 2016-05-09 18:41:08 +0200 | [diff] [blame] | 208 | #endif /* _UAPI_LINUX_BATMAN_ADV_H_ */ |