1 /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */ 2 /* 3 * Copyright (c) 2014, Ericsson AB 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are met: 8 * 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 3. Neither the names of the copyright holders nor the names of its 15 * contributors may be used to endorse or promote products derived from 16 * this software without specific prior written permission. 17 * 18 * Alternatively, this software may be distributed under the terms of the 19 * GNU General Public License ("GPL") version 2 as published by the Free 20 * Software Foundation. 21 * 22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 26 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 * POSSIBILITY OF SUCH DAMAGE. 33 */ 34 35 #ifndef _LINUX_TIPC_NETLINK_H_ 36 #define _LINUX_TIPC_NETLINK_H_ 37 38 #define TIPC_GENL_V2_NAME "TIPCv2" 39 #define TIPC_GENL_V2_VERSION 0x1 40 41 /* Netlink commands */ 42 enum { 43 TIPC_NL_UNSPEC, 44 TIPC_NL_LEGACY, 45 TIPC_NL_BEARER_DISABLE, 46 TIPC_NL_BEARER_ENABLE, 47 TIPC_NL_BEARER_GET, 48 TIPC_NL_BEARER_SET, 49 TIPC_NL_SOCK_GET, 50 TIPC_NL_PUBL_GET, 51 TIPC_NL_LINK_GET, 52 TIPC_NL_LINK_SET, 53 TIPC_NL_LINK_RESET_STATS, 54 TIPC_NL_MEDIA_GET, 55 TIPC_NL_MEDIA_SET, 56 TIPC_NL_NODE_GET, 57 TIPC_NL_NET_GET, 58 TIPC_NL_NET_SET, 59 TIPC_NL_NAME_TABLE_GET, 60 TIPC_NL_MON_SET, 61 TIPC_NL_MON_GET, 62 TIPC_NL_MON_PEER_GET, 63 TIPC_NL_PEER_REMOVE, 64 TIPC_NL_BEARER_ADD, 65 TIPC_NL_UDP_GET_REMOTEIP, 66 TIPC_NL_KEY_SET, 67 TIPC_NL_KEY_FLUSH, 68 TIPC_NL_ADDR_LEGACY_GET, 69 70 __TIPC_NL_CMD_MAX, 71 TIPC_NL_CMD_MAX = __TIPC_NL_CMD_MAX - 1 72 }; 73 74 /* Top level netlink attributes */ 75 enum { 76 TIPC_NLA_UNSPEC, 77 TIPC_NLA_BEARER, /* nest */ 78 TIPC_NLA_SOCK, /* nest */ 79 TIPC_NLA_PUBL, /* nest */ 80 TIPC_NLA_LINK, /* nest */ 81 TIPC_NLA_MEDIA, /* nest */ 82 TIPC_NLA_NODE, /* nest */ 83 TIPC_NLA_NET, /* nest */ 84 TIPC_NLA_NAME_TABLE, /* nest */ 85 TIPC_NLA_MON, /* nest */ 86 TIPC_NLA_MON_PEER, /* nest */ 87 88 __TIPC_NLA_MAX, 89 TIPC_NLA_MAX = __TIPC_NLA_MAX - 1 90 }; 91 92 /* Bearer info */ 93 enum { 94 TIPC_NLA_BEARER_UNSPEC, 95 TIPC_NLA_BEARER_NAME, /* string */ 96 TIPC_NLA_BEARER_PROP, /* nest */ 97 TIPC_NLA_BEARER_DOMAIN, /* u32 */ 98 TIPC_NLA_BEARER_UDP_OPTS, /* nest */ 99 100 __TIPC_NLA_BEARER_MAX, 101 TIPC_NLA_BEARER_MAX = __TIPC_NLA_BEARER_MAX - 1 102 }; 103 104 enum { 105 TIPC_NLA_UDP_UNSPEC, 106 TIPC_NLA_UDP_LOCAL, /* sockaddr_storage */ 107 TIPC_NLA_UDP_REMOTE, /* sockaddr_storage */ 108 TIPC_NLA_UDP_MULTI_REMOTEIP, /* flag */ 109 110 __TIPC_NLA_UDP_MAX, 111 TIPC_NLA_UDP_MAX = __TIPC_NLA_UDP_MAX - 1 112 }; 113 /* Socket info */ 114 enum { 115 TIPC_NLA_SOCK_UNSPEC, 116 TIPC_NLA_SOCK_ADDR, /* u32 */ 117 TIPC_NLA_SOCK_REF, /* u32 */ 118 TIPC_NLA_SOCK_CON, /* nest */ 119 TIPC_NLA_SOCK_HAS_PUBL, /* flag */ 120 TIPC_NLA_SOCK_STAT, /* nest */ 121 TIPC_NLA_SOCK_TYPE, /* u32 */ 122 TIPC_NLA_SOCK_INO, /* u32 */ 123 TIPC_NLA_SOCK_UID, /* u32 */ 124 TIPC_NLA_SOCK_TIPC_STATE, /* u32 */ 125 TIPC_NLA_SOCK_COOKIE, /* u64 */ 126 TIPC_NLA_SOCK_PAD, /* flag */ 127 TIPC_NLA_SOCK_GROUP, /* nest */ 128 129 __TIPC_NLA_SOCK_MAX, 130 TIPC_NLA_SOCK_MAX = __TIPC_NLA_SOCK_MAX - 1 131 }; 132 133 /* Link info */ 134 enum { 135 TIPC_NLA_LINK_UNSPEC, 136 TIPC_NLA_LINK_NAME, /* string */ 137 TIPC_NLA_LINK_DEST, /* u32 */ 138 TIPC_NLA_LINK_MTU, /* u32 */ 139 TIPC_NLA_LINK_BROADCAST, /* flag */ 140 TIPC_NLA_LINK_UP, /* flag */ 141 TIPC_NLA_LINK_ACTIVE, /* flag */ 142 TIPC_NLA_LINK_PROP, /* nest */ 143 TIPC_NLA_LINK_STATS, /* nest */ 144 TIPC_NLA_LINK_RX, /* u32 */ 145 TIPC_NLA_LINK_TX, /* u32 */ 146 147 __TIPC_NLA_LINK_MAX, 148 TIPC_NLA_LINK_MAX = __TIPC_NLA_LINK_MAX - 1 149 }; 150 151 /* Media info */ 152 enum { 153 TIPC_NLA_MEDIA_UNSPEC, 154 TIPC_NLA_MEDIA_NAME, /* string */ 155 TIPC_NLA_MEDIA_PROP, /* nest */ 156 157 __TIPC_NLA_MEDIA_MAX, 158 TIPC_NLA_MEDIA_MAX = __TIPC_NLA_MEDIA_MAX - 1 159 }; 160 161 /* Node info */ 162 enum { 163 TIPC_NLA_NODE_UNSPEC, 164 TIPC_NLA_NODE_ADDR, /* u32 */ 165 TIPC_NLA_NODE_UP, /* flag */ 166 TIPC_NLA_NODE_ID, /* data */ 167 TIPC_NLA_NODE_KEY, /* data */ 168 TIPC_NLA_NODE_KEY_MASTER, /* flag */ 169 TIPC_NLA_NODE_REKEYING, /* u32 */ 170 171 __TIPC_NLA_NODE_MAX, 172 TIPC_NLA_NODE_MAX = __TIPC_NLA_NODE_MAX - 1 173 }; 174 175 /* Net info */ 176 enum { 177 TIPC_NLA_NET_UNSPEC, 178 TIPC_NLA_NET_ID, /* u32 */ 179 TIPC_NLA_NET_ADDR, /* u32 */ 180 TIPC_NLA_NET_NODEID, /* u64 */ 181 TIPC_NLA_NET_NODEID_W1, /* u64 */ 182 TIPC_NLA_NET_ADDR_LEGACY, /* flag */ 183 184 __TIPC_NLA_NET_MAX, 185 TIPC_NLA_NET_MAX = __TIPC_NLA_NET_MAX - 1 186 }; 187 188 /* Name table info */ 189 enum { 190 TIPC_NLA_NAME_TABLE_UNSPEC, 191 TIPC_NLA_NAME_TABLE_PUBL, /* nest */ 192 193 __TIPC_NLA_NAME_TABLE_MAX, 194 TIPC_NLA_NAME_TABLE_MAX = __TIPC_NLA_NAME_TABLE_MAX - 1 195 }; 196 197 /* Monitor info */ 198 enum { 199 TIPC_NLA_MON_UNSPEC, 200 TIPC_NLA_MON_ACTIVATION_THRESHOLD, /* u32 */ 201 TIPC_NLA_MON_REF, /* u32 */ 202 TIPC_NLA_MON_ACTIVE, /* flag */ 203 TIPC_NLA_MON_BEARER_NAME, /* string */ 204 TIPC_NLA_MON_PEERCNT, /* u32 */ 205 TIPC_NLA_MON_LISTGEN, /* u32 */ 206 207 __TIPC_NLA_MON_MAX, 208 TIPC_NLA_MON_MAX = __TIPC_NLA_MON_MAX - 1 209 }; 210 211 /* Publication info */ 212 enum { 213 TIPC_NLA_PUBL_UNSPEC, 214 215 TIPC_NLA_PUBL_TYPE, /* u32 */ 216 TIPC_NLA_PUBL_LOWER, /* u32 */ 217 TIPC_NLA_PUBL_UPPER, /* u32 */ 218 TIPC_NLA_PUBL_SCOPE, /* u32 */ 219 TIPC_NLA_PUBL_NODE, /* u32 */ 220 TIPC_NLA_PUBL_REF, /* u32 */ 221 TIPC_NLA_PUBL_KEY, /* u32 */ 222 223 __TIPC_NLA_PUBL_MAX, 224 TIPC_NLA_PUBL_MAX = __TIPC_NLA_PUBL_MAX - 1 225 }; 226 227 /* Monitor peer info */ 228 enum { 229 TIPC_NLA_MON_PEER_UNSPEC, 230 231 TIPC_NLA_MON_PEER_ADDR, /* u32 */ 232 TIPC_NLA_MON_PEER_DOMGEN, /* u32 */ 233 TIPC_NLA_MON_PEER_APPLIED, /* u32 */ 234 TIPC_NLA_MON_PEER_UPMAP, /* u64 */ 235 TIPC_NLA_MON_PEER_MEMBERS, /* tlv */ 236 TIPC_NLA_MON_PEER_UP, /* flag */ 237 TIPC_NLA_MON_PEER_HEAD, /* flag */ 238 TIPC_NLA_MON_PEER_LOCAL, /* flag */ 239 TIPC_NLA_MON_PEER_PAD, /* flag */ 240 241 __TIPC_NLA_MON_PEER_MAX, 242 TIPC_NLA_MON_PEER_MAX = __TIPC_NLA_MON_PEER_MAX - 1 243 }; 244 245 /* Nest, socket group info */ 246 enum { 247 TIPC_NLA_SOCK_GROUP_ID, /* u32 */ 248 TIPC_NLA_SOCK_GROUP_OPEN, /* flag */ 249 TIPC_NLA_SOCK_GROUP_NODE_SCOPE, /* flag */ 250 TIPC_NLA_SOCK_GROUP_CLUSTER_SCOPE, /* flag */ 251 TIPC_NLA_SOCK_GROUP_INSTANCE, /* u32 */ 252 TIPC_NLA_SOCK_GROUP_BC_SEND_NEXT, /* u32 */ 253 254 __TIPC_NLA_SOCK_GROUP_MAX, 255 TIPC_NLA_SOCK_GROUP_MAX = __TIPC_NLA_SOCK_GROUP_MAX - 1 256 }; 257 258 /* Nest, connection info */ 259 enum { 260 TIPC_NLA_CON_UNSPEC, 261 262 TIPC_NLA_CON_FLAG, /* flag */ 263 TIPC_NLA_CON_NODE, /* u32 */ 264 TIPC_NLA_CON_SOCK, /* u32 */ 265 TIPC_NLA_CON_TYPE, /* u32 */ 266 TIPC_NLA_CON_INST, /* u32 */ 267 268 __TIPC_NLA_CON_MAX, 269 TIPC_NLA_CON_MAX = __TIPC_NLA_CON_MAX - 1 270 }; 271 272 /* Nest, socket statistics info */ 273 enum { 274 TIPC_NLA_SOCK_STAT_RCVQ, /* u32 */ 275 TIPC_NLA_SOCK_STAT_SENDQ, /* u32 */ 276 TIPC_NLA_SOCK_STAT_LINK_CONG, /* flag */ 277 TIPC_NLA_SOCK_STAT_CONN_CONG, /* flag */ 278 TIPC_NLA_SOCK_STAT_DROP, /* u32 */ 279 280 __TIPC_NLA_SOCK_STAT_MAX, 281 TIPC_NLA_SOCK_STAT_MAX = __TIPC_NLA_SOCK_STAT_MAX - 1 282 }; 283 284 /* Nest, link propreties. Valid for link, media and bearer */ 285 enum { 286 TIPC_NLA_PROP_UNSPEC, 287 288 TIPC_NLA_PROP_PRIO, /* u32 */ 289 TIPC_NLA_PROP_TOL, /* u32 */ 290 TIPC_NLA_PROP_WIN, /* u32 */ 291 TIPC_NLA_PROP_MTU, /* u32 */ 292 TIPC_NLA_PROP_BROADCAST, /* u32 */ 293 TIPC_NLA_PROP_BROADCAST_RATIO, /* u32 */ 294 295 __TIPC_NLA_PROP_MAX, 296 TIPC_NLA_PROP_MAX = __TIPC_NLA_PROP_MAX - 1 297 }; 298 299 /* Nest, statistics info */ 300 enum { 301 TIPC_NLA_STATS_UNSPEC, 302 303 TIPC_NLA_STATS_RX_INFO, /* u32 */ 304 TIPC_NLA_STATS_RX_FRAGMENTS, /* u32 */ 305 TIPC_NLA_STATS_RX_FRAGMENTED, /* u32 */ 306 TIPC_NLA_STATS_RX_BUNDLES, /* u32 */ 307 TIPC_NLA_STATS_RX_BUNDLED, /* u32 */ 308 TIPC_NLA_STATS_TX_INFO, /* u32 */ 309 TIPC_NLA_STATS_TX_FRAGMENTS, /* u32 */ 310 TIPC_NLA_STATS_TX_FRAGMENTED, /* u32 */ 311 TIPC_NLA_STATS_TX_BUNDLES, /* u32 */ 312 TIPC_NLA_STATS_TX_BUNDLED, /* u32 */ 313 TIPC_NLA_STATS_MSG_PROF_TOT, /* u32 */ 314 TIPC_NLA_STATS_MSG_LEN_CNT, /* u32 */ 315 TIPC_NLA_STATS_MSG_LEN_TOT, /* u32 */ 316 TIPC_NLA_STATS_MSG_LEN_P0, /* u32 */ 317 TIPC_NLA_STATS_MSG_LEN_P1, /* u32 */ 318 TIPC_NLA_STATS_MSG_LEN_P2, /* u32 */ 319 TIPC_NLA_STATS_MSG_LEN_P3, /* u32 */ 320 TIPC_NLA_STATS_MSG_LEN_P4, /* u32 */ 321 TIPC_NLA_STATS_MSG_LEN_P5, /* u32 */ 322 TIPC_NLA_STATS_MSG_LEN_P6, /* u32 */ 323 TIPC_NLA_STATS_RX_STATES, /* u32 */ 324 TIPC_NLA_STATS_RX_PROBES, /* u32 */ 325 TIPC_NLA_STATS_RX_NACKS, /* u32 */ 326 TIPC_NLA_STATS_RX_DEFERRED, /* u32 */ 327 TIPC_NLA_STATS_TX_STATES, /* u32 */ 328 TIPC_NLA_STATS_TX_PROBES, /* u32 */ 329 TIPC_NLA_STATS_TX_NACKS, /* u32 */ 330 TIPC_NLA_STATS_TX_ACKS, /* u32 */ 331 TIPC_NLA_STATS_RETRANSMITTED, /* u32 */ 332 TIPC_NLA_STATS_DUPLICATES, /* u32 */ 333 TIPC_NLA_STATS_LINK_CONGS, /* u32 */ 334 TIPC_NLA_STATS_MAX_QUEUE, /* u32 */ 335 TIPC_NLA_STATS_AVG_QUEUE, /* u32 */ 336 337 __TIPC_NLA_STATS_MAX, 338 TIPC_NLA_STATS_MAX = __TIPC_NLA_STATS_MAX - 1 339 }; 340 341 #endif 342
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.