Skip to content

Commit 8023194

Browse files
committed
fix(if entry helper): move enum defs above class
resolves #6
1 parent 895e373 commit 8023194

File tree

2 files changed

+54
-54
lines changed

2 files changed

+54
-54
lines changed

shard.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: snmp
2-
version: 0.9.7
2+
version: 0.9.8
33
crystal: ">= 0.36.1"
44

55
dependencies:

src/snmp/helpers/if_entry.cr

+53-53
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,58 @@
11
# https://www.alvestrand.no/objectid/1.3.6.1.2.1.2.2.1.html
22
class SNMP
3+
# http://www.net-snmp.org/docs/mibs/interfaces.html#ifAdminStatus
4+
enum IfAdminStatus
5+
Up = 1
6+
Down
7+
Testing
8+
end
9+
10+
enum IfOperStatus
11+
Up = 1
12+
Down
13+
Testing
14+
Unknown
15+
Dormant
16+
NotPresent
17+
LowerLayerDown
18+
end
19+
20+
# https://www.alvestrand.no/objectid/1.3.6.1.2.1.2.2.1.3.html
21+
enum IfType
22+
Other = 1
23+
Regular1822
24+
HDH1822
25+
DDNx25
26+
RFC877x25
27+
EthernetCSMACD
28+
ISO88023CSMACD
29+
ISO88024TokenBus
30+
ISO88025TokenRing
31+
ISO88026Man
32+
StarLan
33+
Proteon10Mbit
34+
Proteon80Mbit
35+
HyperChannel
36+
FDDI
37+
LAPB
38+
SDLC
39+
DSL
40+
EL
41+
BasicISDN
42+
PrimaryISDN
43+
PropPointToPointSerial
44+
PPP
45+
SoftwareLoopback
46+
EON
47+
Ethernet3Mbit
48+
NSIP
49+
SLIP
50+
Ultra
51+
DS3
52+
SIP
53+
FrameRelay
54+
end
55+
356
class Helpers::IfEntry
457
# ameba:disable Metrics/CyclomaticComplexity
558
def initialize(pdu : SNMP::PDU)
@@ -77,57 +130,4 @@ class SNMP
77130
property out_errors = 0_u32
78131
property out_qlen = 0_u32
79132
end
80-
81-
# http://www.net-snmp.org/docs/mibs/interfaces.html#ifAdminStatus
82-
enum IfAdminStatus
83-
Up = 1
84-
Down
85-
Testing
86-
end
87-
88-
enum IfOperStatus
89-
Up = 1
90-
Down
91-
Testing
92-
Unknown
93-
Dormant
94-
NotPresent
95-
LowerLayerDown
96-
end
97-
98-
# https://www.alvestrand.no/objectid/1.3.6.1.2.1.2.2.1.3.html
99-
enum IfType
100-
Other = 1
101-
Regular1822
102-
HDH1822
103-
DDNx25
104-
RFC877x25
105-
EthernetCSMACD
106-
ISO88023CSMACD
107-
ISO88024TokenBus
108-
ISO88025TokenRing
109-
ISO88026Man
110-
StarLan
111-
Proteon10Mbit
112-
Proteon80Mbit
113-
HyperChannel
114-
FDDI
115-
LAPB
116-
SDLC
117-
DSL
118-
EL
119-
BasicISDN
120-
PrimaryISDN
121-
PropPointToPointSerial
122-
PPP
123-
SoftwareLoopback
124-
EON
125-
Ethernet3Mbit
126-
NSIP
127-
SLIP
128-
Ultra
129-
DS3
130-
SIP
131-
FrameRelay
132-
end
133133
end

0 commit comments

Comments
 (0)