PcapPlusPlus  Next
ProtocolType and ProtocolTypeFamily

Typedefs

typedef uint8_t pcpp::ProtocolType
 
typedef uint32_t pcpp::ProtocolTypeFamily
 

Functions

constexpr bool pcpp::internal::protoFamilyContainsProtocol (ProtocolTypeFamily family, ProtocolType protocol)
 Check if a protocol family contains a specific protocol. More...
 

Variables

const ProtocolType pcpp::UnknownProtocol = 0
 Unknown protocol (or unsupported by PcapPlusPlus)
 
const ProtocolType pcpp::Ethernet = 1
 Ethernet protocol.
 
const ProtocolType pcpp::IPv4 = 2
 IPv4 protocol.
 
const ProtocolType pcpp::IPv6 = 3
 IPv6 protocol.
 
const ProtocolTypeFamily pcpp::IP = 0x203
 IP protocol family (IPv4 and IPv6 protocols)
 
const ProtocolType pcpp::TCP = 4
 TCP protocol.
 
const ProtocolType pcpp::UDP = 5
 UDP protocol.
 
const ProtocolType pcpp::HTTPRequest = 6
 HTTP request protocol.
 
const ProtocolType pcpp::HTTPResponse = 7
 HTTP response protocol.
 
const ProtocolTypeFamily pcpp::HTTP = 0x607
 HTTP protocol family (HTTP request and HTTP response protocols)
 
const ProtocolType pcpp::ARP = 8
 ARP protocol.
 
const ProtocolType pcpp::VLAN = 9
 VLAN protocol.
 
const ProtocolType pcpp::ICMP = 10
 ICMP protocol.
 
const ProtocolType pcpp::PPPoESession = 11
 PPPoE session protocol.
 
const ProtocolType pcpp::PPPoEDiscovery = 12
 PPPoE discovery protocol.
 
const ProtocolTypeFamily pcpp::PPPoE = 0xb0c
 PPPoE protocol family (PPPoESession and PPPoEDiscovery protocols)
 
const ProtocolType pcpp::DNS = 13
 DNS protocol.
 
const ProtocolType pcpp::MPLS = 14
 MPLS protocol.
 
const ProtocolType pcpp::GREv0 = 15
 GRE version 0 protocol.
 
const ProtocolType pcpp::GREv1 = 16
 GRE version 1 protocol.
 
const ProtocolTypeFamily pcpp::GRE = 0xf10
 GRE protocol family (GREv0 and GREv1 protocols)
 
const ProtocolType pcpp::PPP_PPTP = 17
 PPP for PPTP protocol.
 
const ProtocolType pcpp::SSL = 18
 SSL/TLS protocol.
 
const ProtocolType pcpp::SLL = 19
 SLL (Linux cooked capture) protocol.
 
const ProtocolType pcpp::DHCP = 20
 DHCP/BOOTP protocol.
 
const ProtocolType pcpp::NULL_LOOPBACK = 21
 Null/Loopback protocol.
 
const ProtocolType pcpp::IGMPv1 = 22
 IGMPv1 protocol.
 
const ProtocolType pcpp::IGMPv2 = 23
 IGMPv2 protocol.
 
const ProtocolType pcpp::IGMPv3 = 24
 IGMPv3 protocol.
 
const ProtocolTypeFamily pcpp::IGMP = 0x161718
 IGMP protocol family (IGMPv1, IGMPv2, IGMPv3)
 
const ProtocolType pcpp::GenericPayload = 25
 Generic payload (no specific protocol)
 
const ProtocolType pcpp::VXLAN = 26
 VXLAN protocol.
 
const ProtocolType pcpp::SIPRequest = 27
 SIP request protocol.
 
const ProtocolType pcpp::SIPResponse = 28
 SIP response protocol.
 
const ProtocolTypeFamily pcpp::SIP = 0x1b1c
 SIP protocol family (SIPRequest and SIPResponse protocols)
 
const ProtocolType pcpp::SDP = 29
 SDP protocol.
 
const ProtocolType pcpp::PacketTrailer = 30
 Packet trailer.
 
const ProtocolType pcpp::Radius = 31
 RADIUS protocol.
 
const ProtocolType pcpp::GTPv1 = 32
 GTPv1 protocol.
 
const ProtocolTypeFamily pcpp::GTP = 0x2039
 GTP protocol family (GTPv1 and GTPv2)
 
