python-netgear-switch-library 0.0.post154__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- netgear_switch/__init__.py +132 -0
- netgear_switch/_dispatch.py +178 -0
- netgear_switch/_version.py +24 -0
- netgear_switch/aio_api.py +529 -0
- netgear_switch/cli/__init__.py +1 -0
- netgear_switch/cli/capture.py +131 -0
- netgear_switch/cli/context.py +39 -0
- netgear_switch/cli/format.py +201 -0
- netgear_switch/cli/main.py +484 -0
- netgear_switch/cli/resolve.py +108 -0
- netgear_switch/cli/safety.py +71 -0
- netgear_switch/config.py +184 -0
- netgear_switch/errors.py +52 -0
- netgear_switch/http_read.py +174 -0
- netgear_switch/http_write.py +420 -0
- netgear_switch/models.py +156 -0
- netgear_switch/nsdp_read.py +221 -0
- netgear_switch/nsdp_write.py +315 -0
- netgear_switch/protocols/__init__.py +1 -0
- netgear_switch/protocols/http/__init__.py +1 -0
- netgear_switch/protocols/http/crypt.py +29 -0
- netgear_switch/protocols/http/endpoints.py +165 -0
- netgear_switch/protocols/http/forms.py +77 -0
- netgear_switch/protocols/http/parse.py +238 -0
- netgear_switch/protocols/http/session.py +29 -0
- netgear_switch/protocols/nsdp/__init__.py +7 -0
- netgear_switch/protocols/nsdp/auth.py +33 -0
- netgear_switch/protocols/nsdp/client.py +67 -0
- netgear_switch/protocols/nsdp/parsers.py +209 -0
- netgear_switch/protocols/nsdp/protocol.py +201 -0
- netgear_switch/protocols/nsdp/types.py +137 -0
- netgear_switch/protocols/nsdp/write.py +98 -0
- netgear_switch/protocols/snmp/__init__.py +1 -0
- netgear_switch/protocols/snmp/client.py +88 -0
- netgear_switch/protocols/snmp/oids.py +125 -0
- netgear_switch/protocols/snmp/parse.py +777 -0
- netgear_switch/protocols/snmp/write.py +112 -0
- netgear_switch/py.typed +0 -0
- netgear_switch/registry.py +227 -0
- netgear_switch/snmp_read.py +226 -0
- netgear_switch/snmp_write.py +625 -0
- netgear_switch/sync_api.py +557 -0
- netgear_switch/transport/__init__.py +1 -0
- netgear_switch/transport/aio/__init__.py +1 -0
- netgear_switch/transport/aio/nsdp_udp.py +152 -0
- netgear_switch/transport/aio/snmp_pysnmp.py +247 -0
- netgear_switch/transport/http/__init__.py +1 -0
- netgear_switch/transport/http/client.py +217 -0
- netgear_switch/transport/sync/__init__.py +1 -0
- netgear_switch/transport/sync/nsdp_udp.py +109 -0
- netgear_switch/transport/sync/snmp_netsnmp_cli.py +257 -0
- netgear_switch/virtual/__init__.py +8 -0
- netgear_switch/virtual/faces/__init__.py +2 -0
- netgear_switch/virtual/faces/http.py +164 -0
- netgear_switch/virtual/faces/mibview.py +92 -0
- netgear_switch/virtual/faces/nsdp.py +124 -0
- netgear_switch/virtual/faces/snmp.py +412 -0
- netgear_switch/virtual/seed.py +220 -0
- netgear_switch/virtual/server.py +106 -0
- netgear_switch/virtual/state.py +615 -0
- netgear_switch/virtual/web.py +210 -0
- python_netgear_switch_library-0.0.post154.dist-info/METADATA +85 -0
- python_netgear_switch_library-0.0.post154.dist-info/RECORD +66 -0
- python_netgear_switch_library-0.0.post154.dist-info/WHEEL +4 -0
- python_netgear_switch_library-0.0.post154.dist-info/entry_points.txt +2 -0
- python_netgear_switch_library-0.0.post154.dist-info/licenses/LICENSE +202 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
"""Pure web-UI projection of ``VirtualSwitchState`` (render + apply).
|
|
2
|
+
|
|
3
|
+
The exact inverse of the Task-3 parsers and Task-4 form encoders: ``render_page``
|
|
4
|
+
turns device state into the documented HTML shape the parsers consume, and
|
|
5
|
+
``apply_form`` mutates the state from a POSTed form body. No network here — the
|
|
6
|
+
``VirtualHttpFace`` (Task 11) wraps these in an ``http.server`` handler.
|
|
7
|
+
|
|
8
|
+
The rendered HTML is deliberately minimal but carries every field the parsers
|
|
9
|
+
read, including a constant CSRF ``hash`` token on each writable page. Routing
|
|
10
|
+
(deciding whether a requested path is one a given model's ``http_spec``
|
|
11
|
+
actually advertises, and returning a 404-equivalent for anything else) is
|
|
12
|
+
Task 11's job at the I/O boundary; this module renders/applies whatever page
|
|
13
|
+
its caller already resolved against ``spec``.
|
|
14
|
+
"""
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import re
|
|
18
|
+
from typing import TYPE_CHECKING
|
|
19
|
+
|
|
20
|
+
if TYPE_CHECKING:
|
|
21
|
+
from ..protocols.http.endpoints import HttpModelSpec
|
|
22
|
+
from .state import PoeSim, VirtualSwitchState
|
|
23
|
+
|
|
24
|
+
_HASH = "virtualhash"
|
|
25
|
+
_DETECT_TEXT = {3: "Delivering", 1: "Searching", 2: "Disabled", 4: "Fault"}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def render_login(rand: str) -> str:
|
|
29
|
+
return (
|
|
30
|
+
f'<html><body><form>'
|
|
31
|
+
f'<input type="hidden" id="rand" name="rand" value="{rand}">'
|
|
32
|
+
f'<input type="hidden" name="hash" value="{_HASH}">'
|
|
33
|
+
f"</form></body></html>"
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _hash_input() -> str:
|
|
38
|
+
return f'<input type="hidden" name="hash" value="{_HASH}">'
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def render_page(
|
|
42
|
+
state: VirtualSwitchState, spec: HttpModelSpec, path: str, form: dict[str, str]
|
|
43
|
+
) -> str:
|
|
44
|
+
if path == spec.dashboard_path:
|
|
45
|
+
return _render_dashboard(state)
|
|
46
|
+
if path == spec.stats_path:
|
|
47
|
+
return _render_stats(state)
|
|
48
|
+
if path == spec.poe_status_path:
|
|
49
|
+
return _render_poe_status(state)
|
|
50
|
+
if path == spec.pvid_path:
|
|
51
|
+
return _render_pvid(state)
|
|
52
|
+
if path == spec.vlan_config_path:
|
|
53
|
+
return _render_vlan_cfg(state)
|
|
54
|
+
if path == spec.vlan_membership_path:
|
|
55
|
+
vid = int(form.get("VLAN_ID", "1"))
|
|
56
|
+
return _render_membership(state, vid)
|
|
57
|
+
if path == spec.poe_config_path:
|
|
58
|
+
return f"<html><body>{_hash_input()}</body></html>"
|
|
59
|
+
return f"<html><body>OK{_hash_input()}</body></html>"
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def _render_dashboard(state: VirtualSwitchState) -> str:
|
|
63
|
+
rows = "".join(
|
|
64
|
+
f'<tr class="portID"><td><input type="checkbox"></td>'
|
|
65
|
+
f"<td>{p}</td>"
|
|
66
|
+
f'<td>{("Up " + str(sim.speed) + "M") if sim.link else "Down"}</td>'
|
|
67
|
+
f'<td>{"Enabled" if sim.admin else "Disabled"}</td>'
|
|
68
|
+
f"<td>{sim.name}</td></tr>"
|
|
69
|
+
for p, sim in sorted(state.ports.items())
|
|
70
|
+
)
|
|
71
|
+
return f"<html><body>{_hash_input()}<table>{rows}</table></body></html>"
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def _render_stats(state: VirtualSwitchState) -> str:
|
|
75
|
+
rows = "".join(
|
|
76
|
+
f'<tr class="portID"><td>{p}</td>'
|
|
77
|
+
f"<td>{sim.rx_octets or 0}</td><td>{sim.tx_octets or 0}</td>"
|
|
78
|
+
f"<td>{sim.rx_errors or 0}</td></tr>"
|
|
79
|
+
for p, sim in sorted(state.ports.items())
|
|
80
|
+
)
|
|
81
|
+
return f"<html><body><table>{rows}</table></body></html>"
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def _render_poe_status(state: VirtualSwitchState) -> str:
|
|
85
|
+
def _detect_text(psim: PoeSim) -> str:
|
|
86
|
+
if not psim.admin:
|
|
87
|
+
return "Disabled"
|
|
88
|
+
return _DETECT_TEXT.get(psim.detect, "Disabled")
|
|
89
|
+
|
|
90
|
+
rows = "".join(
|
|
91
|
+
f'<tr class="portID"><td>{p}</td>'
|
|
92
|
+
f"<td>{_detect_text(psim)}</td>"
|
|
93
|
+
f"<td>{psim.power_mw}</td></tr>"
|
|
94
|
+
for p, psim in sorted(state.poe.items())
|
|
95
|
+
)
|
|
96
|
+
return f"<html><body>{_hash_input()}<table>{rows}</table></body></html>"
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def _render_pvid(state: VirtualSwitchState) -> str:
|
|
100
|
+
rows = "".join(
|
|
101
|
+
f'<tr class="portID"><td><input type="checkbox" name="port{p - 1}"></td>'
|
|
102
|
+
f'<td sel="text">{p}<input type="hidden" value="1"></td>'
|
|
103
|
+
f'<td sel="input">{state.pvids.get(p, 1)}</td></tr>'
|
|
104
|
+
for p in sorted(state.ports)
|
|
105
|
+
)
|
|
106
|
+
return f"<html><body>{_hash_input()}<table>{rows}</table></body></html>"
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def _render_vlan_cfg(state: VirtualSwitchState) -> str:
|
|
110
|
+
boxes = "".join(
|
|
111
|
+
f'<input type="checkbox" name="vlanck{i}" value="{vid}">'
|
|
112
|
+
for i, vid in enumerate(sorted(state.vlans))
|
|
113
|
+
)
|
|
114
|
+
return f"<html><body>{_hash_input()}{boxes}</body></html>"
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def _render_membership(state: VirtualSwitchState, vid: int) -> str:
|
|
118
|
+
from ..registry import get_model
|
|
119
|
+
|
|
120
|
+
vsim = state.vlans.get(vid)
|
|
121
|
+
port_count = get_model(state.model_key).port_count
|
|
122
|
+
chars = []
|
|
123
|
+
for p in range(1, port_count + 1):
|
|
124
|
+
if vsim is None or p not in vsim.member:
|
|
125
|
+
chars.append("3")
|
|
126
|
+
elif p in vsim.untagged:
|
|
127
|
+
chars.append("1")
|
|
128
|
+
else:
|
|
129
|
+
chars.append("2")
|
|
130
|
+
hidden = "".join(chars)
|
|
131
|
+
options = "".join(
|
|
132
|
+
f'<option {"selected " if v == vid else ""}value="{v}">VLAN {v}</option>'
|
|
133
|
+
for v in sorted(state.vlans)
|
|
134
|
+
)
|
|
135
|
+
return (
|
|
136
|
+
f"<html><body><form>{_hash_input()}{options}"
|
|
137
|
+
f'<input name="hiddenMem" id="hiddenMem" value="{hidden}" type="hidden">'
|
|
138
|
+
f"</form></body></html>"
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def apply_form(
|
|
143
|
+
state: VirtualSwitchState, spec: HttpModelSpec, path: str, form: dict[str, str]
|
|
144
|
+
) -> None:
|
|
145
|
+
if path == spec.poe_config_path:
|
|
146
|
+
_apply_poe(state, form)
|
|
147
|
+
elif path == spec.pvid_path:
|
|
148
|
+
_apply_pvid(state, form)
|
|
149
|
+
elif path == spec.vlan_membership_path and "hiddenMem" in form:
|
|
150
|
+
_apply_membership(state, form)
|
|
151
|
+
elif path == spec.vlan_config_path:
|
|
152
|
+
_apply_vlan_cfg(state, form)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def _apply_poe(state: VirtualSwitchState, form: dict[str, str]) -> None:
|
|
156
|
+
if form.get("ACTION") == "Apply" and "portID" in form:
|
|
157
|
+
port = int(form["portID"]) + 1
|
|
158
|
+
if port in state.poe:
|
|
159
|
+
on = form.get("ADMIN_MODE") == "1"
|
|
160
|
+
state.poe[port].admin = on
|
|
161
|
+
state.poe[port].detect = 3 if on else 1
|
|
162
|
+
elif form.get("ACTION") == "Reset":
|
|
163
|
+
for key in form:
|
|
164
|
+
m = re.fullmatch(r"port(\d+)", key)
|
|
165
|
+
if m:
|
|
166
|
+
port = int(m.group(1)) + 1
|
|
167
|
+
if port in state.poe:
|
|
168
|
+
state.poe[port].detect = 3 if state.poe[port].admin else 1
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
def _apply_pvid(state: VirtualSwitchState, form: dict[str, str]) -> None:
|
|
172
|
+
vlan = int(form.get("pvid", "0"))
|
|
173
|
+
if vlan <= 0:
|
|
174
|
+
return
|
|
175
|
+
for key in form:
|
|
176
|
+
m = re.fullmatch(r"port(\d+)", key)
|
|
177
|
+
if m:
|
|
178
|
+
state.pvids[int(m.group(1)) + 1] = vlan
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
def _apply_membership(state: VirtualSwitchState, form: dict[str, str]) -> None:
|
|
182
|
+
vid = int(form["VLAN_ID"])
|
|
183
|
+
vsim = state.vlans.get(vid)
|
|
184
|
+
if vsim is None:
|
|
185
|
+
return
|
|
186
|
+
hidden = form["hiddenMem"]
|
|
187
|
+
member: set[int] = set()
|
|
188
|
+
untagged: set[int] = set()
|
|
189
|
+
for i, ch in enumerate(hidden):
|
|
190
|
+
port = i + 1
|
|
191
|
+
if ch == "1":
|
|
192
|
+
member.add(port)
|
|
193
|
+
untagged.add(port)
|
|
194
|
+
elif ch == "2":
|
|
195
|
+
member.add(port)
|
|
196
|
+
vsim.member = member
|
|
197
|
+
vsim.untagged = untagged
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
def _apply_vlan_cfg(state: VirtualSwitchState, form: dict[str, str]) -> None:
|
|
201
|
+
from .state import VlanSim
|
|
202
|
+
|
|
203
|
+
action = form.get("ACTION")
|
|
204
|
+
if action == "Add" and "ADD_VLANID" in form:
|
|
205
|
+
vid = int(form["ADD_VLANID"])
|
|
206
|
+
state.vlans.setdefault(vid, VlanSim(name=""))
|
|
207
|
+
elif action == "Delete":
|
|
208
|
+
for key, val in form.items():
|
|
209
|
+
if re.fullmatch(r"vlanck\d+", key):
|
|
210
|
+
state.vlans.pop(int(val), None)
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: python-netgear-switch-library
|
|
3
|
+
Version: 0.0.post154
|
|
4
|
+
Summary: Python library and CLI to query and control Netgear switches over SNMP, NSDP and HTTP.
|
|
5
|
+
Author-email: Tim Ansell <me@mith.ro>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Python: >=3.11
|
|
9
|
+
Provides-Extra: async
|
|
10
|
+
Requires-Dist: pysnmp>=7.0; extra == 'async'
|
|
11
|
+
Provides-Extra: http
|
|
12
|
+
Requires-Dist: httpx>=0.27; extra == 'http'
|
|
13
|
+
Provides-Extra: sync
|
|
14
|
+
Provides-Extra: testing
|
|
15
|
+
Requires-Dist: pysnmp>=7.0; extra == 'testing'
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
# Python Netgear Switch Interface Library
|
|
19
|
+
|
|
20
|
+
Query and control all your Netgear switches — SNMP (managed), NSDP and HTTP
|
|
21
|
+
web-UI (Plus) — behind one model-driven Python API and the `ngsw` CLI.
|
|
22
|
+
|
|
23
|
+
Status: **early development.** See `docs/superpowers/specs/` for the design and
|
|
24
|
+
`docs/superpowers/plans/` for the implementation plans.
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
### pip / uv (PyPI)
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
pip install python-netgear-switch-library
|
|
32
|
+
# or: uv add python-netgear-switch-library
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Optional extras: `[async]` (pysnmp), `[http]` (httpx). The synchronous SNMP
|
|
36
|
+
transport shells out to the **net-snmp command-line tools**, a system package
|
|
37
|
+
(not a Python dependency):
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
sudo apt install snmp # provides snmpget/snmpbulkwalk/snmpset
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Debian / Ubuntu (apt)
|
|
44
|
+
|
|
45
|
+
Signed `.deb` packages for Debian **trixie** and **sid** are published to a
|
|
46
|
+
GitHub Pages apt repository. Pick the line matching your suite:
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
sudo install -d -m0755 /etc/apt/keyrings
|
|
50
|
+
curl -fsSL https://mithro.github.io/python-netgear-switch-library/netgear-switch.gpg \
|
|
51
|
+
| sudo tee /etc/apt/keyrings/netgear-switch.gpg > /dev/null
|
|
52
|
+
|
|
53
|
+
# trixie:
|
|
54
|
+
echo "deb [signed-by=/etc/apt/keyrings/netgear-switch.gpg] https://mithro.github.io/python-netgear-switch-library/trixie/ ./" \
|
|
55
|
+
| sudo tee /etc/apt/sources.list.d/netgear-switch.list
|
|
56
|
+
# sid:
|
|
57
|
+
echo "deb [signed-by=/etc/apt/keyrings/netgear-switch.gpg] https://mithro.github.io/python-netgear-switch-library/sid/ ./" \
|
|
58
|
+
| sudo tee /etc/apt/sources.list.d/netgear-switch.list
|
|
59
|
+
|
|
60
|
+
sudo apt update
|
|
61
|
+
sudo apt install python3-netgear-switch-library
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
This installs the `netgear_switch` library and the `ngsw` CLI, and pulls in the
|
|
65
|
+
`snmp` net-snmp CLI tools automatically.
|
|
66
|
+
|
|
67
|
+
Either way, once installed run `ngsw --help` to see available commands.
|
|
68
|
+
|
|
69
|
+
### Versioning
|
|
70
|
+
|
|
71
|
+
This project is a **rolling release**: the version is derived from git
|
|
72
|
+
(`0.0.postN` / `X.Y.postN`), and every merge to `main` publishes a new version
|
|
73
|
+
to PyPI and the apt repo. There are no tags or manual version bumps.
|
|
74
|
+
|
|
75
|
+
## Development
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
uv sync --all-extras
|
|
79
|
+
uv run pytest
|
|
80
|
+
uv run ruff check
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## License
|
|
84
|
+
|
|
85
|
+
Apache-2.0.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
netgear_switch/__init__.py,sha256=QgaPNFcr2LFRIx8UMYinPy-YDdiUZXl2MT1hjxQ--3Q,3569
|
|
2
|
+
netgear_switch/_dispatch.py,sha256=cDQtqmZysfpjZFcOlfeOaXO-AUNBqczHObzvpZ6O1C0,6690
|
|
3
|
+
netgear_switch/_version.py,sha256=VPh_gDs50ut4GZY2ewvW0Z7HRppfQ1t8IZ5KRgDNmAk,534
|
|
4
|
+
netgear_switch/aio_api.py,sha256=7eagMF5gHg2iahRpetOw1IsvTb7Yx2N9O08Cx7YrA44,21332
|
|
5
|
+
netgear_switch/config.py,sha256=z2vV1LqsLTb83ekEJwy_nnkeUlxcknicmkmKfILH5kc,5787
|
|
6
|
+
netgear_switch/errors.py,sha256=MoDhagAUzeU01ESKfZcBqX5gAc_hNVtuwATGYkEAOUM,1518
|
|
7
|
+
netgear_switch/http_read.py,sha256=7uwoquknVP0x6FEx2iroiAB4D7X8oaN5Nw0M5AYlT7k,6900
|
|
8
|
+
netgear_switch/http_write.py,sha256=coFerLvRlybWEgCXP1vOqwgG_H_hrksYx82Ni5D2m-o,16525
|
|
9
|
+
netgear_switch/models.py,sha256=3X7i0sEQO599EuwZiV7-gJgsnIx5LMq7j271QzOijKM,4381
|
|
10
|
+
netgear_switch/nsdp_read.py,sha256=o3rHnL14AWOyWLYE0iBjl8MWDvQYtirUg6kbtsAz71I,7918
|
|
11
|
+
netgear_switch/nsdp_write.py,sha256=SEtNGmGsOI0dchRNhrYOw2NEp_TvCdx9vxsvlkdfY_Y,12999
|
|
12
|
+
netgear_switch/registry.py,sha256=JZgYU3DlPvM0SvtuYyZAX_4fGZi72WF32Ivbb-7MZaw,8012
|
|
13
|
+
netgear_switch/snmp_read.py,sha256=mdbjOcn3-pOugM7S_JMQ-Kr_yC7tJ-tiY0rnSHC4h5s,9174
|
|
14
|
+
netgear_switch/snmp_write.py,sha256=va4YLscp8WjRL-PUi5mZqgnwCwygTjOzhtI4Ttn0vMs,26710
|
|
15
|
+
netgear_switch/sync_api.py,sha256=GeJH4IvFSLK04SzVXLnHJECzkwmo1HYIW24BEkzzxR8,23734
|
|
16
|
+
netgear_switch/cli/__init__.py,sha256=tWZVE4BHoVLwYF-KKXIyrilqFpKBkAmHGC68UEK78e4,74
|
|
17
|
+
netgear_switch/cli/capture.py,sha256=-w9dOp2KyNHd_MvY-lOaqBpzSFoOL8TT7unLniOLgj4,4567
|
|
18
|
+
netgear_switch/cli/context.py,sha256=k6-lHXnbTAFcYPzqhfBpkPe2N4QlrEFm5MuP089UBDg,923
|
|
19
|
+
netgear_switch/cli/format.py,sha256=_ti_vjrryKwIm5C0ajkUFhY5Q9YApbF5DXOqmV1nyiU,5615
|
|
20
|
+
netgear_switch/cli/main.py,sha256=zhAemwJFMVd4wz7XVqD2IT3KaQeRwiYQMwkzHU8InfM,15570
|
|
21
|
+
netgear_switch/cli/resolve.py,sha256=3wlrhZeKkh-dfppVC_ZCspk4nziLDTVTj0aeehZhEEk,3720
|
|
22
|
+
netgear_switch/cli/safety.py,sha256=xM9aNyB4_O0k0PSPkMcC49cum5S-B9XZuxBQfsdPhyk,2250
|
|
23
|
+
netgear_switch/protocols/__init__.py,sha256=gWdi-aLLU-zDi7XAIoIjrdvHn4bQBlZDGmZy2b6nysk,44
|
|
24
|
+
netgear_switch/protocols/http/__init__.py,sha256=n_iSvNTdSqeEE8U2hbk5SYSNXrWHDYzlqok89FVnK10,85
|
|
25
|
+
netgear_switch/protocols/http/crypt.py,sha256=qk-GxQT1VOxMi8_yQlRNs_dlsmz-SK3ugHzPv0sxTow,975
|
|
26
|
+
netgear_switch/protocols/http/endpoints.py,sha256=sEQlHDwGf66zw_v6d4t53CGn60-Wz3vAYK852t1P91g,5930
|
|
27
|
+
netgear_switch/protocols/http/forms.py,sha256=vCn2bVYCmDeNSpq23e1da1WvpNIT_wg8VFKKbzO2FxA,2181
|
|
28
|
+
netgear_switch/protocols/http/parse.py,sha256=Esw8g2Lh7Gp-8MPYkExJGx7aEZD_GLfd9AYvywuEVJw,8680
|
|
29
|
+
netgear_switch/protocols/http/session.py,sha256=foum8g9g2JlNK7zuScmymAC4ZbjBX3HH-WrL5n0OucE,886
|
|
30
|
+
netgear_switch/protocols/nsdp/__init__.py,sha256=htINZIBvlsJ-IbE-rkYotSH8grKcm9FMisqpz7qGsug,320
|
|
31
|
+
netgear_switch/protocols/nsdp/auth.py,sha256=BVtX_SiLS3HqOCa1UkG1FBUZDsil6J9k-CVhOpY409Y,1584
|
|
32
|
+
netgear_switch/protocols/nsdp/client.py,sha256=DVYHHgu5x7X41XEoQDt0BbqvIkkpslefZm6Kkh_y3rk,2306
|
|
33
|
+
netgear_switch/protocols/nsdp/parsers.py,sha256=2aa-BG4F8Yn-wOIJWspic8NzVKQx-aWwXlEEzLKFByI,7746
|
|
34
|
+
netgear_switch/protocols/nsdp/protocol.py,sha256=h_8spZ2UzMHz6lMu9ZPt_39oRy22-YP-wdNISOt2Zwc,5810
|
|
35
|
+
netgear_switch/protocols/nsdp/types.py,sha256=_79JO3e_qsK8FuqJfzCZHZyrsjedR_HkUJuUps8LAxo,3808
|
|
36
|
+
netgear_switch/protocols/nsdp/write.py,sha256=PQKjXW1wjAeuYgiBZZJtO-PyNSTW7rpoUUoZ9GY_WIQ,3393
|
|
37
|
+
netgear_switch/protocols/snmp/__init__.py,sha256=gWdi-aLLU-zDi7XAIoIjrdvHn4bQBlZDGmZy2b6nysk,44
|
|
38
|
+
netgear_switch/protocols/snmp/client.py,sha256=OpzEYrradFRuD8prIRPMspT01I5PsEaz1gbvZV7UkFM,2911
|
|
39
|
+
netgear_switch/protocols/snmp/oids.py,sha256=d80P7HWcFLZFbHdziDh3x_qjjC0JF3c-WofF7TwGuYQ,5052
|
|
40
|
+
netgear_switch/protocols/snmp/parse.py,sha256=8WpuFJsU9acDDE1TE5hyvxTpaKVT756vZ966P3NOyO8,30385
|
|
41
|
+
netgear_switch/protocols/snmp/write.py,sha256=s0PznqKzRJdQJxYPo-l8qYFXnx0r3gIMofL0x-mS9SU,4089
|
|
42
|
+
netgear_switch/transport/__init__.py,sha256=h_kjWqAcadW0Tvwdp930BACZO7-fwKVFlJ68yOLINQo,80
|
|
43
|
+
netgear_switch/transport/aio/__init__.py,sha256=bC64jAmHQpa5q1UUK84ANaZ5h3d-Sg7v0B3SGcc6fqI,51
|
|
44
|
+
netgear_switch/transport/aio/nsdp_udp.py,sha256=15c_AgldBeGZHzSQOFbwF-SA5ZNi9bFtRPs9b0hFknQ,5501
|
|
45
|
+
netgear_switch/transport/aio/snmp_pysnmp.py,sha256=mZphRZxRU65K4BAmwcCD5tcoEwWVY6BgDNhZznOABDE,9593
|
|
46
|
+
netgear_switch/transport/http/__init__.py,sha256=G9MgKTbGX7pgb0boNO1TIxqGTmXLlhofkm8CWwGSVxA,57
|
|
47
|
+
netgear_switch/transport/http/client.py,sha256=xwTNemyz1JU7eC8pEHQwmIIIw5Ilo1K9ARuUwoDxfSw,7757
|
|
48
|
+
netgear_switch/transport/sync/__init__.py,sha256=RF_zqpgYttAnAoU-GFDlbJt7qcAwvUerpjfoCFTQ6lI,50
|
|
49
|
+
netgear_switch/transport/sync/nsdp_udp.py,sha256=clQ7jVYnLvvz2lZH8E8gWuk1zTW9NGA0qsFLfjam1Qg,4155
|
|
50
|
+
netgear_switch/transport/sync/snmp_netsnmp_cli.py,sha256=hzzw9mIQncf6KA_qzq5104hEwCHUWBuPtZqieF8VyJw,8506
|
|
51
|
+
netgear_switch/virtual/__init__.py,sha256=IXTaG7OFlGSo3cEvUXil0Mw9DFX6TJmoMGobjxTby3M,414
|
|
52
|
+
netgear_switch/virtual/seed.py,sha256=ebhDgDWORAkp9-61j_agZNfJvTtJf-jnh1vnm1KkgX4,7797
|
|
53
|
+
netgear_switch/virtual/server.py,sha256=vbehgvPMvym1GsMcRkOMsn2rFMoZm0UBQfzVjRvnmGU,4080
|
|
54
|
+
netgear_switch/virtual/state.py,sha256=pAQOV-9Fr02gCazC0RX690ewqd6mMQKeYsEzl_o-YdE,26190
|
|
55
|
+
netgear_switch/virtual/web.py,sha256=QXIPM4cbztK7vx06cHi9ZeMrasi7-trKAdlCn6BZeMU,7322
|
|
56
|
+
netgear_switch/virtual/faces/__init__.py,sha256=V0p8ngLxDVoU_wUAijvSCdL5d87luAEn5vMFHK1HcPY,113
|
|
57
|
+
netgear_switch/virtual/faces/http.py,sha256=3qrwsgTOjFMa5s86WldAlJyPtsXDw7O-F3JNuEPgi4s,6635
|
|
58
|
+
netgear_switch/virtual/faces/mibview.py,sha256=9u5HmhcB0LRx0TpRGQFsznwTG35ixfkPAlfrYKLbEYI,3649
|
|
59
|
+
netgear_switch/virtual/faces/nsdp.py,sha256=8HRgtuN-ZP6d7NCUBBFWSfUXzVyy3Mp_ZKQY_k_aLWY,4852
|
|
60
|
+
netgear_switch/virtual/faces/snmp.py,sha256=7pG2uqS0dNgrx7NoFlnkk0N7FifYy_oAUpVp-XQ7Hq0,18868
|
|
61
|
+
netgear_switch/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
62
|
+
python_netgear_switch_library-0.0.post154.dist-info/METADATA,sha256=baS89PsTjhS4pAhPQ4OeYY-0m9C7_7QKfzcggaX7q5E,2632
|
|
63
|
+
python_netgear_switch_library-0.0.post154.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
|
|
64
|
+
python_netgear_switch_library-0.0.post154.dist-info/entry_points.txt,sha256=KitXCMlj9PfTY7hNMbXY8nf_yFbMX9-hwLcfX6tr1aU,54
|
|
65
|
+
python_netgear_switch_library-0.0.post154.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
66
|
+
python_netgear_switch_library-0.0.post154.dist-info/RECORD,,
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|