// GetTCPTraffic separates all the TCP traffic in the slice of pkt.Packet into
// their respective flows.  The resulting map of TCPFlow are keyed by the string
// of their TCPTuple.
GetTCPTraffic separates all the TCP traffic in the slice of pkt.Packet into
their respective flows.  The resulting map of TCPFlow are keyed by the string
of their TCPTuple.
// GetTCPTraffic separates all the TCP traffic in the slice of pkt . Packet into // their respective flows . The resulting map of TCPFlow are keyed by the string // of their TCPTuple .
func GetTCPTraffic(d []*pkt.Packet) map[string]*TCPFlow {
	m := make(map[string]*TCPFlow)
	var f *TCPFlow
	for i := range d {
		t, err := NewTCPTuple(d[i])
		if err != nil {
			continue
		}
		err = t.srcByPort(ServerSrcPort)
		if err != nil {
			continue
		}
		f = m[t.String()]
		if f == nil {
			f = &TCPFlow{
				TCPTuple:   t,
				SrcDataMap: make(map[uint32]*pkt.Packet),
				DstDataMap: make(map[uint32]*pkt.Packet),
			}
			m[t.String()] = f
		}
		_ = f.AddPacket(d[i])
	}
	return m
}
func GetTCPTraffic ( d [ ] * pkt . Packet ) map [ string ] * TCPFlow { m := make ( map [ string ] * TCPFlow ) var f * TCPFlow for i := range d { t , err := NewTCPTuple ( d [ i ] ) if err != nil { continue } err = t . srcByPort ( ServerSrcPort ) if err != nil { continue } f = m [ t . String ( ) ] if f == nil { f = & TCPFlow { TCPTuple : t , SrcDataMap : make ( map [ uint32 ] * pkt . Packet ) , DstDataMap : make ( map [ uint32 ] * pkt . Packet ) , } m [ t . String ( ) ] = f } _ = f . AddPacket ( d [ i ] ) } return m }
GetTCPTraffic separates all the TCP traffic in the slice of pkt.Packet into
their respective flows.
GetTCPTraffic separates all the TCP traffic in the slice of pkt . Packet into their respective flows .