const ProtocolType pcpp::EthernetDot3 = 33
 IEEE 802.3 Ethernet protocol.
 
const ProtocolType pcpp::BGP = 34
 Border Gateway Protocol (BGP) version 4 protocol.
 
const ProtocolType pcpp::SSH = 35
 SSH version 2 protocol.
 
const ProtocolType pcpp::AuthenticationHeader = 36
 IPSec Authentication Header (AH) protocol.
 
const ProtocolType pcpp::ESP = 37
 IPSec Encapsulating Security Payload (ESP) protocol.
 
const ProtocolTypeFamily pcpp::IPSec = 0x2425
 IPSec protocol family (AH and ESP protocols)
 
const ProtocolType pcpp::DHCPv6 = 38
 Dynamic Host Configuration Protocol version 6 (DHCPv6) protocol.
 
const ProtocolType pcpp::NTP = 39
 Network Time (NTP) Protocol.
 
const ProtocolType pcpp::Telnet = 40
 Telnet Protocol.
 
const ProtocolType pcpp::FTPControl = 41
 File Transfer (FTP) Protocol - Control channel.
 
const ProtocolType pcpp::ICMPv6 = 42
 ICMPv6 protocol.
 
const ProtocolType pcpp::STP = 43
 Spanning Tree Protocol.
 
const ProtocolType pcpp::LLC = 44
 Logical Link Control (LLC)
 
const ProtocolType pcpp::SomeIP = 45
 SOME/IP Base protocol.
 
const ProtocolType pcpp::WakeOnLan = 46
 Wake On LAN (WOL) Protocol.
 
const ProtocolType pcpp::NFLOG = 47
 NFLOG (Linux Netfilter NFLOG) Protocol.
 
const ProtocolType pcpp::TPKT = 48
 TPKT protocol.
 
const ProtocolType pcpp::VRRPv2 = 49
 VRRP version 2 protocol.
 
const ProtocolType pcpp::VRRPv3 = 50
 VRRP version 3 protocol.
 
const ProtocolTypeFamily pcpp::VRRP = 0x3132
 VRRP protocol family (VRRPv2 and VRRPv3 protocols)
 
const ProtocolType pcpp::COTP = 51
 COTP protocol.
 
const ProtocolType pcpp::SLL2 = 52
 SLL2 protocol.
 
const ProtocolType pcpp::S7COMM = 53
 S7COMM protocol.
 
const ProtocolType pcpp::SMTP = 54
 SMTP protocol.
 
const ProtocolType pcpp::LDAP = 55
 LDAP protocol.
 
const ProtocolType pcpp::WireGuard = 56
 WireGuard protocol.
 
const ProtocolType pcpp::GTPv2 = 57
 GTPv2 protocol.
 
const ProtocolType pcpp::CiscoHDLC = 58
 Cisco HDLC protocol.
 
const ProtocolType pcpp::DOIP = 59
 Diagnostic over IP protocol (DOIP)
 
const ProtocolType pcpp::FTPData = 60
 File Transfer Protocol (FTP) Data channel.
 
const ProtocolTypeFamily pcpp::FTP = 0x3c29
 FTP protocol family (FTPControl and FtpData protocols)
 

Detailed Description

In the PcapPlusPlus library, specific protocols are identified by a ProtocolType value, which is an 8-bit unsigned integer. Each Layer class has a ProtocolType that can be used to identify the protocol of that layer.

As there are some situations where multiple protocols can be grouped together (e.g. IPv4 and IPv6 into IP), PcapPlusPlus also defines ProtocolTypeFamily, which is a group of multiple protocol types. In functions where a ProtocolTypeFamily parameter is expected, a single ProtocolType value can be passed instead. The library will treat it as a family containing only that single protocol.

Typedef Documentation

◆ ProtocolType

Representing all protocols supported by PcapPlusPlus

◆ ProtocolTypeFamily

Representing a family of protocols

Function Documentation

◆ protoFamilyContainsProtocol()

constexpr bool pcpp::internal::protoFamilyContainsProtocol ( ProtocolTypeFamily  family,
ProtocolType  protocol 
)
constexpr

Check if a protocol family contains a specific protocol.

Parameters
familyA protocol type family value.
protocolA protocol type value to check against the family.
Returns
True if the protocol is part of the family, false otherwise.