It's a follow-up to commit 81dbf4a0b0.
There is no need to update ether_print(), ether_common_print() and
ether_switch_tag_print() to void functions: back to u_int functions.
There is also no need to add a flag parameter to ether_print(),
ether_common_print() and ether_switch_tag_print(): Remove it.
brcm_tag_if_print()
brcm_tag_prepend_if_print()
dsa_if_print()
edsa_if_print()
ether_if_print()
netanalyzer_if_print()
netanalyzer_transparent_if_print()
Update ether_print(), ether_common_print() and ether_switch_tag_print()
to void functions.
Add a flag parameter to ether_print(), ether_common_print() and
ether_switch_tag_print() to increment the link-layer header length field
of the netdissect_options when needed.
The calls use TRUE when the return value of the funtions was used.
The calls with FALSE avoid increments when the calls are nested.
Moreover:
Remove trailing "_if" from some protocol names.
Have the switch tag dissectors handle *only* the switch tag, not
anything else in the Ethernet header.
Have a routine ether_print_switch_tag() that takes a pointer to a
routine to dissect the switch tag, and a switch tag length, as an
argument, and have a common Ethernet dissection routine called by
ether_print_switch_tag() and by ether_print(), passing a null pointer
for the switch tag dissector and 0 for the switch tag length.
Dissect the switch tag after the MAC addresses, if there's a non-null
switch tag routine dissector pointer.
Clean up the processing logic in the common Ethernet dissection code -
have a loop to process VLAN tags, if any, and, when it's done, handle
frames with a length field, frames with a regular type field, and Alteon
jumbo frames.
Use MAC_ADDR_LEN in expressions representing offsets and lengths.
Don't declare the Ethernet header structure ourselves in the Broadcom
code, just print it the same way it's printed in the Marvell code. Make
the two routines similar in other places as well.
Use "Unknown" rather than "unregistered" when printing the Ethernet type
field in the EDSA header - the value may well be registered even if it's
not in ethertype_values, it's just not a value we happen to have in that
table.
Similarly to commit 6eaebfe adding support for the Broadcom tagging
format supported by the DSA kernel subsystem, this commit adds support
for the Marvell DSA and Ethertype DSA (EDSA) tagging formats.
Marvell DSA is a 4-byte proprietary tag placed between the ether source
address and the ether length/type. It contains data such as the switch
device and port IDs from which a frame came from, or to which port
a frame is targetting. It also contains additional FPri and IEEE bits.
EDSA is a 8-byte variant including a programmable ethertype, two null
bytes and a standard DSA tag.