Skip to content

Commit 3d68f8f

Browse files
authored
Add IPv6 support to PacketCapture (#7385)
This change extends PacketCapture to support IPv6 traffic alongside the existing IPv4 implementation. It also introduces ICMPv6 protocol support. Signed-off-by: Harsh Gupta <[email protected]>
1 parent 4f05458 commit 3d68f8f

File tree

18 files changed

+1468
-202
lines changed

18 files changed

+1468
-202
lines changed

build/charts/antrea/crds/packetcapture.yaml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ spec:
9292
type: string
9393
ip:
9494
type: string
95-
format: ipv4
95+
oneOf:
96+
- format: ipv4
97+
- format: ipv6
9698
destination:
9799
type: object
98100
x-kubernetes-validations:
@@ -111,13 +113,15 @@ spec:
111113
type: string
112114
ip:
113115
type: string
114-
format: ipv4
116+
oneOf:
117+
- format: ipv4
118+
- format: ipv6
115119
packet:
116120
type: object
117121
properties:
118122
ipFamily:
119123
type: string
120-
enum: [IPv4]
124+
enum: [IPv4, IPv6]
121125
default: IPv4
122126
protocol:
123127
x-kubernetes-int-or-string: true
@@ -177,9 +181,25 @@ spec:
177181
type: integer
178182
minimum: 0
179183
maximum: 255
184+
icmpv6:
185+
type: object
186+
properties:
187+
messages:
188+
type: array
189+
items:
190+
type: object
191+
required:
192+
- type
193+
properties:
194+
type:
195+
x-kubernetes-int-or-string: true
196+
code:
197+
type: integer
198+
minimum: 0
199+
maximum: 255
180200
x-kubernetes-validations:
181-
- rule: "(has(self.icmp) ? 1 : 0) + (has(self.udp) ? 1 : 0) + (has(self.tcp) ? 1: 0) <= 1"
182-
message: "At most one of 'icmp', 'udp', or 'tcp' may be set"
201+
- rule: "(has(self.icmp) ? 1 : 0) + (has(self.icmpv6) ? 1 : 0) + (has(self.udp) ? 1 : 0) + (has(self.tcp) ? 1: 0) <= 1"
202+
message: "At most one of 'ICMP', 'ICMPv6', 'UDP', or 'TCP' may be set"
183203
direction:
184204
type: string
185205
enum: ["SourceToDestination", "DestinationToSource", "Both"]

build/yamls/antrea-aks.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3125,7 +3125,9 @@ spec:
31253125
type: string
31263126
ip:
31273127
type: string
3128-
format: ipv4
3128+
oneOf:
3129+
- format: ipv4
3130+
- format: ipv6
31293131
destination:
31303132
type: object
31313133
x-kubernetes-validations:
@@ -3144,13 +3146,15 @@ spec:
31443146
type: string
31453147
ip:
31463148
type: string
3147-
format: ipv4
3149+
oneOf:
3150+
- format: ipv4
3151+
- format: ipv6
31483152
packet:
31493153
type: object
31503154
properties:
31513155
ipFamily:
31523156
type: string
3153-
enum: [IPv4]
3157+
enum: [IPv4, IPv6]
31543158
default: IPv4
31553159
protocol:
31563160
x-kubernetes-int-or-string: true
@@ -3210,9 +3214,25 @@ spec:
32103214
type: integer
32113215
minimum: 0
32123216
maximum: 255
3217+
icmpv6:
3218+
type: object
3219+
properties:
3220+
messages:
3221+
type: array
3222+
items:
3223+
type: object
3224+
required:
3225+
- type
3226+
properties:
3227+
type:
3228+
x-kubernetes-int-or-string: true
3229+
code:
3230+
type: integer
3231+
minimum: 0
3232+
maximum: 255
32133233
x-kubernetes-validations:
3214-
- rule: "(has(self.icmp) ? 1 : 0) + (has(self.udp) ? 1 : 0) + (has(self.tcp) ? 1: 0) <= 1"
3215-
message: "At most one of 'icmp', 'udp', or 'tcp' may be set"
3234+
- rule: "(has(self.icmp) ? 1 : 0) + (has(self.icmpv6) ? 1 : 0) + (has(self.udp) ? 1 : 0) + (has(self.tcp) ? 1: 0) <= 1"
3235+
message: "At most one of 'ICMP', 'ICMPv6', 'UDP', or 'TCP' may be set"
32163236
direction:
32173237
type: string
32183238
enum: ["SourceToDestination", "DestinationToSource", "Both"]

build/yamls/antrea-crds.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3092,7 +3092,9 @@ spec:
30923092
type: string
30933093
ip:
30943094
type: string
3095-
format: ipv4
3095+
oneOf:
3096+
- format: ipv4
3097+
- format: ipv6
30963098
destination:
30973099
type: object
30983100
x-kubernetes-validations:
@@ -3111,13 +3113,15 @@ spec:
31113113
type: string
31123114
ip:
31133115
type: string
3114-
format: ipv4
3116+
oneOf:
3117+
- format: ipv4
3118+
- format: ipv6
31153119
packet:
31163120
type: object
31173121
properties:
31183122
ipFamily:
31193123
type: string
3120-
enum: [IPv4]
3124+
enum: [IPv4, IPv6]
31213125
default: IPv4
31223126
protocol:
31233127
x-kubernetes-int-or-string: true
@@ -3177,9 +3181,25 @@ spec:
31773181
type: integer
31783182
minimum: 0
31793183
maximum: 255
3184+
icmpv6:
3185+
type: object
3186+
properties:
3187+
messages:
3188+
type: array
3189+
items:
3190+
type: object
3191+
required:
3192+
- type
3193+
properties:
3194+
type:
3195+
x-kubernetes-int-or-string: true
3196+
code:
3197+
type: integer
3198+
minimum: 0
3199+
maximum: 255
31803200
x-kubernetes-validations:
3181-
- rule: "(has(self.icmp) ? 1 : 0) + (has(self.udp) ? 1 : 0) + (has(self.tcp) ? 1: 0) <= 1"
3182-
message: "At most one of 'icmp', 'udp', or 'tcp' may be set"
3201+
- rule: "(has(self.icmp) ? 1 : 0) + (has(self.icmpv6) ? 1 : 0) + (has(self.udp) ? 1 : 0) + (has(self.tcp) ? 1: 0) <= 1"
3202+
message: "At most one of 'ICMP', 'ICMPv6', 'UDP', or 'TCP' may be set"
31833203
direction:
31843204
type: string
31853205
enum: ["SourceToDestination", "DestinationToSource", "Both"]

build/yamls/antrea-eks.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3121,7 +3121,9 @@ spec:
31213121
type: string
31223122
ip:
31233123
type: string
3124-
format: ipv4
3124+
oneOf:
3125+
- format: ipv4
3126+
- format: ipv6
31253127
destination:
31263128
type: object
31273129
x-kubernetes-validations:
@@ -3140,13 +3142,15 @@ spec:
31403142
type: string
31413143
ip:
31423144
type: string
3143-
format: ipv4
3145+
oneOf:
3146+
- format: ipv4
3147+
- format: ipv6
31443148
packet:
31453149
type: object
31463150
properties:
31473151
ipFamily:
31483152
type: string
3149-
enum: [IPv4]
3153+
enum: [IPv4, IPv6]
31503154
default: IPv4
31513155
protocol:
31523156
x-kubernetes-int-or-string: true
@@ -3206,9 +3210,25 @@ spec:
32063210
type: integer
32073211
minimum: 0
32083212
maximum: 255
3213+
icmpv6:
3214+
type: object
3215+
properties:
3216+
messages:
3217+
type: array
3218+
items:
3219+
type: object
3220+
required:
3221+
- type
3222+
properties:
3223+
type:
3224+
x-kubernetes-int-or-string: true
3225+
code:
3226+
type: integer
3227+
minimum: 0
3228+
maximum: 255
32093229
x-kubernetes-validations:
3210-
- rule: "(has(self.icmp) ? 1 : 0) + (has(self.udp) ? 1 : 0) + (has(self.tcp) ? 1: 0) <= 1"
3211-
message: "At most one of 'icmp', 'udp', or 'tcp' may be set"
3230+
- rule: "(has(self.icmp) ? 1 : 0) + (has(self.icmpv6) ? 1 : 0) + (has(self.udp) ? 1 : 0) + (has(self.tcp) ? 1: 0) <= 1"
3231+
message: "At most one of 'ICMP', 'ICMPv6', 'UDP', or 'TCP' may be set"
32123232
direction:
32133233
type: string
32143234
enum: ["SourceToDestination", "DestinationToSource", "Both"]

build/yamls/antrea-gke.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3121,7 +3121,9 @@ spec:
31213121
type: string
31223122
ip:
31233123
type: string
3124-
format: ipv4
3124+
oneOf:
3125+
- format: ipv4
3126+
- format: ipv6
31253127
destination:
31263128
type: object
31273129
x-kubernetes-validations:
@@ -3140,13 +3142,15 @@ spec:
31403142
type: string
31413143
ip:
31423144
type: string
3143-
format: ipv4
3145+
oneOf:
3146+
- format: ipv4
3147+
- format: ipv6
31443148
packet:
31453149
type: object
31463150
properties:
31473151
ipFamily:
31483152
type: string
3149-
enum: [IPv4]
3153+
enum: [IPv4, IPv6]
31503154
default: IPv4
31513155
protocol:
31523156
x-kubernetes-int-or-string: true
@@ -3206,9 +3210,25 @@ spec:
32063210
type: integer
32073211
minimum: 0
32083212
maximum: 255
3213+
icmpv6:
3214+
type: object
3215+
properties:
3216+
messages:
3217+
type: array
3218+
items:
3219+
type: object
3220+
required:
3221+
- type
3222+
properties:
3223+
type:
3224+
x-kubernetes-int-or-string: true
3225+
code:
3226+
type: integer
3227+
minimum: 0
3228+
maximum: 255
32093229
x-kubernetes-validations:
3210-
- rule: "(has(self.icmp) ? 1 : 0) + (has(self.udp) ? 1 : 0) + (has(self.tcp) ? 1: 0) <= 1"
3211-
message: "At most one of 'icmp', 'udp', or 'tcp' may be set"
3230+
- rule: "(has(self.icmp) ? 1 : 0) + (has(self.icmpv6) ? 1 : 0) + (has(self.udp) ? 1 : 0) + (has(self.tcp) ? 1: 0) <= 1"
3231+
message: "At most one of 'ICMP', 'ICMPv6', 'UDP', or 'TCP' may be set"
32123232
direction:
32133233
type: string
32143234
enum: ["SourceToDestination", "DestinationToSource", "Both"]

build/yamls/antrea-ipsec.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3121,7 +3121,9 @@ spec:
31213121
type: string
31223122
ip:
31233123
type: string
3124-
format: ipv4
3124+
oneOf:
3125+
- format: ipv4
3126+
- format: ipv6
31253127
destination:
31263128
type: object
31273129
x-kubernetes-validations:
@@ -3140,13 +3142,15 @@ spec:
31403142
type: string
31413143
ip:
31423144
type: string
3143-
format: ipv4
3145+
oneOf:
3146+
- format: ipv4
3147+
- format: ipv6
31443148
packet:
31453149
type: object
31463150
properties:
31473151
ipFamily:
31483152
type: string
3149-
enum: [IPv4]
3153+
enum: [IPv4, IPv6]
31503154
default: IPv4
31513155
protocol:
31523156
x-kubernetes-int-or-string: true
@@ -3206,9 +3210,25 @@ spec:
32063210
type: integer
32073211
minimum: 0
32083212
maximum: 255
3213+
icmpv6:
3214+
type: object
3215+
properties:
3216+
messages:
3217+
type: array
3218+
items:
3219+
type: object
3220+
required:
3221+
- type
3222+
properties:
3223+
type:
3224+
x-kubernetes-int-or-string: true
3225+
code:
3226+
type: integer
3227+
minimum: 0
3228+
maximum: 255
32093229
x-kubernetes-validations:
3210-
- rule: "(has(self.icmp) ? 1 : 0) + (has(self.udp) ? 1 : 0) + (has(self.tcp) ? 1: 0) <= 1"
3211-
message: "At most one of 'icmp', 'udp', or 'tcp' may be set"
3230+
- rule: "(has(self.icmp) ? 1 : 0) + (has(self.icmpv6) ? 1 : 0) + (has(self.udp) ? 1 : 0) + (has(self.tcp) ? 1: 0) <= 1"
3231+
message: "At most one of 'ICMP', 'ICMPv6', 'UDP', or 'TCP' may be set"
32123232
direction:
32133233
type: string
32143234
enum: ["SourceToDestination", "DestinationToSource", "Both"]

build/yamls/antrea.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3121,7 +3121,9 @@ spec:
31213121
type: string
31223122
ip:
31233123
type: string
3124-
format: ipv4
3124+
oneOf:
3125+
- format: ipv4
3126+
- format: ipv6
31253127
destination:
31263128
type: object
31273129
x-kubernetes-validations:
@@ -3140,13 +3142,15 @@ spec:
31403142
type: string
31413143
ip:
31423144
type: string
3143-
format: ipv4
3145+
oneOf:
3146+
- format: ipv4
3147+
- format: ipv6
31443148
packet:
31453149
type: object
31463150
properties:
31473151
ipFamily:
31483152
type: string
3149-
enum: [IPv4]
3153+
enum: [IPv4, IPv6]
31503154
default: IPv4
31513155
protocol:
31523156
x-kubernetes-int-or-string: true
@@ -3206,9 +3210,25 @@ spec:
32063210
type: integer
32073211
minimum: 0
32083212
maximum: 255
3213+
icmpv6:
3214+
type: object
3215+
properties:
3216+
messages:
3217+
type: array
3218+
items:
3219+
type: object
3220+
required:
3221+
- type
3222+
properties:
3223+
type:
3224+
x-kubernetes-int-or-string: true
3225+
code:
3226+
type: integer
3227+
minimum: 0
3228+
maximum: 255
32093229
x-kubernetes-validations:
3210-
- rule: "(has(self.icmp) ? 1 : 0) + (has(self.udp) ? 1 : 0) + (has(self.tcp) ? 1: 0) <= 1"
3211-
message: "At most one of 'icmp', 'udp', or 'tcp' may be set"
3230+
- rule: "(has(self.icmp) ? 1 : 0) + (has(self.icmpv6) ? 1 : 0) + (has(self.udp) ? 1 : 0) + (has(self.tcp) ? 1: 0) <= 1"
3231+
message: "At most one of 'ICMP', 'ICMPv6', 'UDP', or 'TCP' may be set"
32123232
direction:
32133233
type: string
32143234
enum: ["SourceToDestination", "DestinationToSource", "Both"]

0 commit comments

Comments
 (0)