blob: c2a254666561d6815ec6e005b558a124d2a993c9 [file] [log] [blame]
Jonathan Hartf86817b2018-08-17 10:35:54 -07001// Copyright 2018 Open Networking Foundation
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14package main
15
16/*
17 {
18 "id": "PONSIM",
19 "cTag": 333,
20 "sTag": 444,
21 "nasPortId": "PON 1/1/03/1:1.1.1",
22 "circuitId": "foo",
23 "remoteId": "bar"
24 }
25*/
26/*
27 ONOS SADIS subscriber format
28*/
29type sadisSubscriber struct {
Daniele Moro11794a32020-03-05 18:04:58 -080030 ID string `json:"id"`
31 NasPortID string `json:"nasPortId"`
32 CircuitID string `json:"circuitId"`
33 RemoteID string `json:"remoteId"`
34 UniTagList []*sadisUnitaginfo `json:"uniTagList"`
Jonathan Hartf86817b2018-08-17 10:35:54 -070035}
36
37/*
38 XOS RCORD subscriber format
39*/
40type subscriber struct {
Daniele Moro11794a32020-03-05 18:04:58 -080041 ID int `json:"id"`
42 OnuSerialNumber string `json:"onu_device"`
43 NasPortID string `json:"nas_port_id"`
44 CircuitID string `json:"circuit_id"`
45 RemoteID string `json:"remote_id"`
46 UniTagListId []int `json:"unitaglist_ids"`
Jonathan Hartf86817b2018-08-17 10:35:54 -070047}
48
49type subscribers struct {
50 Subscribers []*subscriber `json:"items"`
51}
52
53/*
Daniele Moro11794a32020-03-05 18:04:58 -080054 ONOS SADIS UNI Tag information format
55*/
56type sadisUnitaginfo struct {
57 //FIXME: which fields can be omitted??
58 UniTagMatch int16 `json:"uniTagMatch"`
59 PonCTag int16 `json:"ponCTag"`
60 PonSTag int16 `json:"ponSTag"`
61 UsPonCTagPriority int `json:"usPonCTagPriority"`
62 UsPonSTagPriority int `json:"usPonSTagPriority"`
63 DsPonCTagPriority int `json:"dsPonCTagPriority"`
64 DsPonSTagPriority int `json:"dsPonSTagPriority"`
65 TechnologyProfileID int `json:"technologyProfileId"`
66 UpstreamBandwidthProfile string `json:"upstreamBandwidthProfile"`
67 DownstreamBandwidthProfile string `json:"downstreamBandwidthProfile"`
68 ServiceName string `json:"serviceName"`
69 EnableMacLearning bool `json:"enableMacLearning"`
70 ConfiguredMacAddress *string `json:"configuredMacAddress,omitempty"`
71 IsDhcpRequired bool `json:"isDhcpRequired"`
72 IsIgmpRequired bool `json:"isIgmpRequired"`
73}
74
75type sadisUnitaginfolist struct {
76 SadisUniTagList []*sadisUnitaginfo `json:"items"`
77}
78
79/*
80 XOS RCORD UNI Tag information format
81*/
82
83type unitaginfo struct {
84 //FIXME: which fields can be empty and must be NOT be propagated? (for example see configured_mac_address)
85 ID int `json:"id"`
86 UniTagMatch int16 `json:"uni_tag_match"`
87 PonCTag int16 `json:"pon_c_tag"`
88 PonSTag int16 `json:"pon_s_tag"`
89 UsPonCTagPriority int `json:"us_pon_ctag_priority"`
90 UsPonSTagPriority int `json:"us_pon_stag_priority"`
91 DsPonCTagPriority int `json:"ds_pon_ctag_priority"`
92 DsPonSTagPriority int `json:"ds_pon_stag_priority"`
93 TechnologyProfileID int `json:"tech_profile_id"`
94 UpstreamBandwidthProfile int `json:"upstream_bps_id"`
95 DownstreamBandwidthProfile int `json:"downstream_bps_id"`
96 ServiceName string `json:"service_name"`
97 EnableMacLearning bool `json:"enable_mac_learning"`
98 ConfiguredMacAddress *string `json:"configured_mac_address"`
99 IsDhcpRequired bool `json:"is_dhcp_required"`
100 IsIgmpRequired bool `json:"is_igmp_required"`
101 Subscriber int `json:"subscriber_id"`
102}
103
104/*
Matteo Scandolo60676562019-03-15 14:56:25 -0700105 XOS BandwidthProfile format
106*/
107type bandwidthprofile struct {
108 Name string `json:"name"`
109 Cir int `json:"cir"`
110 Cbs int `json:"cbs"`
111 Eir int `json:"eir"`
112 Ebs int `json:"ebs"`
113 Air int `json:"air"`
114}
115
116type bandwidthprofiles struct {
117 Profiles []*bandwidthprofile `json:"items"`
118}
119
120/*
Jonathan Hartf86817b2018-08-17 10:35:54 -0700121 {
122 "id" : "10.1.1.1:9191",
123 "hardwareIdentifier" : "de:ad:be:ef:ba:11",
124 "uplinkPort" : 128
125 }
126*/
127/*
128 ONOS SADIS device format
129*/
130type sadisDevice struct {
Matteo Scandoloa79e6082018-08-21 14:16:47 -0700131 ID string `json:"id"`
Jonathan Hartf86817b2018-08-17 10:35:54 -0700132 HardwareID string `json:"hardwareIdentifier"`
Matteo Scandoloa79e6082018-08-21 14:16:47 -0700133 Uplink int `json:"uplinkPort"`
Matteo Scandolo3f330cd2018-08-31 07:29:35 -0700134 IPAddress string `json:"ipAddress"`
135 NasID string `json:"nasId"`
Jonathan Hartf86817b2018-08-17 10:35:54 -0700136}
137
138/*
139 XOS vOLT device format
140*/
141type oltDevice struct {
Matteo Scandolo5be70a12018-10-16 10:57:57 -0700142 Uplink string `json:"uplink"`
143 Host string `json:"host"`
144 Port int `json:"port"`
145 NasID string `json:"nas_id"`
146 SerialNumber string `json:"serial_number"`
Jonathan Hartf86817b2018-08-17 10:35:54 -0700147}
148
149type oltDevices struct {
150 OltDevices []*oltDevice `json:"items"`
151}
Matteo Scandolo60676562019-03-15 14:56:25 -0700152
153/*
154 ONOS SADIS bandwidth profile format
155*/
156
157type sadisBandwidthProfile struct {
158 ID string `json:"id"`
159 Cir int `json:"cir"`
160 Cbs int `json:"cbs"`
161 Eir int `json:"eir"`
162 Ebs int `json:"ebs"`
163 Air int `json:"air"`
164}