17e5bf684SAlexander V. Chernikov /*- 24d846d26SWarner Losh * SPDX-License-Identifier: BSD-2-Clause 37e5bf684SAlexander V. Chernikov * 47e5bf684SAlexander V. Chernikov * Copyright (c) 2021 Ng Peng Nam Sean 57e5bf684SAlexander V. Chernikov * Copyright (c) 2022 Alexander V. Chernikov <melifaro@FreeBSD.org> 67e5bf684SAlexander V. Chernikov * 77e5bf684SAlexander V. Chernikov * Redistribution and use in source and binary forms, with or without 87e5bf684SAlexander V. Chernikov * modification, are permitted provided that the following conditions 97e5bf684SAlexander V. Chernikov * are met: 107e5bf684SAlexander V. Chernikov * 1. Redistributions of source code must retain the above copyright 117e5bf684SAlexander V. Chernikov * notice, this list of conditions and the following disclaimer. 127e5bf684SAlexander V. Chernikov * 2. Redistributions in binary form must reproduce the above copyright 137e5bf684SAlexander V. Chernikov * notice, this list of conditions and the following disclaimer in the 147e5bf684SAlexander V. Chernikov * documentation and/or other materials provided with the distribution. 157e5bf684SAlexander V. Chernikov * 167e5bf684SAlexander V. Chernikov * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 177e5bf684SAlexander V. Chernikov * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 187e5bf684SAlexander V. Chernikov * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 197e5bf684SAlexander V. Chernikov * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 207e5bf684SAlexander V. Chernikov * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 217e5bf684SAlexander V. Chernikov * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 227e5bf684SAlexander V. Chernikov * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 237e5bf684SAlexander V. Chernikov * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 247e5bf684SAlexander V. Chernikov * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 257e5bf684SAlexander V. Chernikov * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 267e5bf684SAlexander V. Chernikov * SUCH DAMAGE. 277e5bf684SAlexander V. Chernikov * 287e5bf684SAlexander V. Chernikov * Copyright (C) The Internet Society (2003). All Rights Reserved. 297e5bf684SAlexander V. Chernikov * 307e5bf684SAlexander V. Chernikov * This document and translations of it may be copied and furnished to 317e5bf684SAlexander V. Chernikov * others, and derivative works that comment on or otherwise explain it 327e5bf684SAlexander V. Chernikov * or assist in its implementation may be prepared, copied, published 337e5bf684SAlexander V. Chernikov * and distributed, in whole or in part, without restriction of any 347e5bf684SAlexander V. Chernikov * kind, provided that the above copyright notice and this paragraph are 357e5bf684SAlexander V. Chernikov * included on all such copies and derivative works. However, this 367e5bf684SAlexander V. Chernikov * document itself may not be modified in any way, such as by removing 377e5bf684SAlexander V. Chernikov * the copyright notice or references to the Internet Society or other 387e5bf684SAlexander V. Chernikov * Internet organizations, except as needed for the purpose of 397e5bf684SAlexander V. Chernikov * developing Internet standards in which case the procedures for 407e5bf684SAlexander V. Chernikov * copyrights defined in the Internet Standards process must be 417e5bf684SAlexander V. Chernikov * followed, or as required to translate it into languages other than 427e5bf684SAlexander V. Chernikov * English. 437e5bf684SAlexander V. Chernikov * 447e5bf684SAlexander V. Chernikov * The limited permissions granted above are perpetual and will not be 457e5bf684SAlexander V. Chernikov * revoked by the Internet Society or its successors or assignees. 467e5bf684SAlexander V. Chernikov * 477e5bf684SAlexander V. Chernikov * This document and the information contained herein is provided on an 487e5bf684SAlexander V. Chernikov * "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 497e5bf684SAlexander V. Chernikov * TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 507e5bf684SAlexander V. Chernikov * BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 517e5bf684SAlexander V. Chernikov * HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 527e5bf684SAlexander V. Chernikov * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 537e5bf684SAlexander V. Chernikov 547e5bf684SAlexander V. Chernikov */ 557e5bf684SAlexander V. Chernikov 567e5bf684SAlexander V. Chernikov /* 577e5bf684SAlexander V. Chernikov * This file contains structures and constants for RFC 3549 (Netlink) 587e5bf684SAlexander V. Chernikov * protocol. Some values have been taken from Linux implementation. 597e5bf684SAlexander V. Chernikov */ 607e5bf684SAlexander V. Chernikov 617e5bf684SAlexander V. Chernikov #ifndef _NETLINK_NETLINK_H_ 627e5bf684SAlexander V. Chernikov #define _NETLINK_NETLINK_H_ 637e5bf684SAlexander V. Chernikov 6429f61502SGleb Smirnoff #include <sys/param.h> 657e5bf684SAlexander V. Chernikov #include <sys/socket.h> 667e5bf684SAlexander V. Chernikov 677e5bf684SAlexander V. Chernikov struct sockaddr_nl { 687e5bf684SAlexander V. Chernikov uint8_t nl_len; /* sizeof(sockaddr_nl) */ 697e5bf684SAlexander V. Chernikov sa_family_t nl_family; /* netlink family */ 707e5bf684SAlexander V. Chernikov uint16_t nl_pad; /* reserved, set to 0 */ 717e5bf684SAlexander V. Chernikov uint32_t nl_pid; /* desired port ID, 0 for auto-select */ 727e5bf684SAlexander V. Chernikov uint32_t nl_groups; /* multicast groups mask to bind to */ 737e5bf684SAlexander V. Chernikov }; 747e5bf684SAlexander V. Chernikov 757e5bf684SAlexander V. Chernikov #define SOL_NETLINK 270 767e5bf684SAlexander V. Chernikov 777e5bf684SAlexander V. Chernikov /* Netlink socket options */ 787e5bf684SAlexander V. Chernikov #define NETLINK_ADD_MEMBERSHIP 1 /* Subscribe for the specified group notifications */ 797e5bf684SAlexander V. Chernikov #define NETLINK_DROP_MEMBERSHIP 2 /* Unsubscribe from the specified group */ 807e5bf684SAlexander V. Chernikov #define NETLINK_PKTINFO 3 /* XXX: not supported */ 817e5bf684SAlexander V. Chernikov #define NETLINK_BROADCAST_ERROR 4 /* XXX: not supported */ 827e5bf684SAlexander V. Chernikov #define NETLINK_NO_ENOBUFS 5 /* XXX: not supported */ 837e5bf684SAlexander V. Chernikov #define NETLINK_RX_RING 6 /* XXX: not supported */ 847e5bf684SAlexander V. Chernikov #define NETLINK_TX_RING 7 /* XXX: not supported */ 857e5bf684SAlexander V. Chernikov #define NETLINK_LISTEN_ALL_NSID 8 /* XXX: not supported */ 867e5bf684SAlexander V. Chernikov 877e5bf684SAlexander V. Chernikov #define NETLINK_LIST_MEMBERSHIPS 9 887e5bf684SAlexander V. Chernikov #define NETLINK_CAP_ACK 10 /* Send only original message header in the reply */ 897e5bf684SAlexander V. Chernikov #define NETLINK_EXT_ACK 11 /* Ack support for receiving additional TLVs in ack */ 907e5bf684SAlexander V. Chernikov #define NETLINK_GET_STRICT_CHK 12 /* Strict header checking */ 917e5bf684SAlexander V. Chernikov 9230d7e724SAlexander V. Chernikov #define NETLINK_MSG_INFO 257 /* (FreeBSD-specific) Receive message originator data in cmsg */ 937e5bf684SAlexander V. Chernikov 947e5bf684SAlexander V. Chernikov /* 957e5bf684SAlexander V. Chernikov * RFC 3549, 2.3.2 Netlink Message Header 967e5bf684SAlexander V. Chernikov */ 977e5bf684SAlexander V. Chernikov struct nlmsghdr { 987e5bf684SAlexander V. Chernikov uint32_t nlmsg_len; /* Length of message including header */ 997e5bf684SAlexander V. Chernikov uint16_t nlmsg_type; /* Message type identifier */ 1007e5bf684SAlexander V. Chernikov uint16_t nlmsg_flags; /* Flags (NLM_F_) */ 1017e5bf684SAlexander V. Chernikov uint32_t nlmsg_seq; /* Sequence number */ 1027e5bf684SAlexander V. Chernikov uint32_t nlmsg_pid; /* Sending process port ID */ 1037e5bf684SAlexander V. Chernikov }; 1047e5bf684SAlexander V. Chernikov 1057e5bf684SAlexander V. Chernikov /* 1067e5bf684SAlexander V. Chernikov * RFC 3549, 2.3.2 standard flag bits (nlmsg_flags) 1077e5bf684SAlexander V. Chernikov */ 1087e5bf684SAlexander V. Chernikov #define NLM_F_REQUEST 0x01 /* Indicateds request to kernel */ 1097e5bf684SAlexander V. Chernikov #define NLM_F_MULTI 0x02 /* Message is part of a group terminated by NLMSG_DONE msg */ 1107e5bf684SAlexander V. Chernikov #define NLM_F_ACK 0x04 /* Reply with ack message containing resulting error code */ 1117e5bf684SAlexander V. Chernikov #define NLM_F_ECHO 0x08 /* (not supported) Echo this request back */ 1127e5bf684SAlexander V. Chernikov #define NLM_F_DUMP_INTR 0x10 /* Dump was inconsistent due to sequence change */ 1137e5bf684SAlexander V. Chernikov #define NLM_F_DUMP_FILTERED 0x20 /* Dump was filtered as requested */ 1147e5bf684SAlexander V. Chernikov 1157e5bf684SAlexander V. Chernikov /* 1167e5bf684SAlexander V. Chernikov * RFC 3549, 2.3.2 Additional flag bits for GET requests 1177e5bf684SAlexander V. Chernikov */ 1187e5bf684SAlexander V. Chernikov #define NLM_F_ROOT 0x100 /* Return the complete table */ 1197e5bf684SAlexander V. Chernikov #define NLM_F_MATCH 0x200 /* Return all entries matching criteria */ 1207e5bf684SAlexander V. Chernikov #define NLM_F_ATOMIC 0x400 /* Return an atomic snapshot (ignored) */ 1217e5bf684SAlexander V. Chernikov #define NLM_F_DUMP (NLM_F_ROOT | NLM_F_MATCH) 1227e5bf684SAlexander V. Chernikov 1237e5bf684SAlexander V. Chernikov /* 1247e5bf684SAlexander V. Chernikov * RFC 3549, 2.3.2 Additional flag bits for NEW requests 1257e5bf684SAlexander V. Chernikov */ 1267e5bf684SAlexander V. Chernikov #define NLM_F_REPLACE 0x100 /* Replace existing matching config object */ 1277e5bf684SAlexander V. Chernikov #define NLM_F_EXCL 0x200 /* Don't replace the object if exists */ 1287e5bf684SAlexander V. Chernikov #define NLM_F_CREATE 0x400 /* Create if it does not exist */ 1297e5bf684SAlexander V. Chernikov #define NLM_F_APPEND 0x800 /* Add to end of list */ 1307e5bf684SAlexander V. Chernikov 1317e5bf684SAlexander V. Chernikov /* Modifiers to DELETE requests */ 1327e5bf684SAlexander V. Chernikov #define NLM_F_NONREC 0x100 /* Do not delete recursively */ 1337e5bf684SAlexander V. Chernikov 1347e5bf684SAlexander V. Chernikov /* Flags for ACK message */ 1357e5bf684SAlexander V. Chernikov #define NLM_F_CAPPED 0x100 /* request was capped */ 1367e5bf684SAlexander V. Chernikov #define NLM_F_ACK_TLVS 0x200 /* extended ACK TVLs were included */ 1377e5bf684SAlexander V. Chernikov 1387e5bf684SAlexander V. Chernikov /* 1397e5bf684SAlexander V. Chernikov * RFC 3549, 2.3.2 standard message types (nlmsg_type). 1407e5bf684SAlexander V. Chernikov */ 1417e5bf684SAlexander V. Chernikov #define NLMSG_NOOP 0x1 /* Message is ignored. */ 1427e5bf684SAlexander V. Chernikov #define NLMSG_ERROR 0x2 /* reply error code reporting */ 1437e5bf684SAlexander V. Chernikov #define NLMSG_DONE 0x3 /* Message terminates a multipart message. */ 1447e5bf684SAlexander V. Chernikov #define NLMSG_OVERRUN 0x4 /* overrun detected, data is lost */ 1457e5bf684SAlexander V. Chernikov 1467e5bf684SAlexander V. Chernikov #define NLMSG_MIN_TYPE 0x10 /* < 0x10: reserved control messages */ 1477e5bf684SAlexander V. Chernikov 1487e5bf684SAlexander V. Chernikov /* 1497e5bf684SAlexander V. Chernikov * Defition of numbers assigned to the netlink subsystems. 1507e5bf684SAlexander V. Chernikov */ 1517e5bf684SAlexander V. Chernikov #define NETLINK_ROUTE 0 /* Routing/device hook */ 1527e5bf684SAlexander V. Chernikov #define NETLINK_UNUSED 1 /* not supported */ 1537e5bf684SAlexander V. Chernikov #define NETLINK_USERSOCK 2 /* not supported */ 1547e5bf684SAlexander V. Chernikov #define NETLINK_FIREWALL 3 /* not supported */ 1557e5bf684SAlexander V. Chernikov #define NETLINK_SOCK_DIAG 4 /* not supported */ 1567e5bf684SAlexander V. Chernikov #define NETLINK_NFLOG 5 /* not supported */ 1577e5bf684SAlexander V. Chernikov #define NETLINK_XFRM 6 /* (not supported) PF_SETKEY */ 1587e5bf684SAlexander V. Chernikov #define NETLINK_SELINUX 7 /* not supported */ 1597e5bf684SAlexander V. Chernikov #define NETLINK_ISCSI 8 /* not supported */ 1607e5bf684SAlexander V. Chernikov #define NETLINK_AUDIT 9 /* not supported */ 1617e5bf684SAlexander V. Chernikov #define NETLINK_FIB_LOOKUP 10 /* not supported */ 1627e5bf684SAlexander V. Chernikov #define NETLINK_CONNECTOR 11 /* not supported */ 1637e5bf684SAlexander V. Chernikov #define NETLINK_NETFILTER 12 /* not supported */ 1647e5bf684SAlexander V. Chernikov #define NETLINK_IP6_FW 13 /* not supported */ 1657e5bf684SAlexander V. Chernikov #define NETLINK_DNRTMSG 14 /* not supported */ 1667e5bf684SAlexander V. Chernikov #define NETLINK_KOBJECT_UEVENT 15 /* not supported */ 1677e5bf684SAlexander V. Chernikov #define NETLINK_GENERIC 16 /* Generic netlink (dynamic families) */ 1687e5bf684SAlexander V. Chernikov 1697e5bf684SAlexander V. Chernikov /* 1707e5bf684SAlexander V. Chernikov * RFC 3549, 2.3.2.2 The ACK Netlink Message 1717e5bf684SAlexander V. Chernikov */ 1727e5bf684SAlexander V. Chernikov struct nlmsgerr { 1737e5bf684SAlexander V. Chernikov int error; 1747e5bf684SAlexander V. Chernikov struct nlmsghdr msg; 1757e5bf684SAlexander V. Chernikov }; 1767e5bf684SAlexander V. Chernikov 1777e5bf684SAlexander V. Chernikov enum nlmsgerr_attrs { 1787e5bf684SAlexander V. Chernikov NLMSGERR_ATTR_UNUSED, 1797e5bf684SAlexander V. Chernikov NLMSGERR_ATTR_MSG = 1, /* string, error message */ 1807e5bf684SAlexander V. Chernikov NLMSGERR_ATTR_OFFS = 2, /* u32, offset of the invalid attr from nl header */ 1817e5bf684SAlexander V. Chernikov NLMSGERR_ATTR_COOKIE = 3, /* binary, data to pass to userland */ 1827e5bf684SAlexander V. Chernikov NLMSGERR_ATTR_POLICY = 4, /* not supported */ 1837e5bf684SAlexander V. Chernikov __NLMSGERR_ATTR_MAX, 1847e5bf684SAlexander V. Chernikov NLMSGERR_ATTR_MAX = __NLMSGERR_ATTR_MAX - 1 1857e5bf684SAlexander V. Chernikov }; 1867e5bf684SAlexander V. Chernikov 18730d7e724SAlexander V. Chernikov /* FreeBSD-specific debugging info */ 18830d7e724SAlexander V. Chernikov 18930d7e724SAlexander V. Chernikov enum nlmsginfo_attrs { 19030d7e724SAlexander V. Chernikov NLMSGINFO_ATTR_UNUSED, 19130d7e724SAlexander V. Chernikov NLMSGINFO_ATTR_PROCESS_ID = 1, /* u32, source process PID */ 19230d7e724SAlexander V. Chernikov NLMSGINFO_ATTR_PORT_ID = 2, /* u32, source socket nl_pid */ 19330d7e724SAlexander V. Chernikov NLMSGINFO_ATTR_SEQ_ID = 3, /* u32, source message seq_id */ 19430d7e724SAlexander V. Chernikov }; 19530d7e724SAlexander V. Chernikov 1967e5bf684SAlexander V. Chernikov 1977e5bf684SAlexander V. Chernikov #define NL_ITEM_ALIGN_SIZE sizeof(uint32_t) 198*5143d8c4SGleb Popov #define NL_ITEM_ALIGN(_len) __align_up(_len, NL_ITEM_ALIGN_SIZE) 1997e5bf684SAlexander V. Chernikov #define NL_ITEM_DATA(_ptr, _off) ((void *)((char *)(_ptr) + _off)) 2007e5bf684SAlexander V. Chernikov #define NL_ITEM_DATA_CONST(_ptr, _off) ((const void *)((const char *)(_ptr) + _off)) 2017e5bf684SAlexander V. Chernikov 2027e5bf684SAlexander V. Chernikov #define NL_ITEM_OK(_ptr, _len, _hlen, _LEN_M) \ 2037e5bf684SAlexander V. Chernikov ((_len) >= _hlen && _LEN_M(_ptr) >= _hlen && _LEN_M(_ptr) <= (_len)) 2044261507aSLexi Winter #define NL_ITEM_NEXT(_ptr, _LEN_M) ((__typeof(_ptr))((char *)(_ptr) + _LEN_M(_ptr))) 2057e5bf684SAlexander V. Chernikov #define NL_ITEM_ITER(_ptr, _len, _LEN_MACRO) \ 2067e5bf684SAlexander V. Chernikov ((_len) -= _LEN_MACRO(_ptr), NL_ITEM_NEXT(_ptr, _LEN_MACRO)) 2077e5bf684SAlexander V. Chernikov 2087e5bf684SAlexander V. Chernikov /* part of netlink(3) API */ 2097e5bf684SAlexander V. Chernikov #define NLMSG_ALIGNTO NL_ITEM_ALIGN_SIZE 2107e5bf684SAlexander V. Chernikov #define NLMSG_ALIGN(_len) NL_ITEM_ALIGN(_len) 2119df901c8SGleb Popov 2129df901c8SGleb Popov #ifndef _KERNEL 2139df901c8SGleb Popov /* part of netlink(3) API */ 214c7919fb9SGleb Popov #define NLMSG_HDRLEN (sizeof(struct nlmsghdr)) 2157e5bf684SAlexander V. Chernikov #define NLMSG_LENGTH(_len) ((_len) + NLMSG_HDRLEN) 21603de61aaSAlexander V. Chernikov #define NLMSG_SPACE(_len) NLMSG_ALIGN(NLMSG_LENGTH(_len)) 2177e5bf684SAlexander V. Chernikov #define NLMSG_DATA(_hdr) NL_ITEM_DATA(_hdr, NLMSG_HDRLEN) 218c7919fb9SGleb Popov #define _NLMSG_LEN(_hdr) ((_hdr)->nlmsg_len) 2197e5bf684SAlexander V. Chernikov #define _NLMSG_ALIGNED_LEN(_hdr) NLMSG_ALIGN(_NLMSG_LEN(_hdr)) 2207e5bf684SAlexander V. Chernikov #define NLMSG_OK(_hdr, _len) NL_ITEM_OK(_hdr, _len, NLMSG_HDRLEN, _NLMSG_LEN) 2217e5bf684SAlexander V. Chernikov #define NLMSG_PAYLOAD(_hdr,_len) (_NLMSG_LEN(_hdr) - NLMSG_SPACE((_len))) 2227e5bf684SAlexander V. Chernikov #define NLMSG_NEXT(_hdr, _len) NL_ITEM_ITER(_hdr, _len, _NLMSG_ALIGNED_LEN) 2237e5bf684SAlexander V. Chernikov 2247e5bf684SAlexander V. Chernikov #else 225c7919fb9SGleb Popov #define NLMSG_HDRLEN (NLMSG_ALIGN(sizeof(struct nlmsghdr))) 2267e5bf684SAlexander V. Chernikov #endif 2277e5bf684SAlexander V. Chernikov 2287e5bf684SAlexander V. Chernikov /* 2297e5bf684SAlexander V. Chernikov * Base netlink attribute TLV header. 2307e5bf684SAlexander V. Chernikov */ 2317e5bf684SAlexander V. Chernikov struct nlattr { 2327e5bf684SAlexander V. Chernikov uint16_t nla_len; /* Total attribute length */ 2337e5bf684SAlexander V. Chernikov uint16_t nla_type; /* Attribute type */ 2347e5bf684SAlexander V. Chernikov }; 2357e5bf684SAlexander V. Chernikov 2367e5bf684SAlexander V. Chernikov /* 2377e5bf684SAlexander V. Chernikov * 2387e5bf684SAlexander V. Chernikov * nl_type field enconding: 2397e5bf684SAlexander V. Chernikov * 2407e5bf684SAlexander V. Chernikov * 0 1 2417e5bf684SAlexander V. Chernikov * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 2427e5bf684SAlexander V. Chernikov * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2437e5bf684SAlexander V. Chernikov * |N|O| Attribute type | 2447e5bf684SAlexander V. Chernikov * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2457e5bf684SAlexander V. Chernikov * N - attribute contains other attributes (mostly unused) 2467e5bf684SAlexander V. Chernikov * O - encoded in network byte order (mostly unused) 2477e5bf684SAlexander V. Chernikov * Note: N & O are mutually exclusive 2487e5bf684SAlexander V. Chernikov * 2497e5bf684SAlexander V. Chernikov * Note: attribute type value scope normally is either parent attribute 2507e5bf684SAlexander V. Chernikov * or the message/message group. 2517e5bf684SAlexander V. Chernikov */ 2527e5bf684SAlexander V. Chernikov 2537e5bf684SAlexander V. Chernikov #define NLA_F_NESTED (1 << 15) 2547e5bf684SAlexander V. Chernikov #define NLA_F_NET_BYTEORDER (1 << 14) 2557e5bf684SAlexander V. Chernikov #define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER) 2567e5bf684SAlexander V. Chernikov 2577e5bf684SAlexander V. Chernikov #ifndef _KERNEL 2587e5bf684SAlexander V. Chernikov #define NLA_ALIGNTO NL_ITEM_ALIGN_SIZE 2597e5bf684SAlexander V. Chernikov #define NLA_ALIGN(_len) NL_ITEM_ALIGN(_len) 2607e5bf684SAlexander V. Chernikov #define NLA_HDRLEN ((int)sizeof(struct nlattr)) 2617e5bf684SAlexander V. Chernikov #endif 2627e5bf684SAlexander V. Chernikov 2637e5bf684SAlexander V. Chernikov #endif 264