// Make sure that we can properly parse a C TCP header.
Make sure that we can properly parse a C TCP header.
// Make sure that we can properly parse a C TCP header .
func TestNewTcpHdr(t *testing.T) {
	g := goTcpTestHeader
	c, _ := NewTcpHdr(cTcpTestHeader)
	if c.Source != g.Source {
		t.Errorf("c.Source (%d) != g.Source (%d)", c.Source, g.Source)
	}
	if c.Dest != g.Dest {
		t.Errorf("c.Dest (%d) != g.Dest (%d)", c.Dest, g.Dest)
	}
	if c.Seq != g.Seq {
		t.Errorf("c.Seq (%d) != g.Seq (%d)", c.Seq, g.Seq)
	}
	if c.AckSeq != g.AckSeq {
		t.Errorf("c.AckSeq (%d) != g.AckSeq (%d)", c.AckSeq, g.AckSeq)
	}
	if c.Doff != g.Doff {
		t.Errorf("c.Doff (%d) != g.Doff (%d)", c.Doff, g.Doff)
	}
	if c.Flags != g.Flags {
		t.Errorf("c.Flags (%d) != g.Flags (%d)", c.Flags, g.Flags)
	}
	if c.Window != g.Window {
		t.Errorf("c.Window (%d) != g.Window (%d)", c.Window, g.Window)
	}
	if c.Check != g.Check {
		t.Errorf("c.Check (%d) != g.Check (%d)", c.Check, g.Check)
	}
	if c.UrgPtr != g.UrgPtr {
		t.Errorf("c.UrgPtr (%d) != g.UrgPtr (%d)", c.UrgPtr, g.UrgPtr)
	}
}
func TestNewTcpHdr ( t * testing . T ) { g := goTcpTestHeader c , _ := NewTcpHdr ( cTcpTestHeader ) if c . Source != g . Source { t . Errorf ( " " , c . Source , g . Source ) } if c . Dest != g . Dest { t . Errorf ( " " , c . Dest , g . Dest ) } if c . Seq != g . Seq { t . Errorf ( " " , c . Seq , g . Seq ) } if c . AckSeq != g . AckSeq { t . Errorf ( " " , c . AckSeq , g . AckSeq ) } if c . Doff != g . Doff { t . Errorf ( " " , c . Doff , g . Doff ) } if c . Flags != g . Flags { t . Errorf ( " " , c . Flags , g . Flags ) } if c . Window != g . Window { t . Errorf ( " " , c . Window , g . Window ) } if c . Check != g . Check { t . Errorf ( " " , c . Check , g . Check ) } if c . UrgPtr != g . UrgPtr { t . Errorf ( " " , c . UrgPtr , g . UrgPtr ) } }
Make sure that we can properly parse a C TCP header.
Make sure that we can properly parse a C TCP header .