Skip to content

Instantly share code, notes, and snippets.

@jozadaquebatista
Last active August 11, 2016 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jozadaquebatista/a3f36dbfcd3fc4cfef01ac33858e4e1f to your computer and use it in GitHub Desktop.
Save jozadaquebatista/a3f36dbfcd3fc4cfef01ac33858e4e1f to your computer and use it in GitHub Desktop.
/* [ TCP header ]
============ */
struct set {
uint8_t data_offset:(1<<2);
uint8_t reserved:(3<<1);
_Bool urg;
_Bool ack;
_Bool psh;
_Bool rst;
_Bool syn;
_Bool fin;
uint16_t window_s;
};
struct tcp_H {
uint16_t src_number;
uint16_t dst_number;
uint32_t seq_number;
uint32_t ack_number;
struct set setup;
char chk_sum[0xf];
char urgent_pointer[0xf];
uint8_t options:((1<<5)-(1<<3));
uint8_t padding;
char data[1<<5];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment