Skip to content

Commit 1ee538f

Browse files
committed
NETOBSERV-1890: expand TCP flags as string in FLP
1 parent 766dee5 commit 1ee538f

File tree

8 files changed

+47
-19
lines changed

8 files changed

+47
-19
lines changed

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

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -815,21 +815,9 @@ filters:
815815
- id: tcp_flags
816816
name: TCP flags
817817
component: autocomplete
818-
hint: Specify a TCP flags value as integer number.
818+
hint: Specify a TCP flags value.
819819
examples: |-
820-
Logical OR combination of unique TCP flags comprised in the flow, as per RFC-9293, with additional custom flags
821-
users can specify either numeric value or string representation of the flags as follows :
822-
- FIN or 1,
823-
- SYN or 2,
824-
- RST or 4,
825-
- PSH or 8,
826-
- ACK or 16,
827-
- URG or 32,
828-
- ECE or 64,
829-
- CWR or 128,
830-
- SYN_ACK or 256,
831-
- FIN_ACK or 512,
832-
- RST_ACK or 1024,
820+
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).
833821
- id: node_direction
834822
name: Node Direction
835823
component: autocomplete
@@ -1022,7 +1010,7 @@ fields:
10221010
type: string
10231011
description: Network interfaces
10241012
- name: Flags
1025-
type: number
1013+
type: string
10261014
description: |
10271015
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: +
10281016
- SYN+ACK (0x100) +

controllers/flp/flp_pipeline_builder.go

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

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,5 @@ require (
8888
)
8989

9090
replace github.com/prometheus/common v0.55.0 => github.com/netobserv/prometheus-common v0.55.0-netobserv
91+
92+
replace github.com/netobserv/flowlogs-pipeline => ../flowlogs-pipeline

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq
8888
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
8989
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU=
9090
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
91-
github.com/netobserv/flowlogs-pipeline v1.6.1-crc0.0.20240920063618-2ea1a7ce77b8 h1:Wumfysno927/yCK8RAG/1AtTDpQQzSn9PkoGBLu2Khk=
92-
github.com/netobserv/flowlogs-pipeline v1.6.1-crc0.0.20240920063618-2ea1a7ce77b8/go.mod h1:VVHQK3sEL91gl6CQkrcE+RAi9vMat5gaVaZLqPDoKlQ=
9391
github.com/netobserv/prometheus-common v0.55.0-netobserv h1:Fapr74g0S3gRh/kTTyv9Ytm4DJJfFuUTEToiU/np9eg=
9492
github.com/netobserv/prometheus-common v0.55.0-netobserv/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8=
9593
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: 2 additions & 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.6.1-crc0.0.20240920063618-2ea1a7ce77b8
126+
# github.com/netobserv/flowlogs-pipeline v1.6.1-crc0.0.20240920063618-2ea1a7ce77b8 => ../flowlogs-pipeline
127127
## explicit; go 1.22.3
128128
github.com/netobserv/flowlogs-pipeline/pkg/api
129129
github.com/netobserv/flowlogs-pipeline/pkg/config
@@ -901,3 +901,4 @@ sigs.k8s.io/structured-merge-diff/v4/value
901901
## explicit; go 1.12
902902
sigs.k8s.io/yaml
903903
sigs.k8s.io/yaml/goyaml.v2
904+
# github.com/netobserv/flowlogs-pipeline => ../flowlogs-pipeline

0 commit comments

Comments
 (0)