ns2 0.2.6__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.
- ns2/__init__.py +0 -0
- ns2/core.py +0 -0
- ns2/dbus/__init__.py +0 -0
- ns2/dbus/dbus.py +13 -0
- ns2/lib/__init__.py +0 -0
- ns2/lib/accounts.py +130 -0
- ns2/lib/commands.py +32 -0
- ns2/lib/firewalld.py +167 -0
- ns2/lib/introspection/org.fedoraproject.FirewallD1.config.xml +3 -0
- ns2/lib/introspection/org.fedoraproject.FirewallD1.xml +763 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.AccessPoint.xml +106 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.AgentManager.xml +43 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Checkpoint.xml +36 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Connection.Active.xml +185 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.DHCP4Config.xml +21 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.DHCP6Config.xml +20 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Adsl.xml +21 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Bluetooth.xml +36 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Bond.xml +40 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Bridge.xml +41 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Dummy.xml +20 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Generic.xml +27 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Hsr.xml +51 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.IPTunnel.xml +107 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Infiniband.xml +31 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Ipvlan.xml +38 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Loopback.xml +8 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Lowpan.xml +27 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Macsec.xml +109 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Macvlan.xml +39 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Modem.xml +62 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.OlpcMesh.xml +34 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.OvsBridge.xml +21 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.OvsInterface.xml +11 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.OvsPort.xml +21 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Ppp.xml +11 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Statistics.xml +35 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Team.xml +48 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Tun.xml +65 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Veth.xml +18 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Vlan.xml +45 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Vrf.xml +18 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Vxlan.xml +139 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.WiMax.xml +109 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.WifiP2P.xml +76 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.WireGuard.xml +38 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Wired.xml +53 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Wireless.xml +131 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.Wpan.xml +20 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Device.xml +407 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.DnsManager.xml +40 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.IP4Config.xml +125 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.IP6Config.xml +95 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.PPP.xml +34 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.SecretAgent.xml +94 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Settings.Connection.xml +224 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.Settings.xml +233 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.VPN.Connection.xml +42 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.VPN.Plugin.xml +204 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.WiMax.Nsp.xml +35 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.WifiP2PPeer.xml +91 -0
- ns2/lib/introspection/org.freedesktop.NetworkManager.xml +598 -0
- ns2/lib/lib.py +0 -0
- ns2/lib/network_delay.py +92 -0
- ns2/lib/networking.py +528 -0
- ns2/lib/ntl.py +188 -0
- ns2/lib/pam_client.py +37 -0
- ns2/lib/ping_data_collector.py +37 -0
- ns2/lib/snmp.py +511 -0
- ns2/lib/socket.py +132 -0
- ns2/lib/socket_client.py +62 -0
- ns2/lib/systemd.py +151 -0
- ns2/lib/test.py +374 -0
- ns2/lib/udp_client.py +227 -0
- ns2/lib/udp_server.py +167 -0
- ns2/snmp/__init__.py +0 -0
- ns2/snmp/ns_dbus_service.py +38 -0
- ns2/snmp/pam_interface.py +19 -0
- ns2/snmp/snmp_interface.py +66 -0
- ns2/ui/__init__.py +0 -0
- ns2/ui/assets/NOVUS_LOGO.svg +105 -0
- ns2/ui/assets/favicon.png +0 -0
- ns2/ui/firewalld_page.py +375 -0
- ns2/ui/fpga_page.py +24 -0
- ns2/ui/login.py +65 -0
- ns2/ui/main.py +200 -0
- ns2/ui/networking_page.py +406 -0
- ns2/ui/ntp.py +105 -0
- ns2/ui/root.py +31 -0
- ns2/ui/snmp_page.py +353 -0
- ns2/ui/terminal.py +65 -0
- ns2/ui/tests_page.py +116 -0
- ns2/ui/theme.py +25 -0
- ns2/utils.py +5 -0
- ns2-0.2.6.dist-info/METADATA +78 -0
- ns2-0.2.6.dist-info/RECORD +98 -0
- ns2-0.2.6.dist-info/WHEEL +4 -0
- ns2-0.2.6.dist-info/entry_points.txt +3 -0
ns2/lib/ntl.py
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
|
|
2
|
+
CONFSLAVECORETYPE = 1
|
|
3
|
+
CLKCLOCKCORETYPE = 2
|
|
4
|
+
CLKSIGNALGENERATORCORETYPE = 3
|
|
5
|
+
CLKSIGNALTIMESTAMPERCORETYPE = 4
|
|
6
|
+
IRIGSLAVECORETYPE = 5
|
|
7
|
+
IRIGMASTERCORETYPE = 6
|
|
8
|
+
PPSSLAVECORETYPE = 7
|
|
9
|
+
PPSMASTERCORETYPE = 8
|
|
10
|
+
PTPORDINARYCLOCKCORETYPE = 9
|
|
11
|
+
PTPTRANSPARENTCLOCKCORETYPE = 10
|
|
12
|
+
PTPHYBRIDCLOCKCORETYPE = 11
|
|
13
|
+
REDHSRPRPCORETYPE = 12
|
|
14
|
+
RTCSLAVECORETYPE = 13
|
|
15
|
+
RTCMASTERCORETYPE = 14
|
|
16
|
+
TODSLAVECORETYPE = 15
|
|
17
|
+
TODMASTERCORETYPE = 16
|
|
18
|
+
TAPSLAVECORETYPE = 17
|
|
19
|
+
DCFSLAVECORETYPE = 18
|
|
20
|
+
DCFMASTERCORETYPE = 19
|
|
21
|
+
REDTSNCORETYPE = 20
|
|
22
|
+
TSNIICCORETYPE = 21
|
|
23
|
+
NTPSERVERCORETYPE = 22
|
|
24
|
+
NTPCLIENTCORETYPE = 23
|
|
25
|
+
CLKFREQUENCYGENERATORCORETYPE = 25
|
|
26
|
+
SYNCENODECORETYPE = 26
|
|
27
|
+
PPSCLKTOPPSCORETYPE = 27
|
|
28
|
+
PTPSERVERCORETYPE = 28
|
|
29
|
+
PTPCLIENTCORETYPE = 29
|
|
30
|
+
|
|
31
|
+
ClkClockProperties = {
|
|
32
|
+
"version": 0,
|
|
33
|
+
"status": 1,
|
|
34
|
+
"seconds": 2,
|
|
35
|
+
"nanoseconds": 3,
|
|
36
|
+
"insync": 4,
|
|
37
|
+
"inholdover": 5,
|
|
38
|
+
"insyncthreshold": 6,
|
|
39
|
+
"source": 7,
|
|
40
|
+
"drift": 8,
|
|
41
|
+
"driftinterval": 9,
|
|
42
|
+
"offset": 10,
|
|
43
|
+
"offsetinterval": 11,
|
|
44
|
+
"correctedoffset": 12,
|
|
45
|
+
"correcteddrift": 13,
|
|
46
|
+
"date": 14,
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
NtpServerProperties = {
|
|
52
|
+
|
|
53
|
+
"version": 0,
|
|
54
|
+
"status": 1,
|
|
55
|
+
"ipmode": 2,
|
|
56
|
+
"ipaddress": 3,
|
|
57
|
+
"macaddress": 4,
|
|
58
|
+
"vlanstatus": 5,
|
|
59
|
+
"vlanaddress": 6,
|
|
60
|
+
"unicastmode": 7,
|
|
61
|
+
"multicastmode": 8,
|
|
62
|
+
"broadcastmode": 9,
|
|
63
|
+
"precisionvalue": 10,
|
|
64
|
+
"pollintervalvalue": 11,
|
|
65
|
+
"stratumvalue": 12,
|
|
66
|
+
"referenceid": 13,
|
|
67
|
+
"smearingstatus": 14,
|
|
68
|
+
"leap61inprogress": 15,
|
|
69
|
+
"leap59inprogress": 16,
|
|
70
|
+
"leap61status": 17,
|
|
71
|
+
"leap59status": 18,
|
|
72
|
+
"utcoffsetstatus": 19,
|
|
73
|
+
"utcoffsetvalue": 20,
|
|
74
|
+
"requestsvalue": 21,
|
|
75
|
+
"responsesvalue": 22,
|
|
76
|
+
"requestsdroppedvalue": 23,
|
|
77
|
+
"broadcastsvalue": 24,
|
|
78
|
+
"clearcountersstatus": 25,
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
PpsSlaveProperties = {
|
|
84
|
+
"version": 0,
|
|
85
|
+
"enablestatus": 1,
|
|
86
|
+
"polarity": 2,
|
|
87
|
+
"inputokstatus": 3,
|
|
88
|
+
"pulsewidthvalue": 4,
|
|
89
|
+
"cabledelayvalue": 5,
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
PtpOcProperties = {
|
|
95
|
+
"version": 0,
|
|
96
|
+
"vlanaddress": 1,
|
|
97
|
+
"vlanstatus": 2,
|
|
98
|
+
"profile": 3,
|
|
99
|
+
"layer": 4,
|
|
100
|
+
"delaymechanismvalue": 5,
|
|
101
|
+
"ipaddress": 6,
|
|
102
|
+
"status": 7,
|
|
103
|
+
"defaultdsclockid": 8,
|
|
104
|
+
"defaultdsdomain": 9,
|
|
105
|
+
"defaultdspriority1": 10,
|
|
106
|
+
"defaultdspriority2": 11,
|
|
107
|
+
"defaultdsaccuracy": 12,
|
|
108
|
+
"defaultdsclass": 13,
|
|
109
|
+
"defaultdsvariance": 14,
|
|
110
|
+
"defaultdsshortid": 15,
|
|
111
|
+
"defaultdsinaccuracy": 16,
|
|
112
|
+
"defaultdsnumberofports": 17,
|
|
113
|
+
"defaultdstwostepstatus": 18,
|
|
114
|
+
"defaultdssignalingstatus": 19,
|
|
115
|
+
"defaultdsmasteronlystatus": 20,
|
|
116
|
+
"defaultdsslaveonlystatus": 21,
|
|
117
|
+
"defaultdslistedunicastslavesonlystatus": 22,
|
|
118
|
+
"defaultdsdisableoffsetcorrectionstatus": 23,
|
|
119
|
+
"portdspeerdelayvalue": 24,
|
|
120
|
+
"portdsstate": 25,
|
|
121
|
+
"portdsasymmetryvalue": 26,
|
|
122
|
+
"portdsmaxpeerdelayvalue": 27,
|
|
123
|
+
"portdspdelayreqlogmsgintervalvalue": 28,
|
|
124
|
+
"portdsdelayreqlogmsgintervalvalue": 29,
|
|
125
|
+
"portdsdelayreceipttimeoutvalue": 30,
|
|
126
|
+
"portdsannouncelogmsgintervalvalue": 31,
|
|
127
|
+
"portdsannouncereceipttimeoutvalue": 32,
|
|
128
|
+
"portdssynclogmsgintervalvalue": 33,
|
|
129
|
+
"portdssyncreceipttimeoutvalue": 34,
|
|
130
|
+
"currentdsstepsremovedvalue": 35,
|
|
131
|
+
"currentdsoffsetvalue": 36,
|
|
132
|
+
"currentdsdelayvalue": 37,
|
|
133
|
+
"parentdsparentclockidvalue": 38,
|
|
134
|
+
"parentdsgmclockidvalue": 39,
|
|
135
|
+
"parentdsgmpriority1value": 40,
|
|
136
|
+
"parentdsgmpriority2value": 41,
|
|
137
|
+
"parentdsgmvariancevalue": 42,
|
|
138
|
+
"parentdsgmaccuracyvalue": 43,
|
|
139
|
+
"parentdsgmclassvalue": 44,
|
|
140
|
+
"parentdsgmshortidvalue": 45,
|
|
141
|
+
"parentdsgminaccuracyvalue": 46,
|
|
142
|
+
"parentdsnwinaccuracyvalue": 47,
|
|
143
|
+
"timepropertiesdstimesourcevalue": 48,
|
|
144
|
+
"timepropertiesdsptptimescalestatus": 49,
|
|
145
|
+
"timepropertiesdsfreqtraceablestatus": 50,
|
|
146
|
+
"timepropertiesdstimetraceablestatus": 51,
|
|
147
|
+
"timepropertiesdsleap61status": 52,
|
|
148
|
+
"timepropertiesdsleap59status": 53,
|
|
149
|
+
"timepropertiesdsutcoffsetvalstatus": 54,
|
|
150
|
+
"timepropertiesdsutcoffsetvalue": 55,
|
|
151
|
+
"timepropertiesdscurrentoffsetvalue": 56,
|
|
152
|
+
"timepropertiesdsjumpsecondsvalue": 57,
|
|
153
|
+
"timepropertiesdsnextjumpvalue": 58,
|
|
154
|
+
"timepropertiesdsdisplaynamevalue": 59,
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
TodSlaveProperties = {
|
|
160
|
+
"version": 0,
|
|
161
|
+
"protocol": 1,
|
|
162
|
+
"gnss": 2,
|
|
163
|
+
"msgdisable": 3,
|
|
164
|
+
"correction": 4,
|
|
165
|
+
"baudrate": 5,
|
|
166
|
+
"invertedpolarity": 6,
|
|
167
|
+
"utcoffset": 7,
|
|
168
|
+
"utcinfovalid": 8,
|
|
169
|
+
"leapannounce": 9,
|
|
170
|
+
"leap59": 10,
|
|
171
|
+
"leap61": 11,
|
|
172
|
+
"leapinfovalid": 12,
|
|
173
|
+
"timetoleap": 13,
|
|
174
|
+
"gnssfix": 14,
|
|
175
|
+
"gnssfixok": 15,
|
|
176
|
+
"spoofingstate": 16,
|
|
177
|
+
"fixandspoofinginfovalid": 17,
|
|
178
|
+
"jamminglevel": 18,
|
|
179
|
+
"jammingstate": 19,
|
|
180
|
+
"antennastate": 20,
|
|
181
|
+
"antennaandjamminginfovalid": 21,
|
|
182
|
+
"nrofsatellitesseen": 22,
|
|
183
|
+
"nrofsatelliteslocked": 23,
|
|
184
|
+
"nrofsatellitesinfo": 24,
|
|
185
|
+
"enable": 25,
|
|
186
|
+
"inputok": 26,
|
|
187
|
+
}
|
|
188
|
+
|
ns2/lib/pam_client.py
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
from dbus_next.aio import MessageBus
|
|
2
|
+
|
|
3
|
+
import asyncio
|
|
4
|
+
|
|
5
|
+
loop = asyncio.get_event_loop()
|
|
6
|
+
from dbus_next.constants import BusType
|
|
7
|
+
|
|
8
|
+
async def main():
|
|
9
|
+
bus = await MessageBus(bus_type=BusType.SYSTEM).connect()
|
|
10
|
+
# the introspection xml would normally be included in your project, but
|
|
11
|
+
# this is convenient for development
|
|
12
|
+
introspection = await bus.introspect('com.novus.ns', '/com/novus/ns')
|
|
13
|
+
|
|
14
|
+
obj = bus.get_proxy_object('com.novus.ns', '/com/novus/ns', introspection)
|
|
15
|
+
interface = obj.get_interface('com.novus.ns.pam')
|
|
16
|
+
#properties = obj.get_interface('org.freedesktop.DBus.Properties')
|
|
17
|
+
|
|
18
|
+
user = input("username?: ")
|
|
19
|
+
password = input("password?: ")
|
|
20
|
+
## call methods on the interface (this causes the media player to play)
|
|
21
|
+
resp = await interface.call_authenticate(user, password)
|
|
22
|
+
print(resp)
|
|
23
|
+
#volume = await player.get_volume()
|
|
24
|
+
#print(f'current volume: {volume}, setting to 0.5')
|
|
25
|
+
#
|
|
26
|
+
#await player.set_volume(0.5)
|
|
27
|
+
#
|
|
28
|
+
## listen to signals
|
|
29
|
+
#def on_properties_changed(interface_name, changed_properties, invalidated_properties):
|
|
30
|
+
# for changed, variant in changed_properties.items():
|
|
31
|
+
# print(f'property changed: {changed} - {variant.value}')
|
|
32
|
+
#
|
|
33
|
+
#properties.on_properties_changed(on_properties_changed)
|
|
34
|
+
|
|
35
|
+
await loop.create_future()
|
|
36
|
+
|
|
37
|
+
loop.run_until_complete(main())
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
import os
|
|
3
|
+
import time
|
|
4
|
+
from icmplib import ping
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
async def ping_it():
|
|
8
|
+
|
|
9
|
+
while True:
|
|
10
|
+
|
|
11
|
+
yield ping('8.8.8.8', count=10)
|
|
12
|
+
|
|
13
|
+
await asyncio.sleep(0)
|
|
14
|
+
|
|
15
|
+
async def main():
|
|
16
|
+
global path
|
|
17
|
+
|
|
18
|
+
async for host in ping_it():
|
|
19
|
+
print(host)
|
|
20
|
+
if host.is_alive:
|
|
21
|
+
print(host.jitter)
|
|
22
|
+
with open(path, 'a') as f:
|
|
23
|
+
f.write(f"{time.time()},{host.rtts[0]}\r\n")
|
|
24
|
+
f.close()
|
|
25
|
+
|
|
26
|
+
if __name__ == "__main__":
|
|
27
|
+
global path
|
|
28
|
+
try:
|
|
29
|
+
path = os.path.join("network_delay_data",str(time.time()).replace(".","_")+".csv")
|
|
30
|
+
|
|
31
|
+
with open(path, 'x') as f:
|
|
32
|
+
f.write(f"ts, rtt\r\n")
|
|
33
|
+
f.close()
|
|
34
|
+
|
|
35
|
+
asyncio.run(main())
|
|
36
|
+
except asyncio.CancelledError:
|
|
37
|
+
print("Main completed and tasks cancelled.")
|