-
Notifications
You must be signed in to change notification settings - Fork 4
/
const.go
3742 lines (3275 loc) · 115 KB
/
const.go
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
/*
* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
* Copyright (c) 2011, 2012 Open Networking Foundation
* Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler.
* Copyright 2018, Red Hat, Inc.
*/
// Automatically generated by LOXI from template const.go
// Do not modify
package of15
import (
"fmt"
"strings"
)
const (
// Identifiers from group macro_definitions
MaxTableNameLen = 32 // OFP_MAX_TABLE_NAME_LEN
MaxPortNameLen = 16 // OFP_MAX_PORT_NAME_LEN
TCPPort = 6653 // OFP_TCP_PORT
SSLPort = 6653 // OFP_SSL_PORT
EthAlen = 6 // OFP_ETH_ALEN
DefaultMissSendLen = 128 // OFP_DEFAULT_MISS_SEND_LEN
VLANNone = 0 // OFP_VLAN_NONE
FlowPermanent = 0 // OFP_FLOW_PERMANENT
DefaultPriority = 32768 // OFP_DEFAULT_PRIORITY
NoBuffer = 4294967295 // OFP_NO_BUFFER
DescStrLen = 256 // DESC_STR_LEN
SerialNumLen = 32 // SERIAL_NUM_LEN
OFPQAll = 4294967295 // OFPQ_ALL
OFPQMaxRateUncfg = 65535 // OFPQ_MAX_RATE_UNCFG
OFPQMinRateUncfg = 65535 // OFPQ_MIN_RATE_UNCFG
)
const (
// Identifiers from group nx_action_controller2_prop_type
Nxac2PtMaxLen = 0 // NXAC2PT_MAX_LEN
Nxac2PtControllerID = 1 // NXAC2PT_CONTROLLER_ID
Nxac2PtReason = 2 // NXAC2PT_REASON
Nxac2PtUserdata = 3 // NXAC2PT_USERDATA
Nxac2PtPause = 4 // NXAC2PT_PAUSE
Nxac2PtMeterID = 5 // NXAC2PT_METER_ID
)
type NxActionController2PropType uint16
func (self NxActionController2PropType) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group nx_bd_algorithms
NxBdAlgActiveBackup = 0 // NX_BD_ALG_ACTIVE_BACKUP
NxBdAlgHrw = 1 // NX_BD_ALG_HRW
)
type NxBdAlgorithms uint16
func (self NxBdAlgorithms) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("\"%s\"", self)), nil
}
func (self NxBdAlgorithms) String() string {
switch self {
case NxBdAlgActiveBackup:
return "active_backup"
case NxBdAlgHrw:
return "hrw"
default:
return fmt.Sprintf("%d", self)
}
}
const (
// Identifiers from group nx_conntrack_flags
NxCtFCommit = 1 // NX_CT_F_COMMIT
NxCtFForce = 2 // NX_CT_F_FORCE
)
type NxConntrackFlags uint16
func (self NxConntrackFlags) MarshalJSON() ([]byte, error) {
var flags []string
if self&NxCtFCommit == NxCtFCommit {
flags = append(flags, "\"Commit\": true")
}
if self&NxCtFForce == NxCtFForce {
flags = append(flags, "\"Force\": true")
}
return []byte("{" + strings.Join(flags, ", ") + "}"), nil
}
const (
// Identifiers from group nx_flow_monitor_flags
NxfmfInitial = 1 // NXFMF_INITIAL
NxfmfAdd = 2 // NXFMF_ADD
NxfmfDelete = 4 // NXFMF_DELETE
NxfmfModify = 8 // NXFMF_MODIFY
NxfmfActions = 16 // NXFMF_ACTIONS
NxfmfOwn = 32 // NXFMF_OWN
)
type NxFlowMonitorFlags uint16
func (self NxFlowMonitorFlags) MarshalJSON() ([]byte, error) {
var flags []string
if self&NxfmfInitial == NxfmfInitial {
flags = append(flags, "\"Initial\": true")
}
if self&NxfmfAdd == NxfmfAdd {
flags = append(flags, "\"Add\": true")
}
if self&NxfmfDelete == NxfmfDelete {
flags = append(flags, "\"Delete\": true")
}
if self&NxfmfModify == NxfmfModify {
flags = append(flags, "\"Modify\": true")
}
if self&NxfmfActions == NxfmfActions {
flags = append(flags, "\"Actions\": true")
}
if self&NxfmfOwn == NxfmfOwn {
flags = append(flags, "\"Own\": true")
}
return []byte("{" + strings.Join(flags, ", ") + "}"), nil
}
const (
// Identifiers from group nx_hash_fields
NxHashFieldsEthSrc = 0 // NX_HASH_FIELDS_ETH_SRC
NxHashFieldsSymmetricL4 = 1 // NX_HASH_FIELDS_SYMMETRIC_L4
NxHashFieldsSymmetricL3L4 = 2 // NX_HASH_FIELDS_SYMMETRIC_L3L4
NxHashFieldsSymmetricL3L4Udp = 3 // NX_HASH_FIELDS_SYMMETRIC_L3L4_UDP
NxHashFieldsNwSrc = 4 // NX_HASH_FIELDS_NW_SRC
NxHashFieldsNwDst = 5 // NX_HASH_FIELDS_NW_DST
NxHashFieldsSymmetricL3 = 6 // NX_HASH_FIELDS_SYMMETRIC_L3
)
type NxHashFields uint16
func (self NxHashFields) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("\"%s\"", self)), nil
}
func (self NxHashFields) String() string {
switch self {
case NxHashFieldsEthSrc:
return "eth_src"
case NxHashFieldsSymmetricL4:
return "symmetric_l4"
case NxHashFieldsSymmetricL3L4:
return "symmetric_l3l4"
case NxHashFieldsSymmetricL3L4Udp:
return "symmetric_l3l4_udp"
case NxHashFieldsNwSrc:
return "nw_src"
case NxHashFieldsNwDst:
return "nw_dst"
case NxHashFieldsSymmetricL3:
return "symmetric_l3"
default:
return fmt.Sprintf("%d", self)
}
}
const (
// Identifiers from group nx_mp_algorithm
NxMpAlgModuloN = 0 // NX_MP_ALG_MODULO_N
NxMpAlgHashThreshold = 1 // NX_MP_ALG_HASH_THRESHOLD
NxMpAlgHrw = 2 // NX_MP_ALG_HRW
NxMpAlgIterHash = 3 // NX_MP_ALG_ITER_HASH
)
type NxMpAlgorithm uint16
func (self NxMpAlgorithm) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("\"%s\"", self)), nil
}
func (self NxMpAlgorithm) String() string {
switch self {
case NxMpAlgModuloN:
return "modulo_n"
case NxMpAlgHashThreshold:
return "hash_threshold"
case NxMpAlgHrw:
return "hrw"
case NxMpAlgIterHash:
return "iter_hash"
default:
return fmt.Sprintf("%d", self)
}
}
const (
// Identifiers from group of_action_nx_bundle_slave_type
NxmOfInPort = 2 // NXM_OF_IN_PORT
NxmOfJustThereToDefinePrefix = 10000 // NXM_OF_JUST_THERE_TO_DEFINE_PREFIX
)
type ActionNxBundleSlaveType uint32
func (self ActionNxBundleSlaveType) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("\"%s\"", self)), nil
}
func (self ActionNxBundleSlaveType) String() string {
switch self {
case NxmOfInPort:
return "in_port"
case NxmOfJustThereToDefinePrefix:
return "just_there_to_define_prefix"
default:
return fmt.Sprintf("%d", self)
}
}
const (
// Identifiers from group of_bsn_gentable_error_code
OFBSNGentableErrorUnknown = 0 // OF_BSN_GENTABLE_ERROR_UNKNOWN
OFBSNGentableErrorParam = 1 // OF_BSN_GENTABLE_ERROR_PARAM
OFBSNGentableErrorTableFull = 2 // OF_BSN_GENTABLE_ERROR_TABLE_FULL
)
type BsnGentableErrorCode uint16
func (self BsnGentableErrorCode) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group of_bsn_hash_gtp_port_match
OFBSNHashGtpPortMatchSrc = 1 // OF_BSN_HASH_GTP_PORT_MATCH_SRC
OFBSNHashGtpPortMatchDst = 2 // OF_BSN_HASH_GTP_PORT_MATCH_DST
OFBSNHashGtpPortMatchSrcOrDst = 3 // OF_BSN_HASH_GTP_PORT_MATCH_SRC_OR_DST
OFBSNHashGtpPortMatchSrcAndDst = 4 // OF_BSN_HASH_GTP_PORT_MATCH_SRC_AND_DST
)
type BsnHashGtpPortMatch uint8
func (self BsnHashGtpPortMatch) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group of_bsn_hash_packet_field
BSNHashFieldDstMAC = 2 // OFP_BSN_HASH_FIELD_DST_MAC
BSNHashFieldSrcMAC = 4 // OFP_BSN_HASH_FIELD_SRC_MAC
BSNHashFieldEthType = 8 // OFP_BSN_HASH_FIELD_ETH_TYPE
BSNHashFieldVLANID = 16 // OFP_BSN_HASH_FIELD_VLAN_ID
BSNHashFieldInnerL2 = 32 // OFP_BSN_HASH_FIELD_INNER_L2
BSNHashFieldInnerL3 = 64 // OFP_BSN_HASH_FIELD_INNER_L3
BSNHashFieldSrcIp = 128 // OFP_BSN_HASH_FIELD_SRC_IP
BSNHashFieldDstIp = 256 // OFP_BSN_HASH_FIELD_DST_IP
BSNHashFieldIpProto = 512 // OFP_BSN_HASH_FIELD_IP_PROTO
BSNHashFieldSrcL4Port = 1024 // OFP_BSN_HASH_FIELD_SRC_L4_PORT
BSNHashFieldDstL4Port = 2048 // OFP_BSN_HASH_FIELD_DST_L4_PORT
BSNHashFieldMplsLabel1 = 4096 // OFP_BSN_HASH_FIELD_MPLS_LABEL1
BSNHashFieldMplsLabel2 = 8192 // OFP_BSN_HASH_FIELD_MPLS_LABEL2
BSNHashFieldMplsLabel3 = 16384 // OFP_BSN_HASH_FIELD_MPLS_LABEL3
BSNHashFieldMplsLabelHiBits = 32768 // OFP_BSN_HASH_FIELD_MPLS_LABEL_HI_BITS
BSNHashFieldMplsPayloadSrcIp = 65536 // OFP_BSN_HASH_FIELD_MPLS_PAYLOAD_SRC_IP
BSNHashFieldMplsPayloadDstIp = 131072 // OFP_BSN_HASH_FIELD_MPLS_PAYLOAD_DST_IP
BSNHashFieldSymmetric = 262144 // OFP_BSN_HASH_FIELD_SYMMETRIC
)
type BsnHashPacketField uint64
func (self BsnHashPacketField) MarshalJSON() ([]byte, error) {
var flags []string
if self&BSNHashFieldDstMAC == BSNHashFieldDstMAC {
flags = append(flags, "\"DstMAC\": true")
}
if self&BSNHashFieldSrcMAC == BSNHashFieldSrcMAC {
flags = append(flags, "\"SrcMAC\": true")
}
if self&BSNHashFieldEthType == BSNHashFieldEthType {
flags = append(flags, "\"EthType\": true")
}
if self&BSNHashFieldVLANID == BSNHashFieldVLANID {
flags = append(flags, "\"VlanID\": true")
}
if self&BSNHashFieldInnerL2 == BSNHashFieldInnerL2 {
flags = append(flags, "\"InnerL2\": true")
}
if self&BSNHashFieldInnerL3 == BSNHashFieldInnerL3 {
flags = append(flags, "\"InnerL3\": true")
}
if self&BSNHashFieldSrcIp == BSNHashFieldSrcIp {
flags = append(flags, "\"SrcIp\": true")
}
if self&BSNHashFieldDstIp == BSNHashFieldDstIp {
flags = append(flags, "\"DstIp\": true")
}
if self&BSNHashFieldIpProto == BSNHashFieldIpProto {
flags = append(flags, "\"IpProto\": true")
}
if self&BSNHashFieldSrcL4Port == BSNHashFieldSrcL4Port {
flags = append(flags, "\"SrcL4Port\": true")
}
if self&BSNHashFieldDstL4Port == BSNHashFieldDstL4Port {
flags = append(flags, "\"DstL4Port\": true")
}
if self&BSNHashFieldMplsLabel1 == BSNHashFieldMplsLabel1 {
flags = append(flags, "\"MplsLabel1\": true")
}
if self&BSNHashFieldMplsLabel2 == BSNHashFieldMplsLabel2 {
flags = append(flags, "\"MplsLabel2\": true")
}
if self&BSNHashFieldMplsLabel3 == BSNHashFieldMplsLabel3 {
flags = append(flags, "\"MplsLabel3\": true")
}
if self&BSNHashFieldMplsLabelHiBits == BSNHashFieldMplsLabelHiBits {
flags = append(flags, "\"MplsLabelHiBits\": true")
}
if self&BSNHashFieldMplsPayloadSrcIp == BSNHashFieldMplsPayloadSrcIp {
flags = append(flags, "\"MplsPayloadSrcIp\": true")
}
if self&BSNHashFieldMplsPayloadDstIp == BSNHashFieldMplsPayloadDstIp {
flags = append(flags, "\"MplsPayloadDstIp\": true")
}
if self&BSNHashFieldSymmetric == BSNHashFieldSymmetric {
flags = append(flags, "\"Symmetric\": true")
}
return []byte("{" + strings.Join(flags, ", ") + "}"), nil
}
const (
// Identifiers from group of_bsn_hash_packet_type
OFBSNHashPacketL2 = 0 // OF_BSN_HASH_PACKET_L2
OFBSNHashPacketL2Gre = 1 // OF_BSN_HASH_PACKET_L2GRE
OFBSNHashPacketIpv4 = 3 // OF_BSN_HASH_PACKET_IPV4
OFBSNHashPacketIpv6 = 4 // OF_BSN_HASH_PACKET_IPV6
OFBSNHashPacketMpls = 5 // OF_BSN_HASH_PACKET_MPLS
OFBSNHashPacketSymmetric = 6 // OF_BSN_HASH_PACKET_SYMMETRIC
)
type BsnHashPacketType uint8
func (self BsnHashPacketType) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group of_bsn_hash_type
BSNHashTypeL2 = 0 // OFP_BSN_HASH_TYPE_L2
BSNHashTypeL3 = 1 // OFP_BSN_HASH_TYPE_L3
BSNHashTypeEnhanced = 2 // OFP_BSN_HASH_TYPE_ENHANCED
)
type BsnHashType uint8
func (self BsnHashType) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group of_bsn_lacp_convergence_status
LacpSuccess = 0 // LACP_SUCCESS
LacpTimedout = 1 // LACP_TIMEDOUT
LacpOutOfSync = 2 // LACP_OUT_OF_SYNC
)
type BsnLacpConvergenceStatus uint8
func (self BsnLacpConvergenceStatus) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group of_bsn_pdu_slot_num
BsnPduSlotNumAny = 255 // BSN_PDU_SLOT_NUM_ANY
)
type BsnPduSlotNum uint8
func (self BsnPduSlotNum) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group of_bsn_vlan_counter
BSNVLANCounterRxBytes = 0 // OFP_BSN_VLAN_COUNTER_RX_BYTES
BSNVLANCounterRxPackets = 1 // OFP_BSN_VLAN_COUNTER_RX_PACKETS
BSNVLANCounterTxBytes = 2 // OFP_BSN_VLAN_COUNTER_TX_BYTES
BSNVLANCounterTxPackets = 3 // OFP_BSN_VLAN_COUNTER_TX_PACKETS
)
type BsnVlanCounter uint8
func (self BsnVlanCounter) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group of_bsn_vrf_counter
BSNVrfCounterBytes = 0 // OFP_BSN_VRF_COUNTER_BYTES
BSNVrfCounterPackets = 1 // OFP_BSN_VRF_COUNTER_PACKETS
)
type BsnVrfCounter uint8
func (self BsnVrfCounter) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group of_nx_nat_range
NxNatRangeIpv4Min = 1 // NX_NAT_RANGE_IPV4_MIN
NxNatRangeIpv4Max = 2 // NX_NAT_RANGE_IPV4_MAX
NxNatRangeIpv6Min = 4 // NX_NAT_RANGE_IPV6_MIN
NxNatRangeIpv6Max = 8 // NX_NAT_RANGE_IPV6_MAX
NxNatRangeProtoMin = 16 // NX_NAT_RANGE_PROTO_MIN
NxNatRangeProtoMax = 32 // NX_NAT_RANGE_PROTO_MAX
)
type NxNatRange uint16
func (self NxNatRange) MarshalJSON() ([]byte, error) {
var flags []string
if self&NxNatRangeIpv4Min == NxNatRangeIpv4Min {
flags = append(flags, "\"Ipv4Min\": true")
}
if self&NxNatRangeIpv4Max == NxNatRangeIpv4Max {
flags = append(flags, "\"Ipv4Max\": true")
}
if self&NxNatRangeIpv6Min == NxNatRangeIpv6Min {
flags = append(flags, "\"Ipv6Min\": true")
}
if self&NxNatRangeIpv6Max == NxNatRangeIpv6Max {
flags = append(flags, "\"Ipv6Max\": true")
}
if self&NxNatRangeProtoMin == NxNatRangeProtoMin {
flags = append(flags, "\"ProtoMin\": true")
}
if self&NxNatRangeProtoMax == NxNatRangeProtoMax {
flags = append(flags, "\"ProtoMax\": true")
}
return []byte("{" + strings.Join(flags, ", ") + "}"), nil
}
const (
// Identifiers from group ofp_action_type
OFPATOutput = 0 // OFPAT_OUTPUT
OFPATCopyTtlOut = 11 // OFPAT_COPY_TTL_OUT
OFPATCopyTtlIn = 12 // OFPAT_COPY_TTL_IN
OFPATSetMplsTtl = 15 // OFPAT_SET_MPLS_TTL
OFPATDecMplsTtl = 16 // OFPAT_DEC_MPLS_TTL
OFPATPushVLAN = 17 // OFPAT_PUSH_VLAN
OFPATPopVLAN = 18 // OFPAT_POP_VLAN
OFPATPushMpls = 19 // OFPAT_PUSH_MPLS
OFPATPopMpls = 20 // OFPAT_POP_MPLS
OFPATSetQueue = 21 // OFPAT_SET_QUEUE
OFPATGroup = 22 // OFPAT_GROUP
OFPATSetNwTtl = 23 // OFPAT_SET_NW_TTL
OFPATDecNwTtl = 24 // OFPAT_DEC_NW_TTL
OFPATSetField = 25 // OFPAT_SET_FIELD
OFPATPushPbb = 26 // OFPAT_PUSH_PBB
OFPATPopPbb = 27 // OFPAT_POP_PBB
OFPATCopyField = 28 // OFPAT_COPY_FIELD
OFPATMeter = 29 // OFPAT_METER
OFPATExperimenter = 65535 // OFPAT_EXPERIMENTER
)
type ActionType uint16
func (self ActionType) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group ofp_async_config_failed_code
OFPACFCInvalid = 0 // OFPACFC_INVALID
OFPACFCUnsupported = 1 // OFPACFC_UNSUPPORTED
OFPACFCEperm = 2 // OFPACFC_EPERM
)
type AsyncConfigFailedCode uint16
func (self AsyncConfigFailedCode) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group ofp_async_config_prop_type
OFPACPTPacketInSlave = 0 // OFPACPT_PACKET_IN_SLAVE
OFPACPTPacketInMaster = 1 // OFPACPT_PACKET_IN_MASTER
OFPACPTPortStatusSlave = 2 // OFPACPT_PORT_STATUS_SLAVE
OFPACPTPortStatusMaster = 3 // OFPACPT_PORT_STATUS_MASTER
OFPACPTFlowRemovedSlave = 4 // OFPACPT_FLOW_REMOVED_SLAVE
OFPACPTFlowRemovedMaster = 5 // OFPACPT_FLOW_REMOVED_MASTER
OFPACPTRoleStatusSlave = 6 // OFPACPT_ROLE_STATUS_SLAVE
OFPACPTRoleStatusMaster = 7 // OFPACPT_ROLE_STATUS_MASTER
OFPACPTTableStatusSlave = 8 // OFPACPT_TABLE_STATUS_SLAVE
OFPACPTTableStatusMaster = 9 // OFPACPT_TABLE_STATUS_MASTER
OFPACPTRequestforwardSlave = 10 // OFPACPT_REQUESTFORWARD_SLAVE
OFPACPTRequestforwardMaster = 11 // OFPACPT_REQUESTFORWARD_MASTER
OFPACPTFlowStatsSlave = 12 // OFPACPT_FLOW_STATS_SLAVE
OFPACPTFlowStatsMaster = 13 // OFPACPT_FLOW_STATS_MASTER
OFPACPTContStatusSlave = 14 // OFPACPT_CONT_STATUS_SLAVE
OFPACPTContStatusMaster = 15 // OFPACPT_CONT_STATUS_MASTER
OFPACPTExperimenterSlave = 65534 // OFPACPT_EXPERIMENTER_SLAVE
OFPACPTExperimenterMaster = 65535 // OFPACPT_EXPERIMENTER_MASTER
)
const (
// Identifiers from group ofp_bad_action_code
OFPBACBadType = 0 // OFPBAC_BAD_TYPE
OFPBACBadLen = 1 // OFPBAC_BAD_LEN
OFPBACBadExperimenter = 2 // OFPBAC_BAD_EXPERIMENTER
OFPBACBadExperimenterType = 3 // OFPBAC_BAD_EXPERIMENTER_TYPE
OFPBACBadOutPort = 4 // OFPBAC_BAD_OUT_PORT
OFPBACBadArgument = 5 // OFPBAC_BAD_ARGUMENT
OFPBACEperm = 6 // OFPBAC_EPERM
OFPBACTooMany = 7 // OFPBAC_TOO_MANY
OFPBACBadQueue = 8 // OFPBAC_BAD_QUEUE
OFPBACBadOutGroup = 9 // OFPBAC_BAD_OUT_GROUP
OFPBACMatchInconsistent = 10 // OFPBAC_MATCH_INCONSISTENT
OFPBACUnsupportedOrder = 11 // OFPBAC_UNSUPPORTED_ORDER
OFPBACBadTag = 12 // OFPBAC_BAD_TAG
OFPBACBadSetType = 13 // OFPBAC_BAD_SET_TYPE
OFPBACBadSetLen = 14 // OFPBAC_BAD_SET_LEN
OFPBACBadSetArgument = 15 // OFPBAC_BAD_SET_ARGUMENT
OFPBACBadSetMask = 16 // OFPBAC_BAD_SET_MASK
OFPBACBadMeter = 17 // OFPBAC_BAD_METER
)
type BadActionCode uint16
func (self BadActionCode) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group ofp_bad_instruction_code
OFPBICUnknownInst = 0 // OFPBIC_UNKNOWN_INST
OFPBICUnsupInst = 1 // OFPBIC_UNSUP_INST
OFPBICBadTableID = 2 // OFPBIC_BAD_TABLE_ID
OFPBICUnsupMetadata = 3 // OFPBIC_UNSUP_METADATA
OFPBICUnsupMetadataMask = 4 // OFPBIC_UNSUP_METADATA_MASK
OFPBICBadExperimenter = 5 // OFPBIC_BAD_EXPERIMENTER
OFPBICBadExperimenterType = 6 // OFPBIC_BAD_EXPERIMENTER_TYPE
OFPBICBadLen = 7 // OFPBIC_BAD_LEN
OFPBICEperm = 8 // OFPBIC_EPERM
OFPBICDupInst = 9 // OFPBIC_DUP_INST
)
type BadInstructionCode uint16
func (self BadInstructionCode) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group ofp_bad_match_code
OFPBMCBadType = 0 // OFPBMC_BAD_TYPE
OFPBMCBadLen = 1 // OFPBMC_BAD_LEN
OFPBMCBadTag = 2 // OFPBMC_BAD_TAG
OFPBMCBadDlAddrMask = 3 // OFPBMC_BAD_DL_ADDR_MASK
OFPBMCBadNwAddrMask = 4 // OFPBMC_BAD_NW_ADDR_MASK
OFPBMCBadWildcards = 5 // OFPBMC_BAD_WILDCARDS
OFPBMCBadField = 6 // OFPBMC_BAD_FIELD
OFPBMCBadValue = 7 // OFPBMC_BAD_VALUE
OFPBMCBadMask = 8 // OFPBMC_BAD_MASK
OFPBMCBadPrereq = 9 // OFPBMC_BAD_PREREQ
OFPBMCDupField = 10 // OFPBMC_DUP_FIELD
OFPBMCEperm = 11 // OFPBMC_EPERM
)
type BadMatchCode uint16
func (self BadMatchCode) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group ofp_bad_property_code
OFPBPCBadType = 0 // OFPBPC_BAD_TYPE
OFPBPCBadLen = 1 // OFPBPC_BAD_LEN
OFPBPCBadValue = 2 // OFPBPC_BAD_VALUE
OFPBPCTooMany = 3 // OFPBPC_TOO_MANY
OFPBPCDupType = 4 // OFPBPC_DUP_TYPE
OFPBPCBadExperimenter = 5 // OFPBPC_BAD_EXPERIMENTER
OFPBPCBadExpType = 6 // OFPBPC_BAD_EXP_TYPE
OFPBPCBadExpValue = 7 // OFPBPC_BAD_EXP_VALUE
OFPBPCEperm = 8 // OFPBPC_EPERM
)
type BadPropertyCode uint16
func (self BadPropertyCode) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group ofp_bad_request_code
OFPBRCBadVersion = 0 // OFPBRC_BAD_VERSION
OFPBRCBadType = 1 // OFPBRC_BAD_TYPE
OFPBRCBadStat = 2 // OFPBRC_BAD_STAT
OFPBRCBadExperimenter = 3 // OFPBRC_BAD_EXPERIMENTER
OFPBRCBadExperimenterType = 4 // OFPBRC_BAD_EXPERIMENTER_TYPE
OFPBRCEperm = 5 // OFPBRC_EPERM
OFPBRCBadLen = 6 // OFPBRC_BAD_LEN
OFPBRCBufferEmpty = 7 // OFPBRC_BUFFER_EMPTY
OFPBRCBufferUnknown = 8 // OFPBRC_BUFFER_UNKNOWN
OFPBRCBadTableID = 9 // OFPBRC_BAD_TABLE_ID
OFPBRCIsSlave = 10 // OFPBRC_IS_SLAVE
OFPBRCBadPort = 11 // OFPBRC_BAD_PORT
OFPBRCBadPacket = 12 // OFPBRC_BAD_PACKET
OFPBRCMultipartBufferOverflow = 13 // OFPBRC_MULTIPART_BUFFER_OVERFLOW
OFPBRCMultipartRequestTimeout = 14 // OFPBRC_MULTIPART_REQUEST_TIMEOUT
OFPBRCMultipartReplyTimeout = 15 // OFPBRC_MULTIPART_REPLY_TIMEOUT
OFPBRCMultipartBadSched = 16 // OFPBRC_MULTIPART_BAD_SCHED
OFPBRCPipelineFieldsOnly = 17 // OFPBRC_PIPELINE_FIELDS_ONLY
OFPBRCUnknown = 18 // OFPBRC_UNKNOWN
)
type BadRequestCode uint16
func (self BadRequestCode) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group ofp_bsn_anchor
BSNAnchorPacketStart = 0 // OFP_BSN_ANCHOR_PACKET_START
BSNAnchorL3HeaderStart = 1 // OFP_BSN_ANCHOR_L3_HEADER_START
BSNAnchorL4HeaderStart = 2 // OFP_BSN_ANCHOR_L4_HEADER_START
BSNAnchorL4PayloadStart = 3 // OFP_BSN_ANCHOR_L4_PAYLOAD_START
)
type BsnAnchor uint16
func (self BsnAnchor) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group ofp_bsn_auto_negotiation_type
BSNAutoNegotiationDefault = 0 // OFP_BSN_AUTO_NEGOTIATION_DEFAULT
BSNAutoNegotiationEnable = 1 // OFP_BSN_AUTO_NEGOTIATION_ENABLE
BSNAutoNegotiationDisable = 2 // OFP_BSN_AUTO_NEGOTIATION_DISABLE
)
type BsnAutoNegotiationType uint8
func (self BsnAutoNegotiationType) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group ofp_bsn_bfd_endpoint
BSNBfdUnused = 0 // OFP_BSN_BFD_UNUSED
BSNBfdMicro = 1 // OFP_BSN_BFD_MICRO
BSNBfd1Hop = 2 // OFP_BSN_BFD_1_HOP
BSNBfdMultiHop = 3 // OFP_BSN_BFD_MULTI_HOP
)
type BsnBfdEndpoint uint8
func (self BsnBfdEndpoint) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group ofp_bsn_bfd_endpoint_state
BSNBfdEndpointStateAdmindown = 0 // OFP_BSN_BFD_ENDPOINT_STATE_ADMINDOWN
BSNBfdEndpointStateDown = 1 // OFP_BSN_BFD_ENDPOINT_STATE_DOWN
BSNBfdEndpointStateInit = 2 // OFP_BSN_BFD_ENDPOINT_STATE_INIT
BSNBfdEndpointStateUp = 3 // OFP_BSN_BFD_ENDPOINT_STATE_UP
BSNBfdEndpointSessionError = 4 // OFP_BSN_BFD_ENDPOINT_SESSION_ERROR
BSNBfdEndpointRemoteAdmindown = 5 // OFP_BSN_BFD_ENDPOINT_REMOTE_ADMINDOWN
BSNBfdEndpointParamsChange = 6 // OFP_BSN_BFD_ENDPOINT_PARAMS_CHANGE
)
type BsnBfdEndpointState uint8
func (self BsnBfdEndpointState) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group ofp_bsn_controller_connection_state
BSNControllerConnectionStateDisconnected = 0 // OFP_BSN_CONTROLLER_CONNECTION_STATE_DISCONNECTED
BSNControllerConnectionStateConnected = 1 // OFP_BSN_CONTROLLER_CONNECTION_STATE_CONNECTED
)
type BsnControllerConnectionState uint8
func (self BsnControllerConnectionState) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group ofp_bsn_decap
BSNDecapVxlan = 0 // OFP_BSN_DECAP_VXLAN
BSNDecapErspan = 1 // OFP_BSN_DECAP_ERSPAN
BSNDecapL2GRE = 2 // OFP_BSN_DECAP_L2_GRE
BSNDecapNvgre = 3 // OFP_BSN_DECAP_NVGRE
BSNDecapCapwap = 4 // OFP_BSN_DECAP_CAPWAP
BSNDecapL2Mpls = 5 // OFP_BSN_DECAP_L2_MPLS
BSNDecapL3GRE = 6 // OFP_BSN_DECAP_L3_GRE
BSNDecapGtp = 7 // OFP_BSN_DECAP_GTP
BSNDecapL3Mpls = 8 // OFP_BSN_DECAP_L3_MPLS
)
type BsnDecap uint16
func (self BsnDecap) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group ofp_bsn_encap
BSNEncapUnused = 0 // OFP_BSN_ENCAP_UNUSED
BSNEncapIpv4Udp = 1 // OFP_BSN_ENCAP_IPV4_UDP
BSNEncapIpv6Udp = 2 // OFP_BSN_ENCAP_IPV6_UDP
)
type BsnEncap uint8
func (self BsnEncap) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group ofp_bsn_enhanced_hash_type
BSNEnhancedHashL2 = 1 // OFP_BSN_ENHANCED_HASH_L2
BSNEnhancedHashL3 = 2 // OFP_BSN_ENHANCED_HASH_L3
BSNEnhancedHashL2Gre = 4 // OFP_BSN_ENHANCED_HASH_L2GRE
BSNEnhancedHashMpls = 8 // OFP_BSN_ENHANCED_HASH_MPLS
BSNEnhancedHashGtp = 16 // OFP_BSN_ENHANCED_HASH_GTP
BSNEnhancedHashSymmetric = 32 // OFP_BSN_ENHANCED_HASH_SYMMETRIC
)
type BsnEnhancedHashType uint64
func (self BsnEnhancedHashType) MarshalJSON() ([]byte, error) {
var flags []string
if self&BSNEnhancedHashL2 == BSNEnhancedHashL2 {
flags = append(flags, "\"L2\": true")
}
if self&BSNEnhancedHashL3 == BSNEnhancedHashL3 {
flags = append(flags, "\"L3\": true")
}
if self&BSNEnhancedHashL2Gre == BSNEnhancedHashL2Gre {
flags = append(flags, "\"L2Gre\": true")
}
if self&BSNEnhancedHashMpls == BSNEnhancedHashMpls {
flags = append(flags, "\"Mpls\": true")
}
if self&BSNEnhancedHashGtp == BSNEnhancedHashGtp {
flags = append(flags, "\"Gtp\": true")
}
if self&BSNEnhancedHashSymmetric == BSNEnhancedHashSymmetric {
flags = append(flags, "\"Symmetric\": true")
}
return []byte("{" + strings.Join(flags, ", ") + "}"), nil
}
const (
// Identifiers from group ofp_bsn_fabric_port_role
BSNFabricPortRolePartitionedSpine = 1 // OFP_BSN_FABRIC_PORT_ROLE_PARTITIONED_SPINE
)
type BsnFabricPortRole uint16
func (self BsnFabricPortRole) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group ofp_bsn_fec_config_state
BSNFecConfigStateUnset = 0 // OFP_BSN_FEC_CONFIG_STATE_UNSET
BSNFecConfigStateEnabled = 1 // OFP_BSN_FEC_CONFIG_STATE_ENABLED
BSNFecConfigStateDisabled = 2 // OFP_BSN_FEC_CONFIG_STATE_DISABLED
)
type BsnFecConfigState uint32
func (self BsnFecConfigState) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group ofp_bsn_flow_classifier
BSNFlowClassifierNone = 0 // OFP_BSN_FLOW_CLASSIFIER_NONE
BSNFlowClassifierL2Bc = 1 // OFP_BSN_FLOW_CLASSIFIER_L2BC
BSNFlowClassifierL2Uc = 2 // OFP_BSN_FLOW_CLASSIFIER_L2UC
BSNFlowClassifierL2Unknown = 3 // OFP_BSN_FLOW_CLASSIFIER_L2UNKNOWN
BSNFlowClassifierL2Mcknown = 4 // OFP_BSN_FLOW_CLASSIFIER_L2MCKNOWN
BSNFlowClassifierL2Mcunknown = 5 // OFP_BSN_FLOW_CLASSIFIER_L2MCUNKNOWN
BSNFlowClassifierL3Mcunknown = 6 // OFP_BSN_FLOW_CLASSIFIER_L3MCUNKNOWN
BSNFlowClassifierL3Mcknown = 7 // OFP_BSN_FLOW_CLASSIFIER_L3MCKNOWN
BSNFlowClassifierL3Ucknown = 8 // OFP_BSN_FLOW_CLASSIFIER_L3UCKNOWN
BSNFlowClassifierL3Ucunknown = 9 // OFP_BSN_FLOW_CLASSIFIER_L3UCUNKNOWN
)
type BsnFlowClassifier uint16
func (self BsnFlowClassifier) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group ofp_bsn_forward_error_correction_type
BSNForwardErrorCorrectionDefault = 0 // OFP_BSN_FORWARD_ERROR_CORRECTION_DEFAULT
BSNForwardErrorCorrectionEnable = 1 // OFP_BSN_FORWARD_ERROR_CORRECTION_ENABLE
BSNForwardErrorCorrectionDisable = 2 // OFP_BSN_FORWARD_ERROR_CORRECTION_DISABLE
)
type BsnForwardErrorCorrectionType uint8
func (self BsnForwardErrorCorrectionType) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group ofp_bsn_hash_algorithm_type
BSNHashAlgorithmCrc16Xor8 = 0 // OFP_BSN_HASH_ALGORITHM_CRC16XOR8
BSNHashAlgorithmCrc16Xor4 = 1 // OFP_BSN_HASH_ALGORITHM_CRC16XOR4
BSNHashAlgorithmCrc16Xor2 = 2 // OFP_BSN_HASH_ALGORITHM_CRC16XOR2
BSNHashAlgorithmCrc16Xor1 = 3 // OFP_BSN_HASH_ALGORITHM_CRC16XOR1
BSNHashAlgorithmCrc16 = 4 // OFP_BSN_HASH_ALGORITHM_CRC16
BSNHashAlgorithmXor16 = 5 // OFP_BSN_HASH_ALGORITHM_XOR16
BSNHashAlgorithmCrc16Ccitt = 6 // OFP_BSN_HASH_ALGORITHM_CRC16CCITT
BSNHashAlgorithmCrc32Lo = 7 // OFP_BSN_HASH_ALGORITHM_CRC32LO
BSNHashAlgorithmCrc32Hi = 8 // OFP_BSN_HASH_ALGORITHM_CRC32HI
)
type BsnHashAlgorithmType uint16
func (self BsnHashAlgorithmType) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group ofp_bsn_hash_select_flags
BSNHashSelectSrcIp = 1 // OFP_BSN_HASH_SELECT_SRC_IP
BSNHashSelectDstIp = 2 // OFP_BSN_HASH_SELECT_DST_IP
)
type BsnHashSelectFlags uint32
func (self BsnHashSelectFlags) MarshalJSON() ([]byte, error) {
var flags []string
if self&BSNHashSelectSrcIp == BSNHashSelectSrcIp {
flags = append(flags, "\"SrcIp\": true")
}
if self&BSNHashSelectDstIp == BSNHashSelectDstIp {
flags = append(flags, "\"DstIp\": true")
}
return []byte("{" + strings.Join(flags, ", ") + "}"), nil
}
const (
// Identifiers from group ofp_bsn_ip_tunnel_type
BSNIpTunnelTypeNone = 0 // OFP_BSN_IP_TUNNEL_TYPE_NONE
BSNIpTunnelTypePim = 1 // OFP_BSN_IP_TUNNEL_TYPE_PIM
)
type BsnIpTunnelType uint16
func (self BsnIpTunnelType) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group ofp_bsn_lacp_state
BSNLacpStateActivity = 1 // OFP_BSN_LACP_STATE_ACTIVITY
BSNLacpStateTimeout = 2 // OFP_BSN_LACP_STATE_TIMEOUT
BSNLacpStateAggregation = 4 // OFP_BSN_LACP_STATE_AGGREGATION
BSNLacpStateSynchronization = 8 // OFP_BSN_LACP_STATE_SYNCHRONIZATION
BSNLacpStateCollecting = 16 // OFP_BSN_LACP_STATE_COLLECTING
BSNLacpStateDistributing = 32 // OFP_BSN_LACP_STATE_DISTRIBUTING
BSNLacpStateDefaulted = 64 // OFP_BSN_LACP_STATE_DEFAULTED
BSNLacpStateExpired = 128 // OFP_BSN_LACP_STATE_EXPIRED
)
type BsnLacpState uint8
func (self BsnLacpState) MarshalJSON() ([]byte, error) {
var flags []string
if self&BSNLacpStateActivity == BSNLacpStateActivity {
flags = append(flags, "\"Activity\": true")
}
if self&BSNLacpStateTimeout == BSNLacpStateTimeout {
flags = append(flags, "\"Timeout\": true")
}
if self&BSNLacpStateAggregation == BSNLacpStateAggregation {
flags = append(flags, "\"Aggregation\": true")
}
if self&BSNLacpStateSynchronization == BSNLacpStateSynchronization {
flags = append(flags, "\"Synchronization\": true")
}
if self&BSNLacpStateCollecting == BSNLacpStateCollecting {
flags = append(flags, "\"Collecting\": true")
}
if self&BSNLacpStateDistributing == BSNLacpStateDistributing {
flags = append(flags, "\"Distributing\": true")
}
if self&BSNLacpStateDefaulted == BSNLacpStateDefaulted {
flags = append(flags, "\"Defaulted\": true")
}
if self&BSNLacpStateExpired == BSNLacpStateExpired {
flags = append(flags, "\"Expired\": true")
}
return []byte("{" + strings.Join(flags, ", ") + "}"), nil
}
const (
// Identifiers from group ofp_bsn_lag_flag
BSNLagFlagAutoRecovery = 1 // OFP_BSN_LAG_FLAG_AUTO_RECOVERY
)
type BsnLagFlag uint16
func (self BsnLagFlag) MarshalJSON() ([]byte, error) {
var flags []string
if self&BSNLagFlagAutoRecovery == BSNLagFlagAutoRecovery {
flags = append(flags, "\"BSNLagFlagAutoRecovery\": true")
}
return []byte("{" + strings.Join(flags, ", ") + "}"), nil
}
const (
// Identifiers from group ofp_bsn_loglevel
BSNLoglevelMsg = 0 // OFP_BSN_LOGLEVEL_MSG
BSNLoglevelError = 1 // OFP_BSN_LOGLEVEL_ERROR
BSNLoglevelWarn = 2 // OFP_BSN_LOGLEVEL_WARN
BSNLoglevelInfo = 3 // OFP_BSN_LOGLEVEL_INFO
BSNLoglevelVerbose = 4 // OFP_BSN_LOGLEVEL_VERBOSE
BSNLoglevelTrace = 5 // OFP_BSN_LOGLEVEL_TRACE
)
type BsnLoglevel uint8
func (self BsnLoglevel) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group ofp_bsn_loopback_mode
BSNLoopbackModeNone = 0 // OFP_BSN_LOOPBACK_MODE_NONE
BSNLoopbackModeMAC = 1 // OFP_BSN_LOOPBACK_MODE_MAC
BSNLoopbackModePhy = 2 // OFP_BSN_LOOPBACK_MODE_PHY
BSNLoopbackModePhyRemote = 3 // OFP_BSN_LOOPBACK_MODE_PHY_REMOTE
)
type BsnLoopbackMode uint8
func (self BsnLoopbackMode) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%d", self)), nil
}
const (
// Identifiers from group ofp_bsn_lua_upload_flags
BSNLuaUploadMore = 1 // OFP_BSN_LUA_UPLOAD_MORE
BSNLuaUploadForce = 2 // OFP_BSN_LUA_UPLOAD_FORCE
)
type BsnLuaUploadFlags uint16
func (self BsnLuaUploadFlags) MarshalJSON() ([]byte, error) {
var flags []string
if self&BSNLuaUploadMore == BSNLuaUploadMore {
flags = append(flags, "\"More\": true")
}
if self&BSNLuaUploadForce == BSNLuaUploadForce {
flags = append(flags, "\"Force\": true")
}
return []byte("{" + strings.Join(flags, ", ") + "}"), nil
}
const (
// Identifiers from group ofp_bsn_misc_capabilities
BSNMiscCapFec = 1 // OFP_BSN_MISC_CAP_FEC
)
type BsnMiscCapabilities uint64
func (self BsnMiscCapabilities) MarshalJSON() ([]byte, error) {
var flags []string
if self&BSNMiscCapFec == BSNMiscCapFec {
flags = append(flags, "\"BSNMiscCapFec\": true")
}
return []byte("{" + strings.Join(flags, ", ") + "}"), nil
}
const (
// Identifiers from group ofp_bsn_multicast_packet
BSNMulticastPacketNone = 0 // OFP_BSN_MULTICAST_PACKET_NONE
BSNMulticastPacketPimHello = 1 // OFP_BSN_MULTICAST_PACKET_PIM_HELLO
BSNMulticastPacketPimJoinPrune = 2 // OFP_BSN_MULTICAST_PACKET_PIM_JOIN_PRUNE
BSNMulticastPacketPimAssert = 3 // OFP_BSN_MULTICAST_PACKET_PIM_ASSERT
)
type BsnMulticastPacket uint16