-
Notifications
You must be signed in to change notification settings - Fork 449
/
Copy pathpins_middleblock.p4
1631 lines (1545 loc) · 79.9 KB
/
pins_middleblock.p4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include <core.p4>
#define V1MODEL_VERSION 20180101
#include <v1model.p4>
typedef bit<48> ethernet_addr_t;
typedef bit<32> ipv4_addr_t;
typedef bit<128> ipv6_addr_t;
typedef bit<12> vlan_id_t;
typedef bit<16> ether_type_t;
const vlan_id_t INTERNAL_VLAN_ID = 0xfff;
const vlan_id_t NO_VLAN_ID = 0x0;
header ethernet_t {
ethernet_addr_t dst_addr;
ethernet_addr_t src_addr;
ether_type_t ether_type;
}
header vlan_t {
bit<3> priority_code_point;
bit<1> drop_eligible_indicator;
vlan_id_t vlan_id;
ether_type_t ether_type;
}
header ipv4_t {
bit<4> version;
bit<4> ihl;
bit<6> dscp;
bit<2> ecn;
bit<16> total_len;
bit<16> identification;
bit<1> reserved;
bit<1> do_not_fragment;
bit<1> more_fragments;
bit<13> frag_offset;
bit<8> ttl;
bit<8> protocol;
bit<16> header_checksum;
ipv4_addr_t src_addr;
ipv4_addr_t dst_addr;
}
header ipv6_t {
bit<4> version;
bit<6> dscp;
bit<2> ecn;
bit<20> flow_label;
bit<16> payload_length;
bit<8> next_header;
bit<8> hop_limit;
ipv6_addr_t src_addr;
ipv6_addr_t dst_addr;
}
header udp_t {
bit<16> src_port;
bit<16> dst_port;
bit<16> hdr_length;
bit<16> checksum;
}
header tcp_t {
bit<16> src_port;
bit<16> dst_port;
bit<32> seq_no;
bit<32> ack_no;
bit<4> data_offset;
bit<4> res;
bit<8> flags;
bit<16> window;
bit<16> checksum;
bit<16> urgent_ptr;
}
header icmp_t {
bit<8> type;
bit<8> code;
bit<16> checksum;
bit<32> rest_of_header;
}
header arp_t {
bit<16> hw_type;
bit<16> proto_type;
bit<8> hw_addr_len;
bit<8> proto_addr_len;
bit<16> opcode;
bit<48> sender_hw_addr;
bit<32> sender_proto_addr;
bit<48> target_hw_addr;
bit<32> target_proto_addr;
}
header gre_t {
bit<1> checksum_present;
bit<1> routing_present;
bit<1> key_present;
bit<1> sequence_present;
bit<1> strict_source_route;
bit<3> recursion_control;
bit<1> acknowledgement_present;
bit<4> flags;
bit<3> version;
bit<16> protocol;
}
header ipfix_t {
bit<16> version_number;
bit<16> length;
bit<32> export_time;
bit<32> sequence_number;
bit<32> observation_domain_id;
}
header psamp_extended_t {
bit<16> template_id;
bit<16> length;
bit<64> observation_time;
bit<16> flowset;
bit<16> next_hop_index;
bit<16> epoch;
bit<16> ingress_port;
bit<16> egress_port;
bit<16> user_meta_field;
bit<8> dlb_id;
bit<8> variable_length;
bit<16> packet_sampled_length;
}
enum bit<8> PreservedFieldList {
MIRROR_AND_PACKET_IN_COPY = 8w1,
RECIRCULATE = 8w2
}
// @p4runtime_translation("" , string)
type bit<10> nexthop_id_t;
// @p4runtime_translation("" , string)
type bit<10> tunnel_id_t;
// @p4runtime_translation("" , string)
type bit<12> wcmp_group_id_t;
// @p4runtime_translation("" , string)
@p4runtime_translation_mappings({ { "" , 0 } , }) type bit<10> vrf_id_t;
const vrf_id_t kDefaultVrf = 0;
// @p4runtime_translation("" , string)
type bit<10> router_interface_id_t;
// @p4runtime_translation("" , string)
type bit<9> port_id_t;
// @p4runtime_translation("" , string)
type bit<10> mirror_session_id_t;
// @p4runtime_translation("" , string)
type bit<8> qos_queue_t;
typedef bit<6> route_metadata_t;
typedef bit<8> acl_metadata_t;
typedef bit<16> multicast_group_id_t;
typedef bit<16> replica_instance_t;
enum bit<2> MeterColor_t {
GREEN = 0,
YELLOW = 1,
RED = 2
}
@controller_header("packet_in") header packet_in_header_t {
@id(1)
port_id_t ingress_port;
@id(2)
port_id_t target_egress_port;
}
@controller_header("packet_out") header packet_out_header_t {
@id(1)
port_id_t egress_port;
@id(2)
bit<1> submit_to_ingress;
@id(3) @padding
bit<6> unused_pad;
}
struct headers_t {
packet_out_header_t packet_out_header;
ethernet_t mirror_encap_ethernet;
vlan_t mirror_encap_vlan;
ipv6_t mirror_encap_ipv6;
udp_t mirror_encap_udp;
ipfix_t ipfix;
psamp_extended_t psamp_extended;
ethernet_t ethernet;
vlan_t vlan;
ipv6_t tunnel_encap_ipv6;
gre_t tunnel_encap_gre;
ipv4_t ipv4;
ipv6_t ipv6;
ipv4_t inner_ipv4;
ipv6_t inner_ipv6;
icmp_t icmp;
tcp_t tcp;
udp_t udp;
arp_t arp;
}
struct packet_rewrites_t {
ethernet_addr_t src_mac;
ethernet_addr_t dst_mac;
vlan_id_t vlan_id;
}
struct local_metadata_t {
@field_list(PreservedFieldList.MIRROR_AND_PACKET_IN_COPY)
bool enable_vlan_checks;
vlan_id_t vlan_id;
bool admit_to_l3;
vrf_id_t vrf_id;
bool enable_decrement_ttl;
bool enable_src_mac_rewrite;
bool enable_dst_mac_rewrite;
bool enable_vlan_rewrite;
packet_rewrites_t packet_rewrites;
bit<16> l4_src_port;
bit<16> l4_dst_port;
bit<8> wcmp_selector_input;
bool apply_tunnel_decap_at_end_of_pre_ingress;
bool apply_tunnel_encap_at_egress;
ipv6_addr_t tunnel_encap_src_ipv6;
ipv6_addr_t tunnel_encap_dst_ipv6;
bool marked_to_copy;
bool marked_to_mirror;
mirror_session_id_t mirror_session_id;
port_id_t mirror_egress_port;
@field_list(PreservedFieldList.MIRROR_AND_PACKET_IN_COPY)
ethernet_addr_t mirror_encap_src_mac;
@field_list(PreservedFieldList.MIRROR_AND_PACKET_IN_COPY)
ethernet_addr_t mirror_encap_dst_mac;
@field_list(PreservedFieldList.MIRROR_AND_PACKET_IN_COPY)
vlan_id_t mirror_encap_vlan_id;
@field_list(PreservedFieldList.MIRROR_AND_PACKET_IN_COPY)
ipv6_addr_t mirror_encap_src_ip;
@field_list(PreservedFieldList.MIRROR_AND_PACKET_IN_COPY)
ipv6_addr_t mirror_encap_dst_ip;
@field_list(PreservedFieldList.MIRROR_AND_PACKET_IN_COPY)
bit<16> mirror_encap_udp_src_port;
@field_list(PreservedFieldList.MIRROR_AND_PACKET_IN_COPY)
bit<16> mirror_encap_udp_dst_port;
@field_list(PreservedFieldList.RECIRCULATE)
bit<9> loopback_port;
@field_list(PreservedFieldList.MIRROR_AND_PACKET_IN_COPY)
bit<9> packet_in_ingress_port;
@field_list(PreservedFieldList.MIRROR_AND_PACKET_IN_COPY)
bit<9> packet_in_target_egress_port;
MeterColor_t color;
port_id_t ingress_port;
route_metadata_t route_metadata;
acl_metadata_t acl_metadata;
bool bypass_ingress;
bool wcmp_group_id_valid;
wcmp_group_id_t wcmp_group_id_value;
bool nexthop_id_valid;
nexthop_id_t nexthop_id_value;
bool ipmc_table_hit;
bool acl_drop;
}
parser packet_parser(packet_in packet, out headers_t headers, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) {
state start {
local_metadata.enable_vlan_checks = false;
local_metadata.vlan_id = 0;
local_metadata.admit_to_l3 = false;
local_metadata.vrf_id = kDefaultVrf;
local_metadata.enable_decrement_ttl = false;
local_metadata.enable_src_mac_rewrite = false;
local_metadata.enable_dst_mac_rewrite = false;
local_metadata.enable_vlan_rewrite = false;
local_metadata.packet_rewrites.src_mac = 0;
local_metadata.packet_rewrites.dst_mac = 0;
local_metadata.l4_src_port = 0;
local_metadata.l4_dst_port = 0;
local_metadata.wcmp_selector_input = 0;
local_metadata.apply_tunnel_decap_at_end_of_pre_ingress = false;
local_metadata.apply_tunnel_encap_at_egress = false;
local_metadata.tunnel_encap_src_ipv6 = 0;
local_metadata.tunnel_encap_dst_ipv6 = 0;
local_metadata.marked_to_copy = false;
local_metadata.marked_to_mirror = false;
local_metadata.mirror_session_id = 0;
local_metadata.mirror_egress_port = 0;
local_metadata.color = MeterColor_t.GREEN;
local_metadata.route_metadata = 0;
local_metadata.bypass_ingress = false;
local_metadata.wcmp_group_id_valid = false;
local_metadata.wcmp_group_id_value = 0;
local_metadata.nexthop_id_valid = false;
local_metadata.nexthop_id_value = 0;
local_metadata.ipmc_table_hit = false;
local_metadata.acl_drop = false;
if (standard_metadata.instance_type == 4) {
local_metadata.ingress_port = (port_id_t)local_metadata.loopback_port;
} else {
local_metadata.ingress_port = (port_id_t)standard_metadata.ingress_port;
}
transition select(standard_metadata.ingress_port) {
510: parse_packet_out_header;
default: parse_ethernet;
}
}
state parse_packet_out_header {
packet.extract(headers.packet_out_header);
transition parse_ethernet;
}
state parse_ethernet {
packet.extract(headers.ethernet);
transition select(headers.ethernet.ether_type) {
0x800: parse_ipv4;
0x86dd: parse_ipv6;
0x806: parse_arp;
0x8100: parse_8021q_vlan;
default: accept;
}
}
state parse_8021q_vlan {
packet.extract(headers.vlan);
transition select(headers.vlan.ether_type) {
0x800: parse_ipv4;
0x86dd: parse_ipv6;
0x806: parse_arp;
default: accept;
}
}
state parse_ipv4 {
packet.extract(headers.ipv4);
transition select(headers.ipv4.protocol) {
0x4: parse_ipv4_in_ip;
0x29: parse_ipv6_in_ip;
0x1: parse_icmp;
0x6: parse_tcp;
0x11: parse_udp;
default: accept;
}
}
state parse_ipv4_in_ip {
packet.extract(headers.inner_ipv4);
transition select(headers.inner_ipv4.protocol) {
0x1: parse_icmp;
0x6: parse_tcp;
0x11: parse_udp;
default: accept;
}
}
state parse_ipv6 {
packet.extract(headers.ipv6);
transition select(headers.ipv6.next_header) {
0x4: parse_ipv4_in_ip;
0x29: parse_ipv6_in_ip;
0x3a: parse_icmp;
0x6: parse_tcp;
0x11: parse_udp;
default: accept;
}
}
state parse_ipv6_in_ip {
packet.extract(headers.inner_ipv6);
transition select(headers.inner_ipv6.next_header) {
0x3a: parse_icmp;
0x6: parse_tcp;
0x11: parse_udp;
default: accept;
}
}
state parse_tcp {
packet.extract(headers.tcp);
local_metadata.l4_src_port = headers.tcp.src_port;
local_metadata.l4_dst_port = headers.tcp.dst_port;
transition accept;
}
state parse_udp {
packet.extract(headers.udp);
local_metadata.l4_src_port = headers.udp.src_port;
local_metadata.l4_dst_port = headers.udp.dst_port;
transition accept;
}
state parse_icmp {
packet.extract(headers.icmp);
transition accept;
}
state parse_arp {
packet.extract(headers.arp);
transition accept;
}
}
control packet_deparser(packet_out packet, in headers_t headers) {
apply {
packet.emit(headers.packet_out_header);
packet.emit(headers.mirror_encap_ethernet);
packet.emit(headers.mirror_encap_vlan);
packet.emit(headers.mirror_encap_ipv6);
packet.emit(headers.mirror_encap_udp);
packet.emit(headers.ipfix);
packet.emit(headers.psamp_extended);
packet.emit(headers.ethernet);
packet.emit(headers.vlan);
packet.emit(headers.tunnel_encap_ipv6);
packet.emit(headers.tunnel_encap_gre);
packet.emit(headers.ipv4);
packet.emit(headers.ipv6);
packet.emit(headers.inner_ipv4);
packet.emit(headers.inner_ipv6);
packet.emit(headers.arp);
packet.emit(headers.icmp);
packet.emit(headers.tcp);
packet.emit(headers.udp);
}
}
control packet_in_encap(inout headers_t headers, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) {
apply {
}
}
control packet_out_decap(inout headers_t headers, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) {
apply {
if (headers.packet_out_header.isValid() && headers.packet_out_header.submit_to_ingress == 0) {
standard_metadata.egress_spec = (bit<9>)headers.packet_out_header.egress_port;
local_metadata.bypass_ingress = true;
}
headers.packet_out_header.setInvalid();
}
}
@id(0x01000005) action set_nexthop_id(inout local_metadata_t local_metadata, @id(1) @refers_to(nexthop_table , nexthop_id) nexthop_id_t nexthop_id) {
local_metadata.nexthop_id_valid = true;
local_metadata.nexthop_id_value = nexthop_id;
}
control routing_lookup(in headers_t headers, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) {
@id(0x01798B9E) action no_action() {
}
@entry_restriction("
// The VRF ID 0 (or '' in P4Runtime) encodes the default VRF, which cannot
// be read or written via this table, but is always present implicitly.
// TODO: This constraint should read `vrf_id != ''` (since
// constraints are a control plane (P4Runtime) concept), but
// p4-constraints does not currently support strings.
vrf_id != 0;
") @p4runtime_role("sdn_controller") @id(0x0200004A) table vrf_table {
key = {
local_metadata.vrf_id: exact @id(1) @name("vrf_id");
}
actions = {
@proto_id(1) no_action;
}
const default_action = no_action;
size = 64;
}
@id(0x01000006) action drop() {
mark_to_drop(standard_metadata);
}
@id(0x01000004) action set_wcmp_group_id(@id(1) @refers_to(wcmp_group_table , wcmp_group_id) wcmp_group_id_t wcmp_group_id) {
local_metadata.wcmp_group_id_valid = true;
local_metadata.wcmp_group_id_value = wcmp_group_id;
}
@id(0x01000011) action set_wcmp_group_id_and_metadata(@id(1) @refers_to(wcmp_group_table , wcmp_group_id) wcmp_group_id_t wcmp_group_id, route_metadata_t route_metadata) {
set_wcmp_group_id(wcmp_group_id);
local_metadata.route_metadata = route_metadata;
}
@id(0x01000015) action set_metadata_and_drop(@id(1) route_metadata_t route_metadata) {
local_metadata.route_metadata = route_metadata;
mark_to_drop(standard_metadata);
}
@id(0x01000010) action set_nexthop_id_and_metadata(@id(1) @refers_to(nexthop_table , nexthop_id) nexthop_id_t nexthop_id, route_metadata_t route_metadata) {
local_metadata.nexthop_id_valid = true;
local_metadata.nexthop_id_value = nexthop_id;
local_metadata.route_metadata = route_metadata;
}
@id(0x01000018) @action_restriction("
// Disallow 0 since it encodes 'no multicast' in V1Model.
multicast_group_id != 0;
") action set_multicast_group_id(@id(1) @refers_to(builtin : : multicast_group_table , multicast_group_id) multicast_group_id_t multicast_group_id) {
standard_metadata.mcast_grp = multicast_group_id;
}
@p4runtime_role("sdn_controller") @id(0x02000044) table ipv4_table {
key = {
local_metadata.vrf_id: exact @id(1) @name("vrf_id") @refers_to(vrf_table , vrf_id);
headers.ipv4.dst_addr: lpm @id(2) @name("ipv4_dst") @format(IPV4_ADDRESS);
}
actions = {
@proto_id(1) drop;
@proto_id(2) set_nexthop_id(local_metadata);
@proto_id(3) set_wcmp_group_id;
@proto_id(5) set_nexthop_id_and_metadata;
@proto_id(6) set_wcmp_group_id_and_metadata;
@proto_id(7) set_metadata_and_drop;
}
const default_action = drop;
size = 131072;
}
@p4runtime_role("sdn_controller") @id(0x02000045) table ipv6_table {
key = {
local_metadata.vrf_id: exact @id(1) @name("vrf_id") @refers_to(vrf_table , vrf_id);
headers.ipv6.dst_addr: lpm @id(2) @name("ipv6_dst") @format(IPV6_ADDRESS);
}
actions = {
@proto_id(1) drop;
@proto_id(2) set_nexthop_id(local_metadata);
@proto_id(3) set_wcmp_group_id;
@proto_id(5) set_nexthop_id_and_metadata;
@proto_id(6) set_wcmp_group_id_and_metadata;
@proto_id(7) set_metadata_and_drop;
}
const default_action = drop;
size = 17000;
}
@p4runtime_role("sdn_controller") @id(0x0200004E) table ipv4_multicast_table {
key = {
local_metadata.vrf_id: exact @id(1) @name("vrf_id") @refers_to(vrf_table , vrf_id);
headers.ipv4.dst_addr: exact @id(2) @name("ipv4_dst") @format(IPV4_ADDRESS);
}
actions = {
@proto_id(1) set_multicast_group_id;
}
size = 1600;
}
@p4runtime_role("sdn_controller") @id(0x0200004F) table ipv6_multicast_table {
key = {
local_metadata.vrf_id: exact @id(1) @name("vrf_id") @refers_to(vrf_table , vrf_id);
headers.ipv6.dst_addr: exact @id(2) @name("ipv6_dst") @format(IPV6_ADDRESS);
}
actions = {
@proto_id(1) set_multicast_group_id;
}
size = 1600;
}
apply {
mark_to_drop(standard_metadata);
vrf_table.apply();
if (local_metadata.admit_to_l3) {
if (headers.ipv4.isValid()) {
ipv4_table.apply();
ipv4_multicast_table.apply();
local_metadata.ipmc_table_hit = standard_metadata.mcast_grp != 0;
} else if (headers.ipv6.isValid()) {
ipv6_table.apply();
ipv6_multicast_table.apply();
local_metadata.ipmc_table_hit = standard_metadata.mcast_grp != 0;
}
}
}
}
control routing_resolution(in headers_t headers, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) {
bool tunnel_id_valid = false;
tunnel_id_t tunnel_id_value;
bool router_interface_id_valid = false;
router_interface_id_t router_interface_id_value;
bool neighbor_id_valid = false;
ipv6_addr_t neighbor_id_value;
@id(0x01000001) action set_dst_mac(@id(1) @format(MAC_ADDRESS) ethernet_addr_t dst_mac) {
local_metadata.packet_rewrites.dst_mac = dst_mac;
}
@p4runtime_role("sdn_controller") @id(0x02000040) table neighbor_table {
key = {
router_interface_id_value: exact @id(1) @name("router_interface_id") @refers_to(router_interface_table , router_interface_id);
neighbor_id_value : exact @id(2) @format(IPV6_ADDRESS) @name("neighbor_id");
}
actions = {
@proto_id(1) set_dst_mac;
@defaultonly NoAction;
}
const default_action = NoAction;
size = 1024;
}
@id(0x0100001B) @unsupported @action_restriction("
// Disallow reserved VLAN IDs with implementation-defined semantics.
vlan_id != 0 && vlan_id != 4095") action set_port_and_src_mac_and_vlan_id(@id(1) port_id_t port, @id(2) @format(MAC_ADDRESS) ethernet_addr_t src_mac, @id(3) vlan_id_t vlan_id) {
standard_metadata.egress_spec = (bit<9>)port;
local_metadata.packet_rewrites.src_mac = src_mac;
local_metadata.packet_rewrites.vlan_id = vlan_id;
}
@id(0x01000002) action set_port_and_src_mac(@id(1) port_id_t port, @id(2) @format(MAC_ADDRESS) ethernet_addr_t src_mac) {
set_port_and_src_mac_and_vlan_id(port, src_mac, INTERNAL_VLAN_ID);
}
@p4runtime_role("sdn_controller") @id(0x02000041) table router_interface_table {
key = {
router_interface_id_value: exact @id(1) @name("router_interface_id");
}
actions = {
@proto_id(1) set_port_and_src_mac;
@proto_id(2) set_port_and_src_mac_and_vlan_id;
@defaultonly NoAction;
}
const default_action = NoAction;
size = 256;
}
@id(0x01000017) action set_ip_nexthop_and_disable_rewrites(@id(1) @refers_to(router_interface_table , router_interface_id) @refers_to(neighbor_table , router_interface_id) router_interface_id_t router_interface_id, @id(2) @format(IPV6_ADDRESS) @refers_to(neighbor_table , neighbor_id) ipv6_addr_t neighbor_id, @id(3) bit<1> disable_decrement_ttl, @id(4) bit<1> disable_src_mac_rewrite, @id(5) bit<1> disable_dst_mac_rewrite, @id(6) bit<1> disable_vlan_rewrite) {
router_interface_id_valid = true;
router_interface_id_value = router_interface_id;
neighbor_id_valid = true;
neighbor_id_value = neighbor_id;
local_metadata.enable_decrement_ttl = !(bool)disable_decrement_ttl;
local_metadata.enable_src_mac_rewrite = !(bool)disable_src_mac_rewrite;
local_metadata.enable_dst_mac_rewrite = !(bool)disable_dst_mac_rewrite;
local_metadata.enable_vlan_rewrite = !(bool)disable_vlan_rewrite;
}
@id(0x01000014) action set_ip_nexthop(@id(1) @refers_to(router_interface_table , router_interface_id) @refers_to(neighbor_table , router_interface_id) router_interface_id_t router_interface_id, @id(2) @format(IPV6_ADDRESS) @refers_to(neighbor_table , neighbor_id) ipv6_addr_t neighbor_id) {
set_ip_nexthop_and_disable_rewrites(router_interface_id, neighbor_id, 0x0, 0x0, 0x0, 0x0);
}
@id(0x01000003) @deprecated("Use set_ip_nexthop instead.") action set_nexthop(@id(1) @refers_to(router_interface_table , router_interface_id) @refers_to(neighbor_table , router_interface_id) router_interface_id_t router_interface_id, @id(2) @format(IPV6_ADDRESS) @refers_to(neighbor_table , neighbor_id) ipv6_addr_t neighbor_id) {
set_ip_nexthop(router_interface_id, neighbor_id);
}
@id(0x01000012) action set_p2p_tunnel_encap_nexthop(@id(1) @refers_to(tunnel_table , tunnel_id) tunnel_id_t tunnel_id) {
tunnel_id_valid = true;
tunnel_id_value = tunnel_id;
}
@p4runtime_role("sdn_controller") @id(0x02000042) table nexthop_table {
key = {
local_metadata.nexthop_id_value: exact @id(1) @name("nexthop_id");
}
actions = {
@proto_id(1) set_nexthop;
@proto_id(2) set_p2p_tunnel_encap_nexthop;
@proto_id(3) set_ip_nexthop;
@proto_id(4) set_ip_nexthop_and_disable_rewrites;
@defaultonly NoAction;
}
const default_action = NoAction;
size = 1024;
}
@id(0x01000013) action mark_for_p2p_tunnel_encap(@id(1) @format(IPV6_ADDRESS) ipv6_addr_t encap_src_ip, @id(2) @format(IPV6_ADDRESS) @refers_to(neighbor_table , neighbor_id) ipv6_addr_t encap_dst_ip, @id(3) @refers_to(neighbor_table , router_interface_id) @refers_to(router_interface_table , router_interface_id) router_interface_id_t router_interface_id) {
local_metadata.tunnel_encap_src_ipv6 = encap_src_ip;
local_metadata.tunnel_encap_dst_ipv6 = encap_dst_ip;
local_metadata.apply_tunnel_encap_at_egress = true;
set_ip_nexthop(router_interface_id, encap_dst_ip);
}
@p4runtime_role("sdn_controller") @id(0x02000050) table tunnel_table {
key = {
tunnel_id_value: exact @id(1) @name("tunnel_id");
}
actions = {
@proto_id(1) mark_for_p2p_tunnel_encap;
@defaultonly NoAction;
}
const default_action = NoAction;
size = 2048;
}
@max_group_size(512) @id(0x11DC4EC8) action_selector(HashAlgorithm.identity, 49152, 8) wcmp_group_selector;
@p4runtime_role("sdn_controller") @id(0x02000043) @oneshot table wcmp_group_table {
key = {
local_metadata.wcmp_group_id_value: exact @id(1) @name("wcmp_group_id");
local_metadata.wcmp_selector_input: selector;
}
actions = {
@proto_id(1) set_nexthop_id(local_metadata);
@defaultonly NoAction;
}
const default_action = NoAction;
implementation = wcmp_group_selector;
size = 3968;
}
apply {
if (local_metadata.admit_to_l3) {
if (local_metadata.wcmp_group_id_valid) {
wcmp_group_table.apply();
}
if (local_metadata.nexthop_id_valid) {
nexthop_table.apply();
if (tunnel_id_valid) {
tunnel_table.apply();
}
if (router_interface_id_valid && neighbor_id_valid) {
router_interface_table.apply();
neighbor_table.apply();
}
}
}
local_metadata.packet_in_target_egress_port = standard_metadata.egress_spec;
local_metadata.packet_in_ingress_port = standard_metadata.ingress_port;
if (local_metadata.acl_drop) {
mark_to_drop(standard_metadata);
}
}
}
control verify_ipv4_checksum(inout headers_t headers, inout local_metadata_t local_metadata) {
apply {
verify_checksum(headers.ipv4.isValid(), { headers.ipv4.version, headers.ipv4.ihl, headers.ipv4.dscp, headers.ipv4.ecn, headers.ipv4.total_len, headers.ipv4.identification, headers.ipv4.reserved, headers.ipv4.do_not_fragment, headers.ipv4.more_fragments, headers.ipv4.frag_offset, headers.ipv4.ttl, headers.ipv4.protocol, headers.ipv4.src_addr, headers.ipv4.dst_addr }, headers.ipv4.header_checksum, HashAlgorithm.csum16);
}
}
control compute_ipv4_checksum(inout headers_t headers, inout local_metadata_t local_metadata) {
apply {
update_checksum(headers.ipv4.isValid(), { headers.ipv4.version, headers.ipv4.ihl, headers.ipv4.dscp, headers.ipv4.ecn, headers.ipv4.total_len, headers.ipv4.identification, headers.ipv4.reserved, headers.ipv4.do_not_fragment, headers.ipv4.more_fragments, headers.ipv4.frag_offset, headers.ipv4.ttl, headers.ipv4.protocol, headers.ipv4.src_addr, headers.ipv4.dst_addr }, headers.ipv4.header_checksum, HashAlgorithm.csum16);
}
}
control ingress_cloning(inout headers_t headers, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) {
@id(0x0100001C) action ingress_clone(@id(1) bit<32> clone_session) {
clone_preserving_field_list(CloneType.I2E, clone_session, PreservedFieldList.MIRROR_AND_PACKET_IN_COPY);
}
@unsupported @p4runtime_role("packet_replication_engine_manager") @id(0x02000051) @entry_restriction("
// mirror_egress_port is present iff marked_to_mirror is true.
// Exact match indicating presence of mirror_egress_port.
marked_to_mirror == 1 -> mirror_egress_port::mask == -1;
// Wildcard match indicating abscence of mirror_egress_port.
marked_to_mirror == 0 -> mirror_egress_port::mask == 0;
") table ingress_clone_table {
key = {
local_metadata.marked_to_copy : exact @id(1) @name("marked_to_copy");
local_metadata.marked_to_mirror : exact @id(2) @name("marked_to_mirror");
local_metadata.mirror_egress_port: optional @id(3) @name("mirror_egress_port");
}
actions = {
@proto_id(1) ingress_clone;
}
}
apply {
ingress_clone_table.apply();
}
}
control mirror_session_lookup(inout headers_t headers, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) {
@id(0x01000007) action mirror_as_ipv4_erspan(@id(1) port_id_t port, @id(2) @format(IPV4_ADDRESS) ipv4_addr_t src_ip, @id(3) @format(IPV4_ADDRESS) ipv4_addr_t dst_ip, @id(4) @format(MAC_ADDRESS) ethernet_addr_t src_mac, @id(5) @format(MAC_ADDRESS) ethernet_addr_t dst_mac, @id(6) bit<8> ttl, @id(7) bit<8> tos) {
}
@id(0x0100001D) @unsupported action mirror_with_vlan_tag_and_ipfix_encapsulation(@id(1) port_id_t monitor_port, @id(2) port_id_t monitor_failover_port, @id(3) @format(MAC_ADDRESS) ethernet_addr_t mirror_encap_src_mac, @id(4) @format(MAC_ADDRESS) ethernet_addr_t mirror_encap_dst_mac, @id(6) vlan_id_t mirror_encap_vlan_id, @id(7) @format(IPV6_ADDRESS) ipv6_addr_t mirror_encap_dst_ip, @id(8) @format(IPV6_ADDRESS) ipv6_addr_t mirror_encap_src_ip, @id(9) bit<16> mirror_encap_udp_src_port, @id(10) bit<16> mirror_encap_udp_dst_port) {
local_metadata.mirror_egress_port = monitor_port;
local_metadata.mirror_encap_src_mac = mirror_encap_src_mac;
local_metadata.mirror_encap_dst_mac = mirror_encap_dst_mac;
local_metadata.mirror_encap_vlan_id = mirror_encap_vlan_id;
local_metadata.mirror_encap_src_ip = mirror_encap_src_ip;
local_metadata.mirror_encap_dst_ip = mirror_encap_dst_ip;
local_metadata.mirror_encap_udp_src_port = mirror_encap_udp_src_port;
local_metadata.mirror_encap_udp_dst_port = mirror_encap_udp_dst_port;
}
@p4runtime_role("sdn_controller") @id(0x02000046) table mirror_session_table {
key = {
local_metadata.mirror_session_id: exact @id(1) @name("mirror_session_id");
}
actions = {
@proto_id(1) mirror_as_ipv4_erspan;
@proto_id(2) mirror_with_vlan_tag_and_ipfix_encapsulation;
@defaultonly NoAction;
}
const default_action = NoAction;
size = 4;
}
apply {
if (local_metadata.marked_to_mirror) {
mirror_session_table.apply();
}
}
}
control mirroring_encap(inout headers_t headers, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) {
apply {
if (standard_metadata.instance_type == 1 && standard_metadata.egress_rid == 2) {
headers.mirror_encap_ethernet.setValid();
headers.mirror_encap_ethernet.src_addr = local_metadata.mirror_encap_src_mac;
headers.mirror_encap_ethernet.dst_addr = local_metadata.mirror_encap_dst_mac;
headers.mirror_encap_ethernet.ether_type = 0x8100;
headers.mirror_encap_vlan.setValid();
headers.mirror_encap_vlan.ether_type = 0x86dd;
headers.mirror_encap_vlan.vlan_id = local_metadata.mirror_encap_vlan_id;
headers.mirror_encap_ipv6.setValid();
headers.mirror_encap_ipv6.version = 4w6;
headers.mirror_encap_ipv6.dscp = 0;
headers.mirror_encap_ipv6.ecn = 0;
headers.mirror_encap_ipv6.hop_limit = 16;
headers.mirror_encap_ipv6.flow_label = 0;
headers.mirror_encap_ipv6.payload_length = (bit<16>)standard_metadata.packet_length + 8 + 16 + 28;
headers.mirror_encap_ipv6.next_header = 0x11;
headers.mirror_encap_ipv6.src_addr = local_metadata.mirror_encap_src_ip;
headers.mirror_encap_ipv6.dst_addr = local_metadata.mirror_encap_dst_ip;
headers.mirror_encap_udp.setValid();
headers.mirror_encap_udp.src_port = local_metadata.mirror_encap_udp_src_port;
headers.mirror_encap_udp.dst_port = local_metadata.mirror_encap_udp_dst_port;
headers.mirror_encap_udp.hdr_length = headers.mirror_encap_ipv6.payload_length;
headers.mirror_encap_udp.checksum = 0;
headers.ipfix.setValid();
headers.psamp_extended.setValid();
}
}
}
control l3_admit(in headers_t headers, inout local_metadata_t local_metadata, in standard_metadata_t standard_metadata) {
@id(0x01000008) action admit_to_l3() {
local_metadata.admit_to_l3 = true;
}
@p4runtime_role("sdn_controller") @id(0x02000047) table l3_admit_table {
key = {
headers.ethernet.dst_addr : ternary @name("dst_mac") @id(1) @format(MAC_ADDRESS);
local_metadata.ingress_port: optional @name("in_port") @id(2);
}
actions = {
@proto_id(1) admit_to_l3;
@defaultonly NoAction;
}
const default_action = NoAction;
size = 64;
}
apply {
if (local_metadata.enable_vlan_checks && !(local_metadata.vlan_id == NO_VLAN_ID || local_metadata.vlan_id == INTERNAL_VLAN_ID)) {
local_metadata.admit_to_l3 = false;
} else {
l3_admit_table.apply();
}
}
}
control gre_tunnel_encap(inout headers_t headers, in local_metadata_t local_metadata, in standard_metadata_t standard_metadata) {
apply {
if (local_metadata.apply_tunnel_encap_at_egress) {
headers.tunnel_encap_gre.setValid();
headers.tunnel_encap_gre.checksum_present = 0;
headers.tunnel_encap_gre.routing_present = 0;
headers.tunnel_encap_gre.key_present = 0;
headers.tunnel_encap_gre.sequence_present = 0;
headers.tunnel_encap_gre.strict_source_route = 0;
headers.tunnel_encap_gre.recursion_control = 0;
headers.tunnel_encap_gre.flags = 0;
headers.tunnel_encap_gre.version = 0;
headers.tunnel_encap_gre.protocol = headers.ethernet.ether_type;
headers.ethernet.ether_type = 0x86dd;
headers.tunnel_encap_ipv6.setValid();
headers.tunnel_encap_ipv6.version = 4w6;
headers.tunnel_encap_ipv6.src_addr = local_metadata.tunnel_encap_src_ipv6;
headers.tunnel_encap_ipv6.dst_addr = local_metadata.tunnel_encap_dst_ipv6;
headers.tunnel_encap_ipv6.payload_length = (bit<16>)standard_metadata.packet_length + 4 - 14;
headers.tunnel_encap_ipv6.next_header = 0x2f;
if (headers.ipv4.isValid()) {
headers.tunnel_encap_ipv6.dscp = headers.ipv4.dscp;
headers.tunnel_encap_ipv6.ecn = headers.ipv4.ecn;
headers.tunnel_encap_ipv6.hop_limit = headers.ipv4.ttl;
} else if (headers.ipv6.isValid()) {
headers.tunnel_encap_ipv6.dscp = headers.ipv6.dscp;
headers.tunnel_encap_ipv6.ecn = headers.ipv6.ecn;
headers.tunnel_encap_ipv6.hop_limit = headers.ipv6.hop_limit;
}
}
}
}
control vlan_untag(inout headers_t headers, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) {
@id(0x0100001A) action disable_vlan_checks() {
local_metadata.enable_vlan_checks = false;
}
@p4runtime_role("sdn_controller") @id(0x0200004D) @entry_restriction("
// Force the dummy_match to be wildcard.
dummy_match::mask == 0;
") table disable_vlan_checks_table {
key = {
1w1: ternary @id(1) @name("dummy_match");
}
actions = {
@proto_id(1) disable_vlan_checks;
}
size = 1;
}
apply {
if (headers.vlan.isValid()) {
local_metadata.vlan_id = headers.vlan.vlan_id;
headers.ethernet.ether_type = headers.vlan.ether_type;
headers.vlan.setInvalid();
} else {
local_metadata.vlan_id = INTERNAL_VLAN_ID;
}
local_metadata.enable_vlan_checks = true;
disable_vlan_checks_table.apply();
}
}
control ingress_vlan_checks(inout headers_t headers, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) {
apply {
if (local_metadata.enable_vlan_checks && !(local_metadata.vlan_id == NO_VLAN_ID || local_metadata.vlan_id == INTERNAL_VLAN_ID)) {
mark_to_drop(standard_metadata);
}
}
}
control egress_vlan_checks(inout headers_t headers, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) {
apply {
if (local_metadata.enable_vlan_checks) {
if (standard_metadata.instance_type == 1 && standard_metadata.egress_rid == 2 && !(local_metadata.mirror_encap_vlan_id == NO_VLAN_ID || local_metadata.mirror_encap_vlan_id == INTERNAL_VLAN_ID)) {
mark_to_drop(standard_metadata);
} else if (!(standard_metadata.instance_type == 1 && standard_metadata.egress_rid == 1) && !(local_metadata.vlan_id == NO_VLAN_ID || local_metadata.vlan_id == INTERNAL_VLAN_ID)) {
mark_to_drop(standard_metadata);
}
}
}
}
control vlan_tag(inout headers_t headers, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) {
apply {
if (!(local_metadata.vlan_id == NO_VLAN_ID || local_metadata.vlan_id == INTERNAL_VLAN_ID) && !(standard_metadata.instance_type == 1 && standard_metadata.egress_rid == 2)) {
headers.vlan.setValid();
headers.vlan.priority_code_point = 0;
headers.vlan.drop_eligible_indicator = 0;
headers.vlan.vlan_id = local_metadata.vlan_id;
headers.vlan.ether_type = headers.ethernet.ether_type;
headers.ethernet.ether_type = 0x8100;
}
}
}
const ipv6_addr_t IPV6_MULTICAST_MASK = 0xff000000000000000000000000000000;
const ipv6_addr_t IPV6_MULTICAST_VALUE = 0xff000000000000000000000000000000;
const ipv6_addr_t IPV6_LOOPBACK_MASK = 0xffffffffffffffffffffffffffffffff;
const ipv6_addr_t IPV6_LOOPBACK_VALUE = 0x1;
const ipv4_addr_t IPV4_MULTICAST_MASK = 0xf0000000;
const ipv4_addr_t IPV4_MULTICAST_VALUE = 0xe0000000;
const ipv4_addr_t IPV4_BROADCAST_VALUE = 0xffffffff;
const ipv4_addr_t IPV4_LOOPBACK_MASK = 0xff000000;
const ipv4_addr_t IPV4_LOOPBACK_VALUE = 0x7f000000;
const ethernet_addr_t MAC_MULTICAST_MASK = 0x10000000000;
const ethernet_addr_t MAC_MULTICAST_VALUE = 0x10000000000;
control drop_martians(in headers_t headers, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) {
apply {
if (headers.ipv6.isValid() && (headers.ipv6.src_addr & IPV6_MULTICAST_MASK == IPV6_MULTICAST_VALUE || headers.ipv6.dst_addr & IPV6_MULTICAST_MASK == IPV6_MULTICAST_VALUE || headers.ipv6.src_addr & IPV6_LOOPBACK_MASK == IPV6_LOOPBACK_VALUE || headers.ipv6.dst_addr & IPV6_LOOPBACK_MASK == IPV6_LOOPBACK_VALUE) || headers.ipv4.isValid() && (headers.ipv4.src_addr & IPV4_MULTICAST_MASK == IPV4_MULTICAST_VALUE || headers.ipv4.src_addr == IPV4_BROADCAST_VALUE || (headers.ipv4.dst_addr & IPV4_MULTICAST_MASK == IPV4_MULTICAST_VALUE || headers.ipv4.dst_addr == IPV4_BROADCAST_VALUE) || headers.ipv4.src_addr & IPV4_LOOPBACK_MASK == IPV4_LOOPBACK_VALUE || headers.ipv4.dst_addr & IPV4_LOOPBACK_MASK == IPV4_LOOPBACK_VALUE) || headers.ethernet.isValid() && headers.ethernet.dst_addr & MAC_MULTICAST_MASK == MAC_MULTICAST_VALUE) {
mark_to_drop(standard_metadata);
}
}
}
control multicast_rewrites(inout local_metadata_t local_metadata, in standard_metadata_t standard_metadata) {
port_id_t multicast_replica_port = (port_id_t)standard_metadata.egress_port;
replica_instance_t multicast_replica_instance = standard_metadata.egress_rid;
@id(0x01000019) action set_multicast_src_mac(@id(1) @format(MAC_ADDRESS) ethernet_addr_t src_mac) {
local_metadata.enable_src_mac_rewrite = true;
local_metadata.packet_rewrites.src_mac = src_mac;
}
@p4runtime_role("sdn_controller") @id(0x0200004C) table multicast_router_interface_table {
key = {
multicast_replica_port : exact @referenced_by(builtin : : multicast_group_table , replica . port) @id(1);
multicast_replica_instance: exact @referenced_by(builtin : : multicast_group_table , replica . instance) @id(2);
}
actions = {
@proto_id(1) set_multicast_src_mac;
}
size = 110;
}
apply {
multicast_router_interface_table.apply();
}
}
control packet_rewrites(inout headers_t headers, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) {
apply {
if (standard_metadata.instance_type == 5) {
local_metadata.enable_decrement_ttl = true;
multicast_rewrites.apply(local_metadata, standard_metadata);
}
if (local_metadata.enable_src_mac_rewrite) {
headers.ethernet.src_addr = local_metadata.packet_rewrites.src_mac;
}
if (local_metadata.enable_dst_mac_rewrite) {
headers.ethernet.dst_addr = local_metadata.packet_rewrites.dst_mac;
}
if (local_metadata.enable_vlan_rewrite) {
local_metadata.vlan_id = local_metadata.packet_rewrites.vlan_id;
}
if (headers.ipv4.isValid()) {
if (headers.ipv4.ttl > 0 && local_metadata.enable_decrement_ttl) {
headers.ipv4.ttl = headers.ipv4.ttl - 1;
}
if (headers.ipv4.ttl == 0) {
mark_to_drop(standard_metadata);
}
}
if (headers.ipv6.isValid()) {
if (headers.ipv6.hop_limit > 0 && local_metadata.enable_decrement_ttl) {
headers.ipv6.hop_limit = headers.ipv6.hop_limit - 1;
}
if (headers.ipv6.hop_limit == 0) {
mark_to_drop(standard_metadata);
}
}
}
}
control tunnel_termination_lookup(in headers_t headers, inout local_metadata_t local_metadata) {
@id(0x01000016) action mark_for_tunnel_decap_and_set_vrf(@refers_to(vrf_table , vrf_id) vrf_id_t vrf_id) {
local_metadata.apply_tunnel_decap_at_end_of_pre_ingress = true;
local_metadata.vrf_id = vrf_id;
}
@unsupported @p4runtime_role("sdn_controller") @id(0x0200004B) table ipv6_tunnel_termination_table {
key = {
headers.ipv6.dst_addr: ternary @id(1) @name("dst_ipv6") @format(IPV6_ADDRESS);
headers.ipv6.src_addr: ternary @id(2) @name("src_ipv6") @format(IPV6_ADDRESS);
}
actions = {
@proto_id(1) mark_for_tunnel_decap_and_set_vrf;
}
size = 126;
}
apply {
if (headers.ipv6.isValid()) {
if (headers.ipv6.next_header == 0x4 || headers.ipv6.next_header == 0x29) {
ipv6_tunnel_termination_table.apply();
}
}
}
}
control tunnel_termination_decap(inout headers_t headers, in local_metadata_t local_metadata) {
apply {
if (local_metadata.apply_tunnel_decap_at_end_of_pre_ingress) {