Skip to content

Commit

Permalink
LINKTYPE_CAN_SOCKETCAN: make the priority/VCID field big-endian.
Browse files Browse the repository at this point in the history
This is for historical and compatibility reasons.  Yes, some fields in
the CAN XL header are big-endian and some are little-endian; this is a
mess, but fixing it would cause problems reading older captures.

Fix the description of the Acceptance Field to indicate that it's
little-endian.
  • Loading branch information
guyharris committed Feb 12, 2024
1 parent 7ac9196 commit 9c357d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 4 additions & 5 deletions htmlsrc/linktypes/LINKTYPE_CAN_SOCKETCAN.html
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,12 @@ <h4>Packet structure</h4>

<h4>Description</h4>
<p>
<em>Multi-byte integral-valued fields in this header are
little-endian, not big-endian as they are for fields in the classic CAN
and CAN FD header.</em>
<em>The Priority ID/VCID field is big-endian, but the payload length and
acceptance field are little-endian.</em>
</p>

<p>
The Prioritiy ID/VCID field is in little-endian byte order.
The Prioritiy ID/VCID field is in big-endian byte order.
The bottom 11 bits contain the priority of the frame. The 5 bits above
that are reserved. The 8 bits above that contain a virtual CAN
network identifier (VCID). The 8 bits above that are reserved.
Expand Down Expand Up @@ -225,7 +224,7 @@ <h4>Description</h4>
</p>

<p>
The Acceptance Field is in network byte order (big-endian).
The Acceptance Field is in little-endian byte order.
</p>
</div>
<!-- End of LINKTYPE_CAN_SOCKETCAN section -->
Expand Down
9 changes: 4 additions & 5 deletions linktypes/LINKTYPE_CAN_SOCKETCAN.html
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,12 @@ <h4>Packet structure</h4>

<h4>Description</h4>
<p>
<em>Multi-byte integral-valued fields in this header are
little-endian, not big-endian as they are for fields in the classic CAN
and CAN FD header.</em>
<em>The Priority ID/VCID field is big-endian, but the payload length and
acceptance field are little-endian.</em>
</p>

<p>
The Prioritiy ID/VCID field is in little-endian byte order.
The Prioritiy ID/VCID field is in big-endian byte order.
The bottom 11 bits contain the priority of the frame. The 5 bits above
that are reserved. The 8 bits above that contain a virtual CAN
network identifier (VCID). The 8 bits above that are reserved.
Expand Down Expand Up @@ -269,7 +268,7 @@ <h4>Description</h4>
</p>

<p>
The Acceptance Field is in network byte order (big-endian).
The Acceptance Field is in little-endian byte order.
</p>
</div>
<!-- End of LINKTYPE_CAN_SOCKETCAN section -->
Expand Down

0 comments on commit 9c357d9

Please sign in to comment.