add struct tcphdr in netinet/tcp.h
This commit is contained in:
parent
f7bc29ed22
commit
09b2995bcb
1 changed files with 33 additions and 0 deletions
|
|
@ -31,6 +31,39 @@
|
||||||
#define SOL_TCP 6
|
#define SOL_TCP 6
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <endian.h>
|
||||||
|
|
||||||
|
struct tcphdr
|
||||||
|
{
|
||||||
|
u_int16_t source;
|
||||||
|
u_int16_t dest;
|
||||||
|
u_int32_t seq;
|
||||||
|
u_int32_t ack_seq;
|
||||||
|
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||||
|
u_int16_t res1:4;
|
||||||
|
u_int16_t doff:4;
|
||||||
|
u_int16_t fin:1;
|
||||||
|
u_int16_t syn:1;
|
||||||
|
u_int16_t rst:1;
|
||||||
|
u_int16_t psh:1;
|
||||||
|
u_int16_t ack:1;
|
||||||
|
u_int16_t urg:1;
|
||||||
|
u_int16_t res2:2;
|
||||||
|
#else
|
||||||
|
u_int16_t doff:4;
|
||||||
|
u_int16_t res1:4;
|
||||||
|
u_int16_t res2:2;
|
||||||
|
u_int16_t urg:1;
|
||||||
|
u_int16_t ack:1;
|
||||||
|
u_int16_t psh:1;
|
||||||
|
u_int16_t rst:1;
|
||||||
|
u_int16_t syn:1;
|
||||||
|
u_int16_t fin:1;
|
||||||
|
#endif
|
||||||
|
u_int16_t window;
|
||||||
|
u_int16_t check;
|
||||||
|
u_int16_t urg_ptr;
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue