Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICMP.3d specifies unused bytes instead of bits #103

Closed
Smfakhoury opened this issue Oct 9, 2023 · 0 comments
Closed

ICMP.3d specifies unused bytes instead of bits #103

Smfakhoury opened this issue Oct 9, 2023 · 0 comments

Comments

@Smfakhoury
Copy link

The ICMP specification indicates that there should be a number of unused bits for some messages.

Screenshot 2023-10-06 at 4 30 31 PM

The number of unused bits vary:

  • Destination Unreachable Message: 32 bits
  • Time Exceeded Message: 32 bits
  • Parameter Problem Message: 24 bits
  • Source Quench Message: 32 bits

The current ICMP.3d spec specifies these as byte fields not bit fields:

typedef struct _UNUSED_BYTES (UINT32 len)
{
    ZeroByte    Bytes[len];
} UNUSED_BYTES;

For example in parameter problem:

typedef struct _PARAMETER_PROBLEM_MESSAGE
{
    UINT8                     Code
    {
        Code == 0
    };
    UINT16BE                  Checksum;
    UINT8                     Pointer;  //Valid only if code is 0, is there something to check?
    UNUSED_BYTES(24)          Unused;
    IP_HEADER_AND_DATAGRAM    OriginalMsg;
} PARAMETER_PROBLEM_MESSAGE;

Or in Source quench:

typedef struct _SOURCE_QUENCH_MESSAGE
{
    UINT8                     Code
    {
        Code == 0
    };
    UINT16BE                  Checksum;
    UNUSED_BYTES(32)          Unused;
    IP_HEADER_AND_DATAGRAM    OriginalMsg;
} SOURCE_QUENCH_MESSAGE;

The 3d code could be modified to:

typedef struct _SOURCE_QUENCH_MESSAGE
{
...
    UINT32BE          Unused;
....
} 

And

typedef struct _PARAMETER_PROBLEM_MESSAGE
{
...
    UINT8          Unused[3]; 
....
} 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant