Matteo Scandolo | a428586 | 2020-12-01 18:10:10 -0800 | [diff] [blame] | 1 | /* |
Joey Armstrong | ee4d826 | 2023-08-22 15:19:19 -0400 | [diff] [blame^] | 2 | * Copyright 2018-2023 Open Networking Foundation (ONF) and the ONF Contributors |
Matteo Scandolo | a428586 | 2020-12-01 18:10:10 -0800 | [diff] [blame] | 3 | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package core |
| 18 | |
| 19 | // TODO this should be imported from github.com/opencord/bbsim |
| 20 | // but to do that we need to move them from the "internal" module |
| 21 | |
| 22 | type SadisConfig struct { |
| 23 | Sadis SadisEntries `json:"sadis"` |
| 24 | BandwidthProfile BandwidthProfileEntries `json:"bandwidthprofile"` |
| 25 | } |
| 26 | |
| 27 | type SadisEntries struct { |
| 28 | Integration SadisIntegration `json:"integration"` |
| 29 | Entries []*SadisEntry `json:"entries,omitempty"` |
| 30 | //Entries []interface{} `json:"entries,omitempty"` |
| 31 | } |
| 32 | |
| 33 | type BandwidthProfileEntries struct { |
| 34 | Integration SadisIntegration `json:"integration"` |
| 35 | Entries []*SadisBWPEntry `json:"entries,omitempty"` |
| 36 | } |
| 37 | |
| 38 | type SadisIntegration struct { |
| 39 | URL string `json:"url,omitempty"` |
| 40 | Cache struct { |
| 41 | Enabled bool `json:"enabled"` |
| 42 | MaxSize int `json:"maxsize"` |
| 43 | TTL string `json:"ttl"` |
| 44 | } `json:"cache"` |
| 45 | } |
| 46 | |
| 47 | type SadisEntry struct { |
| 48 | // common |
| 49 | ID string `json:"id"` |
| 50 | // olt |
| 51 | HardwareIdentifier string `json:"hardwareIdentifier"` |
| 52 | IPAddress string `json:"ipAddress"` |
| 53 | NasID string `json:"nasId"` |
| 54 | UplinkPort int `json:"uplinkPort"` |
Andrea Campanella | 68c39e6 | 2022-03-10 17:14:13 +0100 | [diff] [blame] | 55 | NniDhcpTrapVid int `json:"nniDhcpTrapVid,omitempty"` |
Matteo Scandolo | a428586 | 2020-12-01 18:10:10 -0800 | [diff] [blame] | 56 | // onu |
| 57 | NasPortID string `json:"nasPortId"` |
| 58 | CircuitID string `json:"circuitId"` |
| 59 | RemoteID string `json:"remoteId"` |
| 60 | UniTagList []SadisUniTag `json:"uniTagList"` |
| 61 | } |
| 62 | |
| 63 | type SadisOltEntry struct { |
| 64 | ID string `json:"id"` |
| 65 | HardwareIdentifier string `json:"hardwareIdentifier"` |
| 66 | IPAddress string `json:"ipAddress"` |
| 67 | NasID string `json:"nasId"` |
| 68 | UplinkPort int `json:"uplinkPort"` |
Andrea Campanella | 68c39e6 | 2022-03-10 17:14:13 +0100 | [diff] [blame] | 69 | NniDhcpTrapVid int `json:"nniDhcpTrapVid,omitempty"` |
Matteo Scandolo | a428586 | 2020-12-01 18:10:10 -0800 | [diff] [blame] | 70 | } |
| 71 | |
| 72 | type SadisOnuEntryV2 struct { |
| 73 | ID string `json:"id"` |
| 74 | NasPortID string `json:"nasPortId"` |
| 75 | CircuitID string `json:"circuitId"` |
| 76 | RemoteID string `json:"remoteId"` |
| 77 | UniTagList []SadisUniTag `json:"uniTagList"` // this can be SadisUniTagAtt, SadisUniTagDt |
| 78 | } |
| 79 | |
| 80 | type SadisUniTag struct { |
| 81 | UniTagMatch int `json:"uniTagMatch,omitempty"` |
| 82 | PonCTag int `json:"ponCTag,omitempty"` |
| 83 | PonSTag int `json:"ponSTag,omitempty"` |
| 84 | TechnologyProfileID int `json:"technologyProfileId,omitempty"` |
| 85 | UpstreamBandwidthProfile string `json:"upstreamBandwidthProfile,omitempty"` |
| 86 | DownstreamBandwidthProfile string `json:"downstreamBandwidthProfile,omitempty"` |
| 87 | IsDhcpRequired bool `json:"isDhcpRequired,omitempty"` |
| 88 | IsIgmpRequired bool `json:"isIgmpRequired,omitempty"` |
Andrea Campanella | 4523c29 | 2022-02-03 15:59:54 +0100 | [diff] [blame] | 89 | IsPPPoERequired bool `json:"isPppoeRequired,omitempty"` |
Matteo Scandolo | a428586 | 2020-12-01 18:10:10 -0800 | [diff] [blame] | 90 | ConfiguredMacAddress string `json:"configuredMacAddress,omitempty"` |
Andrea Campanella | 4523c29 | 2022-02-03 15:59:54 +0100 | [diff] [blame] | 91 | EnableMacLearning bool `json:"enableMacLearning,omitempty"` |
Matteo Scandolo | a428586 | 2020-12-01 18:10:10 -0800 | [diff] [blame] | 92 | UsPonCTagPriority uint8 `json:"usPonCTagPriority,omitempty"` |
| 93 | UsPonSTagPriority uint8 `json:"usPonSTagPriority,omitempty"` |
| 94 | DsPonCTagPriority uint8 `json:"dsPonCTagPriority,omitempty"` |
| 95 | DsPonSTagPriority uint8 `json:"dsPonSTagPriority,omitempty"` |
| 96 | ServiceName string `json:"serviceName,omitempty"` |
| 97 | } |
| 98 | |
| 99 | // SADIS BandwithProfile Entry |
| 100 | type SadisBWPEntry struct { |
| 101 | ID string `json:"id"` |
Matteo Scandolo | a428586 | 2020-12-01 18:10:10 -0800 | [diff] [blame] | 102 | CBS int `json:"cbs"` |
| 103 | CIR int `json:"cir"` |
Hardik Windlass | ba4eb67 | 2021-05-31 12:56:37 +0000 | [diff] [blame] | 104 | // MEF attributes |
Matteo Scandolo | 06e564f | 2022-03-22 15:45:26 -0700 | [diff] [blame] | 105 | AIR int `json:"air,omitempty"` |
| 106 | EBS int `json:"ebs,omitempty"` |
| 107 | EIR int `json:"eir,omitempty"` |
Hardik Windlass | ba4eb67 | 2021-05-31 12:56:37 +0000 | [diff] [blame] | 108 | // IETF attributes |
Matteo Scandolo | 06e564f | 2022-03-22 15:45:26 -0700 | [diff] [blame] | 109 | GIR int `json:"gir,omitempty"` |
| 110 | PIR int `json:"pir,omitempty"` |
| 111 | PBS int `json:"pbs,omitempty"` |
Matteo Scandolo | a428586 | 2020-12-01 18:10:10 -0800 | [diff] [blame] | 112 | } |