Skip to content

Commit 5871d62

Browse files
Define ETHERTYPE_{SLOW,LLDP} and accept them in pcap_nametoeproto()
The nomenclature for SLOW follows common practice; Linux uses #define ETH_P_SLOW 0x8809 /* Slow Protocol. See 802.3ad 43B */ #define ETH_P_LLDP 0x88CC /* Link Layer Discovery Protocol */ SLOW carries IEEE 802.3 LACP, both defined in annex 57A of 802.3-2018: https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=8457469 and LLDP is defined in sexion 79 of the same.
1 parent 419dac4 commit 5871d62

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

ethertype.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@
100100
#ifndef ETHERTYPE_IPV6
101101
#define ETHERTYPE_IPV6 0x86dd
102102
#endif
103+
#ifndef ETHERTYPE_SLOW
104+
#define ETHERTYPE_SLOW 0x8809 /* Organization-specific slow protocol */
105+
#endif
103106
#ifndef ETHERTYPE_MPLS
104107
#define ETHERTYPE_MPLS 0x8847
105108
#endif
@@ -115,6 +118,9 @@
115118
#ifndef ETHERTYPE_8021AD
116119
#define ETHERTYPE_8021AD 0x88a8
117120
#endif
121+
#ifndef ETHERTYPE_LLDP
122+
#define ETHERTYPE_LLDP 0x88cc /* Layer Discovery Protocol */
123+
#endif
118124
#ifndef ETHERTYPE_LOOPBACK
119125
#define ETHERTYPE_LOOPBACK 0x9000
120126
#endif

nametoaddr.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,11 +571,13 @@ PCAP_API_DEF struct eproto eproto_db[] = {
571571
{ "ip", ETHERTYPE_IP },
572572
{ "ip6", ETHERTYPE_IPV6 },
573573
{ "lat", ETHERTYPE_LAT },
574+
{ "lldp", ETHERTYPE_LLDP },
574575
{ "loopback", ETHERTYPE_LOOPBACK },
575576
{ "mopdl", ETHERTYPE_MOPDL },
576577
{ "moprc", ETHERTYPE_MOPRC },
577578
{ "rarp", ETHERTYPE_REVARP },
578579
{ "sca", ETHERTYPE_SCA },
580+
{ "slow", ETHERTYPE_SLOW },
579581
{ (char *)0, 0 }
580582
};
581583

0 commit comments

Comments
 (0)