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

Consider using "struct" from the standard library #1

Open
ic-it opened this issue Jan 28, 2024 · 0 comments
Open

Consider using "struct" from the standard library #1

ic-it opened this issue Jan 28, 2024 · 0 comments

Comments

@ic-it
Copy link
Owner

ic-it commented Jan 28, 2024

https://docs.python.org/3/library/struct.html

Using this library, we can easily describe structures like this one:

    typedef struct pcap_hdr_s {
            guint32 magic_number;   /* magic number */
            guint16 version_major;  /* major version number */
            guint16 version_minor;  /* minor version number */
            gint32  thiszone;       /* GMT to local correction */
            guint32 sigfigs;        /* accuracy of timestamps */
            guint32 snaplen;        /* max length of captured packets, in octets */
            guint32 network;        /* data link type */
    } pcap_hdr_t;

Code from wiki.wireshark.org

@ic-it ic-it self-assigned this Jan 28, 2024
@ic-it ic-it removed their assignment Mar 26, 2024
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