Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net) |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 3 | * Copyright 2020-present Open Networking Foundation |
| 4 | |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 8 | |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 10 | |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | */ |
Girish Gowdra | e268310 | 2021-03-05 08:24:26 -0800 | [diff] [blame] | 17 | /* |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 18 | * NOTE: This file was generated, manual edits will be overwritten! |
| 19 | * |
| 20 | * Generated by 'goCodeGenerator.py': |
| 21 | * https://github.com/cboling/OMCI-parser/README.md |
| 22 | */ |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 23 | |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 24 | package generated |
| 25 | |
| 26 | import "github.com/deckarep/golang-set" |
| 27 | |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 28 | // MacBridgePortFilterTableDataClassID is the 16-bit ID for the OMCI |
| 29 | // Managed entity MAC bridge port filter table data |
Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [diff] [blame] | 30 | const MacBridgePortFilterTableDataClassID = ClassID(49) // 0x0031 |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 31 | |
| 32 | var macbridgeportfiltertabledataBME *ManagedEntityDefinition |
| 33 | |
Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [diff] [blame] | 34 | // MacBridgePortFilterTableData (Class ID: #49 / 0x0031) |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 35 | // This ME organizes data associated with a bridge port. The ONU automatically creates or deletes |
| 36 | // an instance of this ME upon the creation or deletion of a MAC bridge port configuration data ME. |
| 37 | // |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 38 | // NOTE - The OLT should disable the learning mode in the MAC bridge service profile before writing |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 39 | // to the MAC filter table. |
| 40 | // |
| 41 | // Relationships |
| 42 | // An instance of this ME is associated with an instance of a MAC bridge port configuration data |
| 43 | // ME. |
| 44 | // |
| 45 | // Attributes |
| 46 | // Managed Entity Id |
Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [diff] [blame] | 47 | // This attribute uniquely identifies each instance of this ME. Through an identical ID, this ME is |
| 48 | // implicitly linked to an instance of the MAC bridge port configuration data ME. (R) (mandatory) |
| 49 | // (2-bytes) |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 50 | // |
| 51 | // Mac Filter Table |
Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [diff] [blame] | 52 | // This attribute lists MAC addresses associated with the bridge port, each with an allow/disallow |
| 53 | // forwarding indicator for traffic flowing out of the bridge port. Additionally, the forwarding |
| 54 | // action may be based on a MAC source or DA. In this way, upstream traffic is filtered on ANI-side |
| 55 | // bridge ports, and downstream traffic is filtered on UNI-side bridge ports. The setting of an |
| 56 | // entry with a forward action implies that all other addresses are filtered. Conversely, the |
| 57 | // setting of an entry with a filter action implies that all other addresses are forwarded. The |
| 58 | // behaviour is unspecified if forward and filter actions are mixed. |
| 59 | // |
| 60 | // Each entry contains: |
| 61 | // |
| 62 | // - the entry number, an index into this attribute list (1-byte); |
| 63 | // |
| 64 | // - filter byte (1-byte); |
| 65 | // |
| 66 | // - MAC address (6-bytes). |
| 67 | // |
| 68 | // The bits of the filter byte are assigned as follows. |
| 69 | // |
| 70 | // Bit Name Setting |
| 71 | // |
| 72 | // 1 (LSB) Filter/forward 0: forward |
| 73 | // |
| 74 | // 1: filter |
| 75 | // |
| 76 | // 2 0: MAC DAs |
| 77 | // |
| 78 | // 1: MAC source addresses |
| 79 | // |
| 80 | // 3..6 Reserved 0 |
| 81 | // |
| 82 | // 7..8 Add/remove 10: Clear entire table (set operation) |
| 83 | // |
| 84 | // 00: Remove this entry (set operation) |
| 85 | // |
| 86 | // 01: Add this entry |
| 87 | // |
| 88 | // Upon ME instantiation, the ONU sets this attribute to an empty table. |
| 89 | // |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 90 | // (R,-W) (Mandatory) (8N bytes, where N is the number of entries in the list) |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 91 | // |
| 92 | type MacBridgePortFilterTableData struct { |
| 93 | ManagedEntityDefinition |
| 94 | Attributes AttributeValueMap |
| 95 | } |
| 96 | |
| 97 | func init() { |
| 98 | macbridgeportfiltertabledataBME = &ManagedEntityDefinition{ |
| 99 | Name: "MacBridgePortFilterTableData", |
| 100 | ClassID: 49, |
| 101 | MessageTypes: mapset.NewSetWith( |
| 102 | Get, |
| 103 | GetNext, |
| 104 | Set, |
Girish Gowdra | e268310 | 2021-03-05 08:24:26 -0800 | [diff] [blame] | 105 | SetTable, |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 106 | ), |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 107 | AllowedAttributeMask: 0x8000, |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 108 | AttributeDefinitions: AttributeDefinitionMap{ |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 109 | 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0), |
| 110 | 1: TableField("MacFilterTable", TableAttributeType, 0x8000, TableInfo{nil, 8}, mapset.NewSetWith(Read, Write), false, false, false, 1), |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 111 | }, |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 112 | Access: CreatedByOnu, |
| 113 | Support: UnknownSupport, |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 114 | } |
| 115 | } |
| 116 | |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 117 | // NewMacBridgePortFilterTableData (class ID 49) creates the basic |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 118 | // Managed Entity definition that is used to validate an ME of this type that |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 119 | // is received from or transmitted to the OMCC. |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 120 | func NewMacBridgePortFilterTableData(params ...ParamData) (*ManagedEntity, OmciErrors) { |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 121 | return NewManagedEntity(*macbridgeportfiltertabledataBME, params...) |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 122 | } |