summaryrefslogtreecommitdiff
path: root/print-dsa.c
Commit message (Collapse)AuthorAgeFilesLines
* DSA: Correctly determine VIDTobias Waldekranz2021-10-051-1/+1
| | | | | | | | | | | | | | The 4 MSBs of the VID is stored in the lower nibble of the tag's third byte. Previously the priority bits where folded into the VID space, e.g. a packet with VID=1 and priority 6 was printed as having a VID of 1537 (0x601). Add DSA test PCAPs with packets containing a high VID and non-zero FPri values to make sure we catch any future regressions. Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
* Rework "Update more link-layer dissectors to void functions"Francois-Xavier Le Bail2020-08-061-4/+4
| | | | | | | | | | It's a follow-up to commit 81dbf4a0b05092760d0ff0cdd48c692e4769ba99. 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.
* Update more link-layer dissectors to void functionsFrancois-Xavier Le Bail2020-07-151-6/+6
| | | | | | | | | | | | | | | | | | | | | | 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.
* Ethernet: Rename a printerFrancois-Xavier Le Bail2020-03-081-2/+2
| | | | | Rename ether_print_switch_tag() to ether_switch_tag_print(), with _print suffix like in most similar cases.
* Fix trailing spacesFrancois-Xavier Le Bail2019-05-231-1/+1
|
* Handle switch tags more cleanly.Guy Harris2019-04-231-85/+57
| | | | | | | | | | | | | | | | | | | 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.
* Clean up the switch-tagged header code.Guy Harris2019-04-201-10/+22
| | | | | | | | | | | | | 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.
* Use GET macros to fetch packet data.Guy Harris2019-04-161-1/+1
|
* Add support for decoding Marvell (E)DSA tagsVivien Didelot2019-04-161-0/+235
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.