-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
4e37e51
commit 4f91d6a
Showing
2 changed files
with
105 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4f91d6a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 159
case 0x07: ##! Initialize Available To Network
has wrong comment. The packets with 6 and higher are practically vestigial, and mostly did not see industry-adoption, so as to be not worthy of anything more than appearing in comments, and maybe enumeration text-strings, but here are the accurate ones which have been defined.
X'12' and X'13' are seeing adoption. What seeing them should tell a protocol parser to do, is a subject worthy of its own ticket.
4f91d6a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha! Good thing it was only a comment. It'll get updated on the next round of commits, along with adding these new cases. If possible, could you provide insights into these other cases? Only 3 and 4 are covered as of now.
4f91d6a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In
the code also needs to advance
4f91d6a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The packet would be malformed if encoded transmitting a 1-byte network number, but
is not defensively coded against the possibility, and would access beyond the end of the buffer.
4f91d6a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The loop construct is the proper way to capture what is in the actual packet (after provisioning for the reason in 0x03 and for a potential malformed 1-octet final network number in all) for all of network_layer_message_type == 0x00 through 0x05. This additionally gives an excellent opportunity for our design to decide its architecture for weirdness. In addition to a 1-octet final network number being malformed, when the (network_layer_message_type == 0x03), then any content other than exactly one network number, is malformed. Note, however: when the (network_layer_message_type == 0x04) or the (network_layer_message_type == 0x05), then any content can be fewer or more than one network number (both situations are stipulated in the standard) and yet is still properly well-formed. For (network_layer_message_type == 0x00), then any content can be zero or one network number (both situations are stipulated in the standard) and yet is still properly well-formed. For (network_layer_message_type == 0x01), then any content can be one or more than one network number (both situations are stipulated in the standard) and yet is still properly well-formed. For (network_layer_message_type == 0x02), the content is required to be exactly one network number to be properly well-formed.
4f91d6a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 121/122
still haven't corrected per #12 comment: missed all the other 62 values which convey network_layer_messages. That should be:
I mention 62 rather than 126 other values which can convey network_layer_messages, only because bit 4 is reserved and is always zero.