Jonathan Hart | 44bdbfc | 2020-04-14 17:45:47 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University |
| 3 | * Copyright (c) 2011, 2012 Open Networking Foundation |
| 4 | * Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler. |
| 5 | * Copyright 2018, Red Hat, Inc. |
| 6 | */ |
| 7 | // Automatically generated by LOXI from template const.go |
| 8 | // Do not modify |
| 9 | |
| 10 | package of14 |
| 11 | |
| 12 | import ( |
| 13 | "fmt" |
| 14 | "strings" |
| 15 | ) |
| 16 | |
| 17 | const ( |
| 18 | // Identifiers from group macro_definitions |
| 19 | MaxTableNameLen = 32 // OFP_MAX_TABLE_NAME_LEN |
| 20 | MaxPortNameLen = 16 // OFP_MAX_PORT_NAME_LEN |
| 21 | TCPPort = 6653 // OFP_TCP_PORT |
| 22 | SSLPort = 6653 // OFP_SSL_PORT |
| 23 | EthAlen = 6 // OFP_ETH_ALEN |
| 24 | DefaultMissSendLen = 128 // OFP_DEFAULT_MISS_SEND_LEN |
| 25 | VLANNone = 0 // OFP_VLAN_NONE |
| 26 | FlowPermanent = 0 // OFP_FLOW_PERMANENT |
| 27 | DefaultPriority = 32768 // OFP_DEFAULT_PRIORITY |
| 28 | NoBuffer = 4294967295 // OFP_NO_BUFFER |
| 29 | DescStrLen = 256 // DESC_STR_LEN |
| 30 | SerialNumLen = 32 // SERIAL_NUM_LEN |
| 31 | OFPQAll = 4294967295 // OFPQ_ALL |
| 32 | OFPQMaxRateUncfg = 65535 // OFPQ_MAX_RATE_UNCFG |
| 33 | OFPQMinRateUncfg = 65535 // OFPQ_MIN_RATE_UNCFG |
| 34 | ) |
| 35 | |
| 36 | const ( |
| 37 | // Identifiers from group nx_action_controller2_prop_type |
| 38 | Nxac2PtMaxLen = 0 // NXAC2PT_MAX_LEN |
| 39 | Nxac2PtControllerID = 1 // NXAC2PT_CONTROLLER_ID |
| 40 | Nxac2PtReason = 2 // NXAC2PT_REASON |
| 41 | Nxac2PtUserdata = 3 // NXAC2PT_USERDATA |
| 42 | Nxac2PtPause = 4 // NXAC2PT_PAUSE |
| 43 | Nxac2PtMeterID = 5 // NXAC2PT_METER_ID |
| 44 | ) |
| 45 | |
| 46 | type NxActionController2PropType uint16 |
| 47 | |
| 48 | func (self NxActionController2PropType) MarshalJSON() ([]byte, error) { |
| 49 | return []byte(fmt.Sprintf("%d", self)), nil |
| 50 | } |
| 51 | |
| 52 | const ( |
| 53 | // Identifiers from group nx_bd_algorithms |
| 54 | NxBdAlgActiveBackup = 0 // NX_BD_ALG_ACTIVE_BACKUP |
| 55 | NxBdAlgHrw = 1 // NX_BD_ALG_HRW |
| 56 | ) |
| 57 | |
| 58 | type NxBdAlgorithms uint16 |
| 59 | |
| 60 | func (self NxBdAlgorithms) MarshalJSON() ([]byte, error) { |
| 61 | return []byte(fmt.Sprintf("\"%s\"", self)), nil |
| 62 | } |
| 63 | |
| 64 | func (self NxBdAlgorithms) String() string { |
| 65 | switch self { |
| 66 | case NxBdAlgActiveBackup: |
| 67 | return "active_backup" |
| 68 | case NxBdAlgHrw: |
| 69 | return "hrw" |
| 70 | default: |
| 71 | return fmt.Sprintf("%d", self) |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | const ( |
| 76 | // Identifiers from group nx_conntrack_flags |
| 77 | NxCtFCommit = 1 // NX_CT_F_COMMIT |
| 78 | NxCtFForce = 2 // NX_CT_F_FORCE |
| 79 | ) |
| 80 | |
| 81 | type NxConntrackFlags uint16 |
| 82 | |
| 83 | func (self NxConntrackFlags) MarshalJSON() ([]byte, error) { |
| 84 | var flags []string |
| 85 | if self&NxCtFCommit == NxCtFCommit { |
| 86 | flags = append(flags, "\"Commit\": true") |
| 87 | } |
| 88 | if self&NxCtFForce == NxCtFForce { |
| 89 | flags = append(flags, "\"Force\": true") |
| 90 | } |
| 91 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 92 | } |
| 93 | |
| 94 | const ( |
| 95 | // Identifiers from group nx_flow_monitor_flags |
| 96 | NxfmfInitial = 1 // NXFMF_INITIAL |
| 97 | NxfmfAdd = 2 // NXFMF_ADD |
| 98 | NxfmfDelete = 4 // NXFMF_DELETE |
| 99 | NxfmfModify = 8 // NXFMF_MODIFY |
| 100 | NxfmfActions = 16 // NXFMF_ACTIONS |
| 101 | NxfmfOwn = 32 // NXFMF_OWN |
| 102 | ) |
| 103 | |
| 104 | type NxFlowMonitorFlags uint16 |
| 105 | |
| 106 | func (self NxFlowMonitorFlags) MarshalJSON() ([]byte, error) { |
| 107 | var flags []string |
| 108 | if self&NxfmfInitial == NxfmfInitial { |
| 109 | flags = append(flags, "\"Initial\": true") |
| 110 | } |
| 111 | if self&NxfmfAdd == NxfmfAdd { |
| 112 | flags = append(flags, "\"Add\": true") |
| 113 | } |
| 114 | if self&NxfmfDelete == NxfmfDelete { |
| 115 | flags = append(flags, "\"Delete\": true") |
| 116 | } |
| 117 | if self&NxfmfModify == NxfmfModify { |
| 118 | flags = append(flags, "\"Modify\": true") |
| 119 | } |
| 120 | if self&NxfmfActions == NxfmfActions { |
| 121 | flags = append(flags, "\"Actions\": true") |
| 122 | } |
| 123 | if self&NxfmfOwn == NxfmfOwn { |
| 124 | flags = append(flags, "\"Own\": true") |
| 125 | } |
| 126 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 127 | } |
| 128 | |
| 129 | const ( |
| 130 | // Identifiers from group nx_hash_fields |
| 131 | NxHashFieldsEthSrc = 0 // NX_HASH_FIELDS_ETH_SRC |
| 132 | NxHashFieldsSymmetricL4 = 1 // NX_HASH_FIELDS_SYMMETRIC_L4 |
| 133 | NxHashFieldsSymmetricL3L4 = 2 // NX_HASH_FIELDS_SYMMETRIC_L3L4 |
| 134 | NxHashFieldsSymmetricL3L4Udp = 3 // NX_HASH_FIELDS_SYMMETRIC_L3L4_UDP |
| 135 | NxHashFieldsNwSrc = 4 // NX_HASH_FIELDS_NW_SRC |
| 136 | NxHashFieldsNwDst = 5 // NX_HASH_FIELDS_NW_DST |
| 137 | NxHashFieldsSymmetricL3 = 6 // NX_HASH_FIELDS_SYMMETRIC_L3 |
| 138 | ) |
| 139 | |
| 140 | type NxHashFields uint16 |
| 141 | |
| 142 | func (self NxHashFields) MarshalJSON() ([]byte, error) { |
| 143 | return []byte(fmt.Sprintf("\"%s\"", self)), nil |
| 144 | } |
| 145 | |
| 146 | func (self NxHashFields) String() string { |
| 147 | switch self { |
| 148 | case NxHashFieldsEthSrc: |
| 149 | return "eth_src" |
| 150 | case NxHashFieldsSymmetricL4: |
| 151 | return "symmetric_l4" |
| 152 | case NxHashFieldsSymmetricL3L4: |
| 153 | return "symmetric_l3l4" |
| 154 | case NxHashFieldsSymmetricL3L4Udp: |
| 155 | return "symmetric_l3l4_udp" |
| 156 | case NxHashFieldsNwSrc: |
| 157 | return "nw_src" |
| 158 | case NxHashFieldsNwDst: |
| 159 | return "nw_dst" |
| 160 | case NxHashFieldsSymmetricL3: |
| 161 | return "symmetric_l3" |
| 162 | default: |
| 163 | return fmt.Sprintf("%d", self) |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | const ( |
| 168 | // Identifiers from group nx_mp_algorithm |
| 169 | NxMpAlgModuloN = 0 // NX_MP_ALG_MODULO_N |
| 170 | NxMpAlgHashThreshold = 1 // NX_MP_ALG_HASH_THRESHOLD |
| 171 | NxMpAlgHrw = 2 // NX_MP_ALG_HRW |
| 172 | NxMpAlgIterHash = 3 // NX_MP_ALG_ITER_HASH |
| 173 | ) |
| 174 | |
| 175 | type NxMpAlgorithm uint16 |
| 176 | |
| 177 | func (self NxMpAlgorithm) MarshalJSON() ([]byte, error) { |
| 178 | return []byte(fmt.Sprintf("\"%s\"", self)), nil |
| 179 | } |
| 180 | |
| 181 | func (self NxMpAlgorithm) String() string { |
| 182 | switch self { |
| 183 | case NxMpAlgModuloN: |
| 184 | return "modulo_n" |
| 185 | case NxMpAlgHashThreshold: |
| 186 | return "hash_threshold" |
| 187 | case NxMpAlgHrw: |
| 188 | return "hrw" |
| 189 | case NxMpAlgIterHash: |
| 190 | return "iter_hash" |
| 191 | default: |
| 192 | return fmt.Sprintf("%d", self) |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | const ( |
| 197 | // Identifiers from group of_action_nx_bundle_slave_type |
| 198 | NxmOfInPort = 2 // NXM_OF_IN_PORT |
| 199 | NxmOfJustThereToDefinePrefix = 10000 // NXM_OF_JUST_THERE_TO_DEFINE_PREFIX |
| 200 | ) |
| 201 | |
| 202 | type ActionNxBundleSlaveType uint32 |
| 203 | |
| 204 | func (self ActionNxBundleSlaveType) MarshalJSON() ([]byte, error) { |
| 205 | return []byte(fmt.Sprintf("\"%s\"", self)), nil |
| 206 | } |
| 207 | |
| 208 | func (self ActionNxBundleSlaveType) String() string { |
| 209 | switch self { |
| 210 | case NxmOfInPort: |
| 211 | return "in_port" |
| 212 | case NxmOfJustThereToDefinePrefix: |
| 213 | return "just_there_to_define_prefix" |
| 214 | default: |
| 215 | return fmt.Sprintf("%d", self) |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | const ( |
| 220 | // Identifiers from group of_bsn_gentable_error_code |
| 221 | OFBSNGentableErrorUnknown = 0 // OF_BSN_GENTABLE_ERROR_UNKNOWN |
| 222 | OFBSNGentableErrorParam = 1 // OF_BSN_GENTABLE_ERROR_PARAM |
| 223 | OFBSNGentableErrorTableFull = 2 // OF_BSN_GENTABLE_ERROR_TABLE_FULL |
| 224 | ) |
| 225 | |
| 226 | type BsnGentableErrorCode uint16 |
| 227 | |
| 228 | func (self BsnGentableErrorCode) MarshalJSON() ([]byte, error) { |
| 229 | return []byte(fmt.Sprintf("%d", self)), nil |
| 230 | } |
| 231 | |
| 232 | const ( |
| 233 | // Identifiers from group of_bsn_hash_gtp_port_match |
| 234 | OFBSNHashGtpPortMatchSrc = 1 // OF_BSN_HASH_GTP_PORT_MATCH_SRC |
| 235 | OFBSNHashGtpPortMatchDst = 2 // OF_BSN_HASH_GTP_PORT_MATCH_DST |
| 236 | OFBSNHashGtpPortMatchSrcOrDst = 3 // OF_BSN_HASH_GTP_PORT_MATCH_SRC_OR_DST |
| 237 | OFBSNHashGtpPortMatchSrcAndDst = 4 // OF_BSN_HASH_GTP_PORT_MATCH_SRC_AND_DST |
| 238 | ) |
| 239 | |
| 240 | type BsnHashGtpPortMatch uint8 |
| 241 | |
| 242 | func (self BsnHashGtpPortMatch) MarshalJSON() ([]byte, error) { |
| 243 | return []byte(fmt.Sprintf("%d", self)), nil |
| 244 | } |
| 245 | |
| 246 | const ( |
| 247 | // Identifiers from group of_bsn_hash_packet_field |
| 248 | BSNHashFieldDstMAC = 2 // OFP_BSN_HASH_FIELD_DST_MAC |
| 249 | BSNHashFieldSrcMAC = 4 // OFP_BSN_HASH_FIELD_SRC_MAC |
| 250 | BSNHashFieldEthType = 8 // OFP_BSN_HASH_FIELD_ETH_TYPE |
| 251 | BSNHashFieldVLANID = 16 // OFP_BSN_HASH_FIELD_VLAN_ID |
| 252 | BSNHashFieldInnerL2 = 32 // OFP_BSN_HASH_FIELD_INNER_L2 |
| 253 | BSNHashFieldInnerL3 = 64 // OFP_BSN_HASH_FIELD_INNER_L3 |
| 254 | BSNHashFieldSrcIp = 128 // OFP_BSN_HASH_FIELD_SRC_IP |
| 255 | BSNHashFieldDstIp = 256 // OFP_BSN_HASH_FIELD_DST_IP |
| 256 | BSNHashFieldIpProto = 512 // OFP_BSN_HASH_FIELD_IP_PROTO |
| 257 | BSNHashFieldSrcL4Port = 1024 // OFP_BSN_HASH_FIELD_SRC_L4_PORT |
| 258 | BSNHashFieldDstL4Port = 2048 // OFP_BSN_HASH_FIELD_DST_L4_PORT |
| 259 | BSNHashFieldMplsLabel1 = 4096 // OFP_BSN_HASH_FIELD_MPLS_LABEL1 |
| 260 | BSNHashFieldMplsLabel2 = 8192 // OFP_BSN_HASH_FIELD_MPLS_LABEL2 |
| 261 | BSNHashFieldMplsLabel3 = 16384 // OFP_BSN_HASH_FIELD_MPLS_LABEL3 |
| 262 | BSNHashFieldMplsLabelHiBits = 32768 // OFP_BSN_HASH_FIELD_MPLS_LABEL_HI_BITS |
| 263 | BSNHashFieldMplsPayloadSrcIp = 65536 // OFP_BSN_HASH_FIELD_MPLS_PAYLOAD_SRC_IP |
| 264 | BSNHashFieldMplsPayloadDstIp = 131072 // OFP_BSN_HASH_FIELD_MPLS_PAYLOAD_DST_IP |
| 265 | BSNHashFieldSymmetric = 262144 // OFP_BSN_HASH_FIELD_SYMMETRIC |
| 266 | ) |
| 267 | |
| 268 | type BsnHashPacketField uint64 |
| 269 | |
| 270 | func (self BsnHashPacketField) MarshalJSON() ([]byte, error) { |
| 271 | var flags []string |
| 272 | if self&BSNHashFieldDstMAC == BSNHashFieldDstMAC { |
| 273 | flags = append(flags, "\"DstMAC\": true") |
| 274 | } |
| 275 | if self&BSNHashFieldSrcMAC == BSNHashFieldSrcMAC { |
| 276 | flags = append(flags, "\"SrcMAC\": true") |
| 277 | } |
| 278 | if self&BSNHashFieldEthType == BSNHashFieldEthType { |
| 279 | flags = append(flags, "\"EthType\": true") |
| 280 | } |
| 281 | if self&BSNHashFieldVLANID == BSNHashFieldVLANID { |
| 282 | flags = append(flags, "\"VlanID\": true") |
| 283 | } |
| 284 | if self&BSNHashFieldInnerL2 == BSNHashFieldInnerL2 { |
| 285 | flags = append(flags, "\"InnerL2\": true") |
| 286 | } |
| 287 | if self&BSNHashFieldInnerL3 == BSNHashFieldInnerL3 { |
| 288 | flags = append(flags, "\"InnerL3\": true") |
| 289 | } |
| 290 | if self&BSNHashFieldSrcIp == BSNHashFieldSrcIp { |
| 291 | flags = append(flags, "\"SrcIp\": true") |
| 292 | } |
| 293 | if self&BSNHashFieldDstIp == BSNHashFieldDstIp { |
| 294 | flags = append(flags, "\"DstIp\": true") |
| 295 | } |
| 296 | if self&BSNHashFieldIpProto == BSNHashFieldIpProto { |
| 297 | flags = append(flags, "\"IpProto\": true") |
| 298 | } |
| 299 | if self&BSNHashFieldSrcL4Port == BSNHashFieldSrcL4Port { |
| 300 | flags = append(flags, "\"SrcL4Port\": true") |
| 301 | } |
| 302 | if self&BSNHashFieldDstL4Port == BSNHashFieldDstL4Port { |
| 303 | flags = append(flags, "\"DstL4Port\": true") |
| 304 | } |
| 305 | if self&BSNHashFieldMplsLabel1 == BSNHashFieldMplsLabel1 { |
| 306 | flags = append(flags, "\"MplsLabel1\": true") |
| 307 | } |
| 308 | if self&BSNHashFieldMplsLabel2 == BSNHashFieldMplsLabel2 { |
| 309 | flags = append(flags, "\"MplsLabel2\": true") |
| 310 | } |
| 311 | if self&BSNHashFieldMplsLabel3 == BSNHashFieldMplsLabel3 { |
| 312 | flags = append(flags, "\"MplsLabel3\": true") |
| 313 | } |
| 314 | if self&BSNHashFieldMplsLabelHiBits == BSNHashFieldMplsLabelHiBits { |
| 315 | flags = append(flags, "\"MplsLabelHiBits\": true") |
| 316 | } |
| 317 | if self&BSNHashFieldMplsPayloadSrcIp == BSNHashFieldMplsPayloadSrcIp { |
| 318 | flags = append(flags, "\"MplsPayloadSrcIp\": true") |
| 319 | } |
| 320 | if self&BSNHashFieldMplsPayloadDstIp == BSNHashFieldMplsPayloadDstIp { |
| 321 | flags = append(flags, "\"MplsPayloadDstIp\": true") |
| 322 | } |
| 323 | if self&BSNHashFieldSymmetric == BSNHashFieldSymmetric { |
| 324 | flags = append(flags, "\"Symmetric\": true") |
| 325 | } |
| 326 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 327 | } |
| 328 | |
| 329 | const ( |
| 330 | // Identifiers from group of_bsn_hash_packet_type |
| 331 | OFBSNHashPacketL2 = 0 // OF_BSN_HASH_PACKET_L2 |
| 332 | OFBSNHashPacketL2Gre = 1 // OF_BSN_HASH_PACKET_L2GRE |
| 333 | OFBSNHashPacketIpv4 = 3 // OF_BSN_HASH_PACKET_IPV4 |
| 334 | OFBSNHashPacketIpv6 = 4 // OF_BSN_HASH_PACKET_IPV6 |
| 335 | OFBSNHashPacketMpls = 5 // OF_BSN_HASH_PACKET_MPLS |
| 336 | OFBSNHashPacketSymmetric = 6 // OF_BSN_HASH_PACKET_SYMMETRIC |
| 337 | ) |
| 338 | |
| 339 | type BsnHashPacketType uint8 |
| 340 | |
| 341 | func (self BsnHashPacketType) MarshalJSON() ([]byte, error) { |
| 342 | return []byte(fmt.Sprintf("%d", self)), nil |
| 343 | } |
| 344 | |
| 345 | const ( |
| 346 | // Identifiers from group of_bsn_hash_type |
| 347 | BSNHashTypeL2 = 0 // OFP_BSN_HASH_TYPE_L2 |
| 348 | BSNHashTypeL3 = 1 // OFP_BSN_HASH_TYPE_L3 |
| 349 | BSNHashTypeEnhanced = 2 // OFP_BSN_HASH_TYPE_ENHANCED |
| 350 | ) |
| 351 | |
| 352 | type BsnHashType uint8 |
| 353 | |
| 354 | func (self BsnHashType) MarshalJSON() ([]byte, error) { |
| 355 | return []byte(fmt.Sprintf("%d", self)), nil |
| 356 | } |
| 357 | |
| 358 | const ( |
| 359 | // Identifiers from group of_bsn_lacp_convergence_status |
| 360 | LacpSuccess = 0 // LACP_SUCCESS |
| 361 | LacpTimedout = 1 // LACP_TIMEDOUT |
| 362 | LacpOutOfSync = 2 // LACP_OUT_OF_SYNC |
| 363 | ) |
| 364 | |
| 365 | type BsnLacpConvergenceStatus uint8 |
| 366 | |
| 367 | func (self BsnLacpConvergenceStatus) MarshalJSON() ([]byte, error) { |
| 368 | return []byte(fmt.Sprintf("%d", self)), nil |
| 369 | } |
| 370 | |
| 371 | const ( |
| 372 | // Identifiers from group of_bsn_pdu_slot_num |
| 373 | BsnPduSlotNumAny = 255 // BSN_PDU_SLOT_NUM_ANY |
| 374 | ) |
| 375 | |
| 376 | type BsnPduSlotNum uint8 |
| 377 | |
| 378 | func (self BsnPduSlotNum) MarshalJSON() ([]byte, error) { |
| 379 | return []byte(fmt.Sprintf("%d", self)), nil |
| 380 | } |
| 381 | |
| 382 | const ( |
| 383 | // Identifiers from group of_bsn_vlan_counter |
| 384 | BSNVLANCounterRxBytes = 0 // OFP_BSN_VLAN_COUNTER_RX_BYTES |
| 385 | BSNVLANCounterRxPackets = 1 // OFP_BSN_VLAN_COUNTER_RX_PACKETS |
| 386 | BSNVLANCounterTxBytes = 2 // OFP_BSN_VLAN_COUNTER_TX_BYTES |
| 387 | BSNVLANCounterTxPackets = 3 // OFP_BSN_VLAN_COUNTER_TX_PACKETS |
| 388 | ) |
| 389 | |
| 390 | type BsnVlanCounter uint8 |
| 391 | |
| 392 | func (self BsnVlanCounter) MarshalJSON() ([]byte, error) { |
| 393 | return []byte(fmt.Sprintf("%d", self)), nil |
| 394 | } |
| 395 | |
| 396 | const ( |
| 397 | // Identifiers from group of_bsn_vrf_counter |
| 398 | BSNVrfCounterBytes = 0 // OFP_BSN_VRF_COUNTER_BYTES |
| 399 | BSNVrfCounterPackets = 1 // OFP_BSN_VRF_COUNTER_PACKETS |
| 400 | ) |
| 401 | |
| 402 | type BsnVrfCounter uint8 |
| 403 | |
| 404 | func (self BsnVrfCounter) MarshalJSON() ([]byte, error) { |
| 405 | return []byte(fmt.Sprintf("%d", self)), nil |
| 406 | } |
| 407 | |
| 408 | const ( |
| 409 | // Identifiers from group of_nx_nat_range |
| 410 | NxNatRangeIpv4Min = 1 // NX_NAT_RANGE_IPV4_MIN |
| 411 | NxNatRangeIpv4Max = 2 // NX_NAT_RANGE_IPV4_MAX |
| 412 | NxNatRangeIpv6Min = 4 // NX_NAT_RANGE_IPV6_MIN |
| 413 | NxNatRangeIpv6Max = 8 // NX_NAT_RANGE_IPV6_MAX |
| 414 | NxNatRangeProtoMin = 16 // NX_NAT_RANGE_PROTO_MIN |
| 415 | NxNatRangeProtoMax = 32 // NX_NAT_RANGE_PROTO_MAX |
| 416 | ) |
| 417 | |
| 418 | type NxNatRange uint16 |
| 419 | |
| 420 | func (self NxNatRange) MarshalJSON() ([]byte, error) { |
| 421 | var flags []string |
| 422 | if self&NxNatRangeIpv4Min == NxNatRangeIpv4Min { |
| 423 | flags = append(flags, "\"Ipv4Min\": true") |
| 424 | } |
| 425 | if self&NxNatRangeIpv4Max == NxNatRangeIpv4Max { |
| 426 | flags = append(flags, "\"Ipv4Max\": true") |
| 427 | } |
| 428 | if self&NxNatRangeIpv6Min == NxNatRangeIpv6Min { |
| 429 | flags = append(flags, "\"Ipv6Min\": true") |
| 430 | } |
| 431 | if self&NxNatRangeIpv6Max == NxNatRangeIpv6Max { |
| 432 | flags = append(flags, "\"Ipv6Max\": true") |
| 433 | } |
| 434 | if self&NxNatRangeProtoMin == NxNatRangeProtoMin { |
| 435 | flags = append(flags, "\"ProtoMin\": true") |
| 436 | } |
| 437 | if self&NxNatRangeProtoMax == NxNatRangeProtoMax { |
| 438 | flags = append(flags, "\"ProtoMax\": true") |
| 439 | } |
| 440 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 441 | } |
| 442 | |
| 443 | const ( |
| 444 | // Identifiers from group ofp_action_type |
| 445 | OFPATOutput = 0 // OFPAT_OUTPUT |
| 446 | OFPATCopyTtlOut = 11 // OFPAT_COPY_TTL_OUT |
| 447 | OFPATCopyTtlIn = 12 // OFPAT_COPY_TTL_IN |
| 448 | OFPATSetMplsTtl = 15 // OFPAT_SET_MPLS_TTL |
| 449 | OFPATDecMplsTtl = 16 // OFPAT_DEC_MPLS_TTL |
| 450 | OFPATPushVLAN = 17 // OFPAT_PUSH_VLAN |
| 451 | OFPATPopVLAN = 18 // OFPAT_POP_VLAN |
| 452 | OFPATPushMpls = 19 // OFPAT_PUSH_MPLS |
| 453 | OFPATPopMpls = 20 // OFPAT_POP_MPLS |
| 454 | OFPATSetQueue = 21 // OFPAT_SET_QUEUE |
| 455 | OFPATGroup = 22 // OFPAT_GROUP |
| 456 | OFPATSetNwTtl = 23 // OFPAT_SET_NW_TTL |
| 457 | OFPATDecNwTtl = 24 // OFPAT_DEC_NW_TTL |
| 458 | OFPATSetField = 25 // OFPAT_SET_FIELD |
| 459 | OFPATPushPbb = 26 // OFPAT_PUSH_PBB |
| 460 | OFPATPopPbb = 27 // OFPAT_POP_PBB |
| 461 | OFPATExperimenter = 65535 // OFPAT_EXPERIMENTER |
| 462 | ) |
| 463 | |
| 464 | type ActionType uint16 |
| 465 | |
| 466 | func (self ActionType) MarshalJSON() ([]byte, error) { |
| 467 | return []byte(fmt.Sprintf("%d", self)), nil |
| 468 | } |
| 469 | |
| 470 | const ( |
| 471 | // Identifiers from group ofp_async_config_failed_code |
| 472 | OFPACFCInvalid = 0 // OFPACFC_INVALID |
| 473 | OFPACFCUnsupported = 1 // OFPACFC_UNSUPPORTED |
| 474 | OFPACFCEperm = 2 // OFPACFC_EPERM |
| 475 | ) |
| 476 | |
| 477 | type AsyncConfigFailedCode uint16 |
| 478 | |
| 479 | func (self AsyncConfigFailedCode) MarshalJSON() ([]byte, error) { |
| 480 | return []byte(fmt.Sprintf("%d", self)), nil |
| 481 | } |
| 482 | |
| 483 | const ( |
| 484 | // Identifiers from group ofp_bad_action_code |
| 485 | OFPBACBadType = 0 // OFPBAC_BAD_TYPE |
| 486 | OFPBACBadLen = 1 // OFPBAC_BAD_LEN |
| 487 | OFPBACBadExperimenter = 2 // OFPBAC_BAD_EXPERIMENTER |
| 488 | OFPBACBadExperimenterType = 3 // OFPBAC_BAD_EXPERIMENTER_TYPE |
| 489 | OFPBACBadOutPort = 4 // OFPBAC_BAD_OUT_PORT |
| 490 | OFPBACBadArgument = 5 // OFPBAC_BAD_ARGUMENT |
| 491 | OFPBACEperm = 6 // OFPBAC_EPERM |
| 492 | OFPBACTooMany = 7 // OFPBAC_TOO_MANY |
| 493 | OFPBACBadQueue = 8 // OFPBAC_BAD_QUEUE |
| 494 | OFPBACBadOutGroup = 9 // OFPBAC_BAD_OUT_GROUP |
| 495 | OFPBACMatchInconsistent = 10 // OFPBAC_MATCH_INCONSISTENT |
| 496 | OFPBACUnsupportedOrder = 11 // OFPBAC_UNSUPPORTED_ORDER |
| 497 | OFPBACBadTag = 12 // OFPBAC_BAD_TAG |
| 498 | OFPBACBadSetType = 13 // OFPBAC_BAD_SET_TYPE |
| 499 | OFPBACBadSetLen = 14 // OFPBAC_BAD_SET_LEN |
| 500 | OFPBACBadSetArgument = 15 // OFPBAC_BAD_SET_ARGUMENT |
| 501 | ) |
| 502 | |
| 503 | type BadActionCode uint16 |
| 504 | |
| 505 | func (self BadActionCode) MarshalJSON() ([]byte, error) { |
| 506 | return []byte(fmt.Sprintf("%d", self)), nil |
| 507 | } |
| 508 | |
| 509 | const ( |
| 510 | // Identifiers from group ofp_bad_instruction_code |
| 511 | OFPBICUnknownInst = 0 // OFPBIC_UNKNOWN_INST |
| 512 | OFPBICUnsupInst = 1 // OFPBIC_UNSUP_INST |
| 513 | OFPBICBadTableID = 2 // OFPBIC_BAD_TABLE_ID |
| 514 | OFPBICUnsupMetadata = 3 // OFPBIC_UNSUP_METADATA |
| 515 | OFPBICUnsupMetadataMask = 4 // OFPBIC_UNSUP_METADATA_MASK |
| 516 | OFPBICBadExperimenter = 5 // OFPBIC_BAD_EXPERIMENTER |
| 517 | OFPBICBadExperimenterType = 6 // OFPBIC_BAD_EXPERIMENTER_TYPE |
| 518 | OFPBICBadLen = 7 // OFPBIC_BAD_LEN |
| 519 | OFPBICEperm = 8 // OFPBIC_EPERM |
| 520 | OFPBICDupInst = 9 // OFPBIC_DUP_INST |
| 521 | ) |
| 522 | |
| 523 | type BadInstructionCode uint16 |
| 524 | |
| 525 | func (self BadInstructionCode) MarshalJSON() ([]byte, error) { |
| 526 | return []byte(fmt.Sprintf("%d", self)), nil |
| 527 | } |
| 528 | |
| 529 | const ( |
| 530 | // Identifiers from group ofp_bad_match_code |
| 531 | OFPBMCBadType = 0 // OFPBMC_BAD_TYPE |
| 532 | OFPBMCBadLen = 1 // OFPBMC_BAD_LEN |
| 533 | OFPBMCBadTag = 2 // OFPBMC_BAD_TAG |
| 534 | OFPBMCBadDlAddrMask = 3 // OFPBMC_BAD_DL_ADDR_MASK |
| 535 | OFPBMCBadNwAddrMask = 4 // OFPBMC_BAD_NW_ADDR_MASK |
| 536 | OFPBMCBadWildcards = 5 // OFPBMC_BAD_WILDCARDS |
| 537 | OFPBMCBadField = 6 // OFPBMC_BAD_FIELD |
| 538 | OFPBMCBadValue = 7 // OFPBMC_BAD_VALUE |
| 539 | OFPBMCBadMask = 8 // OFPBMC_BAD_MASK |
| 540 | OFPBMCBadPrereq = 9 // OFPBMC_BAD_PREREQ |
| 541 | OFPBMCDupField = 10 // OFPBMC_DUP_FIELD |
| 542 | OFPBMCEperm = 11 // OFPBMC_EPERM |
| 543 | ) |
| 544 | |
| 545 | type BadMatchCode uint16 |
| 546 | |
| 547 | func (self BadMatchCode) MarshalJSON() ([]byte, error) { |
| 548 | return []byte(fmt.Sprintf("%d", self)), nil |
| 549 | } |
| 550 | |
| 551 | const ( |
| 552 | // Identifiers from group ofp_bad_property_code |
| 553 | OFPBPCBadType = 0 // OFPBPC_BAD_TYPE |
| 554 | OFPBPCBadLen = 1 // OFPBPC_BAD_LEN |
| 555 | OFPBPCBadValue = 2 // OFPBPC_BAD_VALUE |
| 556 | OFPBPCTooMany = 3 // OFPBPC_TOO_MANY |
| 557 | OFPBPCDupType = 4 // OFPBPC_DUP_TYPE |
| 558 | OFPBPCBadExperimenter = 5 // OFPBPC_BAD_EXPERIMENTER |
| 559 | OFPBPCBadExpType = 6 // OFPBPC_BAD_EXP_TYPE |
| 560 | OFPBPCBadExpValue = 7 // OFPBPC_BAD_EXP_VALUE |
| 561 | OFPBPCEperm = 8 // OFPBPC_EPERM |
| 562 | ) |
| 563 | |
| 564 | type BadPropertyCode uint16 |
| 565 | |
| 566 | func (self BadPropertyCode) MarshalJSON() ([]byte, error) { |
| 567 | return []byte(fmt.Sprintf("%d", self)), nil |
| 568 | } |
| 569 | |
| 570 | const ( |
| 571 | // Identifiers from group ofp_bad_request_code |
| 572 | OFPBRCBadVersion = 0 // OFPBRC_BAD_VERSION |
| 573 | OFPBRCBadType = 1 // OFPBRC_BAD_TYPE |
| 574 | OFPBRCBadStat = 2 // OFPBRC_BAD_STAT |
| 575 | OFPBRCBadExperimenter = 3 // OFPBRC_BAD_EXPERIMENTER |
| 576 | OFPBRCBadExperimenterType = 4 // OFPBRC_BAD_EXPERIMENTER_TYPE |
| 577 | OFPBRCEperm = 5 // OFPBRC_EPERM |
| 578 | OFPBRCBadLen = 6 // OFPBRC_BAD_LEN |
| 579 | OFPBRCBufferEmpty = 7 // OFPBRC_BUFFER_EMPTY |
| 580 | OFPBRCBufferUnknown = 8 // OFPBRC_BUFFER_UNKNOWN |
| 581 | OFPBRCBadTableID = 9 // OFPBRC_BAD_TABLE_ID |
| 582 | OFPBRCIsSlave = 10 // OFPBRC_IS_SLAVE |
| 583 | OFPBRCBadPort = 11 // OFPBRC_BAD_PORT |
| 584 | OFPBRCBadPacket = 12 // OFPBRC_BAD_PACKET |
| 585 | OFPBRCMultipartBufferOverflow = 13 // OFPBRC_MULTIPART_BUFFER_OVERFLOW |
| 586 | OFPBRCMultipartRequestTimeout = 14 // OFPBRC_MULTIPART_REQUEST_TIMEOUT |
| 587 | OFPBRCMultipartReplyTimeout = 15 // OFPBRC_MULTIPART_REPLY_TIMEOUT |
| 588 | ) |
| 589 | |
| 590 | type BadRequestCode uint16 |
| 591 | |
| 592 | func (self BadRequestCode) MarshalJSON() ([]byte, error) { |
| 593 | return []byte(fmt.Sprintf("%d", self)), nil |
| 594 | } |
| 595 | |
| 596 | const ( |
| 597 | // Identifiers from group ofp_bsn_anchor |
| 598 | BSNAnchorPacketStart = 0 // OFP_BSN_ANCHOR_PACKET_START |
| 599 | BSNAnchorL3HeaderStart = 1 // OFP_BSN_ANCHOR_L3_HEADER_START |
| 600 | BSNAnchorL4HeaderStart = 2 // OFP_BSN_ANCHOR_L4_HEADER_START |
| 601 | BSNAnchorL4PayloadStart = 3 // OFP_BSN_ANCHOR_L4_PAYLOAD_START |
| 602 | ) |
| 603 | |
| 604 | type BsnAnchor uint16 |
| 605 | |
| 606 | func (self BsnAnchor) MarshalJSON() ([]byte, error) { |
| 607 | return []byte(fmt.Sprintf("%d", self)), nil |
| 608 | } |
| 609 | |
| 610 | const ( |
| 611 | // Identifiers from group ofp_bsn_auto_negotiation_type |
| 612 | BSNAutoNegotiationDefault = 0 // OFP_BSN_AUTO_NEGOTIATION_DEFAULT |
| 613 | BSNAutoNegotiationEnable = 1 // OFP_BSN_AUTO_NEGOTIATION_ENABLE |
| 614 | BSNAutoNegotiationDisable = 2 // OFP_BSN_AUTO_NEGOTIATION_DISABLE |
| 615 | ) |
| 616 | |
| 617 | type BsnAutoNegotiationType uint8 |
| 618 | |
| 619 | func (self BsnAutoNegotiationType) MarshalJSON() ([]byte, error) { |
| 620 | return []byte(fmt.Sprintf("%d", self)), nil |
| 621 | } |
| 622 | |
| 623 | const ( |
| 624 | // Identifiers from group ofp_bsn_bfd_endpoint |
| 625 | BSNBfdUnused = 0 // OFP_BSN_BFD_UNUSED |
| 626 | BSNBfdMicro = 1 // OFP_BSN_BFD_MICRO |
| 627 | BSNBfd1Hop = 2 // OFP_BSN_BFD_1_HOP |
| 628 | BSNBfdMultiHop = 3 // OFP_BSN_BFD_MULTI_HOP |
| 629 | ) |
| 630 | |
| 631 | type BsnBfdEndpoint uint8 |
| 632 | |
| 633 | func (self BsnBfdEndpoint) MarshalJSON() ([]byte, error) { |
| 634 | return []byte(fmt.Sprintf("%d", self)), nil |
| 635 | } |
| 636 | |
| 637 | const ( |
| 638 | // Identifiers from group ofp_bsn_bfd_endpoint_state |
| 639 | BSNBfdEndpointStateAdmindown = 0 // OFP_BSN_BFD_ENDPOINT_STATE_ADMINDOWN |
| 640 | BSNBfdEndpointStateDown = 1 // OFP_BSN_BFD_ENDPOINT_STATE_DOWN |
| 641 | BSNBfdEndpointStateInit = 2 // OFP_BSN_BFD_ENDPOINT_STATE_INIT |
| 642 | BSNBfdEndpointStateUp = 3 // OFP_BSN_BFD_ENDPOINT_STATE_UP |
| 643 | BSNBfdEndpointSessionError = 4 // OFP_BSN_BFD_ENDPOINT_SESSION_ERROR |
| 644 | BSNBfdEndpointRemoteAdmindown = 5 // OFP_BSN_BFD_ENDPOINT_REMOTE_ADMINDOWN |
| 645 | BSNBfdEndpointParamsChange = 6 // OFP_BSN_BFD_ENDPOINT_PARAMS_CHANGE |
| 646 | ) |
| 647 | |
| 648 | type BsnBfdEndpointState uint8 |
| 649 | |
| 650 | func (self BsnBfdEndpointState) MarshalJSON() ([]byte, error) { |
| 651 | return []byte(fmt.Sprintf("%d", self)), nil |
| 652 | } |
| 653 | |
| 654 | const ( |
| 655 | // Identifiers from group ofp_bsn_cml |
| 656 | BSNCmlNone = 0 // OFP_BSN_CML_NONE |
| 657 | BSNCmlCpuDrop = 1 // OFP_BSN_CML_CPU_DROP |
| 658 | BSNCmlForward = 2 // OFP_BSN_CML_FORWARD |
| 659 | BSNCmlCpuForward = 3 // OFP_BSN_CML_CPU_FORWARD |
| 660 | ) |
| 661 | |
| 662 | type BsnCml uint16 |
| 663 | |
| 664 | func (self BsnCml) MarshalJSON() ([]byte, error) { |
| 665 | return []byte(fmt.Sprintf("%d", self)), nil |
| 666 | } |
| 667 | |
| 668 | const ( |
| 669 | // Identifiers from group ofp_bsn_controller_connection_state |
| 670 | BSNControllerConnectionStateDisconnected = 0 // OFP_BSN_CONTROLLER_CONNECTION_STATE_DISCONNECTED |
| 671 | BSNControllerConnectionStateConnected = 1 // OFP_BSN_CONTROLLER_CONNECTION_STATE_CONNECTED |
| 672 | ) |
| 673 | |
| 674 | type BsnControllerConnectionState uint8 |
| 675 | |
| 676 | func (self BsnControllerConnectionState) MarshalJSON() ([]byte, error) { |
| 677 | return []byte(fmt.Sprintf("%d", self)), nil |
| 678 | } |
| 679 | |
| 680 | const ( |
| 681 | // Identifiers from group ofp_bsn_decap |
| 682 | BSNDecapVxlan = 0 // OFP_BSN_DECAP_VXLAN |
| 683 | BSNDecapErspan = 1 // OFP_BSN_DECAP_ERSPAN |
| 684 | BSNDecapL2GRE = 2 // OFP_BSN_DECAP_L2_GRE |
| 685 | BSNDecapNvgre = 3 // OFP_BSN_DECAP_NVGRE |
| 686 | BSNDecapCapwap = 4 // OFP_BSN_DECAP_CAPWAP |
| 687 | BSNDecapL2Mpls = 5 // OFP_BSN_DECAP_L2_MPLS |
| 688 | BSNDecapL3GRE = 6 // OFP_BSN_DECAP_L3_GRE |
| 689 | BSNDecapGtp = 7 // OFP_BSN_DECAP_GTP |
| 690 | BSNDecapL3Mpls = 8 // OFP_BSN_DECAP_L3_MPLS |
| 691 | ) |
| 692 | |
| 693 | type BsnDecap uint16 |
| 694 | |
| 695 | func (self BsnDecap) MarshalJSON() ([]byte, error) { |
| 696 | return []byte(fmt.Sprintf("%d", self)), nil |
| 697 | } |
| 698 | |
| 699 | const ( |
| 700 | // Identifiers from group ofp_bsn_encap |
| 701 | BSNEncapUnused = 0 // OFP_BSN_ENCAP_UNUSED |
| 702 | BSNEncapIpv4Udp = 1 // OFP_BSN_ENCAP_IPV4_UDP |
| 703 | BSNEncapIpv6Udp = 2 // OFP_BSN_ENCAP_IPV6_UDP |
| 704 | ) |
| 705 | |
| 706 | type BsnEncap uint8 |
| 707 | |
| 708 | func (self BsnEncap) MarshalJSON() ([]byte, error) { |
| 709 | return []byte(fmt.Sprintf("%d", self)), nil |
| 710 | } |
| 711 | |
| 712 | const ( |
| 713 | // Identifiers from group ofp_bsn_enhanced_hash_type |
| 714 | BSNEnhancedHashL2 = 1 // OFP_BSN_ENHANCED_HASH_L2 |
| 715 | BSNEnhancedHashL3 = 2 // OFP_BSN_ENHANCED_HASH_L3 |
| 716 | BSNEnhancedHashL2Gre = 4 // OFP_BSN_ENHANCED_HASH_L2GRE |
| 717 | BSNEnhancedHashMpls = 8 // OFP_BSN_ENHANCED_HASH_MPLS |
| 718 | BSNEnhancedHashGtp = 16 // OFP_BSN_ENHANCED_HASH_GTP |
| 719 | BSNEnhancedHashSymmetric = 32 // OFP_BSN_ENHANCED_HASH_SYMMETRIC |
| 720 | ) |
| 721 | |
| 722 | type BsnEnhancedHashType uint64 |
| 723 | |
| 724 | func (self BsnEnhancedHashType) MarshalJSON() ([]byte, error) { |
| 725 | var flags []string |
| 726 | if self&BSNEnhancedHashL2 == BSNEnhancedHashL2 { |
| 727 | flags = append(flags, "\"L2\": true") |
| 728 | } |
| 729 | if self&BSNEnhancedHashL3 == BSNEnhancedHashL3 { |
| 730 | flags = append(flags, "\"L3\": true") |
| 731 | } |
| 732 | if self&BSNEnhancedHashL2Gre == BSNEnhancedHashL2Gre { |
| 733 | flags = append(flags, "\"L2Gre\": true") |
| 734 | } |
| 735 | if self&BSNEnhancedHashMpls == BSNEnhancedHashMpls { |
| 736 | flags = append(flags, "\"Mpls\": true") |
| 737 | } |
| 738 | if self&BSNEnhancedHashGtp == BSNEnhancedHashGtp { |
| 739 | flags = append(flags, "\"Gtp\": true") |
| 740 | } |
| 741 | if self&BSNEnhancedHashSymmetric == BSNEnhancedHashSymmetric { |
| 742 | flags = append(flags, "\"Symmetric\": true") |
| 743 | } |
| 744 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 745 | } |
| 746 | |
| 747 | const ( |
| 748 | // Identifiers from group ofp_bsn_extended_capabilities |
| 749 | BSNExtCapAn = 1 // OFP_BSN_EXT_CAP_AN |
| 750 | BSNExtCapFec = 2 // OFP_BSN_EXT_CAP_FEC |
| 751 | ) |
| 752 | |
| 753 | type BsnExtendedCapabilities uint64 |
| 754 | |
| 755 | func (self BsnExtendedCapabilities) MarshalJSON() ([]byte, error) { |
| 756 | var flags []string |
| 757 | if self&BSNExtCapAn == BSNExtCapAn { |
| 758 | flags = append(flags, "\"An\": true") |
| 759 | } |
| 760 | if self&BSNExtCapFec == BSNExtCapFec { |
| 761 | flags = append(flags, "\"Fec\": true") |
| 762 | } |
| 763 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 764 | } |
| 765 | |
| 766 | const ( |
| 767 | // Identifiers from group ofp_bsn_fabric_port_role |
| 768 | BSNFabricPortRolePartitionedSpine = 1 // OFP_BSN_FABRIC_PORT_ROLE_PARTITIONED_SPINE |
| 769 | ) |
| 770 | |
| 771 | type BsnFabricPortRole uint16 |
| 772 | |
| 773 | func (self BsnFabricPortRole) MarshalJSON() ([]byte, error) { |
| 774 | return []byte(fmt.Sprintf("%d", self)), nil |
| 775 | } |
| 776 | |
| 777 | const ( |
| 778 | // Identifiers from group ofp_bsn_fec_config_state |
| 779 | BSNFecConfigStateUnset = 0 // OFP_BSN_FEC_CONFIG_STATE_UNSET |
| 780 | BSNFecConfigStateEnabled = 1 // OFP_BSN_FEC_CONFIG_STATE_ENABLED |
| 781 | BSNFecConfigStateDisabled = 2 // OFP_BSN_FEC_CONFIG_STATE_DISABLED |
| 782 | ) |
| 783 | |
| 784 | type BsnFecConfigState uint32 |
| 785 | |
| 786 | func (self BsnFecConfigState) MarshalJSON() ([]byte, error) { |
| 787 | return []byte(fmt.Sprintf("%d", self)), nil |
| 788 | } |
| 789 | |
| 790 | const ( |
| 791 | // Identifiers from group ofp_bsn_flow_classifier |
| 792 | BSNFlowClassifierNone = 0 // OFP_BSN_FLOW_CLASSIFIER_NONE |
| 793 | BSNFlowClassifierL2Bc = 1 // OFP_BSN_FLOW_CLASSIFIER_L2BC |
| 794 | BSNFlowClassifierL2Uc = 2 // OFP_BSN_FLOW_CLASSIFIER_L2UC |
| 795 | BSNFlowClassifierL2Unknown = 3 // OFP_BSN_FLOW_CLASSIFIER_L2UNKNOWN |
| 796 | BSNFlowClassifierL2Mcknown = 4 // OFP_BSN_FLOW_CLASSIFIER_L2MCKNOWN |
| 797 | BSNFlowClassifierL2Mcunknown = 5 // OFP_BSN_FLOW_CLASSIFIER_L2MCUNKNOWN |
| 798 | BSNFlowClassifierL3Mcunknown = 6 // OFP_BSN_FLOW_CLASSIFIER_L3MCUNKNOWN |
| 799 | BSNFlowClassifierL3Mcknown = 7 // OFP_BSN_FLOW_CLASSIFIER_L3MCKNOWN |
| 800 | BSNFlowClassifierL3Ucknown = 8 // OFP_BSN_FLOW_CLASSIFIER_L3UCKNOWN |
| 801 | BSNFlowClassifierL3Ucunknown = 9 // OFP_BSN_FLOW_CLASSIFIER_L3UCUNKNOWN |
| 802 | ) |
| 803 | |
| 804 | type BsnFlowClassifier uint16 |
| 805 | |
| 806 | func (self BsnFlowClassifier) MarshalJSON() ([]byte, error) { |
| 807 | return []byte(fmt.Sprintf("%d", self)), nil |
| 808 | } |
| 809 | |
| 810 | const ( |
| 811 | // Identifiers from group ofp_bsn_forward_error_correction_type |
| 812 | BSNForwardErrorCorrectionDefault = 0 // OFP_BSN_FORWARD_ERROR_CORRECTION_DEFAULT |
| 813 | BSNForwardErrorCorrectionEnable = 1 // OFP_BSN_FORWARD_ERROR_CORRECTION_ENABLE |
| 814 | BSNForwardErrorCorrectionDisable = 2 // OFP_BSN_FORWARD_ERROR_CORRECTION_DISABLE |
| 815 | ) |
| 816 | |
| 817 | type BsnForwardErrorCorrectionType uint8 |
| 818 | |
| 819 | func (self BsnForwardErrorCorrectionType) MarshalJSON() ([]byte, error) { |
| 820 | return []byte(fmt.Sprintf("%d", self)), nil |
| 821 | } |
| 822 | |
| 823 | const ( |
| 824 | // Identifiers from group ofp_bsn_hash_algorithm_type |
| 825 | BSNHashAlgorithmCrc16Xor8 = 0 // OFP_BSN_HASH_ALGORITHM_CRC16XOR8 |
| 826 | BSNHashAlgorithmCrc16Xor4 = 1 // OFP_BSN_HASH_ALGORITHM_CRC16XOR4 |
| 827 | BSNHashAlgorithmCrc16Xor2 = 2 // OFP_BSN_HASH_ALGORITHM_CRC16XOR2 |
| 828 | BSNHashAlgorithmCrc16Xor1 = 3 // OFP_BSN_HASH_ALGORITHM_CRC16XOR1 |
| 829 | BSNHashAlgorithmCrc16 = 4 // OFP_BSN_HASH_ALGORITHM_CRC16 |
| 830 | BSNHashAlgorithmXor16 = 5 // OFP_BSN_HASH_ALGORITHM_XOR16 |
| 831 | BSNHashAlgorithmCrc16Ccitt = 6 // OFP_BSN_HASH_ALGORITHM_CRC16CCITT |
| 832 | BSNHashAlgorithmCrc32Lo = 7 // OFP_BSN_HASH_ALGORITHM_CRC32LO |
| 833 | BSNHashAlgorithmCrc32Hi = 8 // OFP_BSN_HASH_ALGORITHM_CRC32HI |
| 834 | ) |
| 835 | |
| 836 | type BsnHashAlgorithmType uint16 |
| 837 | |
| 838 | func (self BsnHashAlgorithmType) MarshalJSON() ([]byte, error) { |
| 839 | return []byte(fmt.Sprintf("%d", self)), nil |
| 840 | } |
| 841 | |
| 842 | const ( |
| 843 | // Identifiers from group ofp_bsn_hash_select_flags |
| 844 | BSNHashSelectSrcIp = 1 // OFP_BSN_HASH_SELECT_SRC_IP |
| 845 | BSNHashSelectDstIp = 2 // OFP_BSN_HASH_SELECT_DST_IP |
| 846 | ) |
| 847 | |
| 848 | type BsnHashSelectFlags uint32 |
| 849 | |
| 850 | func (self BsnHashSelectFlags) MarshalJSON() ([]byte, error) { |
| 851 | var flags []string |
| 852 | if self&BSNHashSelectSrcIp == BSNHashSelectSrcIp { |
| 853 | flags = append(flags, "\"SrcIp\": true") |
| 854 | } |
| 855 | if self&BSNHashSelectDstIp == BSNHashSelectDstIp { |
| 856 | flags = append(flags, "\"DstIp\": true") |
| 857 | } |
| 858 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 859 | } |
| 860 | |
| 861 | const ( |
| 862 | // Identifiers from group ofp_bsn_ip_tunnel_type |
| 863 | BSNIpTunnelTypeNone = 0 // OFP_BSN_IP_TUNNEL_TYPE_NONE |
| 864 | BSNIpTunnelTypePim = 1 // OFP_BSN_IP_TUNNEL_TYPE_PIM |
| 865 | ) |
| 866 | |
| 867 | type BsnIpTunnelType uint16 |
| 868 | |
| 869 | func (self BsnIpTunnelType) MarshalJSON() ([]byte, error) { |
| 870 | return []byte(fmt.Sprintf("%d", self)), nil |
| 871 | } |
| 872 | |
| 873 | const ( |
| 874 | // Identifiers from group ofp_bsn_lacp_state |
| 875 | BSNLacpStateActivity = 1 // OFP_BSN_LACP_STATE_ACTIVITY |
| 876 | BSNLacpStateTimeout = 2 // OFP_BSN_LACP_STATE_TIMEOUT |
| 877 | BSNLacpStateAggregation = 4 // OFP_BSN_LACP_STATE_AGGREGATION |
| 878 | BSNLacpStateSynchronization = 8 // OFP_BSN_LACP_STATE_SYNCHRONIZATION |
| 879 | BSNLacpStateCollecting = 16 // OFP_BSN_LACP_STATE_COLLECTING |
| 880 | BSNLacpStateDistributing = 32 // OFP_BSN_LACP_STATE_DISTRIBUTING |
| 881 | BSNLacpStateDefaulted = 64 // OFP_BSN_LACP_STATE_DEFAULTED |
| 882 | BSNLacpStateExpired = 128 // OFP_BSN_LACP_STATE_EXPIRED |
| 883 | ) |
| 884 | |
| 885 | type BsnLacpState uint8 |
| 886 | |
| 887 | func (self BsnLacpState) MarshalJSON() ([]byte, error) { |
| 888 | var flags []string |
| 889 | if self&BSNLacpStateActivity == BSNLacpStateActivity { |
| 890 | flags = append(flags, "\"Activity\": true") |
| 891 | } |
| 892 | if self&BSNLacpStateTimeout == BSNLacpStateTimeout { |
| 893 | flags = append(flags, "\"Timeout\": true") |
| 894 | } |
| 895 | if self&BSNLacpStateAggregation == BSNLacpStateAggregation { |
| 896 | flags = append(flags, "\"Aggregation\": true") |
| 897 | } |
| 898 | if self&BSNLacpStateSynchronization == BSNLacpStateSynchronization { |
| 899 | flags = append(flags, "\"Synchronization\": true") |
| 900 | } |
| 901 | if self&BSNLacpStateCollecting == BSNLacpStateCollecting { |
| 902 | flags = append(flags, "\"Collecting\": true") |
| 903 | } |
| 904 | if self&BSNLacpStateDistributing == BSNLacpStateDistributing { |
| 905 | flags = append(flags, "\"Distributing\": true") |
| 906 | } |
| 907 | if self&BSNLacpStateDefaulted == BSNLacpStateDefaulted { |
| 908 | flags = append(flags, "\"Defaulted\": true") |
| 909 | } |
| 910 | if self&BSNLacpStateExpired == BSNLacpStateExpired { |
| 911 | flags = append(flags, "\"Expired\": true") |
| 912 | } |
| 913 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 914 | } |
| 915 | |
| 916 | const ( |
| 917 | // Identifiers from group ofp_bsn_lag_flag |
| 918 | BSNLagFlagAutoRecovery = 1 // OFP_BSN_LAG_FLAG_AUTO_RECOVERY |
| 919 | ) |
| 920 | |
| 921 | type BsnLagFlag uint16 |
| 922 | |
| 923 | func (self BsnLagFlag) MarshalJSON() ([]byte, error) { |
| 924 | var flags []string |
| 925 | if self&BSNLagFlagAutoRecovery == BSNLagFlagAutoRecovery { |
| 926 | flags = append(flags, "\"BSNLagFlagAutoRecovery\": true") |
| 927 | } |
| 928 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 929 | } |
| 930 | |
| 931 | const ( |
| 932 | // Identifiers from group ofp_bsn_loglevel |
| 933 | BSNLoglevelMsg = 0 // OFP_BSN_LOGLEVEL_MSG |
| 934 | BSNLoglevelError = 1 // OFP_BSN_LOGLEVEL_ERROR |
| 935 | BSNLoglevelWarn = 2 // OFP_BSN_LOGLEVEL_WARN |
| 936 | BSNLoglevelInfo = 3 // OFP_BSN_LOGLEVEL_INFO |
| 937 | BSNLoglevelVerbose = 4 // OFP_BSN_LOGLEVEL_VERBOSE |
| 938 | BSNLoglevelTrace = 5 // OFP_BSN_LOGLEVEL_TRACE |
| 939 | ) |
| 940 | |
| 941 | type BsnLoglevel uint8 |
| 942 | |
| 943 | func (self BsnLoglevel) MarshalJSON() ([]byte, error) { |
| 944 | return []byte(fmt.Sprintf("%d", self)), nil |
| 945 | } |
| 946 | |
| 947 | const ( |
| 948 | // Identifiers from group ofp_bsn_loopback_mode |
| 949 | BSNLoopbackModeNone = 0 // OFP_BSN_LOOPBACK_MODE_NONE |
| 950 | BSNLoopbackModeMAC = 1 // OFP_BSN_LOOPBACK_MODE_MAC |
| 951 | BSNLoopbackModePhy = 2 // OFP_BSN_LOOPBACK_MODE_PHY |
| 952 | BSNLoopbackModePhyRemote = 3 // OFP_BSN_LOOPBACK_MODE_PHY_REMOTE |
| 953 | ) |
| 954 | |
| 955 | type BsnLoopbackMode uint8 |
| 956 | |
| 957 | func (self BsnLoopbackMode) MarshalJSON() ([]byte, error) { |
| 958 | return []byte(fmt.Sprintf("%d", self)), nil |
| 959 | } |
| 960 | |
| 961 | const ( |
| 962 | // Identifiers from group ofp_bsn_lua_upload_flags |
| 963 | BSNLuaUploadMore = 1 // OFP_BSN_LUA_UPLOAD_MORE |
| 964 | BSNLuaUploadForce = 2 // OFP_BSN_LUA_UPLOAD_FORCE |
| 965 | ) |
| 966 | |
| 967 | type BsnLuaUploadFlags uint16 |
| 968 | |
| 969 | func (self BsnLuaUploadFlags) MarshalJSON() ([]byte, error) { |
| 970 | var flags []string |
| 971 | if self&BSNLuaUploadMore == BSNLuaUploadMore { |
| 972 | flags = append(flags, "\"More\": true") |
| 973 | } |
| 974 | if self&BSNLuaUploadForce == BSNLuaUploadForce { |
| 975 | flags = append(flags, "\"Force\": true") |
| 976 | } |
| 977 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 978 | } |
| 979 | |
| 980 | const ( |
| 981 | // Identifiers from group ofp_bsn_misc_capabilities |
| 982 | BSNMiscCapFec = 1 // OFP_BSN_MISC_CAP_FEC |
| 983 | ) |
| 984 | |
| 985 | type BsnMiscCapabilities uint64 |
| 986 | |
| 987 | func (self BsnMiscCapabilities) MarshalJSON() ([]byte, error) { |
| 988 | var flags []string |
| 989 | if self&BSNMiscCapFec == BSNMiscCapFec { |
| 990 | flags = append(flags, "\"BSNMiscCapFec\": true") |
| 991 | } |
| 992 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 993 | } |
| 994 | |
| 995 | const ( |
| 996 | // Identifiers from group ofp_bsn_multicast_packet |
| 997 | BSNMulticastPacketNone = 0 // OFP_BSN_MULTICAST_PACKET_NONE |
| 998 | BSNMulticastPacketPimHello = 1 // OFP_BSN_MULTICAST_PACKET_PIM_HELLO |
| 999 | BSNMulticastPacketPimJoinPrune = 2 // OFP_BSN_MULTICAST_PACKET_PIM_JOIN_PRUNE |
| 1000 | BSNMulticastPacketPimAssert = 3 // OFP_BSN_MULTICAST_PACKET_PIM_ASSERT |
| 1001 | ) |
| 1002 | |
| 1003 | type BsnMulticastPacket uint16 |
| 1004 | |
| 1005 | func (self BsnMulticastPacket) MarshalJSON() ([]byte, error) { |
| 1006 | return []byte(fmt.Sprintf("%d", self)), nil |
| 1007 | } |
| 1008 | |
| 1009 | const ( |
| 1010 | // Identifiers from group ofp_bsn_pktin_flag |
| 1011 | BSNPktinFlagPdu = 1 // OFP_BSN_PKTIN_FLAG_PDU |
| 1012 | BSNPktinFlagNewHost = 2 // OFP_BSN_PKTIN_FLAG_NEW_HOST |
| 1013 | BSNPktinFlagStationMove = 4 // OFP_BSN_PKTIN_FLAG_STATION_MOVE |
| 1014 | BSNPktinFlagARP = 8 // OFP_BSN_PKTIN_FLAG_ARP |
| 1015 | BSNPktinFlagDhcp = 16 // OFP_BSN_PKTIN_FLAG_DHCP |
| 1016 | BSNPktinFlagL2Cpu = 32 // OFP_BSN_PKTIN_FLAG_L2_CPU |
| 1017 | BSNPktinFlagDebug = 64 // OFP_BSN_PKTIN_FLAG_DEBUG |
| 1018 | BSNPktinFlagTtlExpired = 128 // OFP_BSN_PKTIN_FLAG_TTL_EXPIRED |
| 1019 | BSNPktinFlagL3Miss = 256 // OFP_BSN_PKTIN_FLAG_L3_MISS |
| 1020 | BSNPktinFlagL3Cpu = 512 // OFP_BSN_PKTIN_FLAG_L3_CPU |
| 1021 | BSNPktinFlagIngressAcl = 1024 // OFP_BSN_PKTIN_FLAG_INGRESS_ACL |
| 1022 | BSNPktinFlagSflow = 2048 // OFP_BSN_PKTIN_FLAG_SFLOW |
| 1023 | BSNPktinFlagARPCache = 4096 // OFP_BSN_PKTIN_FLAG_ARP_CACHE |
| 1024 | BSNPktinFlagARPTarget = 8192 // OFP_BSN_PKTIN_FLAG_ARP_TARGET |
| 1025 | BSNPktinFlagIgmp = 16384 // OFP_BSN_PKTIN_FLAG_IGMP |
| 1026 | BSNPktinFlagPim = 32768 // OFP_BSN_PKTIN_FLAG_PIM |
| 1027 | BSNPktinFlagVxlanSipMiss = 65536 // OFP_BSN_PKTIN_FLAG_VXLAN_SIP_MISS |
| 1028 | BSNPktinFlagMcReserved = 131072 // OFP_BSN_PKTIN_FLAG_MC_RESERVED |
| 1029 | BSNPktinFlagAnalytics = 262144 // OFP_BSN_PKTIN_FLAG_ANALYTICS |
| 1030 | BSNPktinFlagIcmpv6 = 524288 // OFP_BSN_PKTIN_FLAG_ICMPV6 |
| 1031 | BSNPktinFlagIngressAclLocal = 1048576 // OFP_BSN_PKTIN_FLAG_INGRESS_ACL_LOCAL |
| 1032 | BSNPktinFlagIpmcMiss = 2097152 // OFP_BSN_PKTIN_FLAG_IPMC_MISS |
| 1033 | BSNPktinFlagIpmcRpfFailed = 4194304 // OFP_BSN_PKTIN_FLAG_IPMC_RPF_FAILED |
| 1034 | BSNPktinFlagBfdSlowpath = 8388608 // OFP_BSN_PKTIN_FLAG_BFD_SLOWPATH |
| 1035 | BSNPktinFlagSflowEgress = 16777216 // OFP_BSN_PKTIN_FLAG_SFLOW_EGRESS |
| 1036 | ) |
| 1037 | |
| 1038 | type BsnPktinFlag uint64 |
| 1039 | |
| 1040 | func (self BsnPktinFlag) MarshalJSON() ([]byte, error) { |
| 1041 | var flags []string |
| 1042 | if self&BSNPktinFlagPdu == BSNPktinFlagPdu { |
| 1043 | flags = append(flags, "\"Pdu\": true") |
| 1044 | } |
| 1045 | if self&BSNPktinFlagNewHost == BSNPktinFlagNewHost { |
| 1046 | flags = append(flags, "\"NewHost\": true") |
| 1047 | } |
| 1048 | if self&BSNPktinFlagStationMove == BSNPktinFlagStationMove { |
| 1049 | flags = append(flags, "\"StationMove\": true") |
| 1050 | } |
| 1051 | if self&BSNPktinFlagARP == BSNPktinFlagARP { |
| 1052 | flags = append(flags, "\"Arp\": true") |
| 1053 | } |
| 1054 | if self&BSNPktinFlagDhcp == BSNPktinFlagDhcp { |
| 1055 | flags = append(flags, "\"Dhcp\": true") |
| 1056 | } |
| 1057 | if self&BSNPktinFlagL2Cpu == BSNPktinFlagL2Cpu { |
| 1058 | flags = append(flags, "\"L2Cpu\": true") |
| 1059 | } |
| 1060 | if self&BSNPktinFlagDebug == BSNPktinFlagDebug { |
| 1061 | flags = append(flags, "\"Debug\": true") |
| 1062 | } |
| 1063 | if self&BSNPktinFlagTtlExpired == BSNPktinFlagTtlExpired { |
| 1064 | flags = append(flags, "\"TtlExpired\": true") |
| 1065 | } |
| 1066 | if self&BSNPktinFlagL3Miss == BSNPktinFlagL3Miss { |
| 1067 | flags = append(flags, "\"L3Miss\": true") |
| 1068 | } |
| 1069 | if self&BSNPktinFlagL3Cpu == BSNPktinFlagL3Cpu { |
| 1070 | flags = append(flags, "\"L3Cpu\": true") |
| 1071 | } |
| 1072 | if self&BSNPktinFlagIngressAcl == BSNPktinFlagIngressAcl { |
| 1073 | flags = append(flags, "\"IngressAcl\": true") |
| 1074 | } |
| 1075 | if self&BSNPktinFlagSflow == BSNPktinFlagSflow { |
| 1076 | flags = append(flags, "\"Sflow\": true") |
| 1077 | } |
| 1078 | if self&BSNPktinFlagARPCache == BSNPktinFlagARPCache { |
| 1079 | flags = append(flags, "\"ArpCache\": true") |
| 1080 | } |
| 1081 | if self&BSNPktinFlagARPTarget == BSNPktinFlagARPTarget { |
| 1082 | flags = append(flags, "\"ArpTarget\": true") |
| 1083 | } |
| 1084 | if self&BSNPktinFlagIgmp == BSNPktinFlagIgmp { |
| 1085 | flags = append(flags, "\"Igmp\": true") |
| 1086 | } |
| 1087 | if self&BSNPktinFlagPim == BSNPktinFlagPim { |
| 1088 | flags = append(flags, "\"Pim\": true") |
| 1089 | } |
| 1090 | if self&BSNPktinFlagVxlanSipMiss == BSNPktinFlagVxlanSipMiss { |
| 1091 | flags = append(flags, "\"VxlanSipMiss\": true") |
| 1092 | } |
| 1093 | if self&BSNPktinFlagMcReserved == BSNPktinFlagMcReserved { |
| 1094 | flags = append(flags, "\"McReserved\": true") |
| 1095 | } |
| 1096 | if self&BSNPktinFlagAnalytics == BSNPktinFlagAnalytics { |
| 1097 | flags = append(flags, "\"Analytics\": true") |
| 1098 | } |
| 1099 | if self&BSNPktinFlagIcmpv6 == BSNPktinFlagIcmpv6 { |
| 1100 | flags = append(flags, "\"Icmpv6\": true") |
| 1101 | } |
| 1102 | if self&BSNPktinFlagIngressAclLocal == BSNPktinFlagIngressAclLocal { |
| 1103 | flags = append(flags, "\"IngressAclLocal\": true") |
| 1104 | } |
| 1105 | if self&BSNPktinFlagIpmcMiss == BSNPktinFlagIpmcMiss { |
| 1106 | flags = append(flags, "\"IpmcMiss\": true") |
| 1107 | } |
| 1108 | if self&BSNPktinFlagIpmcRpfFailed == BSNPktinFlagIpmcRpfFailed { |
| 1109 | flags = append(flags, "\"IpmcRpfFailed\": true") |
| 1110 | } |
| 1111 | if self&BSNPktinFlagBfdSlowpath == BSNPktinFlagBfdSlowpath { |
| 1112 | flags = append(flags, "\"BfdSlowpath\": true") |
| 1113 | } |
| 1114 | if self&BSNPktinFlagSflowEgress == BSNPktinFlagSflowEgress { |
| 1115 | flags = append(flags, "\"SflowEgress\": true") |
| 1116 | } |
| 1117 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 1118 | } |
| 1119 | |
| 1120 | const ( |
| 1121 | // Identifiers from group ofp_bsn_port_counter |
| 1122 | BSNPortCounterRxBytes = 0 // OFP_BSN_PORT_COUNTER_RX_BYTES |
| 1123 | BSNPortCounterRxPacketsUnicast = 1 // OFP_BSN_PORT_COUNTER_RX_PACKETS_UNICAST |
| 1124 | BSNPortCounterRxPacketsBroadcast = 2 // OFP_BSN_PORT_COUNTER_RX_PACKETS_BROADCAST |
| 1125 | BSNPortCounterRxPacketsMulticast = 3 // OFP_BSN_PORT_COUNTER_RX_PACKETS_MULTICAST |
| 1126 | BSNPortCounterRxDropped = 4 // OFP_BSN_PORT_COUNTER_RX_DROPPED |
| 1127 | BSNPortCounterRxErrors = 5 // OFP_BSN_PORT_COUNTER_RX_ERRORS |
| 1128 | BSNPortCounterTxBytes = 6 // OFP_BSN_PORT_COUNTER_TX_BYTES |
| 1129 | BSNPortCounterTxPacketsUnicast = 7 // OFP_BSN_PORT_COUNTER_TX_PACKETS_UNICAST |
| 1130 | BSNPortCounterTxPacketsBroadcast = 8 // OFP_BSN_PORT_COUNTER_TX_PACKETS_BROADCAST |
| 1131 | BSNPortCounterTxPacketsMulticast = 9 // OFP_BSN_PORT_COUNTER_TX_PACKETS_MULTICAST |
| 1132 | BSNPortCounterTxDropped = 10 // OFP_BSN_PORT_COUNTER_TX_DROPPED |
| 1133 | BSNPortCounterTxErrors = 11 // OFP_BSN_PORT_COUNTER_TX_ERRORS |
| 1134 | BSNPortCounterRxRunts = 12 // OFP_BSN_PORT_COUNTER_RX_RUNTS |
| 1135 | BSNPortCounterRxGiants = 13 // OFP_BSN_PORT_COUNTER_RX_GIANTS |
| 1136 | BSNPortCounterRxCrcErrors = 14 // OFP_BSN_PORT_COUNTER_RX_CRC_ERRORS |
| 1137 | BSNPortCounterRxAlignmentErrors = 15 // OFP_BSN_PORT_COUNTER_RX_ALIGNMENT_ERRORS |
| 1138 | BSNPortCounterRxSymbolErrors = 16 // OFP_BSN_PORT_COUNTER_RX_SYMBOL_ERRORS |
| 1139 | BSNPortCounterRxPauseInput = 17 // OFP_BSN_PORT_COUNTER_RX_PAUSE_INPUT |
| 1140 | BSNPortCounterTxCollisions = 18 // OFP_BSN_PORT_COUNTER_TX_COLLISIONS |
| 1141 | BSNPortCounterTxLateCollisions = 19 // OFP_BSN_PORT_COUNTER_TX_LATE_COLLISIONS |
| 1142 | BSNPortCounterTxDeferred = 20 // OFP_BSN_PORT_COUNTER_TX_DEFERRED |
| 1143 | BSNPortCounterTxPauseOutput = 21 // OFP_BSN_PORT_COUNTER_TX_PAUSE_OUTPUT |
| 1144 | BSNPortCounterRxPackets = 22 // OFP_BSN_PORT_COUNTER_RX_PACKETS |
| 1145 | BSNPortCounterTxPackets = 23 // OFP_BSN_PORT_COUNTER_TX_PACKETS |
| 1146 | BSNPortCounterRxLengthErrors = 24 // OFP_BSN_PORT_COUNTER_RX_LENGTH_ERRORS |
| 1147 | BSNPortCounterRxOverflowErrors = 25 // OFP_BSN_PORT_COUNTER_RX_OVERFLOW_ERRORS |
| 1148 | BSNPortCounterTxCarrierErrors = 26 // OFP_BSN_PORT_COUNTER_TX_CARRIER_ERRORS |
| 1149 | BSNPortCounterRxPacketsBadVLAN = 27 // OFP_BSN_PORT_COUNTER_RX_PACKETS_BAD_VLAN |
| 1150 | BSNPortCounterLinkUp = 28 // OFP_BSN_PORT_COUNTER_LINK_UP |
| 1151 | BSNPortCounterLinkDown = 29 // OFP_BSN_PORT_COUNTER_LINK_DOWN |
| 1152 | BSNPortCounterRxPfcControlFrame = 30 // OFP_BSN_PORT_COUNTER_RX_PFC_CONTROL_FRAME |
| 1153 | BSNPortCounterTxPfcControlFrame = 31 // OFP_BSN_PORT_COUNTER_TX_PFC_CONTROL_FRAME |
| 1154 | BSNPortCounterRxPfcFrameXonPriority0 = 32 // OFP_BSN_PORT_COUNTER_RX_PFC_FRAME_XON_PRIORITY_0 |
| 1155 | BSNPortCounterRxPfcFrameXonPriority1 = 33 // OFP_BSN_PORT_COUNTER_RX_PFC_FRAME_XON_PRIORITY_1 |
| 1156 | BSNPortCounterRxPfcFrameXonPriority2 = 34 // OFP_BSN_PORT_COUNTER_RX_PFC_FRAME_XON_PRIORITY_2 |
| 1157 | BSNPortCounterRxPfcFrameXonPriority3 = 35 // OFP_BSN_PORT_COUNTER_RX_PFC_FRAME_XON_PRIORITY_3 |
| 1158 | BSNPortCounterRxPfcFrameXonPriority4 = 36 // OFP_BSN_PORT_COUNTER_RX_PFC_FRAME_XON_PRIORITY_4 |
| 1159 | BSNPortCounterRxPfcFrameXonPriority5 = 37 // OFP_BSN_PORT_COUNTER_RX_PFC_FRAME_XON_PRIORITY_5 |
| 1160 | BSNPortCounterRxPfcFrameXonPriority6 = 38 // OFP_BSN_PORT_COUNTER_RX_PFC_FRAME_XON_PRIORITY_6 |
| 1161 | BSNPortCounterRxPfcFrameXonPriority7 = 39 // OFP_BSN_PORT_COUNTER_RX_PFC_FRAME_XON_PRIORITY_7 |
| 1162 | BSNPortCounterRxPfcFramePriority0 = 40 // OFP_BSN_PORT_COUNTER_RX_PFC_FRAME_PRIORITY_0 |
| 1163 | BSNPortCounterRxPfcFramePriority1 = 41 // OFP_BSN_PORT_COUNTER_RX_PFC_FRAME_PRIORITY_1 |
| 1164 | BSNPortCounterRxPfcFramePriority2 = 42 // OFP_BSN_PORT_COUNTER_RX_PFC_FRAME_PRIORITY_2 |
| 1165 | BSNPortCounterRxPfcFramePriority3 = 43 // OFP_BSN_PORT_COUNTER_RX_PFC_FRAME_PRIORITY_3 |
| 1166 | BSNPortCounterRxPfcFramePriority4 = 44 // OFP_BSN_PORT_COUNTER_RX_PFC_FRAME_PRIORITY_4 |
| 1167 | BSNPortCounterRxPfcFramePriority5 = 45 // OFP_BSN_PORT_COUNTER_RX_PFC_FRAME_PRIORITY_5 |
| 1168 | BSNPortCounterRxPfcFramePriority6 = 46 // OFP_BSN_PORT_COUNTER_RX_PFC_FRAME_PRIORITY_6 |
| 1169 | BSNPortCounterRxPfcFramePriority7 = 47 // OFP_BSN_PORT_COUNTER_RX_PFC_FRAME_PRIORITY_7 |
| 1170 | BSNPortCounterTxPfcFramePriority0 = 48 // OFP_BSN_PORT_COUNTER_TX_PFC_FRAME_PRIORITY_0 |
| 1171 | BSNPortCounterTxPfcFramePriority1 = 49 // OFP_BSN_PORT_COUNTER_TX_PFC_FRAME_PRIORITY_1 |
| 1172 | BSNPortCounterTxPfcFramePriority2 = 50 // OFP_BSN_PORT_COUNTER_TX_PFC_FRAME_PRIORITY_2 |
| 1173 | BSNPortCounterTxPfcFramePriority3 = 51 // OFP_BSN_PORT_COUNTER_TX_PFC_FRAME_PRIORITY_3 |
| 1174 | BSNPortCounterTxPfcFramePriority4 = 52 // OFP_BSN_PORT_COUNTER_TX_PFC_FRAME_PRIORITY_4 |
| 1175 | BSNPortCounterTxPfcFramePriority5 = 53 // OFP_BSN_PORT_COUNTER_TX_PFC_FRAME_PRIORITY_5 |
| 1176 | BSNPortCounterTxPfcFramePriority6 = 54 // OFP_BSN_PORT_COUNTER_TX_PFC_FRAME_PRIORITY_6 |
| 1177 | BSNPortCounterTxPfcFramePriority7 = 55 // OFP_BSN_PORT_COUNTER_TX_PFC_FRAME_PRIORITY_7 |
| 1178 | ) |
| 1179 | |
| 1180 | type BsnPortCounter uint8 |
| 1181 | |
| 1182 | func (self BsnPortCounter) MarshalJSON() ([]byte, error) { |
| 1183 | return []byte(fmt.Sprintf("%d", self)), nil |
| 1184 | } |
| 1185 | |
| 1186 | const ( |
| 1187 | // Identifiers from group ofp_bsn_port_mode |
| 1188 | BSNPortModeNone = 0 // OFP_BSN_PORT_MODE_NONE |
| 1189 | BSNPortMode4Xx = 1 // OFP_BSN_PORT_MODE_4XX |
| 1190 | BSNPortMode4X1 = 2 // OFP_BSN_PORT_MODE_4X1 |
| 1191 | BSNPortMode4X10 = 3 // OFP_BSN_PORT_MODE_4X10 |
| 1192 | BSNPortMode4X25 = 4 // OFP_BSN_PORT_MODE_4X25 |
| 1193 | BSNPortMode2X50 = 5 // OFP_BSN_PORT_MODE_2X50 |
| 1194 | BSNPortMode1X1 = 6 // OFP_BSN_PORT_MODE_1X1 |
| 1195 | BSNPortMode1X10 = 7 // OFP_BSN_PORT_MODE_1X10 |
| 1196 | BSNPortMode1X25 = 8 // OFP_BSN_PORT_MODE_1X25 |
| 1197 | BSNPortMode1X40 = 9 // OFP_BSN_PORT_MODE_1X40 |
| 1198 | BSNPortMode1X100 = 10 // OFP_BSN_PORT_MODE_1X100 |
| 1199 | ) |
| 1200 | |
| 1201 | type BsnPortMode uint16 |
| 1202 | |
| 1203 | func (self BsnPortMode) MarshalJSON() ([]byte, error) { |
| 1204 | return []byte(fmt.Sprintf("%d", self)), nil |
| 1205 | } |
| 1206 | |
| 1207 | const ( |
| 1208 | // Identifiers from group ofp_bsn_port_speed_gbps_type |
| 1209 | BSNPortSpeedGbps1 = 1 // OFP_BSN_PORT_SPEED_GBPS_1 |
| 1210 | BSNPortSpeedGbps10 = 10 // OFP_BSN_PORT_SPEED_GBPS_10 |
| 1211 | BSNPortSpeedGbps25 = 25 // OFP_BSN_PORT_SPEED_GBPS_25 |
| 1212 | BSNPortSpeedGbps40 = 40 // OFP_BSN_PORT_SPEED_GBPS_40 |
| 1213 | BSNPortSpeedGbps50 = 50 // OFP_BSN_PORT_SPEED_GBPS_50 |
| 1214 | BSNPortSpeedGbps100 = 100 // OFP_BSN_PORT_SPEED_GBPS_100 |
| 1215 | ) |
| 1216 | |
| 1217 | type BsnPortSpeedGbpsType uint32 |
| 1218 | |
| 1219 | func (self BsnPortSpeedGbpsType) MarshalJSON() ([]byte, error) { |
| 1220 | return []byte(fmt.Sprintf("%d", self)), nil |
| 1221 | } |
| 1222 | |
| 1223 | const ( |
| 1224 | // Identifiers from group ofp_bsn_port_usage |
| 1225 | BSNPortUnused = 0 // OFP_BSN_PORT_UNUSED |
| 1226 | BSNPortTransmitOnly = 1 // OFP_BSN_PORT_TRANSMIT_ONLY |
| 1227 | BSNPortReceiveOnly = 2 // OFP_BSN_PORT_RECEIVE_ONLY |
| 1228 | BSNPortBidirection = 3 // OFP_BSN_PORT_BIDIRECTION |
| 1229 | ) |
| 1230 | |
| 1231 | type BsnPortUsage uint16 |
| 1232 | |
| 1233 | func (self BsnPortUsage) MarshalJSON() ([]byte, error) { |
| 1234 | return []byte(fmt.Sprintf("%d", self)), nil |
| 1235 | } |
| 1236 | |
| 1237 | const ( |
| 1238 | // Identifiers from group ofp_bsn_port_vxlan_mode |
| 1239 | BSNPortVxlanRecirculationEnable = 0 // OFP_BSN_PORT_VXLAN_RECIRCULATION_ENABLE |
| 1240 | BSNPortVxlanTerminationEnable = 1 // OFP_BSN_PORT_VXLAN_TERMINATION_ENABLE |
| 1241 | ) |
| 1242 | |
| 1243 | type BsnPortVxlanMode uint8 |
| 1244 | |
| 1245 | func (self BsnPortVxlanMode) MarshalJSON() ([]byte, error) { |
| 1246 | return []byte(fmt.Sprintf("%d", self)), nil |
| 1247 | } |
| 1248 | |
| 1249 | const ( |
| 1250 | // Identifiers from group ofp_bsn_push_vlan |
| 1251 | BSNPushVLANUntagged = 1 // OFP_BSN_PUSH_VLAN_UNTAGGED |
| 1252 | BSNPushVLANSingleTagged = 2 // OFP_BSN_PUSH_VLAN_SINGLE_TAGGED |
| 1253 | BSNPushVLANDoubleTagged = 4 // OFP_BSN_PUSH_VLAN_DOUBLE_TAGGED |
| 1254 | ) |
| 1255 | |
| 1256 | type BsnPushVlan uint8 |
| 1257 | |
| 1258 | func (self BsnPushVlan) MarshalJSON() ([]byte, error) { |
| 1259 | var flags []string |
| 1260 | if self&BSNPushVLANUntagged == BSNPushVLANUntagged { |
| 1261 | flags = append(flags, "\"Untagged\": true") |
| 1262 | } |
| 1263 | if self&BSNPushVLANSingleTagged == BSNPushVLANSingleTagged { |
| 1264 | flags = append(flags, "\"SingleTagged\": true") |
| 1265 | } |
| 1266 | if self&BSNPushVLANDoubleTagged == BSNPushVLANDoubleTagged { |
| 1267 | flags = append(flags, "\"DoubleTagged\": true") |
| 1268 | } |
| 1269 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 1270 | } |
| 1271 | |
| 1272 | const ( |
| 1273 | // Identifiers from group ofp_bsn_rate_unit |
| 1274 | BSNRateUnitPps = 0 // OFP_BSN_RATE_UNIT_PPS |
| 1275 | BSNRateUnitKbitps = 1 // OFP_BSN_RATE_UNIT_KBITPS |
| 1276 | ) |
| 1277 | |
| 1278 | type BsnRateUnit uint8 |
| 1279 | |
| 1280 | func (self BsnRateUnit) MarshalJSON() ([]byte, error) { |
| 1281 | return []byte(fmt.Sprintf("%d", self)), nil |
| 1282 | } |
| 1283 | |
| 1284 | const ( |
| 1285 | // Identifiers from group ofp_bsn_routing_param |
| 1286 | BSNRoutingParamOspfUcast = 1 // OFP_BSN_ROUTING_PARAM_OSPF_UCAST |
| 1287 | BSNRoutingParamOspfMcast = 2 // OFP_BSN_ROUTING_PARAM_OSPF_MCAST |
| 1288 | BSNRoutingParamARPFrr = 3 // OFP_BSN_ROUTING_PARAM_ARP_FRR |
| 1289 | BSNRoutingParamIpv6OspfUcast = 4 // OFP_BSN_ROUTING_PARAM_IPV6_OSPF_UCAST |
| 1290 | BSNRoutingParamIpv6OspfMcast = 5 // OFP_BSN_ROUTING_PARAM_IPV6_OSPF_MCAST |
| 1291 | BSNRoutingParamIpv6NdpFrr = 6 // OFP_BSN_ROUTING_PARAM_IPV6_NDP_FRR |
| 1292 | ) |
| 1293 | |
| 1294 | type BsnRoutingParam uint16 |
| 1295 | |
| 1296 | func (self BsnRoutingParam) MarshalJSON() ([]byte, error) { |
| 1297 | return []byte(fmt.Sprintf("%d", self)), nil |
| 1298 | } |
| 1299 | |
| 1300 | const ( |
| 1301 | // Identifiers from group ofp_bsn_speed_capabilities |
| 1302 | BSNSpeedCap10M = 1 // OFP_BSN_SPEED_CAP_10M |
| 1303 | BSNSpeedCap100M = 2 // OFP_BSN_SPEED_CAP_100M |
| 1304 | BSNSpeedCap1Gb = 4 // OFP_BSN_SPEED_CAP_1GB |
| 1305 | BSNSpeedCap10Gb = 8 // OFP_BSN_SPEED_CAP_10GB |
| 1306 | BSNSpeedCap25Gb = 16 // OFP_BSN_SPEED_CAP_25GB |
| 1307 | BSNSpeedCap40Gb = 32 // OFP_BSN_SPEED_CAP_40GB |
| 1308 | BSNSpeedCap50Gb = 64 // OFP_BSN_SPEED_CAP_50GB |
| 1309 | BSNSpeedCap100Gb = 128 // OFP_BSN_SPEED_CAP_100GB |
| 1310 | ) |
| 1311 | |
| 1312 | type BsnSpeedCapabilities uint64 |
| 1313 | |
| 1314 | func (self BsnSpeedCapabilities) MarshalJSON() ([]byte, error) { |
| 1315 | var flags []string |
| 1316 | if self&BSNSpeedCap10M == BSNSpeedCap10M { |
| 1317 | flags = append(flags, "\"10M\": true") |
| 1318 | } |
| 1319 | if self&BSNSpeedCap100M == BSNSpeedCap100M { |
| 1320 | flags = append(flags, "\"100M\": true") |
| 1321 | } |
| 1322 | if self&BSNSpeedCap1Gb == BSNSpeedCap1Gb { |
| 1323 | flags = append(flags, "\"1Gb\": true") |
| 1324 | } |
| 1325 | if self&BSNSpeedCap10Gb == BSNSpeedCap10Gb { |
| 1326 | flags = append(flags, "\"10Gb\": true") |
| 1327 | } |
| 1328 | if self&BSNSpeedCap25Gb == BSNSpeedCap25Gb { |
| 1329 | flags = append(flags, "\"25Gb\": true") |
| 1330 | } |
| 1331 | if self&BSNSpeedCap40Gb == BSNSpeedCap40Gb { |
| 1332 | flags = append(flags, "\"40Gb\": true") |
| 1333 | } |
| 1334 | if self&BSNSpeedCap50Gb == BSNSpeedCap50Gb { |
| 1335 | flags = append(flags, "\"50Gb\": true") |
| 1336 | } |
| 1337 | if self&BSNSpeedCap100Gb == BSNSpeedCap100Gb { |
| 1338 | flags = append(flags, "\"100Gb\": true") |
| 1339 | } |
| 1340 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 1341 | } |
| 1342 | |
| 1343 | const ( |
| 1344 | // Identifiers from group ofp_bsn_status |
| 1345 | BSNStatusDisable = 0 // OFP_BSN_STATUS_DISABLE |
| 1346 | BSNStatusEnable = 1 // OFP_BSN_STATUS_ENABLE |
| 1347 | ) |
| 1348 | |
| 1349 | type BsnStatus uint8 |
| 1350 | |
| 1351 | func (self BsnStatus) MarshalJSON() ([]byte, error) { |
| 1352 | return []byte(fmt.Sprintf("%d", self)), nil |
| 1353 | } |
| 1354 | |
| 1355 | const ( |
| 1356 | // Identifiers from group ofp_bsn_strip_vlan |
| 1357 | BSNStripVLANFirst = 1 // OFP_BSN_STRIP_VLAN_FIRST |
| 1358 | BSNStripVLANSecond = 2 // OFP_BSN_STRIP_VLAN_SECOND |
| 1359 | BSNStripVLANThird = 4 // OFP_BSN_STRIP_VLAN_THIRD |
| 1360 | ) |
| 1361 | |
| 1362 | type BsnStripVlan uint8 |
| 1363 | |
| 1364 | func (self BsnStripVlan) MarshalJSON() ([]byte, error) { |
| 1365 | var flags []string |
| 1366 | if self&BSNStripVLANFirst == BSNStripVLANFirst { |
| 1367 | flags = append(flags, "\"First\": true") |
| 1368 | } |
| 1369 | if self&BSNStripVLANSecond == BSNStripVLANSecond { |
| 1370 | flags = append(flags, "\"Second\": true") |
| 1371 | } |
| 1372 | if self&BSNStripVLANThird == BSNStripVLANThird { |
| 1373 | flags = append(flags, "\"Third\": true") |
| 1374 | } |
| 1375 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 1376 | } |
| 1377 | |
| 1378 | const ( |
| 1379 | // Identifiers from group ofp_bsn_tcp_flag |
| 1380 | BSNTCPFlagFin = 1 // OFP_BSN_TCP_FLAG_FIN |
| 1381 | BSNTCPFlagSyn = 2 // OFP_BSN_TCP_FLAG_SYN |
| 1382 | BSNTCPFlagRst = 4 // OFP_BSN_TCP_FLAG_RST |
| 1383 | BSNTCPFlagPsh = 8 // OFP_BSN_TCP_FLAG_PSH |
| 1384 | BSNTCPFlagAck = 16 // OFP_BSN_TCP_FLAG_ACK |
| 1385 | BSNTCPFlagUrg = 32 // OFP_BSN_TCP_FLAG_URG |
| 1386 | BSNTCPFlagEce = 64 // OFP_BSN_TCP_FLAG_ECE |
| 1387 | BSNTCPFlagCwr = 128 // OFP_BSN_TCP_FLAG_CWR |
| 1388 | BSNTCPFlagNs = 256 // OFP_BSN_TCP_FLAG_NS |
| 1389 | ) |
| 1390 | |
| 1391 | type BsnTcpFlag uint16 |
| 1392 | |
| 1393 | func (self BsnTcpFlag) MarshalJSON() ([]byte, error) { |
| 1394 | var flags []string |
| 1395 | if self&BSNTCPFlagFin == BSNTCPFlagFin { |
| 1396 | flags = append(flags, "\"Fin\": true") |
| 1397 | } |
| 1398 | if self&BSNTCPFlagSyn == BSNTCPFlagSyn { |
| 1399 | flags = append(flags, "\"Syn\": true") |
| 1400 | } |
| 1401 | if self&BSNTCPFlagRst == BSNTCPFlagRst { |
| 1402 | flags = append(flags, "\"Rst\": true") |
| 1403 | } |
| 1404 | if self&BSNTCPFlagPsh == BSNTCPFlagPsh { |
| 1405 | flags = append(flags, "\"Psh\": true") |
| 1406 | } |
| 1407 | if self&BSNTCPFlagAck == BSNTCPFlagAck { |
| 1408 | flags = append(flags, "\"Ack\": true") |
| 1409 | } |
| 1410 | if self&BSNTCPFlagUrg == BSNTCPFlagUrg { |
| 1411 | flags = append(flags, "\"Urg\": true") |
| 1412 | } |
| 1413 | if self&BSNTCPFlagEce == BSNTCPFlagEce { |
| 1414 | flags = append(flags, "\"Ece\": true") |
| 1415 | } |
| 1416 | if self&BSNTCPFlagCwr == BSNTCPFlagCwr { |
| 1417 | flags = append(flags, "\"Cwr\": true") |
| 1418 | } |
| 1419 | if self&BSNTCPFlagNs == BSNTCPFlagNs { |
| 1420 | flags = append(flags, "\"Ns\": true") |
| 1421 | } |
| 1422 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 1423 | } |
| 1424 | |
| 1425 | const ( |
| 1426 | // Identifiers from group ofp_bsn_tunnel_type |
| 1427 | BSNTunnelL2Gre = 1 // OFP_BSN_TUNNEL_L2GRE |
| 1428 | BSNTunnelVxlan = 2 // OFP_BSN_TUNNEL_VXLAN |
| 1429 | ) |
| 1430 | |
| 1431 | type BsnTunnelType uint64 |
| 1432 | |
| 1433 | func (self BsnTunnelType) MarshalJSON() ([]byte, error) { |
| 1434 | var flags []string |
| 1435 | if self&BSNTunnelL2Gre == BSNTunnelL2Gre { |
| 1436 | flags = append(flags, "\"L2Gre\": true") |
| 1437 | } |
| 1438 | if self&BSNTunnelVxlan == BSNTunnelVxlan { |
| 1439 | flags = append(flags, "\"Vxlan\": true") |
| 1440 | } |
| 1441 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 1442 | } |
| 1443 | |
| 1444 | const ( |
| 1445 | // Identifiers from group ofp_bsn_udf_anchor |
| 1446 | BSNUdfAnchorPacketStart = 0 // OFP_BSN_UDF_ANCHOR_PACKET_START |
| 1447 | BSNUdfAnchorL3HeaderStart = 1 // OFP_BSN_UDF_ANCHOR_L3_HEADER_START |
| 1448 | BSNUdfAnchorL4HeaderStart = 2 // OFP_BSN_UDF_ANCHOR_L4_HEADER_START |
| 1449 | ) |
| 1450 | |
| 1451 | type BsnUdfAnchor uint16 |
| 1452 | |
| 1453 | func (self BsnUdfAnchor) MarshalJSON() ([]byte, error) { |
| 1454 | return []byte(fmt.Sprintf("%d", self)), nil |
| 1455 | } |
| 1456 | |
| 1457 | const ( |
| 1458 | // Identifiers from group ofp_bsn_udf_mode |
| 1459 | BSNUdf8X2Bytes = 1 // OFP_BSN_UDF_8X2_BYTES |
| 1460 | ) |
| 1461 | |
| 1462 | type BsnUdfMode uint8 |
| 1463 | |
| 1464 | func (self BsnUdfMode) MarshalJSON() ([]byte, error) { |
| 1465 | var flags []string |
| 1466 | if self&BSNUdf8X2Bytes == BSNUdf8X2Bytes { |
| 1467 | flags = append(flags, "\"BSNUdf8X2Bytes\": true") |
| 1468 | } |
| 1469 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 1470 | } |
| 1471 | |
| 1472 | const ( |
| 1473 | // Identifiers from group ofp_bsn_upgrade |
| 1474 | BSNUpgradeInvalid = 0 // OFP_BSN_UPGRADE_INVALID |
| 1475 | BSNUpgradeInProgress = 1 // OFP_BSN_UPGRADE_IN_PROGRESS |
| 1476 | ) |
| 1477 | |
| 1478 | type BsnUpgrade uint16 |
| 1479 | |
| 1480 | func (self BsnUpgrade) MarshalJSON() ([]byte, error) { |
| 1481 | return []byte(fmt.Sprintf("%d", self)), nil |
| 1482 | } |
| 1483 | |
| 1484 | const ( |
| 1485 | // Identifiers from group ofp_bsn_vlan_counter_constants |
| 1486 | BSNVLANAll = 65535 // OFP_BSN_VLAN_ALL |
| 1487 | ) |
| 1488 | |
| 1489 | const ( |
| 1490 | // Identifiers from group ofp_bsn_vport_l2gre_flags |
| 1491 | OFBSNVportL2GreLocalMACIsValid = 1 // OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID |
| 1492 | OFBSNVportL2GreDSCPAssign = 2 // OF_BSN_VPORT_L2GRE_DSCP_ASSIGN |
| 1493 | OFBSNVportL2GreDSCPCopy = 4 // OF_BSN_VPORT_L2GRE_DSCP_COPY |
| 1494 | OFBSNVportL2GreLoopbackIsValid = 8 // OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID |
| 1495 | OFBSNVportL2GreRateLimitIsValid = 16 // OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID |
| 1496 | ) |
| 1497 | |
| 1498 | type BsnVportL2GreFlags uint32 |
| 1499 | |
| 1500 | func (self BsnVportL2GreFlags) MarshalJSON() ([]byte, error) { |
| 1501 | var flags []string |
| 1502 | if self&OFBSNVportL2GreLocalMACIsValid == OFBSNVportL2GreLocalMACIsValid { |
| 1503 | flags = append(flags, "\"LocalMACIsValid\": true") |
| 1504 | } |
| 1505 | if self&OFBSNVportL2GreDSCPAssign == OFBSNVportL2GreDSCPAssign { |
| 1506 | flags = append(flags, "\"DscpAssign\": true") |
| 1507 | } |
| 1508 | if self&OFBSNVportL2GreDSCPCopy == OFBSNVportL2GreDSCPCopy { |
| 1509 | flags = append(flags, "\"DscpCopy\": true") |
| 1510 | } |
| 1511 | if self&OFBSNVportL2GreLoopbackIsValid == OFBSNVportL2GreLoopbackIsValid { |
| 1512 | flags = append(flags, "\"LoopbackIsValid\": true") |
| 1513 | } |
| 1514 | if self&OFBSNVportL2GreRateLimitIsValid == OFBSNVportL2GreRateLimitIsValid { |
| 1515 | flags = append(flags, "\"RateLimitIsValid\": true") |
| 1516 | } |
| 1517 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 1518 | } |
| 1519 | |
| 1520 | const ( |
| 1521 | // Identifiers from group ofp_bsn_vport_q_in_q_untagged |
| 1522 | OFBSNVportQInQUntagged = 65535 // OF_BSN_VPORT_Q_IN_Q_UNTAGGED |
| 1523 | ) |
| 1524 | |
| 1525 | type BsnVportQInQUntagged uint16 |
| 1526 | |
| 1527 | func (self BsnVportQInQUntagged) MarshalJSON() ([]byte, error) { |
| 1528 | return []byte(fmt.Sprintf("%d", self)), nil |
| 1529 | } |
| 1530 | |
| 1531 | const ( |
| 1532 | // Identifiers from group ofp_bsn_vport_status |
| 1533 | OFBSNVportStatusOk = 0 // OF_BSN_VPORT_STATUS_OK |
| 1534 | OFBSNVportStatusFailed = 1 // OF_BSN_VPORT_STATUS_FAILED |
| 1535 | ) |
| 1536 | |
| 1537 | const ( |
| 1538 | // Identifiers from group ofp_bsn_vrf_counter_constants |
| 1539 | BSNVrfAll = 4294967295 // OFP_BSN_VRF_ALL |
| 1540 | ) |
| 1541 | |
| 1542 | type BsnVrfCounterConstants uint32 |
| 1543 | |
| 1544 | func (self BsnVrfCounterConstants) MarshalJSON() ([]byte, error) { |
| 1545 | return []byte(fmt.Sprintf("%d", self)), nil |
| 1546 | } |
| 1547 | |
| 1548 | const ( |
| 1549 | // Identifiers from group ofp_bundle_ctrl_type |
| 1550 | OFPBCTOpenRequest = 0 // OFPBCT_OPEN_REQUEST |
| 1551 | OFPBCTOpenReply = 1 // OFPBCT_OPEN_REPLY |
| 1552 | OFPBCTCloseRequest = 2 // OFPBCT_CLOSE_REQUEST |
| 1553 | OFPBCTCloseReply = 3 // OFPBCT_CLOSE_REPLY |
| 1554 | OFPBCTCommitRequest = 4 // OFPBCT_COMMIT_REQUEST |
| 1555 | OFPBCTCommitReply = 5 // OFPBCT_COMMIT_REPLY |
| 1556 | OFPBCTDiscardRequest = 6 // OFPBCT_DISCARD_REQUEST |
| 1557 | OFPBCTDiscardReply = 7 // OFPBCT_DISCARD_REPLY |
| 1558 | ) |
| 1559 | |
| 1560 | type BundleCtrlType uint16 |
| 1561 | |
| 1562 | func (self BundleCtrlType) MarshalJSON() ([]byte, error) { |
| 1563 | return []byte(fmt.Sprintf("%d", self)), nil |
| 1564 | } |
| 1565 | |
| 1566 | const ( |
| 1567 | // Identifiers from group ofp_bundle_failed_code |
| 1568 | OFPBFCUnknown = 0 // OFPBFC_UNKNOWN |
| 1569 | OFPBFCEperm = 1 // OFPBFC_EPERM |
| 1570 | OFPBFCBadID = 2 // OFPBFC_BAD_ID |
| 1571 | OFPBFCBundleExist = 3 // OFPBFC_BUNDLE_EXIST |
| 1572 | OFPBFCBundleClosed = 4 // OFPBFC_BUNDLE_CLOSED |
| 1573 | OFPBFCOutOfBundles = 5 // OFPBFC_OUT_OF_BUNDLES |
| 1574 | OFPBFCBadType = 6 // OFPBFC_BAD_TYPE |
| 1575 | OFPBFCBadFlags = 7 // OFPBFC_BAD_FLAGS |
| 1576 | OFPBFCMsgBadLen = 8 // OFPBFC_MSG_BAD_LEN |
| 1577 | OFPBFCMsgBadXid = 9 // OFPBFC_MSG_BAD_XID |
| 1578 | OFPBFCMsgUnsup = 10 // OFPBFC_MSG_UNSUP |
| 1579 | OFPBFCMsgConflict = 11 // OFPBFC_MSG_CONFLICT |
| 1580 | OFPBFCMsgTooMany = 12 // OFPBFC_MSG_TOO_MANY |
| 1581 | OFPBFCMsgFailed = 13 // OFPBFC_MSG_FAILED |
| 1582 | OFPBFCTimeout = 14 // OFPBFC_TIMEOUT |
| 1583 | OFPBFCBundleInProgress = 15 // OFPBFC_BUNDLE_IN_PROGRESS |
| 1584 | ) |
| 1585 | |
| 1586 | type BundleFailedCode uint16 |
| 1587 | |
| 1588 | func (self BundleFailedCode) MarshalJSON() ([]byte, error) { |
| 1589 | return []byte(fmt.Sprintf("%d", self)), nil |
| 1590 | } |
| 1591 | |
| 1592 | const ( |
| 1593 | // Identifiers from group ofp_bundle_flags |
| 1594 | OFPBFAtomic = 1 // OFPBF_ATOMIC |
| 1595 | OFPBFOrdered = 2 // OFPBF_ORDERED |
| 1596 | ) |
| 1597 | |
| 1598 | type BundleFlags uint16 |
| 1599 | |
| 1600 | func (self BundleFlags) MarshalJSON() ([]byte, error) { |
| 1601 | var flags []string |
| 1602 | if self&OFPBFAtomic == OFPBFAtomic { |
| 1603 | flags = append(flags, "\"Atomic\": true") |
| 1604 | } |
| 1605 | if self&OFPBFOrdered == OFPBFOrdered { |
| 1606 | flags = append(flags, "\"Ordered\": true") |
| 1607 | } |
| 1608 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 1609 | } |
| 1610 | |
| 1611 | const ( |
| 1612 | // Identifiers from group ofp_capabilities |
| 1613 | OFPCFlowStats = 1 // OFPC_FLOW_STATS |
| 1614 | OFPCTableStats = 2 // OFPC_TABLE_STATS |
| 1615 | OFPCPortStats = 4 // OFPC_PORT_STATS |
| 1616 | OFPCGroupStats = 8 // OFPC_GROUP_STATS |
| 1617 | OFPCIpReasm = 32 // OFPC_IP_REASM |
| 1618 | OFPCQueueStats = 64 // OFPC_QUEUE_STATS |
| 1619 | OFPCPortBlocked = 256 // OFPC_PORT_BLOCKED |
| 1620 | ) |
| 1621 | |
| 1622 | type Capabilities uint32 |
| 1623 | |
| 1624 | func (self Capabilities) MarshalJSON() ([]byte, error) { |
| 1625 | var flags []string |
| 1626 | if self&OFPCFlowStats == OFPCFlowStats { |
| 1627 | flags = append(flags, "\"FlowStats\": true") |
| 1628 | } |
| 1629 | if self&OFPCTableStats == OFPCTableStats { |
| 1630 | flags = append(flags, "\"TableStats\": true") |
| 1631 | } |
| 1632 | if self&OFPCPortStats == OFPCPortStats { |
| 1633 | flags = append(flags, "\"PortStats\": true") |
| 1634 | } |
| 1635 | if self&OFPCGroupStats == OFPCGroupStats { |
| 1636 | flags = append(flags, "\"GroupStats\": true") |
| 1637 | } |
| 1638 | if self&OFPCIpReasm == OFPCIpReasm { |
| 1639 | flags = append(flags, "\"IpReasm\": true") |
| 1640 | } |
| 1641 | if self&OFPCQueueStats == OFPCQueueStats { |
| 1642 | flags = append(flags, "\"QueueStats\": true") |
| 1643 | } |
| 1644 | if self&OFPCPortBlocked == OFPCPortBlocked { |
| 1645 | flags = append(flags, "\"PortBlocked\": true") |
| 1646 | } |
| 1647 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 1648 | } |
| 1649 | |
| 1650 | const ( |
| 1651 | // Identifiers from group ofp_config_flags |
| 1652 | OFPCFragNormal = 0 // OFPC_FRAG_NORMAL |
| 1653 | OFPCFragDrop = 1 // OFPC_FRAG_DROP |
| 1654 | OFPCFragReasm = 2 // OFPC_FRAG_REASM |
| 1655 | OFPCFragMask = 3 // OFPC_FRAG_MASK |
| 1656 | ) |
| 1657 | |
| 1658 | type ConfigFlags uint16 |
| 1659 | |
| 1660 | func (self ConfigFlags) MarshalJSON() ([]byte, error) { |
| 1661 | var flags []string |
| 1662 | if self&OFPCFragNormal == OFPCFragNormal { |
| 1663 | flags = append(flags, "\"Normal\": true") |
| 1664 | } |
| 1665 | if self&OFPCFragDrop == OFPCFragDrop { |
| 1666 | flags = append(flags, "\"Drop\": true") |
| 1667 | } |
| 1668 | if self&OFPCFragReasm == OFPCFragReasm { |
| 1669 | flags = append(flags, "\"Reasm\": true") |
| 1670 | } |
| 1671 | if self&OFPCFragMask == OFPCFragMask { |
| 1672 | flags = append(flags, "\"Mask\": true") |
| 1673 | } |
| 1674 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 1675 | } |
| 1676 | |
| 1677 | const ( |
| 1678 | // Identifiers from group ofp_controller_max_len |
| 1679 | OFPCMLMax = 65509 // OFPCML_MAX |
| 1680 | OFPCMLNoBuffer = 65535 // OFPCML_NO_BUFFER |
| 1681 | ) |
| 1682 | |
| 1683 | type ControllerMaxLen uint16 |
| 1684 | |
| 1685 | func (self ControllerMaxLen) MarshalJSON() ([]byte, error) { |
| 1686 | return []byte(fmt.Sprintf("%d", self)), nil |
| 1687 | } |
| 1688 | |
| 1689 | const ( |
| 1690 | // Identifiers from group ofp_controller_role |
| 1691 | OFPCRRoleNochange = 0 // OFPCR_ROLE_NOCHANGE |
| 1692 | OFPCRRoleEqual = 1 // OFPCR_ROLE_EQUAL |
| 1693 | OFPCRRoleMaster = 2 // OFPCR_ROLE_MASTER |
| 1694 | OFPCRRoleSlave = 3 // OFPCR_ROLE_SLAVE |
| 1695 | ) |
| 1696 | |
| 1697 | type ControllerRole uint32 |
| 1698 | |
| 1699 | func (self ControllerRole) MarshalJSON() ([]byte, error) { |
| 1700 | return []byte(fmt.Sprintf("%d", self)), nil |
| 1701 | } |
| 1702 | |
| 1703 | const ( |
| 1704 | // Identifiers from group ofp_controller_role_reason |
| 1705 | OFPCRRMasterRequest = 0 // OFPCRR_MASTER_REQUEST |
| 1706 | OFPCRRConfig = 1 // OFPCRR_CONFIG |
| 1707 | OFPCRRExperimenter = 2 // OFPCRR_EXPERIMENTER |
| 1708 | ) |
| 1709 | |
| 1710 | type ControllerRoleReason uint8 |
| 1711 | |
| 1712 | func (self ControllerRoleReason) MarshalJSON() ([]byte, error) { |
| 1713 | return []byte(fmt.Sprintf("%d", self)), nil |
| 1714 | } |
| 1715 | |
| 1716 | const ( |
| 1717 | // Identifiers from group ofp_cs_states |
| 1718 | CsNew = 1 // OFP_CS_NEW |
| 1719 | CsEstablished = 2 // OFP_CS_ESTABLISHED |
| 1720 | CsRelated = 4 // OFP_CS_RELATED |
| 1721 | CsReplyDir = 8 // OFP_CS_REPLY_DIR |
| 1722 | CsInvalid = 16 // OFP_CS_INVALID |
| 1723 | CsTracked = 32 // OFP_CS_TRACKED |
| 1724 | CsSrcNat = 64 // OFP_CS_SRC_NAT |
| 1725 | CsDstNat = 128 // OFP_CS_DST_NAT |
| 1726 | ) |
| 1727 | |
| 1728 | type CsStates uint32 |
| 1729 | |
| 1730 | func (self CsStates) MarshalJSON() ([]byte, error) { |
| 1731 | var flags []string |
| 1732 | if self&CsNew == CsNew { |
| 1733 | flags = append(flags, "\"New\": true") |
| 1734 | } |
| 1735 | if self&CsEstablished == CsEstablished { |
| 1736 | flags = append(flags, "\"Established\": true") |
| 1737 | } |
| 1738 | if self&CsRelated == CsRelated { |
| 1739 | flags = append(flags, "\"Related\": true") |
| 1740 | } |
| 1741 | if self&CsReplyDir == CsReplyDir { |
| 1742 | flags = append(flags, "\"ReplyDir\": true") |
| 1743 | } |
| 1744 | if self&CsInvalid == CsInvalid { |
| 1745 | flags = append(flags, "\"Invalid\": true") |
| 1746 | } |
| 1747 | if self&CsTracked == CsTracked { |
| 1748 | flags = append(flags, "\"Tracked\": true") |
| 1749 | } |
| 1750 | if self&CsSrcNat == CsSrcNat { |
| 1751 | flags = append(flags, "\"SrcNat\": true") |
| 1752 | } |
| 1753 | if self&CsDstNat == CsDstNat { |
| 1754 | flags = append(flags, "\"DstNat\": true") |
| 1755 | } |
| 1756 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 1757 | } |
| 1758 | |
| 1759 | const ( |
| 1760 | // Identifiers from group ofp_ed_nsh_prop_type |
| 1761 | OFPPPTPropNshNone = 0 // OFPPPT_PROP_NSH_NONE |
| 1762 | OFPPPTPropNshMdtype = 1 // OFPPPT_PROP_NSH_MDTYPE |
| 1763 | OFPPPTPropNshTlv = 2 // OFPPPT_PROP_NSH_TLV |
| 1764 | ) |
| 1765 | |
| 1766 | type EdNshPropType uint8 |
| 1767 | |
| 1768 | func (self EdNshPropType) MarshalJSON() ([]byte, error) { |
| 1769 | return []byte(fmt.Sprintf("%d", self)), nil |
| 1770 | } |
| 1771 | |
| 1772 | const ( |
| 1773 | // Identifiers from group ofp_ed_prop_class |
| 1774 | OFPPPCBasic = 0 // OFPPPC_BASIC |
| 1775 | OFPPPCMpls = 1 // OFPPPC_MPLS |
| 1776 | OFPPPCGRE = 2 // OFPPPC_GRE |
| 1777 | OFPPPCGtp = 3 // OFPPPC_GTP |
| 1778 | OFPPPCNsh = 4 // OFPPPC_NSH |
| 1779 | OFPPPCExperimenter = 65535 // OFPPPC_EXPERIMENTER |
| 1780 | ) |
| 1781 | |
| 1782 | type EdPropClass uint16 |
| 1783 | |
| 1784 | func (self EdPropClass) MarshalJSON() ([]byte, error) { |
| 1785 | return []byte(fmt.Sprintf("%d", self)), nil |
| 1786 | } |
| 1787 | |
| 1788 | const ( |
| 1789 | // Identifiers from group ofp_error_type |
| 1790 | OFPETHelloFailed = 0 // OFPET_HELLO_FAILED |
| 1791 | OFPETBadRequest = 1 // OFPET_BAD_REQUEST |
| 1792 | OFPETBadAction = 2 // OFPET_BAD_ACTION |
| 1793 | OFPETBadInstruction = 3 // OFPET_BAD_INSTRUCTION |
| 1794 | OFPETBadMatch = 4 // OFPET_BAD_MATCH |
| 1795 | OFPETFlowModFailed = 5 // OFPET_FLOW_MOD_FAILED |
| 1796 | OFPETGroupModFailed = 6 // OFPET_GROUP_MOD_FAILED |
| 1797 | OFPETPortModFailed = 7 // OFPET_PORT_MOD_FAILED |
| 1798 | OFPETTableModFailed = 8 // OFPET_TABLE_MOD_FAILED |
| 1799 | OFPETQueueOpFailed = 9 // OFPET_QUEUE_OP_FAILED |
| 1800 | OFPETSwitchConfigFailed = 10 // OFPET_SWITCH_CONFIG_FAILED |
| 1801 | OFPETRoleRequestFailed = 11 // OFPET_ROLE_REQUEST_FAILED |
| 1802 | OFPETMeterModFailed = 12 // OFPET_METER_MOD_FAILED |
| 1803 | OFPETTableFeaturesFailed = 13 // OFPET_TABLE_FEATURES_FAILED |
| 1804 | OFPETBadProperty = 14 // OFPET_BAD_PROPERTY |
| 1805 | OFPETAsyncConfigFailed = 15 // OFPET_ASYNC_CONFIG_FAILED |
| 1806 | OFPETFlowMonitorFailed = 16 // OFPET_FLOW_MONITOR_FAILED |
| 1807 | OFPETBundleFailed = 17 // OFPET_BUNDLE_FAILED |
| 1808 | OFPETExperimenter = 65535 // OFPET_EXPERIMENTER |
| 1809 | ) |
| 1810 | |
| 1811 | type ErrorType uint16 |
| 1812 | |
| 1813 | func (self ErrorType) MarshalJSON() ([]byte, error) { |
| 1814 | return []byte(fmt.Sprintf("%d", self)), nil |
| 1815 | } |
| 1816 | |
| 1817 | const ( |
| 1818 | // Identifiers from group ofp_ethernet_type |
| 1819 | EthPLoop = 96 // ETH_P_LOOP |
| 1820 | EthPPup = 512 // ETH_P_PUP |
| 1821 | EthPPupat = 513 // ETH_P_PUPAT |
| 1822 | EthPIp = 2048 // ETH_P_IP |
| 1823 | EthPX25 = 2053 // ETH_P_X25 |
| 1824 | EthPARP = 2054 // ETH_P_ARP |
| 1825 | EthPBpq = 2303 // ETH_P_BPQ |
| 1826 | EthPIeeepup = 2560 // ETH_P_IEEEPUP |
| 1827 | EthPIeeepupat = 2561 // ETH_P_IEEEPUPAT |
| 1828 | EthPDec = 24576 // ETH_P_DEC |
| 1829 | EthPDnaDl = 24577 // ETH_P_DNA_DL |
| 1830 | EthPDnaRc = 24578 // ETH_P_DNA_RC |
| 1831 | EthPDnaRt = 24579 // ETH_P_DNA_RT |
| 1832 | EthPLat = 24580 // ETH_P_LAT |
| 1833 | EthPDiag = 24581 // ETH_P_DIAG |
| 1834 | EthPCust = 24582 // ETH_P_CUST |
| 1835 | EthPSca = 24583 // ETH_P_SCA |
| 1836 | EthPTeb = 25944 // ETH_P_TEB |
| 1837 | EthPRarp = 32821 // ETH_P_RARP |
| 1838 | EthPAtalk = 32923 // ETH_P_ATALK |
| 1839 | EthPAarp = 33011 // ETH_P_AARP |
| 1840 | EthP8021Q = 33024 // ETH_P_8021Q |
| 1841 | EthPIpx = 33079 // ETH_P_IPX |
| 1842 | EthPIpv6 = 34525 // ETH_P_IPV6 |
| 1843 | EthPPause = 34824 // ETH_P_PAUSE |
| 1844 | EthPSlow = 34825 // ETH_P_SLOW |
| 1845 | EthPWccp = 34878 // ETH_P_WCCP |
| 1846 | EthPPppDisc = 34915 // ETH_P_PPP_DISC |
| 1847 | EthPPppSes = 34916 // ETH_P_PPP_SES |
| 1848 | EthPMplsUc = 34887 // ETH_P_MPLS_UC |
| 1849 | EthPMplsMc = 34888 // ETH_P_MPLS_MC |
| 1850 | EthPAtmmpoa = 34892 // ETH_P_ATMMPOA |
| 1851 | EthPAtmfate = 34948 // ETH_P_ATMFATE |
| 1852 | EthPPae = 34958 // ETH_P_PAE |
| 1853 | EthPAoe = 34978 // ETH_P_AOE |
| 1854 | EthPTipc = 35018 // ETH_P_TIPC |
| 1855 | EthP1588 = 35063 // ETH_P_1588 |
| 1856 | EthPFcoe = 35078 // ETH_P_FCOE |
| 1857 | EthPFip = 35092 // ETH_P_FIP |
| 1858 | EthPEdsa = 56026 // ETH_P_EDSA |
| 1859 | ) |
| 1860 | |
| 1861 | type EthernetType uint16 |
| 1862 | |
| 1863 | func (self EthernetType) MarshalJSON() ([]byte, error) { |
| 1864 | return []byte(fmt.Sprintf("\"%s\"", self)), nil |
| 1865 | } |
| 1866 | |
| 1867 | func (self EthernetType) String() string { |
| 1868 | switch self { |
| 1869 | case EthPLoop: |
| 1870 | return "loop" |
| 1871 | case EthPPup: |
| 1872 | return "pup" |
| 1873 | case EthPPupat: |
| 1874 | return "pupat" |
| 1875 | case EthPIp: |
| 1876 | return "ip" |
| 1877 | case EthPX25: |
| 1878 | return "x25" |
| 1879 | case EthPARP: |
| 1880 | return "arp" |
| 1881 | case EthPBpq: |
| 1882 | return "bpq" |
| 1883 | case EthPIeeepup: |
| 1884 | return "ieeepup" |
| 1885 | case EthPIeeepupat: |
| 1886 | return "ieeepupat" |
| 1887 | case EthPDec: |
| 1888 | return "dec" |
| 1889 | case EthPDnaDl: |
| 1890 | return "dna_dl" |
| 1891 | case EthPDnaRc: |
| 1892 | return "dna_rc" |
| 1893 | case EthPDnaRt: |
| 1894 | return "dna_rt" |
| 1895 | case EthPLat: |
| 1896 | return "lat" |
| 1897 | case EthPDiag: |
| 1898 | return "diag" |
| 1899 | case EthPCust: |
| 1900 | return "cust" |
| 1901 | case EthPSca: |
| 1902 | return "sca" |
| 1903 | case EthPTeb: |
| 1904 | return "teb" |
| 1905 | case EthPRarp: |
| 1906 | return "rarp" |
| 1907 | case EthPAtalk: |
| 1908 | return "atalk" |
| 1909 | case EthPAarp: |
| 1910 | return "aarp" |
| 1911 | case EthP8021Q: |
| 1912 | return "8021q" |
| 1913 | case EthPIpx: |
| 1914 | return "ipx" |
| 1915 | case EthPIpv6: |
| 1916 | return "ipv6" |
| 1917 | case EthPPause: |
| 1918 | return "pause" |
| 1919 | case EthPSlow: |
| 1920 | return "slow" |
| 1921 | case EthPWccp: |
| 1922 | return "wccp" |
| 1923 | case EthPPppDisc: |
| 1924 | return "ppp_disc" |
| 1925 | case EthPPppSes: |
| 1926 | return "ppp_ses" |
| 1927 | case EthPMplsUc: |
| 1928 | return "mpls_uc" |
| 1929 | case EthPMplsMc: |
| 1930 | return "mpls_mc" |
| 1931 | case EthPAtmmpoa: |
| 1932 | return "atmmpoa" |
| 1933 | case EthPAtmfate: |
| 1934 | return "atmfate" |
| 1935 | case EthPPae: |
| 1936 | return "pae" |
| 1937 | case EthPAoe: |
| 1938 | return "aoe" |
| 1939 | case EthPTipc: |
| 1940 | return "tipc" |
| 1941 | case EthP1588: |
| 1942 | return "1588" |
| 1943 | case EthPFcoe: |
| 1944 | return "fcoe" |
| 1945 | case EthPFip: |
| 1946 | return "fip" |
| 1947 | case EthPEdsa: |
| 1948 | return "edsa" |
| 1949 | default: |
| 1950 | return fmt.Sprintf("%d", self) |
| 1951 | } |
| 1952 | } |
| 1953 | |
| 1954 | const ( |
| 1955 | // Identifiers from group ofp_flow_mod_command |
| 1956 | OFPFCAdd = 0 // OFPFC_ADD |
| 1957 | OFPFCModify = 1 // OFPFC_MODIFY |
| 1958 | OFPFCModifyStrict = 2 // OFPFC_MODIFY_STRICT |
| 1959 | OFPFCDelete = 3 // OFPFC_DELETE |
| 1960 | OFPFCDeleteStrict = 4 // OFPFC_DELETE_STRICT |
| 1961 | ) |
| 1962 | |
| 1963 | type FlowModCommand uint8 |
| 1964 | |
| 1965 | func (self FlowModCommand) MarshalJSON() ([]byte, error) { |
| 1966 | return []byte(fmt.Sprintf("%d", self)), nil |
| 1967 | } |
| 1968 | |
| 1969 | const ( |
| 1970 | // Identifiers from group ofp_flow_mod_failed_code |
| 1971 | OFPFMFCUnknown = 0 // OFPFMFC_UNKNOWN |
| 1972 | OFPFMFCTableFull = 1 // OFPFMFC_TABLE_FULL |
| 1973 | OFPFMFCBadTableID = 2 // OFPFMFC_BAD_TABLE_ID |
| 1974 | OFPFMFCOverlap = 3 // OFPFMFC_OVERLAP |
| 1975 | OFPFMFCEperm = 4 // OFPFMFC_EPERM |
| 1976 | OFPFMFCBadTimeout = 5 // OFPFMFC_BAD_TIMEOUT |
| 1977 | OFPFMFCBadCommand = 6 // OFPFMFC_BAD_COMMAND |
| 1978 | OFPFMFCBadFlags = 7 // OFPFMFC_BAD_FLAGS |
| 1979 | OFPFMFCCantSync = 8 // OFPFMFC_CANT_SYNC |
| 1980 | OFPFMFCBadPriority = 9 // OFPFMFC_BAD_PRIORITY |
| 1981 | ) |
| 1982 | |
| 1983 | type FlowModFailedCode uint16 |
| 1984 | |
| 1985 | func (self FlowModFailedCode) MarshalJSON() ([]byte, error) { |
| 1986 | return []byte(fmt.Sprintf("%d", self)), nil |
| 1987 | } |
| 1988 | |
| 1989 | const ( |
| 1990 | // Identifiers from group ofp_flow_mod_flags |
| 1991 | OFPFFSendFlowRem = 1 // OFPFF_SEND_FLOW_REM |
| 1992 | OFPFFCheckOverlap = 2 // OFPFF_CHECK_OVERLAP |
| 1993 | OFPFFResetCounts = 4 // OFPFF_RESET_COUNTS |
| 1994 | OFPFFNoPktCounts = 8 // OFPFF_NO_PKT_COUNTS |
| 1995 | OFPFFNoBytCounts = 16 // OFPFF_NO_BYT_COUNTS |
| 1996 | OFPFFBSNSendIdle = 128 // OFPFF_BSN_SEND_IDLE |
| 1997 | ) |
| 1998 | |
| 1999 | type FlowModFlags uint16 |
| 2000 | |
| 2001 | func (self FlowModFlags) MarshalJSON() ([]byte, error) { |
| 2002 | var flags []string |
| 2003 | if self&OFPFFSendFlowRem == OFPFFSendFlowRem { |
| 2004 | flags = append(flags, "\"SendFlowRem\": true") |
| 2005 | } |
| 2006 | if self&OFPFFCheckOverlap == OFPFFCheckOverlap { |
| 2007 | flags = append(flags, "\"CheckOverlap\": true") |
| 2008 | } |
| 2009 | if self&OFPFFResetCounts == OFPFFResetCounts { |
| 2010 | flags = append(flags, "\"ResetCounts\": true") |
| 2011 | } |
| 2012 | if self&OFPFFNoPktCounts == OFPFFNoPktCounts { |
| 2013 | flags = append(flags, "\"NoPktCounts\": true") |
| 2014 | } |
| 2015 | if self&OFPFFNoBytCounts == OFPFFNoBytCounts { |
| 2016 | flags = append(flags, "\"NoBytCounts\": true") |
| 2017 | } |
| 2018 | if self&OFPFFBSNSendIdle == OFPFFBSNSendIdle { |
| 2019 | flags = append(flags, "\"BsnSendIdle\": true") |
| 2020 | } |
| 2021 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 2022 | } |
| 2023 | |
| 2024 | const ( |
| 2025 | // Identifiers from group ofp_flow_monitor_command |
| 2026 | OFPFMCAdd = 0 // OFPFMC_ADD |
| 2027 | OFPFMCModify = 1 // OFPFMC_MODIFY |
| 2028 | OFPFMCDelete = 2 // OFPFMC_DELETE |
| 2029 | ) |
| 2030 | |
| 2031 | type FlowMonitorCommand uint8 |
| 2032 | |
| 2033 | func (self FlowMonitorCommand) MarshalJSON() ([]byte, error) { |
| 2034 | return []byte(fmt.Sprintf("%d", self)), nil |
| 2035 | } |
| 2036 | |
| 2037 | const ( |
| 2038 | // Identifiers from group ofp_flow_monitor_failed_code |
| 2039 | OFPMOFCUnknown = 0 // OFPMOFC_UNKNOWN |
| 2040 | OFPMOFCMonitorExists = 1 // OFPMOFC_MONITOR_EXISTS |
| 2041 | OFPMOFCInvalidMonitor = 2 // OFPMOFC_INVALID_MONITOR |
| 2042 | OFPMOFCUnknownMonitor = 3 // OFPMOFC_UNKNOWN_MONITOR |
| 2043 | OFPMOFCBadCommand = 4 // OFPMOFC_BAD_COMMAND |
| 2044 | OFPMOFCBadFlags = 5 // OFPMOFC_BAD_FLAGS |
| 2045 | OFPMOFCBadTableID = 6 // OFPMOFC_BAD_TABLE_ID |
| 2046 | OFPMOFCBadOut = 7 // OFPMOFC_BAD_OUT |
| 2047 | ) |
| 2048 | |
| 2049 | type FlowMonitorFailedCode uint16 |
| 2050 | |
| 2051 | func (self FlowMonitorFailedCode) MarshalJSON() ([]byte, error) { |
| 2052 | return []byte(fmt.Sprintf("%d", self)), nil |
| 2053 | } |
| 2054 | |
| 2055 | const ( |
| 2056 | // Identifiers from group ofp_flow_monitor_flags |
| 2057 | OFPFMFInitial = 1 // OFPFMF_INITIAL |
| 2058 | OFPFMFAdd = 2 // OFPFMF_ADD |
| 2059 | OFPFMFRemoved = 4 // OFPFMF_REMOVED |
| 2060 | OFPFMFModify = 8 // OFPFMF_MODIFY |
| 2061 | OFPFMFInstructions = 16 // OFPFMF_INSTRUCTIONS |
| 2062 | OFPFMFNoAbbrev = 32 // OFPFMF_NO_ABBREV |
| 2063 | OFPFMFOnlyOwn = 64 // OFPFMF_ONLY_OWN |
| 2064 | ) |
| 2065 | |
| 2066 | type FlowMonitorFlags uint16 |
| 2067 | |
| 2068 | func (self FlowMonitorFlags) MarshalJSON() ([]byte, error) { |
| 2069 | var flags []string |
| 2070 | if self&OFPFMFInitial == OFPFMFInitial { |
| 2071 | flags = append(flags, "\"Initial\": true") |
| 2072 | } |
| 2073 | if self&OFPFMFAdd == OFPFMFAdd { |
| 2074 | flags = append(flags, "\"Add\": true") |
| 2075 | } |
| 2076 | if self&OFPFMFRemoved == OFPFMFRemoved { |
| 2077 | flags = append(flags, "\"Removed\": true") |
| 2078 | } |
| 2079 | if self&OFPFMFModify == OFPFMFModify { |
| 2080 | flags = append(flags, "\"Modify\": true") |
| 2081 | } |
| 2082 | if self&OFPFMFInstructions == OFPFMFInstructions { |
| 2083 | flags = append(flags, "\"Instructions\": true") |
| 2084 | } |
| 2085 | if self&OFPFMFNoAbbrev == OFPFMFNoAbbrev { |
| 2086 | flags = append(flags, "\"NoAbbrev\": true") |
| 2087 | } |
| 2088 | if self&OFPFMFOnlyOwn == OFPFMFOnlyOwn { |
| 2089 | flags = append(flags, "\"OnlyOwn\": true") |
| 2090 | } |
| 2091 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 2092 | } |
| 2093 | |
| 2094 | const ( |
| 2095 | // Identifiers from group ofp_flow_removed_reason |
| 2096 | OFPRRIdleTimeout = 0 // OFPRR_IDLE_TIMEOUT |
| 2097 | OFPRRHardTimeout = 1 // OFPRR_HARD_TIMEOUT |
| 2098 | OFPRRDelete = 2 // OFPRR_DELETE |
| 2099 | OFPRRGroupDelete = 3 // OFPRR_GROUP_DELETE |
| 2100 | OFPRRMeterDelete = 4 // OFPRR_METER_DELETE |
| 2101 | OFPRREviction = 5 // OFPRR_EVICTION |
| 2102 | ) |
| 2103 | |
| 2104 | type FlowRemovedReason uint8 |
| 2105 | |
| 2106 | func (self FlowRemovedReason) MarshalJSON() ([]byte, error) { |
| 2107 | return []byte(fmt.Sprintf("%d", self)), nil |
| 2108 | } |
| 2109 | |
| 2110 | const ( |
| 2111 | // Identifiers from group ofp_flow_update_event |
| 2112 | OFPFMEInitial = 0 // OFPFME_INITIAL |
| 2113 | OFPFMEAdded = 1 // OFPFME_ADDED |
| 2114 | OFPFMERemoved = 2 // OFPFME_REMOVED |
| 2115 | OFPFMEModified = 3 // OFPFME_MODIFIED |
| 2116 | OFPFMEAbbrev = 4 // OFPFME_ABBREV |
| 2117 | OFPFMEPaused = 5 // OFPFME_PAUSED |
| 2118 | OFPFMEResumed = 6 // OFPFME_RESUMED |
| 2119 | ) |
| 2120 | |
| 2121 | type FlowUpdateEvent uint16 |
| 2122 | |
| 2123 | func (self FlowUpdateEvent) MarshalJSON() ([]byte, error) { |
| 2124 | return []byte(fmt.Sprintf("%d", self)), nil |
| 2125 | } |
| 2126 | |
| 2127 | const ( |
| 2128 | // Identifiers from group ofp_group |
| 2129 | OFPGMax = 4294967040 // OFPG_MAX |
| 2130 | OFPGAll = 4294967292 // OFPG_ALL |
| 2131 | OFPGAny = 4294967295 // OFPG_ANY |
| 2132 | ) |
| 2133 | |
| 2134 | type Group uint32 |
| 2135 | |
| 2136 | func (self Group) MarshalJSON() ([]byte, error) { |
| 2137 | return []byte(fmt.Sprintf("%d", self)), nil |
| 2138 | } |
| 2139 | |
| 2140 | const ( |
| 2141 | // Identifiers from group ofp_group_capabilities |
| 2142 | OFPGFCSelectWeight = 1 // OFPGFC_SELECT_WEIGHT |
| 2143 | OFPGFCSelectLiveness = 2 // OFPGFC_SELECT_LIVENESS |
| 2144 | OFPGFCChaining = 4 // OFPGFC_CHAINING |
| 2145 | OFPGFCChainingChecks = 8 // OFPGFC_CHAINING_CHECKS |
| 2146 | ) |
| 2147 | |
| 2148 | type GroupCapabilities uint32 |
| 2149 | |
| 2150 | func (self GroupCapabilities) MarshalJSON() ([]byte, error) { |
| 2151 | var flags []string |
| 2152 | if self&OFPGFCSelectWeight == OFPGFCSelectWeight { |
| 2153 | flags = append(flags, "\"SelectWeight\": true") |
| 2154 | } |
| 2155 | if self&OFPGFCSelectLiveness == OFPGFCSelectLiveness { |
| 2156 | flags = append(flags, "\"SelectLiveness\": true") |
| 2157 | } |
| 2158 | if self&OFPGFCChaining == OFPGFCChaining { |
| 2159 | flags = append(flags, "\"Chaining\": true") |
| 2160 | } |
| 2161 | if self&OFPGFCChainingChecks == OFPGFCChainingChecks { |
| 2162 | flags = append(flags, "\"ChainingChecks\": true") |
| 2163 | } |
| 2164 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 2165 | } |
| 2166 | |
| 2167 | const ( |
| 2168 | // Identifiers from group ofp_group_mod_command |
| 2169 | OFPGCAdd = 0 // OFPGC_ADD |
| 2170 | OFPGCModify = 1 // OFPGC_MODIFY |
| 2171 | OFPGCDelete = 2 // OFPGC_DELETE |
| 2172 | ) |
| 2173 | |
| 2174 | type GroupModCommand uint16 |
| 2175 | |
| 2176 | func (self GroupModCommand) MarshalJSON() ([]byte, error) { |
| 2177 | return []byte(fmt.Sprintf("%d", self)), nil |
| 2178 | } |
| 2179 | |
| 2180 | const ( |
| 2181 | // Identifiers from group ofp_group_mod_failed_code |
| 2182 | OFPGMFCGroupExists = 0 // OFPGMFC_GROUP_EXISTS |
| 2183 | OFPGMFCInvalidGroup = 1 // OFPGMFC_INVALID_GROUP |
| 2184 | OFPGMFCWeightUnsupported = 2 // OFPGMFC_WEIGHT_UNSUPPORTED |
| 2185 | OFPGMFCOutOfGroups = 3 // OFPGMFC_OUT_OF_GROUPS |
| 2186 | OFPGMFCOutOfBuckets = 4 // OFPGMFC_OUT_OF_BUCKETS |
| 2187 | OFPGMFCChainingUnsupported = 5 // OFPGMFC_CHAINING_UNSUPPORTED |
| 2188 | OFPGMFCWatchUnsupported = 6 // OFPGMFC_WATCH_UNSUPPORTED |
| 2189 | OFPGMFCLoop = 7 // OFPGMFC_LOOP |
| 2190 | OFPGMFCUnknownGroup = 8 // OFPGMFC_UNKNOWN_GROUP |
| 2191 | OFPGMFCChainedGroup = 9 // OFPGMFC_CHAINED_GROUP |
| 2192 | OFPGMFCBadType = 10 // OFPGMFC_BAD_TYPE |
| 2193 | OFPGMFCBadCommand = 11 // OFPGMFC_BAD_COMMAND |
| 2194 | OFPGMFCBadBucket = 12 // OFPGMFC_BAD_BUCKET |
| 2195 | OFPGMFCBadWatch = 13 // OFPGMFC_BAD_WATCH |
| 2196 | OFPGMFCEperm = 14 // OFPGMFC_EPERM |
| 2197 | ) |
| 2198 | |
| 2199 | type GroupModFailedCode uint16 |
| 2200 | |
| 2201 | func (self GroupModFailedCode) MarshalJSON() ([]byte, error) { |
| 2202 | return []byte(fmt.Sprintf("%d", self)), nil |
| 2203 | } |
| 2204 | |
| 2205 | const ( |
| 2206 | // Identifiers from group ofp_group_type |
| 2207 | OFPGTAll = 0 // OFPGT_ALL |
| 2208 | OFPGTSelect = 1 // OFPGT_SELECT |
| 2209 | OFPGTIndirect = 2 // OFPGT_INDIRECT |
| 2210 | OFPGTFf = 3 // OFPGT_FF |
| 2211 | ) |
| 2212 | |
| 2213 | type GroupType uint8 |
| 2214 | |
| 2215 | func (self GroupType) MarshalJSON() ([]byte, error) { |
| 2216 | return []byte(fmt.Sprintf("\"%s\"", self)), nil |
| 2217 | } |
| 2218 | |
| 2219 | func (self GroupType) String() string { |
| 2220 | switch self { |
| 2221 | case OFPGTAll: |
| 2222 | return "all" |
| 2223 | case OFPGTSelect: |
| 2224 | return "select" |
| 2225 | case OFPGTIndirect: |
| 2226 | return "indirect" |
| 2227 | case OFPGTFf: |
| 2228 | return "ff" |
| 2229 | default: |
| 2230 | return fmt.Sprintf("%d", self) |
| 2231 | } |
| 2232 | } |
| 2233 | |
| 2234 | const ( |
| 2235 | // Identifiers from group ofp_hello_elem_type |
| 2236 | OFPHETVersionbitmap = 1 // OFPHET_VERSIONBITMAP |
| 2237 | ) |
| 2238 | |
| 2239 | type HelloElemType uint16 |
| 2240 | |
| 2241 | func (self HelloElemType) MarshalJSON() ([]byte, error) { |
| 2242 | return []byte(fmt.Sprintf("%d", self)), nil |
| 2243 | } |
| 2244 | |
| 2245 | const ( |
| 2246 | // Identifiers from group ofp_hello_failed_code |
| 2247 | OFPHFCIncompatible = 0 // OFPHFC_INCOMPATIBLE |
| 2248 | OFPHFCEperm = 1 // OFPHFC_EPERM |
| 2249 | ) |
| 2250 | |
| 2251 | type HelloFailedCode uint16 |
| 2252 | |
| 2253 | func (self HelloFailedCode) MarshalJSON() ([]byte, error) { |
| 2254 | return []byte(fmt.Sprintf("%d", self)), nil |
| 2255 | } |
| 2256 | |
| 2257 | const ( |
| 2258 | // Identifiers from group ofp_icmp_type |
| 2259 | IcmpEchoreply = 0 // ICMP_ECHOREPLY |
| 2260 | IcmpDestUnreach = 3 // ICMP_DEST_UNREACH |
| 2261 | IcmpSourceQuench = 4 // ICMP_SOURCE_QUENCH |
| 2262 | IcmpRedirect = 5 // ICMP_REDIRECT |
| 2263 | IcmpEcho = 8 // ICMP_ECHO |
| 2264 | IcmpTimeExceeded = 11 // ICMP_TIME_EXCEEDED |
| 2265 | IcmpParameterprob = 12 // ICMP_PARAMETERPROB |
| 2266 | IcmpTimestamp = 13 // ICMP_TIMESTAMP |
| 2267 | IcmpTimestampreply = 14 // ICMP_TIMESTAMPREPLY |
| 2268 | IcmpInfoRequest = 15 // ICMP_INFO_REQUEST |
| 2269 | IcmpInfoReply = 16 // ICMP_INFO_REPLY |
| 2270 | IcmpAddress = 17 // ICMP_ADDRESS |
| 2271 | IcmpAddressreply = 18 // ICMP_ADDRESSREPLY |
| 2272 | ) |
| 2273 | |
| 2274 | type IcmpType uint8 |
| 2275 | |
| 2276 | func (self IcmpType) MarshalJSON() ([]byte, error) { |
| 2277 | return []byte(fmt.Sprintf("\"%s\"", self)), nil |
| 2278 | } |
| 2279 | |
| 2280 | func (self IcmpType) String() string { |
| 2281 | switch self { |
| 2282 | case IcmpEchoreply: |
| 2283 | return "echoreply" |
| 2284 | case IcmpDestUnreach: |
| 2285 | return "dest_unreach" |
| 2286 | case IcmpSourceQuench: |
| 2287 | return "source_quench" |
| 2288 | case IcmpRedirect: |
| 2289 | return "redirect" |
| 2290 | case IcmpEcho: |
| 2291 | return "echo" |
| 2292 | case IcmpTimeExceeded: |
| 2293 | return "time_exceeded" |
| 2294 | case IcmpParameterprob: |
| 2295 | return "parameterprob" |
| 2296 | case IcmpTimestamp: |
| 2297 | return "timestamp" |
| 2298 | case IcmpTimestampreply: |
| 2299 | return "timestampreply" |
| 2300 | case IcmpInfoRequest: |
| 2301 | return "info_request" |
| 2302 | case IcmpInfoReply: |
| 2303 | return "info_reply" |
| 2304 | case IcmpAddress: |
| 2305 | return "address" |
| 2306 | case IcmpAddressreply: |
| 2307 | return "addressreply" |
| 2308 | default: |
| 2309 | return fmt.Sprintf("%d", self) |
| 2310 | } |
| 2311 | } |
| 2312 | |
| 2313 | const ( |
| 2314 | // Identifiers from group ofp_icmpv6_type |
| 2315 | Icmpv6EchoRequest = 128 // ICMPV6_ECHO_REQUEST |
| 2316 | Icmpv6EchoReply = 129 // ICMPV6_ECHO_REPLY |
| 2317 | Icmpv6MgmQuery = 130 // ICMPV6_MGM_QUERY |
| 2318 | Icmpv6MgmReport = 131 // ICMPV6_MGM_REPORT |
| 2319 | Icmpv6MgmReduction = 132 // ICMPV6_MGM_REDUCTION |
| 2320 | Icmpv6NiQuery = 139 // ICMPV6_NI_QUERY |
| 2321 | Icmpv6NiReply = 140 // ICMPV6_NI_REPLY |
| 2322 | Icmpv6Mld2Report = 143 // ICMPV6_MLD2_REPORT |
| 2323 | Icmpv6DhaadRequest = 144 // ICMPV6_DHAAD_REQUEST |
| 2324 | Icmpv6DhaadReply = 145 // ICMPV6_DHAAD_REPLY |
| 2325 | Icmpv6MobilePrefixSol = 146 // ICMPV6_MOBILE_PREFIX_SOL |
| 2326 | Icmpv6MobilePrefixAdv = 147 // ICMPV6_MOBILE_PREFIX_ADV |
| 2327 | ) |
| 2328 | |
| 2329 | type Icmpv6Type uint8 |
| 2330 | |
| 2331 | func (self Icmpv6Type) MarshalJSON() ([]byte, error) { |
| 2332 | return []byte(fmt.Sprintf("\"%s\"", self)), nil |
| 2333 | } |
| 2334 | |
| 2335 | func (self Icmpv6Type) String() string { |
| 2336 | switch self { |
| 2337 | case Icmpv6EchoRequest: |
| 2338 | return "echo_request" |
| 2339 | case Icmpv6EchoReply: |
| 2340 | return "echo_reply" |
| 2341 | case Icmpv6MgmQuery: |
| 2342 | return "mgm_query" |
| 2343 | case Icmpv6MgmReport: |
| 2344 | return "mgm_report" |
| 2345 | case Icmpv6MgmReduction: |
| 2346 | return "mgm_reduction" |
| 2347 | case Icmpv6NiQuery: |
| 2348 | return "ni_query" |
| 2349 | case Icmpv6NiReply: |
| 2350 | return "ni_reply" |
| 2351 | case Icmpv6Mld2Report: |
| 2352 | return "mld2_report" |
| 2353 | case Icmpv6DhaadRequest: |
| 2354 | return "dhaad_request" |
| 2355 | case Icmpv6DhaadReply: |
| 2356 | return "dhaad_reply" |
| 2357 | case Icmpv6MobilePrefixSol: |
| 2358 | return "mobile_prefix_sol" |
| 2359 | case Icmpv6MobilePrefixAdv: |
| 2360 | return "mobile_prefix_adv" |
| 2361 | default: |
| 2362 | return fmt.Sprintf("%d", self) |
| 2363 | } |
| 2364 | } |
| 2365 | |
| 2366 | const ( |
| 2367 | // Identifiers from group ofp_instruction_type |
| 2368 | OFPITGotoTable = 1 // OFPIT_GOTO_TABLE |
| 2369 | OFPITWriteMetadata = 2 // OFPIT_WRITE_METADATA |
| 2370 | OFPITWriteActions = 3 // OFPIT_WRITE_ACTIONS |
| 2371 | OFPITApplyActions = 4 // OFPIT_APPLY_ACTIONS |
| 2372 | OFPITClearActions = 5 // OFPIT_CLEAR_ACTIONS |
| 2373 | OFPITMeter = 6 // OFPIT_METER |
| 2374 | OFPITExperimenter = 65535 // OFPIT_EXPERIMENTER |
| 2375 | ) |
| 2376 | |
| 2377 | type InstructionType uint16 |
| 2378 | |
| 2379 | func (self InstructionType) MarshalJSON() ([]byte, error) { |
| 2380 | var flags []string |
| 2381 | if self&OFPITGotoTable == OFPITGotoTable { |
| 2382 | flags = append(flags, "\"GotoTable\": true") |
| 2383 | } |
| 2384 | if self&OFPITWriteMetadata == OFPITWriteMetadata { |
| 2385 | flags = append(flags, "\"WriteMetadata\": true") |
| 2386 | } |
| 2387 | if self&OFPITWriteActions == OFPITWriteActions { |
| 2388 | flags = append(flags, "\"WriteActions\": true") |
| 2389 | } |
| 2390 | if self&OFPITApplyActions == OFPITApplyActions { |
| 2391 | flags = append(flags, "\"ApplyActions\": true") |
| 2392 | } |
| 2393 | if self&OFPITClearActions == OFPITClearActions { |
| 2394 | flags = append(flags, "\"ClearActions\": true") |
| 2395 | } |
| 2396 | if self&OFPITMeter == OFPITMeter { |
| 2397 | flags = append(flags, "\"Meter\": true") |
| 2398 | } |
| 2399 | if self&OFPITExperimenter == OFPITExperimenter { |
| 2400 | flags = append(flags, "\"Experimenter\": true") |
| 2401 | } |
| 2402 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 2403 | } |
| 2404 | |
| 2405 | const ( |
| 2406 | // Identifiers from group ofp_ip_prototype |
| 2407 | IpprotoIp = 0 // IPPROTO_IP |
| 2408 | IpprotoICMP = 1 // IPPROTO_ICMP |
| 2409 | IpprotoIgmp = 2 // IPPROTO_IGMP |
| 2410 | IpprotoIpip = 4 // IPPROTO_IPIP |
| 2411 | IpprotoTCP = 6 // IPPROTO_TCP |
| 2412 | IpprotoEgp = 8 // IPPROTO_EGP |
| 2413 | IpprotoPup = 12 // IPPROTO_PUP |
| 2414 | IpprotoUdp = 17 // IPPROTO_UDP |
| 2415 | IpprotoIdp = 22 // IPPROTO_IDP |
| 2416 | IpprotoTp = 29 // IPPROTO_TP |
| 2417 | IpprotoDccp = 33 // IPPROTO_DCCP |
| 2418 | IpprotoIpv6 = 41 // IPPROTO_IPV6 |
| 2419 | IpprotoRsvp = 46 // IPPROTO_RSVP |
| 2420 | IpprotoGRE = 47 // IPPROTO_GRE |
| 2421 | IpprotoEsp = 50 // IPPROTO_ESP |
| 2422 | IpprotoAh = 51 // IPPROTO_AH |
| 2423 | IpprotoMtp = 92 // IPPROTO_MTP |
| 2424 | IpprotoBeetph = 94 // IPPROTO_BEETPH |
| 2425 | IpprotoEncap = 98 // IPPROTO_ENCAP |
| 2426 | IpprotoPim = 103 // IPPROTO_PIM |
| 2427 | IpprotoComp = 108 // IPPROTO_COMP |
| 2428 | IpprotoSctp = 132 // IPPROTO_SCTP |
| 2429 | IpprotoUdplite = 136 // IPPROTO_UDPLITE |
| 2430 | IpprotoMpls = 137 // IPPROTO_MPLS |
| 2431 | IpprotoRaw = 255 // IPPROTO_RAW |
| 2432 | IpprotoRouting = 43 // IPPROTO_ROUTING |
| 2433 | IpprotoFragment = 44 // IPPROTO_FRAGMENT |
| 2434 | IpprotoIcmpv6 = 58 // IPPROTO_ICMPV6 |
| 2435 | IpprotoNone = 59 // IPPROTO_NONE |
| 2436 | IpprotoDstopts = 60 // IPPROTO_DSTOPTS |
| 2437 | IpprotoMh = 135 // IPPROTO_MH |
| 2438 | IpprotoL2Tp = 115 // IPPROTO_L2TP |
| 2439 | ) |
| 2440 | |
| 2441 | type IpPrototype uint8 |
| 2442 | |
| 2443 | func (self IpPrototype) MarshalJSON() ([]byte, error) { |
| 2444 | return []byte(fmt.Sprintf("\"%s\"", self)), nil |
| 2445 | } |
| 2446 | |
| 2447 | func (self IpPrototype) String() string { |
| 2448 | switch self { |
| 2449 | case IpprotoIp: |
| 2450 | return "ip" |
| 2451 | case IpprotoICMP: |
| 2452 | return "icmp" |
| 2453 | case IpprotoIgmp: |
| 2454 | return "igmp" |
| 2455 | case IpprotoIpip: |
| 2456 | return "ipip" |
| 2457 | case IpprotoTCP: |
| 2458 | return "tcp" |
| 2459 | case IpprotoEgp: |
| 2460 | return "egp" |
| 2461 | case IpprotoPup: |
| 2462 | return "pup" |
| 2463 | case IpprotoUdp: |
| 2464 | return "udp" |
| 2465 | case IpprotoIdp: |
| 2466 | return "idp" |
| 2467 | case IpprotoTp: |
| 2468 | return "tp" |
| 2469 | case IpprotoDccp: |
| 2470 | return "dccp" |
| 2471 | case IpprotoIpv6: |
| 2472 | return "ipv6" |
| 2473 | case IpprotoRsvp: |
| 2474 | return "rsvp" |
| 2475 | case IpprotoGRE: |
| 2476 | return "gre" |
| 2477 | case IpprotoEsp: |
| 2478 | return "esp" |
| 2479 | case IpprotoAh: |
| 2480 | return "ah" |
| 2481 | case IpprotoMtp: |
| 2482 | return "mtp" |
| 2483 | case IpprotoBeetph: |
| 2484 | return "beetph" |
| 2485 | case IpprotoEncap: |
| 2486 | return "encap" |
| 2487 | case IpprotoPim: |
| 2488 | return "pim" |
| 2489 | case IpprotoComp: |
| 2490 | return "comp" |
| 2491 | case IpprotoSctp: |
| 2492 | return "sctp" |
| 2493 | case IpprotoUdplite: |
| 2494 | return "udplite" |
| 2495 | case IpprotoMpls: |
| 2496 | return "mpls" |
| 2497 | case IpprotoRaw: |
| 2498 | return "raw" |
| 2499 | case IpprotoRouting: |
| 2500 | return "routing" |
| 2501 | case IpprotoFragment: |
| 2502 | return "fragment" |
| 2503 | case IpprotoIcmpv6: |
| 2504 | return "icmpv6" |
| 2505 | case IpprotoNone: |
| 2506 | return "none" |
| 2507 | case IpprotoDstopts: |
| 2508 | return "dstopts" |
| 2509 | case IpprotoMh: |
| 2510 | return "mh" |
| 2511 | case IpprotoL2Tp: |
| 2512 | return "l2tp" |
| 2513 | default: |
| 2514 | return fmt.Sprintf("%d", self) |
| 2515 | } |
| 2516 | } |
| 2517 | |
| 2518 | const ( |
| 2519 | // Identifiers from group ofp_ipv6exthdr_flags |
| 2520 | OFPIEHNonext = 1 // OFPIEH_NONEXT |
| 2521 | OFPIEHEsp = 2 // OFPIEH_ESP |
| 2522 | OFPIEHAuth = 4 // OFPIEH_AUTH |
| 2523 | OFPIEHDest = 8 // OFPIEH_DEST |
| 2524 | OFPIEHFrag = 16 // OFPIEH_FRAG |
| 2525 | OFPIEHRouter = 32 // OFPIEH_ROUTER |
| 2526 | OFPIEHHop = 64 // OFPIEH_HOP |
| 2527 | OFPIEHUnrep = 128 // OFPIEH_UNREP |
| 2528 | OFPIEHUnseq = 256 // OFPIEH_UNSEQ |
| 2529 | ) |
| 2530 | |
| 2531 | type Ipv6ExthdrFlags uint16 |
| 2532 | |
| 2533 | func (self Ipv6ExthdrFlags) MarshalJSON() ([]byte, error) { |
| 2534 | var flags []string |
| 2535 | if self&OFPIEHNonext == OFPIEHNonext { |
| 2536 | flags = append(flags, "\"Nonext\": true") |
| 2537 | } |
| 2538 | if self&OFPIEHEsp == OFPIEHEsp { |
| 2539 | flags = append(flags, "\"Esp\": true") |
| 2540 | } |
| 2541 | if self&OFPIEHAuth == OFPIEHAuth { |
| 2542 | flags = append(flags, "\"Auth\": true") |
| 2543 | } |
| 2544 | if self&OFPIEHDest == OFPIEHDest { |
| 2545 | flags = append(flags, "\"Dest\": true") |
| 2546 | } |
| 2547 | if self&OFPIEHFrag == OFPIEHFrag { |
| 2548 | flags = append(flags, "\"Frag\": true") |
| 2549 | } |
| 2550 | if self&OFPIEHRouter == OFPIEHRouter { |
| 2551 | flags = append(flags, "\"Router\": true") |
| 2552 | } |
| 2553 | if self&OFPIEHHop == OFPIEHHop { |
| 2554 | flags = append(flags, "\"Hop\": true") |
| 2555 | } |
| 2556 | if self&OFPIEHUnrep == OFPIEHUnrep { |
| 2557 | flags = append(flags, "\"Unrep\": true") |
| 2558 | } |
| 2559 | if self&OFPIEHUnseq == OFPIEHUnseq { |
| 2560 | flags = append(flags, "\"Unseq\": true") |
| 2561 | } |
| 2562 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 2563 | } |
| 2564 | |
| 2565 | const ( |
| 2566 | // Identifiers from group ofp_match_type |
| 2567 | OFPMTStandard = 0 // OFPMT_STANDARD |
| 2568 | OFPMTOXM = 1 // OFPMT_OXM |
| 2569 | ) |
| 2570 | |
| 2571 | type MatchType uint16 |
| 2572 | |
| 2573 | func (self MatchType) MarshalJSON() ([]byte, error) { |
| 2574 | return []byte(fmt.Sprintf("%d", self)), nil |
| 2575 | } |
| 2576 | |
| 2577 | const ( |
| 2578 | // Identifiers from group ofp_meter |
| 2579 | OFPMMax = 4294901760 // OFPM_MAX |
| 2580 | OFPMSlowpath = 4294967293 // OFPM_SLOWPATH |
| 2581 | OFPMController = 4294967294 // OFPM_CONTROLLER |
| 2582 | OFPMAll = 4294967295 // OFPM_ALL |
| 2583 | ) |
| 2584 | |
| 2585 | type Meter uint32 |
| 2586 | |
| 2587 | func (self Meter) MarshalJSON() ([]byte, error) { |
| 2588 | return []byte(fmt.Sprintf("%d", self)), nil |
| 2589 | } |
| 2590 | |
| 2591 | const ( |
| 2592 | // Identifiers from group ofp_meter_band_type |
| 2593 | OFPMBTDrop = 1 // OFPMBT_DROP |
| 2594 | OFPMBTDSCPRemark = 2 // OFPMBT_DSCP_REMARK |
| 2595 | OFPMBTExperimenter = 65535 // OFPMBT_EXPERIMENTER |
| 2596 | ) |
| 2597 | |
| 2598 | type MeterBandType uint16 |
| 2599 | |
| 2600 | func (self MeterBandType) MarshalJSON() ([]byte, error) { |
| 2601 | return []byte(fmt.Sprintf("%d", self)), nil |
| 2602 | } |
| 2603 | |
| 2604 | const ( |
| 2605 | // Identifiers from group ofp_meter_flags |
| 2606 | OFPMFKbps = 1 // OFPMF_KBPS |
| 2607 | OFPMFPktps = 2 // OFPMF_PKTPS |
| 2608 | OFPMFBurst = 4 // OFPMF_BURST |
| 2609 | OFPMFStats = 8 // OFPMF_STATS |
| 2610 | ) |
| 2611 | |
| 2612 | type MeterFlags uint16 |
| 2613 | |
| 2614 | func (self MeterFlags) MarshalJSON() ([]byte, error) { |
| 2615 | var flags []string |
| 2616 | if self&OFPMFKbps == OFPMFKbps { |
| 2617 | flags = append(flags, "\"Kbps\": true") |
| 2618 | } |
| 2619 | if self&OFPMFPktps == OFPMFPktps { |
| 2620 | flags = append(flags, "\"Pktps\": true") |
| 2621 | } |
| 2622 | if self&OFPMFBurst == OFPMFBurst { |
| 2623 | flags = append(flags, "\"Burst\": true") |
| 2624 | } |
| 2625 | if self&OFPMFStats == OFPMFStats { |
| 2626 | flags = append(flags, "\"Stats\": true") |
| 2627 | } |
| 2628 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 2629 | } |
| 2630 | |
| 2631 | const ( |
| 2632 | // Identifiers from group ofp_meter_mod_command |
| 2633 | OFPMCAdd = 0 // OFPMC_ADD |
| 2634 | OFPMCModify = 1 // OFPMC_MODIFY |
| 2635 | OFPMCDelete = 2 // OFPMC_DELETE |
| 2636 | ) |
| 2637 | |
| 2638 | type MeterModCommand uint16 |
| 2639 | |
| 2640 | func (self MeterModCommand) MarshalJSON() ([]byte, error) { |
| 2641 | return []byte(fmt.Sprintf("%d", self)), nil |
| 2642 | } |
| 2643 | |
| 2644 | const ( |
| 2645 | // Identifiers from group ofp_meter_mod_failed_code |
| 2646 | OFPMMFCUnknown = 0 // OFPMMFC_UNKNOWN |
| 2647 | OFPMMFCMeterExists = 1 // OFPMMFC_METER_EXISTS |
| 2648 | OFPMMFCInvalidMeter = 2 // OFPMMFC_INVALID_METER |
| 2649 | OFPMMFCUnknownMeter = 3 // OFPMMFC_UNKNOWN_METER |
| 2650 | OFPMMFCBadCommand = 4 // OFPMMFC_BAD_COMMAND |
| 2651 | OFPMMFCBadFlags = 5 // OFPMMFC_BAD_FLAGS |
| 2652 | OFPMMFCBadRate = 6 // OFPMMFC_BAD_RATE |
| 2653 | OFPMMFCBadBurst = 7 // OFPMMFC_BAD_BURST |
| 2654 | OFPMMFCBadBand = 8 // OFPMMFC_BAD_BAND |
| 2655 | OFPMMFCBadBandValue = 9 // OFPMMFC_BAD_BAND_VALUE |
| 2656 | OFPMMFCOutOfMeters = 10 // OFPMMFC_OUT_OF_METERS |
| 2657 | OFPMMFCOutOfBands = 11 // OFPMMFC_OUT_OF_BANDS |
| 2658 | ) |
| 2659 | |
| 2660 | type MeterModFailedCode uint16 |
| 2661 | |
| 2662 | func (self MeterModFailedCode) MarshalJSON() ([]byte, error) { |
| 2663 | return []byte(fmt.Sprintf("%d", self)), nil |
| 2664 | } |
| 2665 | |
| 2666 | const ( |
| 2667 | // Identifiers from group ofp_optical_port_features |
| 2668 | OFPOPFRxTune = 1 // OFPOPF_RX_TUNE |
| 2669 | OFPOPFTxTune = 2 // OFPOPF_TX_TUNE |
| 2670 | OFPOPFTxPwr = 4 // OFPOPF_TX_PWR |
| 2671 | OFPOPFUseFreq = 8 // OFPOPF_USE_FREQ |
| 2672 | ) |
| 2673 | |
| 2674 | type OpticalPortFeatures uint32 |
| 2675 | |
| 2676 | func (self OpticalPortFeatures) MarshalJSON() ([]byte, error) { |
| 2677 | var flags []string |
| 2678 | if self&OFPOPFRxTune == OFPOPFRxTune { |
| 2679 | flags = append(flags, "\"RxTune\": true") |
| 2680 | } |
| 2681 | if self&OFPOPFTxTune == OFPOPFTxTune { |
| 2682 | flags = append(flags, "\"TxTune\": true") |
| 2683 | } |
| 2684 | if self&OFPOPFTxPwr == OFPOPFTxPwr { |
| 2685 | flags = append(flags, "\"TxPwr\": true") |
| 2686 | } |
| 2687 | if self&OFPOPFUseFreq == OFPOPFUseFreq { |
| 2688 | flags = append(flags, "\"UseFreq\": true") |
| 2689 | } |
| 2690 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 2691 | } |
| 2692 | |
| 2693 | const ( |
| 2694 | // Identifiers from group ofp_ovs_tcp_flag |
| 2695 | OvsTCPFlagFin = 1 // OFP_OVS_TCP_FLAG_FIN |
| 2696 | OvsTCPFlagSyn = 2 // OFP_OVS_TCP_FLAG_SYN |
| 2697 | OvsTCPFlagRst = 4 // OFP_OVS_TCP_FLAG_RST |
| 2698 | OvsTCPFlagPsh = 8 // OFP_OVS_TCP_FLAG_PSH |
| 2699 | OvsTCPFlagAck = 16 // OFP_OVS_TCP_FLAG_ACK |
| 2700 | OvsTCPFlagUrg = 32 // OFP_OVS_TCP_FLAG_URG |
| 2701 | OvsTCPFlagEce = 64 // OFP_OVS_TCP_FLAG_ECE |
| 2702 | OvsTCPFlagCwr = 128 // OFP_OVS_TCP_FLAG_CWR |
| 2703 | OvsTCPFlagNs = 256 // OFP_OVS_TCP_FLAG_NS |
| 2704 | ) |
| 2705 | |
| 2706 | type OvsTcpFlag uint16 |
| 2707 | |
| 2708 | func (self OvsTcpFlag) MarshalJSON() ([]byte, error) { |
| 2709 | var flags []string |
| 2710 | if self&OvsTCPFlagFin == OvsTCPFlagFin { |
| 2711 | flags = append(flags, "\"Fin\": true") |
| 2712 | } |
| 2713 | if self&OvsTCPFlagSyn == OvsTCPFlagSyn { |
| 2714 | flags = append(flags, "\"Syn\": true") |
| 2715 | } |
| 2716 | if self&OvsTCPFlagRst == OvsTCPFlagRst { |
| 2717 | flags = append(flags, "\"Rst\": true") |
| 2718 | } |
| 2719 | if self&OvsTCPFlagPsh == OvsTCPFlagPsh { |
| 2720 | flags = append(flags, "\"Psh\": true") |
| 2721 | } |
| 2722 | if self&OvsTCPFlagAck == OvsTCPFlagAck { |
| 2723 | flags = append(flags, "\"Ack\": true") |
| 2724 | } |
| 2725 | if self&OvsTCPFlagUrg == OvsTCPFlagUrg { |
| 2726 | flags = append(flags, "\"Urg\": true") |
| 2727 | } |
| 2728 | if self&OvsTCPFlagEce == OvsTCPFlagEce { |
| 2729 | flags = append(flags, "\"Ece\": true") |
| 2730 | } |
| 2731 | if self&OvsTCPFlagCwr == OvsTCPFlagCwr { |
| 2732 | flags = append(flags, "\"Cwr\": true") |
| 2733 | } |
| 2734 | if self&OvsTCPFlagNs == OvsTCPFlagNs { |
| 2735 | flags = append(flags, "\"Ns\": true") |
| 2736 | } |
| 2737 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 2738 | } |
| 2739 | |
| 2740 | const ( |
| 2741 | // Identifiers from group ofp_oxm_class |
| 2742 | OFPXMCNxm0 = 0 // OFPXMC_NXM_0 |
| 2743 | OFPXMCNxm1 = 1 // OFPXMC_NXM_1 |
| 2744 | OFPXMCOpenflowBasic = 32768 // OFPXMC_OPENFLOW_BASIC |
| 2745 | OFPXMCExperimenter = 65535 // OFPXMC_EXPERIMENTER |
| 2746 | ) |
| 2747 | |
| 2748 | type OxmClass uint16 |
| 2749 | |
| 2750 | func (self OxmClass) MarshalJSON() ([]byte, error) { |
| 2751 | return []byte(fmt.Sprintf("%d", self)), nil |
| 2752 | } |
| 2753 | |
| 2754 | const ( |
| 2755 | // Identifiers from group ofp_packet_in_reason |
| 2756 | OFPRNoMatch = 0 // OFPR_NO_MATCH |
| 2757 | OFPRAction = 1 // OFPR_ACTION |
| 2758 | OFPRInvalidTtl = 2 // OFPR_INVALID_TTL |
| 2759 | OFPRActionSet = 3 // OFPR_ACTION_SET |
| 2760 | OFPRGroup = 4 // OFPR_GROUP |
| 2761 | OFPRPacketOut = 5 // OFPR_PACKET_OUT |
| 2762 | OFPRBSNNewHost = 128 // OFPR_BSN_NEW_HOST |
| 2763 | OFPRBSNStationMove = 129 // OFPR_BSN_STATION_MOVE |
| 2764 | OFPRBSNBadVLAN = 130 // OFPR_BSN_BAD_VLAN |
| 2765 | OFPRBSNDestinationLookupFailure = 131 // OFPR_BSN_DESTINATION_LOOKUP_FAILURE |
| 2766 | OFPRBSNNoRoute = 132 // OFPR_BSN_NO_ROUTE |
| 2767 | OFPRBSNICMPEchoRequest = 133 // OFPR_BSN_ICMP_ECHO_REQUEST |
| 2768 | OFPRBSNDestNetworkUnreachable = 134 // OFPR_BSN_DEST_NETWORK_UNREACHABLE |
| 2769 | OFPRBSNDestHostUnreachable = 135 // OFPR_BSN_DEST_HOST_UNREACHABLE |
| 2770 | OFPRBSNDestPortUnreachable = 136 // OFPR_BSN_DEST_PORT_UNREACHABLE |
| 2771 | OFPRBSNFragmentationRequired = 137 // OFPR_BSN_FRAGMENTATION_REQUIRED |
| 2772 | OFPRBSNARP = 139 // OFPR_BSN_ARP |
| 2773 | OFPRBSNDhcp = 140 // OFPR_BSN_DHCP |
| 2774 | OFPRBSNDebug = 141 // OFPR_BSN_DEBUG |
| 2775 | OFPRBSNPacketOfDeath = 142 // OFPR_BSN_PACKET_OF_DEATH |
| 2776 | ) |
| 2777 | |
| 2778 | type PacketInReason uint8 |
| 2779 | |
| 2780 | func (self PacketInReason) MarshalJSON() ([]byte, error) { |
| 2781 | return []byte(fmt.Sprintf("%d", self)), nil |
| 2782 | } |
| 2783 | |
| 2784 | const ( |
| 2785 | // Identifiers from group ofp_packet_type |
| 2786 | PtEthernet = 0 // OFP_PT_ETHERNET |
| 2787 | PtUseNextProto = 65534 // OFP_PT_USE_NEXT_PROTO |
| 2788 | PtIpv4 = 67584 // OFP_PT_IPV4 |
| 2789 | PtMpls = 100423 // OFP_PT_MPLS |
| 2790 | PtMplsMc = 100424 // OFP_PT_MPLS_MC |
| 2791 | PtNsh = 100687 // OFP_PT_NSH |
| 2792 | PtUnknown = 4294967295 // OFP_PT_UNKNOWN |
| 2793 | ) |
| 2794 | |
| 2795 | type PacketType uint32 |
| 2796 | |
| 2797 | func (self PacketType) MarshalJSON() ([]byte, error) { |
| 2798 | return []byte(fmt.Sprintf("\"%s\"", self)), nil |
| 2799 | } |
| 2800 | |
| 2801 | func (self PacketType) String() string { |
| 2802 | switch self { |
| 2803 | case PtEthernet: |
| 2804 | return "ethernet" |
| 2805 | case PtUseNextProto: |
| 2806 | return "use_next_proto" |
| 2807 | case PtIpv4: |
| 2808 | return "ipv4" |
| 2809 | case PtMpls: |
| 2810 | return "mpls" |
| 2811 | case PtMplsMc: |
| 2812 | return "mpls_mc" |
| 2813 | case PtNsh: |
| 2814 | return "nsh" |
| 2815 | case PtUnknown: |
| 2816 | return "unknown" |
| 2817 | default: |
| 2818 | return fmt.Sprintf("%d", self) |
| 2819 | } |
| 2820 | } |
| 2821 | |
| 2822 | const ( |
| 2823 | // Identifiers from group ofp_port |
| 2824 | OFPPMax = 4294967040 // OFPP_MAX |
| 2825 | OFPPInPort = 4294967288 // OFPP_IN_PORT |
| 2826 | OFPPTable = 4294967289 // OFPP_TABLE |
| 2827 | OFPPNormal = 4294967290 // OFPP_NORMAL |
| 2828 | OFPPFlood = 4294967291 // OFPP_FLOOD |
| 2829 | OFPPAll = 4294967292 // OFPP_ALL |
| 2830 | OFPPController = 4294967293 // OFPP_CONTROLLER |
| 2831 | OFPPLocal = 4294967294 // OFPP_LOCAL |
| 2832 | OFPPAny = 4294967295 // OFPP_ANY |
| 2833 | ) |
| 2834 | |
| 2835 | type Port uint32 |
| 2836 | |
| 2837 | func (self Port) MarshalJSON() ([]byte, error) { |
| 2838 | return []byte(fmt.Sprintf("%d", self)), nil |
| 2839 | } |
| 2840 | |
| 2841 | const ( |
| 2842 | // Identifiers from group ofp_port_config |
| 2843 | OFPPCPortDown = 1 // OFPPC_PORT_DOWN |
| 2844 | OFPPCNoRecv = 4 // OFPPC_NO_RECV |
| 2845 | OFPPCNoFwd = 32 // OFPPC_NO_FWD |
| 2846 | OFPPCNoPacketIn = 64 // OFPPC_NO_PACKET_IN |
| 2847 | OFPPCBSNMirrorDest = 2147483648 // OFPPC_BSN_MIRROR_DEST |
| 2848 | ) |
| 2849 | |
| 2850 | type PortConfig uint32 |
| 2851 | |
| 2852 | func (self PortConfig) MarshalJSON() ([]byte, error) { |
| 2853 | var flags []string |
| 2854 | if self&OFPPCPortDown == OFPPCPortDown { |
| 2855 | flags = append(flags, "\"PortDown\": true") |
| 2856 | } |
| 2857 | if self&OFPPCNoRecv == OFPPCNoRecv { |
| 2858 | flags = append(flags, "\"NoRecv\": true") |
| 2859 | } |
| 2860 | if self&OFPPCNoFwd == OFPPCNoFwd { |
| 2861 | flags = append(flags, "\"NoFwd\": true") |
| 2862 | } |
| 2863 | if self&OFPPCNoPacketIn == OFPPCNoPacketIn { |
| 2864 | flags = append(flags, "\"NoPacketIn\": true") |
| 2865 | } |
| 2866 | if self&OFPPCBSNMirrorDest == OFPPCBSNMirrorDest { |
| 2867 | flags = append(flags, "\"BsnMirrorDest\": true") |
| 2868 | } |
| 2869 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 2870 | } |
| 2871 | |
| 2872 | const ( |
| 2873 | // Identifiers from group ofp_port_features |
| 2874 | OFPPF10MbHd = 1 // OFPPF_10MB_HD |
| 2875 | OFPPF10MbFd = 2 // OFPPF_10MB_FD |
| 2876 | OFPPF100MbHd = 4 // OFPPF_100MB_HD |
| 2877 | OFPPF100MbFd = 8 // OFPPF_100MB_FD |
| 2878 | OFPPF1GbHd = 16 // OFPPF_1GB_HD |
| 2879 | OFPPF1GbFd = 32 // OFPPF_1GB_FD |
| 2880 | OFPPF10GbFd = 64 // OFPPF_10GB_FD |
| 2881 | OFPPF40GbFd = 128 // OFPPF_40GB_FD |
| 2882 | OFPPF100GbFd = 256 // OFPPF_100GB_FD |
| 2883 | OFPPF1TbFd = 512 // OFPPF_1TB_FD |
| 2884 | OFPPFOther = 1024 // OFPPF_OTHER |
| 2885 | OFPPFCopper = 2048 // OFPPF_COPPER |
| 2886 | OFPPFFiber = 4096 // OFPPF_FIBER |
| 2887 | OFPPFAutoneg = 8192 // OFPPF_AUTONEG |
| 2888 | OFPPFPause = 16384 // OFPPF_PAUSE |
| 2889 | OFPPFPauseAsym = 32768 // OFPPF_PAUSE_ASYM |
| 2890 | OFPPFBSNBreakoutCapable = 2147483648 // OFPPF_BSN_BREAKOUT_CAPABLE |
| 2891 | ) |
| 2892 | |
| 2893 | type PortFeatures uint32 |
| 2894 | |
| 2895 | func (self PortFeatures) MarshalJSON() ([]byte, error) { |
| 2896 | var flags []string |
| 2897 | if self&OFPPF10MbHd == OFPPF10MbHd { |
| 2898 | flags = append(flags, "\"10MbHd\": true") |
| 2899 | } |
| 2900 | if self&OFPPF10MbFd == OFPPF10MbFd { |
| 2901 | flags = append(flags, "\"10MbFd\": true") |
| 2902 | } |
| 2903 | if self&OFPPF100MbHd == OFPPF100MbHd { |
| 2904 | flags = append(flags, "\"100MbHd\": true") |
| 2905 | } |
| 2906 | if self&OFPPF100MbFd == OFPPF100MbFd { |
| 2907 | flags = append(flags, "\"100MbFd\": true") |
| 2908 | } |
| 2909 | if self&OFPPF1GbHd == OFPPF1GbHd { |
| 2910 | flags = append(flags, "\"1GbHd\": true") |
| 2911 | } |
| 2912 | if self&OFPPF1GbFd == OFPPF1GbFd { |
| 2913 | flags = append(flags, "\"1GbFd\": true") |
| 2914 | } |
| 2915 | if self&OFPPF10GbFd == OFPPF10GbFd { |
| 2916 | flags = append(flags, "\"10GbFd\": true") |
| 2917 | } |
| 2918 | if self&OFPPF40GbFd == OFPPF40GbFd { |
| 2919 | flags = append(flags, "\"40GbFd\": true") |
| 2920 | } |
| 2921 | if self&OFPPF100GbFd == OFPPF100GbFd { |
| 2922 | flags = append(flags, "\"100GbFd\": true") |
| 2923 | } |
| 2924 | if self&OFPPF1TbFd == OFPPF1TbFd { |
| 2925 | flags = append(flags, "\"1TbFd\": true") |
| 2926 | } |
| 2927 | if self&OFPPFOther == OFPPFOther { |
| 2928 | flags = append(flags, "\"Other\": true") |
| 2929 | } |
| 2930 | if self&OFPPFCopper == OFPPFCopper { |
| 2931 | flags = append(flags, "\"Copper\": true") |
| 2932 | } |
| 2933 | if self&OFPPFFiber == OFPPFFiber { |
| 2934 | flags = append(flags, "\"Fiber\": true") |
| 2935 | } |
| 2936 | if self&OFPPFAutoneg == OFPPFAutoneg { |
| 2937 | flags = append(flags, "\"Autoneg\": true") |
| 2938 | } |
| 2939 | if self&OFPPFPause == OFPPFPause { |
| 2940 | flags = append(flags, "\"Pause\": true") |
| 2941 | } |
| 2942 | if self&OFPPFPauseAsym == OFPPFPauseAsym { |
| 2943 | flags = append(flags, "\"PauseAsym\": true") |
| 2944 | } |
| 2945 | if self&OFPPFBSNBreakoutCapable == OFPPFBSNBreakoutCapable { |
| 2946 | flags = append(flags, "\"BsnBreakoutCapable\": true") |
| 2947 | } |
| 2948 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 2949 | } |
| 2950 | |
| 2951 | const ( |
| 2952 | // Identifiers from group ofp_port_mod_failed_code |
| 2953 | OFPPMFCBadPort = 0 // OFPPMFC_BAD_PORT |
| 2954 | OFPPMFCBadHwAddr = 1 // OFPPMFC_BAD_HW_ADDR |
| 2955 | OFPPMFCBadConfig = 2 // OFPPMFC_BAD_CONFIG |
| 2956 | OFPPMFCBadAdvertise = 3 // OFPPMFC_BAD_ADVERTISE |
| 2957 | OFPPMFCEperm = 4 // OFPPMFC_EPERM |
| 2958 | ) |
| 2959 | |
| 2960 | type PortModFailedCode uint16 |
| 2961 | |
| 2962 | func (self PortModFailedCode) MarshalJSON() ([]byte, error) { |
| 2963 | return []byte(fmt.Sprintf("%d", self)), nil |
| 2964 | } |
| 2965 | |
| 2966 | const ( |
| 2967 | // Identifiers from group ofp_port_reason |
| 2968 | OFPPRAdd = 0 // OFPPR_ADD |
| 2969 | OFPPRDelete = 1 // OFPPR_DELETE |
| 2970 | OFPPRModify = 2 // OFPPR_MODIFY |
| 2971 | ) |
| 2972 | |
| 2973 | type PortReason uint8 |
| 2974 | |
| 2975 | func (self PortReason) MarshalJSON() ([]byte, error) { |
| 2976 | return []byte(fmt.Sprintf("%d", self)), nil |
| 2977 | } |
| 2978 | |
| 2979 | const ( |
| 2980 | // Identifiers from group ofp_port_state |
| 2981 | OFPPSLinkDown = 1 // OFPPS_LINK_DOWN |
| 2982 | OFPPSBlocked = 2 // OFPPS_BLOCKED |
| 2983 | OFPPSLive = 4 // OFPPS_LIVE |
| 2984 | ) |
| 2985 | |
| 2986 | type PortState uint32 |
| 2987 | |
| 2988 | func (self PortState) MarshalJSON() ([]byte, error) { |
| 2989 | var flags []string |
| 2990 | if self&OFPPSLinkDown == OFPPSLinkDown { |
| 2991 | flags = append(flags, "\"LinkDown\": true") |
| 2992 | } |
| 2993 | if self&OFPPSBlocked == OFPPSBlocked { |
| 2994 | flags = append(flags, "\"Blocked\": true") |
| 2995 | } |
| 2996 | if self&OFPPSLive == OFPPSLive { |
| 2997 | flags = append(flags, "\"Live\": true") |
| 2998 | } |
| 2999 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 3000 | } |
| 3001 | |
| 3002 | const ( |
| 3003 | // Identifiers from group ofp_port_stats_optical_flags |
| 3004 | OFPOSFRxTune = 1 // OFPOSF_RX_TUNE |
| 3005 | OFPOSFTxTune = 2 // OFPOSF_TX_TUNE |
| 3006 | OFPOSFTxPwr = 4 // OFPOSF_TX_PWR |
| 3007 | OFPOSFRxPwr = 16 // OFPOSF_RX_PWR |
| 3008 | OFPOSFTxBias = 32 // OFPOSF_TX_BIAS |
| 3009 | OFPOSFTxTemp = 64 // OFPOSF_TX_TEMP |
| 3010 | ) |
| 3011 | |
| 3012 | type PortStatsOpticalFlags uint32 |
| 3013 | |
| 3014 | func (self PortStatsOpticalFlags) MarshalJSON() ([]byte, error) { |
| 3015 | var flags []string |
| 3016 | if self&OFPOSFRxTune == OFPOSFRxTune { |
| 3017 | flags = append(flags, "\"RxTune\": true") |
| 3018 | } |
| 3019 | if self&OFPOSFTxTune == OFPOSFTxTune { |
| 3020 | flags = append(flags, "\"TxTune\": true") |
| 3021 | } |
| 3022 | if self&OFPOSFTxPwr == OFPOSFTxPwr { |
| 3023 | flags = append(flags, "\"TxPwr\": true") |
| 3024 | } |
| 3025 | if self&OFPOSFRxPwr == OFPOSFRxPwr { |
| 3026 | flags = append(flags, "\"RxPwr\": true") |
| 3027 | } |
| 3028 | if self&OFPOSFTxBias == OFPOSFTxBias { |
| 3029 | flags = append(flags, "\"TxBias\": true") |
| 3030 | } |
| 3031 | if self&OFPOSFTxTemp == OFPOSFTxTemp { |
| 3032 | flags = append(flags, "\"TxTemp\": true") |
| 3033 | } |
| 3034 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 3035 | } |
| 3036 | |
| 3037 | const ( |
| 3038 | // Identifiers from group ofp_port_stats_prop_type |
| 3039 | OFPPSPTEthernet = 0 // OFPPSPT_ETHERNET |
| 3040 | OFPPSPTOptical = 1 // OFPPSPT_OPTICAL |
| 3041 | OFPPSPTExperimenter = 65535 // OFPPSPT_EXPERIMENTER |
| 3042 | ) |
| 3043 | |
| 3044 | type PortStatsPropType uint16 |
| 3045 | |
| 3046 | func (self PortStatsPropType) MarshalJSON() ([]byte, error) { |
| 3047 | return []byte(fmt.Sprintf("%d", self)), nil |
| 3048 | } |
| 3049 | |
| 3050 | const ( |
| 3051 | // Identifiers from group ofp_queue_op_failed_code |
| 3052 | OFPQOFCBadPort = 0 // OFPQOFC_BAD_PORT |
| 3053 | OFPQOFCBadQueue = 1 // OFPQOFC_BAD_QUEUE |
| 3054 | OFPQOFCEperm = 2 // OFPQOFC_EPERM |
| 3055 | ) |
| 3056 | |
| 3057 | type QueueOpFailedCode uint16 |
| 3058 | |
| 3059 | func (self QueueOpFailedCode) MarshalJSON() ([]byte, error) { |
| 3060 | return []byte(fmt.Sprintf("%d", self)), nil |
| 3061 | } |
| 3062 | |
| 3063 | const ( |
| 3064 | // Identifiers from group ofp_requestforward_reason |
| 3065 | OFPRFRGroupMod = 0 // OFPRFR_GROUP_MOD |
| 3066 | OFPRFRMeterMod = 1 // OFPRFR_METER_MOD |
| 3067 | ) |
| 3068 | |
| 3069 | const ( |
| 3070 | // Identifiers from group ofp_role_request_failed_code |
| 3071 | OFPRRFCStale = 0 // OFPRRFC_STALE |
| 3072 | OFPRRFCUnsup = 1 // OFPRRFC_UNSUP |
| 3073 | OFPRRFCBadRole = 2 // OFPRRFC_BAD_ROLE |
| 3074 | ) |
| 3075 | |
| 3076 | type RoleRequestFailedCode uint16 |
| 3077 | |
| 3078 | func (self RoleRequestFailedCode) MarshalJSON() ([]byte, error) { |
| 3079 | return []byte(fmt.Sprintf("%d", self)), nil |
| 3080 | } |
| 3081 | |
| 3082 | const ( |
| 3083 | // Identifiers from group ofp_stats_reply_flags |
| 3084 | OFPSFReplyMore = 1 // OFPSF_REPLY_MORE |
| 3085 | ) |
| 3086 | |
| 3087 | type StatsReplyFlags uint16 |
| 3088 | |
| 3089 | func (self StatsReplyFlags) MarshalJSON() ([]byte, error) { |
| 3090 | var flags []string |
| 3091 | if self&OFPSFReplyMore == OFPSFReplyMore { |
| 3092 | flags = append(flags, "\"OFPSFReplyMore\": true") |
| 3093 | } |
| 3094 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 3095 | } |
| 3096 | |
| 3097 | const ( |
| 3098 | // Identifiers from group ofp_stats_request_flags |
| 3099 | OFPSFReqMore = 1 // OFPSF_REQ_MORE |
| 3100 | ) |
| 3101 | |
| 3102 | type StatsRequestFlags uint16 |
| 3103 | |
| 3104 | func (self StatsRequestFlags) MarshalJSON() ([]byte, error) { |
| 3105 | var flags []string |
| 3106 | if self&OFPSFReqMore == OFPSFReqMore { |
| 3107 | flags = append(flags, "\"OFPSFReqMore\": true") |
| 3108 | } |
| 3109 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 3110 | } |
| 3111 | |
| 3112 | const ( |
| 3113 | // Identifiers from group ofp_stats_type |
| 3114 | OFPSTDesc = 0 // OFPST_DESC |
| 3115 | OFPSTFlow = 1 // OFPST_FLOW |
| 3116 | OFPSTAggregate = 2 // OFPST_AGGREGATE |
| 3117 | OFPSTTable = 3 // OFPST_TABLE |
| 3118 | OFPSTPort = 4 // OFPST_PORT |
| 3119 | OFPSTQueue = 5 // OFPST_QUEUE |
| 3120 | OFPSTGroup = 6 // OFPST_GROUP |
| 3121 | OFPSTGroupDesc = 7 // OFPST_GROUP_DESC |
| 3122 | OFPSTGroupFeatures = 8 // OFPST_GROUP_FEATURES |
| 3123 | OFPSTMeter = 9 // OFPST_METER |
| 3124 | OFPSTMeterConfig = 10 // OFPST_METER_CONFIG |
| 3125 | OFPSTMeterFeatures = 11 // OFPST_METER_FEATURES |
| 3126 | OFPSTTableFeatures = 12 // OFPST_TABLE_FEATURES |
| 3127 | OFPSTPortDesc = 13 // OFPST_PORT_DESC |
| 3128 | OFPMPTableDesc = 14 // OFPMP_TABLE_DESC |
| 3129 | OFPMPQueueDesc = 15 // OFPMP_QUEUE_DESC |
| 3130 | OFPMPFlowMonitor = 16 // OFPMP_FLOW_MONITOR |
| 3131 | OFPSTExperimenter = 65535 // OFPST_EXPERIMENTER |
| 3132 | ) |
| 3133 | |
| 3134 | type StatsType uint16 |
| 3135 | |
| 3136 | func (self StatsType) MarshalJSON() ([]byte, error) { |
| 3137 | return []byte(fmt.Sprintf("%d", self)), nil |
| 3138 | } |
| 3139 | |
| 3140 | const ( |
| 3141 | // Identifiers from group ofp_switch_config_failed_code |
| 3142 | OFPSCFCBadFlags = 0 // OFPSCFC_BAD_FLAGS |
| 3143 | OFPSCFCBadLen = 1 // OFPSCFC_BAD_LEN |
| 3144 | OFPSCFCEperm = 2 // OFPSCFC_EPERM |
| 3145 | ) |
| 3146 | |
| 3147 | type SwitchConfigFailedCode uint16 |
| 3148 | |
| 3149 | func (self SwitchConfigFailedCode) MarshalJSON() ([]byte, error) { |
| 3150 | return []byte(fmt.Sprintf("%d", self)), nil |
| 3151 | } |
| 3152 | |
| 3153 | const ( |
| 3154 | // Identifiers from group ofp_table |
| 3155 | OFPTTMax = 254 // OFPTT_MAX |
| 3156 | OFPTTAll = 255 // OFPTT_ALL |
| 3157 | ) |
| 3158 | |
| 3159 | type Table uint8 |
| 3160 | |
| 3161 | func (self Table) MarshalJSON() ([]byte, error) { |
| 3162 | return []byte(fmt.Sprintf("%d", self)), nil |
| 3163 | } |
| 3164 | |
| 3165 | const ( |
| 3166 | // Identifiers from group ofp_table_config |
| 3167 | OFPTCDeprecatedMask = 3 // OFPTC_DEPRECATED_MASK |
| 3168 | OFPTCEviction = 4 // OFPTC_EVICTION |
| 3169 | OFPTCVacancyEvents = 8 // OFPTC_VACANCY_EVENTS |
| 3170 | ) |
| 3171 | |
| 3172 | type TableConfig uint32 |
| 3173 | |
| 3174 | func (self TableConfig) MarshalJSON() ([]byte, error) { |
| 3175 | var flags []string |
| 3176 | if self&OFPTCDeprecatedMask == OFPTCDeprecatedMask { |
| 3177 | flags = append(flags, "\"DeprecatedMask\": true") |
| 3178 | } |
| 3179 | if self&OFPTCEviction == OFPTCEviction { |
| 3180 | flags = append(flags, "\"Eviction\": true") |
| 3181 | } |
| 3182 | if self&OFPTCVacancyEvents == OFPTCVacancyEvents { |
| 3183 | flags = append(flags, "\"VacancyEvents\": true") |
| 3184 | } |
| 3185 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 3186 | } |
| 3187 | |
| 3188 | const ( |
| 3189 | // Identifiers from group ofp_table_feature_prop_type |
| 3190 | OFPTFPTInstructions = 0 // OFPTFPT_INSTRUCTIONS |
| 3191 | OFPTFPTInstructionsMiss = 1 // OFPTFPT_INSTRUCTIONS_MISS |
| 3192 | OFPTFPTNextTables = 2 // OFPTFPT_NEXT_TABLES |
| 3193 | OFPTFPTNextTablesMiss = 3 // OFPTFPT_NEXT_TABLES_MISS |
| 3194 | OFPTFPTWriteActions = 4 // OFPTFPT_WRITE_ACTIONS |
| 3195 | OFPTFPTWriteActionsMiss = 5 // OFPTFPT_WRITE_ACTIONS_MISS |
| 3196 | OFPTFPTApplyActions = 6 // OFPTFPT_APPLY_ACTIONS |
| 3197 | OFPTFPTApplyActionsMiss = 7 // OFPTFPT_APPLY_ACTIONS_MISS |
| 3198 | OFPTFPTMatch = 8 // OFPTFPT_MATCH |
| 3199 | OFPTFPTWildcards = 10 // OFPTFPT_WILDCARDS |
| 3200 | OFPTFPTWriteSetfield = 12 // OFPTFPT_WRITE_SETFIELD |
| 3201 | OFPTFPTWriteSetfieldMiss = 13 // OFPTFPT_WRITE_SETFIELD_MISS |
| 3202 | OFPTFPTApplySetfield = 14 // OFPTFPT_APPLY_SETFIELD |
| 3203 | OFPTFPTApplySetfieldMiss = 15 // OFPTFPT_APPLY_SETFIELD_MISS |
| 3204 | OFPTFPTTableSyncFrom = 16 // OFPTFPT_TABLE_SYNC_FROM |
| 3205 | OFPTFPTExperimenter = 65534 // OFPTFPT_EXPERIMENTER |
| 3206 | OFPTFPTExperimenterMiss = 65535 // OFPTFPT_EXPERIMENTER_MISS |
| 3207 | ) |
| 3208 | |
| 3209 | type TableFeaturePropType uint16 |
| 3210 | |
| 3211 | func (self TableFeaturePropType) MarshalJSON() ([]byte, error) { |
| 3212 | return []byte(fmt.Sprintf("%d", self)), nil |
| 3213 | } |
| 3214 | |
| 3215 | const ( |
| 3216 | // Identifiers from group ofp_table_features_failed_code |
| 3217 | OFPTFFCBadTable = 0 // OFPTFFC_BAD_TABLE |
| 3218 | OFPTFFCBadMetadata = 1 // OFPTFFC_BAD_METADATA |
| 3219 | OFPTFFCEperm = 5 // OFPTFFC_EPERM |
| 3220 | ) |
| 3221 | |
| 3222 | type TableFeaturesFailedCode uint16 |
| 3223 | |
| 3224 | func (self TableFeaturesFailedCode) MarshalJSON() ([]byte, error) { |
| 3225 | return []byte(fmt.Sprintf("%d", self)), nil |
| 3226 | } |
| 3227 | |
| 3228 | const ( |
| 3229 | // Identifiers from group ofp_table_mod_failed_code |
| 3230 | OFPTMFCBadTable = 0 // OFPTMFC_BAD_TABLE |
| 3231 | OFPTMFCBadConfig = 1 // OFPTMFC_BAD_CONFIG |
| 3232 | OFPTMFCEperm = 2 // OFPTMFC_EPERM |
| 3233 | ) |
| 3234 | |
| 3235 | type TableModFailedCode uint16 |
| 3236 | |
| 3237 | func (self TableModFailedCode) MarshalJSON() ([]byte, error) { |
| 3238 | return []byte(fmt.Sprintf("%d", self)), nil |
| 3239 | } |
| 3240 | |
| 3241 | const ( |
| 3242 | // Identifiers from group ofp_table_mod_prop_eviction_flag |
| 3243 | OFPTMPEFOther = 1 // OFPTMPEF_OTHER |
| 3244 | OFPTMPEFImportance = 2 // OFPTMPEF_IMPORTANCE |
| 3245 | OFPTMPEFLifetime = 4 // OFPTMPEF_LIFETIME |
| 3246 | ) |
| 3247 | |
| 3248 | type TableModPropEvictionFlag uint32 |
| 3249 | |
| 3250 | func (self TableModPropEvictionFlag) MarshalJSON() ([]byte, error) { |
| 3251 | var flags []string |
| 3252 | if self&OFPTMPEFOther == OFPTMPEFOther { |
| 3253 | flags = append(flags, "\"Other\": true") |
| 3254 | } |
| 3255 | if self&OFPTMPEFImportance == OFPTMPEFImportance { |
| 3256 | flags = append(flags, "\"Importance\": true") |
| 3257 | } |
| 3258 | if self&OFPTMPEFLifetime == OFPTMPEFLifetime { |
| 3259 | flags = append(flags, "\"Lifetime\": true") |
| 3260 | } |
| 3261 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 3262 | } |
| 3263 | |
| 3264 | const ( |
| 3265 | // Identifiers from group ofp_table_reason |
| 3266 | OFPTRVacancyDown = 3 // OFPTR_VACANCY_DOWN |
| 3267 | OFPTRVacancyUp = 4 // OFPTR_VACANCY_UP |
| 3268 | ) |
| 3269 | |
| 3270 | type TableReason uint8 |
| 3271 | |
| 3272 | func (self TableReason) MarshalJSON() ([]byte, error) { |
| 3273 | return []byte(fmt.Sprintf("%d", self)), nil |
| 3274 | } |
| 3275 | |
| 3276 | const ( |
| 3277 | // Identifiers from group ofp_tcp_flags |
| 3278 | TcpFlagCwr = 128 // TCP_FLAG_CWR |
| 3279 | TcpFlagEce = 64 // TCP_FLAG_ECE |
| 3280 | TcpFlagUrg = 32 // TCP_FLAG_URG |
| 3281 | TcpFlagAck = 16 // TCP_FLAG_ACK |
| 3282 | TcpFlagPsh = 8 // TCP_FLAG_PSH |
| 3283 | TcpFlagRst = 4 // TCP_FLAG_RST |
| 3284 | TcpFlagSyn = 2 // TCP_FLAG_SYN |
| 3285 | TcpFlagFin = 1 // TCP_FLAG_FIN |
| 3286 | ) |
| 3287 | |
| 3288 | type TcpFlags uint16 |
| 3289 | |
| 3290 | func (self TcpFlags) MarshalJSON() ([]byte, error) { |
| 3291 | var flags []string |
| 3292 | if self&TcpFlagCwr == TcpFlagCwr { |
| 3293 | flags = append(flags, "\"Cwr\": true") |
| 3294 | } |
| 3295 | if self&TcpFlagEce == TcpFlagEce { |
| 3296 | flags = append(flags, "\"Ece\": true") |
| 3297 | } |
| 3298 | if self&TcpFlagUrg == TcpFlagUrg { |
| 3299 | flags = append(flags, "\"Urg\": true") |
| 3300 | } |
| 3301 | if self&TcpFlagAck == TcpFlagAck { |
| 3302 | flags = append(flags, "\"Ack\": true") |
| 3303 | } |
| 3304 | if self&TcpFlagPsh == TcpFlagPsh { |
| 3305 | flags = append(flags, "\"Psh\": true") |
| 3306 | } |
| 3307 | if self&TcpFlagRst == TcpFlagRst { |
| 3308 | flags = append(flags, "\"Rst\": true") |
| 3309 | } |
| 3310 | if self&TcpFlagSyn == TcpFlagSyn { |
| 3311 | flags = append(flags, "\"Syn\": true") |
| 3312 | } |
| 3313 | if self&TcpFlagFin == TcpFlagFin { |
| 3314 | flags = append(flags, "\"Fin\": true") |
| 3315 | } |
| 3316 | return []byte("{" + strings.Join(flags, ", ") + "}"), nil |
| 3317 | } |
| 3318 | |
| 3319 | const ( |
| 3320 | // Identifiers from group ofp_type |
| 3321 | OFPTHello = 0 // OFPT_HELLO |
| 3322 | OFPTError = 1 // OFPT_ERROR |
| 3323 | OFPTEchoRequest = 2 // OFPT_ECHO_REQUEST |
| 3324 | OFPTEchoReply = 3 // OFPT_ECHO_REPLY |
| 3325 | OFPTExperimenter = 4 // OFPT_EXPERIMENTER |
| 3326 | OFPTFeaturesRequest = 5 // OFPT_FEATURES_REQUEST |
| 3327 | OFPTFeaturesReply = 6 // OFPT_FEATURES_REPLY |
| 3328 | OFPTGetConfigRequest = 7 // OFPT_GET_CONFIG_REQUEST |
| 3329 | OFPTGetConfigReply = 8 // OFPT_GET_CONFIG_REPLY |
| 3330 | OFPTSetConfig = 9 // OFPT_SET_CONFIG |
| 3331 | OFPTPacketIn = 10 // OFPT_PACKET_IN |
| 3332 | OFPTFlowRemoved = 11 // OFPT_FLOW_REMOVED |
| 3333 | OFPTPortStatus = 12 // OFPT_PORT_STATUS |
| 3334 | OFPTPacketOut = 13 // OFPT_PACKET_OUT |
| 3335 | OFPTFlowMod = 14 // OFPT_FLOW_MOD |
| 3336 | OFPTGroupMod = 15 // OFPT_GROUP_MOD |
| 3337 | OFPTPortMod = 16 // OFPT_PORT_MOD |
| 3338 | OFPTTableMod = 17 // OFPT_TABLE_MOD |
| 3339 | OFPTStatsRequest = 18 // OFPT_STATS_REQUEST |
| 3340 | OFPTStatsReply = 19 // OFPT_STATS_REPLY |
| 3341 | OFPTBarrierRequest = 20 // OFPT_BARRIER_REQUEST |
| 3342 | OFPTBarrierReply = 21 // OFPT_BARRIER_REPLY |
| 3343 | OFPTRoleRequest = 24 // OFPT_ROLE_REQUEST |
| 3344 | OFPTRoleReply = 25 // OFPT_ROLE_REPLY |
| 3345 | OFPTGetAsyncRequest = 26 // OFPT_GET_ASYNC_REQUEST |
| 3346 | OFPTGetAsyncReply = 27 // OFPT_GET_ASYNC_REPLY |
| 3347 | OFPTSetAsync = 28 // OFPT_SET_ASYNC |
| 3348 | OFPTMeterMod = 29 // OFPT_METER_MOD |
| 3349 | OFPTRoleStatus = 30 // OFPT_ROLE_STATUS |
| 3350 | OFPTTableStatus = 31 // OFPT_TABLE_STATUS |
| 3351 | OFPTRequestforward = 32 // OFPT_REQUESTFORWARD |
| 3352 | OFPTBundleControl = 33 // OFPT_BUNDLE_CONTROL |
| 3353 | OFPTBundleAddMessage = 34 // OFPT_BUNDLE_ADD_MESSAGE |
| 3354 | ) |
| 3355 | |
| 3356 | type Type uint8 |
| 3357 | |
| 3358 | func (self Type) MarshalJSON() ([]byte, error) { |
| 3359 | return []byte(fmt.Sprintf("\"%s\"", self)), nil |
| 3360 | } |
| 3361 | |
| 3362 | func (self Type) String() string { |
| 3363 | switch self { |
| 3364 | case OFPTHello: |
| 3365 | return "hello" |
| 3366 | case OFPTError: |
| 3367 | return "error" |
| 3368 | case OFPTEchoRequest: |
| 3369 | return "echo_request" |
| 3370 | case OFPTEchoReply: |
| 3371 | return "echo_reply" |
| 3372 | case OFPTExperimenter: |
| 3373 | return "experimenter" |
| 3374 | case OFPTFeaturesRequest: |
| 3375 | return "features_request" |
| 3376 | case OFPTFeaturesReply: |
| 3377 | return "features_reply" |
| 3378 | case OFPTGetConfigRequest: |
| 3379 | return "get_config_request" |
| 3380 | case OFPTGetConfigReply: |
| 3381 | return "get_config_reply" |
| 3382 | case OFPTSetConfig: |
| 3383 | return "set_config" |
| 3384 | case OFPTPacketIn: |
| 3385 | return "packet_in" |
| 3386 | case OFPTFlowRemoved: |
| 3387 | return "flow_removed" |
| 3388 | case OFPTPortStatus: |
| 3389 | return "port_status" |
| 3390 | case OFPTPacketOut: |
| 3391 | return "packet_out" |
| 3392 | case OFPTFlowMod: |
| 3393 | return "flow_mod" |
| 3394 | case OFPTGroupMod: |
| 3395 | return "group_mod" |
| 3396 | case OFPTPortMod: |
| 3397 | return "port_mod" |
| 3398 | case OFPTTableMod: |
| 3399 | return "table_mod" |
| 3400 | case OFPTStatsRequest: |
| 3401 | return "stats_request" |
| 3402 | case OFPTStatsReply: |
| 3403 | return "stats_reply" |
| 3404 | case OFPTBarrierRequest: |
| 3405 | return "barrier_request" |
| 3406 | case OFPTBarrierReply: |
| 3407 | return "barrier_reply" |
| 3408 | case OFPTRoleRequest: |
| 3409 | return "role_request" |
| 3410 | case OFPTRoleReply: |
| 3411 | return "role_reply" |
| 3412 | case OFPTGetAsyncRequest: |
| 3413 | return "get_async_request" |
| 3414 | case OFPTGetAsyncReply: |
| 3415 | return "get_async_reply" |
| 3416 | case OFPTSetAsync: |
| 3417 | return "set_async" |
| 3418 | case OFPTMeterMod: |
| 3419 | return "meter_mod" |
| 3420 | case OFPTRoleStatus: |
| 3421 | return "role_status" |
| 3422 | case OFPTTableStatus: |
| 3423 | return "table_status" |
| 3424 | case OFPTRequestforward: |
| 3425 | return "requestforward" |
| 3426 | case OFPTBundleControl: |
| 3427 | return "bundle_control" |
| 3428 | case OFPTBundleAddMessage: |
| 3429 | return "bundle_add_message" |
| 3430 | default: |
| 3431 | return fmt.Sprintf("%d", self) |
| 3432 | } |
| 3433 | } |
| 3434 | |
| 3435 | const ( |
| 3436 | // Identifiers from group ofp_vlan_id |
| 3437 | OFPVIDNone = 0 // OFPVID_NONE |
| 3438 | OFPVIDPresent = 4096 // OFPVID_PRESENT |
| 3439 | ) |
| 3440 | |
| 3441 | type VlanId uint16 |
| 3442 | |
| 3443 | func (self VlanId) MarshalJSON() ([]byte, error) { |
| 3444 | return []byte(fmt.Sprintf("%d", self)), nil |
| 3445 | } |