-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Better support for the len type #75
Comments
|
2 can be resolved by adding a few special types: |
3 can be resolved by adding a few more types: |
Bitfields (#72), |
Allow to use
len
to denote the length of any other field of the same struct, not just forbuffer/vma/arrayptr
fields.Sometimes one of the fields in a struct denotes not the length of the entire struct or the length of some particular field in bytes, but the length in 32-bit words of the length of a few fields. Not sure exactly how to support that, maybe by adding a support of some simple arithmetic for the
len
type, along the lines ofsizeof(field1) / 4
.A few examples:
IPv4 packets (https://en.wikipedia.org/wiki/IPv4#Header) contain
IHL
field, which is "the number of 32-bit words in the header" (the header is variable in size). More over there is aTotal Length
field, which "defines the entire packet size, including header and data, in bytes".Some IPv6 extension headers (https://en.wikipedia.org/wiki/IPv6_packet#Hop-by-hop_options_and_destination_options) contain
Hdr Ext Len
fields, which is the "length of this header in 8-octet units, not including the first 8 octets" (octet == byte).The text was updated successfully, but these errors were encountered: