Linux Kernel Network Programming - struct tcphdr data-structure - code walk, Example
Linux Kernel Network Programming - struct tcphdr data-structure - code walk, Example

Refer:
struct tcphdr data-structure ↗
sk_buff to tcphdr APIs ↗
Definitions for the TCP module ↗

And here is the copy paste of struct tcp data-structure (/include/uapi/linux/tcp.h) from the Kernel-source version 4.13 for quick reference:

struct tcphdr {
	__be16	source;
	__be16	dest;
	__be32	seq;
	__be32	ack_seq;
#if defined(__LITTLE_ENDIAN_BITFIELD)
	__u16	res1:4,
		doff:4,
		fin:1,
		syn:1,
		rst:1,
		psh:1,
		ack:1,
		urg:1,
		ece:1,
		cwr:1;
#elif defined(__BIG_ENDIAN_BITFIELD)
	__u16	doff:4,
		res1:4,
		cwr:1,
		ece:1,
		urg:1,
		ack:1,
		psh:1,
		rst:1,
		syn:1,
		fin:1;
#else
#error	"Adjust your  defines"
#endif	
	__be16	window;
	__sum16	check;
	__be16	urg_ptr;
};