blob: 049e33a9418b67c8c63d78cb089ac0072670824b [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"`
55 // onu
56 NasPortID string `json:"nasPortId"`
57 CircuitID string `json:"circuitId"`
58 RemoteID string `json:"remoteId"`
59 UniTagList []SadisUniTag `json:"uniTagList"`
60}
61
62type SadisOltEntry struct {
63 ID string `json:"id"`
64 HardwareIdentifier string `json:"hardwareIdentifier"`
65 IPAddress string `json:"ipAddress"`
66 NasID string `json:"nasId"`
67 UplinkPort int `json:"uplinkPort"`
68}
69
70type SadisOnuEntryV2 struct {
71 ID string `json:"id"`
72 NasPortID string `json:"nasPortId"`
73 CircuitID string `json:"circuitId"`
74 RemoteID string `json:"remoteId"`
75 UniTagList []SadisUniTag `json:"uniTagList"` // this can be SadisUniTagAtt, SadisUniTagDt
76}
77
78type SadisUniTag struct {
79 UniTagMatch int `json:"uniTagMatch,omitempty"`
80 PonCTag int `json:"ponCTag,omitempty"`
81 PonSTag int `json:"ponSTag,omitempty"`
82 TechnologyProfileID int `json:"technologyProfileId,omitempty"`
83 UpstreamBandwidthProfile string `json:"upstreamBandwidthProfile,omitempty"`
84 DownstreamBandwidthProfile string `json:"downstreamBandwidthProfile,omitempty"`
85 IsDhcpRequired bool `json:"isDhcpRequired,omitempty"`
86 IsIgmpRequired bool `json:"isIgmpRequired,omitempty"`
Andrea Campanella4523c292022-02-03 15:59:54 +010087 IsPPPoERequired bool `json:"isPppoeRequired,omitempty"`
Matteo Scandoloa4285862020-12-01 18:10:10 -080088 ConfiguredMacAddress string `json:"configuredMacAddress,omitempty"`
Andrea Campanella4523c292022-02-03 15:59:54 +010089 EnableMacLearning bool `json:"enableMacLearning,omitempty"`
Matteo Scandoloa4285862020-12-01 18:10:10 -080090 UsPonCTagPriority uint8 `json:"usPonCTagPriority,omitempty"`
91 UsPonSTagPriority uint8 `json:"usPonSTagPriority,omitempty"`
92 DsPonCTagPriority uint8 `json:"dsPonCTagPriority,omitempty"`
93 DsPonSTagPriority uint8 `json:"dsPonSTagPriority,omitempty"`
94 ServiceName string `json:"serviceName,omitempty"`
95}
96
97// SADIS BandwithProfile Entry
98type SadisBWPEntry struct {
99 ID string `json:"id"`
Matteo Scandoloa4285862020-12-01 18:10:10 -0800100 CBS int `json:"cbs"`
101 CIR int `json:"cir"`
Hardik Windlassba4eb672021-05-31 12:56:37 +0000102 // MEF attributes
103 AIR int `json:"air,omitempty"`
104 EBS int `json:"ebs,omitempty"`
105 EIR int `json:"eir,omitempty"`
106 // IETF attributes
107 GIR int `json:"gir,omitempty"`
108 PIR int `json:"pir,omitempty"`
109 PBS int `json:"pbs,omitempty"`
Matteo Scandoloa4285862020-12-01 18:10:10 -0800110}