///
import { BaseObject, StreamData } from '../structs';
export declare enum MessageType {
NEWLINK = 16,
DELLINK = 17,
GETLINK = 18,
SETLINK = 19,
NEWADDR = 20,
DELADDR = 21,
GETADDR = 22,
NEWROUTE = 24,
DELROUTE = 25,
GETROUTE = 26,
NEWNEIGH = 28,
DELNEIGH = 29,
GETNEIGH = 30,
NEWRULE = 32,
DELRULE = 33,
GETRULE = 34,
NEWQDISC = 36,
DELQDISC = 37,
GETQDISC = 38,
NEWTCLASS = 40,
DELTCLASS = 41,
GETTCLASS = 42,
NEWTFILTER = 44,
DELTFILTER = 45,
GETTFILTER = 46,
NEWACTION = 48,
DELACTION = 49,
GETACTION = 50,
NEWPREFIX = 52,
GETMULTICAST = 58,
GETANYCAST = 62,
NEWNEIGHTBL = 64,
GETNEIGHTBL = 66,
SETNEIGHTBL = 67,
NEWNDUSEROPT = 68,
NEWADDRLABEL = 72,
DELADDRLABEL = 73,
GETADDRLABEL = 74,
GETDCB = 78,
SETDCB = 79,
NEWNETCONF = 80,
DELNETCONF = 81,
GETNETCONF = 82,
NEWMDB = 84,
DELMDB = 85,
GETMDB = 86,
NEWNSID = 88,
DELNSID = 89,
GETNSID = 90,
NEWSTATS = 92,
GETSTATS = 94,
NEWCACHEREPORT = 96,
NEWCHAIN = 100,
DELCHAIN = 101,
GETCHAIN = 102,
NEWNEXTHOP = 104,
DELNEXTHOP = 105,
GETNEXTHOP = 106,
NEWLINKPROP = 108,
DELLINKPROP = 109,
GETLINKPROP = 110,
NEWVLAN = 112,
DELVLAN = 113,
GETVLAN = 114,
NEWNEXTHOPBUCKET = 116,
DELNEXTHOPBUCKET = 117,
GETNEXTHOPBUCKET = 118
}
/** RTnetlink multicast groups */
export declare enum MulticastGroups {
NONE = 0,
LINK = 1,
NOTIFY = 2,
NEIGH = 3,
TC = 4,
IPV4_IFADDR = 5,
IPV4_MROUTE = 6,
IPV4_ROUTE = 7,
IPV4_RULE = 8,
IPV6_IFADDR = 9,
IPV6_MROUTE = 10,
IPV6_ROUTE = 11,
IPV6_IFINFO = 12,
DECnet_IFADDR = 13,
NOP2 = 14,
DECnet_ROUTE = 15,
DECnet_RULE = 16,
NOP4 = 17,
IPV6_PREFIX = 18,
IPV6_RULE = 19,
ND_USEROPT = 20,
PHONET_IFADDR = 21,
PHONET_ROUTE = 22,
DCB = 23,
IPV4_NETCONF = 24,
IPV6_NETCONF = 25,
MDB = 26,
MPLS_ROUTE = 27,
NSID = 28,
MPLS_NETCONF = 29,
IPV4_MROUTE_R = 30,
IPV6_MROUTE_R = 31,
NEXTHOP = 32,
BRVLAN = 33
}
/** Definitions used in routing table administration. */
export interface Route {
family?: number;
dstLen?: number;
srcLen?: number;
tos?: number;
/** Routing table id */
table?: number;
/** Routing protocol */
protocol?: RouteProtocol | keyof typeof RouteProtocol;
scope?: RouteScope | keyof typeof RouteScope;
type?: RouteType | keyof typeof RouteType;
flags?: RouteFlags;
}
/** Parses the attributes of a {@link Route} object */
export declare function parseRoute(r: Buffer): Route;
/** Encodes a {@link Route} object into a stream of attributes */
export declare function formatRoute(x: Route, r?: Buffer): Buffer;
export declare const __LENGTH_Route = 12;
export declare enum RouteType {
UNSPEC = 0,
/** Gateway or direct route */
UNICAST = 1,
/** Accept locally */
LOCAL = 2,
BROADCAST = 3,
ANYCAST = 4,
/** Multicast route */
MULTICAST = 5,
/** Drop */
BLACKHOLE = 6,
/** Destination is unreachable */
UNREACHABLE = 7,
/** Administratively prohibited */
PROHIBIT = 8,
/** Not in this table */
THROW = 9,
/** Translate this address */
NAT = 10,
/** Use external resolver */
XRESOLVE = 11
}
/**
* Values of protocol >= RTPROT_STATIC are not interpreted by kernel;
* they are just passed from user and back as is.
* It will be used by hypothetical multiple routing daemons.
* Note that protocol values should be standardized in order to
* avoid conflicts.
*/
export declare enum RouteProtocol {
/**
* Route installed by ICMP redirects;
* not used by current IPv4
*/
REDIRECT = 1,
/** Route installed by kernel */
KERNEL = 2,
/** Route installed during boot */
BOOT = 3,
/** Route installed by administrator */
STATIC = 4,
/** Apparently, GateD */
GATED = 8,
/** RDISC/ND router advertisements */
RA = 9,
/** Merit MRT */
MRT = 10,
/** Zebra */
ZEBRA = 11,
/** BIRD */
BIRD = 12,
/** DECnet routing daemon */
DNROUTED = 13,
/** XORP */
XORP = 14,
/** Netsukuku */
NTK = 15,
/** DHCP client */
DHCP = 16,
/** Multicast daemon */
MROUTED = 17,
/** Babel daemon */
BABEL = 42,
/** BGP Routes */
BGP = 186,
/** ISIS Routes */
ISIS = 187,
/** OSPF Routes */
OSPF = 188,
/** RIP Routes */
RIP = 189,
/** EIGRP Routes */
EIGRP = 192
}
/**
* Really it is not scope, but sort of distance to the destination.
* NOWHERE are reserved for not existing destinations, HOST is our
* local addresses, LINK are destinations, located on directly attached
* link and UNIVERSE is everywhere in the Universe.
* Intermediate values are also possible f.e. interior routes
* could be assigned a value between UNIVERSE and LINK.
*/
export declare enum RouteScope {
UNIVERSE = 0,
/** User defined values */
SITE = 200,
LINK = 253,
HOST = 254,
NOWHERE = 255
}
export interface RouteFlags {
/** Notify user of route change */
notify?: true;
/** This route is cloned */
cloned?: true;
/** Multipath equalizer: NI */
equalize?: true;
/** Prefix addresses */
prefix?: true;
/** set rtm_table to FIB lookup result */
lookupTable?: true;
/** return full fib lookup match */
fibMatch?: true;
/** route is offloaded */
offload?: true;
/** route is trapping packets */
trap?: true;
__unknown?: number;
}
/** Parses the flags in a {@link RouteFlags} bitmask */
export declare function parseRouteFlags(r: number): RouteFlags;
/** Encodes a {@link RouteFlags} bitmask */
export declare function formatRouteFlags(x: RouteFlags): number;
/** Reserved table identifiers */
export declare enum RoutingTableClass {
/** User defined values */
COMPAT = 252,
DEFAULT = 253,
MAIN = 254,
LOCAL = 255
}
/** Routing message attributes */
export interface RouteAttrs extends BaseObject {
dst?: Buffer;
src?: Buffer;
iif?: number;
oif?: number;
gateway?: Buffer;
priority?: number;
prefsrc?: Buffer;
metrics?: RouteMetrics;
/** array of struct rtnexthop */
multipath?: Buffer;
/** no longer used */
protoinfo?: Buffer;
flow?: number;
cacheInfo?: RouteCacheInfo;
session?: RouteSession;
mpAlgo?: Buffer;
table?: number;
mark?: Buffer;
mfcStats?: RouteMfcStats;
via?: RouteVia;
newdst?: Buffer;
pref?: Buffer;
encapType?: number;
encap?: Buffer;
expires?: Buffer;
__pad?: Buffer;
uid?: Buffer;
ttlPropagate?: number;
ipProto?: Buffer;
sport?: Buffer;
dport?: Buffer;
nhId?: Buffer;
}
/** Parses the attributes of a {@link RouteAttrs} object */
export declare function parseRouteAttrs(r: Buffer): RouteAttrs;
/** Encodes a {@link RouteAttrs} object into a stream of attributes */
export declare function formatRouteAttrs(x: RouteAttrs): StreamData;
/**
* "struct rtnexthop" describes all necessary nexthop information,
* i.e. parameters of path to a destination via this nexthop.
*
* At the moment it is impossible to set different prefsrc, mtu, window
* and rtt for different paths from multipath.
*/
export interface RouteNextHop {
len?: number;
flags?: RouteNextHopFlags;
hops?: number;
ifindex?: number;
}
/** Parses the attributes of a {@link RouteNextHop} object */
export declare function parseRouteNextHop(r: Buffer): RouteNextHop;
/** Encodes a {@link RouteNextHop} object into a stream of attributes */
export declare function formatRouteNextHop(x: RouteNextHop, r?: Buffer): Buffer;
export declare const __LENGTH_RouteNextHop = 8;
export interface RouteNextHopFlags {
/** Nexthop is dead (used by multipath) */
dead?: true;
/** Do recursive gateway lookup */
pervasive?: true;
/** Gateway is forced on link */
onlink?: true;
/** offloaded route */
offload?: true;
/** carrier-down on nexthop */
linkdown?: true;
/** The entry is unresolved (ipmr) */
unresolved?: true;
__unknown?: number;
}
/** Parses the flags in a {@link RouteNextHopFlags} bitmask */
export declare function parseRouteNextHopFlags(r: number): RouteNextHopFlags;
/** Encodes a {@link RouteNextHopFlags} bitmask */
export declare function formatRouteNextHopFlags(x: RouteNextHopFlags): number;
export interface RouteVia {
family?: number;
addr?: number;
}
/** Parses the attributes of a {@link RouteVia} object */
export declare function parseRouteVia(r: Buffer): RouteVia;
/** Encodes a {@link RouteVia} object into a stream of attributes */
export declare function formatRouteVia(x: RouteVia, r?: Buffer): Buffer;
export declare const __LENGTH_RouteVia = 3;
export interface RouteCacheInfo {
clntref?: number;
lastuse?: number;
expires?: number;
error?: number;
used?: number;
id?: number;
ts?: number;
tsage?: number;
}
/** Parses the attributes of a {@link RouteCacheInfo} object */
export declare function parseRouteCacheInfo(r: Buffer): RouteCacheInfo;
/** Encodes a {@link RouteCacheInfo} object into a stream of attributes */
export declare function formatRouteCacheInfo(x: RouteCacheInfo, r?: Buffer): Buffer;
export declare const __LENGTH_RouteCacheInfo = 32;
export interface RouteMetrics extends BaseObject {
lock?: Buffer;
mtu?: Buffer;
window?: Buffer;
rtt?: Buffer;
rttvar?: Buffer;
ssthresh?: Buffer;
cwnd?: Buffer;
advmss?: Buffer;
reordering?: Buffer;
hoplimit?: Buffer;
initcwnd?: Buffer;
features?: Buffer;
rtoMin?: Buffer;
initrwnd?: Buffer;
quickack?: Buffer;
ccAlgo?: Buffer;
fastopenNoCookie?: Buffer;
}
/** Parses the attributes of a {@link RouteMetrics} object */
export declare function parseRouteMetrics(r: Buffer): RouteMetrics;
/** Encodes a {@link RouteMetrics} object into a stream of attributes */
export declare function formatRouteMetrics(x: RouteMetrics): StreamData;
export interface RouteMetricsFeatures {
ecn?: true;
sack?: true;
timestamp?: true;
allfrag?: true;
__unknown?: number;
}
/** Parses the flags in a {@link RouteMetricsFeatures} bitmask */
export declare function parseRouteMetricsFeatures(r: number): RouteMetricsFeatures;
/** Encodes a {@link RouteMetricsFeatures} bitmask */
export declare function formatRouteMetricsFeatures(x: RouteMetricsFeatures): number;
export interface RouteSession {
proto?: number;
__pad1?: number;
__pad2?: number;
u?: number[];
}
/** Parses the attributes of a {@link RouteSession} object */
export declare function parseRouteSession(r: Buffer): RouteSession;
/** Encodes a {@link RouteSession} object into a stream of attributes */
export declare function formatRouteSession(x: RouteSession, r?: Buffer): Buffer;
export declare const __LENGTH_RouteSession = 8;
export interface RouteMfcStats {
packets?: bigint;
bytes?: bigint;
wrongIf?: bigint;
}
/** Parses the attributes of a {@link RouteMfcStats} object */
export declare function parseRouteMfcStats(r: Buffer): RouteMfcStats;
/** Encodes a {@link RouteMfcStats} object into a stream of attributes */
export declare function formatRouteMfcStats(x: RouteMfcStats, r?: Buffer): Buffer;
export declare const __LENGTH_RouteMfcStats = 24;
export interface Address {
family?: number;
/** The prefix length */
prefixlen?: number;
/** Flags */
flags?: AddressFlags;
/** Address scope */
scope?: number;
/** Link index */
index?: number;
}
/** Parses the attributes of a {@link Address} object */
export declare function parseAddress(r: Buffer): Address;
/** Encodes a {@link Address} object into a stream of attributes */
export declare function formatAddress(x: Address, r?: Buffer): Buffer;
export declare const __LENGTH_Address = 8;
export interface AddressAttrs extends BaseObject {
/**
* Important comment:
* this is prefix address, rather than local interface address.
* It makes no difference for normally configured broadcast interfaces,
* but for point-to-point this is DESTINATION address,
* local address is supplied in IFA_LOCAL attribute.
*/
address?: Buffer;
local?: Buffer;
label?: string;
broadcast?: Buffer;
anycast?: Buffer;
cacheInfo?: AddressCacheInfo;
multicast?: Buffer;
/**
* u32 attribute that extends the u8 field ifa_flags.
* If present, the value from struct ifaddrmsg will be ignored.
*/
flags?: AddressFlags;
/** u32, priority/metric for prefix route */
rtPriority?: number;
targetNetnsid?: Buffer;
}
/** Parses the attributes of a {@link AddressAttrs} object */
export declare function parseAddressAttrs(r: Buffer): AddressAttrs;
/** Encodes a {@link AddressAttrs} object into a stream of attributes */
export declare function formatAddressAttrs(x: AddressAttrs): StreamData;
export interface AddressFlags {
secondary?: true;
nodad?: true;
optimistic?: true;
dadfailed?: true;
homeaddress?: true;
deprecated?: true;
tentative?: true;
permanent?: true;
managetempaddr?: true;
noprefixroute?: true;
mcautojoin?: true;
stablePrivacy?: true;
__unknown?: number;
}
/** Parses the flags in a {@link AddressFlags} bitmask */
export declare function parseAddressFlags(r: number): AddressFlags;
/** Encodes a {@link AddressFlags} bitmask */
export declare function formatAddressFlags(x: AddressFlags): number;
export interface AddressCacheInfo {
ifaPrefered?: number;
ifaValid?: number;
/** created timestamp, hundredths of seconds */
cstamp?: number;
/** updated timestamp, hundredths of seconds */
tstamp?: number;
}
/** Parses the attributes of a {@link AddressCacheInfo} object */
export declare function parseAddressCacheInfo(r: Buffer): AddressCacheInfo;
/** Encodes a {@link AddressCacheInfo} object into a stream of attributes */
export declare function formatAddressCacheInfo(x: AddressCacheInfo, r?: Buffer): Buffer;
export declare const __LENGTH_AddressCacheInfo = 16;
export interface Link {
family?: number;
__pad?: number;
/** ARPHRD_* */
type?: LinkType | keyof typeof LinkType;
/** Link index */
index?: number;
/** IFF_* flags */
flags?: DeviceFlags;
/** IFF_* change mask */
change?: DeviceFlags;
}
/** Parses the attributes of a {@link Link} object */
export declare function parseLink(r: Buffer): Link;
/** Encodes a {@link Link} object into a stream of attributes */
export declare function formatLink(x: Link, r?: Buffer): Buffer;
export declare const __LENGTH_Link = 16;
/** New extended info filters for IFLA_EXT_MASK */
export interface RtExtFilter {
vf?: true;
brvlan?: true;
brvlanCompressed?: true;
skipStats?: true;
__unknown?: number;
}
/** Parses the flags in a {@link RtExtFilter} bitmask */
export declare function parseRtExtFilter(r: number): RtExtFilter;
/** Encodes a {@link RtExtFilter} bitmask */
export declare function formatRtExtFilter(x: RtExtFilter): number;
/**
* These are the &struct net_device flags, they can be set by drivers, the
* kernel and some can be triggered by userspace. Userspace can query and
* set these flags using userspace utilities but there is also a sysfs
* entry available for all dev flags which can be queried and set. These flags
* are shared for all types of net_devices. The sysfs entries are available
* via /sys/class/net//flags. Flags which can be toggled through sysfs
* are annotated below, note that only a few flags can be toggled and some
* other flags are always preserved from the original net_device flags
* even if you try to set them via sysfs. Flags which are always preserved
* are kept under the flag grouping @IFF_VOLATILE. Flags which are volatile
* are annotated below as such.
*
* You should have a pretty good reason to be extending these flags.
*/
export interface DeviceFlags {
/** interface is up. Can be toggled through sysfs. */
up?: true;
/** broadcast address valid. Volatile. */
broadcast?: true;
/** turn on debugging. Can be toggled through sysfs. */
debug?: true;
/** is a loopback net. Volatile. */
loopback?: true;
/** interface is has p-p link. Volatile. */
pointopoint?: true;
/**
* avoid use of trailers. Can be toggled through sysfs.
* Volatile.
*/
notrailers?: true;
/** interface RFC2863 OPER_UP. Volatile. */
running?: true;
/** no ARP protocol. Can be toggled through sysfs. Volatile. */
noarp?: true;
/** receive all packets. Can be toggled through sysfs. */
promisc?: true;
/**
* receive all multicast packets. Can be toggled through
* sysfs.
*/
allmulti?: true;
/** master of a load balancer. Volatile. */
master?: true;
/** slave of a load balancer. Volatile. */
slave?: true;
/** Supports multicast. Can be toggled through sysfs. */
multicast?: true;
/** can set media type. Can be toggled through sysfs. */
portsel?: true;
/** auto media select active. Can be toggled through sysfs. */
automedia?: true;
/**
* dialup device with changing addresses. Can be toggled
* through sysfs.
*/
dynamic?: true;
/** driver signals L1 up. Volatile. */
lowerUp?: true;
/** driver signals dormant. Volatile. */
dormant?: true;
/** echo sent packets. Volatile. */
echo?: true;
__unknown?: number;
}
/** Parses the flags in a {@link DeviceFlags} bitmask */
export declare function parseDeviceFlags(r: number): DeviceFlags;
/** Encodes a {@link DeviceFlags} bitmask */
export declare function formatDeviceFlags(x: DeviceFlags): number;
/**
* ARP protocol HARDWARE identifiers.
* for >= 256: Dummy types for non ARP hardware
*/
export declare enum LinkType {
/** from KA9Q: NET/ROM pseudo */
NETROM = 0,
/** Ethernet 10Mbps */
ETHER = 1,
/** Experimental Ethernet */
EETHER = 2,
/** AX.25 Level 2 */
AX25 = 3,
/** PROnet token ring */
PRONET = 4,
/** Chaosnet */
CHAOS = 5,
/** IEEE 802.2 Ethernet/TR/TB */
IEEE802 = 6,
/** ARCnet */
ARCNET = 7,
/** APPLEtalk */
APPLETLK = 8,
/** Frame Relay DLCI */
DLCI = 15,
/** ATM */
ATM = 19,
/** Metricom STRIP (new IANA id) */
METRICOM = 23,
/** IEEE 1394 IPv4 - RFC 2734 */
IEEE1394 = 24,
/** EUI-64 */
EUI64 = 27,
/** InfiniBand */
INFINIBAND = 32,
SLIP = 256,
CSLIP = 257,
SLIP6 = 258,
CSLIP6 = 259,
/** Notional KISS type */
RSRVD = 260,
ADAPT = 264,
ROSE = 270,
/** CCITT X.25 */
X25 = 271,
/** Boards with X.25 in firmware */
HWX25 = 272,
/** Controller Area Network */
CAN = 280,
PPP = 512,
/** Cisco HDLC */
CISCO = 513,
/** LAPB */
LAPB = 516,
/** Digital's DDCMP protocol */
DDCMP = 517,
/** Raw HDLC */
RAWHDLC = 518,
/** Raw IP */
RAWIP = 519,
/** IPIP tunnel */
TUNNEL = 768,
/** IP6IP6 tunnel */
TUNNEL6 = 769,
/** Frame Relay Access Device */
FRAD = 770,
/** SKIP vif */
SKIP = 771,
/** Loopback device */
LOOPBACK = 772,
/** Localtalk device */
LOCALTLK = 773,
/** Fiber Distributed Data Interface */
FDDI = 774,
/** AP1000 BIF */
BIF = 775,
/** sit0 device - IPv6-in-IPv4 */
SIT = 776,
/** IP over DDP tunneller */
IPDDP = 777,
/** GRE over IP */
IPGRE = 778,
/** PIMSM register interface */
PIMREG = 779,
/** High Performance Parallel Interface */
HIPPI = 780,
/** Nexus 64Mbps Ash */
ASH = 781,
/** Acorn Econet */
ECONET = 782,
/** Linux-IrDA */
IRDA = 783,
/** Point to point fibrechannel */
FCPP = 784,
/** Fibrechannel arbitrated loop */
FCAL = 785,
/** Fibrechannel public loop */
FCPL = 786,
/** Fibrechannel fabric */
FCFABRIC = 787,
/** Magic type ident for TR */
IEEE802_TR = 800,
/** IEEE 802.11 */
IEEE80211 = 801,
/** IEEE 802.11 + Prism2 header */
IEEE80211_PRISM = 802,
/** IEEE 802.11 + radiotap header */
IEEE80211_RADIOTAP = 803,
IEEE802154 = 804,
/** IEEE 802.15.4 network monitor */
IEEE802154_MONITOR = 805,
/** PhoNet media type */
PHONET = 820,
/** PhoNet pipe header */
PHONET_PIPE = 821,
/** CAIF media type */
CAIF = 822,
/** GRE over IPv6 */
IP6GRE = 823,
/** Netlink header */
NETLINK = 824,
/** IPv6 over LoWPAN */
_6LOWPAN = 825,
/** Vsock monitor header */
VSOCKMON = 826,
/** Void type, nothing is known */
VOID = 65535,
/** zero header length */
NONE = 65534
}
/** prefix information */
export interface Prefix {
family?: number;
__pad1?: number;
__pad2?: number;
ifindex?: number;
type?: number;
len?: number;
flags?: number;
__pad3?: number;
}
/** Parses the attributes of a {@link Prefix} object */
export declare function parsePrefix(r: Buffer): Prefix;
/** Encodes a {@link Prefix} object into a stream of attributes */
export declare function formatPrefix(x: Prefix, r?: Buffer): Buffer;
export declare const __LENGTH_Prefix = 12;
export interface PrefixAttrs extends BaseObject {
address?: Buffer;
cacheInfo?: PrefixCacheInfo;
}
/** Parses the attributes of a {@link PrefixAttrs} object */
export declare function parsePrefixAttrs(r: Buffer): PrefixAttrs;
/** Encodes a {@link PrefixAttrs} object into a stream of attributes */
export declare function formatPrefixAttrs(x: PrefixAttrs): StreamData;
export interface PrefixCacheInfo {
preferredTime?: number;
validTime?: number;
}
/** Parses the attributes of a {@link PrefixCacheInfo} object */
export declare function parsePrefixCacheInfo(r: Buffer): PrefixCacheInfo;
/** Encodes a {@link PrefixCacheInfo} object into a stream of attributes */
export declare function formatPrefixCacheInfo(x: PrefixCacheInfo, r?: Buffer): Buffer;
export declare const __LENGTH_PrefixCacheInfo = 8;
/** Queueing discipline, class or filter */
export interface Tc {
family?: number;
__pad1?: number;
__pad2?: number;
ifindex?: number;
/** Qdisc handle */
handle?: number;
/** Parent qdisc */
parent?: number;
info?: number;
}
/** Parses the attributes of a {@link Tc} object */
export declare function parseTc(r: Buffer): Tc;
/** Encodes a {@link Tc} object into a stream of attributes */
export declare function formatTc(x: Tc, r?: Buffer): Buffer;
export declare const __LENGTH_Tc = 20;
export interface TcAttrs extends BaseObject {
kind?: string;
options?: Buffer;
stats?: Buffer;
xstats?: Buffer;
rate?: Buffer;
fcnt?: Buffer;
stats2?: Buffer;
stab?: Buffer;
__pad?: Buffer;
dumpInvisible?: Buffer;
chain?: number;
hwOffload?: Buffer;
ingressBlock?: Buffer;
egressBlock?: Buffer;
}
/** Parses the attributes of a {@link TcAttrs} object */
export declare function parseTcAttrs(r: Buffer): TcAttrs;
/** Encodes a {@link TcAttrs} object into a stream of attributes */
export declare function formatTcAttrs(x: TcAttrs): StreamData;
/** TC action piece */
export interface TcAction {
family?: number;
__pad1?: number;
__pad2?: number;
}
/** Parses the attributes of a {@link TcAction} object */
export declare function parseTcAction(r: Buffer): TcAction;
/** Encodes a {@link TcAction} object into a stream of attributes */
export declare function formatTcAction(x: TcAction, r?: Buffer): Buffer;
export declare const __LENGTH_TcAction = 4;
export interface TcActionRoot extends BaseObject {
tab?: Buffer;
flags?: Buffer;
count?: Buffer;
/** in msecs */
timeDelta?: Buffer;
}
/** Parses the attributes of a {@link TcActionRoot} object */
export declare function parseTcActionRoot(r: Buffer): TcActionRoot;
/** Encodes a {@link TcActionRoot} object into a stream of attributes */
export declare function formatTcActionRoot(x: TcActionRoot): StreamData;
/**
* 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
*/
export interface TcActionFlags {
largeDumpOn?: true;
__unknown?: number;
}
/** Parses the flags in a {@link TcActionFlags} bitmask */
export declare function parseTcActionFlags(r: number): TcActionFlags;
/** Encodes a {@link TcActionFlags} bitmask */
export declare function formatTcActionFlags(x: TcActionFlags): number;
/** Neighbor Discovery userland options */
export interface NdUserOption {
family?: number;
__pad1?: number;
/** Total length of options */
optsLen?: number;
ifindex?: number;
icmpType?: number;
icmpCode?: number;
__pad2?: number;
__pad3?: number;
}
/** Parses the attributes of a {@link NdUserOption} object */
export declare function parseNdUserOption(r: Buffer): NdUserOption;
/** Encodes a {@link NdUserOption} object into a stream of attributes */
export declare function formatNdUserOption(x: NdUserOption, r?: Buffer): Buffer;
export declare const __LENGTH_NdUserOption = 16;
export interface NdUserOptionAttrs extends BaseObject {
srcaddr?: Buffer;
}
/** Parses the attributes of a {@link NdUserOptionAttrs} object */
export declare function parseNdUserOptionAttrs(r: Buffer): NdUserOptionAttrs;
/** Encodes a {@link NdUserOptionAttrs} object into a stream of attributes */
export declare function formatNdUserOptionAttrs(x: NdUserOptionAttrs): StreamData;
export interface Neighbor {
family?: number;
__pad1?: number;
__pad2?: number;
ifindex?: number;
state?: NeighborState;
flags?: NeighborFlags;
type?: number;
}
/** Parses the attributes of a {@link Neighbor} object */
export declare function parseNeighbor(r: Buffer): Neighbor;
/** Encodes a {@link Neighbor} object into a stream of attributes */
export declare function formatNeighbor(x: Neighbor, r?: Buffer): Buffer;
export declare const __LENGTH_Neighbor = 12;
export interface NeighborAttrs extends BaseObject {
dst?: Buffer;
lladdr?: Buffer;
cacheInfo?: NeighborCacheInfo;
probes?: number;
vlan?: number;
port?: Buffer;
vni?: Buffer;
ifindex?: Buffer;
master?: number;
linkNetnsid?: Buffer;
srcVni?: Buffer;
/** Originator of entry */
protocol?: Buffer;
}
/** Parses the attributes of a {@link NeighborAttrs} object */
export declare function parseNeighborAttrs(r: Buffer): NeighborAttrs;
/** Encodes a {@link NeighborAttrs} object into a stream of attributes */
export declare function formatNeighborAttrs(x: NeighborAttrs): StreamData;
/** Neighbor Cache Entry Flags */
export interface NeighborFlags {
use?: true;
self?: true;
master?: true;
/** == ATF_PUBL */
proxy?: true;
extLearned?: true;
offloaded?: true;
sticky?: true;
router?: true;
__unknown?: number;
}
/** Parses the flags in a {@link NeighborFlags} bitmask */
export declare function parseNeighborFlags(r: number): NeighborFlags;
/** Encodes a {@link NeighborFlags} bitmask */
export declare function formatNeighborFlags(x: NeighborFlags): number;
/**
* Neighbor Cache Entry States.
*
* NUD_NOARP & NUD_PERMANENT are pseudostates, they never change
* and make no address resolution or NUD.
* NUD_PERMANENT also cannot be deleted by garbage collectors.
*/
export interface NeighborState {
incomplete?: true;
reachable?: true;
stale?: true;
delay?: true;
probe?: true;
failed?: true;
/** Dummy states */
noarp?: true;
permanent?: true;
__unknown?: number;
}
/** Parses the flags in a {@link NeighborState} bitmask */
export declare function parseNeighborState(r: number): NeighborState;
/** Encodes a {@link NeighborState} bitmask */
export declare function formatNeighborState(x: NeighborState): number;
export interface NeighborCacheInfo {
confirmed?: number;
used?: number;
updated?: number;
refcnt?: number;
}
/** Parses the attributes of a {@link NeighborCacheInfo} object */
export declare function parseNeighborCacheInfo(r: Buffer): NeighborCacheInfo;
/** Encodes a {@link NeighborCacheInfo} object into a stream of attributes */
export declare function formatNeighborCacheInfo(x: NeighborCacheInfo, r?: Buffer): Buffer;
export declare const __LENGTH_NeighborCacheInfo = 16;
/**
* Neighbour tables specific messages.
*
* To retrieve the neighbour tables send RTM_GETNEIGHTBL with the
* NLM_F_DUMP flag set. Every neighbour table configuration is
* spread over multiple messages to avoid running into message
* size limits on systems with many interfaces. The first message
* in the sequence transports all not device specific data such as
* statistics, configuration, and the default parameter set.
* This message is followed by 0..n messages carrying device
* specific parameter sets.
* Although the ordering should be sufficient, NDTA_NAME can be
* used to identify sequences. The initial message can be identified
* by checking for NDTA_CONFIG. The device specific messages do
* not contain this TLV but have NDTPA_IFINDEX set to the
* corresponding interface index.
*
* To change neighbour table attributes, send RTM_SETNEIGHTBL
* with NDTA_NAME set. Changeable attribute include NDTA_THRESH[1-3],
* NDTA_GC_INTERVAL, and all TLVs in NDTA_PARMS unless marked
* otherwise. Device specific parameter sets can be changed by
* setting NDTPA_IFINDEX to the interface index of the corresponding
* device.
*/
export interface NeighborTable {
family?: number;
__pad1?: number;
__pad2?: number;
}
/** Parses the attributes of a {@link NeighborTable} object */
export declare function parseNeighborTable(r: Buffer): NeighborTable;
/** Encodes a {@link NeighborTable} object into a stream of attributes */
export declare function formatNeighborTable(x: NeighborTable, r?: Buffer): Buffer;
export declare const __LENGTH_NeighborTable = 4;
export interface NeighborTableAttrs extends BaseObject {
/** char *, unchangeable */
name?: string;
/** u32 */
thresh1?: number;
thresh2?: number;
thresh3?: number;
/** struct ndt_config, read-only */
config?: NeighborTableConfig;
/** nested TLV NDTPA_* */
parms?: NeighborTableParams;
/** struct ndt_stats, read-only */
stats?: NeighborTableStats;
/** u64, msecs */
gcInterval?: bigint;
__pad?: Buffer;
}
/** Parses the attributes of a {@link NeighborTableAttrs} object */
export declare function parseNeighborTableAttrs(r: Buffer): NeighborTableAttrs;
/** Encodes a {@link NeighborTableAttrs} object into a stream of attributes */
export declare function formatNeighborTableAttrs(x: NeighborTableAttrs): StreamData;
export interface NeighborTableConfig {
keyLen?: number;
entrySize?: number;
entries?: number;
/** delta to now in msecs */
lastFlush?: number;
lastRand?: number;
hashRnd?: number;
hashMask?: number;
hashChainGc?: number;
proxyQlen?: number;
}
/** Parses the attributes of a {@link NeighborTableConfig} object */
export declare function parseNeighborTableConfig(r: Buffer): NeighborTableConfig;
/** Encodes a {@link NeighborTableConfig} object into a stream of attributes */
export declare function formatNeighborTableConfig(x: NeighborTableConfig, r?: Buffer): Buffer;
export declare const __LENGTH_NeighborTableConfig = 32;
export interface NeighborTableStats {
allocs?: bigint;
destroys?: bigint;
hashGrows?: bigint;
resFailed?: bigint;
lookups?: bigint;
hits?: bigint;
rcvProbesMcast?: bigint;
rcvProbesUcast?: bigint;
periodicGcRuns?: bigint;
forcedGcRuns?: bigint;
tableFulls?: bigint;
}
/** Parses the attributes of a {@link NeighborTableStats} object */
export declare function parseNeighborTableStats(r: Buffer): NeighborTableStats;
/** Encodes a {@link NeighborTableStats} object into a stream of attributes */
export declare function formatNeighborTableStats(x: NeighborTableStats, r?: Buffer): Buffer;
export declare const __LENGTH_NeighborTableStats = 88;
export interface NeighborTableParams extends BaseObject {
/** u32, unchangeable */
ifindex?: number;
/** u32, read-only */
refcnt?: number;
/** u64, read-only, msecs */
reachableTime?: bigint;
/** u64, msecs */
baseReachableTime?: bigint;
retransTime?: bigint;
gcStaletime?: bigint;
delayProbeTime?: bigint;
/** u32 */
queueLen?: number;
appProbes?: number;
ucastProbes?: number;
mcastProbes?: number;
/** u64, msecs */
anycastDelay?: bigint;
proxyDelay?: bigint;
/** u32 */
proxyQlen?: number;
/** u64, msecs */
locktime?: bigint;
/** u32 */
queueLenbytes?: number;
mcastReprobes?: number;
__pad?: Buffer;
}
/** Parses the attributes of a {@link NeighborTableParams} object */
export declare function parseNeighborTableParams(r: Buffer): NeighborTableParams;
/** Encodes a {@link NeighborTableParams} object into a stream of attributes */
export declare function formatNeighborTableParams(x: NeighborTableParams): StreamData;
export interface Rule {
family?: number;
dstLen?: number;
srcLen?: number;
tos?: number;
table?: number;
/** reserved */
__reserved1?: number;
/** reserved */
__reserved2?: number;
action?: RuleAction | keyof typeof RuleAction;
flags?: RuleFlags;
}
/** Parses the attributes of a {@link Rule} object */
export declare function parseRule(r: Buffer): Rule;
/** Encodes a {@link Rule} object into a stream of attributes */
export declare function formatRule(x: Rule, r?: Buffer): Buffer;
export declare const __LENGTH_Rule = 12;
export interface RuleAttrs extends BaseObject {
/** destination address */
dst?: Buffer;
/** source address */
src?: Buffer;
/** input interface name (deprecated alias FRA_IFNAME) */
iifname?: string;
/** target to jump to (RuleAction.GOTO) */
goto?: number;
unused2?: Buffer;
/** priority/preference */
priority?: number;
unused3?: Buffer;
unused4?: Buffer;
unused5?: Buffer;
/** netfilter mark */
fwmark?: number;
/** flow/class id */
flow?: number;
tunId?: Buffer;
suppressIfgroup?: Buffer;
suppressPrefixlen?: Buffer;
/** Extended table id */
table?: number;
/** mask for {@link fwmark} */
fwmask?: number;
/** output interface name */
oifname?: string;
__pad?: Buffer;
/** iif or oif is l3mdev goto its table */
l3Mdev?: number;
uidRange?: RuleUidRange;
/** Originator of the rule */
protocol?: number;
ipProto?: number;
sportRange?: RulePortRange;
dportRange?: RulePortRange;
}
/** Parses the attributes of a {@link RuleAttrs} object */
export declare function parseRuleAttrs(r: Buffer): RuleAttrs;
/** Encodes a {@link RuleAttrs} object into a stream of attributes */
export declare function formatRuleAttrs(x: RuleAttrs): StreamData;
export interface RuleFlags {
/** rule is permanent, and cannot be deleted */
permanent?: true;
invert?: true;
unresolved?: true;
/** input interface detached (deprecated alias FIB_RULE_DEV_DETACHED) */
iifDetached?: true;
/** output interface detached */
oifDetached?: true;
/** try to find source address in routing lookups */
findSaddr?: true;
__unknown?: number;
}
/** Parses the flags in a {@link RuleFlags} bitmask */
export declare function parseRuleFlags(r: number): RuleFlags;
/** Encodes a {@link RuleFlags} bitmask */
export declare function formatRuleFlags(x: RuleFlags): number;
export interface RuleUidRange {
start?: number;
end?: number;
}
/** Parses the attributes of a {@link RuleUidRange} object */
export declare function parseRuleUidRange(r: Buffer): RuleUidRange;
/** Encodes a {@link RuleUidRange} object into a stream of attributes */
export declare function formatRuleUidRange(x: RuleUidRange, r?: Buffer): Buffer;
export declare const __LENGTH_RuleUidRange = 8;
export interface RulePortRange {
start?: number;
end?: number;
}
/** Parses the attributes of a {@link RulePortRange} object */
export declare function parseRulePortRange(r: Buffer): RulePortRange;
/** Encodes a {@link RulePortRange} object into a stream of attributes */
export declare function formatRulePortRange(x: RulePortRange, r?: Buffer): Buffer;
export declare const __LENGTH_RulePortRange = 4;
export declare enum RuleAction {
unspec = 0,
/** Pass to fixed table */
toTbl = 1,
/** Jump to another rule */
goto = 2,
/** No operation */
nop = 3,
res3 = 4,
res4 = 5,
/** Drop without notification */
blackhole = 6,
/** Drop with ENETUNREACH */
unreachable = 7,
/** Drop with EACCES */
prohibit = 8
}
export interface NextHop {
family?: number;
/** return only */
scope?: number;
/** Routing protocol that installed nexthop */
protocol?: number;
__reserved?: number;
flags?: RouteNextHopFlags;
}
/** Parses the attributes of a {@link NextHop} object */
export declare function parseNextHop(r: Buffer): NextHop;
/** Encodes a {@link NextHop} object into a stream of attributes */
export declare function formatNextHop(x: NextHop, r?: Buffer): Buffer;
export declare const __LENGTH_NextHop = 8;
export interface NextHopAttrs extends BaseObject {
/** id for nexthop. id == 0 means auto-assign */
id?: number;
/** [if this attribute is present: no other attributes can be set (other than `id` and `groupType`)] */
group?: Buffer;
groupType?: NextHopGroupType | keyof typeof NextHopGroupType;
/**
* nexthop used to blackhole packets
* [if this attribute is present: OIF, GATEWAY, ENCAP can not be set]
*/
blackhole?: true;
/**
* nexthop device
* [can be appended to dump request to return only nexthops using given device]
*/
oif?: number;
/** be32 (IPv4) or in6_addr (IPv6) gw address */
gateway?: Buffer;
/** lwt encap type */
encapType?: number;
/** lwt encap data */
encap?: Buffer;
/** only return nexthop groups in dump */
groups?: true;
/** only return nexthops with given master dev */
master?: number;
/**
* nexthop belongs to a bridge fdb
* [if this attribute is present: OIF, BLACKHOLE, ENCAP cannot be set]
*/
fdb?: true;
/** resilient nexthop group attributes */
resGroup?: NextHopResGroup;
/** nexthop bucket attributes */
resBucket?: NextHopResBucket;
}
/** Parses the attributes of a {@link NextHopAttrs} object */
export declare function parseNextHopAttrs(r: Buffer): NextHopAttrs;
/** Encodes a {@link NextHopAttrs} object into a stream of attributes */
export declare function formatNextHopAttrs(x: NextHopAttrs): StreamData;
/** entry in a nexthop group */
export interface NextHopGroup {
/** nexthop id - must exist */
id?: number;
/** weight of this nexthop */
weight?: number;
__reserved1?: number;
__reserved2?: number;
}
/** Parses the attributes of a {@link NextHopGroup} object */
export declare function parseNextHopGroup(r: Buffer): NextHopGroup;
/** Encodes a {@link NextHopGroup} object into a stream of attributes */
export declare function formatNextHopGroup(x: NextHopGroup, r?: Buffer): Buffer;
export declare const __LENGTH_NextHopGroup = 8;
export declare enum NextHopGroupType {
/**
* hash-threshold nexthop group
* (default type if not specified)
*/
multipath = 0,
/** resilient nexthop group */
resilient = 1
}
export interface NextHopResGroup extends BaseObject {
/** Pad attribute for 64-bit alignment. */
__pad?: Buffer;
/** number of nexthop buckets in a resilient nexthop group */
buckets?: number;
/** clock_t; nexthop bucket idle timer (per-group) */
idleTimer?: number;
/** clock_t; nexthop unbalanced timer */
unbalancedTimer?: number;
/** clock_t; nexthop unbalanced time */
unbalancedTime?: bigint;
}
/** Parses the attributes of a {@link NextHopResGroup} object */
export declare function parseNextHopResGroup(r: Buffer): NextHopResGroup;
/** Encodes a {@link NextHopResGroup} object into a stream of attributes */
export declare function formatNextHopResGroup(x: NextHopResGroup): StreamData;
export interface NextHopResBucket extends BaseObject {
/** Pad attribute for 64-bit alignment. */
__pad?: Buffer;
/** u16; nexthop bucket index */
index?: number;
/** clock_t; nexthop bucket idle time */
idleTime?: bigint;
/** nexthop id assigned to the nexthop bucket */
nexthopId?: number;
}
/** Parses the attributes of a {@link NextHopResBucket} object */
export declare function parseNextHopResBucket(r: Buffer): NextHopResBucket;
/** Encodes a {@link NextHopResBucket} object into a stream of attributes */
export declare function formatNextHopResBucket(x: NextHopResBucket): StreamData;