diff options
-rw-r--r-- | man/systemd.network.xml | 73 | ||||
-rw-r--r-- | src/basic/linux/batman_adv.h | 1252 | ||||
-rw-r--r-- | src/basic/linux/btrfs.h | 5 | ||||
-rw-r--r-- | src/basic/linux/btrfs_tree.h | 7 | ||||
-rw-r--r-- | src/basic/linux/can/netlink.h | 1 | ||||
-rw-r--r-- | src/basic/linux/if_bonding.h | 12 | ||||
-rw-r--r-- | src/basic/linux/if_bridge.h | 128 | ||||
-rw-r--r-- | src/basic/linux/if_ether.h | 1 | ||||
-rw-r--r-- | src/basic/linux/if_link.h | 12 | ||||
-rw-r--r-- | src/basic/linux/in.h | 3 | ||||
-rw-r--r-- | src/basic/linux/l2tp.h | 1 | ||||
-rw-r--r-- | src/basic/linux/netfilter/nf_tables.h | 63 | ||||
-rw-r--r-- | src/basic/linux/netfilter/nfnetlink.h | 9 | ||||
-rw-r--r-- | src/basic/linux/netlink.h | 7 | ||||
-rw-r--r-- | src/basic/linux/nexthop.h | 47 | ||||
-rw-r--r-- | src/basic/linux/nl80211.h | 196 | ||||
-rw-r--r-- | src/basic/linux/pkt_sched.h | 1 | ||||
-rw-r--r-- | src/basic/linux/rtnetlink.h | 33 | ||||
-rw-r--r-- | src/network/networkd-can.c | 324 | ||||
-rw-r--r-- | src/network/networkd-can.h | 6 | ||||
-rw-r--r-- | src/network/networkd-network-gperf.gperf | 28 | ||||
-rw-r--r-- | src/network/networkd-network.c | 5 | ||||
-rw-r--r-- | src/network/networkd-network.h | 20 | ||||
-rw-r--r-- | test/fuzz/fuzz-network-parser/directives.network | 14 |
24 files changed, 1480 insertions, 768 deletions
diff --git a/man/systemd.network.xml b/man/systemd.network.xml index e568ef9b45..3bd0e04879 100644 --- a/man/systemd.network.xml +++ b/man/systemd.network.xml @@ -2966,7 +2966,27 @@ IPv6Token=prefixstable:2002:da8:1::</programlisting></para> <term><varname>SamplePoint=</varname></term> <listitem> <para>Optional sample point in percent with one decimal (e.g. <literal>75%</literal>, - <literal>87.5%</literal>) or permille (e.g. <literal>875‰</literal>).</para> + <literal>87.5%</literal>) or permille (e.g. <literal>875‰</literal>). This will be ignored when + <varname>BitRate=</varname> is unspecified.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><varname>TimeQuantaNSec=</varname></term> + <term><varname>PropagationSegment=</varname></term> + <term><varname>PhaseBufferSegment1=</varname></term> + <term><varname>PhaseBufferSegment2=</varname></term> + <term><varname>SyncJumpWidth=</varname></term> + <listitem> + <para>Specifies the time quanta, propagation segment, phase buffer segment 1 and 2, and the + synchronization jump width, which allow to define the CAN bit-timing in a hardware + independent format as proposed by the Bosch CAN 2.0 Specification. + <varname>TimeQuantaNSec=</varname> takes a timespan in nanoseconds. + <varname>PropagationSegment=</varname>, <varname>PhaseBufferSegment1=</varname>, + <varname>PhaseBufferSegment2=</varname>, and <varname>SyncJumpWidth=</varname> take number + of time quantum specified in <varname>TimeQuantaNSec=</varname> and must be an unsigned + integer in the range 0…4294967295. These settings except for + <varname>SyncJumpWidth=</varname> will be ignored when <varname>BitRate=</varname> is + specified.</para> </listitem> </varlistentry> <varlistentry> @@ -2978,11 +2998,24 @@ IPv6Token=prefixstable:2002:da8:1::</programlisting></para> </listitem> </varlistentry> <varlistentry> + <term><varname>DataTimeQuantaNSec=</varname></term> + <term><varname>DataPropagationSegment=</varname></term> + <term><varname>DataPhaseBufferSegment1=</varname></term> + <term><varname>DataPhaseBufferSegment2=</varname></term> + <term><varname>DataSyncJumpWidth=</varname></term> + <listitem> + <para>Specifies the time quanta, propagation segment, phase buffer segment 1 and 2, and the + synchronization jump width for the data phase, if CAN-FD is used. These settings are + analogous to the <varname>TimeQuantaNSec=</varname> or related settings.</para> + </listitem> + </varlistentry> + <varlistentry> <term><varname>FDMode=</varname></term> <listitem> <para>Takes a boolean. When <literal>yes</literal>, CAN-FD mode is enabled for the interface. Note, that a bitrate and optional sample point should also be set for the CAN-FD data phase using - the <varname>DataBitRate=</varname> and <varname>DataSamplePoint=</varname> keys.</para> + the <varname>DataBitRate=</varname> and <varname>DataSamplePoint=</varname> keys, or + <varname>DataTimeQuanta=</varname> and related settings.</para> </listitem> </varlistentry> <varlistentry> @@ -3005,8 +3038,10 @@ IPv6Token=prefixstable:2002:da8:1::</programlisting></para> <varlistentry> <term><varname>Termination=</varname></term> <listitem> - <para>Takes a boolean. When <literal>yes</literal>, the termination resistor will be selected for - the bias network. When unset, the kernel's default will be used.</para> + <para>Takes a boolean or a termination resistor value in ohm in the range 0–65535. When + <literal>yes</literal>, the termination resistor is set to 120 ohm. When + <literal>no</literal> or <literal>0</literal> is set, the termination resistor is disabled. + When unset, the kernel's default will be used.</para> </listitem> </varlistentry> <varlistentry> @@ -3036,6 +3071,36 @@ IPv6Token=prefixstable:2002:da8:1::</programlisting></para> </para> </listitem> </varlistentry> + <varlistentry> + <term><varname>Loopback=</varname></term> + <listitem> + <para>Takes a boolean. When <literal>yes</literal>, loopback mode is enabled. When the + loopback mode is enabled, the interface treats messages transmitted by itself as received + messages. The loopback mode is important to debug CAN networks. When unset, the kernel's + default will be used.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><varname>OneShot=</varname></term> + <listitem> + <para>Takes a boolean. When <literal>yes</literal>, one-shot mode is enabled. When unset, + the kernel's default will be used.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><varname>PresumeAck=</varname></term> + <listitem> + <para>Takes a boolean. When <literal>yes</literal>, the interface will ignore missing CAN + ACKs. When unset, the kernel's default will be used.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><varname>ClassicDataLengthCode=</varname></term> + <listitem> + <para>Takes a boolean. When <literal>yes</literal>, the interface will handle the 4bit data + length code (DLC). When unset, the kernel's default will be used.</para> + </listitem> + </varlistentry> </variablelist> </refsect1> diff --git a/src/basic/linux/batman_adv.h b/src/basic/linux/batman_adv.h index d035e4cf34..35dc016c9b 100644 --- a/src/basic/linux/batman_adv.h +++ b/src/basic/linux/batman_adv.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: MIT */ -/* Copyright (C) 2016-2020 B.A.T.M.A.N. contributors: +/* Copyright (C) B.A.T.M.A.N. contributors: * * Matthias Schiffer */ @@ -24,54 +24,54 @@ * in the TT CRC computation. */ enum batadv_tt_client_flags { - /** - * @BATADV_TT_CLIENT_DEL: the client has to be deleted from the table - */ - BATADV_TT_CLIENT_DEL = (1 << 0), - - /** - * @BATADV_TT_CLIENT_ROAM: the client roamed to/from another node and - * the new update telling its new real location has not been - * received/sent yet - */ - BATADV_TT_CLIENT_ROAM = (1 << 1), - - /** - * @BATADV_TT_CLIENT_WIFI: this client is connected through a wifi - * interface. This information is used by the "AP Isolation" feature - */ - BATADV_TT_CLIENT_WIFI = (1 << 4), - - /** - * @BATADV_TT_CLIENT_ISOLA: this client is considered "isolated". This - * information is used by the Extended Isolation feature - */ - BATADV_TT_CLIENT_ISOLA = (1 << 5), - - /** - * @BATADV_TT_CLIENT_NOPURGE: this client should never be removed from - * the table - */ - BATADV_TT_CLIENT_NOPURGE = (1 << 8), - - /** - * @BATADV_TT_CLIENT_NEW: this client has been added to the local table - * but has not been announced yet - */ - BATADV_TT_CLIENT_NEW = (1 << 9), - - /** - * @BATADV_TT_CLIENT_PENDING: this client is marked for removal but it - * is kept in the table for one more originator interval for consistency - * purposes - */ - BATADV_TT_CLIENT_PENDING = (1 << 10), - - /** - * @BATADV_TT_CLIENT_TEMP: this global client has been detected to be - * part of the network but no node has already announced it - */ - BATADV_TT_CLIENT_TEMP = (1 << 11), + /** + * @BATADV_TT_CLIENT_DEL: the client has to be deleted from the table + */ + BATADV_TT_CLIENT_DEL = (1 << 0), + + /** + * @BATADV_TT_CLIENT_ROAM: the client roamed to/from another node and + * the new update telling its new real location has not been + * received/sent yet + */ + BATADV_TT_CLIENT_ROAM = (1 << 1), + + /** + * @BATADV_TT_CLIENT_WIFI: this client is connected through a wifi + * interface. This information is used by the "AP Isolation" feature + */ + BATADV_TT_CLIENT_WIFI = (1 << 4), + + /** + * @BATADV_TT_CLIENT_ISOLA: this client is considered "isolated". This + * information is used by the Extended Isolation feature + */ + BATADV_TT_CLIENT_ISOLA = (1 << 5), + + /** + * @BATADV_TT_CLIENT_NOPURGE: this client should never be removed from + * the table + */ + BATADV_TT_CLIENT_NOPURGE = (1 << 8), + + /** + * @BATADV_TT_CLIENT_NEW: this client has been added to the local table + * but has not been announced yet + */ + BATADV_TT_CLIENT_NEW = (1 << 9), + + /** + * @BATADV_TT_CLIENT_PENDING: this client is marked for removal but it + * is kept in the table for one more originator interval for consistency + * purposes + */ + BATADV_TT_CLIENT_PENDING = (1 << 10), + + /** + * @BATADV_TT_CLIENT_TEMP: this global client has been detected to be + * part of the network but no node has already announced it + */ + BATADV_TT_CLIENT_TEMP = (1 << 11), }; /** @@ -88,615 +88,615 @@ enum batadv_tt_client_flags { * related flags are undefined. */ enum batadv_mcast_flags_priv { - /** - * @BATADV_MCAST_FLAGS_BRIDGED: There is a bridge on top of the mesh - * interface. - */ - BATADV_MCAST_FLAGS_BRIDGED = (1 << 0), - - /** - * @BATADV_MCAST_FLAGS_QUERIER_IPV4_EXISTS: Whether an IGMP querier - * exists in the mesh - */ - BATADV_MCAST_FLAGS_QUERIER_IPV4_EXISTS = (1 << 1), - - /** - * @BATADV_MCAST_FLAGS_QUERIER_IPV6_EXISTS: Whether an MLD querier - * exists in the mesh - */ - BATADV_MCAST_FLAGS_QUERIER_IPV6_EXISTS = (1 << 2), - - /** - * @BATADV_MCAST_FLAGS_QUERIER_IPV4_SHADOWING: If an IGMP querier - * exists, whether it is potentially shadowing multicast listeners - * (i.e. querier is behind our own bridge segment) - */ - BATADV_MCAST_FLAGS_QUERIER_IPV4_SHADOWING = (1 << 3), - - /** - * @BATADV_MCAST_FLAGS_QUERIER_IPV6_SHADOWING: If an MLD querier - * exists, whether it is potentially shadowing multicast listeners - * (i.e. querier is behind our own bridge segment) - */ - BATADV_MCAST_FLAGS_QUERIER_IPV6_SHADOWING = (1 << 4), + /** + * @BATADV_MCAST_FLAGS_BRIDGED: There is a bridge on top of the mesh + * interface. + */ + BATADV_MCAST_FLAGS_BRIDGED = (1 << 0), + + /** + * @BATADV_MCAST_FLAGS_QUERIER_IPV4_EXISTS: Whether an IGMP querier + * exists in the mesh + */ + BATADV_MCAST_FLAGS_QUERIER_IPV4_EXISTS = (1 << 1), + + /** + * @BATADV_MCAST_FLAGS_QUERIER_IPV6_EXISTS: Whether an MLD querier + * exists in the mesh + */ + BATADV_MCAST_FLAGS_QUERIER_IPV6_EXISTS = (1 << 2), + + /** + * @BATADV_MCAST_FLAGS_QUERIER_IPV4_SHADOWING: If an IGMP querier + * exists, whether it is potentially shadowing multicast listeners + * (i.e. querier is behind our own bridge segment) + */ + BATADV_MCAST_FLAGS_QUERIER_IPV4_SHADOWING = (1 << 3), + + /** + * @BATADV_MCAST_FLAGS_QUERIER_IPV6_SHADOWING: If an MLD querier + * exists, whether it is potentially shadowing multicast listeners + * (i.e. querier is behind our own bridge segment) + */ + BATADV_MCAST_FLAGS_QUERIER_IPV6_SHADOWING = (1 << 4), }; /** * enum batadv_gw_modes - gateway mode of node */ enum batadv_gw_modes { - /** @BATADV_GW_MODE_OFF: gw mode disabled */ - BATADV_GW_MODE_OFF, + /** @BATADV_GW_MODE_OFF: gw mode disabled */ + BATADV_GW_MODE_OFF, - /** @BATADV_GW_MODE_CLIENT: send DHCP requests to gw servers */ - BATADV_GW_MODE_CLIENT, + /** @BATADV_GW_MODE_CLIENT: send DHCP requests to gw servers */ + BATADV_GW_MODE_CLIENT, - /** @BATADV_GW_MODE_SERVER: announce itself as gateway server */ - BATADV_GW_MODE_SERVER, + /** @BATADV_GW_MODE_SERVER: announce itself as gateway server */ + BATADV_GW_MODE_SERVER, }; /** * enum batadv_nl_attrs - batman-adv netlink attributes */ enum batadv_nl_attrs { - /** - * @BATADV_ATTR_UNSPEC: unspecified attribute to catch errors - */ - BATADV_ATTR_UNSPEC, - - /** - * @BATADV_ATTR_VERSION: batman-adv version string - */ - BATADV_ATTR_VERSION, - - /** - * @BATADV_ATTR_ALGO_NAME: name of routing algorithm - */ - BATADV_ATTR_ALGO_NAME, - - /** - * @BATADV_ATTR_MESH_IFINDEX: index of the batman-adv interface - */ - BATADV_ATTR_MESH_IFINDEX, - - /** - * @BATADV_ATTR_MESH_IFNAME: name of the batman-adv interface - */ - BATADV_ATTR_MESH_IFNAME, - - /** - * @BATADV_ATTR_MESH_ADDRESS: mac address of the batman-adv interface - */ - BATADV_ATTR_MESH_ADDRESS, - - /** - * @BATADV_ATTR_HARD_IFINDEX: index of the non-batman-adv interface - */ - BATADV_ATTR_HARD_IFINDEX, - - /** - * @BATADV_ATTR_HARD_IFNAME: name of the non-batman-adv interface - */ - BATADV_ATTR_HARD_IFNAME, - - /** - * @BATADV_ATTR_HARD_ADDRESS: mac address of the non-batman-adv - * interface - */ - BATADV_ATTR_HARD_ADDRESS, - - /** - * @BATADV_ATTR_ORIG_ADDRESS: originator mac address - */ - BATADV_ATTR_ORIG_ADDRESS, - - /** - * @BATADV_ATTR_TPMETER_RESULT: result of run (see - * batadv_tp_meter_status) - */ - BATADV_ATTR_TPMETER_RESULT, - - /** - * @BATADV_ATTR_TPMETER_TEST_TIME: time (msec) the run took - */ - BATADV_ATTR_TPMETER_TEST_TIME, - - /** - * @BATADV_ATTR_TPMETER_BYTES: amount of acked bytes during run - */ - BATADV_ATTR_TPMETER_BYTES, - - /** - * @BATADV_ATTR_TPMETER_COOKIE: session cookie to match tp_meter session - */ - BATADV_ATTR_TPMETER_COOKIE, - - /** - * @BATADV_ATTR_PAD: attribute used for padding for 64-bit alignment - */ - BATADV_ATTR_PAD, - - /** - * @BATADV_ATTR_ACTIVE: Flag indicating if the hard interface is active - */ - BATADV_ATTR_ACTIVE, - - /** - * @BATADV_ATTR_TT_ADDRESS: Client MAC address - */ - BATADV_ATTR_TT_ADDRESS, - - /** - * @BATADV_ATTR_TT_TTVN: Translation table version - */ - BATADV_ATTR_TT_TTVN, - - /** - * @BATADV_ATTR_TT_LAST_TTVN: Previous translation table version - */ - BATADV_ATTR_TT_LAST_TTVN, - - /** - * @BATADV_ATTR_TT_CRC32: CRC32 over translation table - */ - BATADV_ATTR_TT_CRC32, - - /** - * @BATADV_ATTR_TT_VID: VLAN ID - */ - BATADV_ATTR_TT_VID, - - /** - * @BATADV_ATTR_TT_FLAGS: Translation table client flags - */ - BATADV_ATTR_TT_FLAGS, - - /** - * @BATADV_ATTR_FLAG_BEST: Flags indicating entry is the best - */ - BATADV_ATTR_FLAG_BEST, - - /** - * @BATADV_ATTR_LAST_SEEN_MSECS: Time in milliseconds since last seen - */ - BATADV_ATTR_LAST_SEEN_MSECS, - - /** - * @BATADV_ATTR_NEIGH_ADDRESS: Neighbour MAC address - */ - BATADV_ATTR_NEIGH_ADDRESS, - - /** - * @BATADV_ATTR_TQ: TQ to neighbour - */ - BATADV_ATTR_TQ, - - /** - * @BATADV_ATTR_THROUGHPUT: Estimated throughput to Neighbour - */ - BATADV_ATTR_THROUGHPUT, - - /** - * @BATADV_ATTR_BANDWIDTH_UP: Reported uplink bandwidth - */ - BATADV_ATTR_BANDWIDTH_UP, - - /** - * @BATADV_ATTR_BANDWIDTH_DOWN: Reported downlink bandwidth - */ - BATADV_ATTR_BANDWIDTH_DOWN, - - /** - * @BATADV_ATTR_ROUTER: Gateway router MAC address - */ - BATADV_ATTR_ROUTER, - - /** - * @BATADV_ATTR_BLA_OWN: Flag indicating own originator - */ - BATADV_ATTR_BLA_OWN, - - /** - * @BATADV_ATTR_BLA_ADDRESS: Bridge loop avoidance claim MAC address - */ - BATADV_ATTR_BLA_ADDRESS, - - /** - * @BATADV_ATTR_BLA_VID: BLA VLAN ID - */ - BATADV_ATTR_BLA_VID, - - /** - * @BATADV_ATTR_BLA_BACKBONE: BLA gateway originator MAC address - */ - BATADV_ATTR_BLA_BACKBONE, - - /** - * @BATADV_ATTR_BLA_CRC: BLA CRC - */ - BATADV_ATTR_BLA_CRC, - - /** - * @BATADV_ATTR_DAT_CACHE_IP4ADDRESS: Client IPv4 address - */ - BATADV_ATTR_DAT_CACHE_IP4ADDRESS, - - /** - * @BATADV_ATTR_DAT_CACHE_HWADDRESS: Client MAC address - */ - BATADV_ATTR_DAT_CACHE_HWADDRESS, - - /** - * @BATADV_ATTR_DAT_CACHE_VID: VLAN ID - */ - BATADV_ATTR_DAT_CACHE_VID, - - /** - * @BATADV_ATTR_MCAST_FLAGS: Per originator multicast flags - */ - BATADV_ATTR_MCAST_FLAGS, - - /** - * @BATADV_ATTR_MCAST_FLAGS_PRIV: Private, own multicast flags - */ - BATADV_ATTR_MCAST_FLAGS_PRIV, - - /** - * @BATADV_ATTR_VLANID: VLAN id on top of soft interface - */ - BATADV_ATTR_VLANID, - - /** - * @BATADV_ATTR_AGGREGATED_OGMS_ENABLED: whether the batman protocol - * messages of the mesh interface shall be aggregated or not. - */ - BATADV_ATTR_AGGREGATED_OGMS_ENABLED, - - /** - * @BATADV_ATTR_AP_ISOLATION_ENABLED: whether the data traffic going - * from a wireless client to another wireless client will be silently - * dropped. - */ - BATADV_ATTR_AP_ISOLATION_ENABLED, - - /** - * @BATADV_ATTR_ISOLATION_MARK: the isolation mark which is used to - * classify clients as "isolated" by the Extended Isolation feature. - */ - BATADV_ATTR_ISOLATION_MARK, - - /** - * @BATADV_ATTR_ISOLATION_MASK: the isolation (bit)mask which is used to - * classify clients as "isolated" by the Extended Isolation feature. - */ - BATADV_ATTR_ISOLATION_MASK, - - /** - * @BATADV_ATTR_BONDING_ENABLED: whether the data traffic going through - * the mesh will be sent using multiple interfaces at the same time. - */ - BATADV_ATTR_BONDING_ENABLED, - - /** - * @BATADV_ATTR_BRIDGE_LOOP_AVOIDANCE_ENABLED: whether the bridge loop - * avoidance feature is enabled. This feature detects and avoids loops - * between the mesh and devices bridged with the soft interface - */ - BATADV_ATTR_BRIDGE_LOOP_AVOIDANCE_ENABLED, - - /** - * @BATADV_ATTR_DISTRIBUTED_ARP_TABLE_ENABLED: whether the distributed - * arp table feature is enabled. This feature uses a distributed hash - * table to answer ARP requests without flooding the request through - * the whole mesh. - */ - BATADV_ATTR_DISTRIBUTED_ARP_TABLE_ENABLED, - - /** - * @BATADV_ATTR_FRAGMENTATION_ENABLED: whether the data traffic going - * through the mesh will be fragmented or silently discarded if the - * packet size exceeds the outgoing interface MTU. - */ - BATADV_ATTR_FRAGMENTATION_ENABLED, - - /** - * @BATADV_ATTR_GW_BANDWIDTH_DOWN: defines the download bandwidth which - * is propagated by this node if %BATADV_ATTR_GW_BANDWIDTH_MODE was set - * to 'server'. - */ - BATADV_ATTR_GW_BANDWIDTH_DOWN, - - /** - * @BATADV_ATTR_GW_BANDWIDTH_UP: defines the upload bandwidth which - * is propagated by this node if %BATADV_ATTR_GW_BANDWIDTH_MODE was set - * to 'server'. - */ - BATADV_ATTR_GW_BANDWIDTH_UP, - - /** - * @BATADV_ATTR_GW_MODE: defines the state of the gateway features. - * Possible values are specified in enum batadv_gw_modes - */ - BATADV_ATTR_GW_MODE, - - /** - * @BATADV_ATTR_GW_SEL_CLASS: defines the selection criteria this node - * will use to choose a gateway if gw_mode was set to 'client'. - */ - BATADV_ATTR_GW_SEL_CLASS, - - /** - * @BATADV_ATTR_HOP_PENALTY: defines the penalty which will be applied - * to an originator message's tq-field on every hop and/or per - * hard interface - */ - BATADV_ATTR_HOP_PENALTY, - - /** - * @BATADV_ATTR_LOG_LEVEL: bitmask with to define which debug messages - * should be send to the debug log/trace ring buffer - */ - BATADV_ATTR_LOG_LEVEL, - - /** - * @BATADV_ATTR_MULTICAST_FORCEFLOOD_ENABLED: whether multicast - * optimizations should be replaced by simple broadcast-like flooding - * of multicast packets. If set to non-zero then all nodes in the mesh - * are going to use classic flooding for any multicast packet with no - * optimizations. - */ - BATADV_ATTR_MULTICAST_FORCEFLOOD_ENABLED, - - /** - * @BATADV_ATTR_NETWORK_CODING_ENABLED: whether Network Coding (using - * some magic to send fewer wifi packets but still the same content) is - * enabled or not. - */ - BATADV_ATTR_NETWORK_CODING_ENABLED, - - /** - * @BATADV_ATTR_ORIG_INTERVAL: defines the interval in milliseconds in - * which batman sends its protocol messages. - */ - BATADV_ATTR_ORIG_INTERVAL, - - /** - * @BATADV_ATTR_ELP_INTERVAL: defines the interval in milliseconds in - * which batman emits probing packets for neighbor sensing (ELP). - */ - BATADV_ATTR_ELP_INTERVAL, - - /** - * @BATADV_ATTR_THROUGHPUT_OVERRIDE: defines the throughput value to be - * used by B.A.T.M.A.N. V when estimating the link throughput using - * this interface. If the value is set to 0 then batman-adv will try to - * estimate the throughput by itself. - */ - BATADV_ATTR_THROUGHPUT_OVERRIDE, - - /** - * @BATADV_ATTR_MULTICAST_FANOUT: defines the maximum number of packet - * copies that may be generated for a multicast-to-unicast conversion. - * Once this limit is exceeded distribution will fall back to broadcast. - */ - BATADV_ATTR_MULTICAST_FANOUT, - - /* add attributes above here, update the policy in netlink.c */ - - /** - * @__BATADV_ATTR_AFTER_LAST: internal use - */ - __BATADV_ATTR_AFTER_LAST, - - /** - * @NUM_BATADV_ATTR: total number of batadv_nl_attrs available - */ - NUM_BATADV_ATTR = __BATADV_ATTR_AFTER_LAST, - - /** - * @BATADV_ATTR_MAX: highest attribute number currently defined - */ - BATADV_ATTR_MAX = __BATADV_ATTR_AFTER_LAST - 1 + /** + * @BATADV_ATTR_UNSPEC: unspecified attribute to catch errors + */ + BATADV_ATTR_UNSPEC, + + /** + * @BATADV_ATTR_VERSION: batman-adv version string + */ + BATADV_ATTR_VERSION, + + /** + * @BATADV_ATTR_ALGO_NAME: name of routing algorithm + */ + BATADV_ATTR_ALGO_NAME, + + /** + * @BATADV_ATTR_MESH_IFINDEX: index of the batman-adv interface + */ + BATADV_ATTR_MESH_IFINDEX, + + /** + * @BATADV_ATTR_MESH_IFNAME: name of the batman-adv interface + */ + BATADV_ATTR_MESH_IFNAME, + + /** + * @BATADV_ATTR_MESH_ADDRESS: mac address of the batman-adv interface + */ + BATADV_ATTR_MESH_ADDRESS, + + /** + * @BATADV_ATTR_HARD_IFINDEX: index of the non-batman-adv interface + */ + BATADV_ATTR_HARD_IFINDEX, + + /** + * @BATADV_ATTR_HARD_IFNAME: name of the non-batman-adv interface + */ + BATADV_ATTR_HARD_IFNAME, + + /** + * @BATADV_ATTR_HARD_ADDRESS: mac address of the non-batman-adv + * interface + */ + BATADV_ATTR_HARD_ADDRESS, + + /** + * @BATADV_ATTR_ORIG_ADDRESS: originator mac address + */ + BATADV_ATTR_ORIG_ADDRESS, + + /** + * @BATADV_ATTR_TPMETER_RESULT: result of run (see + * batadv_tp_meter_status) + */ + BATADV_ATTR_TPMETER_RESULT, + + /** + * @BATADV_ATTR_TPMETER_TEST_TIME: time (msec) the run took + */ + BATADV_ATTR_TPMETER_TEST_TIME, + + /** + * @BATADV_ATTR_TPMETER_BYTES: amount of acked bytes during run + */ + BATADV_ATTR_TPMETER_BYTES, + + /** + * @BATADV_ATTR_TPMETER_COOKIE: session cookie to match tp_meter session + */ + BATADV_ATTR_TPMETER_COOKIE, + + /** + * @BATADV_ATTR_PAD: attribute used for padding for 64-bit alignment + */ + BATADV_ATTR_PAD, + + /** + * @BATADV_ATTR_ACTIVE: Flag indicating if the hard interface is active + */ + BATADV_ATTR_ACTIVE, + + /** + * @BATADV_ATTR_TT_ADDRESS: Client MAC address + */ + BATADV_ATTR_TT_ADDRESS, + + /** + * @BATADV_ATTR_TT_TTVN: Translation table version + */ + BATADV_ATTR_TT_TTVN, + + /** + * @BATADV_ATTR_TT_LAST_TTVN: Previous translation table version + */ + BATADV_ATTR_TT_LAST_TTVN, + + /** + * @BATADV_ATTR_TT_CRC32: CRC32 over translation table + */ + BATADV_ATTR_TT_CRC32, + + /** + * @BATADV_ATTR_TT_VID: VLAN ID + */ + BATADV_ATTR_TT_VID, + + /** + * @BATADV_ATTR_TT_FLAGS: Translation table client flags + */ + BATADV_ATTR_TT_FLAGS, + + /** + * @BATADV_ATTR_FLAG_BEST: Flags indicating entry is the best + */ + BATADV_ATTR_FLAG_BEST, + + /** + * @BATADV_ATTR_LAST_SEEN_MSECS: Time in milliseconds since last seen + */ + BATADV_ATTR_LAST_SEEN_MSECS, + + /** + * @BATADV_ATTR_NEIGH_ADDRESS: Neighbour MAC address + */ + BATADV_ATTR_NEIGH_ADDRESS, + + /** + * @BATADV_ATTR_TQ: TQ to neighbour + */ + BATADV_ATTR_TQ, + + /** + * @BATADV_ATTR_THROUGHPUT: Estimated throughput to Neighbour + */ + BATADV_ATTR_THROUGHPUT, + + /** + * @BATADV_ATTR_BANDWIDTH_UP: Reported uplink bandwidth + */ + BATADV_ATTR_BANDWIDTH_UP, + + /** + * @BATADV_ATTR_BANDWIDTH_DOWN: Reported downlink bandwidth + */ + BATADV_ATTR_BANDWIDTH_DOWN, + + /** + * @BATADV_ATTR_ROUTER: Gateway router MAC address + */ + BATADV_ATTR_ROUTER, + + /** + * @BATADV_ATTR_BLA_OWN: Flag indicating own originator + */ + BATADV_ATTR_BLA_OWN, + + /** + * @BATADV_ATTR_BLA_ADDRESS: Bridge loop avoidance claim MAC address + */ + BATADV_ATTR_BLA_ADDRESS, + + /** + * @BATADV_ATTR_BLA_VID: BLA VLAN ID + */ + BATADV_ATTR_BLA_VID, + + /** + * @BATADV_ATTR_BLA_BACKBONE: BLA gateway originator MAC address + */ + BATADV_ATTR_BLA_BACKBONE, + + /** + * @BATADV_ATTR_BLA_CRC: BLA CRC + */ + BATADV_ATTR_BLA_CRC, + + /** + * @BATADV_ATTR_DAT_CACHE_IP4ADDRESS: Client IPv4 address + */ + BATADV_ATTR_DAT_CACHE_IP4ADDRESS, + + /** + * @BATADV_ATTR_DAT_CACHE_HWADDRESS: Client MAC address + */ + BATADV_ATTR_DAT_CACHE_HWADDRESS, + + /** + * @BATADV_ATTR_DAT_CACHE_VID: VLAN ID + */ + BATADV_ATTR_DAT_CACHE_VID, + + /** + * @BATADV_ATTR_MCAST_FLAGS: Per originator multicast flags + */ + BATADV_ATTR_MCAST_FLAGS, + + /** + * @BATADV_ATTR_MCAST_FLAGS_PRIV: Private, own multicast flags + */ + BATADV_ATTR_MCAST_FLAGS_PRIV, + + /** + * @BATADV_ATTR_VLANID: VLAN id on top of soft interface + */ + BATADV_ATTR_VLANID, + + /** + * @BATADV_ATTR_AGGREGATED_OGMS_ENABLED: whether the batman protocol + * messages of the mesh interface shall be aggregated or not. + */ + BATADV_ATTR_AGGREGATED_OGMS_ENABLED, + + /** + * @BATADV_ATTR_AP_ISOLATION_ENABLED: whether the data traffic going + * from a wireless client to another wireless client will be silently + * dropped. + */ + BATADV_ATTR_AP_ISOLATION_ENABLED, + + /** + * @BATADV_ATTR_ISOLATION_MARK: the isolation mark which is used to + * classify clients as "isolated" by the Extended Isolation feature. + */ + BATADV_ATTR_ISOLATION_MARK, + + /** + * @BATADV_ATTR_ISOLATION_MASK: the isolation (bit)mask which is used to + * classify clients as "isolated" by the Extended Isolation feature. + */ + BATADV_ATTR_ISOLATION_MASK, + + /** + * @BATADV_ATTR_BONDING_ENABLED: whether the data traffic going through + * the mesh will be sent using multiple interfaces at the same time. + */ + BATADV_ATTR_BONDING_ENABLED, + + /** + * @BATADV_ATTR_BRIDGE_LOOP_AVOIDANCE_ENABLED: whether the bridge loop + * avoidance feature is enabled. This feature detects and avoids loops + * between the mesh and devices bridged with the soft interface + */ + BATADV_ATTR_BRIDGE_LOOP_AVOIDANCE_ENABLED, + + /** + * @BATADV_ATTR_DISTRIBUTED_ARP_TABLE_ENABLED: whether the distributed + * arp table feature is enabled. This feature uses a distributed hash + * table to answer ARP requests without flooding the request through + * the whole mesh. + */ + BATADV_ATTR_DISTRIBUTED_ARP_TABLE_ENABLED, + + /** + * @BATADV_ATTR_FRAGMENTATION_ENABLED: whether the data traffic going + * through the mesh will be fragmented or silently discarded if the + * packet size exceeds the outgoing interface MTU. + */ + BATADV_ATTR_FRAGMENTATION_ENABLED, + + /** + * @BATADV_ATTR_GW_BANDWIDTH_DOWN: defines the download bandwidth which + * is propagated by this node if %BATADV_ATTR_GW_BANDWIDTH_MODE was set + * to 'server'. + */ + BATADV_ATTR_GW_BANDWIDTH_DOWN, + + /** + * @BATADV_ATTR_GW_BANDWIDTH_UP: defines the upload bandwidth which + * is propagated by this node if %BATADV_ATTR_GW_BANDWIDTH_MODE was set + * to 'server'. + */ + BATADV_ATTR_GW_BANDWIDTH_UP, + + /** + * @BATADV_ATTR_GW_MODE: defines the state of the gateway features. + * Possible values are specified in enum batadv_gw_modes + */ + BATADV_ATTR_GW_MODE, + + /** + * @BATADV_ATTR_GW_SEL_CLASS: defines the selection criteria this node + * will use to choose a gateway if gw_mode was set to 'client'. + */ + BATADV_ATTR_GW_SEL_CLASS, + + /** + * @BATADV_ATTR_HOP_PENALTY: defines the penalty which will be applied + * to an originator message's tq-field on every hop and/or per + * hard interface + */ + BATADV_ATTR_HOP_PENALTY, + + /** + * @BATADV_ATTR_LOG_LEVEL: bitmask with to define which debug messages + * should be send to the debug log/trace ring buffer + */ + BATADV_ATTR_LOG_LEVEL, + + /** + * @BATADV_ATTR_MULTICAST_FORCEFLOOD_ENABLED: whether multicast + * optimizations should be replaced by simple broadcast-like flooding + * of multicast packets. If set to non-zero then all nodes in the mesh + * are going to use classic flooding for any multicast packet with no + * optimizations. + */ + BATADV_ATTR_MULTICAST_FORCEFLOOD_ENABLED, + + /** + * @BATADV_ATTR_NETWORK_CODING_ENABLED: whether Network Coding (using + * some magic to send fewer wifi packets but still the same content) is + * enabled or not. + */ + BATADV_ATTR_NETWORK_CODING_ENABLED, + + /** + * @BATADV_ATTR_ORIG_INTERVAL: defines the interval in milliseconds in + * which batman sends its protocol messages. + */ + BATADV_ATTR_ORIG_INTERVAL, + + /** + * @BATADV_ATTR_ELP_INTERVAL: defines the interval in milliseconds in + * which batman emits probing packets for neighbor sensing (ELP). + */ + BATADV_ATTR_ELP_INTERVAL, + + /** + * @BATADV_ATTR_THROUGHPUT_OVERRIDE: defines the throughput value to be + * used by B.A.T.M.A.N. V when estimating the link throughput using + * this interface. If the value is set to 0 then batman-adv will try to + * estimate the throughput by itself. + */ + BATADV_ATTR_THROUGHPUT_OVERRIDE, + + /** + * @BATADV_ATTR_MULTICAST_FANOUT: defines the maximum number of packet + * copies that may be generated for a multicast-to-unicast conversion. + * Once this limit is exceeded distribution will fall back to broadcast. + */ + BATADV_ATTR_MULTICAST_FANOUT, + + /* add attributes above here, update the policy in netlink.c */ + + /** + * @__BATADV_ATTR_AFTER_LAST: internal use + */ + __BATADV_ATTR_AFTER_LAST, + + /** + * @NUM_BATADV_ATTR: total number of batadv_nl_attrs available + */ + NUM_BATADV_ATTR = __BATADV_ATTR_AFTER_LAST, + + /** + * @BATADV_ATTR_MAX: highest attribute number currently defined + */ + BATADV_ATTR_MAX = __BATADV_ATTR_AFTER_LAST - 1 }; /** * enum batadv_nl_commands - supported batman-adv netlink commands */ enum batadv_nl_commands { - /** - * @BATADV_CMD_UNSPEC: unspecified command to catch errors - */ - BATADV_CMD_UNSPEC, - - /** - * @BATADV_CMD_GET_MESH: Get attributes from softif/mesh - */ - BATADV_CMD_GET_MESH, - - /** - * @BATADV_CMD_GET_MESH_INFO: Alias for @BATADV_CMD_GET_MESH - */ - BATADV_CMD_GET_MESH_INFO = BATADV_CMD_GET_MESH, - - /** - * @BATADV_CMD_TP_METER: Start a tp meter session - */ - BATADV_CMD_TP_METER, - - /** - * @BATADV_CMD_TP_METER_CANCEL: Cancel a tp meter session - */ - BATADV_CMD_TP_METER_CANCEL, - - /** - * @BATADV_CMD_GET_ROUTING_ALGOS: Query the list of routing algorithms. - */ - BATADV_CMD_GET_ROUTING_ALGOS, - - /** - * @BATADV_CMD_GET_HARDIF: Get attributes from a hardif of the - * current softif - */ - BATADV_CMD_GET_HARDIF, - - /** - * @BATADV_CMD_GET_HARDIFS: Alias for @BATADV_CMD_GET_HARDIF - */ - BATADV_CMD_GET_HARDIFS = BATADV_CMD_GET_HARDIF, - - /** - * @BATADV_CMD_GET_TRANSTABLE_LOCAL: Query list of local translations - */ - BATADV_CMD_GET_TRANSTABLE_LOCAL, - - /** - * @BATADV_CMD_GET_TRANSTABLE_GLOBAL: Query list of global translations - */ - BATADV_CMD_GET_TRANSTABLE_GLOBAL, - - /** - * @BATADV_CMD_GET_ORIGINATORS: Query list of originators - */ - BATADV_CMD_GET_ORIGINATORS, - - /** - * @BATADV_CMD_GET_NEIGHBORS: Query list of neighbours - */ - BATADV_CMD_GET_NEIGHBORS, - - /** - * @BATADV_CMD_GET_GATEWAYS: Query list of gateways - */ - BATADV_CMD_GET_GATEWAYS, - - /** - * @BATADV_CMD_GET_BLA_CLAIM: Query list of bridge loop avoidance claims - */ - BATADV_CMD_GET_BLA_CLAIM, - - /** - * @BATADV_CMD_GET_BLA_BACKBONE: Query list of bridge loop avoidance - * backbones - */ - BATADV_CMD_GET_BLA_BACKBONE, - - /** - * @BATADV_CMD_GET_DAT_CACHE: Query list of DAT cache entries - */ - BATADV_CMD_GET_DAT_CACHE, - - /** - * @BATADV_CMD_GET_MCAST_FLAGS: Query list of multicast flags - */ - BATADV_CMD_GET_MCAST_FLAGS, - - /** - * @BATADV_CMD_SET_MESH: Set attributes for softif/mesh - */ - BATADV_CMD_SET_MESH, - - /** - * @BATADV_CMD_SET_HARDIF: Set attributes for hardif of the - * current softif - */ - BATADV_CMD_SET_HARDIF, - - /** - * @BATADV_CMD_GET_VLAN: Get attributes from a VLAN of the - * current softif - */ - BATADV_CMD_GET_VLAN, - - /** - * @BATADV_CMD_SET_VLAN: Set attributes for VLAN of the - * current softif - */ - BATADV_CMD_SET_VLAN, - - /* add new commands above here */ - - /** - * @__BATADV_CMD_AFTER_LAST: internal use - */ - __BATADV_CMD_AFTER_LAST, - - /** - * @BATADV_CMD_MAX: highest used command number - */ - BATADV_CMD_MAX = __BATADV_CMD_AFTER_LAST - 1 + /** + * @BATADV_CMD_UNSPEC: unspecified command to catch errors + */ + BATADV_CMD_UNSPEC, + + /** + * @BATADV_CMD_GET_MESH: Get attributes from softif/mesh + */ + BATADV_CMD_GET_MESH, + + /** + * @BATADV_CMD_GET_MESH_INFO: Alias for @BATADV_CMD_GET_MESH + */ + BATADV_CMD_GET_MESH_INFO = BATADV_CMD_GET_MESH, + + /** + * @BATADV_CMD_TP_METER: Start a tp meter session + */ + BATADV_CMD_TP_METER, + + /** + * @BATADV_CMD_TP_METER_CANCEL: Cancel a tp meter session + */ + BATADV_CMD_TP_METER_CANCEL, + + /** + * @BATADV_CMD_GET_ROUTING_ALGOS: Query the list of routing algorithms. + */ + BATADV_CMD_GET_ROUTING_ALGOS, + + /** + * @BATADV_CMD_GET_HARDIF: Get attributes from a hardif of the + * current softif + */ + BATADV_CMD_GET_HARDIF, + + /** + * @BATADV_CMD_GET_HARDIFS: Alias for @BATADV_CMD_GET_HARDIF + */ + BATADV_CMD_GET_HARDIFS = BATADV_CMD_GET_HARDIF, + + /** + * @BATADV_CMD_GET_TRANSTABLE_LOCAL: Query list of local translations + */ + BATADV_CMD_GET_TRANSTABLE_LOCAL, + + /** + * @BATADV_CMD_GET_TRANSTABLE_GLOBAL: Query list of global translations + */ + BATADV_CMD_GET_TRANSTABLE_GLOBAL, + + /** + * @BATADV_CMD_GET_ORIGINATORS: Query list of originators + */ + BATADV_CMD_GET_ORIGINATORS, + + /** + * @BATADV_CMD_GET_NEIGHBORS: Query list of neighbours + */ + BATADV_CMD_GET_NEIGHBORS, + + /** + * @BATADV_CMD_GET_GATEWAYS: Query list of gateways + */ + BATADV_CMD_GET_GATEWAYS, + + /** + * @BATADV_CMD_GET_BLA_CLAIM: Query list of bridge loop avoidance claims + */ + BATADV_CMD_GET_BLA_CLAIM, + + /** + * @BATADV_CMD_GET_BLA_BACKBONE: Query list of bridge loop avoidance + * backbones + */ + BATADV_CMD_GET_BLA_BACKBONE, + + /** + * @BATADV_CMD_GET_DAT_CACHE: Query list of DAT cache entries + */ + BATADV_CMD_GET_DAT_CACHE, + + /** + * @BATADV_CMD_GET_MCAST_FLAGS: Query list of multicast flags + */ + BATADV_CMD_GET_MCAST_FLAGS, + + /** + * @BATADV_CMD_SET_MESH: Set attributes for softif/mesh + */ + BATADV_CMD_SET_MESH, + + /** + * @BATADV_CMD_SET_HARDIF: Set attributes for hardif of the + * current softif + */ + BATADV_CMD_SET_HARDIF, + + /** + * @BATADV_CMD_GET_VLAN: Get attributes from a VLAN of the + * current softif + */ + BATADV_CMD_GET_VLAN, + + /** + * @BATADV_CMD_SET_VLAN: Set attributes for VLAN of the + * current softif + */ + BATADV_CMD_SET_VLAN, + + /* add new commands above here */ + + /** + * @__BATADV_CMD_AFTER_LAST: internal use + */ + __BATADV_CMD_AFTER_LAST, + + /** + * @BATADV_CMD_MAX: highest used command number + */ + BATADV_CMD_MAX = __BATADV_CMD_AFTER_LAST - 1 }; /** * enum batadv_tp_meter_reason - reason of a tp meter test run stop */ enum batadv_tp_meter_reason { - /** - * @BATADV_TP_REASON_COMPLETE: sender finished tp run - */ - BATADV_TP_REASON_COMPLETE = 3, - - /** - * @BATADV_TP_REASON_CANCEL: sender was stopped during run - */ - BATADV_TP_REASON_CANCEL = 4, - - /* error status >= 128 */ - - /** - * @BATADV_TP_REASON_DST_UNREACHABLE: receiver could not be reached or - * didn't answer - */ - BATADV_TP_REASON_DST_UNREACHABLE = 128, - - /** - * @BATADV_TP_REASON_RESEND_LIMIT: (unused) sender retry reached limit - */ - BATADV_TP_REASON_RESEND_LIMIT = 129, - - /** - * @BATADV_TP_REASON_ALREADY_ONGOING: test to or from the same node - * already ongoing - */ - BATADV_TP_REASON_ALREADY_ONGOING = 130, - - /** - * @BATADV_TP_REASON_MEMORY_ERROR: test was stopped due to low memory - */ - BATADV_TP_REASON_MEMORY_ERROR = 131, - - /** - * @BATADV_TP_REASON_CANT_SEND: failed to send via outgoing interface - */ - BATADV_TP_REASON_CANT_SEND = 132, - - /** - * @BATADV_TP_REASON_TOO_MANY: too many ongoing sessions - */ - BATADV_TP_REASON_TOO_MANY = 133, + /** + * @BATADV_TP_REASON_COMPLETE: sender finished tp run + */ + BATADV_TP_REASON_COMPLETE = 3, + + /** + * @BATADV_TP_REASON_CANCEL: sender was stopped during run + */ + BATADV_TP_REASON_CANCEL = 4, + + /* error status >= 128 */ + + /** + * @BATADV_TP_REASON_DST_UNREACHABLE: receiver could not be reached or + * didn't answer + */ + BATADV_TP_REASON_DST_UNREACHABLE = 128, + + /** + * @BATADV_TP_REASON_RESEND_LIMIT: (unused) sender retry reached limit + */ + BATADV_TP_REASON_RESEND_LIMIT = 129, + + /** + * @BATADV_TP_REASON_ALREADY_ONGOING: test to or from the same node + * already ongoing + */ + BATADV_TP_REASON_ALREADY_ONGOING = 130, + + /** + * @BATADV_TP_REASON_MEMORY_ERROR: test was stopped due to low memory + */ + BATADV_TP_REASON_MEMORY_ERROR = 131, + + /** + * @BATADV_TP_REASON_CANT_SEND: failed to send via outgoing interface + */ + BATADV_TP_REASON_CANT_SEND = 132, + + /** + * @BATADV_TP_REASON_TOO_MANY: too many ongoing sessions + */ + BATADV_TP_REASON_TOO_MANY = 133, }; /** * enum batadv_ifla_attrs - batman-adv ifla nested attributes */ enum batadv_ifla_attrs { - /** - * @IFLA_BATADV_UNSPEC: unspecified attribute which is not parsed by - * rtnetlink - */ - IFLA_BATADV_UNSPEC, - - /** - * @IFLA_BATADV_ALGO_NAME: routing algorithm (name) which should be - * used by the newly registered batadv net_device. - */ - IFLA_BATADV_ALGO_NAME, - - /* add attributes above here, update the policy in soft-interface.c */ - - /** - * @__IFLA_BATADV_MAX: internal use - */ - __IFLA_BATADV_MAX, + /** + * @IFLA_BATADV_UNSPEC: unspecified attribute which is not parsed by + * rtnetlink + */ + IFLA_BATADV_UNSPEC, + + /** + * @IFLA_BATADV_ALGO_NAME: routing algorithm (name) which should be + * used by the newly registered batadv net_device. + */ + IFLA_BATADV_ALGO_NAME, + + /* add attributes above here, update the policy in soft-interface.c */ + + /** + * @__IFLA_BATADV_MAX: internal use + */ + __IFLA_BATADV_MAX, }; #define IFLA_BATADV_MAX (__IFLA_BATADV_MAX - 1) diff --git a/src/basic/linux/btrfs.h b/src/basic/linux/btrfs.h index d22f1978ce..0f8306fdea 100644 --- a/src/basic/linux/btrfs.h +++ b/src/basic/linux/btrfs.h @@ -154,7 +154,7 @@ struct btrfs_scrub_progress { __u64 tree_bytes_scrubbed; /* # of tree bytes scrubbed */ __u64 read_errors; /* # of read errors encountered (EIO) */ __u64 csum_errors; /* # of failed csum checks */ - __u64 verify_errors; /* # of occurences, where the metadata + __u64 verify_errors; /* # of occurrences, where the metadata * of a tree block did not match the * expected values, like generation or * logical */ @@ -174,7 +174,7 @@ struct btrfs_scrub_progress { __u64 last_physical; /* last physical address scrubbed. In * case a scrub was aborted, this can * be used to restart the scrub */ - __u64 unverified_errors; /* # of occurences where a read for a + __u64 unverified_errors; /* # of occurrences where a read for a * full (64k) bio failed, but the re- * check succeeded for each 4k piece. * Intermittent error. */ @@ -307,6 +307,7 @@ struct btrfs_ioctl_fs_info_args { #define BTRFS_FEATURE_INCOMPAT_NO_HOLES (1ULL << 9) #define BTRFS_FEATURE_INCOMPAT_METADATA_UUID (1ULL << 10) #define BTRFS_FEATURE_INCOMPAT_RAID1C34 (1ULL << 11) +#define BTRFS_FEATURE_INCOMPAT_ZONED (1ULL << 12) struct btrfs_ioctl_feature_flags { __u64 compat_flags; diff --git a/src/basic/linux/btrfs_tree.h b/src/basic/linux/btrfs_tree.h index 6b885982ec..ccdb40fe40 100644 --- a/src/basic/linux/btrfs_tree.h +++ b/src/basic/linux/btrfs_tree.h @@ -59,7 +59,7 @@ /* for storing balance parameters in the root tree */ #define BTRFS_BALANCE_OBJECTID -4ULL -/* orhpan objectid for tracking unlinked/truncated files */ +/* orphan objectid for tracking unlinked/truncated files */ #define BTRFS_ORPHAN_OBJECTID -5ULL /* does write ahead logging to speed up fsyncs */ @@ -275,7 +275,7 @@ #define BTRFS_PERSISTENT_ITEM_KEY 249 /* - * Persistantly stores the device replace state in the device tree. + * Persistently stores the device replace state in the device tree. * The key is built like this: (0, BTRFS_DEV_REPLACE_KEY, 0). */ #define BTRFS_DEV_REPLACE_KEY 250 @@ -299,7 +299,8 @@ */ #define BTRFS_STRING_ITEM_KEY 253 - +/* Maximum metadata block size (nodesize) */ +#define BTRFS_MAX_METADATA_BLOCKSIZE 65536 /* 32 bytes in various csum fields */ #define BTRFS_CSUM_SIZE 32 diff --git a/src/basic/linux/can/netlink.h b/src/basic/linux/can/netlink.h index 6f598b7383..f730d443b9 100644 --- a/src/basic/linux/can/netlink.h +++ b/src/basic/linux/can/netlink.h @@ -100,6 +100,7 @@ struct can_ctrlmode { #define CAN_CTRLMODE_FD 0x20 /* CAN FD mode */ #define CAN_CTRLMODE_PRESUME_ACK 0x40 /* Ignore missing CAN ACKs */ #define CAN_CTRLMODE_FD_NON_ISO 0x80 /* CAN FD in non-ISO mode */ +#define CAN_CTRLMODE_CC_LEN8_DLC 0x100 /* Classic CAN DLC option */ /* * CAN device statistics diff --git a/src/basic/linux/if_bonding.h b/src/basic/linux/if_bonding.h index 45f3750aa8..d174914a83 100644 --- a/src/basic/linux/if_bonding.h +++ b/src/basic/linux/if_bonding.h @@ -94,6 +94,7 @@ #define BOND_XMIT_POLICY_LAYER23 2 /* layer 2+3 (IP ^ MAC) */ #define BOND_XMIT_POLICY_ENCAP23 3 /* encapsulated layer 2+3 */ #define BOND_XMIT_POLICY_ENCAP34 4 /* encapsulated layer 3+4 */ +#define BOND_XMIT_POLICY_VLAN_SRCMAC 5 /* vlan + source MAC */ /* 802.3ad port state definitions (43.4.2.2 in the 802.3ad standard) */ #define LACP_STATE_LACP_ACTIVITY 0x1 @@ -152,14 +153,3 @@ enum { #define BOND_3AD_STAT_MAX (__BOND_3AD_STAT_MAX - 1) #endif /* _LINUX_IF_BONDING_H */ - -/* - * Local variables: - * version-control: t - * kept-new-versions: 5 - * c-indent-level: 8 - * c-basic-offset: 8 - * tab-width: 8 - * End: - */ - diff --git a/src/basic/linux/if_bridge.h b/src/basic/linux/if_bridge.h index 4c687686aa..6b56a75495 100644 --- a/src/basic/linux/if_bridge.h +++ b/src/basic/linux/if_bridge.h @@ -121,6 +121,7 @@ enum { IFLA_BRIDGE_VLAN_INFO, IFLA_BRIDGE_VLAN_TUNNEL_INFO, IFLA_BRIDGE_MRP, + IFLA_BRIDGE_CFM, __IFLA_BRIDGE_MAX, }; #define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1) @@ -328,6 +329,130 @@ struct br_mrp_start_in_test { __u16 in_id; }; +enum { + IFLA_BRIDGE_CFM_UNSPEC, + IFLA_BRIDGE_CFM_MEP_CREATE, + IFLA_BRIDGE_CFM_MEP_DELETE, + IFLA_BRIDGE_CFM_MEP_CONFIG, + IFLA_BRIDGE_CFM_CC_CONFIG, + IFLA_BRIDGE_CFM_CC_PEER_MEP_ADD, + IFLA_BRIDGE_CFM_CC_PEER_MEP_REMOVE, + IFLA_BRIDGE_CFM_CC_RDI, + IFLA_BRIDGE_CFM_CC_CCM_TX, + IFLA_BRIDGE_CFM_MEP_CREATE_INFO, + IFLA_BRIDGE_CFM_MEP_CONFIG_INFO, + IFLA_BRIDGE_CFM_CC_CONFIG_INFO, + IFLA_BRIDGE_CFM_CC_RDI_INFO, + IFLA_BRIDGE_CFM_CC_CCM_TX_INFO, + IFLA_BRIDGE_CFM_CC_PEER_MEP_INFO, + IFLA_BRIDGE_CFM_MEP_STATUS_INFO, + IFLA_BRIDGE_CFM_CC_PEER_STATUS_INFO, + __IFLA_BRIDGE_CFM_MAX, +}; + +#define IFLA_BRIDGE_CFM_MAX (__IFLA_BRIDGE_CFM_MAX - 1) + +enum { + IFLA_BRIDGE_CFM_MEP_CREATE_UNSPEC, + IFLA_BRIDGE_CFM_MEP_CREATE_INSTANCE, + IFLA_BRIDGE_CFM_MEP_CREATE_DOMAIN, + IFLA_BRIDGE_CFM_MEP_CREATE_DIRECTION, + IFLA_BRIDGE_CFM_MEP_CREATE_IFINDEX, + __IFLA_BRIDGE_CFM_MEP_CREATE_MAX, +}; + +#define IFLA_BRIDGE_CFM_MEP_CREATE_MAX (__IFLA_BRIDGE_CFM_MEP_CREATE_MAX - 1) + +enum { + IFLA_BRIDGE_CFM_MEP_DELETE_UNSPEC, + IFLA_BRIDGE_CFM_MEP_DELETE_INSTANCE, + __IFLA_BRIDGE_CFM_MEP_DELETE_MAX, +}; + +#define IFLA_BRIDGE_CFM_MEP_DELETE_MAX (__IFLA_BRIDGE_CFM_MEP_DELETE_MAX - 1) + +enum { + IFLA_BRIDGE_CFM_MEP_CONFIG_UNSPEC, + IFLA_BRIDGE_CFM_MEP_CONFIG_INSTANCE, + IFLA_BRIDGE_CFM_MEP_CONFIG_UNICAST_MAC, + IFLA_BRIDGE_CFM_MEP_CONFIG_MDLEVEL, + IFLA_BRIDGE_CFM_MEP_CONFIG_MEPID, + __IFLA_BRIDGE_CFM_MEP_CONFIG_MAX, +}; + +#define IFLA_BRIDGE_CFM_MEP_CONFIG_MAX (__IFLA_BRIDGE_CFM_MEP_CONFIG_MAX - 1) + +enum { + IFLA_BRIDGE_CFM_CC_CONFIG_UNSPEC, + IFLA_BRIDGE_CFM_CC_CONFIG_INSTANCE, + IFLA_BRIDGE_CFM_CC_CONFIG_ENABLE, + IFLA_BRIDGE_CFM_CC_CONFIG_EXP_INTERVAL, + IFLA_BRIDGE_CFM_CC_CONFIG_EXP_MAID, + __IFLA_BRIDGE_CFM_CC_CONFIG_MAX, +}; + +#define IFLA_BRIDGE_CFM_CC_CONFIG_MAX (__IFLA_BRIDGE_CFM_CC_CONFIG_MAX - 1) + +enum { + IFLA_BRIDGE_CFM_CC_PEER_MEP_UNSPEC, + IFLA_BRIDGE_CFM_CC_PEER_MEP_INSTANCE, + IFLA_BRIDGE_CFM_CC_PEER_MEPID, + __IFLA_BRIDGE_CFM_CC_PEER_MEP_MAX, +}; + +#define IFLA_BRIDGE_CFM_CC_PEER_MEP_MAX (__IFLA_BRIDGE_CFM_CC_PEER_MEP_MAX - 1) + +enum { + IFLA_BRIDGE_CFM_CC_RDI_UNSPEC, + IFLA_BRIDGE_CFM_CC_RDI_INSTANCE, + IFLA_BRIDGE_CFM_CC_RDI_RDI, + __IFLA_BRIDGE_CFM_CC_RDI_MAX, +}; + +#define IFLA_BRIDGE_CFM_CC_RDI_MAX (__IFLA_BRIDGE_CFM_CC_RDI_MAX - 1) + +enum { + IFLA_BRIDGE_CFM_CC_CCM_TX_UNSPEC, + IFLA_BRIDGE_CFM_CC_CCM_TX_INSTANCE, + IFLA_BRIDGE_CFM_CC_CCM_TX_DMAC, + IFLA_BRIDGE_CFM_CC_CCM_TX_SEQ_NO_UPDATE, + IFLA_BRIDGE_CFM_CC_CCM_TX_PERIOD, + IFLA_BRIDGE_CFM_CC_CCM_TX_IF_TLV, + IFLA_BRIDGE_CFM_CC_CCM_TX_IF_TLV_VALUE, + IFLA_BRIDGE_CFM_CC_CCM_TX_PORT_TLV, + IFLA_BRIDGE_CFM_CC_CCM_TX_PORT_TLV_VALUE, + __IFLA_BRIDGE_CFM_CC_CCM_TX_MAX, +}; + +#define IFLA_BRIDGE_CFM_CC_CCM_TX_MAX (__IFLA_BRIDGE_CFM_CC_CCM_TX_MAX - 1) + +enum { + IFLA_BRIDGE_CFM_MEP_STATUS_UNSPEC, + IFLA_BRIDGE_CFM_MEP_STATUS_INSTANCE, + IFLA_BRIDGE_CFM_MEP_STATUS_OPCODE_UNEXP_SEEN, + IFLA_BRIDGE_CFM_MEP_STATUS_VERSION_UNEXP_SEEN, + IFLA_BRIDGE_CFM_MEP_STATUS_RX_LEVEL_LOW_SEEN, + __IFLA_BRIDGE_CFM_MEP_STATUS_MAX, +}; + +#define IFLA_BRIDGE_CFM_MEP_STATUS_MAX (__IFLA_BRIDGE_CFM_MEP_STATUS_MAX - 1) + +enum { + IFLA_BRIDGE_CFM_CC_PEER_STATUS_UNSPEC, + IFLA_BRIDGE_CFM_CC_PEER_STATUS_INSTANCE, + IFLA_BRIDGE_CFM_CC_PEER_STATUS_PEER_MEPID, + IFLA_BRIDGE_CFM_CC_PEER_STATUS_CCM_DEFECT, + IFLA_BRIDGE_CFM_CC_PEER_STATUS_RDI, + IFLA_BRIDGE_CFM_CC_PEER_STATUS_PORT_TLV_VALUE, + IFLA_BRIDGE_CFM_CC_PEER_STATUS_IF_TLV_VALUE, + IFLA_BRIDGE_CFM_CC_PEER_STATUS_SEEN, + IFLA_BRIDGE_CFM_CC_PEER_STATUS_TLV_SEEN, + IFLA_BRIDGE_CFM_CC_PEER_STATUS_SEQ_UNEXP_SEEN, + __IFLA_BRIDGE_CFM_CC_PEER_STATUS_MAX, +}; + +#define IFLA_BRIDGE_CFM_CC_PEER_STATUS_MAX (__IFLA_BRIDGE_CFM_CC_PEER_STATUS_MAX - 1) + struct bridge_stp_xstats { __u64 transition_blk; __u64 transition_fwd; @@ -502,6 +627,8 @@ enum { MDBA_ROUTER_PATTR_UNSPEC, MDBA_ROUTER_PATTR_TIMER, MDBA_ROUTER_PATTR_TYPE, + MDBA_ROUTER_PATTR_INET_TIMER, + MDBA_ROUTER_PATTR_INET6_TIMER, __MDBA_ROUTER_PATTR_MAX }; #define MDBA_ROUTER_PATTR_MAX (__MDBA_ROUTER_PATTR_MAX - 1) @@ -526,6 +653,7 @@ struct br_mdb_entry { union { __be32 ip4; struct in6_addr ip6; + unsigned char mac_addr[ETH_ALEN]; } u; __be16 proto; } addr; diff --git a/src/basic/linux/if_ether.h b/src/basic/linux/if_ether.h index d6de2b1674..a0b637911d 100644 --- a/src/basic/linux/if_ether.h +++ b/src/basic/linux/if_ether.h @@ -99,6 +99,7 @@ #define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */ #define ETH_P_NCSI 0x88F8 /* NCSI protocol */ #define ETH_P_PRP 0x88FB /* IEC 62439-3 PRP/HSRv0 */ +#define ETH_P_CFM 0x8902 /* Connectivity Fault Management */ #define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */ #define ETH_P_IBOE 0x8915 /* Infiniband over Ethernet */ #define ETH_P_TDLS 0x890D /* TDLS */ diff --git a/src/basic/linux/if_link.h b/src/basic/linux/if_link.h index 82708c6db4..4882e81514 100644 --- a/src/basic/linux/if_link.h +++ b/src/basic/linux/if_link.h @@ -341,6 +341,13 @@ enum { IFLA_ALT_IFNAME, /* Alternative ifname */ IFLA_PERM_ADDRESS, IFLA_PROTO_DOWN_REASON, + + /* device (sysfs) name as parent, used instead + * of IFLA_LINK where there's no parent netdev + */ + IFLA_PARENT_DEV_NAME, + IFLA_PARENT_DEV_BUS_NAME, + __IFLA_MAX }; @@ -525,6 +532,8 @@ enum { IFLA_BRPORT_BACKUP_PORT, IFLA_BRPORT_MRP_RING_OPEN, IFLA_BRPORT_MRP_IN_OPEN, + IFLA_BRPORT_MCAST_EHT_HOSTS_LIMIT, + IFLA_BRPORT_MCAST_EHT_HOSTS_CNT, __IFLA_BRPORT_MAX }; #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1) @@ -612,6 +621,7 @@ enum macvlan_macaddr_mode { }; #define MACVLAN_FLAG_NOPROMISC 1 +#define MACVLAN_FLAG_NODST 2 /* skip dst macvlan if matching src macvlan */ /* VRF section */ enum { @@ -1233,6 +1243,8 @@ enum { #define RMNET_FLAGS_INGRESS_MAP_COMMANDS (1U << 1) #define RMNET_FLAGS_INGRESS_MAP_CKSUMV4 (1U << 2) #define RMNET_FLAGS_EGRESS_MAP_CKSUMV4 (1U << 3) +#define RMNET_FLAGS_INGRESS_MAP_CKSUMV5 (1U << 4) +#define RMNET_FLAGS_EGRESS_MAP_CKSUMV5 (1U << 5) enum { IFLA_RMNET_UNSPEC, diff --git a/src/basic/linux/in.h b/src/basic/linux/in.h index 7d6687618d..d1b327036a 100644 --- a/src/basic/linux/in.h +++ b/src/basic/linux/in.h @@ -289,6 +289,9 @@ struct sockaddr_in { /* Address indicating an error return. */ #define INADDR_NONE ((unsigned long int) 0xffffffff) +/* Dummy address for src of ICMP replies if no real address is set (RFC7600). */ +#define INADDR_DUMMY ((unsigned long int) 0xc0000008) + /* Network number for local host loopback. */ #define IN_LOOPBACKNET 127 diff --git a/src/basic/linux/l2tp.h b/src/basic/linux/l2tp.h index 30c80d5ba4..bab8c97086 100644 --- a/src/basic/linux/l2tp.h +++ b/src/basic/linux/l2tp.h @@ -145,6 +145,7 @@ enum { L2TP_ATTR_RX_ERRORS, /* u64 */ L2TP_ATTR_STATS_PAD, L2TP_ATTR_RX_COOKIE_DISCARDS, /* u64 */ + L2TP_ATTR_RX_INVALID, /* u64 */ __L2TP_ATTR_STATS_MAX, }; diff --git a/src/basic/linux/netfilter/nf_tables.h b/src/basic/linux/netfilter/nf_tables.h index 4565456c0e..e94d1fa554 100644 --- a/src/basic/linux/netfilter/nf_tables.h +++ b/src/basic/linux/netfilter/nf_tables.h @@ -133,7 +133,7 @@ enum nf_tables_msg_types { * @NFTA_LIST_ELEM: list element (NLA_NESTED) */ enum nft_list_attributes { - NFTA_LIST_UNPEC, + NFTA_LIST_UNSPEC, NFTA_LIST_ELEM, __NFTA_LIST_MAX }; @@ -164,7 +164,10 @@ enum nft_hook_attributes { */ enum nft_table_flags { NFT_TABLE_F_DORMANT = 0x1, + NFT_TABLE_F_OWNER = 0x2, }; +#define NFT_TABLE_F_MASK (NFT_TABLE_F_DORMANT | \ + NFT_TABLE_F_OWNER) /** * enum nft_table_attributes - nf_tables table netlink attributes @@ -172,6 +175,8 @@ enum nft_table_flags { * @NFTA_TABLE_NAME: name of the table (NLA_STRING) * @NFTA_TABLE_FLAGS: bitmask of enum nft_table_flags (NLA_U32) * @NFTA_TABLE_USE: number of chains in this table (NLA_U32) + * @NFTA_TABLE_USERDATA: user data (NLA_BINARY) + * @NFTA_TABLE_OWNER: owner of this table through netlink portID (NLA_U32) */ enum nft_table_attributes { NFTA_TABLE_UNSPEC, @@ -180,10 +185,21 @@ enum nft_table_attributes { NFTA_TABLE_USE, NFTA_TABLE_HANDLE, NFTA_TABLE_PAD, + NFTA_TABLE_USERDATA, + NFTA_TABLE_OWNER, __NFTA_TABLE_MAX }; #define NFTA_TABLE_MAX (__NFTA_TABLE_MAX - 1) +enum nft_chain_flags { + NFT_CHAIN_BASE = (1 << 0), + NFT_CHAIN_HW_OFFLOAD = (1 << 1), + NFT_CHAIN_BINDING = (1 << 2), +}; +#define NFT_CHAIN_FLAGS (NFT_CHAIN_BASE | \ + NFT_CHAIN_HW_OFFLOAD | \ + NFT_CHAIN_BINDING) + /** * enum nft_chain_attributes - nf_tables chain netlink attributes * @@ -196,6 +212,8 @@ enum nft_table_attributes { * @NFTA_CHAIN_TYPE: type name of the string (NLA_NUL_STRING) * @NFTA_CHAIN_COUNTERS: counter specification of the chain (NLA_NESTED: nft_counter_attributes) * @NFTA_CHAIN_FLAGS: chain flags + * @NFTA_CHAIN_ID: uniquely identifies a chain in a transaction (NLA_U32) + * @NFTA_CHAIN_USERDATA: user data (NLA_BINARY) */ enum nft_chain_attributes { NFTA_CHAIN_UNSPEC, @@ -209,6 +227,8 @@ enum nft_chain_attributes { NFTA_CHAIN_COUNTERS, NFTA_CHAIN_PAD, NFTA_CHAIN_FLAGS, + NFTA_CHAIN_ID, + NFTA_CHAIN_USERDATA, __NFTA_CHAIN_MAX }; #define NFTA_CHAIN_MAX (__NFTA_CHAIN_MAX - 1) @@ -238,6 +258,7 @@ enum nft_rule_attributes { NFTA_RULE_PAD, NFTA_RULE_ID, NFTA_RULE_POSITION_ID, + NFTA_RULE_CHAIN_ID, __NFTA_RULE_MAX }; #define NFTA_RULE_MAX (__NFTA_RULE_MAX - 1) @@ -277,6 +298,7 @@ enum nft_rule_compat_attributes { * @NFT_SET_EVAL: set can be updated from the evaluation path * @NFT_SET_OBJECT: set contains stateful objects * @NFT_SET_CONCAT: set contains a concatenation + * @NFT_SET_EXPR: set contains expressions */ enum nft_set_flags { NFT_SET_ANONYMOUS = 0x1, @@ -287,6 +309,7 @@ enum nft_set_flags { NFT_SET_EVAL = 0x20, NFT_SET_OBJECT = 0x40, NFT_SET_CONCAT = 0x80, + NFT_SET_EXPR = 0x100, }; /** @@ -345,6 +368,7 @@ enum nft_set_field_attributes { * @NFTA_SET_OBJ_TYPE: stateful object type (NLA_U32: NFT_OBJECT_*) * @NFTA_SET_HANDLE: set handle (NLA_U64) * @NFTA_SET_EXPR: set expression (NLA_NESTED: nft_expr_attributes) + * @NFTA_SET_EXPRESSIONS: list of expressions (NLA_NESTED: nft_list_attributes) */ enum nft_set_attributes { NFTA_SET_UNSPEC, @@ -365,6 +389,7 @@ enum nft_set_attributes { NFTA_SET_OBJ_TYPE, NFTA_SET_HANDLE, NFTA_SET_EXPR, + NFTA_SET_EXPRESSIONS, __NFTA_SET_MAX }; #define NFTA_SET_MAX (__NFTA_SET_MAX - 1) @@ -373,9 +398,11 @@ enum nft_set_attributes { * enum nft_set_elem_flags - nf_tables set element flags * * @NFT_SET_ELEM_INTERVAL_END: element ends the previous interval + * @NFT_SET_ELEM_CATCHALL: special catch-all element */ enum nft_set_elem_flags { NFT_SET_ELEM_INTERVAL_END = 0x1, + NFT_SET_ELEM_CATCHALL = 0x2, }; /** @@ -390,6 +417,7 @@ enum nft_set_elem_flags { * @NFTA_SET_ELEM_EXPR: expression (NLA_NESTED: nft_expr_attributes) * @NFTA_SET_ELEM_OBJREF: stateful object reference (NLA_STRING) * @NFTA_SET_ELEM_KEY_END: closing key value (NLA_NESTED: nft_data) + * @NFTA_SET_ELEM_EXPRESSIONS: list of expressions (NLA_NESTED: nft_list_attributes) */ enum nft_set_elem_attributes { NFTA_SET_ELEM_UNSPEC, @@ -403,6 +431,7 @@ enum nft_set_elem_attributes { NFTA_SET_ELEM_PAD, NFTA_SET_ELEM_OBJREF, NFTA_SET_ELEM_KEY_END, + NFTA_SET_ELEM_EXPRESSIONS, __NFTA_SET_ELEM_MAX }; #define NFTA_SET_ELEM_MAX (__NFTA_SET_ELEM_MAX - 1) @@ -468,11 +497,13 @@ enum nft_data_attributes { * * @NFTA_VERDICT_CODE: nf_tables verdict (NLA_U32: enum nft_verdicts) * @NFTA_VERDICT_CHAIN: jump target chain name (NLA_STRING) + * @NFTA_VERDICT_CHAIN_ID: jump target chain ID (NLA_U32) */ enum nft_verdict_attributes { NFTA_VERDICT_UNSPEC, NFTA_VERDICT_CODE, NFTA_VERDICT_CHAIN, + NFTA_VERDICT_CHAIN_ID, __NFTA_VERDICT_MAX }; #define NFTA_VERDICT_MAX (__NFTA_VERDICT_MAX - 1) @@ -684,6 +715,7 @@ enum nft_dynset_ops { enum nft_dynset_flags { NFT_DYNSET_F_INV = (1 << 0), + NFT_DYNSET_F_EXPR = (1 << 1), }; /** @@ -697,6 +729,7 @@ enum nft_dynset_flags { * @NFTA_DYNSET_TIMEOUT: timeout value for the new element (NLA_U64) * @NFTA_DYNSET_EXPR: expression (NLA_NESTED: nft_expr_attributes) * @NFTA_DYNSET_FLAGS: flags (NLA_U32) + * @NFTA_DYNSET_EXPRESSIONS: list of expressions (NLA_NESTED: nft_list_attributes) */ enum nft_dynset_attributes { NFTA_DYNSET_UNSPEC, @@ -709,6 +742,7 @@ enum nft_dynset_attributes { NFTA_DYNSET_EXPR, NFTA_DYNSET_PAD, NFTA_DYNSET_FLAGS, + NFTA_DYNSET_EXPRESSIONS, __NFTA_DYNSET_MAX, }; #define NFTA_DYNSET_MAX (__NFTA_DYNSET_MAX - 1) @@ -731,10 +765,12 @@ enum nft_payload_bases { * * @NFT_PAYLOAD_CSUM_NONE: no checksumming * @NFT_PAYLOAD_CSUM_INET: internet checksum (RFC 791) + * @NFT_PAYLOAD_CSUM_SCTP: CRC-32c, for use in SCTP header (RFC 3309) */ enum nft_payload_csum_types { NFT_PAYLOAD_CSUM_NONE, NFT_PAYLOAD_CSUM_INET, + NFT_PAYLOAD_CSUM_SCTP, }; enum nft_payload_csum_flags { @@ -777,11 +813,13 @@ enum nft_exthdr_flags { * @NFT_EXTHDR_OP_IPV6: match against ipv6 extension headers * @NFT_EXTHDR_OP_TCP: match against tcp options * @NFT_EXTHDR_OP_IPV4: match against ipv4 options + * @NFT_EXTHDR_OP_SCTP: match against sctp chunks */ enum nft_exthdr_op { NFT_EXTHDR_OP_IPV6, NFT_EXTHDR_OP_TCPOPT, NFT_EXTHDR_OP_IPV4, + NFT_EXTHDR_OP_SCTP, __NFT_EXTHDR_OP_MAX }; #define NFT_EXTHDR_OP_MAX (__NFT_EXTHDR_OP_MAX - 1) @@ -980,11 +1018,13 @@ enum nft_rt_attributes { * * @NFTA_SOCKET_KEY: socket key to match * @NFTA_SOCKET_DREG: destination register + * @NFTA_SOCKET_LEVEL: cgroups2 ancestor level (only for cgroupsv2) */ enum nft_socket_attributes { NFTA_SOCKET_UNSPEC, NFTA_SOCKET_KEY, NFTA_SOCKET_DREG, + NFTA_SOCKET_LEVEL, __NFTA_SOCKET_MAX }; #define NFTA_SOCKET_MAX (__NFTA_SOCKET_MAX - 1) @@ -994,10 +1034,14 @@ enum nft_socket_attributes { * * @NFT_SOCKET_TRANSPARENT: Value of the IP(V6)_TRANSPARENT socket option * @NFT_SOCKET_MARK: Value of the socket mark + * @NFT_SOCKET_WILDCARD: Whether the socket is zero-bound (e.g. 0.0.0.0 or ::0) + * @NFT_SOCKET_CGROUPV2: Match on cgroups version 2 */ enum nft_socket_keys { NFT_SOCKET_TRANSPARENT, NFT_SOCKET_MARK, + NFT_SOCKET_WILDCARD, + NFT_SOCKET_CGROUPV2, __NFT_SOCKET_MAX }; #define NFT_SOCKET_MAX (__NFT_SOCKET_MAX - 1) @@ -1152,6 +1196,21 @@ enum nft_counter_attributes { #define NFTA_COUNTER_MAX (__NFTA_COUNTER_MAX - 1) /** + * enum nft_last_attributes - nf_tables last expression netlink attributes + * + * @NFTA_LAST_SET: last update has been set, zero means never updated (NLA_U32) + * @NFTA_LAST_MSECS: milliseconds since last update (NLA_U64) + */ +enum nft_last_attributes { + NFTA_LAST_UNSPEC, + NFTA_LAST_SET, + NFTA_LAST_MSECS, + NFTA_LAST_PAD, + __NFTA_LAST_MAX +}; +#define NFTA_LAST_MAX (__NFTA_LAST_MAX - 1) + +/** * enum nft_log_attributes - nf_tables log expression netlink attributes * * @NFTA_LOG_GROUP: netlink group to send messages to (NLA_U32) @@ -1541,6 +1600,7 @@ enum nft_ct_expectation_attributes { * @NFTA_OBJ_DATA: stateful object data (NLA_NESTED) * @NFTA_OBJ_USE: number of references to this expression (NLA_U32) * @NFTA_OBJ_HANDLE: object handle (NLA_U64) + * @NFTA_OBJ_USERDATA: user data (NLA_BINARY) */ enum nft_object_attributes { NFTA_OBJ_UNSPEC, @@ -1551,6 +1611,7 @@ enum nft_object_attributes { NFTA_OBJ_USE, NFTA_OBJ_HANDLE, NFTA_OBJ_PAD, + NFTA_OBJ_USERDATA, __NFTA_OBJ_MAX }; #define NFTA_OBJ_MAX (__NFTA_OBJ_MAX - 1) diff --git a/src/basic/linux/netfilter/nfnetlink.h b/src/basic/linux/netfilter/nfnetlink.h index a89f3a56a3..6cd58cd2a6 100644 --- a/src/basic/linux/netfilter/nfnetlink.h +++ b/src/basic/linux/netfilter/nfnetlink.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _NFNETLINK_H -#define _NFNETLINK_H +#ifndef _UAPI_NFNETLINK_H +#define _UAPI_NFNETLINK_H #include <linux/types.h> #include <linux/netfilter/nfnetlink_compat.h> @@ -60,7 +60,8 @@ struct nfgenmsg { #define NFNL_SUBSYS_CTHELPER 9 #define NFNL_SUBSYS_NFTABLES 10 #define NFNL_SUBSYS_NFT_COMPAT 11 -#define NFNL_SUBSYS_COUNT 12 +#define NFNL_SUBSYS_HOOK 12 +#define NFNL_SUBSYS_COUNT 13 /* Reserved control nfnetlink messages */ #define NFNL_MSG_BATCH_BEGIN NLMSG_MIN_TYPE @@ -78,4 +79,4 @@ enum nfnl_batch_attributes { }; #define NFNL_BATCH_MAX (__NFNL_BATCH_MAX - 1) -#endif /* _NFNETLINK_H */ +#endif /* _UAPI_NFNETLINK_H */ diff --git a/src/basic/linux/netlink.h b/src/basic/linux/netlink.h index c3816ff7bf..4c0cde075c 100644 --- a/src/basic/linux/netlink.h +++ b/src/basic/linux/netlink.h @@ -2,7 +2,7 @@ #ifndef _UAPI__LINUX_NETLINK_H #define _UAPI__LINUX_NETLINK_H -#include <linux/kernel.h> +#include <linux/const.h> #include <linux/socket.h> /* for __kernel_sa_family_t */ #include <linux/types.h> @@ -91,9 +91,10 @@ struct nlmsghdr { #define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr))) #define NLMSG_LENGTH(len) ((len) + NLMSG_HDRLEN) #define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len)) -#define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0))) +#define NLMSG_DATA(nlh) ((void *)(((char *)nlh) + NLMSG_HDRLEN)) #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \ - (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len))) + (struct nlmsghdr *)(((char *)(nlh)) + \ + NLMSG_ALIGN((nlh)->nlmsg_len))) #define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \ (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \ (nlh)->nlmsg_len <= (len)) diff --git a/src/basic/linux/nexthop.h b/src/basic/linux/nexthop.h index 2d4a1e784c..d8ffa8c9ca 100644 --- a/src/basic/linux/nexthop.h +++ b/src/basic/linux/nexthop.h @@ -21,7 +21,10 @@ struct nexthop_grp { }; enum { - NEXTHOP_GRP_TYPE_MPATH, /* default type if not specified */ + NEXTHOP_GRP_TYPE_MPATH, /* hash-threshold nexthop group + * default type if not specified + */ + NEXTHOP_GRP_TYPE_RES, /* resilient nexthop group */ __NEXTHOP_GRP_TYPE_MAX, }; @@ -52,8 +55,50 @@ enum { NHA_FDB, /* flag; nexthop belongs to a bridge fdb */ /* if NHA_FDB is added, OIF, BLACKHOLE, ENCAP cannot be set */ + /* nested; resilient nexthop group attributes */ + NHA_RES_GROUP, + /* nested; nexthop bucket attributes */ + NHA_RES_BUCKET, + __NHA_MAX, }; #define NHA_MAX (__NHA_MAX - 1) + +enum { + NHA_RES_GROUP_UNSPEC, + /* Pad attribute for 64-bit alignment. */ + NHA_RES_GROUP_PAD = NHA_RES_GROUP_UNSPEC, + + /* u16; number of nexthop buckets in a resilient nexthop group */ + NHA_RES_GROUP_BUCKETS, + /* clock_t as u32; nexthop bucket idle timer (per-group) */ + NHA_RES_GROUP_IDLE_TIMER, + /* clock_t as u32; nexthop unbalanced timer */ + NHA_RES_GROUP_UNBALANCED_TIMER, + /* clock_t as u64; nexthop unbalanced time */ + NHA_RES_GROUP_UNBALANCED_TIME, + + __NHA_RES_GROUP_MAX, +}; + +#define NHA_RES_GROUP_MAX (__NHA_RES_GROUP_MAX - 1) + +enum { + NHA_RES_BUCKET_UNSPEC, + /* Pad attribute for 64-bit alignment. */ + NHA_RES_BUCKET_PAD = NHA_RES_BUCKET_UNSPEC, + + /* u16; nexthop bucket index */ + NHA_RES_BUCKET_INDEX, + /* clock_t as u64; nexthop bucket idle time */ + NHA_RES_BUCKET_IDLE_TIME, + /* u32; nexthop id assigned to the nexthop bucket */ + NHA_RES_BUCKET_NH_ID, + + __NHA_RES_BUCKET_MAX, +}; + +#define NHA_RES_BUCKET_MAX (__NHA_RES_BUCKET_MAX - 1) + #endif diff --git a/src/basic/linux/nl80211.h b/src/basic/linux/nl80211.h index 47700a2b9a..db474994fa 100644 --- a/src/basic/linux/nl80211.h +++ b/src/basic/linux/nl80211.h @@ -11,7 +11,7 @@ * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com> * Copyright 2008 Colin McCabe <colin@cozybit.com> * Copyright 2015-2017 Intel Deutschland GmbH - * Copyright (C) 2018-2020 Intel Corporation + * Copyright (C) 2018-2021 Intel Corporation * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -655,6 +655,9 @@ * When a security association was established on an 802.1X network using * fast transition, this event should be followed by an * %NL80211_CMD_PORT_AUTHORIZED event. + * Following a %NL80211_CMD_ROAM event userspace can issue + * %NL80211_CMD_GET_SCAN in order to obtain the scan information for the + * new BSS the card/driver roamed to. * @NL80211_CMD_DISCONNECT: drop a given connection; also used to notify * userspace that a connection was dropped by the AP or due to other * reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and @@ -757,7 +760,8 @@ * of any other interfaces, and other interfaces will again take * precedence when they are used. * - * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface. + * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface + * (no longer supported). * * @NL80211_CMD_SET_MULTICAST_TO_UNICAST: Configure if this AP should perform * multicast to unicast conversion. When enabled, all multicast packets @@ -1177,6 +1181,10 @@ * includes the contents of the frame. %NL80211_ATTR_ACK flag is included * if the recipient acknowledged the frame. * + * @NL80211_CMD_SET_SAR_SPECS: SAR power limitation configuration is + * passed using %NL80211_ATTR_SAR_SPEC. %NL80211_ATTR_WIPHY is used to + * specify the wiphy index to be applied to. + * * @NL80211_CMD_MAX: highest used command number * @__NL80211_CMD_AFTER_LAST: internal use */ @@ -1407,6 +1415,8 @@ enum nl80211_commands { NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS, + NL80211_CMD_SET_SAR_SPECS, + /* add new commands above here */ /* used to define NL80211_CMD_MAX below */ @@ -1750,8 +1760,9 @@ enum nl80211_commands { * specify just a single bitrate, which is to be used for the beacon. * The driver must also specify support for this with the extended * features NL80211_EXT_FEATURE_BEACON_RATE_LEGACY, - * NL80211_EXT_FEATURE_BEACON_RATE_HT and - * NL80211_EXT_FEATURE_BEACON_RATE_VHT. + * NL80211_EXT_FEATURE_BEACON_RATE_HT, + * NL80211_EXT_FEATURE_BEACON_RATE_VHT and + * NL80211_EXT_FEATURE_BEACON_RATE_HE. * * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain * at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME. @@ -1955,8 +1966,15 @@ enum nl80211_commands { * @NL80211_ATTR_PROBE_RESP: Probe Response template data. Contains the entire * probe-response frame. The DA field in the 802.11 header is zero-ed out, * to be filled by the FW. - * @NL80211_ATTR_DISABLE_HT: Force HT capable interfaces to disable - * this feature. Currently, only supported in mac80211 drivers. + * @NL80211_ATTR_DISABLE_HT: Force HT capable interfaces to disable + * this feature during association. This is a flag attribute. + * Currently only supported in mac80211 drivers. + * @NL80211_ATTR_DISABLE_VHT: Force VHT capable interfaces to disable + * this feature during association. This is a flag attribute. + * Currently only supported in mac80211 drivers. + * @NL80211_ATTR_DISABLE_HE: Force HE capable interfaces to disable + * this feature during association. This is a flag attribute. + * Currently only supported in mac80211 drivers. * @NL80211_ATTR_HT_CAPABILITY_MASK: Specify which bits of the * ATTR_HT_CAPABILITY to which attention should be paid. * Currently, only mac80211 NICs support this feature. @@ -2077,7 +2095,8 @@ enum nl80211_commands { * until the channel switch event. * @NL80211_ATTR_CH_SWITCH_BLOCK_TX: flag attribute specifying that transmission * must be blocked on the current channel (before the channel switch - * operation). + * operation). Also included in the channel switch started event if quiet + * was requested by the AP. * @NL80211_ATTR_CSA_IES: Nested set of attributes containing the IE information * for the time while performing a channel switch. * @NL80211_ATTR_CNTDWN_OFFS_BEACON: An array of offsets (u16) to the channel @@ -2527,6 +2546,20 @@ enum nl80211_commands { * override mask. Used with NL80211_ATTR_S1G_CAPABILITY in * NL80211_CMD_ASSOCIATE or NL80211_CMD_CONNECT. * + * @NL80211_ATTR_SAE_PWE: Indicates the mechanism(s) allowed for SAE PWE + * derivation in WPA3-Personal networks which are using SAE authentication. + * This is a u8 attribute that encapsulates one of the values from + * &enum nl80211_sae_pwe_mechanism. + * + * @NL80211_ATTR_SAR_SPEC: SAR power limitation specification when + * used with %NL80211_CMD_SET_SAR_SPECS. The message contains fields + * of %nl80211_sar_attrs which specifies the sar type and related + * sar specs. Sar specs contains array of %nl80211_sar_specs_attrs. + * + * @NL80211_ATTR_RECONNECT_REQUESTED: flag attribute, used with deauth and + * disassoc events to indicate that an immediate reconnect to the AP + * is desired. + * * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use @@ -3016,6 +3049,14 @@ enum nl80211_attrs { NL80211_ATTR_S1G_CAPABILITY, NL80211_ATTR_S1G_CAPABILITY_MASK, + NL80211_ATTR_SAE_PWE, + + NL80211_ATTR_RECONNECT_REQUESTED, + + NL80211_ATTR_SAR_SPEC, + + NL80211_ATTR_DISABLE_HE, + /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, @@ -3613,6 +3654,8 @@ enum nl80211_mpath_info { * defined * @NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA: HE 6GHz band capabilities (__le16), * given for all 6 GHz band channels + * @NL80211_BAND_IFTYPE_ATTR_VENDOR_ELEMS: vendor element capabilities that are + * advertised on this band/for this iftype (binary) * @__NL80211_BAND_IFTYPE_ATTR_AFTER_LAST: internal use */ enum nl80211_band_iftype_attr { @@ -3624,6 +3667,7 @@ enum nl80211_band_iftype_attr { NL80211_BAND_IFTYPE_ATTR_HE_CAP_MCS_SET, NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE, NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA, + NL80211_BAND_IFTYPE_ATTR_VENDOR_ELEMS, /* keep last */ __NL80211_BAND_IFTYPE_ATTR_AFTER_LAST, @@ -5896,6 +5940,19 @@ enum nl80211_feature_flags { * @NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP: Driver/device supports * unsolicited broadcast probe response transmission * + * @NL80211_EXT_FEATURE_BEACON_RATE_HE: Driver supports beacon rate + * configuration (AP/mesh) with HE rates. + * + * @NL80211_EXT_FEATURE_SECURE_LTF: Device supports secure LTF measurement + * exchange protocol. + * + * @NL80211_EXT_FEATURE_SECURE_RTT: Device supports secure RTT measurement + * exchange protocol. + * + * @NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE: Device supports management + * frame protection for all management frames exchanged during the + * negotiation and range measurement procedure. + * * @NUM_NL80211_EXT_FEATURES: number of extended features. * @MAX_NL80211_EXT_FEATURES: highest extended feature index. */ @@ -5956,6 +6013,10 @@ enum nl80211_ext_feature_index { NL80211_EXT_FEATURE_SAE_OFFLOAD_AP, NL80211_EXT_FEATURE_FILS_DISCOVERY, NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP, + NL80211_EXT_FEATURE_BEACON_RATE_HE, + NL80211_EXT_FEATURE_SECURE_LTF, + NL80211_EXT_FEATURE_SECURE_RTT, + NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE, /* add new features before the definition below */ NUM_NL80211_EXT_FEATURES, @@ -6253,11 +6314,13 @@ struct nl80211_vendor_cmd_info { * @NL80211_TDLS_PEER_HT: TDLS peer is HT capable. * @NL80211_TDLS_PEER_VHT: TDLS peer is VHT capable. * @NL80211_TDLS_PEER_WMM: TDLS peer is WMM capable. + * @NL80211_TDLS_PEER_HE: TDLS peer is HE capable. */ enum nl80211_tdls_peer_capability { NL80211_TDLS_PEER_HT = 1<<0, NL80211_TDLS_PEER_VHT = 1<<1, NL80211_TDLS_PEER_WMM = 1<<2, + NL80211_TDLS_PEER_HE = 1<<3, }; /** @@ -6849,6 +6912,12 @@ enum nl80211_peer_measurement_ftm_capa { * if neither %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED nor * %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set, EDCA based * ranging will be used. + * @NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK: negotiate for LMR feedback. Only + * valid if either %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED or + * %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set. + * @NL80211_PMSR_FTM_REQ_ATTR_BSS_COLOR: optional. The BSS color of the + * responder. Only valid if %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED + * or %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED is set. * * @NUM_NL80211_PMSR_FTM_REQ_ATTR: internal * @NL80211_PMSR_FTM_REQ_ATTR_MAX: highest attribute number @@ -6867,6 +6936,8 @@ enum nl80211_peer_measurement_ftm_req { NL80211_PMSR_FTM_REQ_ATTR_REQUEST_CIVICLOC, NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED, NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED, + NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK, + NL80211_PMSR_FTM_REQ_ATTR_BSS_COLOR, /* keep last */ NUM_NL80211_PMSR_FTM_REQ_ATTR, @@ -7124,4 +7195,115 @@ enum nl80211_unsol_bcast_probe_resp_attributes { NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_MAX = __NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_LAST - 1 }; + +/** + * enum nl80211_sae_pwe_mechanism - The mechanism(s) allowed for SAE PWE + * derivation. Applicable only when WPA3-Personal SAE authentication is + * used. + * + * @NL80211_SAE_PWE_UNSPECIFIED: not specified, used internally to indicate that + * attribute is not present from userspace. + * @NL80211_SAE_PWE_HUNT_AND_PECK: hunting-and-pecking loop only + * @NL80211_SAE_PWE_HASH_TO_ELEMENT: hash-to-element only + * @NL80211_SAE_PWE_BOTH: both hunting-and-pecking loop and hash-to-element + * can be used. + */ +enum nl80211_sae_pwe_mechanism { + NL80211_SAE_PWE_UNSPECIFIED, + NL80211_SAE_PWE_HUNT_AND_PECK, + NL80211_SAE_PWE_HASH_TO_ELEMENT, + NL80211_SAE_PWE_BOTH, +}; + +/** + * enum nl80211_sar_type - type of SAR specs + * + * @NL80211_SAR_TYPE_POWER: power limitation specified in 0.25dBm unit + * + */ +enum nl80211_sar_type { + NL80211_SAR_TYPE_POWER, + + /* add new type here */ + + /* Keep last */ + NUM_NL80211_SAR_TYPE, +}; + +/** + * enum nl80211_sar_attrs - Attributes for SAR spec + * + * @NL80211_SAR_ATTR_TYPE: the SAR type as defined in &enum nl80211_sar_type. + * + * @NL80211_SAR_ATTR_SPECS: Nested array of SAR power + * limit specifications. Each specification contains a set + * of %nl80211_sar_specs_attrs. + * + * For SET operation, it contains array of %NL80211_SAR_ATTR_SPECS_POWER + * and %NL80211_SAR_ATTR_SPECS_RANGE_INDEX. + * + * For sar_capa dump, it contains array of + * %NL80211_SAR_ATTR_SPECS_START_FREQ + * and %NL80211_SAR_ATTR_SPECS_END_FREQ. + * + * @__NL80211_SAR_ATTR_LAST: Internal + * @NL80211_SAR_ATTR_MAX: highest sar attribute + * + * These attributes are used with %NL80211_CMD_SET_SAR_SPEC + */ +enum nl80211_sar_attrs { + __NL80211_SAR_ATTR_INVALID, + + NL80211_SAR_ATTR_TYPE, + NL80211_SAR_ATTR_SPECS, + + __NL80211_SAR_ATTR_LAST, + NL80211_SAR_ATTR_MAX = __NL80211_SAR_ATTR_LAST - 1, +}; + +/** + * enum nl80211_sar_specs_attrs - Attributes for SAR power limit specs + * + * @NL80211_SAR_ATTR_SPECS_POWER: Required (s32)value to specify the actual + * power limit value in units of 0.25 dBm if type is + * NL80211_SAR_TYPE_POWER. (i.e., a value of 44 represents 11 dBm). + * 0 means userspace doesn't have SAR limitation on this associated range. + * + * @NL80211_SAR_ATTR_SPECS_RANGE_INDEX: Required (u32) value to specify the + * index of exported freq range table and the associated power limitation + * is applied to this range. + * + * Userspace isn't required to set all the ranges advertised by WLAN driver, + * and userspace can skip some certain ranges. These skipped ranges don't + * have SAR limitations, and they are same as setting the + * %NL80211_SAR_ATTR_SPECS_POWER to any unreasonable high value because any + * value higher than regulatory allowed value just means SAR power + * limitation is removed, but it's required to set at least one range. + * It's not allowed to set duplicated range in one SET operation. + * + * Every SET operation overwrites previous SET operation. + * + * @NL80211_SAR_ATTR_SPECS_START_FREQ: Required (u32) value to specify the start + * frequency of this range edge when registering SAR capability to wiphy. + * It's not a channel center frequency. The unit is kHz. + * + * @NL80211_SAR_ATTR_SPECS_END_FREQ: Required (u32) value to specify the end + * frequency of this range edge when registering SAR capability to wiphy. + * It's not a channel center frequency. The unit is kHz. + * + * @__NL80211_SAR_ATTR_SPECS_LAST: Internal + * @NL80211_SAR_ATTR_SPECS_MAX: highest sar specs attribute + */ +enum nl80211_sar_specs_attrs { + __NL80211_SAR_ATTR_SPECS_INVALID, + + NL80211_SAR_ATTR_SPECS_POWER, + NL80211_SAR_ATTR_SPECS_RANGE_INDEX, + NL80211_SAR_ATTR_SPECS_START_FREQ, + NL80211_SAR_ATTR_SPECS_END_FREQ, + + __NL80211_SAR_ATTR_SPECS_LAST, + NL80211_SAR_ATTR_SPECS_MAX = __NL80211_SAR_ATTR_SPECS_LAST - 1, +}; + #endif /* __LINUX_NL80211_H */ diff --git a/src/basic/linux/pkt_sched.h b/src/basic/linux/pkt_sched.h index 9e7c2c6078..79a699f106 100644 --- a/src/basic/linux/pkt_sched.h +++ b/src/basic/linux/pkt_sched.h @@ -434,6 +434,7 @@ enum { TCA_HTB_RATE64, TCA_HTB_CEIL64, TCA_HTB_PAD, + TCA_HTB_OFFLOAD, __TCA_HTB_MAX, }; diff --git a/src/basic/linux/rtnetlink.h b/src/basic/linux/rtnetlink.h index 9b814c92de..5888492a52 100644 --- a/src/basic/linux/rtnetlink.h +++ b/src/basic/linux/rtnetlink.h @@ -178,6 +178,13 @@ enum { RTM_GETVLAN, #define RTM_GETVLAN RTM_GETVLAN + RTM_NEWNEXTHOPBUCKET = 116, +#define RTM_NEWNEXTHOPBUCKET RTM_NEWNEXTHOPBUCKET + RTM_DELNEXTHOPBUCKET, +#define RTM_DELNEXTHOPBUCKET RTM_DELNEXTHOPBUCKET + RTM_GETNEXTHOPBUCKET, +#define RTM_GETNEXTHOPBUCKET RTM_GETNEXTHOPBUCKET + __RTM_MAX, #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) }; @@ -283,6 +290,7 @@ enum { #define RTPROT_MROUTED 17 /* Multicast daemon */ #define RTPROT_KEEPALIVED 18 /* Keepalived daemon */ #define RTPROT_BABEL 42 /* Babel daemon */ +#define RTPROT_OPENR 99 /* Open Routing (Open/R) Routes */ #define RTPROT_BGP 186 /* BGP Routes */ #define RTPROT_ISIS 187 /* ISIS Routes */ #define RTPROT_OSPF 188 /* OSPF Routes */ @@ -319,6 +327,11 @@ enum rt_scope_t { #define RTM_F_FIB_MATCH 0x2000 /* return full fib lookup match */ #define RTM_F_OFFLOAD 0x4000 /* route is offloaded */ #define RTM_F_TRAP 0x8000 /* route is trapping packets */ +#define RTM_F_OFFLOAD_FAILED 0x20000000 /* route offload failed, this value + * is chosen to avoid conflicts with + * other flags defined in + * include/uapi/linux/ipv6_route.h + */ /* Reserved table identifiers */ @@ -396,11 +409,13 @@ struct rtnexthop { #define RTNH_F_DEAD 1 /* Nexthop is dead (used by multipath) */ #define RTNH_F_PERVASIVE 2 /* Do recursive gateway lookup */ #define RTNH_F_ONLINK 4 /* Gateway is forced on link */ -#define RTNH_F_OFFLOAD 8 /* offloaded route */ +#define RTNH_F_OFFLOAD 8 /* Nexthop is offloaded */ #define RTNH_F_LINKDOWN 16 /* carrier-down on nexthop */ #define RTNH_F_UNRESOLVED 32 /* The entry is unresolved (ipmr) */ +#define RTNH_F_TRAP 64 /* Nexthop is trapping packets */ -#define RTNH_COMPARE_MASK (RTNH_F_DEAD | RTNH_F_LINKDOWN | RTNH_F_OFFLOAD) +#define RTNH_COMPARE_MASK (RTNH_F_DEAD | RTNH_F_LINKDOWN | \ + RTNH_F_OFFLOAD | RTNH_F_TRAP) /* Macros to handle hexthops */ @@ -766,12 +781,18 @@ enum { #define TA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcamsg)) /* tcamsg flags stored in attribute TCA_ROOT_FLAGS * - * TCA_FLAG_LARGE_DUMP_ON user->kernel to request for larger than TCA_ACT_MAX_PRIO - * actions in a dump. All dump responses will contain the number of actions - * being dumped stored in for user app's consumption in TCA_ROOT_COUNT + * TCA_ACT_FLAG_LARGE_DUMP_ON user->kernel to request for larger than + * TCA_ACT_MAX_PRIO actions in a dump. All dump responses will contain the + * number of actions being dumped stored in for user app's consumption in + * TCA_ROOT_COUNT + * + * TCA_ACT_FLAG_TERSE_DUMP user->kernel to request terse (brief) dump that only + * includes essential action info (kind, index, etc.) * */ #define TCA_FLAG_LARGE_DUMP_ON (1 << 0) +#define TCA_ACT_FLAG_LARGE_DUMP_ON TCA_FLAG_LARGE_DUMP_ON +#define TCA_ACT_FLAG_TERSE_DUMP (1 << 1) /* New extended info filters for IFLA_EXT_MASK */ #define RTEXT_FILTER_VF (1 << 0) @@ -779,6 +800,8 @@ enum { #define RTEXT_FILTER_BRVLAN_COMPRESSED (1 << 2) #define RTEXT_FILTER_SKIP_STATS (1 << 3) #define RTEXT_FILTER_MRP (1 << 4) +#define RTEXT_FILTER_CFM_CONFIG (1 << 5) +#define RTEXT_FILTER_CFM_STATUS (1 << 6) /* End of information exported to user level */ diff --git a/src/network/networkd-can.c b/src/network/networkd-can.c index 950b4134dd..7a0a6e5522 100644 --- a/src/network/networkd-can.c +++ b/src/network/networkd-can.c @@ -10,50 +10,9 @@ #include "parse-util.h" #include "string-util.h" -#define CAN_TERMINATION_OHM_VALUE 120 - -int config_parse_can_bitrate( - const char* unit, - const char *filename, - unsigned line, - const char *section, - unsigned section_line, - const char *lvalue, - int ltype, - const char *rvalue, - void *data, - void *userdata) { - - uint32_t *br = data; - uint64_t sz; - int r; - - assert(filename); - assert(lvalue); - assert(rvalue); - assert(data); - - r = parse_size(rvalue, 1000, &sz); - if (r < 0) { - log_syntax(unit, LOG_WARNING, filename, line, r, - "Failed to parse can bitrate '%s', ignoring: %m", rvalue); - return 0; - } - - /* Linux uses __u32 for bitrates, so the value should not exceed that. */ - if (sz <= 0 || sz > UINT32_MAX) { - log_syntax(unit, LOG_WARNING, filename, line, 0, - "Bit rate out of permitted range 1...4294967295"); - return 0; - } - - *br = (uint32_t) sz; - - return 0; -} +#define CAN_TERMINATION_DEFAULT_OHM_VALUE 120 int can_set_netlink_message(Link *link, sd_netlink_message *m) { - struct can_ctrlmode cm = {}; int r; assert(link); @@ -72,10 +31,11 @@ int can_set_netlink_message(Link *link, sd_netlink_message *m) { if (r < 0) return log_link_debug_errno(link, r, "Could not open IFLA_INFO_DATA container: %m"); - if (link->network->can_bitrate > 0 || link->network->can_sample_point > 0) { + if (link->network->can_bitrate > 0) { struct can_bittiming bt = { .bitrate = link->network->can_bitrate, .sample_point = link->network->can_sample_point, + .sjw = link->network->can_sync_jump_width, }; log_link_debug(link, "Setting bitrate = %d bit/s", bt.bitrate); @@ -87,12 +47,26 @@ int can_set_netlink_message(Link *link, sd_netlink_message *m) { r = sd_netlink_message_append_data(m, IFLA_CAN_BITTIMING, &bt, sizeof(bt)); if (r < 0) return log_link_debug_errno(link, r, "Could not append IFLA_CAN_BITTIMING attribute: %m"); + } else if (link->network->can_time_quanta_ns > 0) { + struct can_bittiming bt = { + .tq = link->network->can_time_quanta_ns, + .prop_seg = link->network->can_propagation_segment, + .phase_seg1 = link->network->can_phase_buffer_segment_1, + .phase_seg2 = link->network->can_phase_buffer_segment_2, + .sjw = link->network->can_sync_jump_width, + }; + + log_link_debug(link, "Setting time quanta = %"PRIu32" nsec", bt.tq); + r = sd_netlink_message_append_data(m, IFLA_CAN_BITTIMING, &bt, sizeof(bt)); + if (r < 0) + return log_link_debug_errno(link, r, "Could not append IFLA_CAN_BITTIMING attribute: %m"); } - if (link->network->can_data_bitrate > 0 || link->network->can_data_sample_point > 0) { + if (link->network->can_data_bitrate > 0) { struct can_bittiming bt = { .bitrate = link->network->can_data_bitrate, .sample_point = link->network->can_data_sample_point, + .sjw = link->network->can_data_sync_jump_width, }; log_link_debug(link, "Setting data bitrate = %d bit/s", bt.bitrate); @@ -104,6 +78,19 @@ int can_set_netlink_message(Link *link, sd_netlink_message *m) { r = sd_netlink_message_append_data(m, IFLA_CAN_DATA_BITTIMING, &bt, sizeof(bt)); if (r < 0) return log_link_debug_errno(link, r, "Could not append IFLA_CAN_DATA_BITTIMING attribute: %m"); + } else if (link->network->can_data_time_quanta_ns > 0) { + struct can_bittiming bt = { + .tq = link->network->can_data_time_quanta_ns, + .prop_seg = link->network->can_data_propagation_segment, + .phase_seg1 = link->network->can_data_phase_buffer_segment_1, + .phase_seg2 = link->network->can_data_phase_buffer_segment_2, + .sjw = link->network->can_data_sync_jump_width, + }; + + log_link_debug(link, "Setting data time quanta = %"PRIu32" nsec", bt.tq); + r = sd_netlink_message_append_data(m, IFLA_CAN_DATA_BITTIMING, &bt, sizeof(bt)); + if (r < 0) + return log_link_debug_errno(link, r, "Could not append IFLA_CAN_DATA_BITTIMING attribute: %m"); } if (link->network->can_restart_us > 0) { @@ -114,58 +101,27 @@ int can_set_netlink_message(Link *link, sd_netlink_message *m) { else restart_ms = DIV_ROUND_UP(link->network->can_restart_us, USEC_PER_MSEC); - if (restart_ms > UINT32_MAX) - return log_link_debug_errno(link, SYNTHETIC_ERRNO(ERANGE), "restart timeout (%s) too big.", - FORMAT_TIMESPAN(restart_ms * 1000, MSEC_PER_SEC)); - log_link_debug(link, "Setting restart = %s", FORMAT_TIMESPAN(restart_ms * 1000, MSEC_PER_SEC)); - r = sd_netlink_message_append_u32(m, IFLA_CAN_RESTART_MS, restart_ms); if (r < 0) return log_link_debug_errno(link, r, "Could not append IFLA_CAN_RESTART_MS attribute: %m"); } - if (link->network->can_fd_mode >= 0) { - cm.mask |= CAN_CTRLMODE_FD; - SET_FLAG(cm.flags, CAN_CTRLMODE_FD, link->network->can_fd_mode); - log_link_debug(link, "Setting FD mode to '%s'.", yes_no(link->network->can_fd_mode)); - } - - if (link->network->can_non_iso >= 0) { - cm.mask |= CAN_CTRLMODE_FD_NON_ISO; - SET_FLAG(cm.flags, CAN_CTRLMODE_FD_NON_ISO, link->network->can_non_iso); - log_link_debug(link, "Setting FD non-ISO mode to '%s'.", yes_no(link->network->can_non_iso)); - } - - if (link->network->can_triple_sampling >= 0) { - cm.mask |= CAN_CTRLMODE_3_SAMPLES; - SET_FLAG(cm.flags, CAN_CTRLMODE_3_SAMPLES, link->network->can_triple_sampling); - log_link_debug(link, "Setting triple-sampling to '%s'.", yes_no(link->network->can_triple_sampling)); - } - - if (link->network->can_berr_reporting >= 0) { - cm.mask |= CAN_CTRLMODE_BERR_REPORTING; - SET_FLAG(cm.flags, CAN_CTRLMODE_BERR_REPORTING, link->network->can_berr_reporting); - log_link_debug(link, "Setting bus error reporting to '%s'.", yes_no(link->network->can_berr_reporting)); - } - - if (link->network->can_listen_only >= 0) { - cm.mask |= CAN_CTRLMODE_LISTENONLY; - SET_FLAG(cm.flags, CAN_CTRLMODE_LISTENONLY, link->network->can_listen_only); - log_link_debug(link, "Setting listen-only mode to '%s'.", yes_no(link->network->can_listen_only)); - } + if (link->network->can_control_mode_mask != 0) { + struct can_ctrlmode cm = { + .mask = link->network->can_control_mode_mask, + .flags = link->network->can_control_mode_flags, + }; - if (cm.mask != 0) { r = sd_netlink_message_append_data(m, IFLA_CAN_CTRLMODE, &cm, sizeof(cm)); if (r < 0) return log_link_debug_errno(link, r, "Could not append IFLA_CAN_CTRLMODE attribute: %m"); } - if (link->network->can_termination >= 0) { - log_link_debug(link, "Setting can-termination to '%s'.", yes_no(link->network->can_termination)); + if (link->network->can_termination_set) { + log_link_debug(link, "Setting can-termination to '%u'.", link->network->can_termination); - r = sd_netlink_message_append_u16(m, IFLA_CAN_TERMINATION, - link->network->can_termination ? CAN_TERMINATION_OHM_VALUE : 0); + r = sd_netlink_message_append_u16(m, IFLA_CAN_TERMINATION, link->network->can_termination); if (r < 0) return log_link_debug_errno(link, r, "Could not append IFLA_CAN_TERMINATION attribute: %m"); } @@ -180,3 +136,205 @@ int can_set_netlink_message(Link *link, sd_netlink_message *m) { return 0; } + +int config_parse_can_bitrate( + const char* unit, + const char *filename, + unsigned line, + const char *section, + unsigned section_line, + const char *lvalue, + int ltype, + const char *rvalue, + void *data, + void *userdata) { + + uint32_t *br = data; + uint64_t sz; + int r; + + assert(filename); + assert(lvalue); + assert(rvalue); + assert(data); + + r = parse_size(rvalue, 1000, &sz); + if (r < 0) { + log_syntax(unit, LOG_WARNING, filename, line, r, + "Failed to parse can bitrate '%s', ignoring: %m", rvalue); + return 0; + } + + /* Linux uses __u32 for bitrates, so the value should not exceed that. */ + if (sz <= 0 || sz > UINT32_MAX) { + log_syntax(unit, LOG_WARNING, filename, line, 0, + "Bit rate out of permitted range 1...4294967295"); + return 0; + } + + *br = (uint32_t) sz; + + return 0; +} + +int config_parse_can_time_quanta( + const char* unit, + const char *filename, + unsigned line, + const char *section, + unsigned section_line, + const char *lvalue, + int ltype, + const char *rvalue, + void *data, + void *userdata) { + + nsec_t val, *tq = data; + int r; + + assert(filename); + assert(lvalue); + assert(rvalue); + assert(data); + + r = parse_nsec(rvalue, &val); + if (r < 0) { + log_syntax(unit, LOG_WARNING, filename, line, r, + "Failed to parse can time quanta '%s', ignoring: %m", rvalue); + return 0; + } + + /* Linux uses __u32 for bitrates, so the value should not exceed that. */ + if (val <= 0 || val > UINT32_MAX) { + log_syntax(unit, LOG_WARNING, filename, line, 0, + "Time quanta out of permitted range 1...4294967295"); + return 0; + } + + *tq = val; + return 0; +} + +int config_parse_can_restart_usec( + const char* unit, + const char *filename, + unsigned line, + const char *section, + unsigned section_line, + const char *lvalue, + int ltype, + const char *rvalue, + void *data, + void *userdata) { + + usec_t usec, *restart_usec = data; + int r; + + assert(filename); + assert(lvalue); + assert(rvalue); + assert(data); + + r = parse_sec(rvalue, &usec); + if (r < 0) { + log_syntax(unit, LOG_WARNING, filename, line, r, + "Failed to parse CAN restart sec '%s', ignoring: %m", rvalue); + return 0; + } + + if (usec != USEC_INFINITY && + DIV_ROUND_UP(usec, USEC_PER_MSEC) > UINT32_MAX) { + log_syntax(unit, LOG_WARNING, filename, line, 0, + "CAN RestartSec= must be in the range 0...%"PRIu32"ms, ignoring: %s", UINT32_MAX, rvalue); + return 0; + } + + *restart_usec = usec; + return 0; +} + +int config_parse_can_control_mode( + const char* unit, + const char *filename, + unsigned line, + const char *section, + unsigned section_line, + const char *lvalue, + int ltype, + const char *rvalue, + void *data, + void *userdata) { + + Network *network = userdata; + uint32_t mask = ltype; + int r; + + assert(filename); + assert(lvalue); + assert(rvalue); + assert(userdata); + assert(mask != 0); + + if (isempty(rvalue)) { + network->can_control_mode_mask &= ~mask; + network->can_control_mode_flags &= ~mask; + return 0; + } + + r = parse_boolean(rvalue); + if (r < 0) { + log_syntax(unit, LOG_WARNING, filename, line, r, + "Failed to parse CAN control mode '%s', ignoring: %s", lvalue, rvalue); + return 0; + } + + network->can_control_mode_mask |= mask; + SET_FLAG(network->can_control_mode_flags, mask, r); + return 0; +} + +int config_parse_can_termination( + const char* unit, + const char *filename, + unsigned line, + const char *section, + unsigned section_line, + const char *lvalue, + int ltype, + const char *rvalue, + void *data, + void *userdata) { + + Network *network = userdata; + int r; + + assert(filename); + assert(lvalue); + assert(rvalue); + assert(data); + + if (isempty(rvalue)) { + network->can_termination_set = false; + return 0; + } + + /* Note that 0 termination ohm value means no termination resistor, and there is no conflict + * between parse_boolean() and safe_atou16() when Termination=0. However, Termination=1 must be + * treated as 1 ohm, instead of true (and then the default ohm value). So, we need to parse the + * string with safe_atou16() at first. */ + + r = safe_atou16(rvalue, &network->can_termination); + if (r < 0) { + r = parse_boolean(rvalue); + if (r < 0) { + log_syntax(unit, LOG_WARNING, filename, line, r, + "Failed to parse CAN termination value, ignoring: %s", rvalue); + return 0; + } + + network->can_termination = r ? CAN_TERMINATION_DEFAULT_OHM_VALUE : 0; + } + + network->can_termination_set = true; + return 0; +} diff --git a/src/network/networkd-can.h b/src/network/networkd-can.h index 781494ed3c..3945082498 100644 --- a/src/network/networkd-can.h +++ b/src/network/networkd-can.h @@ -1,6 +1,8 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +#include <linux/can/netlink.h> + #include "sd-netlink.h" #include "conf-parser.h" @@ -10,3 +12,7 @@ typedef struct Link Link; int can_set_netlink_message(Link *link, sd_netlink_message *m); CONFIG_PARSER_PROTOTYPE(config_parse_can_bitrate); +CONFIG_PARSER_PROTOTYPE(config_parse_can_time_quanta); +CONFIG_PARSER_PROTOTYPE(config_parse_can_restart_usec); +CONFIG_PARSER_PROTOTYPE(config_parse_can_control_mode); +CONFIG_PARSER_PROTOTYPE(config_parse_can_termination); diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf index d5c8c1ff4b..aa4dc00e55 100644 --- a/src/network/networkd-network-gperf.gperf +++ b/src/network/networkd-network-gperf.gperf @@ -347,15 +347,29 @@ IPv6RoutePrefix.LifetimeSec, config_parse_route_prefix_lifetime, LLDP.MUDURL, config_parse_mud_url, 0, offsetof(Network, lldp_mud) CAN.BitRate, config_parse_can_bitrate, 0, offsetof(Network, can_bitrate) CAN.SamplePoint, config_parse_permille, 0, offsetof(Network, can_sample_point) +CAN.TimeQuantaNSec, config_parse_can_time_quanta, 0, offsetof(Network, can_time_quanta_ns) +CAN.PropagationSegment, config_parse_uint32, 0, offsetof(Network, can_propagation_segment) +CAN.PhaseBufferSegment1, config_parse_uint32, 0, offsetof(Network, can_phase_buffer_segment_1) +CAN.PhaseBufferSegment2, config_parse_uint32, 0, offsetof(Network, can_phase_buffer_segment_2) +CAN.SyncJumpWidth, config_parse_uint32, 0, offsetof(Network, can_sync_jump_width) CAN.DataBitRate, config_parse_can_bitrate, 0, offsetof(Network, can_data_bitrate) CAN.DataSamplePoint, config_parse_permille, 0, offsetof(Network, can_data_sample_point) -CAN.FDMode, config_parse_tristate, 0, offsetof(Network, can_fd_mode) -CAN.FDNonISO, config_parse_tristate, 0, offsetof(Network, can_non_iso) -CAN.RestartSec, config_parse_sec, 0, offsetof(Network, can_restart_us) -CAN.TripleSampling, config_parse_tristate, 0, offsetof(Network, can_triple_sampling) -CAN.BusErrorReporting, config_parse_tristate, 0, offsetof(Network, can_berr_reporting) -CAN.Termination, config_parse_tristate, 0, offsetof(Network, can_termination) -CAN.ListenOnly, config_parse_tristate, 0, offsetof(Network, can_listen_only) +CAN.DataTimeQuantaNSec, config_parse_can_time_quanta, 0, offsetof(Network, can_data_time_quanta_ns) +CAN.DataPropagationSegment, config_parse_uint32, 0, offsetof(Network, can_data_propagation_segment) +CAN.DataPhaseBufferSegment1, config_parse_uint32, 0, offsetof(Network, can_data_phase_buffer_segment_1) +CAN.DataPhaseBufferSegment2, config_parse_uint32, 0, offsetof(Network, can_data_phase_buffer_segment_2) +CAN.DataSyncJumpWidth, config_parse_uint32, 0, offsetof(Network, can_data_sync_jump_width) +CAN.RestartSec, config_parse_can_restart_usec, 0, offsetof(Network, can_restart_us) +CAN.Loopback, config_parse_can_control_mode, CAN_CTRLMODE_LOOPBACK, 0 +CAN.ListenOnly, config_parse_can_control_mode, CAN_CTRLMODE_LISTENONLY, 0 +CAN.TripleSampling, config_parse_can_control_mode, CAN_CTRLMODE_3_SAMPLES, 0 +CAN.OneShot, config_parse_can_control_mode, CAN_CTRLMODE_ONE_SHOT, 0 +CAN.BusErrorReporting, config_parse_can_control_mode, CAN_CTRLMODE_BERR_REPORTING, 0 +CAN.FDMode, config_parse_can_control_mode, CAN_CTRLMODE_FD, 0 +CAN.PresumeACK, config_parse_can_control_mode, CAN_CTRLMODE_PRESUME_ACK, 0 +CAN.FDNonISO, config_parse_can_control_mode, CAN_CTRLMODE_FD_NON_ISO, 0 +CAN.ClassicDataLengthCode, config_parse_can_control_mode, CAN_CTRLMODE_CC_LEN8_DLC, 0 +CAN.Termination, config_parse_can_termination, 0, 0 QDisc.Parent, config_parse_qdisc_parent, _QDISC_KIND_INVALID, 0 QDisc.Handle, config_parse_qdisc_handle, _QDISC_KIND_INVALID, 0 BFIFO.Parent, config_parse_qdisc_parent, QDISC_KIND_BFIFO, 0 diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index 945ac60033..daf34a7225 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -413,12 +413,7 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi .ipv6_accept_ra_route_metric = DHCP_ROUTE_METRIC, .ipv6_accept_ra_start_dhcp6_client = IPV6_ACCEPT_RA_START_DHCP6_CLIENT_YES, - .can_triple_sampling = -1, - .can_berr_reporting = -1, .can_termination = -1, - .can_listen_only = -1, - .can_fd_mode = -1, - .can_non_iso = -1, }; r = config_parse_many( diff --git a/src/network/networkd-network.h b/src/network/networkd-network.h index 8b0b53b4f5..815bcf5023 100644 --- a/src/network/networkd-network.h +++ b/src/network/networkd-network.h @@ -266,15 +266,23 @@ struct Network { /* CAN support */ uint32_t can_bitrate; unsigned can_sample_point; + nsec_t can_time_quanta_ns; + uint32_t can_propagation_segment; + uint32_t can_phase_buffer_segment_1; + uint32_t can_phase_buffer_segment_2; + uint32_t can_sync_jump_width; uint32_t can_data_bitrate; unsigned can_data_sample_point; + nsec_t can_data_time_quanta_ns; + uint32_t can_data_propagation_segment; + uint32_t can_data_phase_buffer_segment_1; + uint32_t can_data_phase_buffer_segment_2; + uint32_t can_data_sync_jump_width; usec_t can_restart_us; - int can_triple_sampling; - int can_berr_reporting; - int can_termination; - int can_listen_only; - int can_fd_mode; - int can_non_iso; + uint32_t can_control_mode_mask; + uint32_t can_control_mode_flags; + uint16_t can_termination; + bool can_termination_set; /* sysctl settings */ AddressFamily ip_forward; diff --git a/test/fuzz/fuzz-network-parser/directives.network b/test/fuzz/fuzz-network-parser/directives.network index a05260b3b5..8fe4ced351 100644 --- a/test/fuzz/fuzz-network-parser/directives.network +++ b/test/fuzz/fuzz-network-parser/directives.network @@ -258,8 +258,18 @@ MUDURL= [CAN] SamplePoint= BitRate= +TimeQuantaNSec= +PropagationSegment= +PhaseBufferSegment1= +PhaseBufferSegment2= +SyncJumpWidth= DataSamplePoint= DataBitRate= +DataTimeQuantaNSec= +DataPropagationSegment= +DataPhaseBufferSegment1= +DataPhaseBufferSegment2= +DataSyncJumpWidth= FDMode= FDNonISO= RestartSec= @@ -267,6 +277,10 @@ TripleSampling= BusErrorReporting= Termination= ListenOnly= +Loopback= +OneShot= +PresumeACK= +ClassicDataLengthCode= [Address] DuplicateAddressDetection= AutoJoin= |