-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev_interfaces.go
150 lines (124 loc) · 3.27 KB
/
dev_interfaces.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
package godevman
import "net/http"
// Get system info
type DevSysReader interface {
System([]string) (System, error)
}
// Set system info
type DevSysWriter interface {
SetSysName(string) error
SetContact(string) error
SetLocation(string) error
}
// Functionality related to interfaces
type DevIfReader interface {
IfInfo([]string, ...string) (map[string]*IfInfo, error)
// Get ifNumber
IfNumber() (int64, error)
// Get interfaces stack info
IfStack() (IfStack, error)
}
type DevIfWriter interface {
// Set interface admin status
SetIfAdmStat(map[string]string) error
// Set interface alias
SetIfAlias(map[string]string) error
}
// Functionality related to inventory
type DevInvReader interface {
InvInfo([]string, ...string) (map[string]*InvInfo, error)
// Get interface to inventory relations
IfInventory() (map[int]int, error)
}
// Functionality related to dot1q vlans
type DevVlanReader interface {
D1qVlans() (map[string]string, error)
// Get dot1q vlans
BrPort2IfIdx() (map[string]int, error)
// Get dot1q vlan to port relations
D1qVlanInfo() (map[string]*D1qVlanInfo, error)
}
// Functionality related to IP addresses
type DevIpReader interface {
IpInfo(...string) (map[string]*IpInfo, error)
IpIfInfo(...string) (map[string]*IpIfInfo, error)
}
// Functionality related to Get IPv6 addresses
type DevIp6Reader interface {
Ip6IfDescr(...string) (map[string]string, error)
}
// Get OSPF info
type DevOspfReader interface {
OspfAreaRouters() (map[string][]string, error)
OspfAreaStatus() (map[string]string, error)
OspfNbrStatus() (map[string]string, error)
}
// Get Software version
type DevSwReader interface {
SwVersion() (string, error)
}
// Get Hardware info
type DevHwReader interface {
HwInfo() (map[string]string, error)
}
// Functionality related to web connection authentication
type DevWebSessManager interface {
WebAuth([]string) error
WebSession() *http.Client
WebLogout() error
}
// Get RL neighbour info
type DevRlReader interface {
RlInfo() (map[string]*RlRadioIfInfo, error)
RlNbrInfo() (map[string]*RlRadioFeIfInfo, error)
}
// Get backup info
type DevBackupReader interface {
LastBackup() (*BackupInfo, error)
}
// Backup initiator
type DevBackupper interface {
// Backup device config
DoBackup() error
}
// Get environment sensors info
type DevSensorsReader interface {
Sensors([]string) (map[string]map[string]map[string]SensorVal, error)
}
// Get ONU info
type DevOnusReader interface {
OnuInfo() (map[string]*OnuInfo, error)
}
// Get Phase Sync info
type DevPhaseSyncReader interface {
PhaseSyncInfo() (*PhaseSyncInfo, error)
}
// Get Frequency Sync info
type DevFreqSyncReader interface {
FreqSyncInfo() (*FreqSyncInfo, error)
}
// Get Power Generator info
type DevGenReader interface {
GeneratorInfo([]string) (GenInfo, error)
}
// Get energy readings
type DevEnergyMeterReader interface {
Ereadings() (*EReadings, error)
}
// CLI releated functionality
type DevCliWriter interface {
// Execute cli commands
RunCmds([]string, *CliCmdOpts) ([]string, error)
}
// Get running config
type DevConfReader interface {
RuningCfg() (string, error)
}
// Mobile signal related functionality
type DevMobReader interface {
MobSignal() (map[string]MobSignal, error)
}
// Test interface
// type DevTest interface {
// TestCmd([]string) ([]string, error)
// }