Jonathan Hart | f86817b | 2018-08-17 10:35:54 -0700 | [diff] [blame] | 1 | // 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. |
| 14 | package 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 | */ |
| 29 | type sadisSubscriber struct { |
Daniele Moro | 11794a3 | 2020-03-05 18:04:58 -0800 | [diff] [blame^] | 30 | 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 Hart | f86817b | 2018-08-17 10:35:54 -0700 | [diff] [blame] | 35 | } |
| 36 | |
| 37 | /* |
| 38 | XOS RCORD subscriber format |
| 39 | */ |
| 40 | type subscriber struct { |
Daniele Moro | 11794a3 | 2020-03-05 18:04:58 -0800 | [diff] [blame^] | 41 | 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 Hart | f86817b | 2018-08-17 10:35:54 -0700 | [diff] [blame] | 47 | } |
| 48 | |
| 49 | type subscribers struct { |
| 50 | Subscribers []*subscriber `json:"items"` |
| 51 | } |
| 52 | |
| 53 | /* |
Daniele Moro | 11794a3 | 2020-03-05 18:04:58 -0800 | [diff] [blame^] | 54 | ONOS SADIS UNI Tag information format |
| 55 | */ |
| 56 | type 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 | |
| 75 | type sadisUnitaginfolist struct { |
| 76 | SadisUniTagList []*sadisUnitaginfo `json:"items"` |
| 77 | } |
| 78 | |
| 79 | /* |
| 80 | XOS RCORD UNI Tag information format |
| 81 | */ |
| 82 | |
| 83 | type 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 Scandolo | 6067656 | 2019-03-15 14:56:25 -0700 | [diff] [blame] | 105 | XOS BandwidthProfile format |
| 106 | */ |
| 107 | type 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 | |
| 116 | type bandwidthprofiles struct { |
| 117 | Profiles []*bandwidthprofile `json:"items"` |
| 118 | } |
| 119 | |
| 120 | /* |
Jonathan Hart | f86817b | 2018-08-17 10:35:54 -0700 | [diff] [blame] | 121 | { |
| 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 | */ |
| 130 | type sadisDevice struct { |
Matteo Scandolo | a79e608 | 2018-08-21 14:16:47 -0700 | [diff] [blame] | 131 | ID string `json:"id"` |
Jonathan Hart | f86817b | 2018-08-17 10:35:54 -0700 | [diff] [blame] | 132 | HardwareID string `json:"hardwareIdentifier"` |
Matteo Scandolo | a79e608 | 2018-08-21 14:16:47 -0700 | [diff] [blame] | 133 | Uplink int `json:"uplinkPort"` |
Matteo Scandolo | 3f330cd | 2018-08-31 07:29:35 -0700 | [diff] [blame] | 134 | IPAddress string `json:"ipAddress"` |
| 135 | NasID string `json:"nasId"` |
Jonathan Hart | f86817b | 2018-08-17 10:35:54 -0700 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | /* |
| 139 | XOS vOLT device format |
| 140 | */ |
| 141 | type oltDevice struct { |
Matteo Scandolo | 5be70a1 | 2018-10-16 10:57:57 -0700 | [diff] [blame] | 142 | 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 Hart | f86817b | 2018-08-17 10:35:54 -0700 | [diff] [blame] | 147 | } |
| 148 | |
| 149 | type oltDevices struct { |
| 150 | OltDevices []*oltDevice `json:"items"` |
| 151 | } |
Matteo Scandolo | 6067656 | 2019-03-15 14:56:25 -0700 | [diff] [blame] | 152 | |
| 153 | /* |
| 154 | ONOS SADIS bandwidth profile format |
| 155 | */ |
| 156 | |
| 157 | type 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 | } |