Skip to content

Commit 56303a1

Browse files
authored
NETOBSERV-1890: expand TCP flags as string in FLP (#833)
1 parent 5442201 commit 56303a1

File tree

8 files changed

+47
-20
lines changed

8 files changed

+47
-20
lines changed

controllers/consoleplugin/config/static-frontend-config.yaml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -814,21 +814,9 @@ filters:
814814
- id: tcp_flags
815815
name: TCP flags
816816
component: autocomplete
817-
hint: Specify a TCP flags value as integer number.
817+
hint: Specify a TCP flags value.
818818
examples: |-
819-
Logical OR combination of unique TCP flags comprised in the flow, as per RFC-9293, with additional custom flags
820-
users can specify either numeric value or string representation of the flags as follows :
821-
- FIN or 1,
822-
- SYN or 2,
823-
- RST or 4,
824-
- PSH or 8,
825-
- ACK or 16,
826-
- URG or 32,
827-
- ECE or 64,
828-
- CWR or 128,
829-
- SYN_ACK or 256,
830-
- FIN_ACK or 512,
831-
- RST_ACK or 1024,
819+
Logical OR combination of unique TCP flags comprised in the flow, as per RFC-9293, with additional custom flags (SYN_ACK, FIN_ACK and RST_ACK).
832820
- id: node_direction
833821
name: Node Direction
834822
component: autocomplete
@@ -1142,7 +1130,7 @@ fields:
11421130
type: string
11431131
description: Network interfaces
11441132
- name: Flags
1145-
type: number
1133+
type: string
11461134
description: |
11471135
Logical OR combination of unique TCP flags comprised in the flow, as per RFC-9293, with additional custom flags to represent the following per-packet combinations: +
11481136
- SYN+ACK (0x100) +

controllers/flp/flp_pipeline_builder.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ func (b *PipelineBuilder) AddProcessorStages() error {
9292
{
9393
Type: api.NetworkReinterpretDirection,
9494
},
95+
{
96+
Type: api.NetworkDecodeTCPFlags,
97+
DecodeTCPFlags: &api.NetworkGenericRule{
98+
Input: "Flags",
99+
Output: "Flags",
100+
},
101+
},
95102
{
96103
Type: api.NetworkAddKubernetesInfra,
97104
KubernetesInfra: &api.K8sInfraRule{

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/coreos/go-semver v0.3.1
99
github.com/go-logr/logr v1.4.2
1010
github.com/google/go-cmp v0.6.0
11-
github.com/netobserv/flowlogs-pipeline v1.7.0-community.0.20241126083919-0fa789ce0e58
11+
github.com/netobserv/flowlogs-pipeline v1.7.0-community.0.20241126155124-18e017f67001
1212
github.com/onsi/ginkgo/v2 v2.20.2
1313
github.com/onsi/gomega v1.35.1
1414
github.com/openshift/api v0.0.0-20240722135205-ae4f370f361f

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq
8383
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
8484
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU=
8585
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
86-
github.com/netobserv/flowlogs-pipeline v1.7.0-community.0.20241126083919-0fa789ce0e58 h1:wfk7Sl0rMoDqfUgvfwlStCGXtIgrtwo4h2LDEGGjgrs=
87-
github.com/netobserv/flowlogs-pipeline v1.7.0-community.0.20241126083919-0fa789ce0e58/go.mod h1:wnCpWttAFkLSSxOcfCkd9zA5pwV/1OcxS5tAfAxNWEc=
86+
github.com/netobserv/flowlogs-pipeline v1.7.0-community.0.20241126155124-18e017f67001 h1:Hb5RxMfFafng2+QbnkiEWTS4TUUz7zcpUS8RiauzWXw=
87+
github.com/netobserv/flowlogs-pipeline v1.7.0-community.0.20241126155124-18e017f67001/go.mod h1:wnCpWttAFkLSSxOcfCkd9zA5pwV/1OcxS5tAfAxNWEc=
8888
github.com/netobserv/prometheus-common v0.55.0-netobserv h1:Fapr74g0S3gRh/kTTyv9Ytm4DJJfFuUTEToiU/np9eg=
8989
github.com/netobserv/prometheus-common v0.55.0-netobserv/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8=
9090
github.com/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4=

pkg/helper/cardinality/cardinality.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"FlowDirection": "fine",
3636
"IfDirections": "fine",
3737
"Interfaces": "careful",
38-
"Flags": "fine",
38+
"Flags": "careful",
3939
"Bytes": "avoid",
4040
"Packets": "avoid",
4141
"PktDropBytes": "avoid",

vendor/github.com/netobserv/flowlogs-pipeline/pkg/api/transform_network.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/netobserv/flowlogs-pipeline/pkg/utils/tcp_flags.go

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ github.com/munnerz/goautoneg
123123
# github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f
124124
## explicit
125125
github.com/mwitkow/go-conntrack
126-
# github.com/netobserv/flowlogs-pipeline v1.7.0-community.0.20241126083919-0fa789ce0e58
126+
# github.com/netobserv/flowlogs-pipeline v1.7.0-community.0.20241126155124-18e017f67001
127127
## explicit; go 1.22.3
128128
github.com/netobserv/flowlogs-pipeline/pkg/api
129129
github.com/netobserv/flowlogs-pipeline/pkg/config

0 commit comments

Comments
 (0)