History

batman-adv: netlink: add translation table query

This adds the commands BATADV_CMD_GET_TRANSTABLE_LOCAL and BATADV_CMD_GET_TRANSTABLE_GLOBAL, which correspond to the transtable_local and transtable_global debugfs files. The batadv_tt_client_flags enum is moved to the UAPI to expose it as part of the netlink API.

Matthias Schiffer committed 10 years ago

Commit d34f0551 parent b60620c6 files · +462 −37Browse files

Showing the changes to include/uapi/linux (1 of 6 files). Show all

Unified · Split

include/uapi/linux/batman_adv.h+56−0
@@ -22,6 +22,42 @@ · 21 unmodified lines
2222
2323 #define BATADV_NL_MCAST_GROUP_TPMETER "tpmeter"
2424
25+/**
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+
2561 /**
2662 * enum batadv_nl_attrs - batman-adv netlink attributes
2763 *
@@ -41,6 +77,14 @@ · 13 unmodified lines
4177 * @BATADV_ATTR_TPMETER_COOKIE: session cookie to match tp_meter session
4278 * @BATADV_ATTR_PAD: attribute used for padding for 64-bit alignment
4379 * @BATADV_ATTR_ACTIVE: Flag indicating if the hard interface is active
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
4488 * @__BATADV_ATTR_AFTER_LAST: internal use
4589 * @NUM_BATADV_ATTR: total number of batadv_nl_attrs available
4690 * @BATADV_ATTR_MAX: highest attribute number currently defined
@@ -62,6 +106,14 @@ enum batadv_nl_attrs { · 15 unmodified lines
62106 BATADV_ATTR_TPMETER_COOKIE,
63107 BATADV_ATTR_PAD,
64108 BATADV_ATTR_ACTIVE,
109+ BATADV_ATTR_TT_ADDRESS,
110+ BATADV_ATTR_TT_TTVN,
111+ BATADV_ATTR_TT_LAST_TTVN,
112+ BATADV_ATTR_TT_CRC32,
113+ BATADV_ATTR_TT_VID,
114+ BATADV_ATTR_TT_FLAGS,
115+ BATADV_ATTR_FLAG_BEST,
116+ BATADV_ATTR_LAST_SEEN_MSECS,
65117 /* add attributes above here, update the policy in netlink.c */
66118 __BATADV_ATTR_AFTER_LAST,
67119 NUM_BATADV_ATTR = __BATADV_ATTR_AFTER_LAST,
@@ -77,6 +129,8 @@ enum batadv_nl_attrs { · 9 unmodified lines
77129 * @BATADV_CMD_TP_METER_CANCEL: Cancel a tp meter session
78130 * @BATADV_CMD_GET_ROUTING_ALGOS: Query the list of routing algorithms.
79131 * @BATADV_CMD_GET_HARDIFS: Query list of hard interfaces
132+ * @BATADV_CMD_GET_TRANSTABLE_LOCAL: Query list of local translations
133+ * @BATADV_CMD_GET_TRANSTABLE_GLOBAL Query list of global translations
80134 * @__BATADV_CMD_AFTER_LAST: internal use
81135 * @BATADV_CMD_MAX: highest used command number
82136 */
@@ -87,6 +141,8 @@ enum batadv_nl_commands { · 4 unmodified lines
87141 BATADV_CMD_TP_METER_CANCEL,
88142 BATADV_CMD_GET_ROUTING_ALGOS,
89143 BATADV_CMD_GET_HARDIFS,
144+ BATADV_CMD_GET_TRANSTABLE_LOCAL,
145+ BATADV_CMD_GET_TRANSTABLE_GLOBAL,
90146 /* add new commands above here */
91147 __BATADV_CMD_AFTER_LAST,
92148 BATADV_CMD_MAX = __BATADV_CMD_AFTER_LAST - 1

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t