Members

(readonly) ETHERTYPE :number

Enum for Ethernet child protocols.
Type:
  • number
Properties
NameTypeDescription
IPnumberInternet protocol
ARPnumberAddress resolution
ETHBRIDGEnumberTransparent Ethernet Bridging
REVARPnumberReverse ARP
ATnumberAppleTalk protocol
AARPnumberAppleTalk ARP
VLANnumberIEEE 802.1Q VLAN tagging
IPXnumberIPX
IPV6numberIP protocol version 6
LOOPBACKnumberused to test interfaces
PPPOEDnumberPPPoE discovery
PPPOESnumberPPPoE session
MPLSnumberMPLS
PPPnumberPoint-to-point protocol (PPP)
ROCEV1numberRDMA over Converged Ethernet (RoCEv1)
IEEE_802_1ADnumberIEEE 802.1ad Provider Bridge, Q-in-Q
WAKE_ON_LANnumberWake on LAN

(readonly) IPProtocolTypes :number

Enum for IPv4 child protocols.
Type:
  • number
Properties
NameTypeDescription
IPnumberDummy protocol for TCP
HOPOPTSnumberIPv6 Hop-by-Hop options
ICMPnumberInternet Control Message Protocol
IGMPnumberInternet Gateway Management Protocol
IPIPnumberIPIP tunnels (older KA9Q tunnels use 94)
TCPnumberTransmission Control Protocol
EGPnumberExterior Gateway Protocol
PUPnumberPUP protocol
UDPnumberUser Datagram Protocol
IDPnumberXNS IDP protocol
IPV6numberIPv6 header
ROUTINGnumberIPv6 Routing header
FRAGMENTnumberIPv6 fragmentation header
GREnumberGRE protocol
ESPnumberencapsulating security payload
AHnumberauthentication header
ICMPV6numberICMPv6
NONEnumberIPv6 no next header
DSTOPTSnumberIPv6 Destination options
VRRPnumberVRRP protocol
RAWnumberRaw IP packets
MAXnumberMaximum value

(readonly) IPv4OptionTypes :number

Enum for IPv4 options.
Type:
  • number
Properties
NameTypeDescription
EndOfOptionsListnumberEnd of Options List
NOPnumberNo Operation
RecordRoutenumberRecord Route
MTUProbenumberMTU Probe
MTUReplynumberMTU Reply
QuickStartnumberQuick-Start
TimestampnumberTimestamp
TraceroutenumberTraceroute
SecuritynumberSecurity
LooseSourceRoutenumberLoose Source Route
ExtendedSecuritynumberExtended Security
CommercialSecuritynumberCommercial Security
StreamIDnumberStream ID
StrictSourceRoutenumberStrict Source Route
ExtendedInternetProtocolnumberExtended Internet Protocol
AddressExtensionnumberAddress Extension
RouterAlertnumberRouter Alert
SelectiveDirectedBroadcastnumberSelective Directed Broadcast
DynamicPacketStatenumberDynamic Packet State
UpstreamMulticastPktnumberUpstream Multicast Pkt.
UnknownnumberUnknown IPv4 option

(constant) OsiModelLayers :number

Enum for OSI model layers.
Type:
  • number
Properties
NameTypeDescription
PhysicalnumberPhysical layer (layer 1)
DataLinknumberData link layer (layer 2)
NetworknumberNetwork layer (layer 3)
TransportnumberTransport layer (layer 4)
SesionnumberSession layer (layer 5)
PresentationnumberPresentation layer (layer 6)
ApplicationnumberApplication layer (layer 7)
UnknownnumberUnknown / null layer

Methods

(async) getArpTable() → {Promise.<Object>}

Retrieves the ARP (Address Resolution Protocol) table for all interfaces.
Source
Returns:
An object where the keys are interface names and the values are arrays of ARP records. Each ARP record is represented by an object with `ipAddr` (IP address) and `hwAddr` (hardware address) properties.
Type: 
Promise.<Object>
Example
const arpTable = await getArpTable();
// arpTable = {
//   eth0: [
//     { ipAddr: '192.168.1.1', hwAddr: '00:1A:2B:3C:4D:5E' },
//     { ipAddr: '192.168.1.2', hwAddr: '00:1A:2B:3C:4D:5F' }
//   ],
//   wlan0: [
//     { ipAddr: '192.168.1.3', hwAddr: '00:1A:2B:3C:4D:60' }
//   ]
// }

(async) getRoutingTable() → {Promise.<Object>}

Retrieves the routing table for all interfaces.
Returns:
An object where the keys are interface names and the values are arrays of routing table records. Each routing table record is represented by an object with `destination`, `gateway`, and `mask` properties.
Type: 
Promise.<Object>
Example
const routingTable = await getRoutingTable();
// routingTable = {
//   eth0: [
//     { destination: '0.0.0.0', gateway: '192.168.1.1', mask: '0.0.0.0' },
//     { destination: '192.168.1.0', gateway: '0.0.0.0', mask: '255.255.255.0' }
//   ],
//   wlan0: [
//     { destination: '10.0.0.0', gateway: '10.0.0.1', mask: '255.255.255.0' }
//   ]
// }

Type Definitions

DeviceStats

Type:
  • Object
Properties
NameTypeDescription
packetsDropnumberThe number of packets dropped.
packetsDropByInterfacenumberThe number of packets dropped by the interface.
packetsRecvnumberThe number of packets received.

InterfaceInfo

Type:
  • Object
Properties
NameTypeDescription
namestringThe name of the network interface.
descriptionstringThe description of the network interface.
macstringThe MAC address of the network interface.
gatewaystringThe gateway address of the network interface.
mtunumberThe Maximum Transmission Unit size.
linktypestringThe link type of the network interface.
dnsServersArray.<string>The DNS servers associated with the network interface.
addressesArray.<string>The IP addresses associated with the network interface.

LiveDeviceOptions

Type:
  • Object
Properties
NameTypeAttributesDescription
modestring<optional>
The mode of the device, either "promiscuous" or "normal".
directionstring<optional>
The direction of packet capture, either "inout", "in", or "out".
packetBufferTimeoutMsnumber<optional>
The packet buffer timeout in milliseconds.
packetBufferSizenumber<optional>
The size of the packet buffer.
snapshotLengthnumber<optional>
The snapshot length for packet capture.
nflogGroupnumber<optional>
The NFLOG group.
ifacestring<optional>
The network interface name.
filterstring<optional>
The filter string for packet capture.

TCPFlags

Type:
  • Object
Properties
NameTypeDescription
reservednumberReserved flag (0 or 1).
cwrnumberCongestion Window Reduced (0 or 1).
ecenumberECN-Echo (0 или 1).
urgnumberUrgent pointer field significant (0 или 1).
acknumberAcknowledgment field significant (0 или 1).
pshnumberPush Function (0 или 1).
rstnumberReset the connection (0 или 1).
synnumberSynchronize sequence numbers (0 или 1).
finnumberNo more data from sender (0 или 1).

TLVOption

Type:
  • Object
Properties
NameTypeDescription
typenumberThe TLV option type.
lengthnumberThe length of the TLV option value.
valueBufferThe TLV option value.