blob: e2c10831b1d24ac22ea71b48e9b5375efa0c87ad [file] [log] [blame]
Matteo Scandoloa4285862020-12-01 18:10:10 -08001/*
2 * Copyright 2018-present Open Networking Foundation
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
17package 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
22type SadisConfig struct {
23 Sadis SadisEntries `json:"sadis"`
24 BandwidthProfile BandwidthProfileEntries `json:"bandwidthprofile"`
25}
26
27type SadisEntries struct {
28 Integration SadisIntegration `json:"integration"`
29 Entries []*SadisEntry `json:"entries,omitempty"`
30 //Entries []interface{} `json:"entries,omitempty"`
31}
32
33type BandwidthProfileEntries struct {
34 Integration SadisIntegration `json:"integration"`
35 Entries []*SadisBWPEntry `json:"entries,omitempty"`
36}
37
38type 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
47type 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 Campanella68c39e62022-03-10 17:14:13 +010055 NniDhcpTrapVid int `json:"nniDhcpTrapVid,omitempty"`
Matteo Scandoloa4285862020-12-01 18:10:10 -080056 // onu
57 NasPortID string `json:"nasPortId"`
58 CircuitID string `json:"circuitId"`
59 RemoteID string `json:"remoteId"`
60 UniTagList []SadisUniTag `json:"uniTagList"`
61}
62
63type 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 Campanella68c39e62022-03-10 17:14:13 +010069 NniDhcpTrapVid int `json:"nniDhcpTrapVid,omitempty"`
Matteo Scandoloa4285862020-12-01 18:10:10 -080070}
71
72type 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
80type 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 Campanella4523c292022-02-03 15:59:54 +010089 IsPPPoERequired bool `json:"isPppoeRequired,omitempty"`
Matteo Scandoloa4285862020-12-01 18:10:10 -080090 ConfiguredMacAddress string `json:"configuredMacAddress,omitempty"`
Andrea Campanella4523c292022-02-03 15:59:54 +010091 EnableMacLearning bool `json:"enableMacLearning,omitempty"`
Matteo Scandoloa4285862020-12-01 18:10:10 -080092 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
100type SadisBWPEntry struct {
101 ID string `json:"id"`
Matteo Scandoloa4285862020-12-01 18:10:10 -0800102 CBS int `json:"cbs"`
103 CIR int `json:"cir"`
Hardik Windlassba4eb672021-05-31 12:56:37 +0000104 // MEF attributes
Matteo Scandolo06e564f2022-03-22 15:45:26 -0700105 AIR int `json:"air,omitempty"`
106 EBS int `json:"ebs,omitempty"`
107 EIR int `json:"eir,omitempty"`
Hardik Windlassba4eb672021-05-31 12:56:37 +0000108 // IETF attributes
Matteo Scandolo06e564f2022-03-22 15:45:26 -0700109 GIR int `json:"gir,omitempty"`
110 PIR int `json:"pir,omitempty"`
111 PBS int `json:"pbs,omitempty"`
Matteo Scandoloa4285862020-12-01 18:10:10 -0800112}