blob: 3c2094d085256acd4c67725d0d6d7d3fcb51f780 [file] [log] [blame]
Author Namea594e632018-08-10 11:33:58 -04001/*
2 Copyright 2017 the original author or authors.
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 physical
18
19import "net"
20
21/*
22Represents an arbitrary OLT linecard
23*/
24type OLT interface {
25 GetCLLI() string
26 GetHostname() string
27 GetAddress() net.TCPAddr
28 GetNumber() int
29 GetPorts() []PONPort
30 GetParent() *Chassis
31 GetDataSwitchPort() int
32}
33
34/*
35A basic representation of an OLT which fulfills the above interface,
36and can be used in other OLT implementations
37*/
38type SimpleOLT struct {
39 CLLI string
40 Hostname string
41 Address net.TCPAddr
42 Number int
43 Ports []PONPort
44 Parent *Chassis `json:"-"`
45 DataSwitchPort int
46}
47
48func (s *SimpleOLT) GetCLLI() string {
49 return s.CLLI
50}
51
52func (s *SimpleOLT) GetHostname() string {
53 return s.Hostname
54}
55
56func (s *SimpleOLT) GetAddress() net.TCPAddr {
57 return s.Address
58}
59
60func (s *SimpleOLT) GetNumber() int {
61 return s.Number
62}
63
64func (s *SimpleOLT) GetPorts() []PONPort {
65 return s.Ports
66}
67
68func (s *SimpleOLT) GetParent() *Chassis {
69 return s.Parent
70}
71
72func (s *SimpleOLT) GetDataSwitchPort() int {
73 return s.DataSwitchPort
74}