Help understanding linux/tcp.h
Posted
by Chris
on Stack Overflow
See other posts from Stack Overflow
or by Chris
Published on 2010-03-20T20:11:21Z
Indexed on
2010/03/20
20:21 UTC
Read the original article
Hit count: 319
I'm learning to use raw sockets, and im trying to prase out the tcp header data, but i can't seem to figure out what res1, ece, and cwr are. Through my networking book and google i know what the rest stand for, but can't seem to find anything on those three. Below is the tcphdr struct in my includes area. Ive commented the parts a bit as i was figureing out what they stood for.
struct tcphdr {
__be16 source;
__be16 dest;
__be32 seq;
__be32 ack_seq;
#if defined(__LITTLE_ENDIAN_BITFIELD)
_u16 res1:4,
doff:4,//tcp header length
fin:1,//final
syn:1,//synchronization
rst:1,//reset
psh:1,//push
ack:1,//ack
urg:1,// urge
ece:1,
cwr:1;
#elif defined(_BIG_ENDIAN_BITFIELD)
__u16 doff:4,//tcp header length
res1:4,
cwr:1,
ece:1,
urg:1,//urge
ack:1,//ack
psh:1,//push
rst:1,//reset
syn:1,//synchronization
fin:1;//final
#else
#error "Adjust your defines"
#endif
__be16 window;
__sum16 check;
__be16 urg_ptr;
};
© Stack Overflow or respective owner