diff --git a/tap/api/api.go b/tap/api/api.go index 64dbb8f4e..72986a1a9 100644 --- a/tap/api/api.go +++ b/tap/api/api.go @@ -110,7 +110,7 @@ type SuperTimer struct { CaptureTime time.Time } -type SuperIdentifier struct { +type ProtoIdentifier struct { Protocol *Protocol IsClosedOthers bool } diff --git a/tap/api/tcp_stream.go b/tap/api/tcp_stream.go index 16fb01fac..eb61ca67f 100644 --- a/tap/api/tcp_stream.go +++ b/tap/api/tcp_stream.go @@ -19,7 +19,7 @@ import ( type TcpStream struct { Id int64 isClosed bool - SuperIdentifier *SuperIdentifier + ProtoIdentifier *ProtoIdentifier TcpState *reassembly.TCPSimpleFSM fsmerr bool Optchecker reassembly.TCPOptionCheck @@ -181,24 +181,24 @@ func (t *TcpStream) Close() { } func (t *TcpStream) CloseOtherProtocolDissectors(protocol *Protocol) { - if t.SuperIdentifier.IsClosedOthers { + if t.ProtoIdentifier.IsClosedOthers { return } - t.SuperIdentifier.Protocol = protocol + t.ProtoIdentifier.Protocol = protocol for i := range t.Clients { reader := &t.Clients[i] - if reader.Extension.Protocol != t.SuperIdentifier.Protocol { + if reader.Extension.Protocol != t.ProtoIdentifier.Protocol { reader.Close() } } for i := range t.Servers { reader := &t.Servers[i] - if reader.Extension.Protocol != t.SuperIdentifier.Protocol { + if reader.Extension.Protocol != t.ProtoIdentifier.Protocol { reader.Close() } } - t.SuperIdentifier.IsClosedOthers = true + t.ProtoIdentifier.IsClosedOthers = true } diff --git a/tap/extensions/amqp/main.go b/tap/extensions/amqp/main.go index 2fb3a3f17..1eefe2662 100644 --- a/tap/extensions/amqp/main.go +++ b/tap/extensions/amqp/main.go @@ -76,7 +76,7 @@ func (d dissecting) Dissect(b *bufio.Reader, reader *api.TcpReader, options *sha var lastMethodFrameMessage Message for { - if reader.Parent.SuperIdentifier.Protocol != nil && reader.Parent.SuperIdentifier.Protocol != &protocol { + if reader.Parent.ProtoIdentifier.Protocol != nil && reader.Parent.ProtoIdentifier.Protocol != &protocol { return errors.New("Identified by another protocol") } diff --git a/tap/extensions/amqp/main_test.go b/tap/extensions/amqp/main_test.go index 5b5c51618..e68cb8796 100644 --- a/tap/extensions/amqp/main_test.go +++ b/tap/extensions/amqp/main_test.go @@ -108,7 +108,7 @@ func TestDissect(t *testing.T) { Request: 0, Response: 0, } - superIdentifier := &api.SuperIdentifier{} + protoIdentifier := &api.ProtoIdentifier{} // Request pathClient := _path @@ -128,7 +128,7 @@ func TestDissect(t *testing.T) { Progress: &api.ReadProgress{}, Parent: &api.TcpStream{ Origin: api.Pcap, - SuperIdentifier: superIdentifier, + ProtoIdentifier: protoIdentifier, }, IsClient: true, TcpID: tcpIDClient, @@ -158,7 +158,7 @@ func TestDissect(t *testing.T) { Progress: &api.ReadProgress{}, Parent: &api.TcpStream{ Origin: api.Pcap, - SuperIdentifier: superIdentifier, + ProtoIdentifier: protoIdentifier, }, IsClient: false, TcpID: tcpIDServer, diff --git a/tap/extensions/http/main.go b/tap/extensions/http/main.go index 187735275..156e3ab54 100644 --- a/tap/extensions/http/main.go +++ b/tap/extensions/http/main.go @@ -117,7 +117,7 @@ func (d dissecting) Dissect(b *bufio.Reader, reader *api.TcpReader, options *sha http2Assembler = createHTTP2Assembler(b) } - if reader.Parent.SuperIdentifier.Protocol != nil && reader.Parent.SuperIdentifier.Protocol != &http11protocol { + if reader.Parent.ProtoIdentifier.Protocol != nil && reader.Parent.ProtoIdentifier.Protocol != &http11protocol { return errors.New("Identified by another protocol") } @@ -173,7 +173,7 @@ func (d dissecting) Dissect(b *bufio.Reader, reader *api.TcpReader, options *sha } } - if reader.Parent.SuperIdentifier.Protocol == nil { + if reader.Parent.ProtoIdentifier.Protocol == nil { return err } diff --git a/tap/extensions/http/main_test.go b/tap/extensions/http/main_test.go index 9da02029c..793c0b8d5 100644 --- a/tap/extensions/http/main_test.go +++ b/tap/extensions/http/main_test.go @@ -110,7 +110,7 @@ func TestDissect(t *testing.T) { Request: 0, Response: 0, } - superIdentifier := &api.SuperIdentifier{} + protoIdentifier := &api.ProtoIdentifier{} // Request pathClient := _path @@ -130,7 +130,7 @@ func TestDissect(t *testing.T) { Progress: &api.ReadProgress{}, Parent: &api.TcpStream{ Origin: api.Pcap, - SuperIdentifier: superIdentifier, + ProtoIdentifier: protoIdentifier, }, IsClient: true, TcpID: tcpIDClient, @@ -160,7 +160,7 @@ func TestDissect(t *testing.T) { Progress: &api.ReadProgress{}, Parent: &api.TcpStream{ Origin: api.Pcap, - SuperIdentifier: superIdentifier, + ProtoIdentifier: protoIdentifier, }, IsClient: false, TcpID: tcpIDServer, diff --git a/tap/extensions/kafka/main.go b/tap/extensions/kafka/main.go index 71d31680d..d527095cb 100644 --- a/tap/extensions/kafka/main.go +++ b/tap/extensions/kafka/main.go @@ -39,7 +39,7 @@ func (d dissecting) Ping() { func (d dissecting) Dissect(b *bufio.Reader, reader *api.TcpReader, options *shared.TrafficFilteringOptions) error { reqResMatcher := reader.ReqResMatcher.(*requestResponseMatcher) for { - if reader.Parent.SuperIdentifier.Protocol != nil && reader.Parent.SuperIdentifier.Protocol != &_protocol { + if reader.Parent.ProtoIdentifier.Protocol != nil && reader.Parent.ProtoIdentifier.Protocol != &_protocol { return errors.New("Identified by another protocol") } diff --git a/tap/extensions/kafka/main_test.go b/tap/extensions/kafka/main_test.go index ef30267d5..0ba54f5b8 100644 --- a/tap/extensions/kafka/main_test.go +++ b/tap/extensions/kafka/main_test.go @@ -108,7 +108,7 @@ func TestDissect(t *testing.T) { Request: 0, Response: 0, } - superIdentifier := &api.SuperIdentifier{} + protoIdentifier := &api.ProtoIdentifier{} // Request pathClient := _path @@ -129,7 +129,7 @@ func TestDissect(t *testing.T) { Progress: &api.ReadProgress{}, Parent: &api.TcpStream{ Origin: api.Pcap, - SuperIdentifier: superIdentifier, + ProtoIdentifier: protoIdentifier, }, IsClient: true, TcpID: tcpIDClient, @@ -159,7 +159,7 @@ func TestDissect(t *testing.T) { Progress: &api.ReadProgress{}, Parent: &api.TcpStream{ Origin: api.Pcap, - SuperIdentifier: superIdentifier, + ProtoIdentifier: protoIdentifier, }, IsClient: false, TcpID: tcpIDServer, diff --git a/tap/extensions/redis/main_test.go b/tap/extensions/redis/main_test.go index 4231d1841..289fbbe2e 100644 --- a/tap/extensions/redis/main_test.go +++ b/tap/extensions/redis/main_test.go @@ -109,7 +109,7 @@ func TestDissect(t *testing.T) { Request: 0, Response: 0, } - superIdentifier := &api.SuperIdentifier{} + protoIdentifier := &api.ProtoIdentifier{} // Request pathClient := _path @@ -129,7 +129,7 @@ func TestDissect(t *testing.T) { Progress: &api.ReadProgress{}, Parent: &api.TcpStream{ Origin: api.Pcap, - SuperIdentifier: superIdentifier, + ProtoIdentifier: protoIdentifier, }, IsClient: true, TcpID: tcpIDClient, @@ -159,7 +159,7 @@ func TestDissect(t *testing.T) { Progress: &api.ReadProgress{}, Parent: &api.TcpStream{ Origin: api.Pcap, - SuperIdentifier: superIdentifier, + ProtoIdentifier: protoIdentifier, }, IsClient: false, TcpID: tcpIDServer, diff --git a/tap/tcp_stream_factory.go b/tap/tcp_stream_factory.go index 5e86d977e..2580027d2 100644 --- a/tap/tcp_stream_factory.go +++ b/tap/tcp_stream_factory.go @@ -65,7 +65,7 @@ func (factory *tcpStreamFactory) New(net, transport gopacket.Flow, tcp *layers.T TcpState: reassembly.NewTCPSimpleFSM(fsmOptions), Ident: fmt.Sprintf("%s:%s", net, transport), Optchecker: reassembly.NewTCPOptionCheck(), - SuperIdentifier: &api.SuperIdentifier{}, + ProtoIdentifier: &api.ProtoIdentifier{}, StreamsMap: factory.streamsMap, Origin: getPacketOrigin(ac), } diff --git a/tap/tlstapper/tls_poller.go b/tap/tlstapper/tls_poller.go index dffce5118..8e4d6411a 100644 --- a/tap/tlstapper/tls_poller.go +++ b/tap/tlstapper/tls_poller.go @@ -170,7 +170,7 @@ func dissect(extension *api.Extension, reader *tlsReader, isRequest bool, tcpid Progress: reader.progress, Parent: &api.TcpStream{ Origin: api.Ebpf, - SuperIdentifier: &api.SuperIdentifier{}, + ProtoIdentifier: &api.ProtoIdentifier{}, }, IsClient: isRequest, TcpID: tcpid,