Compare commits

..

2364 commits

Author SHA1 Message Date
3f2db35e68
updated to 9.0.3 merge 2023-09-21 18:59:32 +01:00
56a0511f21
updated to 9.0.3 2023-09-21 18:54:08 +01:00
bharnden
20071eed2e
Merge pull request #808 from coreemu/develop
fix issues with updated documentation
2023-08-01 10:18:11 -07:00
Blake Harnden
62a09c7570 docs: added github repo to documentation, fixed url paths for images in tutorials 2023-08-01 10:02:31 -07:00
bharnden
c37fa33ffe
Merge pull request #807 from coreemu/develop
CORE 9.0.3
2023-08-01 09:37:38 -07:00
Blake Harnden
7060a6842f bumped versions for release and updated changelog 2023-08-01 09:12:17 -07:00
bharnden
8da068159f
Merge pull request #805 from schrc3b6/develop
Fix templating error in radvd.conf
2023-08-01 08:43:50 -07:00
Blake Harnden
e3715e188c daemon: adjusted cmd utilities to support running different sets of commands for each node 2023-07-31 11:08:05 -07:00
schrc3b6
722fbde7d0 Fix templating error in radvd.conf
When configuring radvd service an undefined object error is thrown.
The data function in RadvdService returns a dict with ifaces. The radvd
template however, expects a dict with a values key.

I changed the key in the template because "ifaces" is way more descriptive
than "values".

Original Error that is fixed:
Traceback (most recent call last):
  File "/opt/core/venv/lib/python3.9/site-packages/core/configservice/base.py", line 471, in render_template
    return self._render(template, data)
  File "/opt/core/venv/lib/python3.9/site-packages/core/configservice/base.py", line 439, in _render
    return template.render_unicode(
  File "/opt/core/venv/lib/python3.9/site-packages/mako/template.py", line 444, in render_unicode
    return runtime._render(
  File "/opt/core/venv/lib/python3.9/site-packages/mako/runtime.py", line 874, in _render
    _render_context(
  File "/opt/core/venv/lib/python3.9/site-packages/mako/runtime.py", line 916, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/opt/core/venv/lib/python3.9/site-packages/mako/runtime.py", line 943, in _exec_template
    callable_(context, *args, **kwargs)
  File "/opt/core/venv/lib/python3.9/site-packages/core/configservices/utilservices/templates/etc/radvd/radvd.conf", line 2, in render_body
    % for ifname, prefixes in values:
TypeError: 'Undefined' object is not iterable
2023-07-28 16:03:49 +02:00
Blake Harnden
2cb8ec2fb2 install: updates to centos dockerfiles 2023-07-25 16:00:59 -07:00
Blake Harnden
544ad9b638 install: updated dockerfile for repo based ubuntu install 2023-07-25 11:12:24 -07:00
Blake Harnden
648f5425b5 install: update pyyaml to 6.0.1 2023-07-25 10:53:08 -07:00
Blake Harnden
359f6940e1 install: fixed issue with dual pyyaml reqs 2023-07-25 10:40:30 -07:00
Blake Harnden
2547c61a7c install: update pyyaml to 5.4.1 2023-07-25 10:35:47 -07:00
Blake Harnden
f8f3f8169c docs: adjustment to install for docker 2023-07-25 10:17:53 -07:00
Blake Harnden
12c07e0175 services: fixed pcap service not properly backgrounding command to avoid blocking 2023-07-15 10:27:41 -07:00
Blake Harnden
d63aa03343 build: updated grpcio dependency versions to fix grpcio vulnerabilities 2023-07-07 08:57:45 -07:00
Blake Harnden
db89fbf066 updated and fixed formatting with proper version of python black 2023-06-13 21:49:50 -07:00
Blake Harnden
a80796ac72 daemon: added initial podman node support 2023-06-13 17:00:53 -07:00
Blake Harnden
c76bc2ee8a daemon: updates for docker nodes to read and use the environ file for the launched process for all nsenter commands 2023-06-12 16:30:02 -07:00
Blake Harnden
e60b0f0de1 daemon: fixed issue bringing back addresses with no broadcast on rj45 nodes 2023-06-12 10:00:38 -07:00
Blake Harnden
e0e4b05b7f gui/grpc: updated GetConfigServiceDefaults to require a session and node id, this will allow retrieving data with the context of the associated node 2023-06-08 20:40:49 -07:00
Blake Harnden
41e473eefc docs: updated gui docs to include notes on running commands within nodes and using xhost for gui applications 2023-06-08 15:42:50 -07:00
Blake Harnden
12d7a1ff2a gui: fixed issue allowing duplicate named hook scripts 2023-06-08 14:59:40 -07:00
Blake Harnden
cbc35b74f8 docs: updated formatting on tutorial files 2023-06-08 14:43:02 -07:00
Blake Harnden
81230edac3 daemon: updated utils.cmd to use returncode instead of wait(), removed redundant default encoding value for calls to decode/encode 2023-06-08 14:34:24 -07:00
Blake Harnden
94f070e0ff cleanup: fixed issue cleaning up device names with @ in them 2023-06-08 11:36:09 -07:00
Blake Harnden
d04f8d69d2 docs: adding tutorial 2 and 3 2023-06-07 17:48:49 -07:00
Blake Harnden
0339073868 docs: added tutorial 5 2023-06-06 15:06:41 -07:00
Blake Harnden
9d88eba1f5 docs: added tutorials overview and tutorial 6 2023-06-06 09:40:44 -07:00
Blake Harnden
0b1a44e9b2 docs: cleanup tutorial scripts 2023-06-05 14:22:08 -07:00
Blake Harnden
2176fcc5a3 docs: adding tutorial 7 2023-06-05 13:57:06 -07:00
Blake Harnden
c554983436 docs: adding tutorial 4 2023-06-05 13:27:34 -07:00
Blake Harnden
75a92f3a38 docs: adjustments for tutorial 1 to working order 2023-06-05 13:07:59 -07:00
Blake J. Harnden
580916f2f0 docs: adding tutorial 1 images 2023-06-05 11:26:14 -07:00
Blake J. Harnden
a5727e3355 docs: adding tutorial 1 2023-06-05 11:11:00 -07:00
Blake Harnden
01585b6ec5 docs: fixed example emane model code to properly load platform config 2023-05-01 08:40:48 -07:00
Blake Harnden
d2008b1e5a docs: improved navigation, fixed type for warning in emane/gpsd 2023-04-20 12:01:39 -07:00
Blake Harnden
374ddb677c github: fixed branch name 2023-04-18 12:21:36 -07:00
Blake Harnden
8281382bd6 github: adding workflow for generating documentation on push to master 2023-04-18 12:21:13 -07:00
bharnden
946d161c11
Merge pull request #787 from coreemu/enhancement/documentation
Enhancement/documentation
2023-04-18 12:12:57 -07:00
Blake Harnden
fac8cfae08 daemon: fixed issue with session data collect transition not properly stopping config services 2023-04-15 00:25:41 -07:00
Blake Harnden
4a02d4bed9 gui: improve type hinting for ShowVar.state() 2023-04-13 21:48:39 -07:00
Blake Harnden
18ac8d5620 daemon: updated formatting for frr changes 2023-04-13 21:25:49 -07:00
Blake Harnden
d9f2ca8491 Merge branch 'gsomlo-gls-frr-sbin-fedora' into develop 2023-04-13 21:21:12 -07:00
Blake Harnden
49049befc8 Merge branch 'gls-frr-sbin-fedora' of https://github.com/gsomlo/core into gsomlo-gls-frr-sbin-fedora 2023-04-13 21:20:35 -07:00
bharnden
32bcd0a345
Merge pull request #774 from laerling/develop
Fix pcap service: Missing parameter
2023-04-13 21:09:34 -07:00
Blake Harnden
899800b925 daemon/gui: coverted remaining usages of old string formatting to f strings 2023-04-13 16:43:09 -07:00
Blake Harnden
4dba1bbe32 gui: updated usage of .format to f strings and small code cleanup for colorpicker 2023-04-13 16:30:35 -07:00
Blake Harnden
e7351b594d gui: updated core.gui to not use deprecated type hinting 2023-04-13 15:53:16 -07:00
Blake Harnden
69f05a6712 daemon: updated top level core modules from using deprecated type hinting 2023-04-13 15:48:02 -07:00
Blake Harnden
921bfdf527 daemon: updated core.services to avoid using deprecated type hinting, also updated string formatting to f strings 2023-04-13 15:39:40 -07:00
Blake Harnden
7f58224f43 daemon: updated core.nodes to avoid using deprecated type hinting 2023-04-13 13:32:23 -07:00
Blake Harnden
f9505b3173 daemon: updated core.scripts and core.xml to avoid using deprecated type hinting 2023-04-13 13:27:22 -07:00
Blake Harnden
7ea950f8ec daemon: updated core.location and core.plugins to avoid using deprecated type hinting 2023-04-13 12:29:16 -07:00
Blake Harnden
8abf2561bf daemon: updated core.emulator to avoid using deprecated type hinting 2023-04-13 12:23:44 -07:00
Blake Harnden
4c222d1a7a daemon: updated core.emane to avoid using deprecated type hinting 2023-04-13 12:18:24 -07:00
Blake Harnden
3d722a7721 daemon: updating core.configservice and core.configservices to avoid deprecated type hinting 2023-04-13 11:58:58 -07:00
Blake Harnden
e770bcd47c daemon: update deprecated typing for core.api 2023-04-13 11:22:37 -07:00
Blake Harnden
6ff2abf0b8 daemon: fixed issue for CoreError messages in new hooks module, updated new modules to all use non deprecated type hinting 2023-04-12 16:53:08 -07:00
Blake Harnden
da3cebe1cd daemon: added refactored cleaned up logic for future handling of broadcasting data 2023-04-12 16:14:58 -07:00
Blake Harnden
b6b300207b daemon: added convenience method to check if a session is running, which is used in multiple places, providing a cleaner and easier to read experience 2023-04-12 14:44:51 -07:00
Blake Harnden
cdc8c7360d daemon: added refactored cleaned up code to use for hooks 2023-04-12 11:58:25 -07:00
Blake Harnden
a6a09d9e56 daemon: added new cleaned up controlnet code, for future use 2023-04-11 12:45:50 -07:00
Blake Harnden
cafbb15b1e daemon: small cleanup in distributed start 2023-04-11 10:09:40 -07:00
Blake Harnden
c444304040 docs: fixed issue with bad imports in grpc doc examples 2023-04-10 11:19:46 -07:00
Blake Harnden
2eb29525de gui: fix issue deleting nodes/links attached to rj45 nodes 2023-04-10 08:13:01 -07:00
Blake Harnden
fcf1448ab6 docs: small documentation cleanup 2023-03-28 21:51:27 -07:00
Blake Harnden
15df06d834 docs: updates to reformat and adjust documentation in regards to using specific services 2023-03-28 21:47:27 -07:00
Blake Harnden
0053ddb57d docs: updates to leverage mkdocs material admonitions 2023-03-28 21:42:43 -07:00
Blake Harnden
03fe74c195 gui: fix issue when joining a session with an rj45 node and assigning an interface, whichw ill later cause an error when configuring the rj45 node 2023-03-28 12:37:25 -07:00
Blake Harnden
d52e0c4547 grpc: adjustment when starting a session to not update session options for empty values, since they may override values set in /etc/core/core.conf 2023-03-21 15:34:13 -07:00
laerling
b4ed8bc9c5 Fix pcap service: Mako dict parameter missing 2023-03-21 00:47:27 +01:00
Blake Harnden
5b41b4e5be docs: brought out hardware in the loop concepts to a higher level for easier visbility, rather than being hidden within the gui docs 2023-03-13 16:22:08 -07:00
Blake Harnden
59f814eac0 install: fixed bad indentation for local install line, causes an error not finding expected files 2023-03-09 10:49:11 -08:00
Blake Harnden
078e0df329 docs: initial changes to support using mkdocs material 2023-03-07 21:49:50 -08:00
Blake Harnden
785cf82ba3 docs: added complete install examples based on dockerfile commands 2023-03-07 10:46:31 -08:00
Blake Harnden
d09f777645 update centos dockerfile to avoid installing unwanted python system packages 2023-03-07 10:43:11 -08:00
Blake Harnden
f8d2b47fa9 install: updated Pillow dependency 2023-03-03 10:00:59 -08:00
bharnden
c44dc521fb
Merge pull request #767 from coreemu/develop
CORE 9.0.2
2023-03-02 22:12:35 -08:00
Blake Harnden
04e778e97f updated changelog for 9.0.2 release 2023-03-02 21:04:59 -08:00
Blake Harnden
d45eeb6d2e updated dockerfiles to run commands to save space optimally 2023-03-02 08:34:54 -08:00
Blake Harnden
fec400ac2e bumped versions for next release 2023-03-01 21:51:05 -08:00
Blake Harnden
c1ad39631d install: updated poetry.lock file to latest dependencies, also updated invoke to 1.7.3 to avoid python 3.10+ issues 2023-02-27 12:49:39 -08:00
Blake Harnden
b92e4ed6b9 install: fixed deprecated syntax when using poetry to install only the main packages 2023-02-27 11:08:51 -08:00
Blake Harnden
3e5c8c894f daemon: fixed issue for LXC nodes and not properly picking up configured image name to use and for writing to xml 2023-02-21 12:06:01 -08:00
Blake Harnden
f10c7cac45 docs: reformatted bird documentation and removed invalid example link 2023-02-06 09:22:00 -08:00
Blake Harnden
0ffcc10953 docs: add example for installing emane using downloaded protoc 2023-02-03 16:52:14 -08:00
Blake Harnden
4dca3eac39 docs: updated install page to remark on solutions for the common issue a user may run into when docker is installed 2023-02-03 16:45:47 -08:00
Blake Harnden
93272d6ed7 daemon: formatting changes related to updating the python black formatter 2023-02-03 15:53:44 -08:00
Blake Harnden
4c351b0d72 install: updated version of the python black library being used, updated poetry.lock in response to help correct issue with click 2023-02-03 15:46:52 -08:00
Blake Harnden
56a287c9c0 install: updated poetry.lock to correct poetry warning, also updates some transitive dependencies for the better 2023-02-03 15:34:16 -08:00
Blake Harnden
d4997bbc04 daemon: fixed p2p nodes to disable mac learning, with new usage to tie together all wired links, this feature is not desired 2023-02-03 15:05:03 -08:00
Blake Harnden
4f2e20a0a0 daemon: updated usage of sysctl to properly leverage utility function to correct device name 2023-02-01 08:40:23 -08:00
Blake Harnden
5abbc1680a daemon: improve node boot logging to display config and legacy services 2023-01-24 09:17:15 -08:00
Blake Harnden
c91facd6e3 daemon: fix to properly check for setting broadcast support 2023-01-24 08:28:25 -08:00
Blake Harnden
d215330426 docs: fix example for scripts ran from gui and how to optionally retrieve the coreemu instance 2023-01-19 16:13:00 -08:00
Blake Harnden
db2f57ca35 install: removed unused help option for build task 2022-12-20 16:11:05 -08:00
Blake Harnden
a3892d6b0e grpc: updated node events to leverage the common grpcutils.get_node_proto so that service and emane config data will be included 2022-12-09 10:56:30 -08:00
Blake Harnden
f422d05215 gui: fixed issue not displaying emane configs that are generally configured for a node, was attempting only interface specific or emane net fallback 2022-12-09 10:29:41 -08:00
Blake Harnden
9ccb1880a1 docs: removed usages of pygui 2022-12-09 10:22:12 -08:00
Blake Harnden
88a52f6cd2 grpc: fix node events to include the config services on a node, allows dynamically added nodes to show their services within the gui 2022-12-09 09:32:49 -08:00
Blake Harnden
a84e689478 updated emane demo example files provided by gui to align with latest changes 2022-12-05 10:54:34 -08:00
Blake Harnden
a787f46719 daemon: fixed issue when setting default wlan config for a wlan node, using the session id instead of the node id 2022-12-05 10:26:46 -08:00
Blake Harnden
b430de226d Merge branch 'develop' of https://github.com/coreemu/core into develop 2022-12-05 01:15:29 -08:00
Blake Harnden
e176a02460 docs: fixed documentation to point to the right files 2022-12-05 01:15:09 -08:00
Blake Harnden
e96322c9af docs: update install instruction for emane to denote passing PYTHON to the emane helper task 2022-11-30 10:47:17 -08:00
bharnden
ecf380c884
Merge pull request #718 from coreemu/develop
release 9.0.1
2022-11-28 14:11:55 -08:00
Blake Harnden
6c52029795 updated dockerfiles to align with protobuf changes 2022-11-28 14:02:46 -08:00
Blake Harnden
41b231b577 updated version and changelog for next release 2022-11-28 11:10:00 -08:00
Blake Harnden
f8a20f8dbb install: updated grpcio-tools in pyproject.toml to 1.49.1 to properly match automated install, also updated protobuf to 4.21.9 to fix issue with import 2022-11-28 10:17:44 -08:00
249cdf1dab
Added rust toolchain 2022-11-20 15:08:52 +00:00
bharnden
5ab71377cc
Merge pull request #712 from coreemu/develop
merge develop for 9.0.0 release
2022-11-18 14:46:29 -08:00
Blake Harnden
50bc4343c3 updated changelog for next release 2022-11-18 11:09:56 -08:00
Blake Harnden
c6898c7c0e examples: updated python switch example to show the need to use ids for switch/hub interfaces 2022-11-10 09:54:31 -08:00
Blake Harnden
568b1360a2 examples: fixed python emane example to leverage current internal api 2022-11-03 12:08:40 -07:00
Blake Harnden
898a4f7c84 gui: updated custom nodes to use config services and updated labels to reflect that 2022-10-14 21:40:40 -07:00
Blake Harnden
4c9c6e9f8c install: bumped grpcio versions to 1.49.1 2022-10-14 12:14:20 -07:00
Blake Harnden
8e2593c9e0 gui: fixed error related to finalizing linked nodes due to recent throughput correction 2022-10-14 10:57:00 -07:00
Blake Harnden
f43e8f7646 install: updated dockerfiles for installing using the script based method for centos/ubuntu 2022-10-14 10:42:31 -07:00
Blake Harnden
7067b54a00 install: update tasks.py to use current latest git commit for ospf mdr 2022-10-14 08:56:33 -07:00
Blake Harnden
9c71e0144c install: updated poetry version to install in setup.sh to 1.2.1 2022-10-14 08:43:12 -07:00
Blake Harnden
0e627afeb0 install: moved all dockerfiles to a specific directory and updated package files to account for recent changes and install ospf mdr and emane 2022-10-13 23:33:22 -07:00
Blake Harnden
82739ce3af install: updates to make python3.9 the minimum required version, updates to various dependencies to account for known vulnerabilities 2022-10-13 10:15:38 -07:00
Blake Harnden
47991cd35f updated workflow to use newer version 2022-10-12 21:35:22 -07:00
Blake Harnden
16b0decde7 install: corrected pytest update 2022-10-12 21:28:19 -07:00
Blake Harnden
d203b7d3ca install: updated pytest to working version 2022-10-12 21:15:22 -07:00
Blake Harnden
e0a21fb099 gui: improved throughputs start/stop to coincide with session start and stop based on a tracked variable 2022-10-12 20:53:59 -07:00
Blake Harnden
03775c2c3c daemon/grpc: shifted kill signal handling to grpc server who will handle complete shutdown, no longer done by CoreEmu directly 2022-10-12 14:34:24 -07:00
Blake Harnden
b5b7b8cdf9 grpc: updates to fix throughput parsing, accounting for new connection changes, now supports throughput for network to network links 2022-10-12 14:04:48 -07:00
Blake Harnden
9218fb0b6f docs: added notes about new wireless node type to GUI documentation 2022-10-12 08:48:23 -07:00
Blake Harnden
0d1fa0049a docs: update quickstart readme for installation covering new package option 2022-10-07 13:05:16 -07:00
Blake Harnden
c067de6792 docs: updates to install page to cover all install types and PATH issues 2022-10-07 12:52:53 -07:00
Blake Harnden
4b2d33c898 Merge branch 'develop' of https://github.com/coreemu/core into develop 2022-09-29 14:03:53 -07:00
Blake Harnden
ee2cdf7716 install: updated automated install to place virtual environment to /opt/core/venv to be consistent with new package location 2022-09-29 13:58:09 -07:00
afonsofrancof
6631fc95ed Added ftp 2022-09-28 22:15:15 +01:00
afonsofrancof
909142b446 Added ftp 2022-09-28 22:14:48 +01:00
e8f0ce79d5 Update 'README.md' 2022-09-28 21:24:35 +01:00
afonsofrancof
5013b53605 Added text editors 2022-09-28 21:17:34 +01:00
afonsofrancof
7e87ad24fa Added text editors 2022-09-28 21:17:16 +01:00
afonsofrancof
2f2dbe26d1 Added firefox dependencies 2022-09-28 21:19:20 +01:00
afonsofrancof
33e13e2381 Added firefox dependencies 2022-09-28 21:18:36 +01:00
2a7904e2f1 Update 'README.md' 2022-09-28 20:31:35 +01:00
47ae24ad59 Update 'README.md' 2022-09-28 20:11:24 +01:00
3b22c7038f Update 'README.md' 2022-09-28 20:10:49 +01:00
afonsofrancof
9c4a0fda32 Dependencies updated 2022-09-28 21:07:51 +01:00
Blake Harnden
78eb03cc65 install: updated option to skip system python packages for setup.sh to be more appropriately named 2022-09-14 22:43:33 -07:00
Blake Harnden
5a81283fca install: added option to skip python system packages for setup.sh 2022-09-14 21:03:24 -07:00
Blake Harnden
281a848bbf grpc: fixed documentation mistake in grpc server 2022-09-13 12:46:56 -07:00
Blake Harnden
e25d1c72b3 daemon: fixed bad config generation for bgp config service 2022-09-13 12:41:24 -07:00
Blake Harnden
88ccd1f194 gui: fixed issue updating preferences, resulting in nodes changing to a default icon 2022-09-10 10:06:40 -07:00
Blake Harnden
d045fc0d51 daemon: removed session state file, information should be available through grpc if needed 2022-09-09 14:22:30 -07:00
Blake Harnden
e56d93f0fe daemon: removed generation of the session nodes file, this information should be available through grpc 2022-08-31 17:03:31 -07:00
Blake Harnden
382ff6d49b docs: updated install doc to provide a better example for installing emane python bindings into a virtual environment 2022-08-30 12:25:34 -07:00
bharnden
5202b2fa04
Merge pull request #700 from coreemu/enhancement/opt-core
Enhancement/opt core
2022-08-30 12:08:28 -07:00
Blake Harnden
e4abefe23b grpc: added nem id and port to interface data returned from GetNode 2022-08-03 17:21:31 -07:00
Blake Harnden
018865b2a2 docs: added install note about upgrading pip to avoid building from source related issues 2022-08-02 13:49:38 -07:00
Blake Harnden
c91d8df790 install: added task using a subset of the previous auto install to support auto setup and building of core packages 2022-07-29 14:12:17 -07:00
Blake Harnden
a201fd2903 install: add option to avoid y/n prompt when uninstalling core during post install script 2022-07-29 14:03:45 -07:00
Blake Harnden
d06659ff82 install: remove debian config from centos package dockerfile 2022-07-29 12:03:20 -07:00
Blake Harnden
d8632da96b install: fixed install.md error for docker build command, fixed default dockerfile example for centos package install to not use NO_VENV 2022-07-27 16:41:23 -07:00
Blake Harnden
fcf6f30302 install: updates to support building deb/rpm packages that contain python wheels and install core from a single file, updates to core to install scripts by way of python directly 2022-07-27 16:00:10 -07:00
Blake Harnden
cd6bb319ad Merge branch 'develop' of https://github.com/coreemu/core into develop 2022-07-21 15:41:48 -07:00
Blake Harnden
d63722c0ed install: add option to avoid installing python system dependencies, in case the python version being used is from source 2022-07-21 15:35:31 -07:00
bharnden
273f68a1ec
Merge pull request #692 from coreemu/node-updates
Node updates
2022-06-29 11:55:45 -07:00
Blake Harnden
fe1593b51f update dockerfiles to fix default branch name in the oracle linux dockerfile and update pip in the centos dockerfile to get back to working order 2022-06-27 09:38:52 -07:00
Blake Harnden
3c28ea373a daemon: adjustments to fix terminal command string generation for docker/lxd nodes to account for being on a distributed server 2022-06-10 14:53:49 -07:00
Blake Harnden
9c69881aad daemon: updates to expose node.create_cmd and not be private, added utility functions for running multiple commands on multiple nodes more efficiently 2022-06-10 14:23:06 -07:00
Blake Harnden
60a48c7084 daemon: update node commands to make use of shlex.quote for shell=True commands 2022-06-10 12:12:25 -07:00
Blake Harnden
9c265ab283 daemon: updates to change hostname settings to replace _ to - due to _ being an invalid character 2022-06-10 10:01:48 -07:00
Blake Harnden
9991942e7b daemon: cleanup code for lxd based nodes and properly implement command exectution 2022-06-10 09:20:49 -07:00
Blake Harnden
469f8f087a grpc: removed removed api call from client code get_node_links, this information is included in get node 2022-06-08 14:17:13 -07:00
Blake Harnden
1aa9d4bccf examples: restore docker switch example to previous state 2022-06-08 14:06:54 -07:00
Blake Harnden
1d718aeda2 update configservice example file to a proper name 2022-06-08 14:00:20 -07:00
bharnden
bb49947550
Merge pull request #690 from coreemu/docker-updates
Docker updates
2022-06-08 13:57:06 -07:00
Blake Harnden
e5d6299f0a daemon: fixed error in requirements check and sorted executable definitions 2022-06-01 11:12:20 -07:00
Blake Harnden
9fa3e77d12 daemon: added further python docs to docker.py 2022-05-31 14:25:49 -07:00
Blake Harnden
f40de9f838 install: added dockerfile for oracle linux support 2022-05-27 20:54:47 -07:00
Blake Harnden
d77ed9c473 install: adjustments to install scripts to better support alternative versions of python, PYTHON_DEP added for system package adjustments 2022-05-27 20:10:48 -07:00
Blake Harnden
7173e488cb daemon: fixed issue with not properly starting emane event monitoring when enabled 2022-05-27 10:57:26 -07:00
Blake Harnden
bbcd4664ff daemon: removed session.add_node_file as it is not needed and was only used by the old tlv api 2022-05-27 10:43:59 -07:00
Blake Harnden
31bc0c6497 scripts: fixed bug in setting type when creating nodes using core-cli 2022-05-27 10:15:34 -07:00
Blake Harnden
28d3deeee8 install: updated and added dockerfiles for ubuntu/centos, updated notes on install page to correlate 2022-05-25 21:43:52 -07:00
Blake Harnden
2e3e085522 daemon: adjustments to revamp how core nodes are created in session.add_node, nodes now provide a create_options function for node specific options that are type hinted 2022-05-25 10:51:42 -07:00
Blake Harnden
03e646031c daemon: updated docker nodes to start using tail to keep alive, adjustments to support more robust volume mounting and adding symlinks to the nodes directory for bind/volume mounts 2022-05-18 14:50:08 -07:00
Blake Harnden
fd3be57f57 daemon: added initial support to docker nodes for setting up volumes and bind mounts 2022-05-11 13:51:02 -07:00
Blake Harnden
25c3c42b40 Merge branch 'develop' into docker-updates 2022-05-11 09:19:10 -07:00
Blake Harnden
844404c765 install: bumped version to 9.0.0 for next release 2022-05-11 09:19:00 -07:00
Blake Harnden
6f60fba18b install: updated pyproj version to avoid the need to build from source on newer distros 2022-05-10 13:54:51 -07:00
Blake Harnden
52b875df36 install: updated locked poetry packages and specifically bumped grpc tooling to a newer version for better binary install support 2022-05-10 13:24:19 -07:00
Blake Harnden
5f1e722331 install: adjustments to better support specifying an alternative python for install using PYTHON env variable 2022-05-10 11:51:36 -07:00
Blake Harnden
33f3eccdcf Merge branch 'develop' into docker-updates 2022-05-09 21:11:51 -07:00
Blake Harnden
8ba169c758 daemon: fixed naming issues with wireless/emane model attributes, fixed issue with emane controlnet updown script 2022-05-09 21:11:14 -07:00
Blake Harnden
2094694ca3 daemon: cleaned up docker node code, updates to use nsenter in most cases 2022-05-05 21:54:08 -07:00
Blake Harnden
2e4d0e0cea daemon: changes to generate random names for all wireless edge veths, to avoid names that would be an invalid device name 2022-05-02 15:01:03 -07:00
Blake Harnden
2ab2c27d49 daemon/test: improved MoveNodesRequest to be hashable using dataclass itself, fixed grpc test not properly using a wrapped MoveNodesRequest object 2022-04-28 23:20:17 -07:00
Blake Harnden
aa8ea40ce6 daemon: moved SetQeueue into utils to be leveraged by others, updated MoveNodesStreamer to leverage SetQueue, this will allow a means to stream node movements, but if position changes happen faster than processing, the latest position will override prior pushes and the latest position will be pulled off the queue 2022-04-28 16:12:31 -07:00
Blake Harnden
fe0bc2b405 services: removed no longer relevant service arouted and associated logic, fixed nrlsmf to put the flood command before configured interfaces 2022-04-26 14:11:48 -07:00
Blake Harnden
0a0248d8b2 gui: fixed issue where wireless edges were not properly attempting to arc common edges when added/deleted 2022-04-26 10:16:36 -07:00
Blake Harnden
0b420cfc07 grpc: update to fix sending protobuf format wireless config for joining session 2022-04-19 16:29:33 -07:00
Blake Harnden
62a060588d grpc: update to make sure retrieving session data returns wireless configs for nodes 2022-04-19 16:19:19 -07:00
Blake Harnden
7348942a67 daemon: add a new config value for the wireless network to allow a baseline loss value to be set 2022-04-18 16:46:59 -07:00
Blake Harnden
964e3aaf39 daemon: updated wireless network to configure static delay/bandwidth/jitter and calculate loss only, also will link nodes initially if enabled or run calculation when not at startup 2022-04-15 14:56:21 -07:00
Blake Harnden
ce5c155327 daemon: updated xml code to write/read wireless configs 2022-04-14 16:50:01 -07:00
Blake Harnden
d20cb1ef58 daemon/gui: added support to configure wireless network for position calculations or not 2022-04-14 16:31:14 -07:00
Blake Harnden
d124820a86 daemon: fixed error in handling errors when rendering config service templates 2022-04-14 10:48:00 -07:00
Blake Harnden
e5c06fe47c daemon: fixed wireless movement callback to not calculate config for position callback on links that are down 2022-04-13 13:43:58 -07:00
Blake Harnden
f811373f0b gui: updated config service config dialog to resize better, also now display the rendered tab first, for a more user friendly default 2022-04-11 15:55:32 -07:00
Blake Harnden
c40fb2b15d daemon: updated frr services to use consistent configuration for iface config for ospfv2, enabled opaque lsa support for ospf by default 2022-04-11 10:54:27 -07:00
Blake Harnden
bd6f789cef daemon/gui/grpc: added support to retrieve rendered config service files, added support for grpc to access this, and update gui to leverage this call to provide a rendered view of files based on the current scenario, also allows editing the rendered output to use as the input when running the scenario 2022-04-08 22:24:07 -07:00
Gabriel Somlo
314eee33f6 frrboot: add fedora sbin path to default
Add the Fedora default location for FRR binaries (/usr/libexec/frr/*.)
to CORE's frrboot default "sbin" search path

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2022-04-06 13:41:00 -04:00
Blake Harnden
443c0e708f daemon: removed linktype and apitype from node classes, as they are no longer needed, made adjustments where needed to compensate 2022-04-05 15:22:01 -07:00
Blake Harnden
7440c1d949 daemon: removed node.linktype as it is not needed, updated the one usage to align with other cases 2022-04-05 13:57:49 -07:00
Blake Harnden
5ee561b210 daemon: fixed sdt icons due to legacy gui removal, updated node.type to node.model to avoid variables with the same names with different meanings 2022-04-05 13:39:57 -07:00
Blake Harnden
ea751727b4 daemon: refactoring to tracking wireless link information 2022-04-05 12:05:37 -07:00
Blake Harnden
440c06c040 daemon: updates to refactor and clean up SessionConfig to contain its own logic 2022-04-04 15:13:31 -07:00
Blake Harnden
409b6809e6 daemon: adjustment for wireless link config to avoid has_netem issues for bidirectional configuration 2022-04-04 09:18:18 -07:00
Blake Harnden
388ae44cf2 daemon: small adjustment/cleanup to shutting down all sessions from coreemu 2022-04-04 09:15:34 -07:00
Blake Harnden
543e9982c0 daemon: apply wireless link label even for 0 to force gui update for now 2022-04-02 22:08:59 -07:00
Blake Harnden
42cd1a1019 daemon: force wireless link config options2 to have netem to force a clear/update 2022-04-01 21:30:42 -07:00
Blake Harnden
559cac18e8 grpc: fixed wireless config client/server 2022-04-01 21:23:58 -07:00
Blake Harnden
9d97699b1f daemon: fixed issue starting session and clearing session options, small cleanup to SessionOptions init 2022-04-01 11:46:28 -07:00
bharnden
08637d35b3
Merge pull request #682 from coreemu/enhancement/core-player
Enhancement/core player
2022-03-31 16:55:48 -07:00
Blake Harnden
5d4642006c daemon: added core player writer and player to core library and added wireless event handling, fixed issues with wireless nodes being written to xml 2022-03-31 16:31:20 -07:00
Blake Harnden
ba0e4adb04 Merge branch 'develop' into enhancement/core-player 2022-03-31 09:57:53 -07:00
bharnden
ace0183db5
Merge pull request #681 from coreemu/enhancement/wireless-node
Enhancement/wireless node
2022-03-31 09:56:34 -07:00
Blake Harnden
84acb82c18 daemon/grpc/gui: further updates for a new working wireless node, added grpc support for control and additions to gui for creation 2022-03-30 21:13:28 -07:00
Blake Harnden
e4a6ecf3c2 daemon: initial code to support a new style wireless approach 2022-03-29 12:16:07 -07:00
Blake Harnden
73aaa8ca18 daemon: updated bad doc string 2022-03-25 10:53:52 -07:00
Blake Harnden
1fa0ac25b5 gui: removed host from node model types and updated node config to only display type 2022-03-24 17:15:44 -07:00
Blake Harnden
26f0848cb4 daemon: update iface to use desired name when configuring, gui: dont assign mac to non container nodes 2022-03-22 21:08:31 -07:00
Blake Harnden
346364d705 Merge branch 'develop-notcl' into develop 2022-03-22 10:03:57 -07:00
Blake Harnden
d83bfed608 merged latest updates from develop 2022-03-22 10:03:03 -07:00
bharnden
e3466f0669
Merge pull request #677 from coreemu/enhancement/consistent-linking
Enhancement/consistent linking
2022-03-22 09:47:29 -07:00
bharnden
1841fb1110
Merge pull request #676 from coreemu/develop
Develop merge for 8.2.0
2022-03-21 21:47:35 -07:00
Blake Harnden
d7b2c3cac3 updated changelog for 8.2.0 release 2022-03-21 21:43:24 -07:00
Blake Harnden
6d8ae4af2e core-cli: add geo position to node output for query session and node 2022-03-21 21:35:05 -07:00
Blake Harnden
2df8aa4379 updated version to 8.2.0 for next release 2022-03-21 21:04:43 -07:00
Blake Harnden
b941395100 core-cli: updates to add back json output 2022-03-21 20:59:18 -07:00
Blake Harnden
5398cdd2d5 core-cli: fixed xml load call to use the right parameter type 2022-03-21 15:57:13 -07:00
Blake Harnden
7ed007496c daemon: add linked method to session and grpc support leveraging new linking semantics, update add_link validation check 2022-03-21 15:42:14 -07:00
Blake Harnden
e5e14ad67b grpc: added wlan/emane links to grpc calls to allow knowing initial wireless link state, same as before changes 2022-03-21 09:55:57 -07:00
Blake Harnden
dc9b6adc98 daemon/gui: adjustments to account for network node wired links having proper interface ids, which allow for unique configuration with the new linking semantics 2022-03-18 15:53:13 -07:00
Blake Harnden
b71272519d daemon: revamp to align gre tunnels for distributed to align with changes, also moved gre tunnels for wired links to occur directly when linking, allowing runtime distributed functionality, also updates to phyical node to leverage a core node, but avoid using namespacing 2022-03-18 12:31:04 -07:00
Blake Harnden
8c24e9cfa6 daemon: updates to fix rj45 to account for iface link revamp 2022-03-17 21:21:03 -07:00
Blake Harnden
3c8f6a9512 daemon: fix convert interface grpc utility to properly get ip4/ip6 addresses 2022-03-17 16:44:12 -07:00
Blake Harnden
4f58d5d8eb daemon: removed unused EmaneNet function 2022-03-17 16:43:31 -07:00
Blake Harnden
7b16f9cb74 daemon: moved node cmd to base, allowing interface config to not need a node parameter 2022-03-17 16:31:03 -07:00
Blake Harnden
cd7f1a641e daemon: initial pass to revamp how node linking and link management is done, provides a consistent way to link all wired nodes and allows them to be configured for tc for the same behavior across the board 2022-03-17 15:28:38 -07:00
Blake Harnden
e59fc02ec3 scripts: initial core-player script to playback .core files 2022-03-11 13:29:24 -08:00
Blake Harnden
d684b8eb5a docs: updated emane python example to use updated set_config 2022-03-11 11:04:01 -08:00
Blake Harnden
6cf2793e30 install: removed netgraph checks in configure.ac, removed referenced to netgraph in docs 2022-03-08 16:50:09 -08:00
Blake Harnden
f0750d78b0 docs: updated plantuml files to remove tlv/imn references and regenerated images 2022-03-08 16:10:22 -08:00
Blake Harnden
41db531e97 daemon: removed some unused Session functions and change to make proper use of set_user 2022-03-08 15:50:19 -08:00
Blake Harnden
dde339cc46 daemon: removed bitmap, which is not used 2022-03-08 14:32:01 -08:00
Blake Harnden
c8a589ef76 daemon: removing python tlv related code and tests related to it 2022-03-08 14:18:47 -08:00
Blake Harnden
dc7bb37252 install: removed tcl based gui, updated configure.ac, Makefile.am, and tasks.py to account for removal 2022-03-08 12:00:42 -08:00
Blake Harnden
f324cfbc4a daemon: updated core.conf to change .core references to .coregui 2022-03-08 11:36:57 -08:00
Blake Harnden
3eed1a09fb docs: removing references to imn, tcl, tk, tlv, and .core, removed unused icons 2022-03-08 11:30:03 -08:00
Blake Harnden
f545726ed5 daemon: small improvements to command error reporting, as well as catching and reporting config service get text dynamic exceptions 2022-03-04 09:55:40 -08:00
Blake Harnden
0536747d9a daemon/gui: adjustments to how a session instantiates, allowing the new python gui to move to a failed start state, this allows inpecting the failed nodes to see what went wrong 2022-03-04 09:19:56 -08:00
Blake Harnden
2eef7076f4 daemon: updated how local services are loaded to leverage full core path imports, avoiding name collisions with external modules 2022-03-02 12:42:53 -08:00
Blake Harnden
a42697ecce daemon: consolidated the code for CoreNode commands into the class itself 2022-02-28 22:05:01 -08:00
Blake Harnden
b085105a6b install: updated install instructions to use the right command for centos example 2022-02-28 10:03:34 -08:00
Blake Harnden
074a2263ce daemon: updates to network base to set default behavior for abstract function 2022-02-25 15:06:14 -08:00
Blake Harnden
e557b402b6 daemon: fix PhysicalNode instantiation issues, remove old functions that are no longer use and update session to use the new variation 2022-02-25 14:46:03 -08:00
Blake Harnden
2dd3839396 docs: updated emane docs to remove old GUI references and update the example pictures to include the configuration dialog of the new gui 2022-02-25 12:17:51 -08:00
Blake Harnden
58ffd045e2 daemon: pulling in an old legacy gui related fix for now, that was not merged back 2022-02-25 11:05:14 -08:00
Blake Harnden
482ad037f4 docs: updates to cleanup formatting on tables and denote that the python gui is the default in index.md 2022-02-25 10:38:14 -08:00
Blake Harnden
a7588a2188 install: updated ospf check to use sudo to account for sbin potentially not being on path 2022-02-18 15:25:41 -08:00
bharnden
bcf7429785
Merge pull request #654 from coreemu/develop
8.1.0 merge
2022-02-18 09:12:33 -08:00
Blake Harnden
cdde1c89ee added 8.1.0 notes to changelog 2022-02-18 09:08:22 -08:00
Blake Harnden
a341691d69 install: poetry updates to fix vulnerability issues with protobuf, py, and cryptography 2022-02-18 00:33:18 -08:00
Blake Harnden
458b7f15ce pygui: fixed antenna image to properly show alpha png 2022-02-18 00:24:30 -08:00
Blake Harnden
96f2408e01 daemon: fixed deadlock issue when starting/stopping nftables queue 2022-02-17 23:44:30 -08:00
Blake Harnden
113be65078 install: adjustments to have a better workflow for installation 2022-02-17 15:17:07 -08:00
Blake Harnden
9d32c432db install: updates to README and install docs for installing to run ensurepath after setup.sh ends 2022-02-17 15:03:09 -08:00
Blake Harnden
3c64654598 services: fix missing configurations for ospfv2 in config services 2022-02-17 10:14:04 -08:00
Blake Harnden
0fcc532c0d docs: updated note on poetry version installed 2022-02-11 21:04:12 -08:00
Blake Harnden
e80d22096c install: bumping version to 8.1.0 for next release 2022-02-10 16:17:22 -08:00
Blake Harnden
a1e9fc02fd install: bumped pinned poetry version to 1.1.12 to avoid installation issues related to poetry 2022-02-10 16:11:43 -08:00
Blake Harnden
47b02c3e7b docs: removed notes on needing to install ebtables legacy 2022-02-09 12:47:49 -08:00
Blake Harnden
0e2219f6c8 daemon: fixed issue creating directory for files when needed, within node 2022-02-05 12:19:24 -08:00
Blake Harnden
490a4acf24 daemon: fixed issues related to rj45 2022-02-05 00:46:25 -08:00
Blake Harnden
efb97d1a5d daemon: updates to remove the delay for processing wlan changes along with code to support it 2022-02-05 00:39:11 -08:00
Blake Harnden
43737a42e4 daemon: update nftables bridge tables to use priority -1 to beat default inet table rules if present 2022-02-03 14:29:42 -08:00
Blake Harnden
44b7b6a27e daemon: update config service files to use paths for retrieving templates and generating files in the same consistent way 2022-02-03 14:28:56 -08:00
Blake Harnden
df5ff02f95 docs: fix for bad config service example 2022-02-01 21:26:03 -08:00
Blake Harnden
8f767208e0 daemon: small adjustment to fix xml related issues parsing links for now, until bigger refactoring 2022-01-26 11:35:23 -08:00
Blake Harnden
d5b05a39e8 gui: adjustment to update drawing asymmetric edge data when joining a session 2022-01-26 11:19:30 -08:00
Blake Harnden
6791269eeb daemon: refactored interfaces to store configuration options as link options, instead of using a dictionary 2022-01-25 21:39:52 -08:00
Blake Harnden
e9b83b0d28 daemon: refactored how interfaces are configured, updated link edits to allow proper bi-directional support for network to network interfaces, improved and added more unit tests for link add/edit/delete 2022-01-25 09:13:39 -08:00
bharnden
31e6839ac5
Merge pull request #640 from coreemu/develop
8.0.0 merge
2022-01-12 16:20:03 -08:00
Blake Harnden
bc8c49c573 added docs on how to leverage Dockerfile install for core and update Dockerfile to default to master for latest release 2022-01-12 15:30:10 -08:00
Blake Harnden
e71079c772 updates to changelog for 8.0.0 release 2022-01-12 14:37:51 -08:00
Blake Harnden
8f89488fd5 grpc: added config service actions and update the gui to leverage them as the default for node context menus of running nodes 2022-01-11 16:29:55 -08:00
bharnden
58b8d1cd24
Merge pull request #637 from coreemu/dependabot/pip/daemon/lxml-4.6.5
build(deps): bump lxml from 4.5.1 to 4.6.5 in /daemon
2022-01-11 12:48:24 -08:00
bharnden
fdc009699e
Merge branch 'develop' into dependabot/pip/daemon/lxml-4.6.5 2022-01-11 12:32:19 -08:00
Blake Harnden
8cf2b9af08 install: updates to docs and scripts for installing core 2022-01-11 11:06:06 -08:00
Blake Harnden
871b1ae2af daemon: updates to support configuring and tracking mtu, along with over refactoring 2022-01-07 16:03:45 -08:00
Blake Harnden
0b531d7fd8 daemon: adjustments to support global configurable mtu values for node interfaces and bridges 2021-12-21 08:59:48 -08:00
dependabot[bot]
5e843f15bb
build(deps): bump lxml from 4.5.1 to 4.6.5 in /daemon
Bumps [lxml](https://github.com/lxml/lxml) from 4.5.1 to 4.6.5.
- [Release notes](https://github.com/lxml/lxml/releases)
- [Changelog](https://github.com/lxml/lxml/blob/master/CHANGES.txt)
- [Commits](https://github.com/lxml/lxml/compare/lxml-4.5.1...lxml-4.6.5)

---
updated-dependencies:
- dependency-name: lxml
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-13 20:56:53 +00:00
Blake Harnden
5ff4447528 daemon: reverting adjustment for executing scripts for corehandler specific logic 2021-11-18 09:19:31 -08:00
Blake Harnden
9da64af79b grpc: added args to execute script to reflect prior gui functionality, updated new and old gui to use the same exact logic for executing scripts for consistency 2021-11-18 09:02:42 -08:00
Blake Harnden
f98594e927 install: updates to install docs and update to task for installing emane to be limited to installing for the python virtual environment, recommend official packages instead 2021-11-17 15:55:05 -08:00
Blake Harnden
f090c98c54 readme: fixed command added in readme 2021-11-16 14:33:24 -08:00
Blake Harnden
2d0732d610 install: updated version of ospf mdr to install, to the latest commits 2021-11-16 14:01:46 -08:00
Blake Harnden
c055103c1b readme: updated to add a quick start section 2021-11-16 12:52:31 -08:00
Blake Harnden
49709261fc daemon: updated wlan config option to use float type for range, instead of string 2021-11-16 10:15:58 -08:00
Blake Harnden
22e92111d0 daemon: updates to provide config types for configurable values, without the need to specify the enumerated type 2021-11-15 16:40:30 -08:00
Blake Harnden
bd3e2f5d0e docs: adding initial documentation to help cover using config services 2021-11-15 14:33:05 -08:00
bharnden
35a285daa2
Merge pull request #609 from coreemu/dependabot/pip/daemon/pyyaml-5.4
build(deps): bump pyyaml from 5.3.1 to 5.4 in /daemon
2021-11-11 11:20:46 -08:00
bharnden
750489c2e1
Merge branch 'develop' into dependabot/pip/daemon/pyyaml-5.4 2021-11-11 11:15:27 -08:00
bharnden
ed90b9bbc3
Merge pull request #608 from coreemu/dependabot/pip/daemon/lxml-4.6.3
build(deps): bump lxml from 4.5.1 to 4.6.3 in /daemon
2021-11-11 11:02:24 -08:00
Blake Harnden
b78c07bd24 docs: update node types to include lxc/docker type documentation, instead of being hidden within examples 2021-11-11 10:59:11 -08:00
Blake Harnden
1ce6e51318 pygui: updates to properly save and load canvas size for each canvas separately 2021-10-29 14:56:50 -07:00
Blake Harnden
2b89503432 updates to sample1 scenarios to remove any custom service configurations, since the defaults should be used, fixes an issue specifically in sample1.imn 2021-10-29 14:11:11 -07:00
Blake Harnden
04fb3322b5 daemon: updated ovs net client to use proper set_mac_learning function, due to code changes prior 2021-10-27 08:23:54 -07:00
Blake Harnden
209303b085 merged latest release from master 2021-09-22 13:46:34 -07:00
dependabot[bot]
18163c577f
build(deps): bump pyyaml from 5.3.1 to 5.4 in /daemon
Bumps [pyyaml](https://github.com/yaml/pyyaml) from 5.3.1 to 5.4.
- [Release notes](https://github.com/yaml/pyyaml/releases)
- [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES)
- [Commits](https://github.com/yaml/pyyaml/compare/5.3.1...5.4)

---
updated-dependencies:
- dependency-name: pyyaml
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-22 20:27:28 +00:00
dependabot[bot]
0a88851be3
build(deps): bump lxml from 4.5.1 to 4.6.3 in /daemon
Bumps [lxml](https://github.com/lxml/lxml) from 4.5.1 to 4.6.3.
- [Release notes](https://github.com/lxml/lxml/releases)
- [Changelog](https://github.com/lxml/lxml/blob/master/CHANGES.txt)
- [Commits](https://github.com/lxml/lxml/compare/lxml-4.5.1...lxml-4.6.3)

---
updated-dependencies:
- dependency-name: lxml
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-22 20:27:09 +00:00
bharnden
7e18a7a720
Merge pull request #604 from coreemu/rel/7.5.2
Rel/7.5.2
2021-09-22 13:24:53 -07:00
Blake Harnden
bb592cda58 updated changelog and bumped versions for release 2021-09-17 16:14:28 -07:00
Blake Harnden
0204472928 install: locking in version of pipx installed to help avoid unexpected changes from new versions 2021-09-17 15:09:01 -07:00
bharnden
4b3693b9cd
Merge pull request #597 from dpemmerich/master
set poetry version to 1.1.7
2021-09-17 14:55:57 -07:00
bharnden
b1819668a6
Merge pull request #600 from coreemu/dependabot/pip/daemon/pillow-8.3.2
build(deps): bump pillow from 7.1.2 to 8.3.2 in /daemon
2021-09-17 14:51:16 -07:00
Blake Harnden
35549401eb adding initial Dockerfile for convenience to run CORE within Docker, including GUI 2021-09-17 14:46:01 -07:00
Blake Harnden
bd896d1336 daemon: added capability to config services to shadow directory structures, from a given path, or from a local source, files may be templates or a straight copy and can be sourced from node named unique paths for node specific files, also refactored and renamed file creation related functions for nodes 2021-09-17 14:34:37 -07:00
dependabot[bot]
d14d10803f
build(deps): bump pillow from 7.1.2 to 8.3.2 in /daemon
Bumps [pillow](https://github.com/python-pillow/Pillow) from 7.1.2 to 8.3.2.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/master/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/7.1.2...8.3.2)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-08 03:43:53 +00:00
dpemmerich
629cd13c1b set poetry version to 1.1.7 2021-09-03 19:26:41 +00:00
Blake Harnden
b96dc621cd grpc: refactoring for editing/moving nodes, they are now two separate processes, with specific logic to carry each out 2021-08-27 16:58:44 -07:00
Blake Harnden
ac5bbf5c6d pygui: updates to limit copy/paste to the graph widget itself and some small related cleanup to graph hot key functionalities 2021-08-26 15:12:51 -07:00
Blake Harnden
8e905b6a37 pygui: updates to improve draw order when joining a session, should help avoid some undesired visuals while reading in bigger scenarios 2021-08-26 10:42:02 -07:00
Blake Harnden
631cbbc73e pygui: add configuration and ip options to enable/disable ip4/ip6 assignment, improved gui configuration to handle new fields that do not already exist 2021-07-15 16:42:19 -07:00
Blake Harnden
150d4bd6ea pygui: added option to exit after directory creation 2021-07-15 11:26:36 -07:00
Blake Harnden
aa5bb08a16 grpc: fixed issue for start session not attempting to create directory when using definition 2021-07-14 16:39:18 -07:00
Blake Harnden
1347839200 pygui: adjustments to have save as update the current session to the newly defined file, saves will then continue to use the new save as name 2021-07-14 14:44:23 -07:00
Blake Harnden
8d303bdc2a pygui: changes to allow adding directory paths that do not exist within gui for customizing services 2021-07-14 13:45:49 -07:00
bharnden
eb1a9e2fe4
Merge pull request #584 from coreemu/enhancement/grpc-node-configs
Enhancement/grpc node configs
2021-07-14 13:35:26 -07:00
Blake Harnden
4879d6e297 pygui: small cleanup for removing service configuration when they are removed/toggled 2021-07-12 11:01:36 -07:00
Blake Harnden
54ac807a4f grpc: changes to support nodes containing configuration data, allowing for node creation with configs and querying nodes with their configs 2021-07-12 10:29:53 -07:00
Blake Harnden
8678922c92 grpc: removed global emane config from session protobuf 2021-06-04 18:55:54 -07:00
Blake Harnden
7198d2adc9 pygui: fixed issue in emane configuration for node interfaces using the wrong values 2021-06-03 21:48:07 -07:00
Blake Harnden
425a2ee141 core-cli: add position output for querying nodes 2021-06-03 21:37:56 -07:00
Blake Harnden
7fcedf527f daemon: add check to catch infinity values resulting from geo transformations and throw an error 2021-06-03 21:37:26 -07:00
Blake Harnden
44d797c633 pygui: fix so the emane config dialog will select the current emane configuration for a given emane node 2021-05-28 22:18:13 -07:00
Blake Harnden
a63e3e8d96 daemon: fix to also boot config services when a node is added during runtime 2021-05-26 21:01:24 -07:00
bharnden
b508ad6406
Merge pull request #573 from coreemu/enhancement/emane-nem-process
EMANE process per nem
2021-05-26 16:08:51 -07:00
Blake Harnden
f928284fb7 daemon: fixed emane setup to move binding check to after validating if emane is needed 2021-05-26 14:48:28 -07:00
Blake Harnden
b51200e397 daemon: updated emane model platform configuration to remove controlportendpoint option, as this will be something core itself will define 2021-05-26 12:57:35 -07:00
Blake Harnden
3fcefc4d79 daemon: updated emane shutdown to kill emane daemon for a given interface, instead of killall 2021-05-26 12:29:46 -07:00
Blake Harnden
777097c85e daemon: updated emane position hooks and updating nem position logic to live in emane manager 2021-05-26 12:22:36 -07:00
Blake Harnden
795a5f5865 daemon: refactoring for starting up and shutting down emane daemon per interface 2021-05-26 09:54:32 -07:00
Blake Harnden
820539191d daemon: adjustments to emane model post startup to accept an interface, since settings may be unique per interface, updated tdma to use this information for trying to initialize its tdma schedule properly 2021-05-25 12:14:28 -07:00
Blake Harnden
8d5c3bd212 grpc: update grpc call for get emane event channel to take in a nem id, since channels may now be unique per nem 2021-05-25 10:52:50 -07:00
Blake Harnden
bcd9cc7ac2 daemon: updates to provide new logic for emane event services, creating one per unique control channel, added mapping for nems to associated service for generated events 2021-05-24 21:41:05 -07:00
Blake Harnden
ef0fa8c1a7 daemon: updates to emane manager to setup ota/event control networks on nodes and host based on individual nem configurations 2021-05-21 22:57:27 -07:00
Blake Harnden
aea727ba42 gui: adjustments to remove emane global options from legacy gui, since it is no longer applicable 2021-05-20 12:48:42 -07:00
Blake Harnden
4ff650af67 pygui: removed global emane configuration dialog 2021-05-20 12:24:54 -07:00
Blake Harnden
6b5148566c daemon: adjustment for emane monitor shutdown to avoid locking 2021-05-19 20:49:18 -07:00
Blake Harnden
5bc3345d37 adjustments to remove global emane configuration, platform configurations can now be configured per nem, retrieve emane specific core settings from session options 2021-05-19 20:44:00 -07:00
Blake Harnden
071023b1d9 added platform config to emane models, to replace global config, moved core specific emane global configs to session options 2021-05-18 21:29:38 -07:00
Blake Harnden
e2a9f6b1f4 daemon: initial changes to support one emane process per nem 2021-05-18 09:48:38 -07:00
Blake Harnden
d16f6b234b daemon: fix for wlan to take loss value strings as floats 2021-05-11 23:57:35 -07:00
Blake Harnden
e5d28b01c6 pygui: removed host from gui, default node is now PC 2021-05-11 22:59:21 -07:00
Blake Harnden
86cd0a8e18 install: fixes to properly install/uninstall example files to desired directory as before 2021-05-11 21:10:56 -07:00
Blake Harnden
c2fdbbca32 docs: updated installation page to note commands for enabling the core service, when desired 2021-05-11 20:52:10 -07:00
Blake Harnden
5e843a7674 daemon: update to nftables update tracker to use a queue for more reactive changes 2021-05-10 23:31:11 -07:00
Blake Harnden
5286938e44 daemon: small cleanup to nftables management 2021-05-10 20:34:10 -07:00
Blake Harnden
11d8bb0674 daemon: renamed network variables to not be named in a private way, since they were being used externally 2021-05-10 15:18:15 -07:00
Blake Harnden
30291a8438 daemon: updates to switch from using ebtables to nftables for wlan linking/unlinking 2021-05-10 15:07:42 -07:00
Blake Harnden
208c746b67 daemon: fixed issue setting default config services if legacy services were specifically provided 2021-05-10 12:39:20 -07:00
Blake Harnden
5ffc3e2aa4 pygui: fixed issue with loading recent xml files 2021-05-10 12:07:55 -07:00
Blake Harnden
85c5ad22e4 daemon: adjustments to load local emane models and config services better using a full import 2021-05-07 22:49:58 -07:00
Blake Harnden
3a08b13d6e changes to rename core-pygui to core-gui to be the default gui, renamed core-gui to core-gui-legacy to denote its deprecation 2021-05-07 14:30:28 -07:00
Blake Harnden
ad09bd5504 initial changes to mark older style services as deprecated and make configurable services the defaults for the python gui, added attribute to still allow supporting the legacy gui for time being and logic to compensate 2021-05-07 13:10:05 -07:00
Blake Harnden
ca8b4f1f6e bumped version on develop to denote major changes 2021-05-07 12:01:08 -07:00
Blake Harnden
13778e1d30 pygui: updated emane config dialog to sort emane models consistently 2021-05-07 10:58:23 -07:00
Blake Harnden
50e3aadc6b daemon: refactoring to load emane models one time during startup, updates to account for this change 2021-05-07 10:40:18 -07:00
Blake Harnden
1ddb7b7b24 daemon: small cleanup for service loading in CoreEmu 2021-05-06 16:05:13 -07:00
Blake Harnden
53ae6ac784 grpc: updated create session to return a session object with default values, avoids scripts needing to create and then join, can just create and leverage the returned object 2021-05-06 15:06:16 -07:00
Blake Harnden
598cb0f10d grpc: removed set session state, states are a by product of actions done within a session and probably best to automate that instead of relying on clients responsibly setting proper values 2021-05-06 11:39:18 -07:00
Blake Harnden
d40435fa68 grpc: removed add session server, achieved with start session providing servers for session 2021-05-06 10:56:51 -07:00
Blake Harnden
7e6b87101b updated grpc wrapper client test to be just the grpc client test 2021-05-04 17:02:48 -07:00
Blake Harnden
8108db545a grpc: combined get services and get config services into new get config call, that can be used to get all daemon configuration information 2021-05-04 16:58:51 -07:00
Blake Harnden
42dc56c56b grpc: removed set node config service, achieved with start session 2021-05-04 15:57:53 -07:00
Blake Harnden
805be3f809 grpc: removed get node config services, achieved with get node or get session 2021-05-04 15:42:32 -07:00
Blake Harnden
e299d3dd16 grpc: removed set node service file, achieved with start session, removed get node config service configs, achieved with get session 2021-05-04 15:02:23 -07:00
Blake Harnden
3e2cb86b6b grpc: removed set node service, achieved with start session 2021-05-04 14:55:12 -07:00
Blake Harnden
c574ace9a0 grpc: removed get node service configs, achieved with get session 2021-05-04 14:40:17 -07:00
Blake Harnden
9205fe1764 grpc: removed get mobility configs, achieved with get session 2021-05-04 14:27:46 -07:00
Blake Harnden
618d89b8db grpc: removed get model configs, can be achieved with get session 2021-05-04 13:51:17 -07:00
Blake Harnden
639b29a134 grpc: removed get wlan configs, achieved with get session 2021-05-04 13:36:10 -07:00
Blake Harnden
15acdaa40f grpc: removed old client, refactored wrapped client to be the new standard client, removed old client tests, updated documentation 2021-05-04 13:29:22 -07:00
Blake Harnden
924e86da2b scripts: updated imn to xml to use grpc wrapped client 2021-05-04 10:02:15 -07:00
Blake Harnden
0ed30a4feb scripts: updated route monitor to use grpc wrapped client 2021-05-04 09:56:58 -07:00
Blake Harnden
1cbe891dab grpc: updated core-cli to use the wrapped client, removed json output for now 2021-05-03 16:55:53 -07:00
Blake Harnden
917c45e70b grpc: updates to wrapper classes to help write client code in a more simple way using the consolidated api, updated examples to used the wrapped client 2021-05-03 15:25:18 -07:00
Blake Harnden
38e162aec5 grpc: removed get_node_links, added links to get_node instead 2021-05-02 20:58:24 -07:00
Blake Harnden
f271b0289e grpc: removed add hook and get gooks, can be achieved with get session and start session 2021-04-27 21:48:20 -07:00
Blake Harnden
634341dd03 grpc: removed set session metadata, now accomplished with start session 2021-04-27 21:08:58 -07:00
Blake Harnden
a217c2445c grpc: removed set session location, achieved with start session 2021-04-27 10:59:10 -07:00
Blake Harnden
e0fe86bcb2 grpc: updated start_session to have a definition option, to allow saving xml files and getting service configurations, without fully starting a session 2021-04-27 10:49:52 -07:00
Blake Harnden
f891974e3a grpc: removed set session user, added to start session 2021-04-24 22:35:45 -07:00
Blake Harnden
d8a3f9e78c grpc: removed set/get sessopm options, removed get session metadata/location, can be done with get/start session 2021-04-24 22:10:28 -07:00
Blake Harnden
d4c008e564 grpc: removed get/set session options, now accomplished through get_session and start_session 2021-04-24 21:37:00 -07:00
Blake Harnden
3d356272f1 pygui: adjust service configuration to not use grpc calls, data is saved and provided in start session call 2021-04-23 22:51:35 -07:00
Blake Harnden
4830538053 daemon: fixed issue in dhcp server subnet line using wrong address 2021-04-23 14:00:05 -07:00
Blake Harnden
dcf402ae04 daemon: fixed issue with dhcp service and dealing with addresses with a prefix of 32 2021-04-22 23:02:42 -07:00
Blake Harnden
7938379e6d grpc: added session options to session wrapped object, updated get_session and start_session to utilize this change, updated pygui to leverage as well 2021-04-22 16:12:33 -07:00
Blake Harnden
597834a993 added default logging configuration for __main__ scripts 2021-04-21 23:22:54 -07:00
Blake Harnden
188914ccb1 updated default logging to be at warning level and removed need to adjust the paramiko logger 2021-04-21 21:14:32 -07:00
Blake Harnden
69652ac577 updates to python based logging to use module named loggers, updated logging config file to align with these changes 2021-04-21 21:09:35 -07:00
Blake Harnden
55d5bb3859 daemon: added non promiscuous as default when configuring wlan 2021-04-20 09:48:44 -07:00
Blake Harnden
b12aa981d5 install: removed unwanted tasks, added option to avoid installing ospf mdr 2021-04-16 23:43:25 -07:00
Blake Harnden
25025c00bc Merge branch 'master' into develop 2021-04-15 22:21:40 -07:00
bharnden
cbe1db1215
Merge pull request #566 from coreemu/rel/7.5.1
Rel/7.5.1
2021-04-15 21:58:23 -07:00
Blake Harnden
1daf5778c0 updated changelog 2021-04-15 21:56:14 -07:00
Blake Harnden
21749502f9 bumped version 2021-04-15 21:49:30 -07:00
Blake Harnden
6ce4b425f8 doc: add note to upgrade pip before installing 2021-04-15 21:46:55 -07:00
Blake Harnden
984d28275b pygui: fixed issue with saving services for custom nodes, fixed issue with setting default services present when selecting services for a custom node 2021-04-13 21:53:50 -07:00
Blake Harnden
44f81391c4 daemon: added grpc wrapped client tests, added new wrapped class ServiceFileConfig to consolidate associated data for its purpose 2021-04-01 13:37:19 -07:00
Blake Harnden
6086d1229b daemon: updated config.py to use dataclasses for config classes, updated naming and referencing. updated configurable options to self validate default values align with the config type. updated the example emane model to better align with the current state of things 2021-03-31 11:13:40 -07:00
Blake Harnden
bb3590fbde daemon: fix to correct rj45 link modifications from core-gui failing to include an iface id 2021-03-26 10:56:33 -07:00
Blake Harnden
f7f54d9aa6 pygui: updates to leveraged wrapped grpc client for proper type hinting without manual conversion 2021-03-26 10:43:45 -07:00
Blake Harnden
be0e0175a2 daemon: refactored node.nodedir to node.directory 2021-03-19 17:01:22 -07:00
Blake Harnden
a2148c6923 daemon: refactored session.session_dir to session.directory 2021-03-19 16:56:54 -07:00
Blake Harnden
1c970bbe00 daemon: refactoring to remove usage of os.path where possible and pathlib.Path instead 2021-03-19 16:54:24 -07:00
bharnden
b2726b627f
Merge pull request #562 from coreemu/develop
7.5.0 merge
2021-03-18 21:22:35 -07:00
Blake Harnden
d0a55dd471 updated changelog for release 2021-03-18 21:16:54 -07:00
Blake Harnden
dc9089fcd1 daemon: added type hinting to globals in geo.py 2021-03-17 09:40:07 -07:00
Blake Harnden
1b025c47da daemon: fixed issue in some cases where core-gui would have a session reach shutdown state, without formally shutting down and removing the session directory 2021-03-12 09:51:55 -08:00
Blake Harnden
49659976d3 daemon: fixed issue with bad value check for generating sdt movement 2021-03-09 09:50:02 -08:00
Blake Harnden
b2626b8d0e daemon: fixed sdt link layer usage to avoid assigning links to not leaf layers, added type hinting to globals in sdt file 2021-03-09 09:36:03 -08:00
Blake Harnden
f13334cc58 bumped version to 7.5.0 2021-03-08 13:01:36 -08:00
Blake Harnden
b163b06596 pygui: added simple error dialog call to app, also added blocking option for some error dialogs when needed 2021-02-19 10:35:59 -08:00
Blake Harnden
2387812a76 pygui: update to allow custom nodes to use icons from any directory 2021-02-19 09:31:58 -08:00
Blake Harnden
93813358b5 pygui: further refactoring around retrieving icon images 2021-02-18 23:07:55 -08:00
Blake Harnden
a6fadb76cc pygui: refactored images.py and fixed issue with recreating a default config.yaml every time the gui was started 2021-02-18 21:04:16 -08:00
Blake Harnden
47ac4c850d pygui: refactoring of nodeutils and its usage, fixed issue with drawing custom nodes and copying services 2021-02-18 10:47:20 -08:00
Blake Harnden
422a1a500e pygui: hide related wireless edges when hiding nodes, update to handle hiding wireless edges that are re-added when moving 2021-02-17 16:03:01 -08:00
Blake Harnden
7871a678ca pygui: updates to handle visibility toggles in relation to having nodes hidden, fix final position of a drawn edge when dragging to draw 2021-02-17 15:23:04 -08:00
Blake Harnden
4a21cd5789 pygui: updated sample1.xml to update the background stored due to multi canvas changes 2021-02-17 12:01:46 -08:00
Blake Harnden
b698fed368 Merge branch 'develop' of https://github.com/coreemu/core into develop 2021-02-17 10:10:51 -08:00
Blake Harnden
c7a62a5743 examples: added missing instantiation line for grpc emane example 2021-02-17 10:09:33 -08:00
bharnden
bce5c2cca3
Merge pull request #546 from astropcr/patch-2
Update architecture.md
2021-01-30 10:08:30 -08:00
Blake Harnden
27f7bdb004 pygui: fixed issue not properly sending service customization data when not runtime 2021-01-22 22:33:26 -08:00
Blake Harnden
ca004b3e96 pygui: fixed issue sorting node ids for edge token to avoid issues with edges defining nodes in a different order 2021-01-20 10:09:46 -08:00
Blake Harnden
e9bf50b3ff pygui: moved complete edge logic into the edge itself 2021-01-15 23:39:38 -08:00
Blake Harnden
fb3d593751 pygui: small cleanup for wireless edge creation 2021-01-15 22:49:01 -08:00
Blake Harnden
754b8ba91e pygui: fix bug if emane name happened to contain multiple underbars 2021-01-15 11:35:13 -08:00
Blake Harnden
097f248120 pygui: small cleanup to node utils to simplify usage where possible 2021-01-15 11:33:00 -08:00
Blake Harnden
0fee29754d pygui: moved shadow node code to same file as regular nodes 2021-01-14 23:46:25 -08:00
Blake Harnden
e7c721989f pygui: small cleanup to add some utility functions to edges 2021-01-14 23:31:53 -08:00
Blake Harnden
886b56cf8c pygui: fixed wireless nodes not linking with full netmasks, fixed assigning addresses for nodes connected to other nodes that may have had a full netmask 2021-01-14 13:28:06 -08:00
Blake Harnden
2b171631c7 daemon: fixed check for mobility looping 2021-01-13 21:47:16 -08:00
Blake Harnden
b7483c2715 pygui: adjust logging 2021-01-13 21:31:58 -08:00
Blake Harnden
3d958c5d0f core-cli: added delete session 2021-01-13 21:19:56 -08:00
Blake Harnden
cadbf8dd14 pygui: add node context and interactions to shadow nodes 2021-01-13 20:49:23 -08:00
Blake Harnden
a5098263fd pygui: sort services in node context menu during runtime 2021-01-13 10:51:47 -08:00
Blake Harnden
4007dc331b pygui: update to account for already used mac addresses that may collide with auto assigned addresses 2021-01-13 10:50:16 -08:00
Blake Harnden
878d943ee3 pygui: add services and their actions to container nodes during runtime 2021-01-12 23:51:09 -08:00
Blake Harnden
623cc13fca pygui: fixed issue deleting current session from sessions dialog, also now join session when deleting if present, or create new one when none are left 2021-01-12 22:43:27 -08:00
Blake Harnden
c2a40dbb6b daemon: removed usages of getattr and hasattr where possible 2021-01-12 21:30:48 -08:00
bharnden
6ef458fc74
Merge pull request #549 from coreemu/feature/pygui-multi-canvas
Feature/pygui multi canvas
2021-01-12 20:42:11 -08:00
Blake Harnden
cd35b28ead Merge branch 'develop' into feature/pygui-multi-canvas 2021-01-11 09:23:42 -08:00
bharnden
d98a9a5a91
Merge pull request #548 from coreemu/develop
merging 7.4.0
2021-01-11 09:10:57 -08:00
Blake Harnden
d533083b5f updated changelog for next release 2021-01-11 00:39:38 -08:00
Blake Harnden
4904f7170f updated version for next release 2021-01-11 00:34:38 -08:00
Blake Harnden
6f3246e329 pygui: further updates to support hiding nodes and related edges, added hidden nodes to metadata sent to daemon and parsed when joining a session 2021-01-09 20:35:24 -08:00
Blake Harnden
313768ea56 pygui: added logic to sort canvas tabs when joining a session to organize, removed editing a nodes canvas as it currently is not supported by either gui and causes issue in the python gui due to grpc editing of a node and how values are handled 2021-01-08 11:22:16 -08:00
Blake Harnden
35cc8fab65 pygui: fix redrawing edge labels for multiple canvases, updated edit menu to account for multiple canvases, fixed issue with not setting menubar state when joining a session, starting point for hide/show nodes and related edges 2021-01-08 10:10:46 -08:00
Blake Harnden
bc540e0669 Merge branch 'develop' into feature/pygui-multi-canvas 2021-01-07 15:28:05 -08:00
Blake Harnden
a660b01e93 pygui: validation of the node name field will allow - instead of _, - is valid while _ is not 2021-01-07 14:24:57 -08:00
Blake Harnden
ebd6bb8a21 Merge branch 'develop' into feature/pygui-multi-canvas 2021-01-07 14:20:23 -08:00
Peter R
b88ec31df6
Update architecture.md
Fixed a typo.
2021-01-06 16:24:09 -05:00
Blake Harnden
44ee5308de pygui: adjustments to create gui home directories if not present and add new files that may have been added that do not exist 2021-01-06 10:24:06 -08:00
Blake Harnden
cba86a3da7 pygui: added simple black dot image to represent shadowed nodes in gui 2021-01-06 09:57:19 -08:00
Blake Harnden
acaef00087 pygui: fixed checking link options when joining a session, fixed stopping a session and deleting wireless links due to logic moved to being a part of wireless edge delete itself 2021-01-05 22:44:33 -08:00
Blake Harnden
3c97f80614 pygui: adjustments to help handle links between shadow nodes with initial desired behaviors 2021-01-05 15:42:46 -08:00
Kevin
f919520058 Setting the args in distributed_switch.py to required 2021-01-05 15:28:50 -08:00
Blake Harnden
685b21924c pygui: refactored how edges determine if they are linked wireless, removed wireless network tracking that was not being used by the canvas manager, added helper function to nodes to check if they are of wireless type 2021-01-03 22:08:09 -08:00
Blake Harnden
63282134f5 pygui: added logic to reuse shadow nodes when linked between nodes on same canvas, added logic to avoid deleting shadow nodes when still linked to other nodes on same canvas 2021-01-02 12:59:15 -08:00
Blake Harnden
a2d9659fb7 pygui: cleaned up how edges get drawn to reuse logic, fixed clearing canvas manager edges between changing sessions, fixed deleting edge check for link interfaces 2021-01-02 10:46:05 -08:00
Blake Harnden
77e2b08d76 pygui: fixed deleting selected nodes due to logic changes 2021-01-02 10:05:40 -08:00
Blake Harnden
f24d5f20b4 pygui: updated logic to use new canvases when receiving node delete messages 2021-01-02 09:35:39 -08:00
Blake Harnden
a7d7b94215 pygui: fixed edge context, fixed node context, updated find to leverage multi canvas changes and select canvas of found node 2021-01-02 00:10:23 -08:00
Blake Harnden
62d111b74c pygui: fixed joining a multi canvas session in initial basic test case 2020-12-31 12:24:21 -08:00
Blake Harnden
2af7d595c0 pygui: cleaned up node label position for edge duplicate logic 2020-12-31 11:43:11 -08:00
Blake Harnden
3e2ea42ebd pygui: adjustments to have canvas manager manage all edges, allow shadow nodes to be moved, and updates to account for old usages of a universal canvas 2020-12-30 22:11:45 -08:00
Blake Harnden
f171c6111a pygui: created node function to check if it can be linked to another node 2020-12-17 22:32:25 -08:00
Blake Harnden
28d22c5800 pygui: initial add for link menu within node context menu 2020-12-17 17:23:37 -08:00
Blake Harnden
29ffd64b41 pygui: updates to capture canvas tab change events and set the statusbar zoom variable to be the current canvas 2020-12-17 14:56:54 -08:00
Blake Harnden
f9a4fe3331 pygui: initial canvas manager with a single tab by default, updates to how throughputs are handled related to canvases 2020-12-17 14:31:09 -08:00
Blake Harnden
2f9c169e66 pygui: improvement for loading canvas backgrounds and checking if a gui file or specific path 2020-12-17 13:27:23 -08:00
Blake Harnden
b937e316c4 pygui: cleanup for canvas metadata creation and parsing 2020-12-17 13:10:28 -08:00
Blake Harnden
367a2096fa pygui: added multi canvas support to shapes, updated how shape metadata is saved and loaded to align 2020-12-17 12:42:49 -08:00
Blake Harnden
4a8f8557a6 pygui: changes to support saving and loading canvas backgrounds to xml, canvas dimensions will apply globally 2020-12-17 12:25:11 -08:00
Blake Harnden
5d436dd94d Merge branch 'develop' into feature/pygui-multi-canvas 2020-12-17 09:02:29 -08:00
Blake Harnden
2e77907d72 daemon: removed unused variable in sdt code and update to avoid deadlock when deleting nodes due to sdt trying to leverage the same lock on reconnect 2020-12-16 21:32:47 -08:00
Blake Harnden
8eada3d754 Merge branch 'develop' into feature/pygui-multi-canvas 2020-12-16 13:29:50 -08:00
Blake Harnden
4ec9ea7b16 daemon: small cleanup to boot nodes logic, moved control interface creation to occur before service startup avoiding thread race conditions validating if an interface is for a control network 2020-12-16 10:19:17 -08:00
Blake Harnden
4b6afe4db7 daemon: fix for deleting an interface from rj45 node, better error messaging when trying to add an interface to a node that already exists 2020-12-15 09:34:42 -08:00
bharnden
4a9d16c78c
Merge pull request #539 from haveagr8day/master
Fix attribute exception in UDP TLV API Handler
2020-12-15 09:27:32 -08:00
Riley Baxter
ad839bbc07
Fix session id attribute name in UDP TLV API Handler 2020-12-14 13:08:52 -05:00
Blake Harnden
b01249bb4e added canvas to protobuf node messages, added node canvas id to grpc server handling, updating pygui to draw canvases based on joined session and add nodes to respective canvas 2020-12-12 23:17:43 -08:00
Blake Harnden
9621df6bc4 pygui: able to start session with multiple canvases, just using 1 canvas for now 2020-12-12 00:03:03 -08:00
Blake Harnden
6f43d0e88f pygui: added menu buttons to add/delete canvases 2020-12-11 22:54:52 -08:00
Blake Harnden
4363a20ffb Merge branch 'develop' into feature/pygui-multi-canvas 2020-12-11 22:05:02 -08:00
Blake Harnden
d6b95bab24 install: adjustment to account for /etc/os-release that does not have an ID_LIKE field 2020-12-11 18:46:29 -08:00
Blake Harnden
886bfc093b pygui: further refactoring to work towards multiple canvas support 2020-12-11 18:39:58 -08:00
Blake Harnden
e34c00a431 Merge branch 'develop' into feature/pygui-multi-canvas 2020-12-10 18:07:32 -08:00
Blake Harnden
e7320a61a6 daemon: revert wlan mac learning change, due to undesired default behavior, there may be some cases where this behavior is desired, so the option to enable a promiscuous mode has been added and will be present in core-pygui 2020-12-10 15:16:05 -08:00
Blake Harnden
9fa98ae378 pygui: initial commit for starting on canvas manager 2020-12-09 23:33:36 -08:00
Blake Harnden
d1c2b1bdb9 pygui: fixed configuring node back to default server after switching to a distributed server 2020-12-09 21:22:19 -08:00
Blake Harnden
02d8a32a50 daemon: removing function to move nodes when mobility already has the network, updated logging for mobility script control to include file name being used 2020-12-09 16:05:36 -08:00
Blake Harnden
7308dd50ff daemon: fixed issue related to updating networks of moved nodes with multiple mobility scripts 2020-12-09 15:43:19 -08:00
Blake Harnden
d824fbd1c6 grpc: fixed creating session directory if need be when starting session, before setting config state, avoids path not existing error 2020-12-09 10:05:13 -08:00
Blake Harnden
836e929fbc pygui: add support to rename interfaces in the node config dialog, some small cleanup to interface validation 2020-12-08 10:02:34 -08:00
Blake Harnden
5b93c2d7ac daemon: added support for link options buffer read/write to xml 2020-12-07 22:31:53 -08:00
Blake Harnden
6793382f44 pygui: fixed edit node mac setting to auto to properly clear out current mac setting 2020-12-07 21:08:05 -08:00
Blake Harnden
a23ef7d603 daemon: properly go through the data collect state for grpc session shutdown, also check and avoid repeating data collect or shutdown when already past those states 2020-12-05 09:01:53 -08:00
Blake Harnden
b762fe664b pygui: avoid saving edge config metadata when values are default 2020-12-04 00:03:30 -08:00
Blake Harnden
41222f77c2 daemon: fix delete link for network to network nodes 2020-12-03 22:28:44 -08:00
Blake Harnden
664b049bf7 pygui: updated edge token to default to 0 for interface ids due to grpc messages not properly supporting None 2020-12-02 20:40:03 -08:00
bharnden
a57b838f19
Merge pull request #534 from coreemu/develop
merge for 7.3.0
2020-12-02 10:24:17 -08:00
Blake Harnden
8297b74524 adjusted 7.3.0 changelog 2020-12-02 10:11:49 -08:00
Blake Harnden
ed717599c8 updated changelog for 7.3.0, fixed install docs not displaying file paths properly and simplified requirements section moving it near the top 2020-12-02 09:40:49 -08:00
Blake Harnden
66a1c3d426 bumped version to 7.3.0 for next release 2020-12-02 08:44:21 -08:00
Blake Harnden
a35e91aeba daemon: added link option to configure buffer, added support in pygui to allow configuring buffer 2020-11-30 16:49:44 -08:00
bharnden
d95c2ec05f
Merge pull request #529 from coreemu/enhancement/link-buffer-size
updates for link configuration to calculate a limit when bandwidth/delay are present
2020-11-20 17:06:35 -08:00
bharnden
83ba6cea70
Merge pull request #527 from leif81/patch-1
Typo in services.md
2020-11-13 17:13:51 -08:00
Leif Gruenwoldt
db7d4ca0c1
Typo in services.md 2020-11-12 22:36:14 -05:00
Blake Harnden
380d411833 daemon: updated linkconfig to calculate a limit when bw/delay are present, updated and simplified logic as well, leveraging code from outstanding pull request, updated code to factor in the mtu of the iface being configured 2020-10-17 08:18:49 -07:00
Blake Harnden
aa40229495 pygui: updated edge tokens to use core node ids instead of canvas ids, updated link config to properly set/load width/color, updated metadata to store/load edge width/color when switching sessions and saving xml 2020-10-13 10:25:40 -07:00
Blake Harnden
68934da204 pygui: fixed link options check when options is not present 2020-10-13 09:12:10 -07:00
bharnden
e817a24275
Merge pull request #526 from coreemu/feature/pygui-hide-loss-links
pygui: added option to hide/show links with 100% loss, added checks t…
2020-11-12 11:18:11 -08:00
bharnden
fc846272fc
Merge pull request #525 from coreemu/feature/pygui-multiple-links
Feature/pygui multiple links
2020-11-12 08:40:04 -08:00
Blake Harnden
961f630acb pygui: added option to hide/show links with 100% loss, added checks to flag links for this case 2020-10-13 06:45:37 -07:00
Blake Harnden
a1b4279d80 pygui: dont add created edges to node until after a link has been created 2020-10-12 23:42:58 -07:00
Blake Harnden
053cd1da65 pygui: removed edges tracking interfaces, since the link associated with them already does 2020-10-12 22:51:15 -07:00
Blake Harnden
055029e5c5 pygui: added check so bridge based nodes can only have 1 link between them 2020-10-12 20:41:55 -07:00
Blake Harnden
29bd6ef7f8 pygui: initial changes to allow multiple wired links between nodes, updated to commonize logic for creating edges and adjustments in the UI for several edge related cases 2020-10-12 20:28:27 -07:00
Blake Harnden
96dddb687d docs: updated example custom emane model to use type hinting and embedded it into the emane documentation page, daemon: adjustment to correct rj45 not being provided an iface id when deleting a link from core tlv 2020-10-11 12:06:35 -07:00
Blake Harnden
90d2d5f0dc updated example service to use ExampleService naming and type hinting, removed older type hinting within docs, updated example service in documentation 2020-10-11 11:07:02 -07:00
Blake Harnden
8597c5c1a8 pygui: updated edge labels to just use a set distance from nodes 2020-10-11 10:05:57 -07:00
Blake Harnden
1543dfcc94 daemon: removed loading environment log statement until isolated for entire session 2020-10-11 08:35:46 -07:00
bharnden
dde74f0927
Merge pull request #514 from coreemu/feature/add-session-environment-support
add support for /tmp/pycore.nnnnn/environment file, DRY up env merges
2020-11-07 09:38:15 -08:00
Blake Harnden
ea44f1b6e7 daemon: updated environment reading to leverage pathlib, also added .coregui user environment as a possibility 2020-10-11 08:22:33 -07:00
Blake Harnden
0c847cfb37 pygui: fixed wlan/emane linked nodes drawing link options for invisible links when joining session or clearing throughput 2020-10-10 06:15:59 -07:00
Blake Harnden
26c2997a42 update to controlnet names on host machine to be more obvious to their purpose, ctrl<index>.<short session id> 2020-10-10 05:31:26 -07:00
Blake Harnden
4e79865035 updated radvd config service to match recent change to radvd standard service 2020-10-07 15:28:04 -07:00
bharnden
c25cb3d657
Merge pull request #517 from gsomlo/gls-frr-dir
radvd: ensure existence of [/var]/run/radvd/ directory on startup
2020-10-17 10:23:09 -07:00
Gabriel Somlo
c1864857e1 radvd: ensure existence of [/var]/run/radvd/ directory on startup 2020-10-09 18:09:17 -04:00
Blake Harnden
f2868a9554 daemon: fixed issue where emane global config settings were not being sent to core-gui when joining a session 2020-10-05 20:15:55 -07:00
Blake Harnden
8a6fdc69ba docs: added note about core-gui behavior when running the emane antenna demo 2020-10-04 23:06:01 -07:00
Blake Harnden
93a5d1fb01 docs: cleanup of some of the emane demos, added antennaprofile demo example 2020-10-04 22:42:09 -07:00
Blake Harnden
ce7736a95e Merge branch 'develop' of https://github.com/coreemu/core into develop 2020-10-04 18:54:41 -07:00
bharnden
ac781ef3da
Merge pull request #515 from coreemu/docs/emane-demos
added emane examples for various emane topics when used within core
2020-10-07 13:11:07 -07:00
Blake Harnden
552d8f60d2 daemon: change to generate transport definition for external transports, which allows emanegentransport to function properly 2020-10-04 18:53:31 -07:00
Blake Harnden
5a07929fde added emane examples for various emane topics when used within core 2020-10-04 18:31:34 -07:00
Jeff Ahrenholz
ae336c2cf8 add support for /tmp/pycore.nnnnn/environment file, DRY up env merges 2020-10-02 09:51:01 -07:00
bharnden
56e98f412c
Merge pull request #512 from coreemu/develop
Develop
2020-09-29 08:55:49 -07:00
Blake Harnden
3d3e2271be updated changelog for 7.2.1 2020-09-28 23:19:39 -07:00
Blake Harnden
00433bfd99 added note about docker issue in install doc, bumped version to 7.2.1 2020-09-28 23:14:20 -07:00
Blake Harnden
3f0993d0a9 install: adjust ospf mdr commit 2020-09-26 14:48:48 -07:00
Blake Harnden
b5de4445fe install: set ospf mdr back to original commit to fix routing issue 2020-09-26 14:33:59 -07:00
Blake Harnden
3f1ea0ab86 install: revert ospf mdr commit used to an older version due to issues with multiple interfaces 2020-09-26 13:25:42 -07:00
Blake Harnden
28daab98dd updated install.sh to just leverage apt/yum with assumed packages needed to setup python3/invoke to run the installer 2020-09-26 13:09:33 -07:00
Blake Harnden
a3d2e6dfe3 updated install docs to try and be more explicit, updated install tasks to allow forcing an install type override for unsupported OSs 2020-09-26 09:42:15 -07:00
Blake Harnden
0306f77147 daemon: adjustments for shutdown behavior to avoid issues when shutting down, when already shutdown for the various different cases, but to also make sure the pycore directory is removed 2020-09-24 14:17:15 -07:00
Blake Harnden
b195891b3b daemon: fix issue where control net bridges were not being removed during shutdown of legacy gui 2020-09-24 12:53:02 -07:00
Blake Harnden
0177b07f03 daemon: fixed issue with using the wrong emane network for a given emane connected interface 2020-09-24 11:54:49 -07:00
bharnden
16495c9008
Merge pull request #510 from coreemu/develop
Develop
2020-09-15 13:22:27 -07:00
Blake Harnden
371ca72900 tests: update to fix grpc shutdown during tests, when not mocking 2020-09-15 13:07:08 -07:00
Blake Harnden
d43d854314 updated changelog, modified edit node to edit icon/canvas before node position, in case it gets broadcasted out 2020-09-15 07:27:07 -07:00
Blake Harnden
4dad3f5e9f tests: fixed unit test due to change of shutdown logic 2020-09-14 09:24:40 -07:00
Blake Harnden
ee59d6bf8b daemon: avoid shutting down sessions already in shutdown state, due to exit hooks potentially duplicating effort 2020-09-14 09:06:54 -07:00
Blake Harnden
8ca52bf475 docs: small cleanup for grpc/python docs 2020-09-14 08:41:38 -07:00
Blake Harnden
7fdb114375 docs: added examples for configuring services for python/grpc 2020-09-13 12:08:29 -07:00
Blake Harnden
4538675c90 docs: added examples for listening to events in grpc/python 2020-09-13 09:26:48 -07:00
Blake Harnden
4bdc454970 docs: added edit link examples for grpc/python 2020-09-13 09:16:30 -07:00
Blake Harnden
2b1b027a11 docs: pass updating python examples to be the same as grpc examples and remove extra cruft to focus on simpler example code alone 2020-09-12 11:22:58 -07:00
Blake Harnden
828a68a0cd docs: pass on improving and providing doc based examples for common basic use cases, fixed issue with grpc defaulting session refscale to a very large number 2020-09-11 23:49:26 -07:00
Blake Harnden
9ea1915f48 bump versions for next release 2020-09-11 16:55:49 -07:00
bharnden
5fd51e6b2f
Merge pull request #509 from coreemu/enhancement/local-install-option
Enhancement/local install option
2020-09-11 16:54:17 -07:00
Blake Harnden
92090dd659 install: add node about pitfalls for local install 2020-09-11 16:46:27 -07:00
Blake Harnden
be8fa1b96d install: update message printed when installing core local/venv 2020-09-11 16:41:01 -07:00
Blake Harnden
6e059c7446 install: fixed hiding output for uninstalling local core 2020-09-11 16:34:49 -07:00
Blake Harnden
06e9a04357 install: update reinstall to account for local installs as well 2020-09-11 16:33:21 -07:00
Blake Harnden
7790d4aa00 docs: update install.md to denote the option for installing locally and reference that as a possibility in other instructions 2020-09-11 16:26:13 -07:00
Blake Harnden
efdce20afb install: add local install support for the install emane task 2020-09-11 15:51:01 -07:00
Blake Harnden
f83f71c074 install: use sudo when installing wheel for non-user specific install 2020-09-11 15:16:28 -07:00
Blake Harnden
0668d0a49b install: add option to support building a wheel from poetry and installing locally 2020-09-11 15:05:49 -07:00
Blake Harnden
b9a14fbe0c install: fixed invoke cd not supporting pathlib.Path 2020-09-09 18:42:26 -07:00
Blake Harnden
8234a5ed7e install: adjust emane repo path to use an absolute path with installing from poetry 2020-09-09 17:49:05 -07:00
Blake Harnden
646c6b8f01 install: updated emane install to checkout a specific version to avoid unexpected errors and checkout the repo to parent directory of the core repo 2020-09-09 16:52:35 -07:00
Blake Harnden
202e681fff install: fix ospf mdr repo checkout location 2020-09-09 16:37:23 -07:00
Blake Harnden
57e6df51d3 daemon: removed ospf-mdr as git submodule, due to conflicts with being a sub directory of an existing automake project, ospf-mdr will now be checked out to parent directory of core 2020-09-09 16:17:29 -07:00
Blake Harnden
9e3d6681c5 daemon: added ospf-mdr checkout out to the current latest commit as a sub module to help avoid future changes breaking a working state and a common place to keep files for uninstall 2020-09-09 14:23:37 -07:00
Blake Harnden
d981d88a6f daemon: update how emane is started on nodes, fixing issue with multiple interfaces running emane, added test case to check on this in the future 2020-09-09 10:27:06 -07:00
Blake Harnden
82d87445b6 grpc: added some convenience functions for move node streaming in wrapped client 2020-09-05 10:34:08 -07:00
Blake Harnden
98a51ce17d grpc: implemented wrapper stream classes for using the wrapped client 2020-09-05 10:19:44 -07:00
Blake Harnden
c4a724ee10 daemon: added more wrapping classes, updated grpc.clientw to leverage wrapped classes for listened events 2020-09-02 12:08:21 -07:00
Blake Harnden
a80fda11f5 daemon: abstracted out iface specific configuration generation and parsing to common utilities, to avoid duplicate logic and potential differences that may arise 2020-09-02 09:44:45 -07:00
Blake Harnden
e775ad4c5d fixed invoke task to run emane tests, added emane xml tests for node/interface specific configurations 2020-09-01 17:47:24 -07:00
Blake Harnden
ba028a2b00 daemon: just assign emane model, instead of triggering position hooks during non-runtime cases 2020-09-01 17:16:05 -07:00
Blake Harnden
570ad9522c initial code for a wrapped grpc client, fix for pygui node emane config, fix for xml reading emane configs specific to nodes/interfaces, fix for adding emane nodes and setting the emane model properly 2020-09-01 16:19:01 -07:00
Blake Harnden
b0bac1d319 daemon: moved grpc wrapper classes to core.grpc.wrappers 2020-08-27 11:02:02 -07:00
Blake Harnden
f6992e7545 daemon: moved service boot error to core.errors with all other core specific errors 2020-08-27 10:46:55 -07:00
Blake Harnden
5300eef27e daemon: added a more specific error to be thrown when a service does not exist 2020-08-27 10:43:13 -07:00
bharnden
87ca431e73
Merge pull request #507 from coreemu/develop
Develop
2020-08-21 21:12:03 -07:00
Blake Harnden
534af7cc45 set dependencies to currently known working versions to help avoid possibilities for unaccounted cases 2020-08-21 20:52:59 -07:00
Blake Harnden
1b05ca0553 updated changelog 2020-08-21 14:29:10 -07:00
Blake Harnden
4836ac4f2e daemon: small doc change and fix to corehandlers.py sending back proper data for hooks 2020-08-21 14:28:01 -07:00
Blake Harnden
9e5793ab6e updated changelog to add 7.1.0 changes 2020-08-21 11:59:25 -07:00
Blake Harnden
1c2a451fd3 bumped version to 7.1.0 2020-08-21 11:35:55 -07:00
Blake Harnden
05247524d7 updates to service dependency resolution to allow for multithreaded startup, also improved tests to validate service boot ordering for expected outcomes 2020-08-21 11:34:12 -07:00
Blake Harnden
f687115522 bump grpc worker limit to 1000, this does not mean it is a good idea to have this many connections, but at least helps allow trade offs for how to approach a problem 2020-08-20 16:18:20 -07:00
Blake Harnden
936d782e41 daemon: modified node service boot to properly order services and account for services with the same dependency without cycles, for now removed trying to simultaneously booting services 2020-08-18 13:18:41 -07:00
Blake Harnden
3e41d31c6c daemon: refactored missed LinkTlv INTERFACE_NAME fields to IFACE_NAME to match other refactoring done in 7.0.0 release 2020-08-17 20:04:42 -07:00
Blake Harnden
b98ff0f744 grpc: fixed issue with grpc throughputs checking session id matches using bad values 2020-08-10 12:46:21 -07:00
Blake Harnden
6dd7ce731e removed invoke run task, since core-python provides a better means to do the same thing, updated install doc page to reflect this, removed old emane install from emane docs page 2020-08-07 22:04:34 -07:00
Blake Harnden
b89a19a18e grpc: update node events to include icon, pygui: updated handling node events to update icon when there is a change 2020-08-05 12:10:27 -07:00
Blake Harnden
8004be6e7c grpc: update client edit_node doc 2020-08-05 09:37:23 -07:00
Blake Harnden
9352c0eafe install: added core-python wrapper script to core virtual environment 2020-08-04 21:11:17 -07:00
Blake Harnden
5976bca34b pygui: added view toggle for normal links 2020-08-04 16:32:39 -07:00
Blake Harnden
cd0351c818 pygui: added view option to toggle wireless edges 2020-08-04 16:20:51 -07:00
Blake Harnden
e2b3a2dc6d pygui: fixed issues with configuring services on nodes due to refactoring changes 2020-08-04 12:29:08 -07:00
Blake Harnden
082677c17b pygui: fixed issue saving selected background to xml when not located within the ~/.coregui/backgrounds directory 2020-08-03 16:37:31 -07:00
Blake Harnden
4bcaa32fdb pygui: fixed issue in task handling a returned boolean value, should be doing a none check 2020-08-03 16:29:35 -07:00
Blake Harnden
f41ce8e3a6 daemon: add core python environment variable to be able to refer to the virtual environment executable 2020-08-03 16:04:07 -07:00
Blake Harnden
06e43f619d install: update install complete message to avoid implying invoke is needed to run core 2020-08-03 10:40:48 -07:00
Blake Harnden
b7e3d1c877 pygui: fixed emane config dialog and emane model config dialogs to expand tabs the full height of the dialog 2020-08-02 10:47:01 -07:00
Blake Harnden
f0bc3bbc99 pygui: updates to leverage tk provided constants for sticky configuration, instead of duplicate strings everywhere 2020-08-02 10:36:14 -07:00
Blake Harnden
2aeb119b04 pygui: changes to display both link and asym link options on edges in canvas 2020-08-02 10:03:21 -07:00
Blake Harnden
06563d5953 pygui: fixed issue editing hook with a new name 2020-08-01 11:07:11 -07:00
Blake Harnden
fc44ad6fe8 pygui: update title to show xml file when one is opened, fixed issue creating nodes/links when not runtime due to refactoring, removed xml_file from coreclient and depend on the grpc GetSession wrapped data, grpc: added opened file information to GetSession call 2020-08-01 11:00:26 -07:00
Blake Harnden
04f7bc561b pygui: fixed exception from bad check when double clicking in sessions dialog 2020-07-31 23:23:18 -07:00
Blake Harnden
e7a93e7fd6 pygui: config dialogs that allow selecting a file default to ~/.coregui 2020-07-31 23:18:11 -07:00
Blake Harnden
eb422f5bab pygui: mac editing disabled for nodes during runtime 2020-07-31 23:13:07 -07:00
Blake Harnden
63103ab250 pygui: removed unused unlimited button from linkconfig dialog 2020-07-31 23:09:26 -07:00
bharnden
f54ddc0912
Merge pull request #504 from coreemu/bugfix/emane-mobility
Bugfix/emane mobility
2020-07-29 17:15:29 -07:00
Blake Harnden
46f896925c daemon: fixed mobility manager updates to support emane/wlan 2020-07-29 17:08:20 -07:00
Blake Harnden
d30778b238 daemon: fixed mobility checks to allow both wlan/emane, pygui: enabled emane nodes to configure mobility 2020-07-29 16:55:42 -07:00
bharnden
787f02f024
Merge pull request #502 from coreemu/cleanup/pygui-session-wrapper
Cleanup/pygui session wrapper
2020-07-29 12:19:17 -07:00
Blake Harnden
fe36d28522 pygui: fixed issue with changes to protobuf files for getting emane model configs on a session 2020-07-28 22:45:42 -07:00
Blake Harnden
858e771efd pygui: fixes for copying links/asymmetric links, fixes for configuring asymmetric links, fixed issues adding nodes/links and editing links from gui due to not being able to identify same source changes 2020-07-28 21:49:34 -07:00
Blake Harnden
2f2bb06a5b Merge branch 'develop' into cleanup/pygui-session-wrapper 2020-07-28 16:48:04 -07:00
Blake Harnden
0db1ad1195 Merge branch 'release-7.0.1' into develop 2020-07-28 16:47:34 -07:00
bharnden
1fdc5c5c5a
Merge pull request #501 from coreemu/release-7.0.1
Release 7.0.1
2020-07-28 16:44:58 -07:00
Blake Harnden
afe434f25c updated changelog for bugfix release 7.0.1 2020-07-28 16:39:16 -07:00
Blake Harnden
511a3037a8 bumped versions for release 2020-07-28 16:35:46 -07:00
Blake Harnden
9e3e0e0326 install: fixed issue identifying python versions to install dataclasses for, using ~ should account for any version up to 3.7 properly 2020-07-28 16:34:05 -07:00
Blake Harnden
0d2dd70727 daemon: changes usage of running scripts using /bin/sh to bash to help provide consistency in what could be ran, added bash as a dependency in installation scripts, added bash as an executable check during startup 2020-07-28 16:13:37 -07:00
Blake Harnden
27495cbda1 pygui: changes around using session.nodes instead of canvas_nodes when possible 2020-07-28 10:24:01 -07:00
Blake Harnden
588afaad13 pygui: changes to make use of wrapped session object and wrapped nodes to maintain and retrieving configurations information 2020-07-28 00:03:15 -07:00
Blake Harnden
3bdd6292cd grpc: update GetSession to return all session related information, rather than needing 8 different calls, pygui: updated session protobuf wrapper to handle all new data 2020-07-27 18:19:51 -07:00
bharnden
160498336c
Merge pull request #499 from coreemu/enhancement/pygui-wrappers
Enhancement/pygui wrappers
2020-07-26 23:31:05 -07:00
Blake Harnden
41a3c5fd7f pygui: added wrapper class for sessions returned by grpc GetSession 2020-07-26 11:45:40 -07:00
Blake Harnden
82a212d1cf pygui: modified usages of protobufs within coreclient to use module namespace to make more obvious, replaced config services and services with wrappers 2020-07-25 20:27:11 -07:00
Blake Harnden
a9a2fb8e46 pygui: added wrapper for throughput events, fixed sending nodes/links for configuration 2020-07-25 19:43:24 -07:00
Blake Harnden
77f6577bce pygui: added wrappers for most usages of protobufs within pygui 2020-07-25 10:30:14 -07:00
Blake Harnden
154fa8b77d pygui: replaced hook with wrapped hook class, fixed hook dialog edit 2020-07-24 22:00:38 -07:00
bharnden
eb70386238
Merge pull request #498 from coreemu/develop
7.0.0
2020-07-23 21:30:18 -07:00
Blake Harnden
ba3a247495 updated changelog for 7.0.0 2020-07-23 21:21:43 -07:00
Blake Harnden
fff4bd7963 moved cpu usage to a grpc call that the gui will listen to, fixed grpc stream typing to be grpc.Future, fixed pygui issue for start callback when a start fails, but there are no exceptions 2020-07-23 09:41:39 -07:00
Blake Harnden
3544d00431 pygui: implemented cpu usage monitor to status bar 2020-07-22 21:57:05 -07:00
Blake Harnden
f8d862a296 grpc/pygui: added grpc alert api, updated pygui to better handle and display alerts 2020-07-22 19:19:22 -07:00
Blake Harnden
e34002b851 pygui: added option to launch core-pygui into a specific session using an id 2020-07-22 17:18:35 -07:00
Blake Harnden
165e404184 added example dockerfile and build command to readme 2020-07-22 12:49:11 -07:00
Blake Harnden
45bfa9fdad small tweaks to docs 2020-07-21 16:52:17 -07:00
Blake Harnden
d5d5da7256 bumped version to 7.0.0 2020-07-21 10:08:12 -07:00
Blake Harnden
5e2ca0f549 daemon: refactored how to get required commands, added usage of this func for validating distributed servers when added 2020-07-18 11:56:48 -07:00
Blake Harnden
6d4434bc12 grpc: added set session user call, updated mobility to look for files within new gui as well, fixed pygui issue when start session has a grpc exceptions, showing and empty error window 2020-07-16 22:51:26 -07:00
Blake Harnden
36123e7aa5 updated frr daemons template file for the config service to align with changes to normal service 2020-07-16 14:21:06 -07:00
bharnden
e100defdec
Merge pull request #494 from apwiggins/patch-1
Update frr.py to add staticd to daemons list
2020-07-16 14:18:20 -07:00
apwiggins
fdf00cff0e
Update frr.py to add staticd to daemons list
Add staticd to the list of possible daemons to be started.
http://docs.frrouting.org/en/latest/setup.html#daemons-configuration-file
https://github.com/coreemu/core/issues/397
2020-07-16 18:00:12 -03:00
bharnden
90d24a1094
Merge pull request #493 from b00ga/patch-1
Increase height of options dialogue in TCL gui
2020-07-16 13:37:22 -07:00
Shawn Kelly O'Shea
35b4c157a0
Increase height of options dialogue in TCL gui
We have emane models with  a large list of options. Without this modification, a user cannot access all of the options provided by the emane model (some of the options are cutoff and cannot be scrolled-down to).
2020-07-16 15:22:33 -04:00
Blake Harnden
6219d08416 enable centos 8 check to enable powertools repo for centos 8 when installing emane 2020-07-16 11:04:52 -07:00
Blake Harnden
1c2d7c6d12 added reinstall invoke task, added some simple detections for old core installations in install task 2020-07-16 10:35:16 -07:00
Blake Harnden
6b55061857 update dev gui doc for new installation 2020-07-16 10:09:26 -07:00
Blake Harnden
db4ef2b42e fixed core.conf commented out example path for core-pygui to use .coregui instead of .coretk 2020-07-16 10:02:56 -07:00
Blake Harnden
b50f058374 improved emane section in install doc 2020-07-16 09:26:08 -07:00
Blake Harnden
0be1972a29 update to running user scripts in install doc 2020-07-16 09:16:32 -07:00
Blake Harnden
1212e5ddf8 fix to avoid setting interface data for a mac to the string None, when not present 2020-07-16 08:59:57 -07:00
Blake Harnden
d1fd19edc6 updated doc examples for invoke tasks 2020-07-16 08:47:18 -07:00
Blake Harnden
c884ee27cd removed invoke tasks wrapping scripts, since they can be used directly, added invoke task help strings, add invoke task to run user scripts 2020-07-16 08:42:36 -07:00
Blake Harnden
495fbe5632 added protobuf-compiler to install emane task 2020-07-15 21:50:35 -07:00
Blake Harnden
897ecc6d35 updated install emane task to auto answer yes to installing system packages 2020-07-15 17:52:34 -07:00
Blake Harnden
33d100acff fix bad links in generated docs for grpc to point to latest on master 2020-07-15 17:09:32 -07:00
Blake Harnden
1c876819f1 task to automate installing emane 2020-07-15 16:50:04 -07:00
Blake Harnden
642af4fe47 slimmed down install documentation and added links to relevant tools and files 2020-07-15 16:22:03 -07:00
Blake Harnden
a1ea762b89 updates to help provide better install related documentation 2020-07-15 00:08:22 -07:00
bharnden
feb81ae876
Merge pull request #490 from coreemu/enhancement/poetry-invoke
Enhancement/poetry invoke
2020-07-15 14:44:04 -07:00
Blake Harnden
119a3640e4 remove duplicated progress usage when installing ospf mdr 2020-07-14 22:26:39 -07:00
Blake Harnden
1cadf8362f added a text spinner while installing/uninstalling 2020-07-14 22:09:00 -07:00
Blake Harnden
be2f7e1cae simplified invoke install/uninstall task, since daemon no longer formally installs 2020-07-14 13:42:59 -07:00
Blake Harnden
80194b3e38 moved python black configuration to pyproject.toml and fixed bad exclude 2020-07-14 13:33:40 -07:00
Blake Harnden
f8b0ab6ec3 moved isort config from setup.cfg to pyproject.toml 2020-07-14 13:24:16 -07:00
Blake Harnden
fdd2e6f1f1 removed references for excluding utm.py as it is no longer present 2020-07-14 12:54:13 -07:00
Blake Harnden
873fc0e468 removed daemon MANIFEST.in, poetry will provide 2020-07-14 12:49:40 -07:00
Blake Harnden
0cd3f6115d remove setup.py reference from github action 2020-07-14 12:37:29 -07:00
Blake Harnden
8c50d08121 removed setup.py and requirements.txt as poetry will be where this information will live 2020-07-14 12:33:13 -07:00
Blake Harnden
7b3f934e95 updated pyproject.toml to align with setup.py as is 2020-07-14 12:13:41 -07:00
Blake Harnden
df01f04444 removed python buid/installation from makefiles, poetry will handle 2020-07-14 12:08:05 -07:00
Blake Harnden
50f331d93e removed references to building and dealing with service files, as that will now be limited to the invoke task 2020-07-14 11:40:20 -07:00
Blake Harnden
05830c6830 removed fpm packaging, as it will not be used anymore, beyond distributed packages 2020-07-14 11:25:40 -07:00
Blake Harnden
f00d4aef0b update install doc to note centos 8 and netem 2020-07-14 11:02:00 -07:00
Blake Harnden
dfb3e0c424 default install docs and script to poetry based installs 2020-07-14 10:42:24 -07:00
Blake Harnden
6b5aaa6b19 adjust how invoke install prefix is used for core configure 2020-07-14 10:01:57 -07:00
Blake Harnden
08105cf4b3 updated list of invoke tasks in doc 2020-07-14 09:44:28 -07:00
Blake Harnden
35b6f5297a update doc and install to properly set and provide options for OSs like centos who need a different prefix 2020-07-14 09:42:14 -07:00
Blake Harnden
6c7e760f4e tweak to install doc 2020-07-14 09:31:05 -07:00
Blake Harnden
5d23be4a9d updates to install2.md to replace install docs 2020-07-14 09:30:04 -07:00
Blake Harnden
e283c5ec7d broke out invoke tasks for installing scripts and service, testing centos not needing prefix 2020-07-14 09:24:59 -07:00
Blake Harnden
cb66ba60a6 removed kernel-modules-extra, so it is only attempted in centos8 2020-07-14 08:54:08 -07:00
Blake Harnden
125d74e7d5 removed pipenv specific files, wont be needed with poetry 2020-07-14 08:34:02 -07:00
Blake Harnden
bd87403ae5 add prefix option to install2.sh script 2020-07-13 14:13:32 -07:00
Blake Harnden
79058810c2 added uninstall invoke task to uninstall core files added with the invoke install command, beyond system packages 2020-07-13 13:48:27 -07:00
Blake Harnden
63f09e0254 added installation of modified scripts and service to invoke task 2020-07-13 13:14:13 -07:00
Blake Harnden
32c7808cab fixed bad version for grpcio tools 2020-07-13 09:01:55 -07:00
Blake Harnden
dcf3568098 force grpcio related installations to all use the same version to avoid any version conflicts 2020-07-13 08:58:32 -07:00
Blake Harnden
5c58e99ad4 updated pre-commit file to use poetry environment 2020-07-11 22:11:23 -07:00
Blake Harnden
ec45d7198b ci: changes to switch to poetry 2020-07-11 16:17:50 -07:00
Blake Harnden
4d35e8f968 Merge branch 'develop' into enhancement/poetry-invoke 2020-07-11 15:23:30 -07:00
Blake Harnden
5a35431bcb updated grpcio-tools installation to specifically specify binary requirement and updated doc 2020-07-11 15:08:04 -07:00
Blake Harnden
28281c6bde Merge branch 'develop' into enhancement/poetry-invoke 2020-07-11 15:04:43 -07:00
Blake Harnden
68ff7a86c8 fixed install script issues with grpcio-tools and updated documentation 2020-07-11 15:00:09 -07:00
Blake Harnden
e704483527 update install script to avoid issues with recent grpcio-tools and pip binary packages 2020-07-11 14:26:06 -07:00
Blake Harnden
7398196dcc pygui: dont show mobility player when joining sessions not in runtime 2020-07-11 14:06:53 -07:00
Blake Harnden
d0e9cee650 added invoke task to help wrap core-cli 2020-07-10 20:29:47 -07:00
Blake Harnden
80eaa27469 created baseline doc to support poetry based installations 2020-07-10 20:02:41 -07:00
Blake Harnden
8cf89fa114 invoke install, change ebtables-legacy from error to warning, since we dont exit 2020-07-10 17:57:10 -07:00
Blake Harnden
737dae1224 invoke install, added message for failed kernel netem enable in centos 8 and exit with error 2020-07-10 17:56:30 -07:00
Blake Harnden
d2fe7fcff0 invoke install account for centos 8 netem not being installed/enabled and add warning for failed ebtables legacy support 2020-07-10 16:50:37 -07:00
Blake Harnden
9c13803e52 Merge branch 'develop' into enhancement/poetry-invoke 2020-07-10 16:02:51 -07:00
Blake Harnden
a9ec21c604 add make dependency to redhat based invoke installs, since centos 8 does not have it by default 2020-07-10 14:20:13 -07:00
Blake Harnden
637f7740d6 added git as invoke install dependency for ospf-mdr just in case core was a source tarball 2020-07-10 13:00:38 -07:00
Blake Harnden
ece2f1c43f added invoke cleanup message 2020-07-10 12:53:21 -07:00
Blake Harnden
980ab1526d added invoke cleanup task 2020-07-10 12:52:12 -07:00
Blake Harnden
75acbf4dae invoke install account for ebtables based on nf_tables 2020-07-10 12:41:39 -07:00
Blake Harnden
8a60a4739f fixed missing invoke install argument 2020-07-10 12:24:23 -07:00
Blake Harnden
7c3e42396a invoke install acount for centos prefix issues, add usage of nproc for make -j 2020-07-10 12:20:27 -07:00
Blake Harnden
9b541d0316 adding invoke change to support grpcio binary install 2020-07-10 12:09:04 -07:00
Blake Harnden
fe362a10d6 poetry changes to help force installing grpcio from binary packages, causing long build times on centos 2020-07-10 12:05:11 -07:00
Blake Harnden
626b977505 added ospf mdr redhat dependencies to invoke install 2020-07-10 11:30:12 -07:00
Blake Harnden
9bf5756a03 added invoke system dependencies for redhat 2020-07-10 11:20:27 -07:00
Blake Harnden
7821ffb642 python-devel is needed on centos 2020-07-10 10:51:06 -07:00
Blake Harnden
cd9ecd2257 added redhat like os to invoke task 2020-07-10 10:45:03 -07:00
Blake Harnden
38e6838697 avoid empty lines when parsing os-release 2020-07-10 10:39:14 -07:00
Blake Harnden
9b7dce0861 added example output after installation and note about getting a new terminal 2020-07-10 10:27:17 -07:00
Blake Harnden
85cd31ae52 fixed install2.sh argument parsing 2020-07-10 10:23:45 -07:00
Blake Harnden
a2a825e91d better invoke output and removed -j from building ospf mdr 2020-07-10 09:55:30 -07:00
Blake Harnden
51200cf930 added more messages to ospf mdr invoke install 2020-07-10 09:20:13 -07:00
Blake Harnden
7dd2b66680 added message for installing ospf mdr in install task 2020-07-10 08:58:09 -07:00
Blake Harnden
41f0c8ef95 fixed bad arguments being passed in install2.sh 2020-07-10 08:56:16 -07:00
Blake Harnden
8357cddbab added developer and verbose flags to poetry install 2020-07-10 08:51:40 -07:00
Blake Harnden
d4ac9e618f improvements to invoke tasks for installation 2020-07-10 08:32:47 -07:00
bharnden
139323146e
Update install2.sh
update to account for missing python3-venv package and updating PATH in script to run newly installed commands
2020-07-09 23:27:05 -07:00
Blake Harnden
a236ea2455 updates to poetry based installation 2020-07-09 23:01:28 -07:00
Blake Harnden
9fed908322 docs: adjustments to distributed documentation to be more complete 2020-07-08 11:56:23 -07:00
Blake Harnden
7a21affbd4 pygui: update nodes to display assigned server name when not localhost 2020-07-08 08:46:30 -07:00
Blake Harnden
43b586a1a1 daemon: updated xml to write and read session configured distributed servers, updated pygui to send servers before session start or saving xml 2020-07-08 08:24:23 -07:00
Blake Harnden
fb21909dad invoke/poetry: updated version in toml file and added invoke commands 2020-07-07 23:38:12 -07:00
Blake Harnden
3949bd6d1b Merge branch 'develop' into enhancement/poetry-invoke 2020-07-07 19:44:41 -07:00
Blake Harnden
bb4514b93e daemon: changes to saving and restoring server used for nodes in xml 2020-07-07 15:16:17 -07:00
Blake Harnden
f1ff1a6577 pygui: only attempt to run observer commands on container nodes 2020-07-07 14:24:43 -07:00
Blake Harnden
6648dc7825 pygui: service and config service dialogs will now properly show services for default group selected 2020-07-07 08:46:47 -07:00
Blake Harnden
c761c55ebc tests: patch utils.which 2020-07-06 21:47:46 -07:00
Blake Harnden
0045c8d79c pygui: avoid trying to bring up a terminal for rj45 nodes 2020-07-06 21:37:04 -07:00
Blake Harnden
6f7e42d310 daemon: avoid command error logging when checking for emane version as validation for checking if emane is installed 2020-07-06 21:32:43 -07:00
bharnden
3590f2c370
Merge pull request #484 from coreemu/enhancement/runtime-emane-link
Enhancement/runtime emane link
2020-07-06 21:18:29 -07:00
Blake Harnden
8dc570a98d daemon: removed commented out code 2020-07-06 21:13:54 -07:00
Blake Harnden
b3a4b1cb10 daemon: updates to support running emane on the fly for a newly connected link 2020-07-05 21:56:22 -07:00
Blake Harnden
5cc4d92760 daemon: removed nem map from individual emane networks, all nems are stored and generated from the emane manager 2020-07-05 21:29:03 -07:00
Blake Harnden
fcda1f9f14 daemon: CoreInterface now defaults to a virtual transport type, added utility methods to check if an interface is virtual/raw, cleaned up all emane code using these types of checks 2020-07-03 09:08:36 -07:00
Blake Harnden
ac1c27b1c8 daemon: fixed issues when emane generated platform.xml for raw interfaces 2020-07-03 08:51:17 -07:00
Blake Harnden
ddcb0205f3 daemon: cleaned up emane stopdaemons logic 2020-07-02 23:32:59 -07:00
Blake Harnden
2b3e26b7c2 daemon: cleanup emane transport service in relation to refactoring, silenced stopdaemons for rj45 nodes 2020-07-02 23:19:40 -07:00
Blake Harnden
5f676b27ba tests: removed invalid patch due to emane refactoring 2020-07-02 22:15:12 -07:00
Blake Harnden
ce4b61d3b2 daemon: further heavy cleanup to how emane generates and runs xml files 2020-07-02 17:49:56 -07:00
Blake Harnden
bd48e14348 daemon: initial changes to rework logic to start emane for a given interface 2020-07-02 15:37:51 -07:00
Blake Harnden
e549830e33 core-cli: fix to avoid errors for querying nodes with peer to peer links, until there is a proper way to get the other ends node name 2020-07-01 15:20:53 -07:00
Blake Harnden
da9c0d0660 daemon: initial changes to breakout custom interface creation for networks that require it, without being emane specific 2020-07-01 14:40:19 -07:00
Blake Harnden
a870c15b43 pygui: fixed joining sessions with mobility players 2020-07-01 12:11:34 -07:00
Blake Harnden
08bbaf463b core-cli: updated xml command to use a flag argument to be consistent for now 2020-07-01 11:06:09 -07:00
Blake Harnden
7a6c602369 core-cli: cleaned up core client usage by way of a decorator, helps provide convenient grpc error catching 2020-07-01 11:01:44 -07:00
Blake Harnden
3477e84e9d core-cli: added wlan set/get config, fixed session option for node/link interactions 2020-07-01 09:30:05 -07:00
Blake Harnden
537291b219 core-cli: added open xml command to a session xml and optionally start it 2020-06-30 22:16:00 -07:00
Blake Harnden
f22edd1d25 grpc: fixed accidental breakage for get_session ptp links 2020-06-30 16:16:58 -07:00
Blake Harnden
4a0fdf3307 core-cli: add function for printing protobuf responses as json 2020-06-30 15:21:33 -07:00
Blake Harnden
beaebcfa24 grpc: added node_id and net2_id data to interface protos to allow querying a node to provide the node and networks an interface is associated with 2020-06-30 12:34:20 -07:00
Blake Harnden
ab17cb1053 grpc: grpc get_session will no longer return peer to peer nodes, they should be invisible to users, updated core-cli to print human readable links better 2020-06-30 09:50:28 -07:00
Blake Harnden
d480a1dd4c grpc: removed LinkOptions opaque as it was not being used 2020-06-30 09:38:22 -07:00
Blake Harnden
69721dc129 grpc: updated client edit_node to have source as last parameter to be consistent with source placement on all other functions 2020-06-30 09:32:56 -07:00
Blake Harnden
aef3fe8d50 updated core-cli to use consistent shorthand options and existing longform options 2020-06-30 09:25:36 -07:00
Blake Harnden
ec845b920c removed ip mask options from core-cli add link, combined with ip and will parse input to provide simpler interface 2020-06-30 08:27:40 -07:00
Blake Harnden
59e7395a4f initial addition of core-cli script that can be used to run commands and query information with sessions using grpc, similar in concept to coresendmsg 2020-06-29 23:00:33 -07:00
Blake Harnden
c8daeb02d8 grpc: fixed issue with not catching error in delete_node from broadcast changes 2020-06-26 22:29:17 -07:00
Blake Harnden
5eae67aac5 grpc/pygui: updated add_node source support, updated pygui to handle add_node events 2020-06-26 22:11:36 -07:00
Blake Harnden
e79645013b grpc/pygui: updated delete_node to use the source, updated pygui to support delete node events 2020-06-26 21:45:29 -07:00
bharnden
adf28f6b55
Merge pull request #481 from coreemu/enhancement/broadcast-links
Enhancement/broadcast links
2020-06-26 15:33:52 -07:00
Blake Harnden
f4a3fe6b7b grpc/pygui: edit_link will now broadcast link changes, pygui now handles receiving this data 2020-06-26 15:14:30 -07:00
Blake Harnden
f921fa45c5 grpc: updated client methods to allow passing source for add_link/delete_link, None by default 2020-06-26 14:44:13 -07:00
Blake Harnden
aebbff8c22 grpc/pygui: shifted source field in node events to base event message to apply to all events, updated add_link/delete_link rpc calls to broadcast events, updated pygui to handle these events 2020-06-26 14:39:12 -07:00
Blake Harnden
eac941ce72 pygui: updates to show wireless edges in details panel, increased edge thickness to be the same as normal edges for selection to be easier 2020-06-26 09:13:38 -07:00
Blake Harnden
f4224d1b80 daemon: updated ovs option to be a formal session option, will now display within gui, save to and be read from xml 2020-06-25 22:05:10 -07:00
Blake Harnden
b94d4d3507 daemon: updated open xml with start flag to set instantiation state before running instantiate to be consistent with other cases 2020-06-25 21:34:45 -07:00
Blake Harnden
3bfc299bfd daemon: fixed typo in core.configservices.securityservices 2020-06-25 16:22:56 -07:00
Blake Harnden
98e4baca04 pygui: added services to node info panel 2020-06-25 15:05:24 -07:00
bharnden
d746cfa935
Merge pull request #477 from coreemu/feature/pygui-sidebar
pygui: added support for a details pane, can be toggled on/off, can b…
2020-06-25 10:38:35 -07:00
Blake Harnden
f582306bb9 pygui: added support for a details pane, can be toggled on/off, can be used to quickly view details for nodes or links 2020-06-25 10:35:01 -07:00
Blake Harnden
bb2ceaf993 pygui: draw link options on edges 2020-06-23 22:53:48 -07:00
Blake Harnden
6490b5b9cb pygui: fixed and changed custom service copy to focus only on copying the current file displayed from any other nodes with a customized version 2020-06-23 16:11:39 -07:00
Blake Harnden
60d9fe2026 pygui: clear throughput labels when disabling throughput 2020-06-23 14:48:27 -07:00
Blake Harnden
7215f852b8 grpc: added check for emane pathloss when nem id is None and throw an error 2020-06-23 13:34:40 -07:00
Blake Harnden
9649337f18 daemon: updated xml to save links using consistent iface1/2 naming, still fallback to reading interface_one/two 2020-06-23 13:31:31 -07:00
Blake Harnden
14573184e0 pygui: fixed syning session location settings when not in runtime mode, for saving xml 2020-06-23 13:28:41 -07:00
Blake Harnden
8e2cfa61c9 pygui: size and scale meter width and height are no longer editable, but will dynamically update with changes to related size/scale values 2020-06-23 10:09:16 -07:00
bharnden
29a69e8b40
Merge pull request #476 from coreemu/cleanup/executables
Cleanup/executables
2020-06-23 09:46:48 -07:00
Blake Harnden
6dd6bc87ab daemon: renamed executable variables to be simpler 2020-06-23 09:35:11 -07:00
Blake Harnden
8f19ad057c daemon: cleaned up requirement check, updated github workflow to modify correct file 2020-06-23 09:24:40 -07:00
Blake Harnden
e0c9f9c832 daemon: moved executable check to CoreEmu and separated them into their own module core.executables 2020-06-23 09:11:37 -07:00
Blake Harnden
c43dd60a42 daemon: small adjustment in sdt.py 2020-06-22 21:47:03 -07:00
Blake Harnden
1ef66181c6 daemon: moved QUAGGA_STATE_DIR from constants.py to quagga service files 2020-06-22 21:39:29 -07:00
Blake Harnden
2145c07cb7 daemon: moved FRR_STATE_DIR from constants.py to frr service files 2020-06-22 21:36:39 -07:00
Blake Harnden
f39ab1dee6 pygui: limit rj45 node to 1 link 2020-06-22 21:13:24 -07:00
Blake Harnden
27e35a5213 pygui: session options dialog is disabled during runtime 2020-06-22 19:40:42 -07:00
Blake Harnden
344f35e93e pygui: updated ConfigFrame to have a disabled display option, updated nodes to stil show emane config during runtime, updated emane dialog and config dialogs to be in a viewable but disabled state during runtime 2020-06-22 19:04:55 -07:00
Blake Harnden
527d34e374 pygui: added type hinting to class variables for core.gui.dialogs 2020-06-22 11:04:33 -07:00
Blake Harnden
11be40bc90 pygui: added class variable type hinting to core.gui.graph 2020-06-19 23:24:07 -07:00
Blake Harnden
0356f3b19c pygui: added type hinting to everything under base core.gui 2020-06-19 22:08:24 -07:00
Blake Harnden
adfce52632 daemon: removed utils.validate_mac and shifted tests to test_nodes 2020-06-19 15:41:41 -07:00
Blake Harnden
0d4a360e89 daemon: removed utils.validate_ip and shifted tests to test_nodes 2020-06-19 15:32:17 -07:00
Blake Harnden
1829a8e2f8 daemon: refactored CoreInterface.mac from a string to a netaddr.EUI object, providing more functionality 2020-06-19 15:21:45 -07:00
Blake Harnden
cfda9509a2 daemon: refactored TunTap setaddrs to set_ips to be more consistent with new naming 2020-06-19 13:52:59 -07:00
Blake Harnden
f07176dd43 daemon: provide safe fallback for emane install ifaces, in case external configuration does not exist 2020-06-19 13:51:11 -07:00
Blake Harnden
cd6083aed9 daemon: fixed issue not checking if an emane interface is a TunTap before using a specific function, fixed issue not looking for possible iface specific configuration for external 2020-06-19 13:44:28 -07:00
Blake Harnden
df9216e0f0 updated scripting docs to use new naming and fixed out bad example 2020-06-19 13:28:11 -07:00
Blake Harnden
88fe860f97 fixed examples using IpPrefixes class 2020-06-19 13:25:47 -07:00
Blake Harnden
19af9c3f51 daemon: added proper checks for FRRService calls 2020-06-19 11:18:39 -07:00
bharnden
3638b05cd1
Merge pull request #475 from coreemu/cleanup/interface-addresses
Cleanup/interface addresses
2020-06-19 11:15:26 -07:00
Blake Harnden
9e4429fbbc daemon: refactored InterfaceData.get_addresses to InterfaceData.get_ips 2020-06-19 11:11:45 -07:00
Blake Harnden
20feea8f12 daemon: refactored usages of addr to ip and updated functions to align 2020-06-19 10:54:58 -07:00
Blake Harnden
d88f3a2535 daemon: refactored CoreInterface.addrlist storing strings into CoreInterface.ip4s and ip6s, stored as netaddr.IPNetwork objects 2020-06-19 08:50:36 -07:00
Blake Harnden
ca2b1c9e4c daemon: refactored all_link_data to links 2020-06-18 21:33:28 -07:00
Blake Harnden
b2ea8cbbf6 daemon: added type hinting throughout config services 2020-06-18 14:15:45 -07:00
bharnden
a09910d0bc
Merge pull request #474 from coreemu/cleanup/service-type-hinting
daemon: added type hinting throughout all services and made small twe…
2020-06-18 13:08:25 -07:00
Blake Harnden
cd74a44558 daemon: added type hinting throughout all services and made small tweaks/fixes that were ran across 2020-06-18 12:54:36 -07:00
bharnden
250bc6e1f5
Merge pull request #472 from coreemu/cleanup/interfaces-to-iface
interface and related functions renaming
2020-06-18 10:23:37 -07:00
Blake Harnden
e46a072f74 daemon: removed missing params from python docs, updated node ValueErrors to CoreErrors 2020-06-18 09:33:54 -07:00
Blake Harnden
ecc3eb1c89 daemon: refactored NodeData to reference a node instead of replicating fields as an intermediate passthrough, removed data() functions from nodes due to this change 2020-06-18 09:06:31 -07:00
Blake Harnden
1702fe256f doc: updated refactored example in documentation 2020-06-18 00:30:39 -07:00
Blake Harnden
3d7d775bfb daemon: removed unused variables from LinkOptions 2020-06-18 00:15:44 -07:00
Blake Harnden
5d34a2b752 daemon: removed opaque from NodeBase, since it is not used 2020-06-17 22:59:50 -07:00
Blake Harnden
b92ff0586a daemon: renamed NodeData.node_type to type, removed NodeData/NodeOptions fields that were not being used for clarity 2020-06-17 22:43:13 -07:00
Blake Harnden
a64047e221 fixed issue with xorp service depending on old MacAddress class 2020-06-16 23:27:17 -07:00
Blake Harnden
f4671ab2b8 daemon: refactored usages of hwaddr to mac and be consistent everywhere 2020-06-16 23:25:26 -07:00
Blake Harnden
a1734c3bc0 grpc: updated Interface proto fields to be more consistent with code, ip4mask to ip4_mask, ip6mask to ip6_mask, netid to net_id, flowid to flow_id 2020-06-16 22:05:36 -07:00
Blake Harnden
351b99aae0 daemon: renamed LinkData.link_type to LinkData.type and removed LinkOptions.type to remove redundant information, link_type param added to session.add_link, delete_link, and update_link functions 2020-06-16 21:53:12 -07:00
Blake Harnden
a29a7a5582 refactored LinkOptions to be used within LinkData, instead of duplicating data, removed session from LinkOptions and LinkData 2020-06-16 14:18:19 -07:00
Blake Harnden
eeca33e722 combined core.emulator.data and core.emulator.emudata, updated LinkData to leverage InterfaceData, instead of repeated interface fields, removed session from LinkData and LinkOptions 2020-06-16 12:50:24 -07:00
Blake Harnden
0725199d6d initial sweeping changes to call all usages of various interface related variables and functions (netif, interface, if, ifc, etc) to use a consistent name iface 2020-06-16 09:30:16 -07:00
Blake Harnden
0462c1b084 daemon: added usage of ABC to NodeBase, CoreNodeBase, and CoreNetworkBase to help enforce accounting for abstract functions 2020-06-14 13:35:06 -07:00
Blake Harnden
f5916fab5b daemon: added not implemented methods to CoreNodeBase 2020-06-14 12:44:51 -07:00
bharnden
38257de740
Merge pull request #471 from coreemu/cleanup/move-node-start
Cleanup/move node start
2020-06-14 12:41:07 -07:00
Blake Harnden
cf41948894 daemon: fixed error with EmaneNet startup throwing an error, updated Rj45Node and PhysicalNode to implement all abstract methods 2020-06-14 12:36:07 -07:00
Blake Harnden
c4c667bb74 daemon: removed node.startup from inside constructor, session is now responsible, providing more control and avoiding issues when using super calls where you dont want to start just yet 2020-06-14 09:37:58 -07:00
Blake Harnden
3243a69afa daemon: updated xml files to use node1 and interface1 instead of node_one and interface_one, will still fallback to parse old names 2020-06-14 00:46:11 -07:00
Blake Harnden
8587da0621 daemon: moved node instantiation into lock to guarantee id uniqueness, removed node count from environment as it also attmpts to use lock and wouldnt be accurate either 2020-06-13 23:50:08 -07:00
Blake Harnden
d94bae6b42 daemon: added class variable type hinting to core.services.coreservices 2020-06-13 22:25:38 -07:00
Blake Harnden
91f1f7f004 daemon: added global type hinting to core.emulator.session and core.api.grpc.server 2020-06-13 22:01:07 -07:00
Blake Harnden
8d48393525 daemon: updated usage of if1/2 to be consistent with interface1/2 for now 2020-06-13 21:53:09 -07:00
Blake Harnden
5df2e36083 daemon: fixed session.add_event parameter to be specific to node_id 2020-06-13 21:48:51 -07:00
bharnden
0bcf7c1d83
Merge pull request #470 from coreemu/cleanup/variable-names
refactor variables to use numbers instead of letters
2020-06-13 21:27:41 -07:00
Blake Harnden
83f66d33f7 merged latest from develop 2020-06-13 18:07:21 -07:00
Blake Harnden
e18ffaafce daemon: xml files will now write and read loss, but fallback to looking for per for compatibility 2020-06-13 17:41:13 -07:00
bharnden
b74395049a
Merge pull request #469 from coreemu/cleanup/per-to-loss
converted usages of per to loss
2020-06-13 17:26:54 -07:00
Blake Harnden
23d957679e daemon: Session cleanup, removed unused functions, used context managers for writing files, made variables used externally no longer private 2020-06-12 20:22:51 -07:00
Blake Harnden
178d12b327 daemon: updated variables for InterfaceData to be denote data to make it more clear 2020-06-12 17:32:55 -07:00
Blake Harnden
876699e8ef variable/grpc cleanup to rename everything using spelt out numbers instead of actual numbers 2020-06-12 16:52:41 -07:00
Blake Harnden
76305f7257 converted usages of per to loss 2020-06-12 12:49:53 -07:00
Blake Harnden
b28ef76d65 daemon: added class variable type hinting to core.config 2020-06-12 10:05:49 -07:00
Blake Harnden
6201875b78 daemon: added class variable type hinting to core.emane 2020-06-12 09:52:01 -07:00
Blake Harnden
ef3cf5697d daemon: added class variable type hinting for core.xml 2020-06-12 08:54:06 -07:00
Blake Harnden
cfaa9397ad daemon: added class variable type hinting to core.api.grpc 2020-06-12 08:34:02 -07:00
Blake Harnden
e72e332bab daemon: removed need to use getaddr for CoreInterface.othernet as it now has a default of None 2020-06-11 19:12:51 -07:00
Blake Harnden
00cda5c550 fixed test_link name 2020-06-11 19:08:50 -07:00
Blake Harnden
c64094ac1c daemon: updated session.delete_link to have the interface ids default to none, since only one may need to be provided, updated link tests to account for more cases 2020-06-11 19:01:38 -07:00
bharnden
f626564200
Merge pull request #468 from coreemu/cleanup/session-add-link
daemon: refactored add_link,update_link,delete_link to have more spec…
2020-06-11 16:26:58 -07:00
bharnden
e0842197e3
Merge pull request #467 from coreemu/develop
Develop
2020-06-11 15:43:10 -07:00
Blake Harnden
f2409d0604 updated changelog for 6.5.0 2020-06-11 15:40:25 -07:00
Blake Harnden
e325bcfc55 bumped version for release 2020-06-11 14:41:05 -07:00
Blake Harnden
ccf2646c00 daemon: refactored add_link,update_link,delete_link to have more specific logic, refactored CoreNodeBase to have newnetif and for it to return the interface created 2020-06-11 13:59:29 -07:00
Blake Harnden
9ed42cfba8 pygui: avoid issue when joining opened xml that has a node with no ip4 address 2020-06-10 11:04:33 -07:00
Blake Harnden
39fd11efb3 daemon: added missing type hint to core.nodes.interface.CoreInterface 2020-06-10 10:40:24 -07:00
Blake Harnden
a389dc6240 daemon: improve type hinting for WayPoint 2020-06-10 10:31:13 -07:00
Blake Harnden
784c4d2419 daemon: added core.location class variable type hinting 2020-06-10 10:24:44 -07:00
Blake Harnden
fd341bd69b daemon: added class variable type hinting to core.plugins 2020-06-10 09:01:38 -07:00
Blake Harnden
6ee9590bdc daemon: finished class variable type hinting for core.nodes 2020-06-10 08:52:51 -07:00
Blake Harnden
452e0720f2 daemon: added type hinting to DistributedControll and removed bad logic looking for tunnels during add_link 2020-06-09 21:03:19 -07:00
Blake Harnden
32ad8a9b68 daemon: added type hinting to Session 2020-06-09 20:03:32 -07:00
Blake Harnden
a79ba1b8d3 daemon: added type hints to CoreEmu 2020-06-09 19:48:29 -07:00
Blake Harnden
4cc9d3debf added pydoc for grpc client InterfaceHelper 2020-06-09 18:59:14 -07:00
Blake Harnden
f73c617ecf daemon: removed utils.make_tuple and last remaining usage 2020-06-09 18:53:42 -07:00
Blake Harnden
d71d84fae7 daemon: updated IpPrefixes and InterfaceHelper to remove duplicate code 2020-06-09 18:40:50 -07:00
Blake Harnden
21da670698 daemon: renamed link_options to options in both session.add_link and session.update_link 2020-06-09 13:46:26 -07:00
Blake Harnden
2965273f58 daemon: CoreNetworkBase.linkconfig now takes a LinkOptions object, removed usage of emudata.link_config 2020-06-09 13:41:31 -07:00
Blake Harnden
3be15a1316 daemon: update CoreNode.newnetif to require parameters, CoreNode.newnetif now depends on being provided InterfaceData 2020-06-09 12:42:15 -07:00
Blake Harnden
3691c6029f updated corexml InterfaceData instantiation to use named params 2020-06-09 10:48:50 -07:00
Blake Harnden
7d2034df71 daemon: updated NodeOptions to leverage dataclass 2020-06-09 10:45:18 -07:00
Blake Harnden
b5e53e573a daemon: LinkOptions now leverage dataclass and has type hinting, improve test_gui type hinting 2020-06-09 09:12:31 -07:00
Blake Harnden
18044f9474 daemon: cleaned up InterfaceData class, it now leverages dataclass, removed extra bloat and no longer requires parameters as they are optional 2020-06-09 08:48:18 -07:00
Blake Harnden
6ddf1ac9a4 removed IdGen class, added simple function to find next valid node id 2020-06-09 00:56:34 -07:00
Blake Harnden
199c4618f5 removed comments about rj45 removing addresses and setting to promiscuous, as that is not true and misleading 2020-06-08 10:08:26 -07:00
Blake Harnden
7ffbf457be update to netclient existing bridge check to avoid using the -j flag, which requires version 4.7+ vs 4.5+ that we currently expect 2020-06-08 09:55:05 -07:00
Blake Harnden
bf1bc511e2 removed configuration option for number of for corehandler threads as it cannot properly deal with anything more than 1, updated man pages to current 6.4 versions for now 2020-06-05 14:34:19 -07:00
Blake Harnden
75d5bced9c grpc doc improvements, grpc examples additions, small tweak to grpc client for setting emane models not requiring a config when using default configuration 2020-06-05 11:20:23 -07:00
Blake Harnden
9a5fc94ba2 improvements for grpc docs and upates to grpc client pydocs 2020-06-05 08:44:19 -07:00
Blake Harnden
eaa05c34ba avoid piping subprocess command output when not waiting for results 2020-06-04 21:14:11 -07:00
Blake Harnden
7b2dd59c81 grpc: node_command improvements to include return code and options for wait and shell when running commands 2020-06-04 13:48:25 -07:00
Blake Harnden
29d09c8397 updates to move_nodes and emane_pathlosses type hinting and naming 2020-06-03 14:58:29 -07:00
bharnden
e74481df34
Merge pull request #463 from coreemu/enhancement/grpc-emane-pathloss
grpc: implemened initial support for streaming emane pathloss events
2020-06-03 14:51:46 -07:00
Blake Harnden
3b0ca1638c grpc: implemened initial support for streaming emane pathloss events 2020-06-03 14:35:17 -07:00
bharnden
7048aa7867
Merge pull request #462 from coreemu/enhancement/grpc-node-stream
grpc: added call to stream node movements using geo/xy and tests to v…
2020-06-03 08:53:46 -07:00
Blake Harnden
1884103cb4 grpc: added call to stream node movements using geo/xy and tests to validate usage, fixed potential exception when not setting session geo ref and using conversions 2020-06-03 08:47:36 -07:00
Blake Harnden
0d2bcccf3e added initial files to support transitioning to using poetry/invoke to provide an environment for core 2020-06-02 14:48:57 -07:00
Blake Harnden
e323f8965e removed docs link to example service and embedded example into docs 2020-05-30 21:36:44 -07:00
Blake Harnden
c6a06baf29 add geo to grpc calls getting node values, updated emane position hook to set lon/lat/alt values 2020-05-30 14:24:38 -07:00
bharnden
d31cfedde9
Merge pull request #460 from coreemu/enhancement/network-policy-enum
added network policy enum to avoid string usage
2020-05-29 23:52:58 -07:00
Blake Harnden
82c33345be merged latest from develop 2020-05-29 23:47:31 -07:00
bharnden
13fb5db85d
Merge pull request #459 from coreemu/enhancement/transport-type-enum
turned transport type usages of raw and virtual across the board to a…
2020-05-29 23:44:11 -07:00
Blake Harnden
73a5567084 added network policy enum to avoid string usage 2020-05-29 23:22:21 -07:00
Blake Harnden
b034ba6cc3 turned transport type usages of raw and virtual across the board to an enumerated type 2020-05-29 22:48:00 -07:00
Blake Harnden
8ad3f7961a renamed netclient create_interface to set_interface_master to better describe its purpose 2020-05-29 22:07:50 -07:00
Blake Harnden
10fd844397 further type hinting for tests 2020-05-29 21:41:58 -07:00
bharnden
048fc1aaf9
Merge pull request #458 from coreemu/enhancement/rj45-cleanup
changes to make rj45 maintain the interface information, instead of t…
2020-05-29 21:30:36 -07:00
Blake Harnden
b88df84d62 removed logs from emane network all_link_data 2020-05-29 14:42:38 -07:00
Blake Harnden
183ffda570 daemon: changes to support providing emane wireless links in all_link_data, which makes it accessible over grpc 2020-05-29 11:48:00 -07:00
Blake Harnden
4ab415e37d grpc: updated node events to contain geo data when present 2020-05-28 16:12:11 -07:00
Blake Harnden
7e4ef0b280 changes to make rj45 maintain the interface information, instead of trying to be 2 classes at once 2020-05-25 23:18:20 -07:00
Blake Harnden
8fed201fd8 added type hints to class variables in nodes/physical.py 2020-05-25 11:33:59 -07:00
Blake Harnden
f95a8113c9 added type hinting to nodes/network.py class variables 2020-05-25 11:17:28 -07:00
Blake Harnden
2e78025249 started type hinting on class variables for nodes/base 2020-05-25 00:16:58 -07:00
Blake Harnden
ba8b16ec34 added some type hinting with tests to help in refactoring in the future 2020-05-24 23:37:38 -07:00
Blake Harnden
964f78f06a added othernet to CoreInterface to avoid hasattr checks 2020-05-23 01:14:47 -07:00
Blake Harnden
c580e15f8e moved common variables up and localname to CoreInterface, they were being created in all subclasses and avoids type hinting errors 2020-05-23 01:05:46 -07:00
Blake Harnden
37ff989aa4 fixed bad check in linkconfig 2020-05-23 00:19:32 -07:00
Blake Harnden
26b0868f65 removed devname from linkconfig as the only usage was of it was using a parametr that was already being passed in 2020-05-23 00:00:40 -07:00
Blake Harnden
dd13bc8379 moved linkconfig to CoreNetworkBase and made linkconfig defined the same across the board 2020-05-22 23:44:10 -07:00
Blake Harnden
fe09b37819 removed bootsh from CoreNode types as it was not being used 2020-05-21 22:41:03 -07:00
Blake Harnden
56fbc0e3c5 docker changes to avoid issues running commands without mount and running containers as prvileged to allow changing files in /sys 2020-05-21 22:26:54 -07:00
Blake Harnden
70bd837f02 Merge branch 'enhancement/type-checking-node-retrieval' into develop 2020-05-21 07:39:15 -07:00
Blake Harnden
bcd9e4ceb1 fixed session.add_hook to not require a source, since it was not typically used an None was being passed, cleaned up some bad type hinting in related to session.py 2020-05-21 00:20:05 -07:00
Blake Harnden
4b6ba90331 fixed bad type hint for EventData 2020-05-20 23:27:17 -07:00
bharnden
ffc60e5808
Merge pull request #453 from coreemu/enhancement/type-checking-node-retrieval
Enhancement/type checking node retrieval
2020-05-20 23:19:28 -07:00
Blake Harnden
d5016bf44f removed pointless wlan instance check in grpc wlan_link api since it is already being done when retrieving the wlan node 2020-05-20 22:36:04 -07:00
Blake Harnden
c07766e1eb updated session.add_node to use better type hinting and force usage of classes directly, instead of indirectly through NodeTypes 2020-05-20 22:14:03 -07:00
Blake Harnden
d5254e6a91 changes to support better type checking for retrieving an arbitrary node from a session, get_node now requires an expected class that the node would be an instance of, if the returned node is not an instance a CoreError is thrown, this also helps editors pick up expected types to account for variable/function usage better as well 2020-05-20 14:44:34 -07:00
bharnden
19ee367dc5
Merge pull request #451 from coreemu/enhancement/grpc-wlan-links
Enhancement/grpc wlan links
2020-05-20 11:40:46 -07:00
Blake Harnden
0a792f7b3f updates to grpc rpc wlan link, added node class type checking and hinting in grpc server code 2020-05-19 22:36:10 -07:00
Blake Harnden
d14056393b added grpc call to allow direct control of nodes connected through wlan to be linked or not 2020-05-19 16:46:44 -07:00
Blake Harnden
8bae0611a4 pygui: updated icon for observers tool on run menu, added observers to run menu and created custom observers widget 2020-05-19 00:35:48 -07:00
Blake Harnden
773f733cb8 pygui: changes to leverage common icon scaling function, fix issue with scaling toolbar 2020-05-18 23:25:42 -07:00
Blake Harnden
cde053da73 pygui: implemented toolbar based marker configuration, fixed some issues when switching between different node bar states 2020-05-17 23:08:53 -07:00
Blake Harnden
bd897efd05 pygui: allow shapes to be moved in annotation/select modes and nodes in node/select modes 2020-05-17 10:21:54 -07:00
Blake Harnden
d0520bf21d pygui: fixed resizing toolbar with custom node selected 2020-05-17 08:51:51 -07:00
Blake Harnden
34f86174a2 pygui: cleaned up color picker layout 2020-05-17 00:28:03 -07:00
Blake Harnden
8979c86187 pygui: fixed issue with moving text shapes 2020-05-17 00:11:28 -07:00
Blake Harnden
41df8a57b8 pygui: revert change to keep references for created interfaces properly 2020-05-16 23:59:36 -07:00
Blake Harnden
06e3d84862 pygui: fixed interface creation after deletion, fixed issue reusing deleted subnets 2020-05-16 23:35:19 -07:00
Blake Harnden
91220078f1 pygui: created a singular func for ordering items on canvas by tags, updates so that drawing edges are behind nodes 2020-05-16 14:12:08 -07:00
Blake Harnden
50816b3b80 pygui: cleaned up toolbar picker code, fixed closing app when a picker is showing 2020-05-16 01:14:48 -07:00
Blake Harnden
29fc5acb99 pygui: toolbar cleanup for buttonbar frames 2020-05-15 23:23:07 -07:00
Blake Harnden
4eaecd6a7b pygui: simplified a couple of the other widget constructors 2020-05-15 14:46:35 -07:00
Blake Harnden
0dcfcbf4ea pygui: simplified toolbar constructor, since there is no need for something more complicated 2020-05-15 11:43:54 -07:00
Blake Harnden
ee5d5b9864 pygui: removed duplicate get_icon functionality, added more type hints, added enable/disable of toolbar button when running start/stop 2020-05-15 11:41:18 -07:00
Blake Harnden
5e69ea48b3 pygui: fixed tracking for throughputs when joining a session 2020-05-14 23:07:21 -07:00
Blake Harnden
3b1a9bc3e3 pygui: changes to improve grpc event handling 2020-05-14 17:57:32 -07:00
Blake Harnden
df03f1e173 pygui: improvements to handling grpc events and updating gui 2020-05-14 16:24:22 -07:00
Blake Harnden
433fe4ae58 pygui: removed undesired logging in interface manager 2020-05-13 23:59:00 -07:00
Blake Harnden
79d7d66bff updates to sample3-bgp to avoid issues related to older formatted imn 2020-05-13 16:16:45 -07:00
Blake Harnden
95d3a6ca8c updates to force CoreCommandError to contain string values for stderr and stdout, couple bugfixes in handling bad commands when using execute commands from tlv based api or coresendmsg, also updates to coresendmsg to display everything in lowercase to mimic previous look and feel, however coresendmg will now work regardless of casing to avoid breaking things again 2020-05-13 12:01:28 -07:00
Blake Harnden
454dc8091e coresendmsg: small usage cleanup, removed printing enum values when listing tlvs, updated examples to use current expected values 2020-05-13 09:25:56 -07:00
bharnden
cc7c1348ce
Merge pull request #450 from coreemu/develop
Develop
2020-05-12 23:33:53 -07:00
Blake Harnden
fa163c3ed6 pygui: update file dialogs to hide hidden files by default and provide a hidden file toggle 2020-05-12 08:31:53 -07:00
bharnden
21fdbc48da
Merge pull request #449 from coreemu/refactoring/pygui-validation
pygui: updated validation to be wrapper classes around ttk.Entry for …
2020-05-11 22:42:02 -07:00
Blake Harnden
22d813df63 pygui: updated validation to be wrapper classes around ttk.Entry for convenience and less code 2020-05-11 22:00:52 -07:00
Blake Harnden
150db07497 pygui: updated canvas size and scale dialog to allow negative values for lon,lat,alt 2020-05-11 16:02:23 -07:00
Blake Harnden
12ed9c8422 updated changelog for next release 2020-05-11 13:00:29 -07:00
Blake Harnden
124d655dc6 fixed issue when sorting hook when saving to xml, due to enum refactoring, updated test case to hit this potential issue in the future 2020-05-11 12:41:57 -07:00
Blake Harnden
3fac6bc7ec docs: fixed link to pygui from index.md 2020-05-11 12:27:47 -07:00
Blake Harnden
88a98fff82 docs: added initial documentation for the python beta gui based on prior gui documentation 2020-05-11 12:26:05 -07:00
Blake Harnden
a36674aba9 pygui: adjustment to compensate for ip4/ip6 address not being present on joined links 2020-05-11 08:33:56 -07:00
Blake Harnden
f77f37ef86 bumped version for next release 2020-05-11 07:59:13 -07:00
Blake Harnden
5d99244596 removed docker service and associated documentation, was not functioning and will cause confusion with new support in the new GUI 2020-05-09 21:50:16 -07:00
Blake Harnden
9b4802a5ae updated install.sh to attempt to install the latest python dependencies on reinstall in case new dependencies have been introduced 2020-05-08 09:22:22 -07:00
Blake Harnden
0aba1aa928 pygui: updated gui home directory to ~/.coregui and changed config file name to config.yaml from gui.yaml to be more explicit 2020-05-08 09:08:01 -07:00
Blake Harnden
4379ef32e9 pygui: removed restriction on wlan nodes context linking to mdrs only, since custom nodes and other types may be configured and desired to be linked in the same way 2020-05-08 08:29:45 -07:00
bharnden
944040608e
Merge pull request #444 from coreemu/enhancement/pygui-config
Enhancement/pygui config
2020-05-08 08:21:05 -07:00
Blake Harnden
32558d15d2 pygui: removed comment in appconfig 2020-05-08 00:46:02 -07:00
Blake Harnden
86ae87eafe pygui: revamped config to leverage classes mapped to yaml, removes need for using keys all over and type hinting on glasses, future changes should support defaults better 2020-05-08 00:16:25 -07:00
Blake Harnden
d9f48d14a7 pygui fixed button layout on session options dialog 2020-05-05 13:00:22 -07:00
Blake Harnden
41b46b7e7a pygui display error and link to emane docs when attempting to use emane node and it is not installed, fix dialog refactoring breaking mobility player, updated emane docs 2020-05-05 12:55:25 -07:00
Blake Harnden
1d620a0b17 pygui some cleanup for dialog constructors to avoid passing duplicate parameters in most cases 2020-05-04 22:50:59 -07:00
Blake Harnden
185c6736b3 pygui moved custom nodes dialog to menubar and small layout cleanup 2020-05-03 22:47:46 -07:00
Blake Harnden
828254dccd pygui switched netstat socket observer to use ss instead 2020-05-03 22:01:21 -07:00
Blake Harnden
0e08242128 pygui close mobility players when stopping session 2020-05-03 21:55:34 -07:00
Blake Harnden
4ec6ef25fe pygui updated progress tasks to be self contained and leverage a title value to display runtime with more context to user 2020-05-03 21:47:58 -07:00
Blake Harnden
1dd45f4424 pygui cleaned up error display by creating top level app methods for displaying exceptions and errors, logging exceptions, and making sure they work for background tasks 2020-05-03 12:42:56 -07:00
Blake Harnden
0999fabb14 pygui revamped progress bar functionality into app task calls to simplify and commonize the functionality, handle and display task exceptions 2020-05-03 10:41:36 -07:00
Blake Harnden
835675480b pygui removed unimplemented runtime node context options and moved find node to tools menu 2020-05-02 23:57:27 -07:00
Blake Harnden
b858e66c49 pygui updated main app frame to use grid layout like everything else 2020-05-02 23:51:42 -07:00
Blake Harnden
be70c5383e pygui removed manage members context from wireless node 2020-05-02 09:23:06 -07:00
Blake Harnden
ac2d60dad6 pygui improved node context to properly use tk_popup, avoiding bandage code to compensate for other issues 2020-05-02 09:20:36 -07:00
Blake Harnden
65466909d3 pygui improved edge context by properly using tk_popup 2020-05-02 08:41:10 -07:00
Blake Harnden
491f2a8e93 pygui enabled delete on link context menu, removed split/merge for now, set edge labels to bold to stand out until better solution 2020-05-01 23:47:37 -07:00
Blake Harnden
5a8984de10 pygui some delete node/link cleanup and added unlink option to node context menu for an easier unlinking 2020-05-01 23:36:33 -07:00
Blake Harnden
d158fc99c6 pygui small cleanup to layout of find dialog 2020-05-01 19:59:41 -07:00
Blake Harnden
9d1f5cfcc6 pygui most dialogs are modal, default dialogs to modal 2020-05-01 19:56:57 -07:00
Blake Harnden
ea4271d7cb changed defaultroute service to behave similarly as before and use the first interface for a default .1 address 2020-05-01 19:15:53 -07:00
Blake Harnden
0ee679d978 pygui changes to disable most widgets related to configuring a node during runtime 2020-05-01 18:05:54 -07:00
Blake Harnden
686026d9f2 improved netaddr mac dialect usage to leverage constructor parameter 2020-05-01 17:40:53 -07:00
Blake Harnden
4ae5936bdc pygui raise copied nodes above copied edges 2020-05-01 17:28:28 -07:00
bharnden
28f7d93abd
Merge pull request #441 from coreemu/enhancement/pygui-address-creation
Enhancement/pygui address creation
2020-05-01 17:23:40 -07:00
Blake Harnden
2e9968c306 pygui further changes to mimic old gui behavior, parsing link data when joining and removing link data when they are removed 2020-05-01 15:35:53 -07:00
Blake Harnden
6ba065e8b6 Merge branch 'develop' into enhancement/pygui-address-creation 2020-05-01 14:23:18 -07:00
Blake Harnden
f7281459ed pygui changes to avoid deleting session and open xml race conditions, fix to reset canvas view options when creating a new session 2020-05-01 14:13:44 -07:00
Blake Harnden
1f1b1c7b65 Merge branch 'develop' of https://github.com/coreemu/core into develop 2020-05-01 13:42:39 -07:00
Blake Harnden
4a7abe71e4 removed unwanted grpc client stream log 2020-05-01 13:42:15 -07:00
Blake Harnden
9a42368221 initial changes to mimic prior address creation 2020-05-01 13:39:27 -07:00
bharnden
ffe6eed2f2
Merge pull request #440 from coreemu/pygui-rmallservices-fix
Pygui rmallservices fix
2020-04-30 15:51:46 -07:00
Huy Pham
b116d525d9 Merge branch 'develop' into pygui-rmallservices-fix 2020-04-30 13:48:38 -07:00
Huy Pham
580641f5d9 remove CoreClient.modified_service_node. When a new CORE node is created, assign default services right away (instead of leaving it empty), therefore no more confusion whether [] means empty service or means CORE node with default services 2020-04-30 13:47:45 -07:00
Blake Harnden
7e0ead0766 fixed formatting for quagga fast convergence merge 2020-04-30 13:23:00 -07:00
bharnden
337c41528a
Merge pull request #202 from coreemu/bugfix/quagga-ipv6-only-and-fast-convergence
enable OSPFv2 fast convergence, and fix router-id for IPv6-only nodes
2020-04-30 13:18:05 -07:00
bharnden
3c49d0676a
Merge branch 'develop' into bugfix/quagga-ipv6-only-and-fast-convergence 2020-04-30 13:13:53 -07:00
Blake Harnden
d945e7c41e formatted sdn.py after recent merge 2020-04-30 12:57:05 -07:00
Huy Pham
4037da49c2 Fix issue: node's services won't save when clearing all the services and add default services back to the node. Set core node's services to default services (instead of leaving it empty) when a new node is created. 2020-04-30 12:48:51 -07:00
bharnden
98c9730967
Merge pull request #178 from andreas-ibm/ovs
add comments to the OVS service
2020-04-30 12:33:14 -07:00
bharnden
06e145f508
Merge branch 'develop' into ovs 2020-04-30 12:30:57 -07:00
bharnden
cdde6988e2
Merge pull request #439 from coreemu/pygui-findfeature
Pygui findfeature
2020-04-30 11:22:31 -07:00
Blake Harnden
47ef5ec14d avoid writing link options to xml for emane/wlan links 2020-04-30 11:19:23 -07:00
Huy Pham
1f8d16df08 touch up 2020-04-29 17:17:57 -07:00
Huy Pham
64657b20a8 add more logic to scrolling the scrollbar to get a bit nicer view 2020-04-29 17:09:17 -07:00
Huy Pham
e9ca4a5b58 Session dialog: Bold heading text so that it stands out more, allign heading text with column text 2020-04-29 16:53:06 -07:00
Huy Pham
a3a9aee7f7 Merge branch 'develop' into findfeature 2020-04-29 16:36:53 -07:00
Huy Pham
c45202e61b add type checking to class methods 2020-04-29 16:36:12 -07:00
Huy Pham
275e8f4c30 finish writing a Find tool that allows find a node based on node name 2020-04-29 16:19:40 -07:00
Blake Harnden
62c0011caa avoid configuring links for wireless networks 2020-04-28 09:35:21 -07:00
Blake Harnden
b7adbd289c pygui copy links when generating mac to avoid retaining generated macs 2020-04-23 14:04:22 -07:00
Blake Harnden
8e8ffb3ffb pygui close mac config dialog on save 2020-04-23 14:00:23 -07:00
Blake Harnden
b5f4571618 fixed edit node using a 0,0 position when not intending to move node, side effect of trying to give new nodes a default position 2020-04-23 10:26:12 -07:00
Blake Harnden
01b41b0276 pygui cleaned up node service configuration dialog directory tab layout 2020-04-23 09:06:56 -07:00
Blake Harnden
ea99b628fc pygui removed dumping commands multiple times in run window as they are included before node output 2020-04-23 08:54:43 -07:00
Blake Harnden
aa2537753e pygui small tweaks to run tool dialog to simplify text and properly resize 2020-04-23 00:11:13 -07:00
bharnden
a662fcc62c
Merge pull request #436 from coreemu/pygui-runtool
Pygui runtool
2020-04-22 23:28:47 -07:00
Blake Harnden
7054e606ae pygui implemented mac config and fixed issue with manually assigning mac addresses 2020-04-22 23:00:07 -07:00
Huy Pham
f1e0c7245f rm core/Pipfile 2020-04-22 16:01:38 -07:00
Huy Pham
870d5dc41c change the command to start the new core gui 2020-04-22 15:49:30 -07:00
Huy Pham
f6bd21629d Merge branch 'develop' into pygui-runtool 2020-04-22 15:41:11 -07:00
Huy Pham
03e291d215 implement run tool that allows running command on more than one node conveniently 2020-04-22 15:38:29 -07:00
Blake Harnden
3394f0240a update reading session xml options to updating these values instead of clearing out existing settings, avoids issue wiping ovs settings etc 2020-04-22 12:07:42 -07:00
Blake Harnden
6fe2845051 pygui added error dialog for duplicate observer names and cleared out values on success 2020-04-22 11:41:09 -07:00
Blake Harnden
039cf2a3b9 pygui updates to properly dynamically update the observer widgets menu as changes are made 2020-04-22 11:37:58 -07:00
Blake Harnden
f521fe4141 fixed issue where actually sending interface names to tcl gui would cause issue, no longer sending link interfave names 2020-04-22 00:20:18 -07:00
Blake Harnden
ba6a6f06b1 pygui moved observers to menu class, added initial functioning ip address tool 2020-04-21 22:56:56 -07:00
Blake Harnden
20ecdf70d0 pygui fixed emane link updates when rejoining session 2020-04-21 13:22:21 -07:00
Blake Harnden
715bae6f74 pygui avoid sending configs for empty mobility and wlan configurations 2020-04-21 13:14:33 -07:00
Blake Harnden
ec8a15794b pygui fixed wlan drawing range circles using the diameter for the radius 2020-04-21 13:11:00 -07:00
Blake Harnden
219218eebc updated sample8 ipsec imn due to outdated format 2020-04-21 13:06:14 -07:00
bharnden
63b8b7e8a0
Merge pull request #433 from coreemu/enhancement/pygui-config-cleanup
Enhancement/pygui config cleanup
2020-04-21 13:03:59 -07:00
Blake Harnden
b04da98f44 pygui updated config services to be associated with nodes directly and copyable 2020-04-21 11:13:41 -07:00
Blake Harnden
d7ebb90329 pygui updated node service configurations to be self contained and copyable 2020-04-21 10:31:20 -07:00
Blake Harnden
85b4a81f8a updated wlan/mobility configs to be directly associated with a node and allow them to be copied 2020-04-21 09:34:30 -07:00
Blake Harnden
bd30d0d9ff changes to support nodes containing their configurations, starting with emane, making copying easier and reducing code 2020-04-21 00:38:36 -07:00
Blake Harnden
54eab4576d pygui add in cut functionality, currently not including configurations 2020-04-20 23:20:39 -07:00
Blake Harnden
efa5506c80 fix issue when tcp handlers has no other clients for a session 2020-04-20 15:56:25 -07:00
Blake Harnden
b4de016a24 pygui cleanup sessions dialog 2020-04-19 23:02:25 -07:00
Blake Harnden
3233d8ab58 pygui simplify show/hiding annotations 2020-04-19 15:57:59 -07:00
Blake Harnden
d26c4fc4ab pygui initial implementation for supporting the view menu for showing and hiding canvas elements 2020-04-19 15:47:07 -07:00
Blake Harnden
f45a11076f pygui implemented auto grid layout, to auto distance node icons with padding based on canvas size in rows and columns 2020-04-18 09:02:15 -07:00
Blake Harnden
be332a2a29 updated all distributed examples to remove usage of common local module to avoid confusion, even if duplicate code 2020-04-18 08:24:26 -07:00
Blake Harnden
d1f7eafc57 fixed emane python example and changed it to be a simple ping example 2020-04-18 08:18:29 -07:00
Blake Harnden
d659a5c139 python examples, removed params common local module to avoid confusion, clean things up a bit and added a module doc to help explain the file 2020-04-18 08:11:12 -07:00
Blake Harnden
7da7ea5d62 pygui consolidated menubar and menuaction code into one file, small updates to observer widgets to avoid using ifconfig 2020-04-18 00:33:22 -07:00
Blake Harnden
c43afa4b40 pygui removed unwanted buttons from run toolbar 2020-04-17 23:28:45 -07:00
Blake Harnden
c09e3e90d6 pygui pass at removing disabled menu items, small reorg and cleanup 2020-04-17 23:18:11 -07:00
Blake Harnden
02c8604d6a added a bit more context on install docs for tested distributions and the iproute2 requirement 2020-04-16 18:48:46 -07:00
Blake Harnden
1117522c21 reverting node service change until protobuf changes are in place 2020-04-16 12:31:48 -07:00
Blake Harnden
5dcf2f45c5 updates to allow building python docs again, also added checks for requirements to build the python docs 2020-04-16 11:32:50 -07:00
Blake Harnden
78d442b574 add service file content to xml as cdata to avoid escaping 2020-04-16 10:44:33 -07:00
Blake Harnden
ca292cb11e added -r flag to install.sh to provide a convenience to reinstall latest code from current git branch 2020-04-16 10:16:35 -07:00
Blake Harnden
9bd13dce1e updates to allow setting 0 services for a node, but old gui does not send data in a way that can be compatible 2020-04-16 09:19:50 -07:00
Blake Harnden
7e7bf8c7b7 fix p2p upstream link data not using enum, consolidated grpc logic for getting link protobufs 2020-04-15 16:36:03 -07:00
Blake Harnden
e2490dee4a modified wireless links to obtain colors based on connected network from the session, LinkData will no provide a color itself 2020-04-15 15:41:37 -07:00
Blake Harnden
42979f1bb3 pygui edge code cleanup for node label drawing 2020-04-15 13:39:11 -07:00
Blake Harnden
0203d4178d pygui removed unused throughput tag 2020-04-15 12:57:01 -07:00
Blake Harnden
6f87986364 pygui cleanup of edge code to use position tuples instead of individual params 2020-04-15 12:51:35 -07:00
Blake Harnden
23562cd294 updates for working label drawing on wireless links in pygui, will display sinr values on emane links 2020-04-15 12:41:09 -07:00
Blake Harnden
86b0c07764 fixed issue when reading xml file and not associating node with emane model, causing error for grpc 2020-04-15 11:44:14 -07:00
bharnden
18a6442c8e
Merge pull request #429 from coreemu/enhancement/pygui-multi-links
Enhancement/pygui multi links
2020-04-15 10:20:05 -07:00
Blake Harnden
2b97b311ab pygui ignore adding/removing duplicate wireless link events, ignore wireless link events for node to itself 2020-04-14 17:08:42 -07:00
Blake Harnden
3c4a908fd5 updates to support multiple links between nodes in pygui, initially handling multiple wireless links 2020-04-14 15:51:28 -07:00
Blake Harnden
cd8157eff7 renamed python gui to be more similar to other core scripts and specific to it being python, some cleanup to pygui edge drawing and updates to allow for edges to have an arc to support multiple links between the same nodes 2020-04-14 10:47:42 -07:00
Blake Harnden
8c8024df10 updates to formatting for route monitor 2020-04-13 17:02:05 -07:00
Blake Harnden
971a959a19 updates to route monitor 2020-04-13 16:59:55 -07:00
bharnden
d5dec12439
Merge pull request #428 from coreemu/develop
Develop
2020-04-13 14:14:39 -07:00
Blake Harnden
04bd3a2f8f updated changelog for 6.3.0 release 2020-04-13 14:09:02 -07:00
Blake Harnden
3c909d4989 updated version for next release 2020-04-13 12:02:55 -07:00
Blake Harnden
a72b0bb4a5 updated changelog for 6.2.0 2020-04-13 12:01:46 -07:00
Blake Harnden
928bfc73dc updates to core architecture diagrams leveraging plantuml, removed usage of virtual machine language in docs to help avoid confusion 2020-04-13 11:51:12 -07:00
Blake Harnden
27a6c76d57 small tweak to gui docs 2020-04-13 08:52:37 -07:00
Blake Harnden
73a96ffcf5 added section on install page about using install.sh 2020-04-09 21:42:04 -07:00
Blake Harnden
36b3243a4b updates to NOTEs in documentation 2020-04-09 21:33:20 -07:00
Blake Harnden
0d490344fc fixed type on gui.md 2020-04-09 14:39:09 -07:00
Blake Harnden
ca039946a6 quick pass with some doc cleanup and reformatting to fix various issues 2020-04-09 14:34:52 -07:00
Blake Harnden
a5c412b594 updates to sdt integration to use different colors for each network of wireless links 2020-04-09 11:42:27 -07:00
Blake Harnden
3a45e9ec7a fix for ipsec service reading file as bytes 2020-04-07 21:03:45 -07:00
bharnden
c3224251b7
Merge pull request #424 from smvoigt/coreemu#423
Add IS-IS to FRR service #423
2020-04-06 17:06:17 -07:00
bharnden
41451c29cf
Merge pull request #422 from smvoigt/coreemu#421
Fix for IPv6 Addresses disappear with FRR #421
2020-04-06 17:01:20 -07:00
bharnden
0db119a9ae
Merge pull request #425 from coreemu/enhancement/route-monitor
Enhancement/route monitor
2020-04-06 16:54:33 -07:00
Blake Harnden
87f90cd8e3 added tcpdump check to print a message about its requirement 2020-04-06 16:47:21 -07:00
Blake Harnden
0aa7c6f1f2 cleaned up how grpc creates node protobuf data for grpc interfaces, cleaned up route monitor script slighly 2020-04-06 16:09:01 -07:00
Blake Harnden
0742c08b59 added session/node dir to grpc responses and node channels, updating route monitor to use grpc for getting session/node information 2020-04-06 15:46:47 -07:00
Shaun Voigt
6c9c2cbeb0 resolve isort 2020-04-07 07:50:26 +09:30
Blake Harnden
2750a69e79 initial route monitor based on searching for core directories 2020-04-06 15:16:16 -07:00
Shaun Voigt
8dfdd6171d check for ipv6 address using netaddr.valid_ipv6 2020-04-07 07:44:23 +09:30
Shaun Voigt
29fea7e572 Add IS-IS support to FRR Service #423 2020-04-06 18:26:29 +09:30
Shaun Voigt
ba18853509 resolve black formatting 2020-04-06 18:03:27 +09:30
Shaun Voigt
953bd80e2e isort - sort imports 2020-04-06 17:54:42 +09:30
Shaun Voigt
b6fbedf471 Fix for IPv6 Addresses disappear with FRR #421 2020-04-06 17:36:32 +09:30
Blake Harnden
d0c4d4b935 fixed issue where the udp handler would no broadcast node/link changes from coresendmsg 2020-04-02 21:14:08 -07:00
Blake Harnden
7be7beec42 updated core-daemon thread usage to use thread daemon param 2020-04-02 17:33:38 -07:00
Blake Harnden
7d392c43ac improve default route service to detect connected routers and use the addresses of the first one found 2020-04-02 15:12:07 -07:00
Blake Harnden
72189a5c28 fix configdata issue, since most corehandler code did not account for using flags directly 2020-04-01 10:56:09 -07:00
Blake Harnden
b29f640547 modified emane link monitor to send labels containing sinr values to sdt 2020-03-31 21:09:20 -07:00
Blake Harnden
091131fe5c tweak to session.exception to default node_id to None when not provided 2020-03-31 16:39:27 -07:00
Blake Harnden
3165bddc92 updates to allow emane to throw an exception when emane python bindings are not present and emane is attempted to be ran 2020-03-31 16:21:04 -07:00
Blake Harnden
71196004c8 improved sdt deletion of links by using the id properly 2020-03-31 15:20:34 -07:00
Blake Harnden
1252f72220 updated requirements.txt to use environment markers for dataclasses dependency 2020-03-31 14:38:48 -07:00
bharnden
eccd1f1695
Merge pull request #418 from coreemu/enhancement/dataclasses
switched core emulator data files from using namedtuples to backporte…
2020-03-31 14:32:24 -07:00
Blake Harnden
2ce1ef04ae updated Pipfile.lock to denote marker for only installing dataclasses in python 3.6 2020-03-31 14:28:17 -07:00
Blake Harnden
2532f6605d modify setup.py to denote dataclasses only being needed in 3.6 2020-03-31 14:19:02 -07:00
Blake Harnden
6e8f980cc9 moved github action to 3.6, since that is the current min requirement 2020-03-31 14:06:13 -07:00
Blake Harnden
13ef701b6e ignore reading emane global config from xml when not present 2020-03-31 10:08:08 -07:00
Blake Harnden
8186c62b19 switched core emulator data files from using namedtuples to backported dataclasses 2020-03-31 09:41:29 -07:00
bharnden
5d9b451b1d
Merge pull request #416 from coreemu/enhancement/emane-links
Enhancement/emane links
2020-03-30 12:59:44 -07:00
Blake Harnden
16764c702b updated emane link monitor to not run when there is nothing to monitor, added better logging about what is being monitored 2020-03-30 12:26:08 -07:00
Blake Harnden
7e0efa7020 updated sdt plugin to support layering core nodes and links as well as wireless links into network layers, also using linkid to support multiple links between nodes 2020-03-30 12:00:22 -07:00
Blake Harnden
7b29f6bb82 change to account for importing slightly older bindings for emane link monitor 2020-03-30 10:46:05 -07:00
Blake Harnden
16cc73c070 import change to help isort pass 2020-03-30 10:36:39 -07:00
Blake Harnden
52ff5ce62b improvement to github action isort check to print change needed, added pipenv install to be verbose 2020-03-30 10:31:36 -07:00
Blake Harnden
6616f104e6 tweak github action to sync pipenv and not install newer packages 2020-03-30 10:19:23 -07:00
Blake Harnden
1efa1284bb merged latest from develop 2020-03-28 13:18:25 -07:00
Blake Harnden
172c5e7e4e Merge branch 'develop' of https://github.com/coreemu/core into develop 2020-03-28 13:07:06 -07:00
Blake Harnden
6c5c2c5674 fixed core xml to properly write and read emane global configurations 2020-03-28 13:06:46 -07:00
Blake Harnden
0b30289879 emane link monitor clear complete links during shutdown 2020-03-27 22:47:16 -07:00
Blake Harnden
3d59cd0ad8 initial logic for working emane links based on emane stats 2020-03-27 17:22:44 -07:00
bharnden
484d66191d
Merge pull request #414 from smvoigt/coreemu#413
Enable OSPFv2 Adjacency Widget to work with FRR
2020-03-27 10:14:04 -07:00
Shaun Voigt
6479afb7b2 Enable OSPFv2 Adjacency Widget to work with FRR 2020-03-27 18:19:07 +10:30
Blake Harnden
fc40c8d7bb enabled node context delete/copy and edit menu delete in python gui 2020-03-26 22:24:23 -07:00
bharnden
e0ce29b25a
Merge pull request #411 from coreemu/bugfix/wlan-config-0
updates to basic range model configuration settings to allow 0 values…
2020-03-26 11:24:49 -07:00
Blake Harnden
66e5be7576 updates to basic range model configuration settings to allow 0 values as well as empty values for None, that work in old and new guis 2020-03-26 11:21:47 -07:00
Blake Harnden
6a41012857 updates to break up core.proto into separate logical files 2020-03-22 22:57:50 -07:00
Blake Harnden
38f9f44cdf fixed type hinting and bad return value 2020-03-22 21:15:11 -07:00
Blake Harnden
14e708681c small tweak to corehandlers logic 2020-03-22 21:08:12 -07:00
Blake Harnden
33bcc24d88 cleaned up broadcast_node to use nodes directly 2020-03-22 16:38:15 -07:00
bharnden
fd7db64f6d
Merge pull request #409 from coreemu/enhancement/enum-cleanup
Enhancement/enum cleanup
2020-03-22 15:19:06 -07:00
Blake Harnden
39499a4ab4 moved ConfigShim to being under tlv, updated RegisterTlvs to use enums directly in non tlv code 2020-03-22 14:59:42 -07:00
Blake Harnden
7a5a0f34ea broke out tlv specific enums into their own module 2020-03-22 14:09:38 -07:00
Blake Harnden
c264634b5f merged latest from develop 2020-03-22 13:52:26 -07:00
Blake Harnden
3f17706c28 small cleanup for interface position hooks, updates to support using a provided altitude when sending emane events based on position hooks 2020-03-19 16:40:43 -07:00
bharnden
3be162b0b0
Merge pull request #407 from coreemu/develop
Merge 6.2.0
2020-03-16 11:37:08 -07:00
Blake Harnden
102fa410fe make wlan nodes start with a ebtables change event to trigger default rules when all nodes are disconnected 2020-03-12 23:21:48 -07:00
Blake Harnden
3507b65676 bump version to 6.2.0 for next release 2020-03-12 23:21:13 -07:00
Blake Harnden
a7790185d4 updates to use message flags enum directly 2020-03-12 23:12:17 -07:00
Blake Harnden
5cdfd8d8b9 updated NodeTypes to be used directly 2020-03-10 23:11:37 -07:00
Blake Harnden
f277e96c9a revert logging back to info, removed Rj45Models enum as it was not being used, updated linktypes enum to be used directly 2020-03-10 22:48:05 -07:00
Blake Harnden
1e8d1ecd9f changes for sessions to use EventTypes for state/hooks directly 2020-03-06 22:35:23 -08:00
Blake Harnden
0e299d5af4 update to make use of shutil.which for executable searching 2020-03-06 16:41:26 -08:00
Blake Harnden
6b5cd95ac2 small updates to new gui exception dialog, fixed error checking and setting interface mac addresses 2020-03-05 21:38:52 -08:00
Blake Harnden
595e77a1ef updates to install doc 2020-03-05 15:04:29 -08:00
Blake Harnden
eb030aaca7 updated devguide to note using install.sh and clear up needing to maintain duplicate content 2020-03-05 14:16:14 -08:00
Blake Harnden
81382f2899 updated install.sh dev install to setup pre-commit hook as well 2020-03-05 13:44:32 -08:00
Blake Harnden
d8cf1373da updates to allow install.sh to use newer versions of python, defaults to 3.6 2020-03-05 13:19:20 -08:00
Blake Harnden
5c52fbbdec update install.sh to only use pipenv sync to avoid package changes, added user/root installations of pipenv for centos dev environment 2020-03-05 12:58:42 -08:00
Blake Harnden
e5a446d70f fixed using apt instead of yum and sudo needed for centos in install.sh 2020-03-05 12:13:38 -08:00
Blake Harnden
105dd4ad7b small tweaks to fix/cleanup install.sh 2020-03-05 11:44:13 -08:00
Blake Harnden
f826a4c5e8 new gui fixed error display when daemon is not running 2020-03-04 20:42:40 -08:00
Blake Harnden
c4234d33f0 updates to allow new gui to recreate session to continue where it left off 2020-03-04 20:09:56 -08:00
bharnden
f2da8dc2c9
Merge pull request #403 from coreemu/coretk-enhance/fix-bugs
Coretk enhance/fix bugs
2020-03-04 14:55:10 -08:00
Blake Harnden
be37f0f279 updates in new gui to allow empty ip4/ip6 addresses, fixed display issues related to empty addresses 2020-03-04 14:39:28 -08:00
Huy Pham
95d36a1792 fix merge conflict 2020-03-04 14:27:29 -08:00
Huy Pham
f50c1e4db4 keep track of opened, saved file to appropriately prompt save xml when needed, add Save As menu option 2020-03-04 14:15:02 -08:00
bharnden
d076229973
Merge pull request #399 from coreemu/coretk-enhance/execute-xml-script
Coretk enhance/execute xml script
2020-03-04 13:59:32 -08:00
bharnden
902cfab677
Merge pull request #401 from coreemu/fix-core-cleanup-d-kill-daemon
fix-core-cleanup-d-kill-daemon
2020-03-04 13:58:19 -08:00
Blake Harnden
038a83cbfd merged latest from develop 2020-03-04 13:34:08 -08:00
Blake Harnden
34895c1f9c changes for initial gui setup and discovery of the terminal program to use, avoid using TERM env variable 2020-03-04 13:30:01 -08:00
Huy Pham
7dee59e86e New Session command deletes the current session if it is not in runtime else prompt save running session, and then creates the new session 2020-03-04 13:25:22 -08:00
Jeff Ahrenholz
91dae87810 properly kill python3-based core-daemon when using 'core-cleanup -d' 2020-03-04 13:23:09 -08:00
bharnden
53865e1898
Merge pull request #400 from coreemu/bugfix/fix-387-gnome-terminal-launch-try2
fix #387 launch gnome-terminal properly by removing extra quoting try2
2020-03-04 13:22:13 -08:00
Jeff Ahrenholz
c0d576f26d fix black pre-commit formatting 2020-03-04 13:11:39 -08:00
Jeff Ahrenholz
18d88ab797 fix #387 launch gnome-terminal properly by removing extra quoting try2 2020-03-04 13:03:03 -08:00
bharnden
fd2a5ec290
Merge pull request #398 from coreemu/bugfix/fix-terms-list-typo
fix typo in DEFAULT_TERMS make gnome-terminal work
2020-03-04 12:12:37 -08:00
Huy Pham
b72ce6a66c allow editable Edit - Preferences - Terminal 2020-03-04 11:49:09 -08:00
Blake Harnden
0d4a86f10e updated new gui to properly update modified addresses for nodes, added validation for ip4/ip6, fixed redrawing edge labels when node addresses change 2020-03-04 11:38:24 -08:00
Jeff Ahrenholz
52689bd210 fix typo in DEFAULT_TERMS make gnome-terminal work 2020-03-04 11:23:21 -08:00
Huy Pham
6ce29bea75 fix merge conflict 2020-03-04 11:14:20 -08:00
Blake Harnden
4093b2244a fixed new gui removing marker annotations when creating new sessions 2020-03-03 22:38:03 -08:00
Blake Harnden
539ca5d22c added docker/lxc to xml read/write, fixed icon retrieval for docker/lxc in new gui 2020-03-03 22:27:02 -08:00
bharnden
7c8e115bc7
Merge pull request #383 from coreemu/coretk-enhance/disable-runtime-editing-custom-service-config
Coretk enhance/disable runtime editing custom service config
2020-03-03 12:54:47 -08:00
bharnden
020a13bde6
Merge pull request #386 from coreemu/coretk-enhance/scaling
Coretk enhance/scaling
2020-03-03 12:49:16 -08:00
Huy Pham
ea341cbe45 set the initial directory of executing python scripts to HOME_PATH/scripts 2020-03-02 14:08:11 -08:00
Huy Pham
9cd6166b9b use varaibles that represent smallest and largest allowed scale value to replace float numbers 2020-03-02 11:20:00 -08:00
Huy Pham
58cb5a1a1d add a scrollbar next to scale entry to allow scale adjustment in increments of a specific value (since the Scale Slider widget does not support this) 2020-03-02 11:02:54 -08:00
Huy Pham
933f409498 adjust node text and edge text to scale not as fast as other components 2020-03-02 10:18:37 -08:00
Blake Harnden
ff3b20a962 modifications to support optional geo position edits for nodes and to account for geo updates to sdt 2020-03-02 10:01:36 -08:00
Huy Pham
b0a3c85f0e allow editable scale field for manually setting the app scale value 2020-03-02 09:56:57 -08:00
Huy Pham
a7fa0bf6d3 use a bigger size font for alert button text to see the scaling effect more easily 2020-03-02 09:17:35 -08:00
Huy Pham
dfc24e107f use grpc method to execute python script, redraw canvas and reset session data 2020-03-02 09:01:03 -08:00
Huy Pham
c1f0e385b4 Merge branch 'develop' into coretk-enhance/execute-xml-script 2020-02-28 12:52:29 -08:00
Blake Harnden
9535d40b70 added grpc call to execute python script, to replicate prior gui functionality 2020-02-28 12:28:41 -08:00
bharnden
c630d911fe
Merge pull request #384 from coreemu/enhancement/sdt-internal
changes to move sdt calls internal to core interactions, which allows…
2020-02-28 11:22:10 -08:00
Blake Harnden
67da3e5c22 changes to move sdt calls internal to core interactions, which allows it to work with both guis 2020-02-27 21:39:18 -08:00
Huy Pham
848cda03f7 design execute python file dialog 2020-02-27 15:24:36 -08:00
Huy Pham
f8a3f0a2d4 Merge branch 'develop' into coretk-enhance/disable-runtime-editing-custom-service-config 2020-02-27 11:00:09 -08:00
Huy Pham
1cba11d9e0 clean up more code, click defaults in service configuration correctly reset files tab as well as directories tab 2020-02-27 10:57:22 -08:00
Huy Pham
c36f060d44 fixed wrong variable used for configuring service in grpcutils, add/delete directories for node's service configuration, clean up some old code 2020-02-26 15:43:31 -08:00
Blake Harnden
20e3fbc7d9 modify execute python script handling for old gui to wait for script to complete before looking for new session to avoid possible race conditions 2020-02-26 15:39:37 -08:00
Blake Harnden
e1c9155ba7 simplify thread daemon usage 2020-02-26 15:29:19 -08:00
Blake Harnden
21dfaf7d66 avoid initializing emane event service twice 2020-02-26 14:34:35 -08:00
bharnden
377790cff2
Merge pull request #379 from coreemu/enhancement/xy-to-lonlat
Enhancement/xy to lonlat
2020-02-26 14:25:03 -08:00
Blake Harnden
7574765305 updates to Pipfiles and requirements.txt for pyproj dependency 2020-02-26 12:18:55 -08:00
Huy Pham
764a61e89e create layout for service config - directory tab 2020-02-26 10:43:01 -08:00
Huy Pham
696fda00ea add/delete custom service file to node 2020-02-26 08:31:28 -08:00
Blake Harnden
b5b51794d8 update pyproj logic to use formal transformers, added altitude to conversion debug logging 2020-02-25 21:26:41 -08:00
Blake Harnden
32efc75c64 removed legacy location translation 2020-02-25 20:40:51 -08:00
Blake Harnden
909f231c13 Merge branch 'develop' into enhancement/xy-to-lonlat 2020-02-25 13:14:34 -08:00
Huy Pham
41bb951531 Merge branch 'develop' into coretk-enhance/disable-editing-during-runtime 2020-02-25 11:39:50 -08:00
Huy Pham
014707580f allow custom service file to be created 2020-02-25 11:38:58 -08:00
Blake Harnden
177f27372e fixed wrong variable used for configuring service in grpcutils 2020-02-25 11:30:26 -08:00
Blake Harnden
db0f984401 Merge branch 'develop' into enhancement/xy-to-lonlat 2020-02-24 14:00:43 -08:00
Huy Pham
8a0257d130 disable copy/paste/delete shortcuts as well as commands during runtime state 2020-02-24 12:51:47 -08:00
bharnden
e66968dcbb
Merge pull request #377 from coreemu/coretk-enhance/add-more-error-dialog
Coretk enhance/add more error dialog
2020-02-24 11:29:48 -08:00
Huy Pham
7a50f6ac25 replace hasattr with getattr for cleaner code 2020-02-24 11:24:59 -08:00
Huy Pham
1dca477e6d disable delete, copy, paste during runtime 2020-02-24 11:17:06 -08:00
Huy Pham
ddaba7c477 remove code for deleting wireless links and nodes during runtime 2020-02-24 10:58:01 -08:00
Huy Pham
04d7bb6265 Merge branch 'develop' into coretk-enhance/add-more-error-dialog 2020-02-24 10:33:37 -08:00
bharnden
8b544d98d8
Merge pull request #374 from coreemu/coretk-enhance/wlanlink-runtime-deletion
Coretk enhance/wlanlink runtime deletion
2020-02-24 10:30:30 -08:00
Blake Harnden
795e5a0c2c Merge branch 'develop' into enhancement/xy-to-lonlat 2020-02-21 17:17:39 -08:00
Blake Harnden
afb0fe8b46 avoid sending sdt 2 updates for emane location event, avoid not using lon,lat,alt if any value is 0 2020-02-21 17:17:09 -08:00
Blake Harnden
f1a7c10e91 Merge branch 'develop' into enhancement/xy-to-lonlat 2020-02-21 16:43:18 -08:00
Blake Harnden
a3c7ed8012 update emaneevent logging to debug, fixed emaneevent thread stop logic, fixed node data conversion for lon,lat,alt values 2020-02-21 16:42:23 -08:00
Blake Harnden
95c32ddd28 initial geo location conversion using pyproj 2020-02-21 15:54:55 -08:00
Huy Pham
3a2da0282f display error dialog when start session fails 2020-02-20 15:46:18 -08:00
Huy Pham
2a8f689ad5 remove extra code 2020-02-20 11:26:48 -08:00
Huy Pham
e90eff578e reset variable 2020-02-20 11:16:26 -08:00
Huy Pham
08d4bf98c7 fix merge conflict, add a logging error to temporarily solve issue removing a wireless link when multiple wireless links exist 2020-02-20 10:47:59 -08:00
bharnden
ceb3d072da
Merge pull request #371 from coreemu/coretk-enhance/scaling
Coretk enhance/scaling
2020-02-20 10:29:21 -08:00
Huy Pham
83842fe9be Merge branch 'develop' into coretk-enhance/scaling 2020-02-20 10:03:19 -08:00
Huy Pham
20be527add remove extra code 2020-02-20 10:02:13 -08:00
bharnden
b6aef6d560
Merge pull request #373 from coreemu/develop
release-6.1.0
2020-02-20 10:00:22 -08:00
Blake Harnden
44bf4e020c updated config services frr to match standard frr service 2020-02-20 09:46:25 -08:00
Blake Harnden
d128f2425d updated changelog 2020-02-20 09:32:37 -08:00
Blake Harnden
2a6c6ac286 version bump for next release 2020-02-20 09:03:34 -08:00
Blake Harnden
8572e153f4 fixed comparison logic for waypoints and added tests to help catch issue in the future 2020-02-19 21:21:21 -08:00
Huy Pham
cfeb378287 Merge branch 'develop' into coretk-enhance/wlanlink-runtime-deletion 2020-02-19 13:29:37 -08:00
Huy Pham
23aeb40f54 display the range while configuring wlan node 2020-02-19 13:22:52 -08:00
Huy Pham
d8f586bd2b add wireless network variable to CanvasGraph that maps a wireless/EMANE node to all MDRs connected to it 2020-02-18 15:58:18 -08:00
Huy Pham
08e652633f support wireless link deletion during runtime 2020-02-18 13:59:23 -08:00
Huy Pham
471f40a0bd change wlan configuration's label name from error rate (%) to loss (%) to match the old gui 2020-02-18 10:37:37 -08:00
Huy Pham
b3dabbfe05 delete wireless links on canvas during runtime 2020-02-18 10:33:49 -08:00
Huy Pham
87c9492d32 scale antenna and mobility player buttons 2020-02-17 15:14:52 -08:00
Huy Pham
1d911a763f scale custom node icon and custom node drawn on canvas 2020-02-17 12:56:19 -08:00
Huy Pham
4fd1338cf1 save application scale to gui configuration, and draw everything to the correct saved scale when starting the application 2020-02-17 11:10:13 -08:00
Huy Pham
b7116c52ff Merge branch 'develop' into coretk-enhance/scaling 2020-02-17 09:27:37 -08:00
Blake Harnden
e8f6ccaa4e fixed typing used for session.instantiate 2020-02-14 16:25:05 -08:00
Blake Harnden
1375af51cb added grpc to get emane event channel being used 2020-02-14 16:22:28 -08:00
Blake Harnden
ebafa228ff added files/directories to grpc set_node_service 2020-02-14 13:40:10 -08:00
Huy Pham
0ea99ca809 scale edge text font (ipv4 and ipv6 address, scale edge, scale node when first drawn on canvas and when joining session 2020-02-14 13:34:00 -08:00
Blake Harnden
71aeb98bb9 updates to grpc add_link to return created interface data 2020-02-14 13:18:05 -08:00
Huy Pham
55b6cbbd90 sacle toolbar button after choosing a node from node picker, scale canvas nodes and canvas node text 2020-02-13 12:15:56 -08:00
bharnden
0d3460e2ec
Merge pull request #370 from devdkerr/patch-1
Update utility.py
2020-02-12 21:46:37 -08:00
Daniel R. Kerr
83e6bbee45
Update utility.py
fix on radvd config file generation to support python3
2020-02-13 00:38:45 -05:00
Huy Pham
9cd756f2dc fix merge conflict 2020-02-12 14:16:17 -08:00
Huy Pham
3a466fd463 remove custom size for custom style so that text can scale, scale the remaining node icons from the node picker, scale node's name 2020-02-12 14:13:28 -08:00
bharnden
c4f0f62206
Merge pull request #368 from gsomlo/gls-frr-staticd
services/frr.py: frrboot.sh: start 'staticd' to support static routes
2020-02-12 09:02:57 -08:00
bharnden
13275c59df
Merge pull request #367 from coreemu/coretk-enhance/error-dialog
Coretk enhance/error dialog
2020-02-12 09:01:25 -08:00
Huy Pham
b4bf3ee391 remove unecessary print statement and remove commented code 2020-02-12 08:39:10 -08:00
Huy Pham
7fbbfa8c63 scale font 2020-02-12 08:35:14 -08:00
Huy Pham
8734b9f22f attempt adding scaling function to the gui 2020-02-10 15:20:07 -08:00
Gabriel Somlo
d2fe352797 services/frr.py: frrboot.sh: start 'staticd' to support static routes
Unlike Quagga, FRR requires 'staticd' to be running in order
to support provisioning and use of static routes in the running
configuration (e.g., 'ip route a.b.c.d/p nexthop').

Signed-off-by: Gabriel Somlo <glsomlo@cert.org>
2020-02-09 08:45:48 -05:00
Blake Harnden
3d1692fbb3 quick fix to coreservices type hinting 2020-02-07 08:58:38 -08:00
Huy Pham
80f47a5d4c Merge branch 'develop' into coretk-enhance/error-dialog 2020-02-05 15:56:15 -08:00
Huy Pham
ee0c63e4a1 change some variable names to be more informative, add an image to error dialog 2020-02-05 15:53:14 -08:00
Huy Pham
0407645061 replace tkinter errormessage with custom create error dialog 2020-02-05 15:09:33 -08:00
Blake Harnden
6020496b6f fixed sdt issue core gui, fixed sdt message sending for python3 2020-02-05 14:40:37 -08:00
Blake Harnden
b55aad9750 added simple openvpn services example on how to use them 2020-02-05 11:45:06 -08:00
Blake Harnden
8d628fbe1c updates to devdoc to be consistent with commands used in other places 2020-02-05 10:40:29 -08:00
bharnden
19680bd452
Merge pull request #366 from coreemu/coretk-enhance/fix-bug
Coretk enhance/fix bug
2020-02-05 10:32:22 -08:00
Blake Harnden
f97a4f29fb compress services docs listing of services into a smaller table, to easier see everything 2020-02-05 10:29:00 -08:00
Blake Harnden
52cdc0d75c breaking up services documentation into documentation files related to service groups 2020-02-05 10:18:57 -08:00
Blake Harnden
461a27989c initial config changes for config services for openvpn 2020-02-04 17:28:58 -08:00
Blake Harnden
3b0a8ebc37 small tweak to make openvpn example server config valid 2020-02-04 17:09:54 -08:00
Huy Pham
6bb1d5cba2 add a new data to track the most recently opened/saved files, and update recent files menu as the recent files change 2020-02-04 13:49:46 -08:00
Huy Pham
e2fba18ba5 fix merge conflict 2020-02-04 13:05:08 -08:00
bharnden
9216683902
Merge pull request #354 from apwiggins/frr-service-reset-interfaces
added reset interfaces at FRR startup
2020-02-04 13:02:43 -08:00
Huy Pham
bdbf5fac61 add recent files to gui.yaml for keeping track of recent files 2020-02-04 13:00:00 -08:00
Blake Harnden
c66ee04db5 avoid attempting to stop services for nodes that are not considered up 2020-02-04 10:13:37 -08:00
Blake Harnden
3846f2b5bd removed hard coded example recent files 2020-02-04 10:03:10 -08:00
bharnden
26a03cc758
Merge pull request #364 from coreemu/coretk-enhance/fix-bug
Coretk enhance/fix bug
2020-02-04 09:53:48 -08:00
bharnden
540e1b46d8
Merge pull request #365 from coreemu/coretk-enhance/gui-logging
Coretk enhance/gui logging
2020-02-04 09:52:55 -08:00
Blake Harnden
bc79d31d40 Merge branch 'develop' of https://github.com/coreemu/core into develop 2020-02-04 09:48:54 -08:00
Blake Harnden
866e13e0ef removed usage of iperf in examples, to remove need of another dependency, renamed parser module examples used to avoid conflict with std library module 2020-02-04 09:48:37 -08:00
Huy Pham
6140ebfb59 remove unnecessary loggings 2020-02-03 12:18:29 -08:00
Huy Pham
b7206fe7b9 Merge branch 'develop' into coretk-enhance/gui-logging 2020-02-03 12:01:58 -08:00
Huy Pham
60dd7691bf remove unecessary loggings, change less important loggings to logging.debug 2020-02-03 12:01:10 -08:00
Huy Pham
034d126a2a remove unnecessary comment 2020-02-03 10:53:24 -08:00
Huy Pham
875739e748 track nodes whose services have been modified by the user to differentiate between newly created nodes and default type nodes with empty services 2020-02-03 10:35:25 -08:00
Huy Pham
ede9e93b52 add a menu option for opening recent files, hard code some example xml files for testing 2020-02-03 09:10:46 -08:00
Huy Pham
2c6307603a Merge branch 'coretk-enhance/gui-logging' into develop 2020-02-03 07:56:10 -08:00
Huy Pham
09397925e8 remove unnecessary loggings 2020-02-03 07:54:28 -08:00
Huy Pham
5dd379a2ee replace logging.info with logging.debug for unimportant loggings, change the functions inside type checking class into classmethods 2020-02-03 07:30:25 -08:00
Blake Harnden
356bfd16b4 forward all 802.1D MAC bridge filtered MAC group addresses, except restricted types 2020-01-31 17:05:13 -08:00
Blake Harnden
8c4931819b added service update script to help transition older services for use in core 2020-01-31 10:13:24 -08:00
Blake Harnden
a8a1643ee0 added configuration for loading custom config services 2020-01-29 17:08:36 -08:00
Huy Pham
6c89ba1abb logging.info for more important loggings and logging.debug for less important loggings that user might not care about 2020-01-29 16:08:36 -08:00
bharnden
53dd1de090
Update frr.py
updates to generate interface up/down commands for node interfaces
2020-01-28 13:33:34 -08:00
Blake Harnden
6aa7d2175d added file logging for coretk, using a time rotating logger, added command line arg to choose coretk log level 2020-01-28 12:30:12 -08:00
bharnden
7cc52f13d6
Merge pull request #360 from coreemu/enhancement/coretk-global-ip6
updates for coretk to default to assigning global ip6 addresses
2020-01-28 11:30:33 -08:00
bharnden
c911ff4c0b
Merge pull request #359 from coreemu/coretk-fix
Coretk fix
2020-01-28 11:21:56 -08:00
Blake Harnden
cf77b3c06f updates for coretk to default to assigning global ip6 addresses 2020-01-28 10:46:40 -08:00
Blake Harnden
29b064eaf1 fix to emane bypass model and config group data being supplied to guis 2020-01-28 09:20:43 -08:00
bharnden
c5666f9112
Merge pull request #357 from coreemu/feature/config-service
Feature/config service
2020-01-27 17:31:03 -08:00
Huy Pham
4c0254ec10 reload custom node image when open xml, if the gui doesn't know about the custom image, use a default one 2020-01-27 16:27:21 -08:00
Huy Pham
b4b71eda0e Merge branch 'develop' into coretk-fix 2020-01-27 13:21:16 -08:00
Huy Pham
09cc65646f fix right click service on custom nodes with empty services, load services to custom node when drawn on canvas, show current services for custom node's service dialog 2020-01-27 13:20:31 -08:00
Blake Harnden
45fb32c834 renamed config service dependency finder method to startup_paths, added pydocs to config service related methods 2020-01-27 11:44:00 -08:00
Blake Harnden
09aa882017 fixed config service to leverage validation_timer properly, added unit tests for config service base class 2020-01-27 10:57:16 -08:00
bharnden
da46c830b5
Merge pull request #358 from gsomlo/gls-systemd-path
systemd: fix unit file install path
2020-01-27 09:22:35 -08:00
Blake Harnden
80073dd8c8 adding documentation to config service base class 2020-01-24 22:15:21 -08:00
Blake Harnden
22ff48182a added some basic documentation to the config service manager and dependency finder 2020-01-24 17:27:12 -08:00
Blake Harnden
bc2fb628cc updates to Pipefiles, requirements.txt, and setup.py to account for addition of mako dependency 2020-01-24 17:12:14 -08:00
Blake Harnden
b02f2251cd added config service template files to MANIFEST file for core daemon 2020-01-24 16:32:36 -08:00
Blake Harnden
05a60f684e updated config service logging to debug 2020-01-24 16:01:44 -08:00
Blake Harnden
a85cb92196 removed options not needed for config data for GUI support for both old and new GUIs 2020-01-24 13:19:08 -08:00
Blake Harnden
93ad6b588a updates to coretk to fix displaying boolean configs properly and updating config values for config services when changing mode 2020-01-24 12:51:57 -08:00
Blake Harnden
6f2a840710 update simple service to show all config types 2020-01-24 10:59:47 -08:00
Gabriel Somlo
ce9fc08aa9 systemd: fix unit file install path
The proper location for unit files is /usr/lib/systemd/system,
with /etc/systemd/system reserved for local overrides of default
package settings.

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2020-01-24 09:38:48 -05:00
Blake Harnden
531b55e1e7 small update to quagga config services, converted frr services to config services 2020-01-23 22:06:30 -08:00
Blake Harnden
b9cbbf5709 finished converting quagga services to config services 2020-01-23 21:08:40 -08:00
Blake Harnden
fcc445bb72 fixed issues in zebra config service, updated config services to start and validate different modes appropriately, added service dependency startup for config services 2020-01-23 13:22:47 -08:00
Blake Harnden
0749dcacb2 updated config services to use getattr instead of hasattr to simplify code 2020-01-23 11:27:05 -08:00
Blake Harnden
852eb60ab9 renamed config service get_text to get_text_template to be more obvious to the purpose 2020-01-23 11:06:09 -08:00
Blake Harnden
422bf9ac15 initial work to add support for quagga services as config services 2020-01-23 11:03:56 -08:00
Blake Harnden
8f03c9c975 finished converting nrl services to config service format 2020-01-23 08:53:20 -08:00
Blake Harnden
062273a99b added several nrl services updated to config service format 2020-01-22 22:10:30 -08:00
Blake Harnden
640b2c7d5b updated config services to account for files that have a path, basename will be used for template rendering, converted all current utility/security services to config service format 2020-01-22 16:54:45 -08:00
Blake Harnden
d7d0a55fd2 updates to support saving config services to xml, loading config services from xml, retrieving config services from coretk when joining a session 2020-01-21 17:32:12 -08:00
Blake Harnden
0ea2f73a80 added modes to config services that allows them to decide sets of configurations 2020-01-21 14:00:55 -08:00
Blake Harnden
1ca3b0e3f4 moved config values to simple service from default route, fixed coretk issue with config service config data 2020-01-21 12:04:22 -08:00
Blake Harnden
80a4955bd4 updated coretk to working order for configuring config services from coretk 2020-01-21 11:58:43 -08:00
Blake Harnden
da107cc1d9 updates to config services dialogs in coretk, initial working state for running config services from the coretk gui 2020-01-21 10:35:46 -08:00
bharnden
89af081712
Update frr.py
replace deprecated ifconfig with ip
2020-01-20 22:38:34 -08:00
bharnden
daea312162
Merge pull request #355 from coreemu/coretk-fix
Coretk fix
2020-01-20 21:18:38 -08:00
Blake Harnden
83e7853821 fixed protobuf generation to avoid grpc generation for files with no definitions, added service config tab display to coretk 2020-01-20 16:25:56 -08:00
Huy Pham
b3463f1fb7 set SessionsDialog treeview's current selection again so that deleting multiple sessions is a bit more convenient 2020-01-20 16:17:27 -08:00
Huy Pham
b6f68e0b06 destroy any mobility player dialog before joinning a different session, pass in old_session_id to Menuaction.cleanup_old_session() so that the old session is deleted rather than the new one 2020-01-20 16:01:46 -08:00
Blake Harnden
a4f3abf27c updated config service grpc to return default templates and config, added logic to check for local custom templates 2020-01-20 15:54:47 -08:00
Blake Harnden
7b5df11dc7 added files to config services, added default logic for creating files from templates, added new method to provide extra data to templates, updated gui to display templates raw 2020-01-20 15:02:04 -08:00
Huy Pham
b0087bbde1 add nodeutils function to get node's image, add a function to get edge token 2020-01-20 14:04:31 -08:00
Blake Harnden
9447ddb94f initial changes to add config services to coretk gui 2020-01-20 12:17:11 -08:00
Huy Pham
510252c4a7 change terminal command 2020-01-20 12:04:10 -08:00
Huy Pham
8bcacf0a04 Merge branch 'develop' into coretk-fix 2020-01-20 09:12:17 -08:00
Huy Pham
cded9ef630 canvas wallpaper 2020-01-20 09:11:43 -08:00
Blake Harnden
0d99810491 fixed issue where xml did not read in custom icons 2020-01-20 09:09:42 -08:00
apwiggins
14db4eb383
added reset interfaces at FRR startup
adds an interface down and up for all interfaces except lo; assists babel in particular
2020-01-20 11:17:45 -04:00
Blake Harnden
0e6d1535db added grpc to get current config services for a node 2020-01-19 19:27:57 -08:00
Blake Harnden
a7764214d2 updating github actions to build all protos 2020-01-18 21:23:46 -08:00
Blake Harnden
0af6a7a620 improved gitignore for generated proto files, added new initial separate config service proto, incorporated into grpc api 2020-01-18 13:52:15 -08:00
Blake Harnden
43fe81a86e Merge branch 'develop' into feature/config-service 2020-01-17 21:13:07 -08:00
Blake Harnden
2ed56fbaa6 fixed doc formatting that was missed 2020-01-17 21:12:14 -08:00
Blake Harnden
dcc683dd38 added config service manager to CoreEmu and made it possible to create a session and nodes with config services from a script 2020-01-17 21:09:51 -08:00
bharnden
e66995194e
Merge pull request #352 from coreemu/coretk-fix
Coretk fix
2020-01-17 17:04:33 -08:00
Blake Harnden
191a9e9909 added some code to keep track of config services separately within core nodes, added function for starting config services during session instantiation 2020-01-17 16:57:49 -08:00
Huy Pham
845198efc6 remove print statements 2020-01-17 16:05:34 -08:00
Huy Pham
88625ffad8 fix Ctrl-S issue and node context menu issue 2020-01-17 15:59:12 -08:00
Blake Harnden
dbc77d81f6 updates naming for built in config services, broke out current example script to examples dir, broke out config service manager to separate file 2020-01-17 13:47:55 -08:00
Blake Harnden
433327c0ae added config service manager, added custom loading of subdirs for config based services, added configurations for config services 2020-01-17 11:40:29 -08:00
Blake Harnden
cf7dda816c improvements to config services, start/stop/validate basics, abc levergae to enforce definitions for custom services 2020-01-16 17:14:42 -08:00
Blake Harnden
ff018cfd01 Merge branch 'develop' into feature/config-service 2020-01-16 16:13:22 -08:00
Blake Harnden
b8ded52a66 fixed formatting in docs due 2020-01-16 16:12:01 -08:00
Blake Harnden
988ca76cec initial code towards services that will generate files from templates and provide configuration 2020-01-16 15:48:21 -08:00
bharnden
5490f961a6
Update CHANGELOG.md
added latest releases that were not formally added to the CHANGELOG
2020-01-16 11:32:44 -08:00
Blake Harnden
f24901c4e6 fixed type hinting in config.py 2020-01-16 11:17:08 -08:00
bharnden
ea47217e94
Merge pull request #347 from coreemu/coretk-fix
Coretk fix
2020-01-16 11:08:39 -08:00
bharnden
cff0bd7d46
Merge pull request #351 from coreemu/enhancement/remove-doc-types
removed rtype and param typing from doc strings to help avoid maintai…
2020-01-16 11:07:47 -08:00
Blake Harnden
f4ddf310a8 removed rtype and param typing from doc strings to help avoid maintaining duplicate information provided by type hints 2020-01-16 11:00:57 -08:00
bharnden
9d89877b20
Merge pull request #350 from coreemu/bugfix/frr-babel-wireless
Bugfix/frr babel wireless
2020-01-15 21:42:04 -08:00
bharnden
4d82d1412c fix check for frr babel wireless config 2020-01-15 21:40:16 -08:00
Blake Harnden
55d537ae53 removed ns3 related code, that should not have been added 2020-01-15 20:54:40 -08:00
bharnden
a91511bac5
Merge pull request #349 from coreemu/enhancement/mac-format
updated utils.validate_mac format to use unix expanded to avoid singu…
2020-01-15 17:04:52 -08:00
Blake Harnden
aa96484fb6 updated utils.validate_mac format to use unix expanded to avoid singular values 2020-01-15 17:02:27 -08:00
bharnden
80c06f8216
Merge pull request #348 from coreemu/bugfix/existing-bridges
updates to cases when checking existing bridges using ip -j returns a…
2020-01-15 16:23:32 -08:00
Blake Harnden
781dc806a8 updates to cases when checking existing bridges using ip -j returns an empty object 2020-01-15 16:20:35 -08:00
Huy Pham
5c087141bd fix merge conflict 2020-01-15 15:27:33 -08:00
Huy Pham
084b25779b differentiate sessions dialog's between start gui vs open from menu, add delete button to sessions dialog, remove fix width in TMenubutton for dark theme 2020-01-15 15:23:49 -08:00
bharnden
f1d8608add
Merge pull request #346 from coreemu/bugfix/coretk-terminal
update to place the terminal command in quotes
2020-01-15 14:12:37 -08:00
Blake Harnden
d83fd2d035 update to place the terminal command in quotes 2020-01-15 14:02:59 -08:00
bharnden
ce1ac1fc05
Merge pull request #345 from coreemu/bugfix/hwaddr-none
updates to log exceptions during threadpool, avoid errors when hwaddr…
2020-01-15 14:01:26 -08:00
Blake Harnden
d1c95a468a updates to log exceptions during threadpool, avoid errors when hwaddr is None during EMANE scenarios 2020-01-15 13:58:48 -08:00
bharnden
7e50dbdc65
Merge pull request #343 from coreemu/coregui-typehint
Coregui typehint
2020-01-15 13:39:03 -08:00
bharnden
e574968e38
Merge pull request #344 from coreemu/enhancement/type-hinting
Enhancement/type hinting
2020-01-15 13:38:06 -08:00
Huy Pham
6ecffc465b wrap up coretk type hinting 2020-01-15 12:59:54 -08:00
Blake Harnden
dcabd8d6f8 updates to add type hinting to uses of Callable 2020-01-15 11:56:23 -08:00
Blake Harnden
b3118513fa added function type hinting for core.plugins 2020-01-15 11:20:31 -08:00
Huy Pham
c1c580cdc4 type hint for new small update 2020-01-15 10:55:29 -08:00
Blake Harnden
dafd5dff9f merged latest from develop 2020-01-14 22:19:49 -08:00
bharnden
41bf279f76
Merge pull request #342 from coreemu/enhancement/disable-grpc-client-proxy
Enhancement/disable grpc client proxy
2020-01-14 22:17:33 -08:00
Blake Harnden
d4bce0d25c updated grpc client to have a proxy flag, updated coretk script to have a flag to enable proxy, disabled by default 2020-01-14 22:15:00 -08:00
bharnden
947c381a88
Merge pull request #341 from gsomlo/gls-fix-installer2
update dependency installer to python3
2020-01-14 20:57:19 -08:00
Blake Harnden
fa095431fb added type hinting to core.emane functions 2020-01-14 16:27:08 -08:00
Blake Harnden
49f09a25cc added type hinting to core.services, avoiding all the various services for now 2020-01-14 15:26:19 -08:00
Blake Harnden
8cd8b2ae2c added type hinting to core.xml 2020-01-14 14:56:00 -08:00
Huy Pham
948a33f201 edit some parts where pycharm gives warning on type hint 2020-01-14 14:30:08 -08:00
Huy Pham
8a4ad41a47 fix merge conflict 2020-01-14 14:08:41 -08:00
Huy Pham
a0c04c0809 type hinting 2020-01-14 14:02:37 -08:00
Gabriel Somlo
d0180af043 update dependency installer to python3 2020-01-14 16:26:44 -05:00
bharnden
21776feb90
Merge pull request #340 from gsomlo/gls-fix-installer
Fix typo in installer
2020-01-14 12:22:25 -08:00
bharnden
917a7171b3
Merge pull request #339 from coreemu/coretk-smallfix
Coretk smallfix
2020-01-14 12:21:02 -08:00
Huy Pham
c22f1680f7 more type hinting, remove some Optional type, and fix a small bug at dialogs.nodeconfig.mac_auto() 2020-01-14 11:59:44 -08:00
Huy Pham
6c8a2526d9 -m 2020-01-14 11:06:52 -08:00
Gabriel Somlo
35d5d5271b Fix typo in installer 2020-01-14 13:26:24 -05:00
Blake Harnden
02156867e2 added type hinting to location module funcs 2020-01-13 22:15:44 -08:00
Blake Harnden
03c4d8768d finished grpc server func type hints 2020-01-13 21:33:15 -08:00
Huy Pham
b9b8e3a5f1 more on python type hint 2020-01-13 15:31:41 -08:00
Blake Harnden
0388140068 fixed WirelessModelType usage to avoid runtime errors 2020-01-13 14:10:00 -08:00
Blake Harnden
c0fcc91d10 added type hinting for core.nodes 2020-01-13 14:08:49 -08:00
Huy Pham
eb5f2c5648 more on type hinting, remove unecessary function comments 2020-01-13 12:03:13 -08:00
Blake Harnden
4e71759ac9 updates for typing functions on top level modules 2020-01-13 10:06:18 -08:00
Blake Harnden
ab3659183e function typing for some of the grpc code 2020-01-11 23:49:51 -08:00
Blake Harnden
39bdd3a1ee finished function typing in core.emulator 2020-01-11 09:37:26 -08:00
Blake Harnden
5583b7edfc added type hints for emulator and session files 2020-01-10 22:37:19 -08:00
Blake Harnden
583a552bdb disable grpc client from using proxy settings 2020-01-10 20:25:34 -08:00
Huy Pham
7bbd6aa353 type hint 2020-01-10 16:22:21 -08:00
Huy Pham
a8a0255624 type hint some files 2020-01-10 15:32:16 -08:00
Huy Pham
b0d580485b Merge branch 'develop' into coredev-serviceconfig 2020-01-10 07:40:41 -08:00
bharnden
0e74212c43
Merge pull request #338 from coreemu/cleanup/remove-ns3
removed ns3 related code
2020-01-09 16:49:30 -08:00
Blake Harnden
4aeb16b866 removed ns3 related code 2020-01-09 16:36:00 -08:00
bharnden
0a37a583ab
Merge pull request #337 from coreemu/enhancement/zerba-service-deprecation
updates to zebra service to remove deprecated configurations
2020-01-09 15:52:54 -08:00
Blake Harnden
9aafc8e44f updates to zebra service to remove deprecated configurations 2020-01-09 15:34:54 -08:00
Huy Pham
853d2828fe add temp service file path 2020-01-09 15:31:35 -08:00
Huy Pham
e3c8a53838 Merge branch 'develop' into coredev-serviceconfig 2020-01-09 14:50:17 -08:00
bharnden
67c1dae357
Merge pull request #336 from coreemu/refactoring/remove-ipaddress
Refactoring/remove ipaddress
2020-01-09 14:31:33 -08:00
Blake Harnden
7028d3e78f added unit tests to help check new utils functions and usages within nodes for adding addresses and macs 2020-01-09 14:23:08 -08:00
Blake Harnden
834ceea55d updates to sdn ovs service to use ip instead of deprecated ifconfig 2020-01-09 13:52:36 -08:00
Huy Pham
2a7a22c2ee change logging.warn to logging.warning 2020-01-09 13:10:45 -08:00
bharnden
02172e94ab
Merge pull request #334 from coreemu/coredev-serviceconfig
Coredev serviceconfig
2020-01-09 11:13:01 -08:00
Huy Pham
3ef87a97d5 remove extra function 2020-01-09 10:12:00 -08:00
Huy Pham
41ae67b559 copy service config from other node 2020-01-09 08:54:15 -08:00
Blake Harnden
6042c6fed9 added validation checks/conversion for valid values of mac addresses and ip addresses to addaddr and sethwaddr functions 2020-01-08 20:44:15 -08:00
Blake Harnden
de493c810a changes to replace MacAddress usage and remove ipaddress module altogether 2020-01-08 17:33:49 -08:00
Huy Pham
54994f4c96 change back to INFO mode 2020-01-08 16:59:04 -08:00
Huy Pham
77c59aa38f Merge branch 'develop' into coredev-serviceconfig 2020-01-08 16:55:23 -08:00
Huy Pham
55adce231e copy other nodes' custom service configuration 2020-01-08 16:48:04 -08:00
Blake Harnden
4db7f845a5 removed commented out ipaddress code 2020-01-08 14:31:57 -08:00
Blake Harnden
fd10663323 changes to replaces known usages of ipaddress, leaving only ipaddress.MacAddress 2020-01-08 13:25:00 -08:00
bharnden
c46085e716
Merge pull request #332 from coreemu/coredev-serviceconfig
Coredev serviceconfig
2020-01-08 11:13:52 -08:00
Huy Pham
c402ce5284 allow choosing local host machine interface for rj45 node 2020-01-08 09:32:39 -08:00
bharnden
e9caea5a6c
Merge pull request #333 from coreemu/feature/imn-to-xml
added imn-to-xml script
2020-01-07 16:43:54 -08:00
Huy Pham
615b989102 Merge branch 'develop' into coredev-serviceconfig 2020-01-07 15:36:01 -08:00
Huy Pham
1e6e3f0958 some clean up 2020-01-07 15:30:19 -08:00
Blake Harnden
848d4acb8f added imn-to-xml script, fixed bug introduced when reading xml files with custom service files 2020-01-07 15:29:36 -08:00
Huy Pham
be0f170f89 add a button to more conveniently remove a node's service 2020-01-07 15:05:05 -08:00
Blake Harnden
f431254e15 initial changes towards removing ipaddress and using netaddr 2020-01-07 14:08:29 -08:00
Huy Pham
6105439ae4 color custom services green 2020-01-07 13:36:04 -08:00
bharnden
93ce2a3755
Merge pull request #331 from coreemu/feature/distributed-package
make commands to build core distributed packages using fpm
2020-01-07 12:51:06 -08:00
Blake Harnden
6bc68220f9 make commands to build core distributed packages using fpm 2020-01-07 12:48:54 -08:00
Huy Pham
3ad1af8d1d enable default button in service configuration 2020-01-07 12:32:45 -08:00
bharnden
607e88585c
Merge pull request #330 from coreemu/feature/grpc-interfaces
added get_interfaces to grpc client
2020-01-07 12:11:43 -08:00
Blake Harnden
769572de02 added get_interfaces to grpc client 2020-01-07 12:03:51 -08:00
Huy Pham
db4d517ea8 Merge branch 'develop' into coredev-copypaste 2020-01-06 14:34:11 -08:00
Huy Pham
9369bd27b4 copy link config 2020-01-06 14:20:20 -08:00
bharnden
34fa3d8448
Merge pull request #329 from coreemu/bugfix/service-config-xml
fix for custom services not setting service.configs when reading xml
2020-01-06 11:57:14 -08:00
Blake Harnden
c1a0f4e83d fix for custom services not setting service.configs when reading xml 2020-01-06 11:54:51 -08:00
bharnden
5ae3ad9011
Merge pull request #326 from coreemu/develop
Develop
2020-01-01 00:29:25 -08:00
Blake Harnden
3e87737ee6 updates to use tk after for backgrounded tasks, also added background task convenience class for running something in the background and running a callback using tk.after when done 2019-12-30 16:34:44 -08:00
Blake Harnden
dd43fae62a updated icons and added icon attribution to about dialog 2019-12-30 00:00:36 -08:00
Blake Harnden
ff7909e97a removed old icons 2019-12-29 23:23:35 -08:00
Blake Harnden
bed66ffa1f updates to main Makefile.am and install docs 2019-12-29 23:18:40 -08:00
Blake Harnden
c7c3b1e3be updated requirements.txt 2019-12-29 23:01:29 -08:00
Blake Harnden
f2d65efad3 updates to building fpm packages and slight adjustments to install doc 2019-12-29 22:55:26 -08:00
Blake Harnden
2be0713ed1 updated so that throughputs will update link color/width based on threshold 2019-12-27 00:32:10 -08:00
Blake Harnden
5dd08c283a updated throughput dialog to load and set values from graph class 2019-12-26 21:32:30 -08:00
Blake Harnden
3512eedc60 small tweaks to throughput config dialog 2019-12-26 14:00:22 -08:00
Blake Harnden
fe8bc6f10e removed usage of brctl and dependency on bridge-utils library as it is deprecated, replaced with using iproute instead 2019-12-23 14:48:56 -08:00
Blake Harnden
8029a27bb4 added installing netns and classic gui to dev install 2019-12-23 13:36:25 -08:00
Blake Harnden
0d0862d29c added install.sh options for dev install 2019-12-23 09:28:49 -08:00
bharnden
ace15636ac
Update install.sh
updates for centos
2019-12-21 11:53:14 -08:00
Blake Harnden
fb5f1a771c updates to add centos install support 2019-12-21 02:45:05 -05:00
Blake Harnden
6d68034177 updated start proto to return exception strings, updated grpc start session to exist early when a failure is found, updated coretk ui to not switch ui to running when start fails and display error dialog 2019-12-20 15:11:34 -08:00
Blake Harnden
5639aeab75 Merge branch 'develop' of https://github.com/coreemu/core into develop 2019-12-20 13:31:32 -08:00
Blake Harnden
d4fae0d89e changes to fix emane config data leveraging emane prefix to work as intended 2019-12-20 13:30:55 -08:00
Blake Harnden
09756eb7ab updates for devguide doc 2019-12-20 12:55:52 -08:00
Blake Harnden
8fe6bc76ca update devguide notes for installing emane 2019-12-20 12:36:29 -08:00
Huy Pham
684cb26c5c Merge branch 'develop' of https://github.com/coreemu/core into develop 2019-12-20 11:57:04 -08:00
Huy Pham
e4b44d08c1 create a rough layout for throughput config dialog 2019-12-20 11:56:51 -08:00
Blake Harnden
9f3a3cef28 update coretk gui to allow proper cancel when there is an attempt to exit a running session 2019-12-20 11:56:48 -08:00
Blake Harnden
396a948bb9 small tweak to make new has_ebtables_chain variable created in __init__ 2019-12-20 11:50:43 -08:00
bharnden
ea6ecc751d
Merge pull request #311 from coreemu/feature/init-ebtables-for-wlan-only
feature/init-ebtables-for-wlan-only,
2019-12-20 11:41:40 -08:00
Blake Harnden
513eaf2b76 improved coretk gui alerts to display alert text when selected, fixed merged code for adding a check to cleanup interfaces, updated session.exceptions to use enums directly 2019-12-20 10:51:52 -08:00
Blake Harnden
c0c23190d1 Merge branch 'develop' of https://github.com/coreemu/core into develop 2019-12-20 09:58:25 -08:00
bharnden
6fa67f8844
Merge pull request #313 from coreemu/feature/check-ifc-before-flush
Feature/check ifc before flush
2019-12-20 09:58:13 -08:00
Blake Harnden
95c57bbad6 changes to allow node container commands to leverage shell parameter when needed 2019-12-20 09:57:34 -08:00
Huy Pham
086e3316eb copy over wlan config, emane, mobility config, service config, service file config 2019-12-20 09:55:30 -08:00
Blake Harnden
e92441d728 bumped version to 6.0.0 2019-12-20 09:42:43 -08:00
Blake Harnden
9dd42e0359 changes to daemon setup.py to support including gui data files 2019-12-19 21:29:10 -08:00
Blake Harnden
a7e243ae53 update coretk-gui to use configured terminal when double clicking nodes 2019-12-19 21:28:48 -08:00
Blake Harnden
eb7d81614e set pillow logging to ERROR for coretk-gui 2019-12-19 21:28:17 -08:00
Blake Harnden
a674f5bf78 update python install makefiles to avoid forcing site-packages 2019-12-19 17:27:57 -08:00
Blake Harnden
43d0ee84c2 missing gawk dependency from install.sh 2019-12-19 17:15:11 -08:00
Huy Pham
9a506fc35f Merge branch 'develop' into coredev-painttool 2019-12-19 16:16:18 -08:00
Huy Pham
c1755afb2f copy node and links 2019-12-19 16:15:29 -08:00
Blake Harnden
fc15918a64 adding install script to help automate setup for others, small touchup to devguide doc 2019-12-19 16:07:17 -08:00
Blake Harnden
298cd2c9d3 small update to devguide, updates to READMEs for LXD and Docker 2019-12-19 12:32:30 -08:00
Blake Harnden
793d340668 removed mock from setup.py.in as its not needed in python3, added formal script to run coretk gui and remove main line from core/gui/app.py 2019-12-19 11:32:59 -08:00
Huy Pham
395f8134dc adjust alert table size 2019-12-19 11:30:27 -08:00
Huy Pham
5f9a227fac Merge branch 'develop' into coredev-painttool 2019-12-19 11:14:44 -08:00
Huy Pham
f6c02973c1 fix merge conflict 2019-12-19 11:12:45 -08:00
Blake Harnden
105825808d fixed edge refactoring issue when finding next subnet 2019-12-19 11:10:08 -08:00
Huy Pham
5a81adc653 some fix one paint tool 2019-12-19 10:58:22 -08:00
Blake Harnden
05d3b58c5f updating dialog based classes to have dialog in name 2019-12-19 09:50:58 -08:00
Blake Harnden
1114e4b975 removed coretk specific github action 2019-12-19 09:39:18 -08:00
Blake Harnden
f5ce7b1d31 updated requirements.txt with gui packages 2019-12-19 09:37:49 -08:00
Blake Harnden
322ed47280 removed coretk directory 2019-12-19 09:31:35 -08:00
Blake Harnden
0b5c94778c moved coretk under daemon/core/gui 2019-12-19 09:30:21 -08:00
Blake Harnden
f13c62a1c9 removing corefx javafx based gui 2019-12-19 08:56:04 -08:00
Blake Harnden
b8b4b7dcce removed unwanted log file 2019-12-19 08:55:03 -08:00
bharnden
cfdd9e059d
Merge pull request #323 from coreemu/coretk
merging current state of coretk
2019-12-19 08:52:16 -08:00
Huy Pham
62afbbae56 Merge branch 'coretk' into coretk-painttool 2019-12-19 08:46:56 -08:00
Huy Pham
43c8b9e285 marker tool 2019-12-19 08:46:21 -08:00
Blake Harnden
8eb4df7b1d updated linkconfig to support asymmetric links, updated grpc start session to provide asymmetric links, since they currently depend on being processed as a link edit 2019-12-18 22:09:00 -08:00
Blake Harnden
1884cda271 consolidated logic for drawing edge labels based on link to be contained within the edge class itself 2019-12-18 16:51:05 -08:00
Huy Pham
5f927f75ba marker tool 2019-12-18 11:57:47 -08:00
Huy Pham
da26e34765 work on marker tool 2019-12-18 09:49:45 -08:00
Blake Harnden
ccb433a32d update to support link config during runtime 2019-12-17 22:08:14 -08:00
Blake Harnden
7bd8c5a5aa updates to linkconfig, working configuration for symmetric, updates to change link color and use color picker 2019-12-17 22:02:56 -08:00
Huy Pham
0b0ab08030 Merge branch 'coretk' of https://github.com/coreemu/core into coretk 2019-12-17 12:38:31 -08:00
Huy Pham
752b3956a6 create layout for link configuration 2019-12-17 11:59:34 -08:00
Blake Harnden
582beea1be improvement to configframe, it is now a notebook itself, with scrollable frames for contents in each tab 2019-12-17 11:56:22 -08:00
Huy Pham
57bbac5c55 Merge branch 'coretk' into coretk-linkconfig 2019-12-17 11:50:01 -08:00
Huy Pham
d11ce3ef7f create layout for link configuration 2019-12-17 11:47:05 -08:00
Blake Harnden
50efd2ebc3 changes to framescroll widget to use a standard frame by default instead of a label frame 2019-12-17 11:43:49 -08:00
Blake Harnden
e72f44ed85 updated canvas wallpaper selection to use common image chooser function 2019-12-17 11:35:30 -08:00
Blake Harnden
80609da90a updates to docs for nrl changes to github 2019-12-17 10:58:03 -08:00
Blake Harnden
02695f1672 revamped codetext widget to use ttk scrollbars for better theme matching, slight adjustments to service config dialog layout 2019-12-17 10:01:25 -08:00
Blake Harnden
9c4b42f77e Merge branch 'coretk' of https://github.com/coreemu/core into coretk 2019-12-16 20:58:05 -08:00
Blake Harnden
042a56ecb3 updated node dialog to display interfaces in notebook tabs, added emane interface configuration for nodes connected to an emane network 2019-12-16 20:57:46 -08:00
Huy Pham
cb1322a28a small fix for color picker 2019-12-16 16:06:21 -08:00
Huy Pham
921e002997 small fix for color picker 2019-12-16 16:05:15 -08:00
Huy Pham
6799b537de Merge branch 'coretk' of https://github.com/coreemu/core into coretk 2019-12-16 14:58:03 -08:00
Blake Harnden
0082d61517 updates to allow wlan config changes during runtime 2019-12-16 14:55:54 -08:00
Huy Pham
e649f2642d Merge branch 'coretk' into coretk-color 2019-12-16 14:55:39 -08:00
Huy Pham
b7139996e1 have a working color picker 2019-12-16 14:55:05 -08:00
Blake Harnden
084aedf3d2 removed services button from node config dialog, limited to context menu for now 2019-12-16 14:34:37 -08:00
Blake Harnden
5dbd34f230 cleanup for theming widgets 2019-12-16 14:30:38 -08:00
Blake Harnden
dcdcb6a711 updated theme style function names, removed unused function 2019-12-16 14:21:30 -08:00
Blake Harnden
c4f21e8a2e cleaned up listboxscroll widgets to not default to a labeleframe, updated code that really needed a lebelframe 2019-12-16 14:17:05 -08:00
Blake Harnden
69494b600f fixes for parsing grpc throughputs 2019-12-16 13:26:55 -08:00
Blake Harnden
713c42a64e added styling for listboxes, made use of listbox scroll where all other basic listboxes were being used 2019-12-16 13:11:23 -08:00
Blake Harnden
585d10dd28 small tweaks to alert dialog 2019-12-16 12:34:22 -08:00
Blake Harnden
44df926fb9 updated events streamed from sessions to include session id for easy identification 2019-12-16 12:21:03 -08:00
Huy Pham
34c0b91228 update zoom % on statusbar 2019-12-16 12:04:18 -08:00
Huy Pham
3ceb5cde3e Merge branch 'coretk' into coretk-color 2019-12-16 11:43:53 -08:00
Huy Pham
9eaa1fb36c more work on color picker 2019-12-16 11:42:39 -08:00
Blake Harnden
d248bc09b5 added clearing streams to reset for coreclient and set event stream to be cleared 2019-12-16 11:17:20 -08:00
Blake Harnden
424f69bb15 updated grpc throughputs to only check a specific session and verify the data being collected and sent is for that session, fixed data from throughputs being in hex getting converted to int, updated coretk to only run throughputs when enabled, updated grpc streams to return the stream to allow it being canceled 2019-12-16 11:14:05 -08:00
Huy Pham
bd2eaa8966 Merge branch 'coretk' into coretk-color 2019-12-16 08:03:21 -08:00
Blake Harnden
85521e8c8f added grpc to get current service configurations, fixed bug for core daemon not using custom service configs 2019-12-13 18:17:42 -08:00
Blake Harnden
47cc20b567 updates to grpc event streaming, client can now listen to a subset of desired events 2019-12-13 16:11:58 -08:00
Huy Pham
ea2bfad591 Merge branch 'coretk' into coretk-color 2019-12-13 15:53:51 -08:00
Huy Pham
2afbf63e4b start working on color picker 2019-12-13 15:52:48 -08:00
Blake Harnden
47e087b365 fixed unit tests for grpc get emane model configs 2019-12-13 15:28:22 -08:00
Blake Harnden
9d988a4b13 fixed issue in grpc get emane model configs that would allow key collision 2019-12-13 14:18:13 -08:00
Blake Harnden
9ada94107e changes to grpc get emane model configs to return the interface value and actual node id, instead of coded value that would need to be parsed 2019-12-13 14:03:41 -08:00
Blake Harnden
9b16f272b8 added get wlan configs, made use of it in coretk, updated node context to allow wlan config during runtime 2019-12-13 11:48:36 -08:00
Blake Harnden
b993fadedb removed grpc check for getting a node service file, it will return the default value when not currently set 2019-12-13 11:24:35 -08:00
Blake Harnden
358985d129 update to avoid not reusing session ids 2019-12-13 10:54:42 -08:00
Blake Harnden
819954a695 updated grpc node positions to use floats, avoids needing to deal with int conversions 2019-12-13 10:47:23 -08:00
Blake Harnden
9c302e8bc6 added some basic boundary checking for moving nodes and shapes 2019-12-13 09:28:51 -08:00
Blake Harnden
d343bd0655 updated gui to display custom icons if set, updated grpc to send custon icon and image data when present 2019-12-13 08:48:40 -08:00
Blake Harnden
fb63d7e8b3 added canvas boundary checks for mouse interactions 2019-12-12 21:33:51 -08:00
Blake Harnden
d5b2edb6ab fixed unit tests for broadcasted exceptions to use proper values 2019-12-12 21:10:30 -08:00
Blake Harnden
fd83861399 updated cel to alerts dialog, updated layout to support resizing, added styles for alert button to be different colors 2019-12-12 21:05:45 -08:00
Blake Harnden
da9d344c54 Merge branch 'coretk' of https://github.com/coreemu/core into coretk 2019-12-12 20:32:36 -08:00
Blake Harnden
eca92af588 removed icon dialog, just use file chooser directly 2019-12-12 20:30:28 -08:00
Huy Pham
89f8b421b8 check emulation light 2019-12-12 16:23:27 -08:00
Huy Pham
73b27d38cd Merge branch 'coretk' into coretk-selectbox 2019-12-12 16:18:20 -08:00
Huy Pham
2344e026ff check emulation light, fix one line of backend code 2019-12-12 16:17:33 -08:00
Blake Harnden
f154733e2e fixed toolbar updating with the smaller icons from picked nodes/annotations 2019-12-12 12:49:29 -08:00
Blake Harnden
136121ca18 fixed issue saving wallpaper metadata when None 2019-12-12 12:34:50 -08:00
Blake Harnden
afd2514728 Merge branch 'coretk' of https://github.com/coreemu/core into coretk 2019-12-12 11:10:32 -08:00
Blake Harnden
4e9de862a3 updated nodes to store actual positions, instead of scaled ones, updated shapes to return actual positions for metadata, added some logic for resetting the canvas and drawn nodes when resizing, convert node update coords into scaled coords for moving nodes 2019-12-12 11:06:52 -08:00
Huy Pham
d34a58dff0 small edits on cel dialog 2019-12-12 11:04:55 -08:00
Huy Pham
71e6df76ce create layout for check emulation light dialog 2019-12-12 10:49:52 -08:00
Huy Pham
a7e1035f5a Merge branch 'coretk' into coretk-selectbox 2019-12-12 08:33:36 -08:00
Blake Harnden
0372e43cc5 Merge branch 'coretk' of https://github.com/coreemu/core into coretk 2019-12-11 16:22:01 -08:00
Blake Harnden
9c9ccdf04f some cleanup to layout for service configuration, updated titles for service config and node config dialogs 2019-12-11 16:21:37 -08:00
Huy Pham
80fb0e26b6 attempt to work on check engine light dialog 2019-12-11 16:16:59 -08:00
Huy Pham
489d28d2fd Merge branch 'coretk' into coretk-selectbox 2019-12-11 14:43:34 -08:00
Huy Pham
d6ae39089e select box in select mode, link to selected for wlan/emane nodes, send session data to damon before save xml 2019-12-11 14:42:00 -08:00
Blake Harnden
899eb51c55 added common padding for x, y, and frame paddings, to easily modify and provide consistent look and feel 2019-12-11 14:36:27 -08:00
Blake Harnden
69296d6ea9 pass on updating dialogs to have buttons float to bottom and start using common pad configuration 2019-12-11 14:09:50 -08:00
Blake Harnden
8585911900 updated theme and size for picker buttons, also added text for clarity 2019-12-11 11:42:05 -08:00
Huy Pham
fa1f344fd7 Merge branch 'coretk' into coretk-validation 2019-12-11 09:18:15 -08:00
Huy Pham
4cc83cf313 cel 2019-12-11 09:17:39 -08:00
Blake Harnden
e5430ab5e7 Merge branch 'coretk' of https://github.com/coreemu/core into coretk 2019-12-10 19:25:20 -08:00
Blake Harnden
737c14cc0f updated canvas wallpaper to scale with zoom level 2019-12-10 19:25:00 -08:00
Huy Pham
8bdc5c8e2e Merge branch 'coretk' into coretk-validation 2019-12-10 16:53:01 -08:00
Huy Pham
6a42748191 controlnet validation 2019-12-10 16:50:28 -08:00
Blake Harnden
0c61c6bffe updates to wallpaper drawing and redrawing on zoom 2019-12-10 16:31:01 -08:00
Blake Harnden
5dda7396ef Merge branch 'coretk' of https://github.com/coreemu/core into coretk 2019-12-10 14:34:14 -08:00
Blake Harnden
51163a30d3 updates to handling movement for nodes/shapes on canvas, added initial canvas zoom/panning, fixed some issues with mobility player event handling when dialog is closed 2019-12-10 14:33:52 -08:00
Huy Pham
c4a117a236 insert default value to some entry when entry is empty 2019-12-10 13:23:03 -08:00
Huy Pham
2292001e17 Merge branch 'coretk' into coretk-validation 2019-12-10 09:58:54 -08:00
Huy Pham
ada21997e9 add validation to canvassizescale, wlanconfig, nodename 2019-12-10 09:57:12 -08:00
Blake Harnden
17c78d59cd Merge branch 'develop' into coretk 2019-12-10 08:21:16 -08:00
Blake Harnden
21f0857e65 reset mobility player to default dialog size 2019-12-09 23:09:39 -08:00
Blake Harnden
d78ef86cef added grpc error display and updated grpc calls to catch and display grpc exceptions 2019-12-09 22:50:26 -08:00
Huy Pham
7039a3682e fix merge conflict 2019-12-09 16:37:52 -08:00
Huy Pham
542d632066 fix merge conflict 2019-12-09 16:37:24 -08:00
Huy Pham
0b3f3a5166 start working on input validation 2019-12-09 16:33:32 -08:00
Blake Harnden
33e3a46146 better gui startup connection failure message 2019-12-09 16:25:29 -08:00
Blake Harnden
088a69d9d9 catching grpc error on setup, displaying error dialog and exiting app 2019-12-09 16:23:09 -08:00
Blake Harnden
c36a72bc16 small tweak to statusbar to define the different sections 2019-12-09 15:27:51 -08:00
Blake Harnden
b04e61ccee added common tags file for canvas created items, to reduce duplicate strings 2019-12-09 14:13:21 -08:00
Blake Harnden
afdacf0c94 set to selection mode when starting/stopping a session as well as joining for runtime/design states 2019-12-09 13:19:45 -08:00
Blake Harnden
2a29cd1fe5 after joining a session default to select mode 2019-12-09 13:09:01 -08:00
Blake Harnden
4ca9ab910e added spinbox missing from 3.6, added spinbox theme, updated config gen to display a file picker for labels with file in it 2019-12-09 13:05:07 -08:00
Blake Harnden
5003e2356c small cleanup to canvas resize/redraw logic and updates to support saving/drawing gridlines and canvas dimensions 2019-12-09 12:07:42 -08:00
Huy Pham
27131ef367 start on input validation 2019-12-09 10:07:21 -08:00
Huy Pham
11f771417e Merge branch 'coretk' into coretk-servicefix 2019-12-09 08:54:53 -08:00
Huy Pham
456e331870 loading xml set canvas state to select mode and display that on toolbar 2019-12-09 08:53:54 -08:00
Blake Harnden
0308a4c8d7 fixed temp issue for dealing with xml and node positions as floats, updated shape metadata to save bold/italic/underline options and read them back from xml 2019-12-06 22:33:21 -08:00
Blake Harnden
71df2a3b7f updated annotation text to be selectable/moveable, save annotation text with other shapes and reload from xml 2019-12-06 22:10:27 -08:00
Huy Pham
2add215704 fix configuring newly added services 2019-12-06 15:06:35 -08:00
Blake Harnden
2824ae09b0 updated sample1.xml to draw shapes using new metadata logic 2019-12-06 14:18:13 -08:00
Blake Harnden
bf710b9afc merged latest from coretk 2019-12-06 14:02:57 -08:00
Blake Harnden
742eb2bed6 cleanup for shapes and creating shapes and storing and restoring shapes from metadata 2019-12-06 14:01:03 -08:00
Huy Pham
6a08bff7de Merge branch 'coretk' of https://github.com/coreemu/core into coretk 2019-12-06 12:53:45 -08:00
Huy Pham
a7d9d588ae add display throughput back to the gui 2019-12-06 12:46:00 -08:00
Blake Harnden
c238b5dfc8 moved node context services option higher for better convenience, added check that context services only shown for container nodes 2019-12-06 11:17:05 -08:00
Blake Harnden
9ef5cdd70b added basic about dialog and created codetext widget for displaying text in terminal like colors using scrolledtext widget 2019-12-06 11:13:43 -08:00
Blake Harnden
0593d0c6a2 Merge branch 'coretk' of https://github.com/coreemu/core into coretk 2019-12-06 09:43:07 -08:00
Blake Harnden
45a23a6c14 updated usage of time.time to time.monotonic or time.perf_counter due to time.time possibly rolling backwards 2019-12-06 09:42:41 -08:00
Blake Harnden
b9bbf397c9 updated node context menu option for wireless to use nodeutils 2019-12-06 09:13:58 -08:00
Huy Pham
27ead56a15 remove redundant file 2019-12-06 09:11:21 -08:00
Blake Harnden
49acac026c updates to move node context logic to node class and added check to display options the same as old core 2019-12-06 09:10:50 -08:00
Huy Pham
e832787f1c fix merge conflict 2019-12-06 09:09:05 -08:00
Huy Pham
4a34aaa30d working on shapes and texts 2019-12-06 09:03:21 -08:00
bharnden
491e850e13
Merge pull request #319 from apwiggins/patch-3
Update services.md
2019-12-06 08:38:29 -08:00
apwiggins
583df84868
Update services.md
Added FRR features as of version 7.2.  Updated FRR installation notes for Ubuntu 19.10 and later which install from native repositories.  Added new Fedora 31 installation note for native repository install.
2019-12-06 08:31:37 -04:00
Blake Harnden
6077e81bf4 moved node/edge delete logic into their own classes for helping make them managing their own data a bit easier 2019-12-05 17:01:48 -08:00
Blake Harnden
81eeac9ec6 merged drawing antenna code to graph node class 2019-12-05 16:37:48 -08:00
Huy Pham
7e2ebb4a2c delete some extra print statement 2019-12-05 13:43:12 -08:00
Huy Pham
6a43f73940 Merge branch 'coretk' of https://github.com/coreemu/core into coretk 2019-12-05 13:40:07 -08:00
Huy Pham
a44fc0b6f9 load shapes from xml 2019-12-05 13:39:09 -08:00
Blake Harnden
6425b08878 updated graph canvas width and height to use the id it already knows of 2019-12-05 13:17:12 -08:00
Blake Harnden
7c8f9dac0f removed nodedelete module and added logic to the graph canvas itself 2019-12-05 13:13:35 -08:00
Huy Pham
c82453b981 load shapes 2019-12-05 11:15:51 -08:00
Blake Harnden
d970d5ee85 separated out graph code into more file and its own sub package 2019-12-05 11:12:25 -08:00
Huy Pham
8c30ad6af5 commit before splitting files 2019-12-05 10:39:53 -08:00
Huy Pham
6d4c437d2d Merge branch 'coretk' into coretk-shapes 2019-12-05 10:17:24 -08:00
Huy Pham
59614fa8d3 try to load canvas config 2019-12-05 10:12:31 -08:00
Blake Harnden
1de3ac9d09 Merge branch 'coretk' of https://github.com/coreemu/core into coretk 2019-12-04 16:40:41 -08:00
Blake Harnden
c7b9c7bfb4 updated sample1 xml to store all metadata in json format 2019-12-04 16:40:33 -08:00
Huy Pham
d024bdf0b7 fix small logic 2019-12-04 15:12:31 -08:00
Huy Pham
b9a5c428cc Merge branch 'coretk' of https://github.com/coreemu/core into coretk 2019-12-04 15:09:14 -08:00
Huy Pham
96d273815d support moving multiple nodes and shape 2019-12-04 15:08:05 -08:00
Blake Harnden
5aa01d9bb5 simplify some join session logic to loop over nodes once 2019-12-04 14:44:43 -08:00
Blake Harnden
5a387537bb updates clean up setting wallpaper for graph canvas, updates to read metadata for canvas to display wallpaper from loaded xml file, update to allow reopening mobility player from node context 2019-12-04 13:40:35 -08:00
Huy Pham
bbb8be6655 shape configuration, replace tunntel tool image 2019-12-04 09:28:16 -08:00
Huy Pham
41a9b88189 working on shape config 2019-12-03 17:17:45 -08:00
Huy Pham
0a26a8f8e3 shape dialog, fix move shape 2019-12-03 16:18:00 -08:00
Huy Pham
ff473b9748 shape dialog 2019-12-02 16:05:10 -08:00
Huy Pham
a0caff6ca2 fix merge conflict 2019-11-27 16:44:42 -08:00
Huy Pham
5c04225cc4 working on shape 2019-11-27 16:39:48 -08:00
Blake Harnden
6a8e0c8360 fixed app quit when grpc fails, fixed quitting when not stopping the running session 2019-11-27 16:27:53 -08:00
Blake Harnden
b30b8ab83d updated status bar text to be centered 2019-11-27 16:14:14 -08:00
Blake Harnden
693d7beeb7 updated remove antenna logic to simplify, updated wireless edges to be objects 2019-11-27 15:40:54 -08:00
Blake Harnden
3c7bf57b5c simplified select logic to check against known nodes and modified get_selected to avoid returning the canvas id 2019-11-27 14:25:29 -08:00
Huy Pham
1a05571e50 shape 2019-11-27 14:04:49 -08:00
Huy Pham
2fc8782360 shape 2019-11-27 13:58:34 -08:00
Blake Harnden
804b95d486 consolidated node move logic to one function, used by both node events and node drag 2019-11-27 13:23:45 -08:00
Huy Pham
0f6cca1194 Merge branch 'coretk' into coretk-progress 2019-11-27 13:15:57 -08:00
Huy Pham
f3ca5682ac start on shape drawing 2019-11-27 13:15:04 -08:00
Blake Harnden
d1db5e4b4e added some data for node events to have a source field to help distinguish what originates from the gui or not 2019-11-27 12:55:39 -08:00
Blake Harnden
354d227cb3 removed old service config code 2019-11-27 12:20:00 -08:00
Blake Harnden
5708dbd083 fixed issue when deleting node without a link tuple 2019-11-27 12:16:56 -08:00
Blake Harnden
554028ad5c display mobility player context for mobility configured nodes during runtime 2019-11-27 12:11:11 -08:00
Blake Harnden
9a55ff4ca5 display mobility player on session start, change buttons and progress bar on session events 2019-11-27 11:41:54 -08:00
Huy Pham
8278641cf4 Merge branch 'coretk' into coretk-progress 2019-11-27 11:21:56 -08:00
Huy Pham
d51dc0e909 canvas size 2019-11-27 11:21:03 -08:00
Huy Pham
1ca9aec247 canvas size added to preferences and updated to dialog 2019-11-27 09:54:43 -08:00
Blake Harnden
da203d578e fixed issue with node event tests when position is None 2019-11-27 09:15:19 -08:00
Blake Harnden
8b7d651d06 fixed issue with nod emobility location calculations being forced to use ints 2019-11-27 09:05:37 -08:00
Blake Harnden
af9915191d fixed wireless link events displaying over nodes 2019-11-27 08:52:20 -08:00
Huy Pham
15e484c8c2 Merge branch 'coretk' into coretk-progress 2019-11-27 08:51:02 -08:00
Huy Pham
a4ef585865 improve small logic in node deletion and wallpaper change 2019-11-27 08:49:58 -08:00
Blake Harnden
3cd48ec1ab added pause icon and icons to mobility player buttons 2019-11-27 08:48:21 -08:00
Blake Harnden
13ca85cf3f changes to support mobility actions for mobility player dialog 2019-11-26 17:00:55 -08:00
Blake Harnden
14b01e0325 Merge branch 'coretk' of https://github.com/coreemu/core into coretk 2019-11-26 16:50:40 -08:00
Blake Harnden
2a08c770d3 updates to handle node events for moving nodes and displaying mobility player dialog on session event with configured data 2019-11-26 16:50:23 -08:00
Huy Pham
b0ea6b2530 Merge branch 'coretk' into coretk-progress 2019-11-26 15:15:42 -08:00
Huy Pham
00e0da2990 improve wireless link logic when deleting nodes, stop session and join session 2019-11-26 15:12:04 -08:00
Blake Harnden
2586a5ad6f Merge branch 'coretk' of https://github.com/coreemu/core into coretk 2019-11-26 11:33:59 -08:00
Blake Harnden
bc026bb693 initial work for mobility player dialog, added default sample1.xml to created gui directory, fixed issue with non modal dialogs 2019-11-26 11:32:48 -08:00
Huy Pham
fa7e5e321b save service config, file config when join session, update progress bar to start, stop, join session, delete antennas, wirelesslink as well as other stuff that we had before when join session 2019-11-26 11:30:25 -08:00
Huy Pham
3493b05eb4 Merge branch 'coretk' into coretk-progress 2019-11-25 16:52:19 -08:00
Huy Pham
4238c14362 progress bar for start session 2019-11-25 16:50:44 -08:00
Blake Harnden
c1a8fada7a avoid querying state for node movement, check currently known state instead 2019-11-25 15:48:41 -08:00
Blake Harnden
ad4ee58ddd properly adding change for emane node links being wireless, fixed issue when sending emane model configs when there is no interface set 2019-11-25 15:46:32 -08:00
Blake Harnden
cdc48a765a ignoring control networks on join, fixed emane links on join being wireless, fixed setting emane model being set when configuring emane 2019-11-25 15:40:09 -08:00
Blake Harnden
6fd38c4195 Merge branch 'coretk' of https://github.com/coreemu/core into coretk 2019-11-25 15:05:24 -08:00
Blake Harnden
731b586df0 fixed issue with clearing out session location for created sessions 2019-11-25 15:05:07 -08:00
Blake Harnden
e3fc318a1b linkinfo cleanup, changed text distance to be proprotionate of line distance 2019-11-25 14:52:00 -08:00
Huy Pham
a13eb2f214 Merge branch 'coretk' into coretk-progress 2019-11-25 14:10:58 -08:00
Huy Pham
4d3bde7c31 deleting node also deletes antenna 2019-11-25 14:09:41 -08:00
Blake Harnden
3d2e372663 simplified next node id logic to avoid trying to over optimize 2019-11-25 12:59:32 -08:00
Blake Harnden
1290dae4f8 simplified logic for picking next subnet, avoiding trying to optimize too early 2019-11-25 11:31:40 -08:00
Huy Pham
89dfeae07c basic status bar, node deletion also remove antenna 2019-11-25 11:23:04 -08:00
Blake Harnden
27a37c77fc made preexisting nodes a local variable, renamed reuseable to delete_nodes for more clarity 2019-11-25 09:52:50 -08:00
bharnden
4e32c9c13c updates to add reuse of deleted subnets 2019-11-22 23:48:10 -08:00
bharnden
e8f8fa3bd5 cleaned up some of the logic for deleting nodes/edges 2019-11-22 16:30:25 -08:00
bharnden
46627aad11 renamed coreclient delete graph nodes func 2019-11-22 15:43:43 -08:00
bharnden
981be3b7ff small cleanup with stopping sessions 2019-11-22 14:58:41 -08:00
Huy Pham
4788d7aacc Merge branch 'coretk' into coretk-progress 2019-11-22 14:56:05 -08:00
Huy Pham
8ffac10a1e status bar 2019-11-22 14:55:10 -08:00
bharnden
52c6f2f31c fixed issue with services identifying ip4/ip6 addresses 2019-11-22 14:52:46 -08:00
Huy Pham
ad2d3d63f6 Merge branch 'coretk' into coretk-progress 2019-11-22 13:00:25 -08:00
Huy Pham
15e05ac580 work on status bar 2019-11-22 12:59:22 -08:00
bharnden
e20da62366 Merge branch 'coretk' of https://github.com/coreemu/core into coretk 2019-11-22 12:52:45 -08:00
bharnden
f2b37d32c8 added netaddr library, added logic to support dealing with creating new subnet when needed 2019-11-22 12:51:58 -08:00
Huy Pham
3e2cc80a80 finish service file config 2019-11-22 11:45:44 -08:00
Huy Pham
e39db4bd63 get rid of 2 unnecessary classes for service config 2019-11-22 10:32:25 -08:00
Huy Pham
3a73b10902 service file configs 2019-11-22 10:01:36 -08:00
bharnden
6c0d4d3a93 updated node labels 2019-11-22 09:09:00 -08:00
bharnden
8ff63219a3 increased node icon size, added improve way to offset text regardless of icon size 2019-11-21 22:55:37 -08:00
bharnden
72e9ae75eb fixed issue with changing themes and abg colors not being present 2019-11-21 22:39:39 -08:00
bharnden
a6cdd63570 fixed name issue with app config, renamed to guiconfig 2019-11-21 22:03:07 -08:00
bharnden
fbbf31f4fa added saving session location to config, and query location when joining a session 2019-11-21 21:56:28 -08:00
Blake Harnden
bb7bad89d3 added a default location for now to get emane working, until session location is supported 2019-11-21 17:14:23 -08:00
Blake Harnden
df9c7308db update to avoid issue when old gui creates emane nodes without emane models 2019-11-21 17:03:18 -08:00
Huy Pham
c21f060797 service file config 2019-11-21 16:59:55 -08:00
Blake Harnden
97cb1444f3 updates to emane model config storage, fixes to reconnecting to a wlan session 2019-11-21 16:41:38 -08:00
Huy Pham
741477c043 fix merge conflict 2019-11-21 15:07:43 -08:00
Huy Pham
4cd42c2a20 work on service config 2019-11-21 15:00:17 -08:00
Blake Harnden
b983a09ae7 small cleanup to emane config dialog, fixed default service storage to just use names 2019-11-21 14:41:05 -08:00
Blake Harnden
471c5eb7e1 Merge branch 'coretk' of https://github.com/coreemu/core into coretk 2019-11-21 12:45:59 -08:00
Blake Harnden
059b0cc316 changes to fix session adding default emane configuration 2019-11-21 12:44:50 -08:00
Huy Pham
a4055f84bd Merge branch 'coretk' into coretk-config 2019-11-21 12:34:28 -08:00
Huy Pham
e059f89520 change some icons 2019-11-21 12:33:43 -08:00
Blake Harnden
9445b63bd2 removed saving default configurations for wlan and mobility by default, updated session.add_node to set default configurations for wlan and emane 2019-11-21 12:29:33 -08:00
Blake Harnden
eced9863ad removed mobility config class to try and help simplify saving configs 2019-11-21 09:40:57 -08:00
Huy Pham
56876710a1 Merge branch 'coretk' into coretk-config 2019-11-21 07:39:35 -08:00
bharnden
6035032e96 removed wlan config class and canvas action class 2019-11-20 23:16:04 -08:00
Huy Pham
37c032afc5 Merge branch 'coretk' into coretk-config 2019-11-20 16:53:05 -08:00
Huy Pham
2e121a3344 service config, trying out some new icons 2019-11-20 16:52:02 -08:00
bharnden
07c07da099 update node config dialog to display fields based on node type, added field for nodes with images 2019-11-20 11:20:08 -08:00
bharnden
c43e5f999c added node config interface display and updated canvas nodes to use core node porotbuf directly for display and saving data 2019-11-20 10:59:30 -08:00
bharnden
695f5c3e66 updated node config layout 2019-11-16 08:54:15 -08:00
bharnden
c93a07415e merged latest from coretk 2019-11-15 23:47:01 -08:00
bharnden
95cd792675 updated check for creating interfaces on nodes 2019-11-15 23:45:01 -08:00
bharnden
8ad9b7d728 removed CustomNode class, added nodeutils and NodeDraw to support defining the current node type to draw and reuse for custom nodes as well 2019-11-15 23:31:41 -08:00
Huy Pham
7f2a2f8043 fix code based on the new changes 2019-11-15 17:26:02 -08:00
Huy Pham
0006bd4abc save service file data change locally and use that for display and for start session 2019-11-15 17:05:03 -08:00
bharnden
7981340b13 added path for creating non core container based nodes 2019-11-15 13:09:53 -08:00
bharnden
f1b7dd3824 Merge branch 'coretk' of https://github.com/coreemu/core into coretk 2019-11-15 12:39:48 -08:00
bharnden
814d35d7dd removed coreclient edge and updated code to save and use link protobuf data structures 2019-11-15 12:39:08 -08:00
bharnden
6d38058887 update node creation and storage to leverage protobufs directly 2019-11-15 10:22:30 -08:00
bharnden
fa76bbf01b removed unused code in graph and coreclient 2019-11-14 21:39:44 -08:00
Huy Pham
bfcccd8dab Merge branch 'coretk' into coretk-config 2019-11-14 15:21:09 -08:00
Huy Pham
940281a3ee save work 2019-11-14 15:20:07 -08:00
bharnden
aec1126a14 updated canvas dialogs to make use of common canvas redraw/wallpaper logic 2019-11-14 12:58:27 -08:00
bharnden
4d2b84b107 updated wallpaper dialog to now save and redisplay current wallpaper, updated app to display in center of screen on launch 2019-11-14 11:26:20 -08:00
bharnden
31d8781008 fixed emane icon background to alpha, updated wlan icon to have a white cloud instead of alpha 2019-11-13 23:03:12 -08:00
bharnden
145abca863 added theme configuration to preferences dialog 2019-11-13 22:49:32 -08:00
Blake Harnden
d63da73581 updated framescroll to dynamically set bg based on current style 2019-11-13 13:19:18 -08:00
Blake Harnden
08927b180a changed service checklist style 2019-11-13 12:42:16 -08:00
Blake Harnden
40b2c270e4 fixed typo in canvas dialog variable, updated theming to make label frame have a relief groove border 2019-11-13 12:11:37 -08:00
Huy Pham
234554fdc2 Merge branch 'coretk' into coretk-config 2019-11-13 10:52:29 -08:00
Huy Pham
f01a8a4cb2 node service config 2019-11-13 10:51:16 -08:00
Blake Harnden
1e642b6302 merged latest from coretk 2019-11-13 10:49:14 -08:00
Blake Harnden
ca798215e4 updates to leverage theming, initially using a dark theme, updated all dialogs to be contained within a frame to help provide consistent theming 2019-11-13 10:45:43 -08:00
Huy Pham
c652ad2321 fix merge conflicts, continued work on node service configuration 2019-11-13 09:30:49 -08:00
Huy Pham
b69b24d9fc continued work on node service configuration 2019-11-13 09:09:53 -08:00
Blake Harnden
21d116c4c0 Merge branch 'coretk' of https://github.com/coreemu/core into coretk 2019-11-13 08:39:54 -08:00
Blake Harnden
02243684d9 merged latest from coretk and updated code to use ttk widgets 2019-11-13 08:38:08 -08:00
bharnden
1693c5942c added ttk theme based on opensource dark theme with minor tweaks for button presses and menu coloring 2019-11-12 22:42:55 -08:00
Blake Harnden
14187ba79c tweaks to retrieving images/icons, updates to toolbar to use ttk widgets 2019-11-12 17:32:34 -08:00
Blake Harnden
b96f8ff999 updated standard tooltip to use delays and have the same style of the canvas tooltip 2019-11-12 13:01:58 -08:00
Blake Harnden
96abea311f cleanup for padding to canvas dialogs 2019-11-12 12:47:29 -08:00
Blake Harnden
469e32b890 finished converting dialogs to use ttk 2019-11-12 12:13:53 -08:00
Huy Pham
66c9063d2e Merge branch 'coretk' into coretk-config 2019-11-11 16:36:33 -08:00
Huy Pham
3dd3d928dd more work on designing node service configuration 2019-11-11 16:34:41 -08:00
Blake Harnden
58a4db6050 updates to convert more dialogs to use ttk widgets when possible 2019-11-11 16:33:51 -08:00
Blake Harnden
a8f06da338 converted canvas dialogs to use ttk widgets 2019-11-11 15:55:39 -08:00
Blake Harnden
691013eeb8 added preferences dialog, updates to try and simplify config saving a bit, adding default preferences configurations 2019-11-11 15:35:48 -08:00
Blake Harnden
f5480c8e35 updated observers dialog to create/edit/delete custom observers and save configuration 2019-11-11 14:04:50 -08:00
Blake Harnden
dd73c96830 added observers to gui config and display them within menu 2019-11-11 13:33:37 -08:00
Blake Harnden
aa718817d0 updates to implement working observer widgets 2019-11-11 13:23:02 -08:00
Huy Pham
2cc4ef5ac0 Merge branch 'coretk' into coretk-config 2019-11-11 10:58:30 -08:00
Huy Pham
13a7aa73a1 draw node service configurations 2019-11-11 10:57:26 -08:00
Blake Harnden
18c9904d58 modified grpc set node service and node service file to use messages for their config, updated start session to leverage these messages to set them when starting a session 2019-11-11 10:19:30 -08:00
bharnden
b88abd0f74 added initial code that can help support canvas tooltips for observer widgets 2019-11-10 17:26:38 -08:00
Blake Harnden
5bf0a2ac05 fixed service editing for custom nodes, fixed hiding picker when clicking edit custom nodes 2019-11-08 16:37:00 -08:00
Blake Harnden
78f44e8110 updates to toolbar event handling to eliminate events being sent to other components when displaying pickers 2019-11-08 16:21:36 -08:00
Blake Harnden
3306dbbfae updates to allow custom nodes to be linked with interfaces 2019-11-08 15:43:58 -08:00
Blake Harnden
b0fe5660bd updates to draw custom nodes on the node picker frame 2019-11-08 11:00:22 -08:00
Blake Harnden
22177def1c updates to disable all unimplemented menu options 2019-11-08 10:07:23 -08:00
bharnden
dbaf5dad91 changed tooltip from pack to grid 2019-11-07 22:11:27 -08:00
bharnden
6357062fec removed packing from toolbar 2019-11-07 22:00:46 -08:00
bharnden
99678499ce some refactoring for menubar code 2019-11-07 21:46:40 -08:00
bharnden
be36940bd1 merged latest from coretk 2019-11-07 16:22:34 -08:00
bharnden
c4d2ae599b removed toolbarhelper, moved logic into coreclient, updated start session click 2019-11-07 16:15:29 -08:00
bharnden
173747fd13 renamed coretoolbar to just toolbar 2019-11-07 15:58:02 -08:00
Huy Pham
9898e50739 Merge branch 'coretk-config' into coretk-nodedelete 2019-11-07 15:21:13 -08:00
Huy Pham
707201ce54 work on node deletion 2019-11-07 15:19:01 -08:00
bharnden
2ee77d097d merged latest from coretk 2019-11-07 14:41:32 -08:00
bharnden
4970fb0d55 cleanup for app toolbar, updated toolbar to use grid layout 2019-11-07 14:37:08 -08:00
Huy Pham
dcfd7f8795 working on delete node 2019-11-07 13:23:02 -08:00
Jeff Ahrenholz
2d9cf81d0b remove shell=True from run command 2019-11-07 11:38:31 -08:00
bharnden
2873c32c23 custom nodes dialog works for creating, editing, and saving to config in basic case 2019-11-07 11:33:40 -08:00
Jeff Ahrenholz
ddcce82af4 address PR comments and fix pre-commit 2019-11-07 09:01:01 -08:00
Jeff Ahrenholz
5db05aad13 fix black pre-commit errors (formatting) 2019-11-07 08:57:46 -08:00
Huy Pham
a789498f5c updates 2019-11-07 08:30:49 -08:00
Huy Pham
98cfb301bb Merge branch 'coretk' into coretk-config 2019-11-07 07:57:48 -08:00
bharnden
613568ca28 updates to get custom nodes dialog to a working state 2019-11-06 23:58:02 -08:00
bharnden
1cf4847835 removed coreclient set session state 2019-11-06 23:16:49 -08:00
bharnden
5d6d22c6eb updated config frame widget to draw tabs for each config group 2019-11-06 22:41:05 -08:00
bharnden
0147bb9988 updated config generation to use config frame where possible 2019-11-06 20:49:09 -08:00
Huy Pham
a0039d3991 Merge branch 'coretk' into coretk-config 2019-11-06 14:37:19 -08:00
Blake Harnden
9987637564 updated and used common frame scroll class where needed, created common config widget to use where all configurations get drawn 2019-11-06 14:36:36 -08:00
Huy Pham
40e1bb0374 add emane configurations to my start_session() 2019-11-06 14:34:41 -08:00
bharnden
b71f93e606 added scrollable frame widget which can re-use code to be the basis for other scrollable frame widgets 2019-11-06 07:22:40 -08:00
bharnden
2b3e071045 updated nodeicondialog to just icondialog, added custom widgets for convenience, listboxscroll and checkboxlist 2019-11-05 22:44:50 -08:00
Blake Harnden
275a03b9e7 added observer widget dialog, still needs to be hooked to where widgets will be kept 2019-11-05 17:32:48 -08:00
Blake Harnden
73b147b152 updated tk servers dialog to save config 2019-11-05 16:56:47 -08:00
Blake Harnden
cb72a70d85 change to fix coretk action 2019-11-05 16:23:47 -08:00
Blake Harnden
bff1c26c2a Merge branch 'coretk' of https://github.com/coreemu/core into coretk 2019-11-05 16:18:11 -08:00
Blake Harnden
1c36c5e291 startred custom node dialog, update node services dialog to use service data retrieved from grpc 2019-11-05 16:16:46 -08:00
Huy Pham
6db4be4e13 fix merge conflict 2019-11-05 15:31:32 -08:00
Huy Pham
6405af2429 more work on coretk 2019-11-05 15:15:22 -08:00
Huy Pham
20637da140 change to appropriate toolbar when join session, emane config, emane model config 2019-11-05 14:25:25 -08:00
Blake Harnden
2d1f5edf79 started initial data for gui config file and added example server to it when initially running gui 2019-11-05 13:10:42 -08:00
Blake Harnden
68a5468ffb added servers dialog for distributed core, updated usages of ttk.Combobox to readonly 2019-11-05 12:37:47 -08:00
Blake Harnden
22601a4580 updated wlan config dialog to use common dialog class 2019-11-04 17:18:59 -08:00
Huy Pham
68da6c0c14 Merge branch 'coretk' into coretk-config 2019-11-04 16:25:47 -08:00
Huy Pham
d7280a3f6d work on emane config 2019-11-04 16:24:35 -08:00
Blake Harnden
c5d5226384 updated configutils parser to save values within configoptions, allowing them to be reused to redraw a config 2019-11-04 16:20:35 -08:00
Huy Pham
81e9bda65d fixed broken get_mobility_configs 2019-11-04 15:51:37 -08:00
Huy Pham
bd7055a87c cleared out old files, leftovers from merge 2019-11-04 15:43:05 -08:00
Huy Pham
cdb4ed571b merged latest from coretk and started work on emane configurations 2019-11-04 15:36:34 -08:00
Blake Harnden
8c4ed15629 converted canvas size and scale dialog to use common dialog class 2019-11-04 14:09:59 -08:00
Blake Harnden
2334f0f688 updated canvas background dialog to use common dialog class 2019-11-04 12:29:01 -08:00
Blake Harnden
22a55b69d3 update node service dialog to use common dialog class 2019-11-04 11:34:28 -08:00
Huy Pham
eb862dd9da emane config 2019-11-04 10:48:22 -08:00
Huy Pham
91ab1b0ee6 mobility config, start emane config 2019-11-03 22:58:45 -08:00
bharnden
d4f77a01e3 moved all modules creating dialogs under dialogs package, updated node config and node icon dialogs to use common dialog class, fixed common dialog class show order to fix delayed cases with grab_set 2019-11-02 23:47:43 -07:00
Huy Pham
eabca7dfcf work on wlan configuration 2019-11-02 21:59:29 -07:00
bharnden
bf9b776ad1
Merge pull request #312 from coreemu/feature/remove-sudo-from-init-script
Feature/remove sudo from init script
2019-11-02 15:00:16 -07:00
bharnden
b991dc0242 updates to handle delete hook and button states 2019-11-02 14:46:30 -07:00
bharnden
8c1b70822e fixed how hooks get created and sent to grpc StartSession, also query hooks when joining a session 2019-11-02 14:34:00 -07:00
bharnden
c947d8c6c2 update to hooks dialog to leverage grpc, allows for getting hooks and creation 2019-11-02 10:29:16 -07:00
bharnden
09e18889b0 start to hooks dialog and hook dialog create/edit 2019-11-01 18:14:36 -07:00
bharnden
b4f4ecd93d avoid issues when open/save xml provides no value 2019-11-01 16:47:30 -07:00
bharnden
f10acbc8d9 added gui directory check and creation, created module for referencing gui directories 2019-11-01 16:31:40 -07:00
bharnden
0f78acaa0c update method names for drawing main app, moved delete window call into app 2019-11-01 13:57:41 -07:00
bharnden
6c49a73e38 removed old image, fixed get image calls in images.py 2019-11-01 13:45:42 -07:00
bharnden
6fa3beb1c1 refactoring to change core_grpc to core, and update CoreGrpc to be CoreClient and have core now be client, also refactored usages of application to be just app to keep it short 2019-11-01 13:42:49 -07:00
bharnden
1f230146a6 merged grpcmanager with coregrpc 2019-11-01 13:15:45 -07:00
bharnden
5369694797 merged latest from coretk 2019-11-01 11:34:38 -07:00
bharnden
0e5d7a6f80 cleanup for organizing how some parameters are passed around, merging logic into central places, avoiding things like needing to requery a session multiple times for joining 2019-11-01 10:45:47 -07:00
Huy Pham
96d020a53d coretk 2019-11-01 09:01:56 -07:00
Huy Pham
22e773df1b fix merge conflict 2019-11-01 08:56:35 -07:00
Huy Pham
bdf13ca037 Merge branch 'develop' into coretk-config 2019-11-01 08:49:33 -07:00
Huy Pham
60fff54918 work on wlan config 2019-11-01 08:35:14 -07:00
bharnden
01d3a3158a updated sessions dialog to use common dialog base, cleaned up code and made widgets expandable 2019-10-31 23:17:26 -07:00
Blake Harnden
f0c32304db removed canvas border for configuration options 2019-10-31 15:54:38 -07:00
Blake Harnden
c65c846638 updated configutils to generate a scrollable view for configurations 2019-10-31 15:18:49 -07:00
Blake Harnden
891e9aef9a initial add with a common dialog class and leveraging it for a session options dialog 2019-10-31 14:06:50 -07:00
Jeff Ahrenholz
6be1e19d98 don't flush IPv6 address if interface is absent 2019-10-31 13:20:28 -07:00
Jeff Ahrenholz
140fe3c7fe remove sudo from init script, since it is already running as root 2019-10-31 13:11:09 -07:00
Jeff Ahrenholz
85c926ff47 create ebtables chains as needed
* otherwise every switch gets a chain, causing problems with simultaneous running Python scripts
2019-10-31 13:00:46 -07:00
Blake Harnden
e19e8c12f7 Merge branch 'develop' into coretk 2019-10-31 09:42:14 -07:00
bharnden
19300c7564
Merge pull request #310 from coreemu/actions-test
Mocked Unit Test Action
2019-10-30 16:51:22 -07:00
Blake Harnden
ea39f8fc6f updated corehandlers.py to no longer use threading.isAlive, which is pending deprecation 2019-10-30 15:49:08 -07:00
Blake Harnden
a33c8046f5 changes to support running mock tests 2019-10-30 15:44:57 -07:00
Huy Pham
ef213dc66f Merge branch 'develop' into coretk-config 2019-10-30 13:34:56 -07:00
Huy Pham
46127b44f9 more work on configurations 2019-10-30 13:33:22 -07:00
Blake Harnden
79dfbaa3ec switched session.metadata to just be a standard dict, fixed shutdown service issue during session.data_collect 2019-10-30 13:27:12 -07:00
Blake Harnden
fe95f246d4 added grpc get/set session metadata 2019-10-30 12:01:01 -07:00
bharnden
c0516255f2 added emane model configs and mobility configs to grpc.StartSession 2019-10-29 14:40:37 -07:00
bharnden
adbab066c9 added wlan configs to grpc.StartSession 2019-10-29 13:37:37 -07:00
bharnden
de936ea315 added hook creation and set location to grpc.StartSession 2019-10-29 12:35:07 -07:00
bharnden
4e03dc6888 updates to grpc StartSession, added utility threadpool function to help improve speed when running certain tasks, made use of utility threadpool function where needed 2019-10-29 10:25:39 -07:00
Huy Pham
f662846f9e Merge branch 'coretk-create-node' into coretk 2019-10-29 09:08:58 -07:00
Huy Pham
2a32a5b1a2 adjust open xml 2019-10-29 09:04:16 -07:00
bharnden
236ac7919a moved grpc utility functions into grpcutils, updated StartSession to threadpool node and link creation 2019-10-28 23:11:15 -07:00
Blake Harnden
934ea96558 changes to support a simpler start/stop session API 2019-10-28 15:18:57 -07:00
bharnden
fff281a452 removed master from corehandlers and session, since it will not be needed any more 2019-10-25 22:06:30 -07:00
Blake Harnden
77c7bf798e changes to tests to fix session fixture not being master and updated emane xml config test to use a valid value 2019-10-25 15:32:12 -07:00
bharnden
8e67294a8a changes to fix lock issues with multiple threads when stopping from gui 2019-10-24 21:17:15 -07:00
Huy Pham
5829e3ae42 more work on coretk 2019-10-24 16:50:24 -07:00
bharnden
6f58a82a75 removing mocked tests, until grpc and constants.py generation are determined 2019-10-24 15:31:17 -07:00
bharnden
e4a2c18d17 adding mocked tests to github actions 2019-10-24 15:28:30 -07:00
bharnden
5c12651e4e updates to session.clear to clear out all configuration data as well, updated session.shutdown to use clear, updated tests to account for this 2019-10-24 13:05:02 -07:00
bharnden
dc27fadb10 added distributed tests based on new distributed, removed old distributed tests and fixture to support it 2019-10-24 11:52:25 -07:00
bharnden
c255625d2f removed skipping TestCore:test_mobility 2019-10-24 11:20:38 -07:00
bharnden
6045908a14 cleanup for test fixtures to help simplify test_gui fixture setup 2019-10-24 10:58:26 -07:00
bharnden
27be86f175 fixed unwanted patcher in test fixture 2019-10-24 09:26:28 -07:00
bharnden
4a6a87b931 updates to how test fixtures are created 2019-10-24 09:06:14 -07:00
bharnden
ade1d980a8 updates to speed up tests 2019-10-23 23:15:19 -07:00
bharnden
d28a64b53c removed todo for wireless links, since they may be used by an API, until know for sure, leaving in 2019-10-23 12:31:13 -07:00
bharnden
7366738023 updated network to network link to not look for Rj45, since that wont happen, removed unwanted grpc client function 2019-10-23 11:24:50 -07:00
bharnden
053d2a0b10 removed unused utils.hex_dump 2019-10-23 11:01:25 -07:00
bharnden
711104df64 update to move mac learning disable into wlan and hub node startup 2019-10-23 10:56:01 -07:00
bharnden
440c8ed565 updated interface.py to use python3 super() 2019-10-23 10:40:40 -07:00
bharnden
b185c3c679 updated network.py to leverage super() 2019-10-23 10:16:35 -07:00
bharnden
68be311c7a updated usages of super to use python3 variation 2019-10-23 09:51:52 -07:00
bharnden
6a0a9e7698 updated all classes to be created without using (object), in python3 all classes are new style classes 2019-10-23 09:31:34 -07:00
bharnden
39c40d2a8c updated netif function to remove net parameter, since it was not used 2019-10-23 09:15:27 -07:00
bharnden
3dccd073f2 updated newveth and newtuntap function to remove the net parameter, since it was not being used 2019-10-23 09:02:24 -07:00
bharnden
28d1803af6 added netifi to CoreInterface, so it is defined up front 2019-10-22 23:03:03 -07:00
bharnden
945f3cce5b removed session.create_emane_network, removed unused node types 2019-10-22 21:27:31 -07:00
bharnden
14d759667c refactored session.update_node to session.edit_node to match grpc call 2019-10-22 20:55:06 -07:00
bharnden
cb81095b64 refactored NodeData and NodeOptions to use server instead of emulation_server 2019-10-22 20:50:01 -07:00
Blake Harnden
ab0abd65aa modified session.add_node parameter node_options, to just be options 2019-10-22 15:31:50 -07:00
Blake Harnden
ce411a07d7 removed session.create_wireless_node, can be achieved simply without needing this function 2019-10-22 15:13:28 -07:00
Huy Pham
b097028a4a Merge branch 'develop' into coretk-create-node 2019-10-22 13:20:34 -07:00
Huy Pham
c1ed7f54d8 coretk 2019-10-22 13:17:47 -07:00
Blake Harnden
c1bb9ed5d8 added optional custom class param for session.add_node 2019-10-22 13:15:12 -07:00
Blake Harnden
9e7b5abeb9 updated fabric commands to be hide output 2019-10-22 12:36:47 -07:00
Blake Harnden
b703ad11c6 updating command logging back to debug 2019-10-22 12:19:37 -07:00
Blake Harnden
f39b7e9f96 updated open_xml functionality, grpc open_xml can optionally start now, added opened files to grpc get_sessions 2019-10-22 12:08:55 -07:00
Blake Harnden
0a689a3e96 updates to grpc to provide a consistent config response, mapping config ids to ConfigOptions 2019-10-22 09:57:41 -07:00
Huy Pham
0e036ddca9 Merge branch 'develop' into coretk-create-node 2019-10-21 16:56:59 -07:00
Huy Pham
1559c9c6a1 Merge branch 'develop' into coretk 2019-10-21 16:34:03 -07:00
Huy Pham
f18d07985a more work on coretk 2019-10-21 16:33:18 -07:00
Blake Harnden
233ca92fd2 update grpc to allow for configuring and created distributed nodes 2019-10-21 12:51:38 -07:00
Blake Harnden
630b44627c updated distributed python examples a bit to clean things up 2019-10-21 11:36:59 -07:00
Blake Harnden
78f981463d renamed utils.check_cmd to utils.cmd, updated host_cmd to allow for shell commands for output redirection 2019-10-21 10:32:42 -07:00
Blake Harnden
16b7e70c33 update to add config example for fabric.yml 2019-10-21 10:08:41 -07:00
Blake Harnden
3fc0ca5cec fix to get_node over grpc to avoid issues with nodes that dont have services 2019-10-21 09:51:52 -07:00
Blake Harnden
104ac4cdc7 Merge branch 'develop' of https://github.com/coreemu/core into develop 2019-10-21 09:37:26 -07:00
Blake Harnden
d056578e9d modified ctrlnets to use an id starting at 9001, to avoid string based ids 2019-10-21 09:36:07 -07:00
bharnden
6006710c32 changed net_cmd to host_cmd and node_net_cmd to cmd, for simpler more logical naming 2019-10-18 23:28:09 -07:00
bharnden
d4af459653 update to distributed core doc 2019-10-18 22:56:10 -07:00
bharnden
c0ab9ea4cc small update to grpc docs 2019-10-18 21:51:15 -07:00
Huy Pham
38683cb0d0 more work on coretk 2019-10-18 16:42:00 -07:00
Blake Harnden
18e5598203 fixed node data reporting emulation server host instead of name 2019-10-18 16:28:13 -07:00
Blake Harnden
73b2eff312 fix for corehandlers.py session_clients access 2019-10-18 16:25:38 -07:00
Blake Harnden
83c408359a set flow id logging to debug 2019-10-18 14:56:21 -07:00
Blake Harnden
d1e9223d52 updates to install docs to remove python2 references 2019-10-18 14:52:08 -07:00
Blake Harnden
2012105df0 updated core.conf to contain distributed address and grpc configurations 2019-10-18 14:43:36 -07:00
bharnden
f1ae806c7d
Merge pull request #308 from coreemu/python3-only
Python3 Only
2019-10-18 14:34:08 -07:00
Blake Harnden
e298a2a5c1 grpc will now always be ran, but can be configured through command line or core.conf 2019-10-18 14:28:50 -07:00
Blake Harnden
c5ce85b235 added net client get ifindex and mac functions 2019-10-18 14:22:37 -07:00
Blake Harnden
bab5c75cb9 removed unwanted logging of container env 2019-10-18 13:20:05 -07:00
Blake Harnden
5633d4d18b converted format strings to f strings 2019-10-18 12:55:35 -07:00
Blake Harnden
07b4408076 f string updates to all but services complete 2019-10-18 12:44:13 -07:00
Blake Harnden
7d2a615716 more updates to using f string 2019-10-18 10:33:31 -07:00
Blake Harnden
79cde8cd59 further f string updates 2019-10-17 19:25:52 -07:00
Blake Harnden
c9326b6a97 initial changes to use f strings 2019-10-17 18:59:50 -07:00
Blake Harnden
da946f1f56 removing builtins imports 2019-10-17 15:02:24 -07:00
Blake Harnden
6edd6a7fdb first pass at removing all python2 specific dependencies, updating python requirements.txt/setup.py/Pipfiles/Makefiles, and removing python2 compat imports 2019-10-17 14:52:31 -07:00
Blake Harnden
5d5ffb70c2 update to grpc edit_node to allow editing icon and broadcasting a node update for all to listen to a change 2019-10-17 13:00:20 -07:00
bharnden
74e15d9c9d
Merge pull request #307 from coreemu/enhancement/distributed-flask
Updated Distributed
2019-10-17 12:31:23 -07:00
Blake Harnden
fb28741393 Merge branch 'enhancement/distributed-flask' of https://github.com/coreemu/core into enhancement/distributed-flask 2019-10-17 12:13:45 -07:00
bharnden
8a3183c8b3 Merge branch 'enhancement/distributed-flask' of https://github.com/coreemu/core into enhancement/distributed-flask 2019-10-17 12:13:26 -07:00
Blake Harnden
4746fe67ef added docs for distributed.py 2019-10-17 11:35:48 -07:00
Blake Harnden
e94a6d1afa separated distributed session logic into its own class to help reduce session.py size as it is already too big 2019-10-17 11:10:59 -07:00
Blake Harnden
0ef06a0167 added docs for session distributed commands 2019-10-17 09:32:32 -07:00
Blake Harnden
b7dd8ddb66 fix for docker/lxd based nodes to use remote servers and example for lxd 2019-10-17 09:09:03 -07:00
Blake Harnden
7afaff8cbb updated requirements and setup.py to include fabric/invoke 2019-10-17 08:41:48 -07:00
Blake Harnden
774dd8330c removed broker.py 2019-10-16 20:26:14 -07:00
Blake Harnden
009ce8143e removed lock for distributed commands and limited usage to uploads 2019-10-16 20:19:51 -07:00
Blake Harnden
8aef9f273f updates to clear broker from physical node 2019-10-16 17:11:21 -07:00
Blake Harnden
61a4e228a1 updated ctrlnets to assign unique addresses per server, fixed ovs command issue for interface specific commands 2019-10-16 10:14:36 -07:00
Blake Harnden
0b8bc7bd13 updated corehandlers to allow sdt snooping to help mimic previous behavior 2019-10-15 15:02:38 -07:00
Blake Harnden
b2d2705849 removed broker from session, updated most places using broker to use alternative logic to compensate where needed 2019-10-15 14:13:42 -07:00
Blake Harnden
6570f22ccf refactor fabric distributed to use a class and update sessions to create and provide these to nodes 2019-10-14 15:43:57 -07:00
Blake Harnden
5f282bb695 updates to lxd/docker to work with net_cmd/node_net_cmd 2019-10-14 14:28:18 -07:00
Blake Harnden
82bdbd776b removed parameter conversion for creating GreTap commands 2019-10-14 12:31:41 -07:00
bharnden
1b428c120b merged latest from develop 2019-10-12 14:39:29 -07:00
bharnden
d871615ae8
Merge pull request #305 from coreemu/develop
5.5.2 release
2019-10-12 14:26:38 -07:00
bharnden
a93763f4a7 bump version for release 2019-10-12 08:57:14 -07:00
bharnden
4e4fcddd00 added grpc api for creating emane link/unlink messages, which will be sent to the gui for being added/removed 2019-10-12 08:56:39 -07:00
bharnden
eb248291a5 fix for gretap interfaces giving bad values to netclient 2019-10-12 08:10:30 -07:00
bharnden
fee56302a1 fix for wlan configuration issues 2019-10-12 08:03:20 -07:00
bharnden
2bfd050880 updated missed commands to be string based 2019-10-11 22:37:33 -07:00
bharnden
5b3308a231 updated linkconfig to use string commands, fixed issues for wlan configuration 2019-10-11 22:27:04 -07:00
Blake Harnden
02ef91242e initial changes to convert all commands to be string based for consistency 2019-10-11 16:36:57 -07:00
Blake Harnden
69772f993c removed VnodeClient.icmd and VnodeClient.term 2019-10-11 13:55:06 -07:00
Blake Harnden
b5d71bab82 removed VnodeClient.popen 2019-10-11 13:36:00 -07:00
Blake Harnden
fc7a161221 updated utils.check_cmd to accept the same parameters as other commands and be leveraged for node cmds 2019-10-11 13:15:57 -07:00
Blake Harnden
d326f246a7 removed node based check_cmd, updated to use appropriate function 2019-10-11 12:57:37 -07:00
Blake Harnden
4a6d69bb09 removing cmd_output function from utils and nodes 2019-10-11 09:34:49 -07:00
Blake Harnden
c3d27eb8a5 removed utils.cmd and related node functions 2019-10-10 23:01:16 -07:00
Huy Pham
ec2e959bda move images files, create ip and mac for links, progress on node command and node terminal, progress on save and open xml 2019-10-10 17:02:28 -07:00
Blake Harnden
f6cdeb23de changes to update commands to leverage either node_net_cmd/net_cmd 2019-10-10 15:25:12 -07:00
Blake Harnden
bc58693339 updated emane config files to be generated for remote servers, fixed services not using node remote server compatible commands 2019-10-10 11:53:52 -07:00
bharnden
ef6b355561
Merge pull request #302 from coreemu/bugfix/allow-scripts-to-connect-to-gui
fix exception when trying to run Python script from GUI
2019-10-09 20:16:46 -07:00
Blake Harnden
a4b6b8be51 updated link config to work distributed, added crude locking for fabric 2019-10-09 15:44:45 -07:00
Blake Harnden
859f473ba9 updated ebtables to use net_cmd 2019-10-09 12:13:26 -07:00
Blake Harnden
7e45168e77 distributed example for ptp 2019-10-08 21:17:15 -07:00
Blake Harnden
c8d68c332a updates for testing using examples 2019-10-08 21:06:22 -07:00
Blake Harnden
b7b0e4222c updates for basic working distrbuted network using fabric 2019-10-08 15:09:26 -07:00
Jeff Ahrenholz
0bbb686bda fix exception when trying to run Python script from GUI 2019-10-08 13:05:37 -07:00
Blake Harnden
212fec916b updated how distributed servers are added and connections are created to reduce duplicate connections 2019-10-07 11:58:27 -07:00
bharnden
4eacd815d1 updated to use fabric scp for copying files to remote nodes 2019-10-06 00:06:29 -07:00
bharnden
cca57bba47 updated other node system commands to be ran in such a way that should work if local or remote using shell commands 2019-10-05 16:10:01 -07:00
bharnden
95296988c5 updates to Pipefile.lock and for nodes to add server to constructor 2019-10-05 11:16:57 -07:00
bharnden
931ee65235 added remote_cmd func for nodes to avoid duplication 2019-10-05 09:48:30 -07:00
Blake Harnden
f83f98262f some initial remote node commands using fabric 2019-10-04 17:33:44 -07:00
Huy Pham
8611106c93 basics on redraw components from prev section, work more on start/stop session 2019-10-04 16:52:07 -07:00
Blake Harnden
cc9c0eec96 Merge branch 'develop' into enhancement/distributed-flask 2019-10-04 13:31:13 -07:00
bharnden
c358ecf7be
Merge pull request #301 from coreemu/develop
updated version to 5.5.1
2019-10-04 12:47:48 -07:00
Blake Harnden
d00658ccb2 updated version to 5.5.1 2019-10-04 12:47:01 -07:00
bharnden
a3d9b28efa
Merge pull request #300 from coreemu/develop
Develop
2019-10-04 12:44:04 -07:00
Blake Harnden
bb98a4a77f removed circular dependency causing issues in python2 2019-10-04 12:36:15 -07:00
Blake Harnden
031517ba56 fixed base.py imports with isort 2019-10-04 09:29:10 -07:00
bharnden
7aa013d351 start to wrapping commands to support remote ssh 2019-10-03 20:38:32 -07:00
Huy Pham
cb03aa261a some work on grpc add nodes and links, some work on query session, redraw nodes 2019-10-03 16:50:49 -07:00
bharnden
70bb1598e1 fixed some nrl services for python3, using len(filter) 2019-10-03 13:49:26 -07:00
bharnden
fbfc4929f1 updated pipenv run core to default to turning on grpc 2019-10-03 13:31:22 -07:00
bharnden
8ce6f650c4 removing unused Jenkins file 2019-10-03 13:25:44 -07:00
bharnden
839a1b9368
Merge pull request #299 from coreemu/develop
Merging 5.5.0 for release
2019-10-03 13:19:51 -07:00
bharnden
0bba23da69 set version to 5.5.0 for release 2019-10-03 12:54:56 -07:00
bharnden
41f7f46988 removed old examples, updated examples api to denote they are python script examples 2019-10-03 12:41:56 -07:00
bharnden
319c10aa34 added notes about installing python/pip to install doc 2019-10-03 12:11:12 -07:00
bharnden
478eb84786
Merge pull request #298 from coreemu/cleanup/node-client
Cleanup/node client
2019-10-03 12:02:24 -07:00
bharnden
6d0d183788 fixed returning output from NodeBase.net_cmd 2019-10-03 11:59:45 -07:00
bharnden
5cc83850ea
Merge pull request #297 from coreemu/bugfix/add-session-class-to-create_session-again
cherry-pick commit e56c001 for Session() instead of EmuSession() class
2019-10-02 21:12:57 -07:00
Blake Harnden
572ed48241 added ethtool to configure.ac, updated other program checks to fail when not found and required 2019-10-02 08:58:25 -07:00
Jeff Ahrenholz
6c3066e752 cherry-pick commit e56c001 for Session() instead of EmuSession() class 2019-10-02 07:55:51 -07:00
bharnden
0fe8bea25b added net_cmd to NodeBase for encapsulating network configuration commands 2019-10-01 21:06:11 -07:00
Huy Pham
cbd593eed6 finish the basics of toolbar and start working on simple grpc 2019-10-01 16:25:26 -07:00
bharnden
4079df9739 added pydocs for netclient 2019-10-01 15:38:23 -07:00
bharnden
af7faa85df removed redircmd, shcmd, shcmd_result, getaddr, netifstats from VnodeClient 2019-10-01 14:40:24 -07:00
bharnden
223590c8fb removed vnode client netif stats, since was not being used 2019-10-01 12:52:25 -07:00
bharnden
d3d70ecc54 removed getaddr from node clients, since it was not being used 2019-10-01 12:30:32 -07:00
bharnden
e4bb315c14 updates to netclient, providing commonly used network commands in more convenient functions 2019-10-01 12:14:37 -07:00
Kevin Larson
22341a748c
Merge pull request #296 from coreemu/install-patch
Update install.md
2019-10-01 11:35:49 -07:00
Kevin Larson
e9364676a9
Update install.md 2019-10-01 11:31:15 -07:00
Blake Harnden
a798774f18 updates to tone down warning logs to debug in broker.py and session.py 2019-09-30 12:58:13 -07:00
Blake Harnden
3f1ff113ca small core configuration cleanup 2019-09-30 11:51:40 -07:00
Blake Harnden
6b43c00031 removed xmlfilever from config, since not used 2019-09-30 10:36:27 -07:00
Huy Pham
269d7f8f92 create grids 2019-09-30 10:11:29 -07:00
Blake Harnden
1fb99e8690 converted info to debug for some corehandlers logging 2019-09-30 10:06:10 -07:00
Blake Harnden
d6cf09e4b8 updated service loading to catch on_load exceptions and ignore service 2019-09-30 09:33:17 -07:00
bharnden
1248982d8c
Merge pull request #295 from coreemu/bug/invalid-executables
updates to fail early for required executables that are not in PATH
2019-09-28 11:16:42 -07:00
bharnden
503fa754a9 updates to fail early for required executables that are not in PATH 2019-09-27 23:29:15 -07:00
bharnden
2a5c913a62
Merge pull request #294 from coreemu/cleanup/emane-node
consolidated EmaneNode and EmaneNet, renaming EmaneNode to EmaneNet
2019-09-27 22:34:09 -07:00
bharnden
050297587d consolidated EmaneNode and EmaneNet, renaming EmaneNode to EmaneNet 2019-09-27 22:31:56 -07:00
Huy Pham
130c2a9b8d Merge branch 'develop' into coretk-create-node 2019-09-27 16:19:03 -07:00
Huy Pham
4bf08af886 added core to coretk dependencies 2019-09-27 16:18:30 -07:00
bharnden
7562b8a445
Merge pull request #293 from coreemu/sidebar
Sidebar
2019-09-27 16:03:23 -07:00
Huy Pham
2e007935ee toolbar 2019-09-27 16:00:38 -07:00
Blake Harnden
b961a8a959 updated broker.py logging to not be as noisy by default 2019-09-27 15:31:19 -07:00
Huy Pham
a1af60688e add tool tip class to draw tool tip box for the buttons 2019-09-27 15:28:51 -07:00
Blake Harnden
ce27a43486 updated install instruction to denote installing ethtool 2019-09-27 15:07:41 -07:00
bharnden
6886746711
Merge pull request #292 from coreemu/bug/290-fix-default-pythonpath
fix #290 use pythondir var as base for setting PYTHONLIBDIR
2019-09-27 14:25:19 -07:00
Blake Harnden
07c28e8a93 updated configure.ac python3 argument help line to be more specific 2019-09-27 14:22:50 -07:00
Huy Pham
5ce340b8b0 progress on tool bar 2019-09-27 14:19:48 -07:00
Blake Harnden
f5aa74ed06 updated install doc to refer to new configure option for building packages 2019-09-27 13:15:20 -07:00
Blake Harnden
3cf557024c added more formal configure option for enabling python3, avoids issues with not having a very specific name for PYTHON being set 2019-09-27 13:08:59 -07:00
Blake Harnden
03cf401639 moved AM_CONDITIONAL out of if statement 2019-09-27 12:41:34 -07:00
Blake Harnden
cd747515ea added python path change to ns3 and simplified substitution, which is not version dependent 2019-09-27 12:11:14 -07:00
bharnden
59e5363941
Merge pull request #291 from coreemu/bugfix/requirements-txt
Bumping configparser to 4.0.2 in requirements.txt
2019-09-27 11:03:37 -07:00
Jeff Ahrenholz
4b028661ab fix #290 use pythondir var as base for setting PYTHONLIBDIR 2019-09-27 11:02:01 -07:00
Blake Harnden
a01ea35f7c bumping configparser version in requirements.txt due to previous version removal 2019-09-27 11:01:19 -07:00
Blake Harnden
dec96b355b Merge branch 'master' into develop 2019-09-27 10:56:15 -07:00
bharnden
08ea1dd813
Merge pull request #289 from coreemu/cleanup/remove-node-map
Removed node maps and integrated OVS mode
2019-09-27 10:54:42 -07:00
Blake Harnden
1277ae4686 fleshed out documentation for netclient.py and removed openvswitch.py 2019-09-27 10:48:24 -07:00
bharnden
0c002bb491 implemented net client for linux and ovs 2019-09-26 22:04:29 -07:00
Huy Pham
b1bac1dda0 progress on core toolbar 2019-09-26 16:05:57 -07:00
bharnden
b449729a31 added net client to consolidate bridge and interface creation 2019-09-26 15:20:32 -07:00
bharnden
bdf288ff1d removed is_net_node utility to leverage isinstance as other places are consistently 2019-09-26 13:15:46 -07:00
bharnden
b14012e5e9 removed node map file and utilities, added formal class methods to session objects and added checks for specific classes where needed 2019-09-26 13:00:12 -07:00
bharnden
8c348b5ab1
Merge pull request #287 from coreemu/bug/remove-ovs-node
removed ovs node from gui
2019-09-25 10:51:41 -07:00
Blake Harnden
b0c30056f9 removed ovs node from gui 2019-09-25 10:46:41 -07:00
Huy Pham
000da143f9 Create a class for menubar and start working on toolbar 2019-09-25 08:29:34 -07:00
bharnden
1c11c6c573
Update README.md 2019-09-23 23:40:59 -07:00
bharnden
87816748b3
Merge pull request #286 from coreemu/develop
Merging for 5.4.0
2019-09-23 23:39:17 -07:00
bharnden
9c4459e7e7 update to devguide 2019-09-23 23:28:20 -07:00
bharnden
212b8ccb02 bumping version for release 2019-09-23 23:28:16 -07:00
bharnden
d5c257fc9b fixed flake8 config to match other tooling 2019-09-23 23:28:08 -07:00
Huy Pham
06979141ad Merge branch 'coretk' into sidebar 2019-09-23 11:44:17 -07:00
Huy Pham
f1698de74b toolbar 2019-09-23 11:43:13 -07:00
bharnden
00353e6727
Merge pull request #285 from coreemu/menubar
Menubar
2019-09-23 11:41:10 -07:00
bharnden
37e525b4bd
Merge pull request #281 from coreemu/dependabot/maven/corefx/jackson.version-2.10.0.pr2
Bump jackson.version from 2.9.9 to 2.10.0.pr2 in /corefx
2019-09-20 22:28:37 -07:00
Huy Pham
1ebe33cabb get rid all the dash lines in menubar 2019-09-20 13:51:01 -07:00
Huy Pham
01a919eb23 finish up menubar 2019-09-20 13:33:42 -07:00
Huy Pham
aa1fb62182 start working on sidebar 2019-09-20 11:58:15 -07:00
Huy Pham
303e96cdd6 finish up menubar 2019-09-20 10:45:35 -07:00
Huy Pham
5297286b7a working on menubar 2019-09-19 16:24:21 -07:00
Blake Harnden
3268c110cd gh action - adding coretk checks 2019-09-19 10:35:35 -07:00
Blake Harnden
597342248b Merge branch 'develop' into coretk 2019-09-19 10:29:34 -07:00
bharnden
56a61ee520
Merge pull request #282 from coreemu/gh-actions
Add github action for running pre-commit checks as a double check before merging, isolated to daemon code for now
2019-09-19 08:52:25 -07:00
Blake Harnden
ae6291a1f3 gh action - update isort to only check 2019-09-19 08:36:59 -07:00
Blake Harnden
009ecd96bb gh action - update black to report status for failure 2019-09-19 08:35:04 -07:00
Blake Harnden
5baf4adad1 gh auto - update to compensate for not building setup.py 2019-09-19 08:30:20 -07:00
Blake Harnden
4271086422 update workflow to use 18.04 correctly 2019-09-18 12:56:24 -07:00
Blake Harnden
0dec7af9eb workflow formatting cleanup 2019-09-18 12:38:38 -07:00
Blake Harnden
9fc77511f2 adding gh action workflow 2019-09-18 12:34:44 -07:00
Blake Harnden
372a690af9 coretk - added to pre-commit 2019-09-18 11:39:48 -07:00
Blake Harnden
2f8935b4c9 coretk - formatting cleanup 2019-09-18 11:26:26 -07:00
Blake Harnden
17d1830176 coretk changed prints to use logging 2019-09-18 11:25:33 -07:00
Blake Harnden
4a9e6febe5 coretk - changes icons.py to images.py 2019-09-18 11:21:41 -07:00
Blake Harnden
8682f01fdc coretk - updated pipfile to install as editable, added convenient run script, updated images to load assuming local path 2019-09-18 11:20:22 -07:00
Blake Harnden
00a37cbb6f coretk - removed python3.7 hard requirement 2019-09-17 13:18:07 -07:00
bharnden
939203aa46
Merge pull request #280 from coreemu/pydocupdates
Pydocupdates
2019-09-17 11:56:04 -07:00
bharnden
976f06dc10 removed unwanted logging line from corexml.py 2019-09-17 10:13:51 -07:00
Huy Pham
51e8be223e fix tables and add sub-headers 2019-09-17 10:12:03 -07:00
Huy Pham
22189122e6 add text to markdown table headers, fix some return types, fix emane link 2019-09-17 09:33:55 -07:00
bharnden
b6d5f23201
Merge pull request #275 from NvanAdrichem/master
Disable MAC learning on Wlan networks
2019-09-16 21:55:34 -07:00
dependabot[bot]
d9bd0fa434
Bump jackson.version from 2.9.9 to 2.10.0.pr2 in /corefx
Bumps `jackson.version` from 2.9.9 to 2.10.0.pr2.

Updates `jackson-core` from 2.9.9 to 2.10.0.pr2
- [Release notes](https://github.com/FasterXML/jackson-core/releases)
- [Commits](https://github.com/FasterXML/jackson-core/compare/jackson-core-2.9.9...jackson-core-2.10.0.pr2)

Updates `jackson-databind` from 2.9.9 to 2.10.0.pr2
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

Updates `jackson-annotations` from 2.9.9 to 2.10.0.pr2
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-16 23:59:50 +00:00
Huy Pham
463d4d145e test new table format on performance.md 2019-09-16 16:55:41 -07:00
Huy Pham
7c1f197774 fix links 2019-09-16 16:13:49 -07:00
Huy Pham
b333859d86 finish up server.py and fix 2 broken links 2019-09-16 12:55:00 -07:00
Blake Harnden
d88ea50ad2 coretk - changes to have app load all images, and some small cleanup 2019-09-15 23:45:13 -07:00
Blake Harnden
6f916995d7 setup coretk left side buttons as radio buttons 2019-09-15 23:16:08 -07:00
Blake Harnden
bcb7bf4a10 coretk change to set a core-icon 2019-09-15 16:38:12 -07:00
Blake Harnden
28e1e7d796 separated graph module from app for coretk 2019-09-15 16:00:01 -07:00
Blake Harnden
70ec532703 initial commit down a path for a possible core python tkinter gui 2019-09-15 15:20:00 -07:00
Huy Pham
edcb3d3472 updates on python comments 4:20pm friday 2019-09-13 16:21:07 -07:00
Blake Harnden
c0ce07404f moved service validation to debug, to limit error messages causing confusion about failures 2019-09-13 13:26:30 -07:00
Blake Harnden
fcee44775a changes to logging, moving logs to debug and removing setnemposition logging that could spam output 2019-09-13 13:13:59 -07:00
Huy Pham
813ddc10c6 Merge branch 'develop' into pydocupdates 2019-09-13 11:07:43 -07:00
Huy Pham
1843b5f709 further updates to python docs and docs files 2019-09-13 11:07:04 -07:00
Blake Harnden
cc4a25cc21 added devdoc update about installing emane into pipenv environment from source 2019-09-12 16:27:12 -07:00
Blake Harnden
5b8a7b1cfd fixed path for example tdma schedule from moving emane tests 2019-09-12 16:13:24 -07:00
Blake Harnden
32bfa4b2f9 fixed exception catches for get_node expecting KeyError to expect CoreError 2019-09-12 15:48:09 -07:00
Blake Harnden
0db3031b15 update devdoc to denote install pre-commit hooks 2019-09-12 14:36:28 -07:00
Blake Harnden
f71e2522dd update Pipfile.lock due to configparser 4.0.1 removal 2019-09-12 14:29:56 -07:00
Huy Pham
2bfcc9ef24 Merge branch 'develop' into pydocupdates 2019-09-12 10:24:23 -07:00
Huy Pham
b43a686d6b initial documentation improvements 2019-09-12 10:23:46 -07:00
bharnden
89fe61f312 fix for wlan configuration not getting set by default 2019-09-11 21:54:07 -07:00
bharnden
935a7da0e9 added node delete info logging 2019-09-11 15:44:15 -07:00
bharnden
4bf7790a6a
Merge pull request #278 from coreemu/log-updates
updates to try and clean up info logging, moved some statements to debug
2019-09-11 15:10:04 -07:00
bharnden
0d5692e7e8 updates to try and clean up info logging, moved some statements to debug 2019-09-11 15:05:05 -07:00
bharnden
8a39d070b8
Merge pull request #277 from coreemu/core-error
CoreError
2019-09-11 14:06:28 -07:00
bharnden
ec2f87ae58 removed duplicate instructions for install requirements.txt in the install docs 2019-09-11 13:47:21 -07:00
bharnden
2a4ee68fd9 moved ping test method into the emane test itself 2019-09-11 13:16:09 -07:00
bharnden
3776e1dda7 moved emane dependent tests into subdir, moved pytest config into setup.cfg, added CoreError and made use of in session.py 2019-09-11 13:12:42 -07:00
bharnden
4598bddcdb
Merge pull request #276 from coreemu/pre-commit
Pre-commit support and setup.py changes
2019-09-11 11:51:19 -07:00
bharnden
3cfac5b611 update to Makefile for using fpm to require 3.6+ for python3 2019-09-11 11:44:57 -07:00
bharnden
6739e9ff6e change to devguide to denote the need for python 3.6+ 2019-09-11 11:23:31 -07:00
bharnden
58471b168b fixed logging changes to be python2 compatible, small change to Pipfile to support possibility of installing to python2, but python3 required for dev 2019-09-11 10:59:06 -07:00
bharnden
0683ea3c22 update setup.py to leverage extra_requires and updates to pipfile dependencies 2019-09-11 09:37:06 -07:00
Niels van Adrichem
09896b008e Disable MAC learning on Wlan networks 2019-09-11 15:27:55 +02:00
bharnden
3e325fcdc7 fixed typo in test_links 2019-09-10 21:35:47 -07:00
bharnden
b4bc9c23a3 updated test_links to avoid running a system command and the need to use iperf/ping 2019-09-10 21:33:35 -07:00
bharnden
fb8fc46d0d added pytest/mock to Pipfile, updated setup.cfg to increase max complexity for flake8 to pass for now with plans to decrease in the future 2019-09-10 21:12:39 -07:00
bharnden
dee91e97bf changes to fix flake8 issues 2019-09-10 21:01:51 -07:00
bharnden
1fc8d647c3 added flake8/black, pre-commit integration for flake8/black, and black formatting changes 2019-09-10 15:10:24 -07:00
bharnden
d5055f85d3 pass over files using isort 2019-09-10 14:20:51 -07:00
bharnden
a004285514 adding isort/pre-commit dev dependencies and setup.cfg for isort 2019-09-10 14:07:46 -07:00
bharnden
d11480c1c5
Merge pull request #273 from coreemu/pipenv
Added development support for leveraging pipenv
2019-09-10 13:48:21 -07:00
bharnden
6d8099e8c6 added pipenv as a recommend use case for development, updated core-daemon script to allow a parameter to pass in the logging configuration 2019-09-10 13:39:36 -07:00
Kevin Larson
76846fefeb Removing deprecated perf scripts 2019-08-08 16:19:01 -07:00
bharnden
527a44748d avoid bad check that prevents reverting link configuration to 0 2019-07-05 19:06:27 -07:00
Blake Harnden
2cd0f381ea updated ovs service to use fail mode secure 2019-07-19 11:35:01 -07:00
Blake Harnden
554f4a570d added check when deleting links to avoid exceptions from gui driven deletions 2019-07-19 07:46:17 -07:00
Blake Harnden
ccf5a5de60 updates to ryu service to run in a more general way avoiding the need for specific pathing and local installs 2019-07-18 08:19:51 -07:00
Blake J. Harnden
a2f6ba7e97 corefx - updates to support creating an rj45 node 2019-07-12 14:44:41 -07:00
Blake Harnden
bcd2584eb8 grpc - add rpc to get local non-core interfaces 2019-07-12 13:02:15 -07:00
Blake J. Harnden
a97d93ef4c corefx - small cleanup to core addresses file 2019-07-12 12:34:55 -07:00
Blake J. Harnden
7ecac387a0 corefx - consolidation of details panel code and updates to linkoptions to reflect current value types 2019-07-12 09:48:52 -07:00
Blake J. Harnden
5f7d46aacd corefx - added rj45 node, updates to dealing with session start failure 2019-07-12 08:43:29 -07:00
Blake Harnden
60588eabbb Merge branch 'develop' of https://github.com/coreemu/core into develop 2019-07-11 13:09:07 -07:00
Blake Harnden
02668c9c3c grpc - initial support for container node types 2019-07-11 13:09:04 -07:00
Blake J. Harnden
e87cdc929c updates to support orchestrating new container nodes with corefx gui 2019-07-11 13:08:03 -07:00
Blake Harnden
11473a7138 Merge branch 'develop' of https://github.com/coreemu/core into develop 2019-07-10 13:58:40 -07:00
Blake Harnden
0d24ca3387 grpc support for docker/lxc 2019-07-10 13:58:27 -07:00
Blake J. Harnden
6e25388ad9 Merge branch 'develop' of https://github.com/coreemu/core into develop 2019-07-10 12:41:06 -07:00
bharnden
802379d763
Merge pull request #267 from coreemu/feature/new-nodes
Adds Docker/LXD support
2019-07-05 16:36:16 -07:00
bharnden
d9e7d37171
Merge pull request #269 from coreemu/develop
Merging develop for 5.3.1 release
2019-07-05 16:27:36 -07:00
bharnden
76b95ee86e
Merge branch 'master' into develop 2019-07-05 16:25:40 -07:00
bharnden
b8cbf6b5f6 bumped version for release 2019-07-05 16:12:26 -07:00
bharnden
836133c97d reverting a change that caused switching sessions within gui to break 2019-07-05 09:00:14 -07:00
bharnden
ae5d718737 revert loss pack to using floats in all related places 2019-07-03 23:09:55 -07:00
Blake Harnden
913ca51b1c cleanup for docker/lxd code being used, tweaks to running container commands 2019-07-02 16:05:45 -07:00
Blake Harnden
9e273c2d8f small tweaks to cleanup lxd from commented out code 2019-07-02 09:51:56 -07:00
bharnden
02d9418808
Merge pull request #263 from SaintYomar/documentation
Documentation
2019-07-02 08:43:19 -07:00
bharnden
ec9fc37f8c
Merge branch 'develop' into documentation 2019-07-02 08:42:01 -07:00
Blake Harnden
e83b38d96a initial lxd based node working from simple scripts 2019-07-02 07:48:43 -07:00
Blake Harnden
2397cd58ee integrated creation into the standard session.add_node call, currently requires an extra check due to the need for being able to specify an image 2019-06-28 15:41:55 -07:00
Blake Harnden
0e7464d419 fixed cmd to leverage wait similar to standard nodes and avoid throwing its own exceptions 2019-06-28 14:24:36 -07:00
Blake Harnden
6ab8368f1c updates to attempt to support trying to run traditional services in some manner within the context of a docker node 2019-06-28 12:58:08 -07:00
Blake Harnden
5971950523 changes to have DockerNode based off a CoreNode instead, elminating the need for a lot of boiler plate 2019-06-28 08:17:11 -07:00
Blake Harnden
9825706e03 initial commit with some docker nodes integrating with core at a basic level 2019-06-27 15:45:35 -07:00
Blake Harnden
67595485c6 updated example custom emane model to get away from needing pycco altogether for documentation 2019-06-26 09:38:54 -07:00
SaintYomar
2b5e3666b2
Removed LXC references in architecture documentation 2019-06-26 10:24:07 -05:00
Blake Harnden
f6af078e7e pass at cleaning up custom service documentation and removing the need for pycco for this case 2019-06-25 16:03:37 -07:00
bharnden
f8960cc519
Merge pull request #262 from coreemu/tlv-tests
TLV Message Handling Tests
2019-06-25 12:37:59 -07:00
Blake Harnden
ca10ef4e9e finished initial pass on adding tests to help run through and validate tlv message handling 2019-06-25 12:29:46 -07:00
Blake Harnden
4f4605163f fixed issues executing xml from gui, added more tests for testing message handling 2019-06-24 15:49:12 -07:00
bharnden
588a0932d3 beginning to add some tests to help verify handling different tlv messages, added delete link logic for net to node and node to net 2019-06-21 23:12:18 -07:00
bharnden
e11ec020eb
Update install.md
avoid building docs for ospf mdr
2019-06-21 12:57:32 -07:00
bharnden
f9304b0875
Update install.md
fixed missing command to build ospf msdr and added possible dependencies
2019-06-21 12:51:20 -07:00
Blake Harnden
05c6233908 added utility method to replace execfile for python2/3 support 2019-06-21 09:29:19 -07:00
bharnden
ca28920e2d
Merge pull request #259 from coreemu/emane-distributed
Emane distributed fixes
2019-06-21 09:02:50 -07:00
Blake Harnden
c57089284f updates to rename utils.hash to utils.hashkey to avoid builtin conflict 2019-06-21 08:51:56 -07:00
Blake Harnden
a5f26e664a updated logic for creating tunnel keys to use a consistent hashing method, since the builtin hash is not guaranteed in python3 as it was before in python2 2019-06-20 13:22:20 -07:00
Blake Harnden
338c3a1fa1 fix to avoid sorting issue for comparinga str to an int in python3 2019-06-20 10:49:07 -07:00
Blake Harnden
b5acdf0c3d updated tests for running distributed to working order and adding simple emane case 2019-06-19 17:34:33 -07:00
bharnden
ee6b420c9e
Update distributed.md 2019-06-19 14:07:04 -07:00
Blake Harnden
407cfa5fe1 updated emanemanager to add server prefixes to control nets, when control nets are not configured 2019-06-19 13:52:51 -07:00
Blake Harnden
6270fcbc75 shifted session startup order to help ensure broker tunnels get setup before emane starts 2019-06-19 10:58:49 -07:00
Blake J. Harnden
ef8414200c Merge branch 'master' of https://github.com/coreemu/core 2019-06-19 10:31:45 -07:00
Blake J. Harnden
3dac7f096c docs - added an updated take on running distributed and isolated it to its own higher level page 2019-06-19 10:31:34 -07:00
Blake Harnden
14fc16832d updated long to use lon in emane code to avoid name conflicts in 2.7 2019-06-19 08:22:28 -07:00
Blake Harnden
948b1126ba changes to support not modifying controlnet configuration messages and avoid issues with setting the master meane config when dealing with distributed emane 2019-06-18 10:33:16 -07:00
SaintYomar
0f1105e81d
Updated services.md, added nrl services documentation 2019-06-18 11:30:38 -05:00
bharnden
74ea163e72
Update install.md 2019-06-17 20:21:43 -07:00
bharnden
17e1b29ebe
Merge pull request #258 from coreemu/fix-fpm
changes to fix some issues when building fpm packages
2019-06-17 20:14:19 -07:00
bharnden
d053d126a9 merged latest from develop 2019-06-17 20:13:58 -07:00
bharnden
8b4f8c2c5b changes to fix some issues when building fpm packages 2019-06-17 19:59:44 -07:00
SaintYomar
828ab7c16c
Updated services.md, added xorp documentation 2019-06-17 15:05:12 -05:00
SaintYomar
dc92719934
Updated services.md, added utility services documentation 2019-06-17 13:56:52 -05:00
SaintYomar
3dcaa5e963
Updates services.md, added ucarp documentation 2019-06-17 12:25:00 -05:00
Blake J. Harnden
5b671ccb00 corefx - small tweaks to node/link details page 2019-06-17 10:05:22 -07:00
SaintYomar
9ff327b933
Updated services with security documentation 2019-06-17 10:49:05 -05:00
SaintYomar
d8505418a6
Updated services.md with quagga documentation 2019-06-17 08:23:03 -05:00
bharnden
0af3629ac6 corefx - fixed some issues loading xml due to grpc change, updated subnet logic to help handle loaded scenarios. grpc - fixed issue when loading network links 2019-06-15 10:42:55 -07:00
bharnden
338439b429 corefx - changes to reuse deleted subnets 2019-06-15 00:43:17 -07:00
bharnden
0661f5d601 corefx - updated proto link 2019-06-14 23:04:18 -07:00
Blake J. Harnden
9b485c8209 corefx changes to support similarly bumping subnet linking to be the same as previous gui 2019-06-14 17:59:14 -07:00
Blake J. Harnden
778021c553 corefx - removed jackson annotations from data fields as there is no longer a need to deal with them in json form 2019-06-14 14:17:41 -07:00
Blake J. Harnden
d1d6c401f0 Merge branch 'develop' of https://github.com/coreemu/core into develop 2019-06-14 14:15:56 -07:00
Blake Harnden
6288e11bcc grpc - fixed issue when handling wlan configurations 2019-06-14 14:14:00 -07:00
Blake J. Harnden
541e719c07 corefx moved some data objects into a common package, removed libraries and code for using previous experimental rest interface 2019-06-14 13:59:18 -07:00
Blake J. Harnden
56993ec44f corefx removed apache dependency no longer needed, added ipaddress maven dependency for helping generate and deal with node addresses, updated some logic when linking nodes 2019-06-14 13:43:19 -07:00
SaintYomar
a715a77c0d
Fixed bird config path 2019-06-13 14:05:13 -05:00
SaintYomar
2a1f6388c5
Added docker services documentation 2019-06-13 13:42:50 -05:00
Blake J. Harnden
4f4c4c4f60 updated jackson dependency in corefx 2019-06-12 16:46:53 -07:00
Blake Harnden
d724ee289b added dependency and usage of ethtool to disable rx/tx checksums, since they will never be valid from a veth. also lowered some noisy logging and removed other logging 2019-06-12 12:41:01 -07:00
SaintYomar
c1113cc192
Added FRRouting documentation 2019-06-12 13:40:51 -05:00
Blake Harnden
ac9dab097a default logging to INFO 2019-06-12 09:44:10 -07:00
Blake Harnden
fca79fcf94 small change for possibility of runtime mobility configuration 2019-06-11 15:55:11 -07:00
Blake Harnden
a9e622c32f fixed issue when getting wlan config range value from gui as a float string, cannot be parsed to int by python3 2019-06-11 15:27:50 -07:00
Blake Harnden
e7d12b9746 fixing mobility working in python2/3 due to using __cmp__ and node updates not being ints 2019-06-11 15:07:36 -07:00
Blake Harnden
e0dcb194cc removed duplicate code updating basic range model updates 2019-06-11 13:23:19 -07:00
Blake Harnden
38c58d9603 fixed tlv api changing wlan config during runtime, fixed for grpc as well and added grpc test 2019-06-11 13:11:36 -07:00
SaintYomar
20dc78dfc4
Update services.md 2019-06-11 14:43:34 -05:00
Blake Harnden
5b1c9a6e68 small tweaks to documentation, initial add of a section for grpc, moved ns3 to experimental section 2019-06-11 12:05:04 -07:00
bharnden
1d1eba84fc
Merge pull request #255 from coreemu/develop
Merging latest from develop
2019-06-10 22:21:52 -07:00
SaintYomar
6b4b82d2f6
Fixed misspelled word in update.md 2019-06-10 15:28:52 -05:00
SaintYomar
777e224a87
Fixed misspelled word 2019-06-10 14:47:15 -05:00
SaintYomar
4485d9b3c5
Formated install from source instructions on install.md 2019-06-10 14:41:30 -05:00
SaintYomar
4c5686fdea
Updated services.md
Added the information regarding services removed from the usage.md document
2019-06-10 08:19:28 -05:00
SaintYomar
4535cef89e
Updated usage.md
Deleted services division
2019-06-10 07:51:00 -05:00
bharnden
756f8fd3e9 fixed python3 specific dependency issue for fpm definition 2019-06-08 22:46:21 -07:00
Blake Harnden
d37db217b5 cleanup on README and CHANGELOG markdown 2019-06-10 15:59:00 -07:00
Blake Harnden
1018143cfe updated CHANGELOG and converted it to markdown format 2019-06-10 15:37:32 -07:00
Blake Harnden
df55f90f24 cleaned up selinux section and better clarity for using fpm in install.md 2019-06-10 14:59:42 -07:00
Blake J. Harnden
c7ce0e47f4 corefx updates to account for latest protobuf file 2019-06-10 13:36:40 -07:00
Blake Harnden
0692ab6f68 added check for grpcio-tools in autoconf, updated install docs to denote python dependencies and grpcio-tools for building from source 2019-06-10 13:15:34 -07:00
Blake Harnden
43627805ee small tweak to building python2/3 and install.md documentation 2019-06-10 12:26:44 -07:00
Blake Harnden
fc654a31a8 update to installation docs, tweaks to handling python2/3 package builds 2019-06-10 11:41:27 -07:00
bharnden
223bcb64f1 added way to denote which python packages we are building for fpm 2019-06-08 22:00:02 -07:00
bharnden
10df7d35ee fixed saving bidirectional params for ptp networks, storing to xml and loading back into running environment 2019-06-08 21:46:07 -07:00
bharnden
191d392c46 updated grpc node x,y types, added new grpc session position type, grpc updated link options to use int, fixed corehandlers handling of dup, fixed corexml type handling for link options, updated mobility config types to correlate with link options 2019-06-08 16:56:39 -07:00
bharnden
e2f2d9dca0 added xml tests for network to network links and verifying saving/loading of link options for network and ptp cases 2019-06-08 14:01:26 -07:00
bharnden
39bcdcaf79 Updated fpm buiilds to build from destdir and include everything for a simpler single file installation. Also removing python specific dependencies, to use requirements.txt as alternative 2019-06-07 22:07:13 -07:00
bharnden
579c0d5783 version bumped to 5.3.0 and removed empty email field from package maintaners 2019-06-07 21:51:24 -07:00
bharnden
1b71061cdb make building new man pages simpler, updated generated man pages 2019-06-07 21:50:32 -07:00
bharnden
7594afec82 updated all scripts to be executable 2019-06-07 21:49:48 -07:00
bharnden
5bf53f1ad8 cleared out netns make for building python wrappers 2019-06-07 21:49:15 -07:00
bharnden
8ce6703875 removed unwanted man page 2019-06-07 21:48:47 -07:00
Blake Harnden
e62ae42bdc merged latest from master 2019-06-07 10:05:40 -07:00
bharnden
a74f2dae1f
Merge pull request #254 from coreemu/sendmsg-udp
Merging back in core-daemon / coresendmsg udp support
2019-06-07 09:21:02 -07:00
Blake Harnden
b448c6ebf0 bumped version to 5.2.2 and fixed issue in gui that prevented moving nodes while mobility was occuring 2019-06-07 09:10:34 -07:00
Blake Harnden
db7bfe12bd pass on updated pydocs to reflect path changes 2019-06-07 08:59:16 -07:00
Blake Harnden
89877ffe6f updated docs for python files 2019-06-06 16:34:26 -07:00
Blake Harnden
994fe042e1 updates to just leverage broker clients instead of repeating logic for now, until broker is refactored 2019-06-06 13:02:20 -07:00
SaintYomar
174bae6de1
Update usage.md
Added icons for the toolbar buttons.
2019-06-06 14:59:35 -04:00
Blake Harnden
0b770d8350 reverted enclosing system start in exception handler 2019-06-06 11:43:39 -07:00
Blake Harnden
e59a8bf66d changes to add back in coresendmsg udp support 2019-06-06 11:33:22 -07:00
Blake Harnden
4381615f1d fixed issue for link data not including per/loss when it is a ptp node, for host to host links 2019-06-05 09:54:11 -07:00
bharnden
c262778209 just use setuptools in setup.py 2019-06-04 21:49:44 -07:00
bharnden
2dd1538184
Merge pull request #250 from coreemu/refactor_pure
Merging directory layout changes and 2/3 support
2019-06-04 17:16:21 -07:00
bharnden
996a7715be fixed ignoring adding nodes to xml and xml links from network to network 2019-06-04 16:03:07 -07:00
bharnden
86ada3da0b updated requirements.txt to latest tested 2/3 environment and updated setup.py to reflect current dependencies 2019-06-04 15:41:15 -07:00
bharnden
f78736ebfd updated coresendmsg and core-manage to be 2/3 compliant 2019-06-04 14:42:40 -07:00
bharnden
6c861a6ff8 fixed issues related to writing xml with tunnel nodes using othernet, fixed reading x,y as int instead of float due to packing issues for tlv 2019-06-04 10:59:02 -07:00
bharnden
d1114bd804 fixed byte/str issue in coreapi tlv mac addr 2019-06-04 10:55:08 -07:00
bharnden
675dd0614d fixed bad variable name in session.py 2019-06-04 10:54:09 -07:00
bharnden
23ae71bed3 make netns install programs to bin, since c extension is no longer used, added hack to endforce dist-packages 2019-06-03 21:59:29 -07:00
bharnden
f5efecabf0 byte string fix in coreapi, different approach to urlparse compatibility to avoid other issues 2019-06-03 21:22:11 -07:00
Kevin Larson
c4c1a10f05 Added compatible idioms for configparser and queue to support both python2 and python3 2019-06-03 18:22:25 -07:00
Kevin Larson
823fda9c97 Switched write to writebytes for python3 support 2019-06-03 18:22:06 -07:00
Blake Harnden
59fac510c4 Merge branch 'refactor_pure' of https://github.com/coreemu/core into refactor_pure 2019-06-03 16:50:34 -07:00
Blake Harnden
c9baf66f3d fixed utils.cmd_output to utf-8 2019-06-03 16:49:55 -07:00
Blake J. Harnden
1af41d3ec6 updated corefx to use protobuf bytes to string changes 2019-06-03 14:51:56 -07:00
Blake Harnden
597bd21994 updated logging.warn to logging.warning due to deprecation in python3, fixed python 2/3 filter issue in tests, fixed utf decoding for some missed popen commands 2019-06-03 14:36:21 -07:00
Blake Harnden
69b1297002 updated protobuf to use string instead of bytes for 2/3 compatibility for now, updated default service in grpc tests, fixed byte string issues for python3 in coreapi 2019-06-03 13:34:54 -07:00
Blake Harnden
7efec88e79 merged latest from develop 2019-06-03 13:06:11 -07:00
Blake Harnden
bb5e68ad8b 2/3 fixes for ip address and mac byte handling 2019-06-03 11:49:43 -07:00
bharnden
db9d13aff8 update to setparams check to avoid python3 errors, and fix to ipprefix 2019-06-02 22:53:39 -07:00
bharnden
40176e861d fixed unit test for vnode client, due to changes using python directly 2019-06-02 22:31:23 -07:00
bharnden
7a0edd5927 fixed bad logic introduced into interface setparams, fixed grpc edit link test 2019-06-02 22:20:00 -07:00
bharnden
3de37f0f5e fixed basestring check for 2/3 compatibility 2019-06-02 19:23:49 -07:00
bharnden
ecc63f4abb updates to support 2/3 along with not using vcmd c extension 2019-06-02 19:06:25 -07:00
bharnden
a8061b811d grpc added get node terminal, updated corefx to leverage get node terminal to launch local terminals on double click 2019-05-31 22:20:19 -07:00
Blake J. Harnden
43e18d820f corefx properly cancel server stream from client for session events 2019-05-31 16:53:16 -07:00
Blake J. Harnden
b075181796 corefx got throughput working using grpc, removed unused session nodes menu option 2019-05-31 16:06:24 -07:00
Blake Harnden
4c1d7bfb22 grpc added simple throughputs stream events 2019-05-31 14:19:23 -07:00
Blake J. Harnden
5542dbbce2 corefx added node command usage from grpc and removed mailing list link 2019-05-31 12:38:35 -07:00
Blake Harnden
1890db5991 added grpc for a node command and fixed grpc unit tests 2019-05-31 11:46:47 -07:00
Blake Harnden
e063fcd4fe core-daemon now allows configuration for grpc address and port, defaults to localhost, also fixed grpc example due to enum and event changes 2019-05-30 16:31:48 -07:00
Blake J. Harnden
4dd6dc1837 updated corefx to use consolidated event streaming 2019-05-30 13:27:54 -07:00
Blake Harnden
df3a8980ed grpc merged multiple event request/handlers into a singular event request for a session, which will return all events 2019-05-30 13:07:45 -07:00
Blake J. Harnden
2ba8669c5c corefx updated to use latest proto file, moved websocket into rest client 2019-05-30 10:15:00 -07:00
Blake Harnden
2ed2b4a879 encapsulated grpc enums within messages to help provide better namespace separation due to python/c code generation 2019-05-30 08:57:24 -07:00
Blake J. Harnden
ec672d209f corefx updates to support handling streamed events from the grpc server 2019-05-29 12:25:33 -07:00
Blake J. Harnden
6b93f60056 updated corefx to use explicit id names for grpc 2019-05-28 14:49:25 -07:00
Blake Harnden
b3aaa870eb Merge branch 'develop' of https://github.com/coreemu/core into develop 2019-05-28 14:33:10 -07:00
Blake Harnden
3e194af5ee updated all grpc variables to use more explicit naming for session/node/interface ids 2019-05-28 14:31:34 -07:00
bharnden
f1d440488c
Merge pull request #249 from coreemu/corefx-grpc
Adding corefx using grpc client
2019-05-28 13:07:00 -07:00
Blake J. Harnden
09a681dab6 catch grpc runtime exceptions and throw as expected ioexceptions 2019-05-28 12:10:24 -07:00
Kevin Larson
e74b833db2 Updated print in configure.ac to be python2/3 compatible 2019-05-28 11:16:34 -07:00
Kevin Larson
83e883ee13 Removed instances of old nrl mailing list 2019-05-28 10:59:34 -07:00
Blake J. Harnden
7da09a0dd9 added missing corefx config files due to gitignore 2019-05-28 09:36:18 -07:00
Blake Harnden
01fc5be82f properly ignore root level config directory 2019-05-28 09:34:11 -07:00
Blake Harnden
a294ff3c40 removed generated config files 2019-05-28 09:33:14 -07:00
Blake Harnden
5acc93207a updated ignore to not exclude desired corefx files 2019-05-28 09:26:40 -07:00
bharnden
2b419ac67c finished all current grpc commands, potentially should add remaining 2019-05-26 12:36:48 -07:00
bharnden
e9d7ed5049 converted session location calls 2019-05-26 10:58:04 -07:00
bharnden
636a505365 converted more client calls to grpc 2019-05-26 10:20:56 -07:00
bharnden
295fdddaf9 further updates to implement more grpc calls 2019-05-25 21:06:50 -07:00
bharnden
a593289f1b initial commit supporting converting corefx to using grpc from previous rest client 2019-05-25 10:16:50 -07:00
Kevin Larson
dee09cae71 Starting to add acronym expansion to the docs 2019-05-24 10:02:08 -07:00
Kevin Larson
d9bf4f5926 Added core screenshot image and a few other small changes to the usage doc 2019-05-23 16:02:30 -07:00
Kevin Larson
0b84f21b47 Updated copyright date 2019-05-23 16:01:47 -07:00
Kevlar
1d8419d592
Added image of CORE 2019-05-23 15:45:37 -07:00
bharnden
864c7b69a1 updated Queue and ConfigParser to use 2/3 compatible imports 2019-05-05 21:49:42 -07:00
bharnden
b58d32c156 updated socketserver to 2/3 compliant 2019-05-05 21:37:45 -07:00
bharnden
1e98175e35 refactored usages of iteritems, itervalues, and iterkeys to be 2/3 compliant 2019-05-05 21:23:43 -07:00
bharnden
8d6bf54a16 removed usage of longs, updated int instance checking and octal constants to be 2/3 compliant 2019-05-05 17:11:07 -07:00
bharnden
5b7453b906 updated caught exceptions to be 2/3 compliant 2019-05-05 16:58:08 -07:00
bharnden
b42b5b1a5a fixed updated raised exceptions to be 2/3 compatible 2019-05-05 16:56:18 -07:00
bharnden
feebd8704f updated all print calls to use print() method for 2/3 2019-05-05 16:52:55 -07:00
bharnden
e58cbe9421 added future library to support python2/3, updated xrange calls to leverage builtins range 2019-05-05 16:19:12 -07:00
bharnden
e79fd6c7ce merged EmuSession and Session, small cleanup 2019-05-01 23:17:46 -07:00
bharnden
66e603906a updates to layout core module packages in a more logical way, including renaming methods from objects to nodes and nodes.objid to nodes.id 2019-04-29 23:31:47 -07:00
bharnden
9517740704 initial refactor for all variables named objid 2019-04-26 22:07:51 -07:00
Jeff Ahrenholz
9399218123 enable OSPFv2 fast convergence, and fix router-id for IPv6-only nodes 2018-10-10 09:58:18 -07:00
Andreas Martens
7dedaa0344 add comments to the OVS service 2018-07-30 15:12:08 +01:00
710 changed files with 55526 additions and 76396 deletions

View file

@ -11,6 +11,7 @@ insert_final_newline = true
[*.py] [*.py]
indent_style = space indent_style = space
indent_size = 4 indent_size = 4
max_line_length = 88
[*.am] [*.am]
indent_style = tab indent_style = tab

41
.github/workflows/daemon-checks.yml vendored Normal file
View file

@ -0,0 +1,41 @@
name: Daemon Checks
on: [push]
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
cd daemon
cp core/constants.py.in core/constants.py
sed -i 's/required=True/required=False/g' core/emulator/coreemu.py
poetry install
- name: isort
run: |
cd daemon
poetry run isort -c -df
- name: black
run: |
cd daemon
poetry run black --check .
- name: flake8
run: |
cd daemon
poetry run flake8
- name: grpc
run: |
cd daemon/proto
poetry run python -m grpc_tools.protoc -I . --python_out=.. --grpc_python_out=.. core/api/grpc/*.proto
- name: test
run: |
cd daemon
poetry run pytest --mock tests

21
.github/workflows/documentation.yml vendored Normal file
View file

@ -0,0 +1,21 @@
name: documentation
on:
push:
branches:
- master
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/cache@v2
with:
key: ${{ github.ref }}
path: .cache
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force

18
.gitignore vendored
View file

@ -8,18 +8,22 @@ Makefile
Makefile.in Makefile.in
aclocal.m4 aclocal.m4
autom4te.cache autom4te.cache
config /config
config.h config.h
config.h.in config.h.in
config.log config.log
config.status config.status
configure configure
configure~
debian debian
stamp-h1 stamp-h1
# python virtual environments
venv
# generated protobuf files # generated protobuf files
daemon/core/grpc/core_pb2.py *_pb2.py
daemon/core/grpc/core_pb2_grpc.py *_pb2_grpc.py
# python build directory # python build directory
dist dist
@ -39,6 +43,7 @@ coverage.xml
# python files # python files
*.egg-info *.egg-info
*.pyc
# ignore package files # ignore package files
*.rpm *.rpm
@ -54,4 +59,9 @@ coverage.xml
# ignore built input files # ignore built input files
netns/setup.py netns/setup.py
daemon/setup.py daemon/setup.py
ns3/setup.py
# python
__pycache__
# ignore core player files
*.core

977
CHANGELOG.md Normal file
View file

@ -0,0 +1,977 @@
## 2023-08-01 CORE 9.0.3
* Installation
* updated various dependencies
* Documentation
* improved GUI docs to include node interaction and note xhost usage
* \#780 - fixed gRPC examples
* \#787 - complete documentation revamp to leverage mkdocs material
* \#790 - fixed custom emane model example
* core-daemon
* update type hinting to avoid deprecated imports
* updated commands ran within docker based nodes to have proper environment variables
* fixed issue improperly setting session options over gRPC
* \#668 - add fedora sbin path to frr service
* \#774 - fixed pcap configservice
* \#805 - fixed radvd configservice template error
* core-gui
* update type hinting to avoid deprecated imports
* fixed issue allowing duplicate named hook scripts
* fixed issue joining sessions with RJ45 nodes
* utility scripts
* fixed issue in core-cleanup for removing devices
## 2023-03-02 CORE 9.0.2
* Installation
* updated python dependencies, including invoke to resolve python 3.10+ issues
* improved example dockerfiles to use less space for built images
* Documentation
* updated emane install instructions
* added Docker related issues to install instructions
* core-daemon
* fixed issue using invalid device name in sysctl commands
* updated PTP nodes to properly disable mac learning for their linux bridge
* fixed issue for LXC nodes to properly use a configured image name and write it to XML
* \#742 - fixed issue with bad wlan node id being used
* \#744 - fixed issue not properly setting broadcast address
* core-gui
* fixed sample1.xml to remove SSH service
* fixed emane demo examples
* fixed issue displaying emane configs generally configured for a node
## 2022-11-28 CORE 9.0.1
* Installation
* updated protobuf and grpcio-tools versions in pyproject.toml to account for bad version mix
## 2022-11-18 CORE 9.0.0
* Breaking Changes
* removed session nodes file
* removed session state file
* emane now runs in one process per nem with unique control ports
* grpc client has been refactored and updated
* removed tcl/legacy gui, imn file support and the tlv api
* link configuration is now different, but consistent, for wired links
* Installation
* added packaging for single file distribution
* python3.9 is now the minimum required version
* updated Dockerfile examples
* updated various python dependencies
* virtual environment is now installed to /opt/core/venv
* Documentation
* updated emane invoke task examples
* revamped install documentation
* added wireless node notes
* core-gui
* updated config services to display rendered templated and allow editing
* fixed node icon issue when updating preferences
* \#89 - throughput widget now works for hubs/switches
* \#691 - fixed custom nodes to properly use config services
* gRPC API
* add linked call to support linking and unlinking interfaces without destroying them
* fixed issue during start session clearing out session options
* added call to get rendered config service files
* removed get_node_links from links from client
* nem id and nem port have been added to GetNode and AddLink calls
* core-daemon
* wired links always create two veth pairs joined by a bridge
* node interfaces are now configured within the container to apply to outgoing traffic
* session.add_node now uses NodeOptions, allowing for node specific options
* fixed issue with xml reading node canvas values
* removed Session.add_node_file
* fixed get requirements logic
* fixed docker/lxd node support terminal commands on remote servers
* improved docker node command execution time using nsenter
* new wireless node type added to support dynamic loss based on distance
* \#513 - add and deleting distributed links during runtime is now supported
* \#703 - fixed issue not starting emane event listening service
## 2022-03-21 CORE 8.2.0
* core-gui
* improved failed starts to trigger runtime to allow node investigation
* core-daemon
* improved default service loading to use a full import path
* updated session instantiation to always set to a runtime state
* core-cli
* \#672 - fixed xml loading
* \#578 - restored json flag and added geo output to session overview
* Documentation
* updated emane example and documentation
* improved table markdown
## 2022-02-18 CORE 8.1.0
* Installation
* updated dependency versions to account for known vulnerabilities
* GUI
* fixed issue drawing asymmetric link configurations when joining a session
* daemon
* fixed issue getting templates and creating files for config services
* added by directional support for network to network links
* \#647 - fixed issue when creating RJ45 nodes
* \#646 - fixed issue when creating files for Docker nodes
* \#645 - improved wlan change updates to account for all updates with no delay
* services
* fixed file generation for OSPFv2 config service
## 2022-01-12 CORE 8.0.0
*Breaking Changes
* heavily refactored gRPC client, removing some calls, adding others, all using type hinted classes representing their protobuf counterparts
* emane adjustments to run each nem in its own process, includes adjustments to configuration, which may cause issues
* internal daemon cleanup and refactoring, in a script directly driving a scenario is used
* Installation
* added options to allow installation without ospf mdr
* removed tasks that are no longer needed
* updates to properly install/remove example files
* pipx/poetry/invoke versions are now locked to help avoid update related issues
* install.sh is now setup.sh and is a convenience to get tool setup to run invoke
* Documentation
* formally added notes for Docker and LXD based node types
* added config services
* Updated README to have quick notes for installation
* \#563 - update to note how to enable core service
* Examples
* \#598 - update to fix sample1.imn to working order
* core-daemon
* emane global configuration is now configurable per nem
* fixed wlan loss to support float values
* improved default service loading to use full core path
* improved emane model loading to occur one time
* fixed handling rj45 link edits from tlv api
* fixed wlan config getting a default value for the promiscuous setting when not provided
* ebtables usage has now been replaced with nftables
* \#564 - logging is now using module named loggers
* \#573 - emane processes are not created 1 to 1 with nems
* \#608 - update lxml version
* \#609 - update pyyaml version
* \#623 - fixed issue with ovs mode and mac learning
* core-gui
* config services are now the default service type
* legacy services are marked as deprecated
* fix to properly load session options
* logging is now using module named loggers
* save as will not update the current session file name as expected
* fix to properly clear out removed customized services
* adding directories to a service that do not exist, is now valid
* added flag to exit after creating gui directory from command line
* added new options to enable/disable ip4/ip6 assignment
* improved canvas draw order, when joining sessions
* improved node copy/paste to avoid issues when pasting text into service config dialogs
* each canvas will not correctly save and load their size from xml
* gRPC API
* session options are now returned for GetSession
* fixed issue not properly creating the session directory during start session definition state
* updates to separate editing a node and moving a node, new MoveNode call added, EditNode is now used for editing icons
* Services
* fixed default route config service
* config services now have options for shadowing directories, including per node customization
## 2021-09-17 CORE 7.5.2
* Installation
* \#596 - fixes issue related to installing poetry by pinning version to 1.1.7
* updates pipx installation to pinned version 0.16.4
* core-daemon
* \#600 - fixes known vulnerability for pillow dependency by updating version
## 2021-04-15 CORE 7.5.1
* core-pygui
* fixed issues creating and drawing custom nodes
## 2021-03-11 CORE 7.5.0
* core-daemon
* fixed issue setting mobility loop value properly
* fixed issue that some states would not properly remove session directories
* \#560 - fixed issues with sdt integration for mobility movement and layer creation
* core-pygui
* added multiple canvas support
* added support to hide nodes and restore them visually
* update to assign full netmasks to wireless connected nodes by default
* update to display services and action controls for nodes during runtime
* fixed issues with custom nodes
* fixed issue auto assigning macs, avoiding duplication
* fixed issue joining session with different netmasks
* fixed issues when deleting a session from the sessions dialog
* \#550 - fixed issue not sending all service customization data
* core-cli
* added delete session command
## 2021-01-11 CORE 7.4.0
* Installation
* fixed issue for automated install assuming ID_LIKE is always present in /etc/os-release
* gRPC API
* fixed issue stopping session and not properly going to data collect state
* fixed issue to have start session properly create a directory before configuration state
* core-pygui
* fixed issue handling deletion of wired link to a switch
* avoid saving edge metadata to xml when values are default
* fixed issue editing node mac addresses
* added support for configuring interface names
* fixed issue with potential node names to allow hyphens and remove under bars
* \#531 - fixed issue changing distributed nodes back to local
* core-daemon
* fixed issue to properly handle deleting links from a network to network node
* updated xml to support writing and reading link buffer configurations
* reverted change and removed mac learning from wlan, due to promiscuous like behavior
* fixed issue creating control interfaces when starting services
* fixed deadlock issue when clearing a session using sdt
* \#116 - fixed issue for wlans handling multiple mobility scripts at once
* \#539 - fixed issue in udp tlv api
## 2020-12-02 CORE 7.3.0
* core-daemon
* fixed issue where emane global configuration was not being sent to core-gui
* updated controlnet names on host to be prefixed with ctrl
* fixed RJ45 link shutdown from core-gui causing an error
* fixed emane external transport xml generation
* \#517 - update to account for radvd required directory
* \#514 - support added for session specific environment files
* \#529 - updated to configure netem limit based on delay or user specified, requires kernel 3.3+
* core-pygui
* fixed issue drawing wlan/emane link options when it should not have
* edge labels are now placed a set distance from nodes like original gui
* link color/width are now saved to xml files
* added support to configure buffer size for links
* \#525 - added support for multiple wired links between the same nodes
* \#526 - added option to hide/show links with 100% loss
* Documentation
* \#527 - typo in service documentation
* \#515 - added examples to docs for using EMANE features within a CORE context
## 2020-09-29 CORE 7.2.1
* core-daemon
* fixed issue where shutting down sessions may not have removed session directories
* fixed issue with multiple emane interfaces on the same node not getting the right configuration
* Installation
* updated automated install to be a bit more robust for alternative distros
* added force install type to try and leverage a redhat/debian like install
* locked ospf mdr version installed to older commit to avoid issues with multiple interfaces on same node
## 2020-09-15 CORE 7.2.0
* Installation
* locked down version of ospf-mdr installed in automated install
* locked down version of emane to v1.2.5 in automated emane install
* added option to install locally using the -l option
* core-daemon
* improve error when retrieving services that do not exist, or failed to load
* fixed issue with writing/reading emane node interface configurations to xml
* fixed issue with not setting the emane model when creating a node
* added common utility method for getting a emane node interface config id in core.utils
* fixed issue running emane on more than one interface for a node
* fixed issue validating paths when creating emane transport xml for a node
* fixed issue avoiding multiple calls to shutdown, if already in shutdown state
* core-pygui
* fixed issue configuring emane for a node interface
* gRPC API
* added wrapper client that can provide type hinting and a simpler interface at core.api.grpc.clientw
* fixed issue creating sessions that default to having a very large reference scale
* fixed issue with GetSession returning control net nodes
## 2020-08-21 CORE 7.1.0
* Installation
* added core-python script that gets installed to help globally reference the virtual environment
* gRPC API
* GetSession will now return all configuration information for a session and the file it was opened from, if applicable
* node update events will now include icon information
* fixed issue with getting session throughputs for sessions with a high id
* core-daemon
* \#503 - EMANE networks will now work with mobility again
* \#506 - fixed service dependency resolution issue
* fixed issue sending hooks to core-gui when joining session
* core-pygui
* fixed issues editing hooks
* fixed issue with cpu usage when joining a session
* fixed mac field not being disabled during runtime when configuring a node
* removed unlimited button from link config dialog
* fixed issue with copy/paste links and their options
* fixed issue with adding nodes/links and editing links during runtime
* updated open file dialog in config dialogs to open to ~/.coregui home directory
* fixed issue double clicking sessions dialog in invalid areas
* added display of asymmetric link options on links
* fixed emane config dialog display
* fixed issue saving backgrounds in xml files
* added view toggle for wired/wireless links
* node events will now update icons
## 2020-07-28 CORE 7.0.1
* Bugfixes
* \#500 - fixed issue running node commands with shell=True
* fixed issue for poetry based install not properly vetting requirements for dataclasses dependency
## 2020-07-23 CORE 7.0.0
* Breaking Changes
* core.emudata and core.data combined and cleaned up into core.data
* updates to consistently use mac instead of hwaddr/mac
* \#468 - code related to adding/editing/deleting links cleaned up
* \#469 - usages of per all changed to loss to be consistent
* \#470 - variables with numbered names now use numbers directly
* \#471 - node startup is no longer embedded within its constructor
* \#472 - code updated to refer to interfaces consistently as iface
* \#475 - code updates changing how ip addresses are stored on interfaces
* \#476 - executables to check for moved into own module core.executables
* \#486 - core will now install into its own python virtual environment managed by poetry
* core-daemon
* updates to properly save/load distributed servers to xml
* \#474 - added type hinting to all service files
* \#478 - fixed typo in config service directory
* \#479 - opening an xml file will now cycle through states like a normal session
* \#480 - ovs configuration will now save/load from xml and display in guis
* \#484 - changes to support adding emane links during runtime
* core-pygui
* fixed issue not displaying services for the default group in service dialogs
* fixed issue starting a session when the daemon is not present
* fixed issue attempting to open terminals for invalid nodes
* fixed issue syncing session location
* fixed issue joining a session with mobility, not in runtime
* added cpu usage monitor to status bar
* emane configurations can now be seen during runtime
* rj45 nodes can only have one link
* disabling throughputs will clear labels
* improvements to custom service copy
* link options will now be drawn on as a label
* updates to handle runtime link events
* \#477 - added optional details pane for a quick view of node/link details
* \#485 - pygui fixed observer widget for invalid nodes
* \#496 - improved alert handling
* core-gui
* \#493 - increased frame size to show all emane configuration options
* gRPC API
* added set session user rpc
* added cpu usage stream
* interface objects returned from get_node will now provide node_id, net_id, and net2_id data
* peer to peer nodes will not be included in get_session calls
* pathloss events will now throw an error when nem id not found
* \#481 - link rpc calls will broadcast out
* \#496 - added alert rpc call
* Services
* fixed issue reading files in security services
* \#494 - add staticd to daemons list for frr services
## 2020-06-11 CORE 6.5.0
* Breaking Changes
* CoreNode.newnetif - both parameters are required and now takes an InterfaceData object as its second parameter
* CoreNetworkBase.linkconfig - now takes a LinkOptions parameter instead of a subset of some of the options (ie bandwidth, delay, etc)
* \#453 - Session.add_node and Session.get_node now requires the node class you expect to create/retrieve
* \#458 - rj45 cleanup to only inherit from one class
* Enhancements
* fixed issues with handling bad commands for TLV execute messages
* removed unused boot.sh from CoreNode types
* added linkconfig to CoreNetworkBase and cleaned up function signature
* emane position hook now saves geo position to node
* emane pathloss support
* core.emulator.emudata leveraged dataclass and type hinting
* \#459 - updated transport type usage to an enum
* \#460 - updated network policy type usage to an enum
* Python GUI Enhancements
* fixed throughput events do not work for joined sessions
* fixed exiting app with a toolbar picker showing
* fixed issue with creating interfaces and reusing subnets after deletion
* fixed issue with moving text shapes
* fixed scaling with custom node selected
* fixed toolbar state switching issues
* enable/disable toolbar when running stop/start
* marker config integrated into toolbar
* improved color picker layout
* shapes can now be moved while drawing shapes
* added observers to toolbar in run mode
* gRPC API
* node events will now have geo positional data
* node geo data is now returned in get_session and get_node calls
* \#451 - added wlan link api to allow direct linking/unlinking of wireless links between nodes
* \#462 - added streaming call for sending node position/geo changes
* \#463 - added streaming call for emane pathloss events
* Bugfixes
* \#454 - fixed issue creating docker nodes, but containers are now required to have networking tools
* \#466 - fixed issue in python gui when xml file is loading nodes with no ip4 addresses
## 2020-05-11 CORE 6.4.0
* Enhancements
* updates to core-route-monitor, allow specific session, configurable settings, and properly
listen on all interfaces
* install.sh now has a "-r" option to help with reinstalling from current branch and installing
current python dependencies
* \#202 - enable OSPFv2 fast convergence
* \#178 - added comments to OVS service
* Python GUI Enhancements
* added initial documentation to help support usage
* supports drawing multiple links for wireless connections
* supports differentiating wireless networks with different colored links
* implemented unlink in node context menu to delete links to other nodes
* implemented node run tool dialog
* implemented find node dialog
* implemented address configuration dialog
* implemented mac configuration dialog
* updated link address creation to more closely mimic prior behavior
* updated configuration to use yaml class based configs
* implemented auto grid layout for nodes
* fixed drawn wlan ranges during configuration
* Bugfixes
* no longer writes link option data for WLAN/EMANE links in XML
* avoid configuring links for WLAN/EMANE link options in XML, due to them being written to XML prior
* updates to allow building python docs again
* \#431 - peer to peer node uplink link data was not using an enum properly due to code changes
* \#432 - loading XML was not setting EMANE nodes model
* \#435 - loading XML was not maintaining existing session options
* \#448 - fixed issue sorting hooks being saved to XML
## 2020-04-13 CORE 6.3.0
* Features
* \#424 - added FRR IS-IS service
* Enhancements
* \#414 - update GUI OSPFv2 adjacency widget to work with FRR
* \#416 - EMANE links can now be drawn for 80211 and RF Pipe models
* \#418 #409 - code cleanup
* \#425 - added route monitor script for SDT3D integration
* a formal error will now be thrown when EMANE binding are not installed, but attempted to be used
* node positions will now default to 0,0 to avoid GUI errors, when one is not provided
* improved SDT3D integration, multiple link support and usage of custom layers
* Python GUI Enhancements
* enabled edit menu delete
* cleaned up node context menu and enabled delete
* Bugfixes
* \#427 - fixed issue in default route service
* \#426 - fixed issue reading ipsec template file
* \#420 - fixed issue with TLV API udp handler
* \#411 - allow wlan to be configured with 0 values
* \#415 - general EMANE configuration was not being saved/loaded from XML
## 2020-03-16 CORE 6.2.0
* gRPC API
* Added call to execute python script
* Enhancements
* \#371 - improved coretk gui scaling
* \#374 - display range visually for wlan in coretk gui, when configuring
* \#377 - improved coretk error dialogs
* \#379 - fixed issues with core converting between x,y and lon,lat for values that would cross utm zones
* \#384 - sdt integration moved internally to core code allowing it to work for coretk gui as well
* \#387 - coretk gui will now auto detect potential valid terminal and command to use for interacting with nodes during runtime
* \#389 - coretk gui will now attempt to reconnect to daemon without need to restart
* \#395 - coretk gui now has "save" and "save as" menu options
* \#402 - coretk will now allow terminal preference to be directly edited
* Bugfixes
* \#375 - fixed issues with emane event monitor handling data
* \#381 - executing a python script will now wait until completion before looking to join a new session
* \#391 - fixed configuring node ip addresses in coretk gui
* \#392 - fixed coretk link display when addresses are cleared out
* \#393 - coretk gui will properly clear marker annotations when switching sessions
* \#396 - Docker and LXC nodes will now properly save to XML
* \#406- WLAN bridge initialization was not ran when all nodes are disconnected
## 2020-02-20 CORE 6.1.0
* New
* config services - these services leverage a proper template engine and have configurable parameters, given enough time may replace existing services
* core-imn-to-xml - IMN to XML utility script
* replaced internal code for determining ip/mac address with netaddr library
* Enhancements
* added distributed package for built packages
* made use of python type hinting for functions and their return values
* updated Quagga zebra service to remove deprecated warning
* Removed
* removed stale ns3 code
* CORETK GUI
* added logging
* improved error dialog
* properly use global ipv6 addresses for nodes
* disable proxy usage by default, flag available to enable
* gRPC API
* add_link - now returns created interface information
* set_node_service - can now set files and directories to properly replicate previous usage
* get_emane_event_channel - return information related to the currently used emane event channel
* Bugfixes
* fixed session SDT functionality back to working order, due to python3 changes
* avoid shutting down services for nodes that are not up
* EMANE bypass model options will now display properly in GUIs
* XML scenarios will now properly read in custom node icons
* \#372 - fixed mobility waypoint comparisons
* \#370 - fixed radvd service
* \#368 - updated frr services to properly start staticd when needed
* \#358 - fixed systemd service install path
* \#350 - fixed frr babel wireless configuration
* \#354 - updated frr to reset interfaces to properly take configurations
## 2020-01-01 CORE 6.0.0
* New
* beta release of the python based tk GUI, use **coretk-gui** to try it out, plan will be to eventually sunset the old GUI once this is good enough
* this GUI will allow us to provide enhancements and a consistent python dev environment for developers
* Major Changes
* python3.6+ support only, due to python2 EOL https://pyfound.blogspot.com/2019/12/python-2-sunset.html
* distributed sessions now leverages the fabric library for sending remote SSH commands
* Enhancements
* changed usage of bridge-utils to using ip based bridge commands due to deprecation
* installation.sh script to help automate a standard make install or dev install
* when sessions are created without an id they will now always start from 1 and return the next unused id
* gRPC is now running by default
* Session API
* removed **create_emane_network** and **create_wlan_network** to help force using **add_node** for all cases
* removed **session.master** as it was only used for previous distributed sessions
* updated **add_node** to allow providing a custom class for node creation
* gRPC API
* added get all services configurations
* added get all wlan configurations
* added start/stop session calls, provides more freedom for startup and shutdown logic
* session events now have a session id to help differentiate which session they are coming from
* throughput events now require a session id and responses include session id for differentiating data
* session events can now be subscribed to with a subset of events or all
* emane model config data now include interface ids properly
* sessions returned from get sessions call may include file names when created from xml
* when opening an xml the session can now be started or not
* edit node will now broadcast the edit for others to listen to
* all config responses will now be in the form of a mapped value of key to ConfigOption, or a list of these when retrieving all, sometimes the config response may be wrapped in a different message to include other metadata
* Bugfixes
* \#311 - initialize ebtables chains for wlan networks only
* \#312 - removed sudo from init script
* \#313 - check if interface exists before flushing, previously would log an exception that didn't matter
* \#314 - node locations stored as floats instead of ints to avoid mobility calculations due to loss of precision
* \#321 - python installation path will be based on distr ibution/python building it
* emane options xml parsing didn't properly take into account the **emane_prefix** configuration
* updates services that checked for ipv4/ipv6 addresses to not fail for valid ipv6 addresses with a decimal
* Documentation
* updated NRL links to new GitHub locations
* updates for distributed session
* updates to dev guide
* updates to examples LXD/Docker setup
* updates to FRR service documentation
* gRPC get node service file will not throw an exception when node doesn't exist
## 2019-10-12 CORE 5.5.2
* gRPC
* Added emane_link API for linking/unlinking EMANE nodes within the GUI
* Bugfixes
* Fixed python3 issues when configuring WLAN nodes
* Fixed issue due to refactoring when running distributed
* Fixed issue when running python script from GUI
## 2019-10-09 CORE 5.5.1
* Bugfix
* Fixed issue with 5.5.0 refactoring causing issues in python2.
* Fixed python3 issues with NRL services
## 2019-10-03 CORE 5.5.0
* Documentation
* updated dependencies for building OSPF MDR on installation page
* added python/pip instruction on installation page
* added ethtool dependency for CORE
* GUI
* removed experimental OVS node to avoid confusion and issues related to using it
* Daemon
* fixed core-daemon --ovs flag back to working order for running CORE using OVS bridges instead of Linux bridges
* updated requirements.txt to refer to configparser 4.0.2, due to 4.0.1 removal by developers
* update to fail fast for dependent executables that are not found within PATH
* update to not load services that fail during service.on_load and move on
* Build
* fixed issue with configure script when using option flags
* python install path will use the native install path for AM_PATH_PYTHON, instead of coercing to python3
* Issues
* \#271 - OVS node error in GUI
* \#291 - configparser 4.0.1 issue
* \#290 - python3 path issue when building
## 2019-09-23 CORE 5.4.0
* Documentation
* Updates to documentation dev guide
* Improvements
* Added support for Pipenv for development
* Added configuration to leverage pre-commit during development
* Added configuration to leverage isort, black, and flake8 during development
* Added Github Actions to help verify pull requests in the same way as pre-commit
* Issues
* \#279 - WLAN configuration does not get set by default
* \#272 - error installing python package futures==3.2.0
* Pull Requests
* \#275 - Disable MAC learning on WLAN
* \#281 - Bumped jackson version on corefx
## 2019-07-05 CORE 5.3.1
* Documentation
* Updates to provide more information regarding several of the included services
* Issues
* \#252 - fixed changing wlan configurations during runtime
* \#256 - fixed mobility waypoint comparison for python3
* \#174 - turn tx/rx checksums off by default as they will never be valid for virtual interfaces
* \#259 - fixes for distributed EMANE
* \#260 - fixed issue with how execfile was being used due to it not existing within python3
## 2019-06-10 CORE 5.3.0
* Enhancements
* python 2 / 3 support
* added new API using [gRPC](https://grpc.io/)
* --grpc --grpc-port --grpc-address flags added to core-daemon
* core.api.grpc.client.CoreGrpcClient, provides a convenience wrapper for leveraging the API
* Docs
* Updates to installation instructions for latest changes
* Services
* Added FRR service
* EMANE
* Added EMANE prefix configuration when looking for emane model manifest files
* requires configuring **emane_prefix** in /etc/core/core.conf
* Cleanup
* Refactoring of the core python package structure, trying to help provide better organization and
logical groupings
* Issues
* \#246 - Fixed network to network link handling when reading xml files
* \#236 - Fixed storing/reading of link configuration values within xml files
* \#170 - FRR Service
* \#155 - EMANE path configuration
* \#233 - Python 3 support
* \#245 - Fixed bidirectional link configurations when reading from xml files
* \#208 - gRPC API
* Fixed link configuration dup handling when loaded from xml files
## 2019-06-07 CORE 5.2.2
* Enhancements:
* adds back in core-daemon udp support for coresendmsg, people may have depended on previously for certain scenarios
* Bug Fixes:
* fixes issue in GUI that would prevent moving nodes during mobility scenarios
## 2019-03-25 CORE 5.2.1
* Packaging:
* documentation no longer builds by default, must use configure flag
* added configure flag to allow only building vcmd
* sphinx will no long be required when not building documentation
* Services:
* Added source NAT service
* Fixed DHCP service for Ubuntu 18.04
* BUGFIXES:
* \#188 - properly remove session on delete TLV API call
* \#192 - updated default gnome terminal command for nodes to be Ubuntu 18.04 compatible
* \#193 - updates to service validation, will retry on failure and better exception logging
* \#195 - TLV link message data fix
* \#196 - fix to avoid clearing out default services
* \#197 - removed wireless_link_all API from EmuSession
* \#216 - updated default WLAN bandwidth to 54Mbps
* \#223 - fix to saving RJ45 to session XML files
## 2018-05-22 CORE 5.1
* DAEMON:
* removed and cleared out code that is either legacy or no longer supported (Xen, BSD, Kernel patching, RPM/DEB
specific files)
* default nodes are now set in the node map
* moved ns3 and netns directories to the top of the repo
* changes to make use of fpm as the tool for building packages
* removed usage of logzero to avoid dependency issues for built packages
* removed daemon addons directory
* added CoreEmu to core.emulator.coreemu to help begin serving as the basis for a more formal API for scripting
and creating new external APIs out of
* cleaned up logging, moved more logging to DEBUG from INFO, tried to mold INFO message to be more simple and
informative
* EMANE 1.0.1-1.21 supported
* updates to leverage EMANE python bindings for dynamically parsing phy/mac manifest files
* example custom EMANE model lives under /usr/share/core/examples/myemane/examplemodel.py
* EMANE TDMA model now supports an option to start a TDMA schedule when running
* fixed issues with coresendmsg script due to code refactoring
* added make target for generating documentation "make doc"
* Python 2.7+ is now required
* ns3 is no longer bundled by default, but will be produced as a separate package for installation
* GUI:
* updated broken help links in GUI Help->About
* Packaging:
* fixed PYTHON_PATH to PYTHONPATH in sysv script
* added make command to leverage FPM as the tool for creating deb/rpm packages going forward, there is documentation
within README.md to try it out
* TEST:
* fixed some broken tests
* new test cases based on CoreEmu usage
* BUGFIXES:
* \#142 - duplication of custom services
* \#136 - sphinx-apidoc command not found
* \#137 - make command fails when using distclean
## 2017-09-01 CORE 5.0
* DEVELOPMENT:
* support for editorconfig to help standardize development across IDEs, from the defined configuration file
* support for sonarqube analysis, from the defined configuration file
* DAEMON:
* code cleanup and improvements to adhere to coding standards (SonarQube)
* leverage "logzero" module to make easy usage of the standard logging module
* improvements to documentation across the code base
* initial work to separate the dependence on TCP API messaging from the core library (easier core scripting)
* beta support for running core in Open vSwitch mode, leveraging Open vSwitch bridges, instead of Linux bridges
* SERVICES:
* added Ryu SDN controller service
* added Open vSwitch service
* TEST:
* added unit/integration tests to support validating changes going forward
* BUGFIXES:
* merged pull requests for: #115, #110, #109, #107, #106, #105, #103, #102, #101, #96
## 2015-06-05 CORE 4.8
* EMANE:
* support for EMANE 0.9.2
* run emane in each container when using EMANE 0.9.2
* support using separate control networks for EMANE OTA and event traffic
* GUI:
* fixed an issue where the adjacency widget lines pointed to old node positions
* fixed an issue where not all EMANE 0.9.x IEEE 802.11 MAC parameter were configurable
* fixed an issue related to running python scripts from the GUI when using tcl/tk version 8.6
* improved batch mode execution to display the check emulation light status
* improved managing multiple sessions
* improved support for using multiple canvases
* added a reload option to the file menu to revert back to a saved scenario
* DAEMON:
* support exporting scenarios in NRL Network Modeling Framework 1.0 XML format
* support importing scenarios in NRL Network Modeling Framework 1.0 XML format
* support exporting the deployed scenario state in NRL NMF XML 1.0 format
* improved EMANE post-startup processing to better synchronize distributed emulations
* improved how addresses are assigned to tun/tap devices
* added support for python state-change callbacks
* SERVICES:
* added mgen sink and mgen actor services
* added oslrv2 and olsr.org services
* added a docker service
* BUILD:
* improved the install/uninstall process
* improved debian and rpm packaging
* BUGFIXES:
* updated the http service for ubuntu 14.04
* improved included examples
* shortened the length of network interface names
* improved how the core system service manages running the core daemon
* fixed an issues related to applying session configuration setting
* improved detecting when a distributed emulation is already running
* improved documentation
## 2014-08-06 CORE 4.7
* EMANE:
* support for EMANE 0.9.1
* fix error when using Comm Effect model with loss/duplicate string values
* enable flow control in virtual transport if enabled in the MAC model
* fix bug #150 where EMANE event service/address port were not used
* GUI:
* support Tcl/Tk 8.6 when available
* added --(a)ddress and --(p)ort arguments to core-gui command-line
* added File > Execute XML or Python script... option
* added File > Execute Python script with options... menu item
* when executing Python script from GUI, run in background thread, wait for
RUNTIME state
* enter RUNTIME state when start button pressed with empty canvas
* added support for asymmetric link effects
* support link delays up to 274 seconds (netem maximum)
* allow runtime changes of WLAN link effects
* DAEMON:
* set NODE_NAME, NODE_NUMBER, SESSION_SHORT in default vnoded environment
* changed host device naming to use veth, tap prefixes; b.n.SS for bridges
* allow parsing XML files into live running session
* enable link effects between hub/switch and hub/switch connections
* update MDR service to use broadcast interfaces for non-WLAN links
* allow node class to be specified when initializing XML parser
* save and parse canvas origin (reference point) and scale in MP XML
* up/down control script session option
* fix hash calculation used to determine GRE tunnel keys
* use shell script to detach SMF on startup
* added NRL services for mgen sink and nrlolsrv2
* use SDT URL session option
* added core-manage tool for addons to add/remove/check services, models,
and custom node types
* API:
* implement local flag in Execute Message for running host commands
* jitter changed to 64-bit value to align with delay in Link Message
* added unidirectional link flag TLV to Link Message
* added reconfigure event type for re-generating service config files
* return errors in API with failed services
* BUGFIXES:
* fix HTTP service running under Ubuntu
* fixed the following bugs: #150, 169, 188, 220, 225, 230, 231, 242, 244,
247, 248, 250, 251
## 2013-09-25 CORE 4.6
* NOTE: cored is now core-daemon, and core is now core-gui (for Debian acceptance)
* NOTE: /etc/init.d/core is now /etc/init.d/core-daemon (for insserv compatibility)
* EMANE:
* don't start EMANE locally if no local NEMs
* EMANE poststartup() to re-transmit location events during initialization
* added debug port to EMANE options
* added a basic EMANE 802.11 CORE Python script example
* expose transport XML block generation to EmaneModels
* expose NEM entry to the EmaneModel so it can be overridden by a model
* add the control interface bridge prior to starting EMANE, as some models may
* depend on the controlnet functionality
* added EMANE model to CORE converter
* parse lat/long/alt from node messages, for moving nodes using command-line
* fix bug #196 incorrect distance when traversing UTM zones
* GUI:
* added Cut, Copy, and Paste options to the Edit menu
* paste will copy selected services and take care of node and interface
* renumbering
* implement Edit > Find dialog for searching nodes and links
* when copying existing file for a service, perform string replacement of:
* "~", "%SESSION%", "%SESSION_DIR%", "%SESSION_USER%", "%NODE%", "%NODENAME%"
* use CORE_DATA_DIR insteadof LIBDIR
* fix Adjacency Widget to work with OSPFv2 only networks
* BUILD:
* build/packaging improvements for inclusion on Debian
* fix error when running scenario with a mobility script in batch mode
* include Linux kernel patches for 3.8
* renamed core-cleanup.sh to core-cleanup for Debian conformance
* don't always generate man pages from Makefile; new manpages for
coresendmsg and core-daemon
* BUGFIXES:
* don't auto-assign IPv4/IPv6 addresses when none received in Link Messages (session reconnect)
* fixed lock view
* fix GUI spinbox errors for Tk 8.5.8 (RHEL/CentOS 6.2)
* fix broker node count for distributed session entering the RUNTIME state when
* (non-EMANE) WLANs or GreTapBridges are involved;
* fix "file exists" error message when distributed session number is re-used
* and servers file is written
* fix bug #194 configuration dialog too long, make dialog scrollable/resizable
* allow float values for loss and duplicates percent
* fix the following bugs: 166, 172, 177, 178, 192, 194, 196, 201, 202,
205, 206, 210, 212, 213, 214, 221
## 2013-04-13 CORE 4.5
* GUI:
* improved behavior when starting GUI without daemon, or using File New after connection with daemon is lost
* fix various GUI issues when reconnecting to a session
* support 3D GUI via output to SDT3D
* added "Execute Python script..." entry to the File Menu
* support user-defined terminal program instead of hard-coded xterm
* added session options for "enable RJ45s", "preserve session dir"
* added buttons to the IP Addresses dialog for removing all/selected IPv4/IPv6
* allow sessions with multiple canvases to enter RUNTIME state
* added "--addons" startup mode to pass control to code included from addons dir
* added "Locked" entry to View menu to prevent moving items
* use currently selected node type when invoking a topology generator
* updated throughput plots with resizing, color picker, plot labels, locked scales, and save/load plot
configuration with imn file
* improved session dialog
* EMANE:
* EMANE 0.8.1 support with backwards-compatibility for 0.7.4
* extend CommEffect model to generate CommEffect events upon receipt of Link Messages having link effects
* Services:
* updated FTP service with root directory for anonymous users
* added HTTP, PCAP, BIRD, RADVD, and Babel services
* support copying existing files instead of always generating them
* added "Services..." entry to node right-click menu
* added "View" button for side-by-side comparison when copying customized config files
* updated Quagga daemons to wait for zebra.vty VTY file before starting
* General:
* XML import and export
* renamed "cored.py" to "cored", "coresendmsg.py" to "coresendmsg"
* code reorganization and clean-up
* updated XML export to write NetworkPlan, MotionPlan, and ServicePlan within a Scenario tag, added new
"Save As XML..." File menu entry
* added script_start/pause/stop options to Ns2ScriptedMobility
* "python" source sub-directory renamed to "daemon"
* added "cored -e" option to execute a Python script, adding its session to the active sessions list, allowing for
GUI connection
* support comma-separated list for custom_services_dir in core.conf file
* updated kernel patches for Linux kernel 3.5
* support RFC 6164-style IPv6 /127 addressing
* ns-3:
* integrate ns-3 node location between CORE and ns-3 simulation
* added ns-3 random walk mobility example
* updated ns-3 Wifi example to allow GUI connection and moving of nodes
* fixed the following bugs: 54, 103, 111, 136, 145, 153, 157, 160, 161, 162, 164, 165, 168, 170, 171, 173, 174, 176,
184, 190, 193
## 2012-09-25 CORE 4.4
* GUI:
* real-time bandwidth plotting tool
* added Wireshark and tshark right-click menu items
* X,Y coordinates shown in the status bar
* updated GUI attribute option to link messages for changing color/width/dash
* added sample IPsec and VPN scenarios, how many nodes script
* added jitter parameter to WLANs
* renamed Experiment menu to Session menu, added session options
* use 'key=value' configuration for services, EMANE models, WLAN models, etc.
* save only service values that have been customized
* copy service parameters from one customized service to another
* right-click menu to start/stop/restart each service
* EMANE:
* EMANE 0.7.4 support
* added support for EMANE CommEffect model and Comm Effect controller GUI
* added support for EMANE Raw Transport when using RJ45 devices
* Services:
* improved service customization; allow a service to define custom Tcl tab
* added vtysh.conf for Quagga service to support 'write mem'
* support scheduled events and services that start N seconds after runtime
* added UCARP service
* Documentation:
* converted the CORE manual to reStructuredText using Sphinx; added Python docs
* General:
* Python code reorganization
* improved cored.py thread locking
* merged xen branch into trunk
* added an event queue to a session with notion of time zero
* added UDP support to cored.py
* use UDP by default in coresendmsg.py; added '-H' option to print examples
* enter a bash shell by default when running vcmd with no arguments
* fixes to distributed emulation entering runtime state
* write 'nodes' file upon session startup
* make session number and other attributes available in environment
* support /etc/core/environment and ~/.core/environment files
* added Ns2ScriptedMobility model to Python, removed from the GUI
* namespace nodes mount a private /sys
* fixed the following bugs: 80, 81, 84, 99, 104, 109, 110, 122, 124, 131, 133, 134, 135, 137, 140, 143, 144, 146,
147, 151, 154, 155
## 2012-03-07 CORE 4.3
* EMANE 0.7.2 and 0.7.3 support
* hook scripts: customize actions at any of six different session states
* Check Emulation Light (CEL) exception feedback system
* added FTP and XORP services, and service validate commands
* services can flag when customization is required
* Python classes to support ns-3 simulation experiments
* write state, node X,Y position, and servers to pycore session dir
* removed over 9,000 lines of unused GUI code
* performance monitoring script
* batch mode improvements and --closebatch option
* export session to EmulationScript XML files
* basic range model moved from GUI to Python, supports 3D coordinates
* improved WLAN dialog with tabs
* added PhysicalNode class for joining real nodes with emulated networks
* fixed the following bugs: 50, 75, 76, 79, 82, 83, 85, 86, 89, 90, 92, 94, 96, 98, 100, 112, 113, 116, 119, 120
## 2011-08-19 CORE 4.2
* EMANE 0.7.1 support
* support for Bypass model, Universal PHY, logging, realtime
* configurable MAC addresses
* control interfaces (backchannel between node and host)
* service customization dialog improved (tabbed)
* new testing scripts for MDR and EMANE performance testing
* improved upgrading of old imn files
* new coresendmsg.py utility (deprecates libcoreapi and coreapisend)
* new security services, custom service becomes UserDefined
* new services and Python scripting chapters in manual
* fixes to distributed emulation, linking tunnels/RJ45s with WLANs/hubs/switches
* fixed the following bugs: 18, 32, 34, 38, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 52, 53, 55, 57, 58, 60, 62, 64,
65, 66, 68, 71, 72, 74
## 2011-01-05 CORE 4.1
* new icons for toolbars and nodes
* node services introduced, node models deprecated
* customizable node types
* traffic flow editor with MGEN support
* user configs moved from /etc/core/`*` to ~/.core/
* allocate addresses from custom IPv4/IPv6 prefixes
* distributed emulation using GRE tunnels
* FreeBSD 8.1 now uses cored.py
* EMANE 0.6.4 support
* numerous bugfixes
## 2010-08-17 CORE 4.0
* Python framework with Linux network namespace (netns) support (Linux netns is now the primary supported platform)
* ability to close the GUI and later reconnect to a running session (netns only)
* EMANE integration (netns only)
* new topology generators, host file generator
* user-editable Observer Widgets
* use of /etc/core instead of /usr/local/etc/core
* various bugfixes
## 2009-09-15 CORE 3.5
## 2009-06-23 CORE 3.4
## 2009-03-11 CORE 3.3

342
Changelog
View file

@ -1,342 +0,0 @@
2019-03-25 CORE 5.2.1
* Packaging:
- documentation no longer builds by default, must use configure flag
- added configure flag to allow only building vcmd
- sphinx will no long be required when not building documentation
* Services:
- Added source NAT service
- Fixed DHCP service for Ubuntu 18.04
* BUGFIXES:
- #188 - properly remove session on delete TLV API call
- #192 - updated default gnome terminal command for nodes to be Ubuntu 18.04 compatible
- #193 - updates to service validation, will retry on failure and better exception logging
- #195 - TLV link message data fix
- #196 - fix to avoid clearing out default services
- #197 - removed wireless_link_all API from EmuSession
- #216 - updated default WLAN bandwidth to 54Mbps
- #223 - fix to saving RJ45 to session XML files
2018-05-22 CORE 5.1
* DAEMON:
- removed and cleared out code that is either legacy or no longer supported (Xen, BSD, Kernel patching, RPM/DEB specific files)
- default nodes are now set in the node map
- moved ns3 and netns directories to the top of the repo
- changes to make use of fpm as the tool for building packages
- removed usage of logzero to avoid dependency issues for built packages
- removed daemon addons directory
- added CoreEmu to core.emulator.coreemu to help begin serving as the basis for a more formal API for scripting and creating new external APIs out of
- cleaned up logging, moved more logging to DEBUG from INFO, tried to mold INFO message to be more simple and informative
- EMANE 1.0.1-1.21 supported
- updates to leverage EMANE python bindings for dynamically parsing phy/mac manifest files
- example custom EMANE model lives under /usr/share/core/examples/myemane/examplemodel.py
- EMANE TDMA model now supports an option to start a TDMA schedule when running
- fixed issues with coresendmsg script due to code refactoring
- added make target for generating documentation "make doc"
- Python 2.7+ is now required
- ns3 is no longer bundled by default, but will be produced as a separate package for installation
* GUI:
- updated broken help links in GUI Help->About
* Packaging:
- fixed PYTHON_PATH to PYTHONPATH in sysv script
- added make command to leverage FPM as the tool for creating deb/rpm packages going forward, there is documentation within README.md to try it out
* TEST:
- fixed some broken tests
- new test cases based on CoreEmu usage
* BUGFIXES:
- #142 - duplication of custom services
- #136 - sphinx-apidoc command not found
- #137 - make command fails when using distclean
2017-09-01 CORE 5.0
* DEVELOPMENT:
- support for editorconfig to help standardize development across IDEs, from the defined configuration file
- support for sonarqube analysis, from the defined configuration file
* DAEMON:
- code cleanup and improvements to adhere to coding standards (SonarQube)
- leverage "logzero" module to make easy usage of the standard logging module
- improvements to documentation across the code base
- initial work to separate the dependence on TCP API messaging from the core library (easier core scripting)
- beta support for running core in Open vSwitch mode, leveraging Open vSwitch bridges, instead of Linux bridges
* SERVICES:
- added Ryu SDN controller service
- added Open vSwitch service
* TEST:
- added unit/integration tests to support validating changes going forward
* BUGFIXES:
- merged pull requests for: #115, #110, #109, #107, #106, #105, #103, #102, #101, #96
2015-06-05 CORE 4.8
* EMANE:
- support for EMANE 0.9.2
- run emane in each container when using EMANE 0.9.2
- support using separate control networks for EMANE OTA and event traffic
* GUI:
- fixed an issue where the adjacency widget lines pointed to old node positions
- fixed an issue where not all EMANE 0.9.x IEEE 802.11 MAC parameter were configurable
- fixed an issue related to running python scripts from the GUI when using tcl/tk version 8.6
- improved batch mode execution to display the check emulation light status
- improved managing multiple sessions
- improved support for using multiple canvases
- added a reload option to the file menu to revert back to a saved scenario
* DAEMON:
- support exporting scenarios in NRL Network Modeling Framework 1.0 XML format
- support importing scenarios in NRL Network Modeling Framework 1.0 XML format
- support exporting the deployed scenario state in NRL NMF XML 1.0 format
- improved EMANE post-startup processing to better synchronize distributed emulations
- improved how addresses are assigned to tun/tap devices
- added support for python state-change callbacks
* SERVICES:
- added mgen sink and mgen actor services
- added oslrv2 and olsr.org services
- added a docker service
* BUILD:
- improved the install/uninstall process
- improved debian and rpm packaging
* BUGFIXES:
- updated the http service for ubuntu 14.04
- improved included examples
- shortened the length of network interface names
- improved how the core system service manages running the core daemon
- fixed an issues related to applying session configuration setting
- improved detecting when a distributed emulation is already running
- improved documentation
2014-08-06 CORE 4.7
* EMANE:
- support for EMANE 0.9.1
- fix error when using Comm Effect model with loss/duplicate string values
- enable flow control in virtual transport if enabled in the MAC model
- fix bug #150 where EMANE event service/address port were not used
* GUI:
- support Tcl/Tk 8.6 when available
- added --(a)ddress and --(p)ort arguments to core-gui command-line
- added File > Execute XML or Python script... option
- added File > Execute Python script with options... menu item
- when executing Python script from GUI, run in background thread, wait for
RUNTIME state
- enter RUNTIME state when start button pressed with empty canvas
- added support for asymmetric link effects
- support link delays up to 274 seconds (netem maximum)
- allow runtime changes of WLAN link effects
* DAEMON:
- set NODE_NAME, NODE_NUMBER, SESSION_SHORT in default vnoded environment
- changed host device naming to use veth, tap prefixes; b.n.SS for bridges
- allow parsing XML files into live running session
- enable link effects between hub/switch and hub/switch connections
- update MDR service to use broadcast interfaces for non-WLAN links
- allow node class to be specified when initializing XML parser
- save and parse canvas origin (reference point) and scale in MP XML
- up/down control script session option
- fix hash calculation used to determine GRE tunnel keys
- use shell script to detach SMF on startup
- added NRL services for mgen sink and nrlolsrv2
- use SDT URL session option
- added core-manage tool for addons to add/remove/check services, models,
and custom node types
* API:
- implement local flag in Execute Message for running host commands
- jitter changed to 64-bit value to align with delay in Link Message
- added unidirectional link flag TLV to Link Message
- added reconfigure event type for re-generating service config files
- return errors in API with failed services
* BUGFIXES:
- fix HTTP service running under Ubuntu
- fixed the following bugs: #150, 169, 188, 220, 225, 230, 231, 242, 244,
247, 248, 250, 251
2013-09-25 CORE 4.6
* NOTE: cored is now core-daemon, and core is now core-gui (for Debian
acceptance)
* NOTE: /etc/init.d/core is now /etc/init.d/core-daemon (for insserv
compatibility)
* EMANE:
- don't start EMANE locally if no local NEMs
- EMANE poststartup() to re-transmit location events during initialization
- added debug port to EMANE options
- added a basic EMANE 802.11 CORE Python script example
- expose transport XML block generation to EmaneModels
- expose NEM entry to the EmaneModel so it can be overridden by a model
- add the control interface bridge prior to starting EMANE, as some models may
- depend on the controlnet functionality
- added EMANE model to CORE converter
- parse lat/long/alt from node messages, for moving nodes using command-line
- fix bug #196 incorrect distance when traversing UTM zones
* GUI:
- added Cut, Copy, and Paste options to the Edit menu
- paste will copy selected services and take care of node and interface
- renumbering
- implement Edit > Find dialog for searching nodes and links
- when copying existing file for a service, perform string replacement of:
- "~", "%SESSION%", "%SESSION_DIR%", "%SESSION_USER%", "%NODE%", "%NODENAME%"
- use CORE_DATA_DIR insteadof LIBDIR
- fix Adjacency Widget to work with OSPFv2 only networks
* BUILD:
- build/packaging improvements for inclusion on Debian
- fix error when running scenario with a mobility script in batch mode
- include Linux kernel patches for 3.8
- renamed core-cleanup.sh to core-cleanup for Debian conformance
- don't always generate man pages from Makefile; new manpages for
coresendmsg and core-daemon
* BUGFIXES:
- don't auto-assign IPv4/IPv6 addresses when none received in Link Messages (session reconnect)
- fixed lock view
- fix GUI spinbox errors for Tk 8.5.8 (RHEL/CentOS 6.2)
- fix broker node count for distributed session entering the RUNTIME state when
- (non-EMANE) WLANs or GreTapBridges are involved;
- fix "file exists" error message when distributed session number is re-used
- and servers file is written
- fix bug #194 configuration dialog too long, make dialog scrollable/resizable
- allow float values for loss and duplicates percent
- fix the following bugs: 166, 172, 177, 178, 192, 194, 196, 201, 202,
205, 206, 210, 212, 213, 214, 221
2013-04-13 CORE 4.5
* GUI:
- improved behavior when starting GUI without daemon, or using File New after connection with daemon is lost
- fix various GUI issues when reconnecting to a session
- support 3D GUI via output to SDT3D
- added "Execute Python script..." entry to the File Menu
- support user-defined terminal program instead of hard-coded xterm
- added session options for "enable RJ45s", "preserve session dir"
- added buttons to the IP Addresses dialog for removing all/selected IPv4/IPv6
- allow sessions with multiple canvases to enter RUNTIME state
- added "--addons" startup mode to pass control to code included from addons dir
- added "Locked" entry to View menu to prevent moving items
- use currently selected node type when invoking a topology generator
- updated throughput plots with resizing, color picker, plot labels, locked scales, and save/load plot configuration with imn file
- improved session dialog
* EMANE:
- EMANE 0.8.1 support with backwards-compatibility for 0.7.4
- extend CommEffect model to generate CommEffect events upon receipt of Link Messages having link effects
* Services:
- updated FTP service with root directory for anonymous users
- added HTTP, PCAP, BIRD, RADVD, and Babel services
- support copying existing files instead of always generating them
- added "Services..." entry to node right-click menu
- added "View" button for side-by-side comparison when copying customized config files
- updated Quagga daemons to wait for zebra.vty VTY file before starting
* General:
- XML import and export
- renamed "cored.py" to "cored", "coresendmsg.py" to "coresendmsg"
- code reorganization and clean-up
- updated XML export to write NetworkPlan, MotionPlan, and ServicePlan within a Scenario tag, added new "Save As XML..." File menu entry
- added script_start/pause/stop options to Ns2ScriptedMobility
- "python" source sub-directory renamed to "daemon"
- added "cored -e" option to execute a Python script, adding its session to the active sessions list, allowing for GUI connection
- support comma-separated list for custom_services_dir in core.conf file
- updated kernel patches for Linux kernel 3.5
- support RFC 6164-style IPv6 /127 addressing
* ns-3:
- integrate ns-3 node location between CORE and ns-3 simulation
- added ns-3 random walk mobility example
- updated ns-3 Wifi example to allow GUI connection and moving of nodes
* fixed the following bugs: 54, 103, 111, 136, 145, 153, 157, 160, 161, 162, 164, 165, 168, 170, 171, 173, 174, 176, 184, 190, 193
2012-09-25 CORE 4.4
* GUI:
- real-time bandwidth plotting tool
- added Wireshark and tshark right-click menu items
- X,Y coordinates shown in the status bar
- updated GUI attribute option to link messages for changing color/width/dash
- added sample IPsec and VPN scenarios, how many nodes script
- added jitter parameter to WLANs
- renamed Experiment menu to Session menu, added session options
- use 'key=value' configuration for services, EMANE models, WLAN models, etc.
- save only service values that have been customized
- copy service parameters from one customized service to another
- right-click menu to start/stop/restart each service
* EMANE:
- EMANE 0.7.4 support
- added support for EMANE CommEffect model and Comm Effect controller GUI
- added support for EMANE Raw Transport when using RJ45 devices
* Services:
- improved service customization; allow a service to define custom Tcl tab
- added vtysh.conf for Quagga service to support 'write mem'
- support scheduled events and services that start N seconds after runtime
- added UCARP service
* Documentation:
- converted the CORE manual to reStructuredText using Sphinx; added Python docs
* General:
- Python code reorganization
- improved cored.py thread locking
- merged xen branch into trunk
- added an event queue to a session with notion of time zero
- added UDP support to cored.py
- use UDP by default in coresendmsg.py; added '-H' option to print examples
- enter a bash shell by default when running vcmd with no arguments
- fixes to distributed emulation entering runtime state
- write 'nodes' file upon session startup
- make session number and other attributes available in environment
- support /etc/core/environment and ~/.core/environment files
- added Ns2ScriptedMobility model to Python, removed from the GUI
- namespace nodes mount a private /sys
- fixed the following bugs: 80, 81, 84, 99, 104, 109, 110, 122, 124, 131, 133, 134, 135, 137, 140, 143, 144, 146, 147, 151, 154, 155
2012-03-07 CORE 4.3
* EMANE 0.7.2 and 0.7.3 support
* hook scripts: customize actions at any of six different session states
* Check Emulation Light (CEL) exception feedback system
* added FTP and XORP services, and service validate commands
* services can flag when customization is required
* Python classes to support ns-3 simulation experiments
* write state, node X,Y position, and servers to pycore session dir
* removed over 9,000 lines of unused GUI code
* performance monitoring script
* batch mode improvements and --closebatch option
* export session to EmulationScript XML files
* basic range model moved from GUI to Python, supports 3D coordinates
* improved WLAN dialog with tabs
* added PhysicalNode class for joining real nodes with emulated networks
* fixed the following bugs: 50, 75, 76, 79, 82, 83, 85, 86, 89, 90, 92, 94, 96, 98, 100, 112, 113, 116, 119, 120
2011-08-19 CORE 4.2
* EMANE 0.7.1 support
- support for Bypass model, Universal PHY, logging, realtime
* configurable MAC addresses
* control interfaces (backchannel between node and host)
* service customization dialog improved (tabbed)
* new testing scripts for MDR and EMANE performance testing
* improved upgrading of old imn files
* new coresendmsg.py utility (deprecates libcoreapi and coreapisend)
* new security services, custom service becomes UserDefined
* new services and Python scripting chapters in manual
* fixes to distributed emulation, linking tunnels/RJ45s with WLANs/hubs/switches
* fixed the following bugs: 18, 32, 34, 38, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 52, 53, 55, 57, 58, 60, 62, 64, 65, 66, 68, 71, 72, 74
2011-01-05 CORE 4.1
* new icons for toolbars and nodes
* node services introduced, node models deprecated
* customizable node types
* traffic flow editor with MGEN support
* user configs moved from /etc/core/`*` to ~/.core/
* allocate addresses from custom IPv4/IPv6 prefixes
* distributed emulation using GRE tunnels
* FreeBSD 8.1 now uses cored.py
* EMANE 0.6.4 support
* numerous bugfixes
2010-08-17 CORE 4.0
* Python framework with Linux network namespace (netns) support (Linux netns is now the primary supported platform)
* ability to close the GUI and later reconnect to a running session (netns only)
* EMANE integration (netns only)
* new topology generators, host file generator
* user-editable Observer Widgets
* use of /etc/core instead of /usr/local/etc/core
* various bugfixes
2009-09-15 CORE 3.5
2009-06-23 CORE 3.4
2009-03-11 CORE 3.3

126
Dockerfile Normal file
View file

@ -0,0 +1,126 @@
# syntax=docker/dockerfile:1
FROM ubuntu:22.04
LABEL Description="CORE Docker Ubuntu Image"
ARG PREFIX=/usr/local
ARG BRANCH=master
ARG PROTOC_VERSION=3.19.6
ARG VENV_PATH=/opt/core/venv
ENV DEBIAN_FRONTEND=noninteractive
ENV PATH="$PATH:${VENV_PATH}/bin"
WORKDIR /opt
# install system dependencies
RUN apt-get update -y && \
apt-get install -y software-properties-common
RUN add-apt-repository "deb http://archive.ubuntu.com/ubuntu jammy universe"
RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
automake \
bash \
ca-certificates \
ethtool \
gawk \
gcc \
g++ \
iproute2 \
iputils-ping \
libc-dev \
libev-dev \
libreadline-dev \
libtool \
nftables \
python3 \
python3-pip \
python3-tk \
pkg-config \
tk \
xauth \
xterm \
wireshark \
vim \
build-essential \
nano \
firefox \
net-tools \
rsync \
openssh-server \
openssh-client \
vsftpd \
atftpd \
atftp \
mini-httpd \
lynx \
tcpdump \
iperf \
iperf3 \
tshark \
openssh-sftp-server \
bind9 \
bind9-utils \
openvpn \
isc-dhcp-server \
isc-dhcp-client \
whois \
ipcalc \
socat \
hping3 \
libgtk-3-0 \
librest-0.7-0 \
libgtk-3-common \
dconf-gsettings-backend \
libsoup-gnome2.4-1 \
libsoup2.4-1 \
dconf-service \
x11-xserver-utils \
ftp \
git \
sudo \
wget \
tzdata \
libpcap-dev \
libpcre3-dev \
libprotobuf-dev \
libxml2-dev \
protobuf-compiler \
unzip \
uuid-dev \
iproute2 \
vlc \
iputils-ping && \
apt-get autoremove -y
# install core
RUN git clone https://github.com/coreemu/core && \
cd core && \
git checkout ${BRANCH} && \
./setup.sh && \
PATH=/root/.local/bin:$PATH inv install -v -p ${PREFIX} && \
cd /opt && \
rm -rf ospf-mdr
# install emane
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip && \
mkdir protoc && \
unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d protoc && \
git clone https://github.com/adjacentlink/emane.git && \
cd emane && \
./autogen.sh && \
./configure --prefix=/usr && \
make -j$(nproc) && \
make install && \
cd src/python && \
make clean && \
PATH=/opt/protoc/bin:$PATH make && \
${VENV_PATH}/bin/python -m pip install . && \
cd /opt && \
rm -rf protoc && \
rm -rf emane && \
rm -f protoc-${PROTOC_VERSION}-linux-x86_64.zip
WORKDIR /root
CMD /opt/core/venv/bin/core-daemon

20
Jenkinsfile vendored
View file

@ -1,20 +0,0 @@
pipeline {
agent any
stages {
stage('build core') {
steps {
sh './bootstrap.sh'
sh './configure'
sh 'make'
sh 'sudo make install'
}
}
stage('test core') {
steps {
sh 'pytest daemon/tests/test_core.py'
sh 'pytest daemon/tests/test_gui.py'
sh 'pytest daemon/tests/test_emane.py'
}
}
}
}

View file

@ -6,29 +6,26 @@ if WANT_DOCS
DOCS = docs man DOCS = docs man
endif endif
if WANT_GUI
GUI = gui
endif
if WANT_DAEMON if WANT_DAEMON
DAEMON = scripts daemon DAEMON = daemon
endif endif
if WANT_NETNS if WANT_NETNS
NETNS = netns ns3 NETNS = netns
endif endif
# keep docs last due to dependencies on binaries # keep docs last due to dependencies on binaries
SUBDIRS = $(GUI) $(DAEMON) $(NETNS) $(DOCS) SUBDIRS = $(DAEMON) $(NETNS) $(DOCS)
ACLOCAL_AMFLAGS = -I config ACLOCAL_AMFLAGS = -I config
# extra files to include with distribution tarball # extra files to include with distribution tarball
EXTRA_DIST = bootstrap.sh \ EXTRA_DIST = bootstrap.sh \
package \
LICENSE \ LICENSE \
README.md \ README.md \
ASSIGNMENT_OF_COPYRIGHT.pdf \ ASSIGNMENT_OF_COPYRIGHT.pdf \
Changelog \ CHANGELOG.md \
.version \ .version \
.version.date .version.date
@ -44,80 +41,117 @@ DISTCLEANFILES = aclocal.m4 \
MAINTAINERCLEANFILES = .version \ MAINTAINERCLEANFILES = .version \
.version.date .version.date
define fpm-python = define fpm-distributed-deb =
fpm -s python -t $1 \ fpm -s dir -t deb -n core-distributed \
-m "$(PACKAGE_MAINTAINERS)" \
--vendor "$(PACKAGE_VENDOR)" \
$2
endef
define fpm-gui =
fpm -s dir -t $1 -n core-gui \
-m "$(PACKAGE_MAINTAINERS)" \ -m "$(PACKAGE_MAINTAINERS)" \
--license "BSD" \ --license "BSD" \
--description "Common Open Research Emulator GUI front-end" \ --description "Common Open Research Emulator Distributed Package" \
--url https://github.com/coreemu/core \ --url https://github.com/coreemu/core \
--vendor "$(PACKAGE_VENDOR)" \ --vendor "$(PACKAGE_VENDOR)" \
-p core-gui_VERSION_ARCH.$1 \ -p core-distributed_VERSION_ARCH.deb \
-v $(PACKAGE_VERSION) \ -v $(PACKAGE_VERSION) \
-d "bash" \ -d "ethtool" \
-d "tcl" \ -d "procps" \
-d "tk" \ -d "libc6 >= 2.14" \
$2 \ -d "bash >= 3.0" \
-C $(DESTDIR) -d "nftables" \
-d "iproute2" \
-d "libev4" \
-d "openssh-server" \
-d "xterm" \
netns/vnoded=/usr/bin/ \
netns/vcmd=/usr/bin/
endef endef
define fpm-daemon-rpm = define fpm-distributed-rpm =
fpm -s python -t rpm \ fpm -s dir -t rpm -n core-distributed \
-p NAME_sysv_VERSION_ARCH.rpm \
--rpm-init scripts/core-daemon \
--python-install-bin $(bindir) \
--python-install-data $(prefix) \
--python-install-lib $(pythondir) \
-m "$(PACKAGE_MAINTAINERS)" \ -m "$(PACKAGE_MAINTAINERS)" \
--license "BSD" \
--description "Common Open Research Emulator Distributed Package" \
--url https://github.com/coreemu/core \
--vendor "$(PACKAGE_VENDOR)" \ --vendor "$(PACKAGE_VENDOR)" \
-p core-distributed_VERSION_ARCH.rpm \
-v $(PACKAGE_VERSION) \
-d "ethtool" \
-d "procps-ng" \
-d "bash >= 3.0" \
-d "nftables" \
-d "iproute" \
-d "libev" \
-d "net-tools" \
-d "openssh-server" \
-d "xterm" \
netns/vnoded=/usr/bin/ \
netns/vcmd=/usr/bin/
endef
define fpm-rpm =
fpm -s dir -t rpm -n core \
-m "$(PACKAGE_MAINTAINERS)" \
--license "BSD" \
--description "core vnoded/vcmd and system dependencies" \
--url https://github.com/coreemu/core \
--vendor "$(PACKAGE_VENDOR)" \
-p core_VERSION_ARCH.rpm \
-v $(PACKAGE_VERSION) \
--rpm-init package/core-daemon \
--after-install package/after-install.sh \
--after-remove package/after-remove.sh \
-d "ethtool" \
-d "tk" \
-d "procps-ng" \ -d "procps-ng" \
-d "bash >= 3.0" \ -d "bash >= 3.0" \
-d "bridge-utils" \
-d "ebtables" \ -d "ebtables" \
-d "iproute" \ -d "iproute" \
-d "libev" \ -d "libev" \
-d "net-tools" \ -d "net-tools" \
-d "python >= 2.7, python < 3.0" \ -d "nftables" \
netns/setup.py daemon/setup.py netns/vnoded=/usr/bin/ \
netns/vcmd=/usr/bin/ \
package/etc/core.conf=/etc/core/ \
package/etc/logging.conf=/etc/core/ \
package/examples=/opt/core/ \
daemon/dist/core-$(PACKAGE_VERSION)-py3-none-any.whl=/opt/core/
endef endef
define fpm-daemon-deb = define fpm-deb =
fpm -s python -t deb \ fpm -s dir -t deb -n core \
-p NAME_$1_VERSION_ARCH.deb \
--python-install-bin $(bindir) \
--python-install-data $(prefix) \
--python-install-lib $(pythondir) \
$2 $3 \
-m "$(PACKAGE_MAINTAINERS)" \ -m "$(PACKAGE_MAINTAINERS)" \
--license "BSD" \
--description "core vnoded/vcmd and system dependencies" \
--url https://github.com/coreemu/core \
--vendor "$(PACKAGE_VENDOR)" \ --vendor "$(PACKAGE_VENDOR)" \
-p core_VERSION_ARCH.deb \
-v $(PACKAGE_VERSION) \
--deb-systemd package/core-daemon.service \
--deb-no-default-config-files \
--after-install package/after-install.sh \
--after-remove package/after-remove.sh \
-d "ethtool" \
-d "tk" \
-d "libtk-img" \
-d "procps" \ -d "procps" \
-d "libc6 >= 2.14" \ -d "libc6 >= 2.14" \
-d "bash >= 3.0" \ -d "bash >= 3.0" \
-d "bridge-utils" \
-d "ebtables" \ -d "ebtables" \
-d "iproute2" \ -d "iproute2" \
-d "libev4" \ -d "libev4" \
-d "python (>= 2.7), python (<< 3.0)" \ -d "nftables" \
--deb-recommends quagga \ netns/vnoded=/usr/bin/ \
netns/setup.py daemon/setup.py netns/vcmd=/usr/bin/ \
package/etc/core.conf=/etc/core/ \
package/etc/logging.conf=/etc/core/ \
package/examples=/opt/core/ \
daemon/dist/core-$(PACKAGE_VERSION)-py3-none-any.whl=/opt/core/
endef endef
.PHONY: fpm .PHONY: fpm
fpm: clean-local-fpm fpm: clean-local-fpm
$(MAKE) -C gui install DESTDIR=$(DESTDIR) cd daemon && poetry build -f wheel
$(call fpm-gui,rpm) $(call fpm-deb)
$(call fpm-gui,deb,-d "libtk-img") $(call fpm-rpm)
$(call fpm-python,rpm,ns3/setup.py) $(call fpm-distributed-deb)
$(call fpm-python,deb,ns3/setup.py) $(call fpm-distributed-rpm)
$(call fpm-daemon-rpm)
$(call fpm-daemon-deb,sysv,--deb-init,scripts/core-daemon)
$(call fpm-daemon-deb,systemd,--deb-systemd,scripts/core-daemon.service)
.PHONY: clean-local-fpm .PHONY: clean-local-fpm
clean-local-fpm: clean-local-fpm:
@ -136,24 +170,12 @@ define change-files =
$(info creating file $1 from $1.in) $(info creating file $1 from $1.in)
@$(SED) -e 's,[@]sbindir[@],$(sbindir),g' \ @$(SED) -e 's,[@]sbindir[@],$(sbindir),g' \
-e 's,[@]bindir[@],$(bindir),g' \ -e 's,[@]bindir[@],$(bindir),g' \
-e 's,[@]pythondir[@],$(pythondir),g' \
-e 's,[@]PYTHON[@],$(PYTHON),g' \
-e 's,[@]PACKAGE_VERSION[@],$(PACKAGE_VERSION),g' \ -e 's,[@]PACKAGE_VERSION[@],$(PACKAGE_VERSION),g' \
-e 's,[@]PACKAGE_DATE[@],$(PACKAGE_DATE),g' \ -e 's,[@]PACKAGE_DATE[@],$(PACKAGE_DATE),g' \
-e 's,[@]CORE_LIB_DIR[@],$(CORE_LIB_DIR),g' \ -e 's,[@]CORE_LIB_DIR[@],$(CORE_LIB_DIR),g' \
-e 's,[@]CORE_STATE_DIR[@],$(CORE_STATE_DIR),g' \ -e 's,[@]CORE_STATE_DIR[@],$(CORE_STATE_DIR),g' \
-e 's,[@]CORE_DATA_DIR[@],$(CORE_DATA_DIR),g' \ -e 's,[@]CORE_DATA_DIR[@],$(CORE_DATA_DIR),g' \
-e 's,[@]CORE_CONF_DIR[@],$(CORE_CONF_DIR),g' \ -e 's,[@]CORE_CONF_DIR[@],$(CORE_CONF_DIR),g' \
-e 's,[@]CORE_GUI_CONF_DIR[@],$(CORE_GUI_CONF_DIR),g' \
-e 's,[@]brctl_path[@],$(brctl_path),g' \
-e 's,[@]sysctl_path[@],$(sysctl_path),g' \
-e 's,[@]ip_path[@],$(ip_path),g' \
-e 's,[@]tc_path[@],$(tc_path),g' \
-e 's,[@]ebtables_path[@],$(ebtables_path),g' \
-e 's,[@]mount_path[@],$(mount_path),g' \
-e 's,[@]umount_path[@],$(umount_path),g' \
-e 's,[@]ovs_vs_path[@],$(ovs_vs_path),g' \
-e 's,[@]ovs_of_path[@],$(ovs_of_path),g' \
< $1.in > $1 < $1.in > $1
endef endef
@ -161,13 +183,8 @@ all: change-files
.PHONY: change-files .PHONY: change-files
change-files: change-files:
$(call change-files,gui/core-gui)
$(call change-files,scripts/core-daemon.service)
$(call change-files,scripts/core-daemon)
$(call change-files,daemon/core/constants.py) $(call change-files,daemon/core/constants.py)
$(call change-files,ns3/setup.py)
$(call change-files,netns/setup.py) $(call change-files,netns/setup.py)
$(call change-files,daemon/setup.py)
CORE_DOC_SRC = core-python-$(PACKAGE_VERSION) CORE_DOC_SRC = core-python-$(PACKAGE_VERSION)
.PHONY: doc .PHONY: doc

118
README.md
View file

@ -1,41 +1,107 @@
# CORE [![Codacy Badge](https://api.codacy.com/project/badge/Grade/d94eb0244ade4510a106b4af76077a92)](https://www.codacy.com/app/blakeharnden/core?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=coreemu/core&amp;utm_campaign=Badge_Grade) # Index
- CORE
- Docker Setup
- Precompiled container image
- Build container image from source
- Adding extra packages
- Useful commands
- License
# CORE
CORE: Common Open Research Emulator CORE: Common Open Research Emulator
Copyright (c)2005-2018 the Boeing Company. Copyright (c)2005-2022 the Boeing Company.
See the LICENSE file included in this distribution. See the LICENSE file included in this distribution.
## About # Docker Setup
The Common Open Research Emulator (CORE) is a tool for emulating Here you have 2 choices
networks on one or more machines. You can connect these emulated
networks to live networks. CORE consists of a GUI for drawing
topologies of lightweight virtual machines, and Python modules for
scripting network emulation.
## Documentation and Examples ## Precompiled container image
* Documentation hosted on GitHub ```bash
* <http://coreemu.github.io/core/>
* Basic Script Examples
* [Examples](daemon/examples/api)
* Custom Service Example
* [sample.py](daemon/examples/myservices/sample.py)
* Custom Emane Model Example
* [examplemodel.py](daemon/examples/myemane/examplemodel.py)
## Support # Start container
sudo docker run -itd --name core -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:rw --privileged --restart unless-stopped git.olympuslab.net/afonso/core-extra:latest
We are leveraging Discord for persistent chat rooms, voice chat, and ```
GitHub integration. This allows for more dynamic conversations and the ## Build container image from source
capability to respond faster. Feel free to join us at the link below.
<https://discord.gg/AKd7kmP>
## Building CORE ```bash
# Clone the repo
git clone https://gitea.olympuslab.net/afonso/core-extra.git
See [CORE Installation](http://coreemu.github.io/core/install.html) for detailed build instructions. # cd into the directory
cd core-extra
### Running CORE # build the docker image
sudo docker build -t core-extra .
See [Using the CORE GUI](http://coreemu.github.io/core/usage.html) for more details on running CORE. # start container
sudo docker run -itd --name core -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:rw --privileged --restart unless-stopped core-extra
```
### Adding extra packages
To add extra packages you must modify the Dockerfile and then compile the docker image.
If you install it after starting the container it will, by docker nature, be reverted on the next boot of the container.
# Useful commands
I have the following functions on my fish shell
to help me better use core
THIS ONLY WORKS ON FISH, MODIFY FOR BASH OR ZSH
```fish
# RUN CORE GUI
function core
xhost +local:root
sudo docker exec -it core core-gui
end
# RUN BASH INSIDE THE CONTAINER
function core-bash
sudo docker exec -it core /bin/bash
end
# LAUNCH NODE BASH ON THE HOST MACHINE
function launch-term --argument nodename
sudo docker exec -it core xterm -bg black -fg white -fa 'DejaVu Sans Mono' -fs 16 -e vcmd -c /tmp/pycore.1/$nodename -- /bin/bash
end
#TO RUN ANY OTHER COMMAND
sudo docker exec -it core COMAND_GOES_HERE
```
## LICENSE
Copyright (c) 2005-2018, the Boeing Company.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.

View file

@ -1,9 +1,5 @@
#!/bin/sh #!/bin/sh
# #
# (c)2010-2012 the Boeing Company
#
# author: Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com>
#
# Bootstrap the autoconf system. # Bootstrap the autoconf system.
# #

View file

@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
# this defines the CORE version number, must be static for AC_INIT # this defines the CORE version number, must be static for AC_INIT
AC_INIT(core, 5.2.1, core-dev@nrl.navy.mil) AC_INIT(core, 9.0.3)
# autoconf and automake initialization # autoconf and automake initialization
AC_CONFIG_SRCDIR([netns/version.h.in]) AC_CONFIG_SRCDIR([netns/version.h.in])
@ -14,7 +14,7 @@ AM_INIT_AUTOMAKE([tar-ustar])
# define variables used for packaging and date display # define variables used for packaging and date display
PACKAGE_DATE=m4_esyscmd_s([date +%Y%m%d]) PACKAGE_DATE=m4_esyscmd_s([date +%Y%m%d])
PACKAGE_VENDOR="CORE Developers" PACKAGE_VENDOR="CORE Developers"
PACKAGE_MAINTAINERS="$PACKAGE_VENDOR <$PACKAGE_BUGREPORT>" PACKAGE_MAINTAINERS="$PACKAGE_VENDOR"
# core specific variables # core specific variables
CORE_LIB_DIR="\${prefix}/lib/core" CORE_LIB_DIR="\${prefix}/lib/core"
@ -30,20 +30,14 @@ AC_SUBST(CORE_CONF_DIR)
AC_SUBST(CORE_DATA_DIR) AC_SUBST(CORE_DATA_DIR)
AC_SUBST(CORE_STATE_DIR) AC_SUBST(CORE_STATE_DIR)
# CORE GUI configuration files and preferences in CORE_GUI_CONF_DIR # documentation option
# scenario files in ~/.core/configs/ AC_ARG_ENABLE([docs],
AC_ARG_WITH([guiconfdir], [AS_HELP_STRING([--enable-docs[=ARG]],
[AS_HELP_STRING([--with-guiconfdir=dir], [build python documentation (default is no)])],
[specify GUI configuration directory])], [], [enable_docs=no])
[CORE_GUI_CONF_DIR="$with_guiconfdir"], AC_SUBST(enable_docs)
[CORE_GUI_CONF_DIR="\$\${HOME}/.core"])
AC_SUBST(CORE_GUI_CONF_DIR)
AC_ARG_ENABLE([gui],
[AS_HELP_STRING([--enable-gui[=ARG]],
[build and install the GUI (default is yes)])],
[], [enable_gui=yes])
AC_SUBST(enable_gui)
# python option
AC_ARG_ENABLE([python], AC_ARG_ENABLE([python],
[AS_HELP_STRING([--enable-python[=ARG]], [AS_HELP_STRING([--enable-python[=ARG]],
[build and install the python bindings (default is yes)])], [build and install the python bindings (default is yes)])],
@ -54,6 +48,7 @@ if test "x$enable_python" = "xyes" ; then
else else
want_python=no want_python=no
fi fi
AC_ARG_ENABLE([daemon], AC_ARG_ENABLE([daemon],
[AS_HELP_STRING([--enable-daemon[=ARG]], [AS_HELP_STRING([--enable-daemon[=ARG]],
[build and install the daemon with Python modules [build and install the daemon with Python modules
@ -88,8 +83,62 @@ if test "x$enable_daemon" = "xyes"; then
want_python=yes want_python=yes
want_linux_netns=yes want_linux_netns=yes
# Checks for libraries. AM_PATH_PYTHON(3.9)
AC_CHECK_LIB([netgraph], [NgMkSockNode]) AS_IF([$PYTHON -m grpc_tools.protoc -h &> /dev/null], [], [AC_MSG_ERROR([please install python grpcio-tools])])
AC_CHECK_PROG(sysctl_path, sysctl, $as_dir, no, $SEARCHPATH)
if test "x$sysctl_path" = "xno" ; then
AC_MSG_ERROR([Could not locate sysctl (from procps package).])
fi
AC_CHECK_PROG(nftables_path, nft, $as_dir, no, $SEARCHPATH)
if test "x$nftables_path" = "xno" ; then
AC_MSG_ERROR([Could not locate nftables (from nftables package).])
fi
AC_CHECK_PROG(ip_path, ip, $as_dir, no, $SEARCHPATH)
if test "x$ip_path" = "xno" ; then
AC_MSG_ERROR([Could not locate ip (from iproute package).])
fi
AC_CHECK_PROG(tc_path, tc, $as_dir, no, $SEARCHPATH)
if test "x$tc_path" = "xno" ; then
AC_MSG_ERROR([Could not locate tc (from iproute package).])
fi
AC_CHECK_PROG(ethtool_path, ethtool, $as_dir, no, $SEARCHPATH)
if test "x$ethtool_path" = "xno" ; then
AC_MSG_ERROR([Could not locate ethtool (from package ethtool)])
fi
AC_CHECK_PROG(mount_path, mount, $as_dir, no, $SEARCHPATH)
if test "x$mount_path" = "xno" ; then
AC_MSG_ERROR([Could not locate mount (from package mount)])
fi
AC_CHECK_PROG(umount_path, umount, $as_dir, no, $SEARCHPATH)
if test "x$umount_path" = "xno" ; then
AC_MSG_ERROR([Could not locate umount (from package mount)])
fi
AC_CHECK_PROG(convert, convert, yes, no, $SEARCHPATH)
if test "x$convert" = "xno" ; then
AC_MSG_WARN([Could not locate ImageMagick convert.])
fi
AC_CHECK_PROG(ovs_vs_path, ovs-vsctl, $as_dir, no, $SEARCHPATH)
if test "x$ovs_vs_path" = "xno" ; then
AC_MSG_WARN([Could not locate ovs-vsctl cannot use OVS mode])
fi
AC_CHECK_PROG(ovs_of_path, ovs-ofctl, $as_dir, no, $SEARCHPATH)
if test "x$ovs_of_path" = "xno" ; then
AC_MSG_WARN([Could not locate ovs-ofctl cannot use OVS mode])
fi
fi
if [ test "x$enable_daemon" = "xyes" || test "x$enable_vnodedonly" = "xyes" ] ; then
want_linux_netns=yes
# Checks for header files. # Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h stdint.h stdlib.h string.h sys/ioctl.h sys/mount.h sys/socket.h sys/time.h termios.h unistd.h]) AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h stdint.h stdlib.h string.h sys/ioctl.h sys/mount.h sys/socket.h sys/time.h termios.h unistd.h])
@ -109,54 +158,6 @@ if test "x$enable_daemon" = "xyes"; then
AC_FUNC_REALLOC AC_FUNC_REALLOC
AC_CHECK_FUNCS([atexit dup2 gettimeofday memset socket strerror uname]) AC_CHECK_FUNCS([atexit dup2 gettimeofday memset socket strerror uname])
AM_PATH_PYTHON(2.7)
AC_CHECK_PROG(brctl_path, brctl, $as_dir, no, $SEARCHPATH)
if test "x$brctl_path" = "xno" ; then
AC_MSG_ERROR([Could not locate brctl (from bridge-utils package).])
fi
AC_CHECK_PROG(sysctl_path, sysctl, $as_dir, no, $SEARCHPATH)
AC_CHECK_PROG(ebtables_path, ebtables, $as_dir, no, $SEARCHPATH)
if test "x$ebtables_path" = "xno" ; then
AC_MSG_ERROR([Could not locate ebtables (from ebtables package).])
fi
AC_CHECK_PROG(ip_path, ip, $as_dir, no, $SEARCHPATH)
if test "x$ip_path" = "xno" ; then
AC_MSG_ERROR([Could not locate ip (from iproute package).])
fi
AC_CHECK_PROG(tc_path, tc, $as_dir, no, $SEARCHPATH)
if test "x$tc_path" = "xno" ; then
AC_MSG_ERROR([Could not locate tc (from iproute package).])
fi
AC_CHECK_PROG(mount_path, mount, $as_dir, no, $SEARCHPATH)
AC_CHECK_PROG(umount_path, umount, $as_dir, no, $SEARCHPATH)
AC_CHECK_PROG(convert, convert, yes, no, $SEARCHPATH)
if test "x$convert" = "xno" ; then
AC_MSG_WARN([Could not locate ImageMagick convert.])
fi
AC_CHECK_PROG(ovs_vs_path, ovs-vsctl, $as_dir, no, $SEARCHPATH)
if test "x$ovs_vs_path" = "xno" ; then
AC_MSG_WARN([Could not locate ovs-vsctl cannot use OVS nodes])
fi
AC_CHECK_PROG(ovs_of_path, ovs-ofctl, $as_dir, no, $SEARCHPATH)
if test "x$ovs_of_path" = "xno" ; then
AC_MSG_WARN([Could not locate ovs-ofctl cannot use OVS nodes])
fi
CFLAGS_save=$CFLAGS
CPPFLAGS_save=$CPPFLAGS
if test "x$PYTHON_INCLUDE_DIR" = "x"; then
PYTHON_INCLUDE_DIR=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_python_inc()"`
fi
CFLAGS="-I$PYTHON_INCLUDE_DIR"
CPPFLAGS="-I$PYTHON_INCLUDE_DIR"
AC_CHECK_HEADERS([Python.h], [],
AC_MSG_ERROR([Python bindings require Python development headers (try installing your 'python-devel' or 'python-dev' package)]))
CFLAGS=$CFLAGS_save
CPPFLAGS=$CPPFLAGS_save
fi
if [ test "x$enable_daemon" = "xyes" || test "x$enable_vnodedonly" = "xyes" ] ; then
want_linux_netns=yes
PKG_CHECK_MODULES(libev, libev, PKG_CHECK_MODULES(libev, libev,
AC_MSG_RESULT([found libev using pkgconfig OK]) AC_MSG_RESULT([found libev using pkgconfig OK])
AC_SUBST(libev_CFLAGS) AC_SUBST(libev_CFLAGS)
@ -170,8 +171,7 @@ if [ test "x$enable_daemon" = "xyes" || test "x$enable_vnodedonly" = "xyes" ] ;
fi fi
want_docs=no want_docs=no
if test "x$enable_docs" = "xyes" ; then if [test "x$want_python" = "xyes" && test "x$enable_docs" = "xyes"] ; then
AC_CHECK_PROG(help2man, help2man, yes, no, $SEARCHPATH) AC_CHECK_PROG(help2man, help2man, yes, no, $SEARCHPATH)
if test "x$help2man" = "xno" ; then if test "x$help2man" = "xno" ; then
@ -189,37 +189,17 @@ if test "x$enable_docs" = "xyes" ; then
# check for sphinx required during make # check for sphinx required during make
AC_CHECK_PROG(sphinxapi_path, sphinx-apidoc, $as_dir, no, $SEARCHPATH) AC_CHECK_PROG(sphinxapi_path, sphinx-apidoc, $as_dir, no, $SEARCHPATH)
if test "x$sphinxapi_path" = "xno" ; then if test "x$sphinxapi_path" = "xno" ; then
AC_MSG_ERROR(["Could not location sphinx-apidoc, from the python-sphinx package"]) AC_MSG_ERROR(["Could not locate sphinx-apidoc, install python3 -m pip install sphinx"])
want_docs=no want_docs=no
fi fi
AS_IF([$PYTHON -c "import sphinx_rtd_theme" &> /dev/null], [], [AC_MSG_ERROR([doc dependency missing, please install python3 -m pip install sphinx-rtd-theme])])
fi fi
#AC_PATH_PROGS(tcl_path, [tclsh tclsh8.5 tclsh8.4], no)
#if test "x$tcl_path" = "xno" ; then
# AC_MSG_ERROR([Could not locate tclsh. Please install Tcl/Tk.])
#fi
#AC_PATH_PROGS(wish_path, [wish wish8.5 wish8.4], no)
#if test "x$wish_path" = "xno" ; then
# AC_MSG_ERROR([Could not locate wish. Please install Tcl/Tk.])
#fi
AC_ARG_WITH([startup],
[AS_HELP_STRING([--with-startup=option],
[option=systemd,suse,none to install systemd/SUSE init scripts])],
[with_startup=$with_startup],
[with_startup=initd])
AC_SUBST(with_startup)
AC_MSG_RESULT([using startup option $with_startup])
# Variable substitutions # Variable substitutions
AM_CONDITIONAL(WANT_GUI, test x$enable_gui = xyes)
AM_CONDITIONAL(WANT_DAEMON, test x$enable_daemon = xyes) AM_CONDITIONAL(WANT_DAEMON, test x$enable_daemon = xyes)
AM_CONDITIONAL(WANT_DOCS, test x$want_docs = xyes) AM_CONDITIONAL(WANT_DOCS, test x$want_docs = xyes)
AM_CONDITIONAL(WANT_PYTHON, test x$want_python = xyes) AM_CONDITIONAL(WANT_PYTHON, test x$want_python = xyes)
AM_CONDITIONAL(WANT_NETNS, test x$want_linux_netns = xyes) AM_CONDITIONAL(WANT_NETNS, test x$want_linux_netns = xyes)
AM_CONDITIONAL(WANT_INITD, test x$with_startup = xinitd)
AM_CONDITIONAL(WANT_SYSTEMD, test x$with_startup = xsystemd)
AM_CONDITIONAL(WANT_VNODEDONLY, test x$enable_vnodedonly = xyes) AM_CONDITIONAL(WANT_VNODEDONLY, test x$enable_vnodedonly = xyes)
if test $cross_compiling = no; then if test $cross_compiling = no; then
@ -230,11 +210,6 @@ fi
# Output files # Output files
AC_CONFIG_FILES([Makefile AC_CONFIG_FILES([Makefile
gui/version.tcl
gui/Makefile
gui/icons/Makefile
scripts/Makefile
scripts/perf/Makefile
man/Makefile man/Makefile
docs/Makefile docs/Makefile
daemon/Makefile daemon/Makefile
@ -242,8 +217,7 @@ AC_CONFIG_FILES([Makefile
daemon/doc/conf.py daemon/doc/conf.py
daemon/proto/Makefile daemon/proto/Makefile
netns/Makefile netns/Makefile
netns/version.h netns/version.h],)
ns3/Makefile],)
AC_OUTPUT AC_OUTPUT
# Summary text # Summary text
@ -257,20 +231,12 @@ Build:
Prefix: ${prefix} Prefix: ${prefix}
Exec Prefix: ${exec_prefix} Exec Prefix: ${exec_prefix}
GUI:
GUI path: ${CORE_LIB_DIR}
GUI config: ${CORE_GUI_CONF_DIR}
Daemon: Daemon:
Daemon path: ${bindir} Daemon path: ${bindir}
Daemon config: ${CORE_CONF_DIR} Daemon config: ${CORE_CONF_DIR}
Python modules: ${pythondir} Python: ${PYTHON}
Logs: ${CORE_STATE_DIR}/log
Startup: ${with_startup}
Features to build: Features to build:
Build GUI: ${enable_gui}
Build Daemon: ${enable_daemon} Build Daemon: ${enable_daemon}
Documentation: ${want_docs} Documentation: ${want_docs}

2
daemon/.gitignore vendored
View file

@ -1,2 +0,0 @@
*.pyc
build

View file

@ -0,0 +1,23 @@
repos:
- repo: local
hooks:
- id: isort
name: isort
stages: [commit]
language: system
entry: bash -c 'cd daemon && poetry run isort --atomic -y'
types: [python]
- id: black
name: black
stages: [commit]
language: system
entry: bash -c 'cd daemon && poetry run black .'
types: [python]
- id: flake8
name: flake8
stages: [commit]
language: system
entry: bash -c 'cd daemon && poetry run flake8'
types: [python]

View file

@ -1,50 +1,14 @@
# CORE # CORE
# (c)2010-2012 the Boeing Company.
# See the LICENSE file included in this distribution.
#
# author: Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com>
# #
# Makefile for building netns components. # Makefile for building netns components.
# #
SETUPPY = setup.py
SETUPPYFLAGS = -v
if WANT_DOCS if WANT_DOCS
DOCS = doc DOCS = doc
endif endif
SUBDIRS = proto $(DOCS) SUBDIRS = proto $(DOCS)
SCRIPT_FILES := $(notdir $(wildcard scripts/*))
MAN_FILES := $(notdir $(wildcard ../man/*.1))
# Python package build
noinst_SCRIPTS = build
build:
$(PYTHON) $(SETUPPY) $(SETUPPYFLAGS) build
# Python package install
install-exec-hook:
$(PYTHON) $(SETUPPY) $(SETUPPYFLAGS) install \
--root=/$(DESTDIR) \
--prefix=$(prefix) \
--install-lib=$(pythondir) \
--single-version-externally-managed
# Python package uninstall
uninstall-hook:
rm -rf $(DESTDIR)/etc/core
rm -rf $(DESTDIR)/$(datadir)/core
rm -f $(addprefix $(DESTDIR)/$(datarootdir)/man/man1/, $(MAN_FILES))
rm -f $(addprefix $(DESTDIR)/$(bindir)/,$(SCRIPT_FILES))
rm -rf $(DESTDIR)/$(pythondir)/core-$(PACKAGE_VERSION)-py$(PYTHON_VERSION).egg-info
rm -rf $(DESTDIR)/$(pythondir)/core
# Python package cleanup
clean-local:
-rm -rf build
# because we include entire directories with EXTRA_DIST, we need to clean up # because we include entire directories with EXTRA_DIST, we need to clean up
# the source control files # the source control files
dist-hook: dist-hook:
@ -53,17 +17,12 @@ dist-hook:
distclean-local: distclean-local:
-rm -rf core.egg-info -rm -rf core.egg-info
DISTCLEANFILES = Makefile.in DISTCLEANFILES = Makefile.in
# files to include with distribution tarball # files to include with distribution tarball
EXTRA_DIST = $(SETUPPY) \ EXTRA_DIST = core \
core \
data \
doc/conf.py.in \ doc/conf.py.in \
examples \
scripts \
tests \ tests \
test.py \
setup.cfg \ setup.cfg \
requirements.txt poetry.lock \
pyproject.toml

View file

@ -1,30 +1,4 @@
import json
import logging.config import logging.config
import os
import subprocess
from core import constants
# setup default null handler # setup default null handler
logging.getLogger(__name__).addHandler(logging.NullHandler()) logging.getLogger(__name__).addHandler(logging.NullHandler())
def load_logging_config():
"""
Load CORE logging configuration file.
:return: nothing
"""
log_config_path = os.path.join(constants.CORE_CONF_DIR, "logging.conf")
with open(log_config_path, "r") as log_config_file:
log_config = json.load(log_config_file)
logging.config.dictConfig(log_config)
class CoreCommandError(subprocess.CalledProcessError):
"""
Used when encountering internal CORE command errors.
"""
def __str__(self):
return "Command(%s), Status(%s):\n%s" % (self.cmd, self.returncode, self.output)

View file

@ -1,3 +0,0 @@
"""
Contains code specific to the legacy TCP API for interacting with the TCL based GUI.
"""

File diff suppressed because it is too large Load diff

View file

@ -1,65 +0,0 @@
"""
Converts CORE data objects into legacy API messages.
"""
from core.api import coreapi
from core.enumerations import ConfigTlvs
from core.enumerations import NodeTlvs
from core.misc import structutils
def convert_node(node_data):
"""
Convenience method for converting NodeData to a packed TLV message.
:param core.data.NodeData node_data: node data to convert
:return: packed node message
"""
tlv_data = structutils.pack_values(coreapi.CoreNodeTlv, [
(NodeTlvs.NUMBER, node_data.id),
(NodeTlvs.TYPE, node_data.node_type),
(NodeTlvs.NAME, node_data.name),
(NodeTlvs.IP_ADDRESS, node_data.ip_address),
(NodeTlvs.MAC_ADDRESS, node_data.mac_address),
(NodeTlvs.IP6_ADDRESS, node_data.ip6_address),
(NodeTlvs.MODEL, node_data.model),
(NodeTlvs.EMULATION_ID, node_data.emulation_id),
(NodeTlvs.EMULATION_SERVER, node_data.emulation_server),
(NodeTlvs.SESSION, node_data.session),
(NodeTlvs.X_POSITION, node_data.x_position),
(NodeTlvs.Y_POSITION, node_data.y_position),
(NodeTlvs.CANVAS, node_data.canvas),
(NodeTlvs.NETWORK_ID, node_data.network_id),
(NodeTlvs.SERVICES, node_data.services),
(NodeTlvs.LATITUDE, node_data.latitude),
(NodeTlvs.LONGITUDE, node_data.longitude),
(NodeTlvs.ALTITUDE, node_data.altitude),
(NodeTlvs.ICON, node_data.icon),
(NodeTlvs.OPAQUE, node_data.opaque)
])
return coreapi.CoreNodeMessage.pack(node_data.message_type, tlv_data)
def convert_config(config_data):
"""
Convenience method for converting ConfigData to a packed TLV message.
:param core.data.ConfigData config_data: config data to convert
:return: packed message
"""
tlv_data = structutils.pack_values(coreapi.CoreConfigTlv, [
(ConfigTlvs.NODE, config_data.node),
(ConfigTlvs.OBJECT, config_data.object),
(ConfigTlvs.TYPE, config_data.type),
(ConfigTlvs.DATA_TYPES, config_data.data_types),
(ConfigTlvs.VALUES, config_data.data_values),
(ConfigTlvs.CAPTIONS, config_data.captions),
(ConfigTlvs.BITMAP, config_data.bitmap),
(ConfigTlvs.POSSIBLE_VALUES, config_data.possible_values),
(ConfigTlvs.GROUPS, config_data.groups),
(ConfigTlvs.SESSION, config_data.session),
(ConfigTlvs.INTERFACE_NUMBER, config_data.interface_number),
(ConfigTlvs.NETWORK_ID, config_data.network_id),
(ConfigTlvs.OPAQUE, config_data.opaque),
])
return coreapi.CoreConfMessage.pack(config_data.message_type, tlv_data)

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,219 @@
import logging
from collections.abc import Iterable
from queue import Empty, Queue
from typing import Optional
from core.api.grpc import core_pb2, grpcutils
from core.api.grpc.grpcutils import convert_link_data
from core.emulator.data import (
ConfigData,
EventData,
ExceptionData,
FileData,
LinkData,
NodeData,
)
from core.emulator.session import Session
logger = logging.getLogger(__name__)
def handle_node_event(session: Session, node_data: NodeData) -> core_pb2.Event:
"""
Handle node event when there is a node event
:param session: session node is from
:param node_data: node data
:return: node event that contains node id, name, model, position, and services
"""
node = node_data.node
emane_configs = grpcutils.get_emane_model_configs_dict(session)
node_emane_configs = emane_configs.get(node.id, [])
node_proto = grpcutils.get_node_proto(session, node, node_emane_configs)
message_type = node_data.message_type.value
node_event = core_pb2.NodeEvent(message_type=message_type, node=node_proto)
return core_pb2.Event(node_event=node_event, source=node_data.source)
def handle_link_event(link_data: LinkData) -> core_pb2.Event:
"""
Handle link event when there is a link event
:param link_data: link data
:return: link event that has message type and link information
"""
link = convert_link_data(link_data)
message_type = link_data.message_type.value
link_event = core_pb2.LinkEvent(message_type=message_type, link=link)
return core_pb2.Event(link_event=link_event, source=link_data.source)
def handle_session_event(event_data: EventData) -> core_pb2.Event:
"""
Handle session event when there is a session event
:param event_data: event data
:return: session event
"""
event_time = event_data.time
if event_time is not None:
event_time = float(event_time)
session_event = core_pb2.SessionEvent(
node_id=event_data.node,
event=event_data.event_type.value,
name=event_data.name,
data=event_data.data,
time=event_time,
)
return core_pb2.Event(session_event=session_event)
def handle_config_event(config_data: ConfigData) -> core_pb2.Event:
"""
Handle configuration event when there is configuration event
:param config_data: configuration data
:return: configuration event
"""
config_event = core_pb2.ConfigEvent(
message_type=config_data.message_type,
node_id=config_data.node,
object=config_data.object,
type=config_data.type,
captions=config_data.captions,
bitmap=config_data.bitmap,
data_values=config_data.data_values,
possible_values=config_data.possible_values,
groups=config_data.groups,
iface_id=config_data.iface_id,
network_id=config_data.network_id,
opaque=config_data.opaque,
data_types=config_data.data_types,
)
return core_pb2.Event(config_event=config_event)
def handle_exception_event(exception_data: ExceptionData) -> core_pb2.Event:
"""
Handle exception event when there is exception event
:param exception_data: exception data
:return: exception event
"""
exception_event = core_pb2.ExceptionEvent(
node_id=exception_data.node,
level=exception_data.level.value,
source=exception_data.source,
date=exception_data.date,
text=exception_data.text,
opaque=exception_data.opaque,
)
return core_pb2.Event(exception_event=exception_event)
def handle_file_event(file_data: FileData) -> core_pb2.Event:
"""
Handle file event
:param file_data: file data
:return: file event
"""
file_event = core_pb2.FileEvent(
message_type=file_data.message_type.value,
node_id=file_data.node,
name=file_data.name,
mode=file_data.mode,
number=file_data.number,
type=file_data.type,
source=file_data.source,
data=file_data.data,
compressed_data=file_data.compressed_data,
)
return core_pb2.Event(file_event=file_event)
class EventStreamer:
"""
Processes session events to generate grpc events.
"""
def __init__(
self, session: Session, event_types: Iterable[core_pb2.EventType]
) -> None:
"""
Create a EventStreamer instance.
:param session: session to process events for
:param event_types: types of events to process
"""
self.session: Session = session
self.event_types: Iterable[core_pb2.EventType] = event_types
self.queue: Queue = Queue()
self.add_handlers()
def add_handlers(self) -> None:
"""
Add a session event handler for desired event types.
:return: nothing
"""
if core_pb2.EventType.NODE in self.event_types:
self.session.node_handlers.append(self.queue.put)
if core_pb2.EventType.LINK in self.event_types:
self.session.link_handlers.append(self.queue.put)
if core_pb2.EventType.CONFIG in self.event_types:
self.session.config_handlers.append(self.queue.put)
if core_pb2.EventType.FILE in self.event_types:
self.session.file_handlers.append(self.queue.put)
if core_pb2.EventType.EXCEPTION in self.event_types:
self.session.exception_handlers.append(self.queue.put)
if core_pb2.EventType.SESSION in self.event_types:
self.session.event_handlers.append(self.queue.put)
def process(self) -> Optional[core_pb2.Event]:
"""
Process the next event in the queue.
:return: grpc event, or None when invalid event or queue timeout
"""
event = None
try:
data = self.queue.get(timeout=1)
if isinstance(data, NodeData):
event = handle_node_event(self.session, data)
elif isinstance(data, LinkData):
event = handle_link_event(data)
elif isinstance(data, EventData):
event = handle_session_event(data)
elif isinstance(data, ConfigData):
event = handle_config_event(data)
elif isinstance(data, ExceptionData):
event = handle_exception_event(data)
elif isinstance(data, FileData):
event = handle_file_event(data)
else:
logger.error("unknown event: %s", data)
except Empty:
pass
if event:
event.session_id = self.session.id
return event
def remove_handlers(self) -> None:
"""
Remove session event handlers for events being watched.
:return: nothing
"""
if core_pb2.EventType.NODE in self.event_types:
self.session.node_handlers.remove(self.queue.put)
if core_pb2.EventType.LINK in self.event_types:
self.session.link_handlers.remove(self.queue.put)
if core_pb2.EventType.CONFIG in self.event_types:
self.session.config_handlers.remove(self.queue.put)
if core_pb2.EventType.FILE in self.event_types:
self.session.file_handlers.remove(self.queue.put)
if core_pb2.EventType.EXCEPTION in self.event_types:
self.session.exception_handlers.remove(self.queue.put)
if core_pb2.EventType.SESSION in self.event_types:
self.session.event_handlers.remove(self.queue.put)

View file

@ -0,0 +1,908 @@
import logging
import time
from pathlib import Path
from typing import Any, Optional, Union
import grpc
from grpc import ServicerContext
from core import utils
from core.api.grpc import common_pb2, core_pb2, wrappers
from core.api.grpc.configservices_pb2 import ConfigServiceConfig
from core.api.grpc.emane_pb2 import NodeEmaneConfig
from core.api.grpc.services_pb2 import (
NodeServiceConfig,
NodeServiceData,
ServiceConfig,
ServiceDefaults,
)
from core.config import ConfigurableOptions
from core.emane.nodes import EmaneNet, EmaneOptions
from core.emulator.data import InterfaceData, LinkData, LinkOptions
from core.emulator.enumerations import LinkTypes, NodeTypes
from core.emulator.links import CoreLink
from core.emulator.session import Session
from core.errors import CoreError
from core.location.mobility import BasicRangeModel, Ns2ScriptedMobility
from core.nodes.base import (
CoreNode,
CoreNodeBase,
CoreNodeOptions,
NodeBase,
NodeOptions,
Position,
)
from core.nodes.docker import DockerNode, DockerOptions
from core.nodes.interface import CoreInterface
from core.nodes.lxd import LxcNode, LxcOptions
from core.nodes.network import CoreNetwork, CtrlNet, PtpNet, WlanNode
from core.nodes.podman import PodmanNode, PodmanOptions
from core.nodes.wireless import WirelessNode
from core.services.coreservices import CoreService
logger = logging.getLogger(__name__)
WORKERS = 10
class CpuUsage:
def __init__(self) -> None:
self.stat_file: Path = Path("/proc/stat")
self.prev_idle: int = 0
self.prev_total: int = 0
def run(self) -> float:
lines = self.stat_file.read_text().splitlines()[0]
values = [int(x) for x in lines.split()[1:]]
idle = sum(values[3:5])
non_idle = sum(values[:3] + values[5:8])
total = idle + non_idle
total_diff = total - self.prev_total
idle_diff = idle - self.prev_idle
self.prev_idle = idle
self.prev_total = total
return (total_diff - idle_diff) / total_diff
def add_node_data(
_class: type[NodeBase], node_proto: core_pb2.Node
) -> tuple[Position, NodeOptions]:
"""
Convert node protobuf message to data for creating a node.
:param _class: node class to create options from
:param node_proto: node proto message
:return: node type, id, and options
"""
options = _class.create_options()
options.icon = node_proto.icon
options.canvas = node_proto.canvas
if isinstance(options, CoreNodeOptions):
options.model = node_proto.model
options.services = node_proto.services
options.config_services = node_proto.config_services
if isinstance(options, EmaneOptions):
options.emane_model = node_proto.emane
if isinstance(options, (DockerOptions, LxcOptions, PodmanOptions)):
options.image = node_proto.image
position = Position()
position.set(node_proto.position.x, node_proto.position.y)
if node_proto.HasField("geo"):
geo = node_proto.geo
position.set_geo(geo.lon, geo.lat, geo.alt)
return position, options
def link_iface(iface_proto: core_pb2.Interface) -> InterfaceData:
"""
Create interface data from interface proto.
:param iface_proto: interface proto
:return: interface data
"""
iface_data = None
if iface_proto:
name = iface_proto.name if iface_proto.name else None
mac = iface_proto.mac if iface_proto.mac else None
ip4 = iface_proto.ip4 if iface_proto.ip4 else None
ip6 = iface_proto.ip6 if iface_proto.ip6 else None
iface_data = InterfaceData(
id=iface_proto.id,
name=name,
mac=mac,
ip4=ip4,
ip4_mask=iface_proto.ip4_mask,
ip6=ip6,
ip6_mask=iface_proto.ip6_mask,
)
return iface_data
def add_link_data(
link_proto: core_pb2.Link,
) -> tuple[InterfaceData, InterfaceData, LinkOptions]:
"""
Convert link proto to link interfaces and options data.
:param link_proto: link proto
:return: link interfaces and options
"""
iface1_data = link_iface(link_proto.iface1)
iface2_data = link_iface(link_proto.iface2)
options = LinkOptions()
options_proto = link_proto.options
if options_proto:
options.delay = options_proto.delay
options.bandwidth = options_proto.bandwidth
options.loss = options_proto.loss
options.dup = options_proto.dup
options.jitter = options_proto.jitter
options.mer = options_proto.mer
options.burst = options_proto.burst
options.mburst = options_proto.mburst
options.buffer = options_proto.buffer
options.unidirectional = options_proto.unidirectional
options.key = options_proto.key
return iface1_data, iface2_data, options
def create_nodes(
session: Session, node_protos: list[core_pb2.Node]
) -> tuple[list[NodeBase], list[Exception]]:
"""
Create nodes using a thread pool and wait for completion.
:param session: session to create nodes in
:param node_protos: node proto messages
:return: results and exceptions for created nodes
"""
funcs = []
for node_proto in node_protos:
_type = NodeTypes(node_proto.type)
_class = session.get_node_class(_type)
position, options = add_node_data(_class, node_proto)
args = (
_class,
node_proto.id or None,
node_proto.name or None,
node_proto.server or None,
position,
options,
)
funcs.append((session.add_node, args, {}))
start = time.monotonic()
results, exceptions = utils.threadpool(funcs)
total = time.monotonic() - start
logger.debug("grpc created nodes time: %s", total)
return results, exceptions
def create_links(
session: Session, link_protos: list[core_pb2.Link]
) -> tuple[list[NodeBase], list[Exception]]:
"""
Create links using a thread pool and wait for completion.
:param session: session to create nodes in
:param link_protos: link proto messages
:return: results and exceptions for created links
"""
funcs = []
for link_proto in link_protos:
node1_id = link_proto.node1_id
node2_id = link_proto.node2_id
iface1, iface2, options = add_link_data(link_proto)
args = (node1_id, node2_id, iface1, iface2, options)
funcs.append((session.add_link, args, {}))
start = time.monotonic()
results, exceptions = utils.threadpool(funcs)
total = time.monotonic() - start
logger.debug("grpc created links time: %s", total)
return results, exceptions
def edit_links(
session: Session, link_protos: list[core_pb2.Link]
) -> tuple[list[None], list[Exception]]:
"""
Edit links using a thread pool and wait for completion.
:param session: session to create nodes in
:param link_protos: link proto messages
:return: results and exceptions for created links
"""
funcs = []
for link_proto in link_protos:
node1_id = link_proto.node1_id
node2_id = link_proto.node2_id
iface1, iface2, options = add_link_data(link_proto)
args = (node1_id, node2_id, iface1.id, iface2.id, options)
funcs.append((session.update_link, args, {}))
start = time.monotonic()
results, exceptions = utils.threadpool(funcs)
total = time.monotonic() - start
logger.debug("grpc edit links time: %s", total)
return results, exceptions
def convert_value(value: Any) -> str:
"""
Convert value into string.
:param value: value
:return: string conversion of the value
"""
if value is not None:
value = str(value)
return value
def convert_session_options(session: Session) -> dict[str, common_pb2.ConfigOption]:
config_options = {}
for option in session.options.options:
value = session.options.get(option.id)
config_option = common_pb2.ConfigOption(
label=option.label,
name=option.id,
value=value,
type=option.type.value,
select=option.options,
group="Options",
)
config_options[option.id] = config_option
return config_options
def get_config_options(
config: dict[str, str],
configurable_options: Union[ConfigurableOptions, type[ConfigurableOptions]],
) -> dict[str, common_pb2.ConfigOption]:
"""
Retrieve configuration options in a form that is used by the grpc server.
:param config: configuration
:param configurable_options: configurable options
:return: mapping of configuration ids to configuration options
"""
results = {}
for configuration in configurable_options.configurations():
value = config.get(configuration.id, configuration.default)
config_option = common_pb2.ConfigOption(
label=configuration.label,
name=configuration.id,
value=value,
type=configuration.type.value,
select=configuration.options,
)
results[configuration.id] = config_option
for config_group in configurable_options.config_groups():
start = config_group.start - 1
stop = config_group.stop
options = list(results.values())[start:stop]
for option in options:
option.group = config_group.name
return results
def get_node_proto(
session: Session, node: NodeBase, emane_configs: list[NodeEmaneConfig]
) -> core_pb2.Node:
"""
Convert CORE node to protobuf representation.
:param session: session containing node
:param node: node to convert
:param emane_configs: emane configs related to node
:return: node proto
"""
node_type = session.get_node_type(node.__class__)
position = core_pb2.Position(
x=node.position.x, y=node.position.y, z=node.position.z
)
geo = core_pb2.Geo(
lat=node.position.lat, lon=node.position.lon, alt=node.position.alt
)
services = [x.name for x in node.services]
node_dir = None
config_services = []
if isinstance(node, CoreNodeBase):
node_dir = str(node.directory)
config_services = [x for x in node.config_services]
channel = None
if isinstance(node, CoreNode):
channel = str(node.ctrlchnlname)
emane_model = None
if isinstance(node, EmaneNet):
emane_model = node.wireless_model.name
image = None
if isinstance(node, (DockerNode, LxcNode, PodmanNode)):
image = node.image
# check for wlan config
wlan_config = session.mobility.get_configs(
node.id, config_type=BasicRangeModel.name
)
if wlan_config:
wlan_config = get_config_options(wlan_config, BasicRangeModel)
# check for wireless config
wireless_config = None
if isinstance(node, WirelessNode):
configs = node.get_config()
wireless_config = {}
for config in configs.values():
config_option = common_pb2.ConfigOption(
label=config.label,
name=config.id,
value=config.default,
type=config.type.value,
select=config.options,
group=config.group,
)
wireless_config[config.id] = config_option
# check for mobility config
mobility_config = session.mobility.get_configs(
node.id, config_type=Ns2ScriptedMobility.name
)
if mobility_config:
mobility_config = get_config_options(mobility_config, Ns2ScriptedMobility)
# check for service configs
custom_services = session.services.custom_services.get(node.id)
service_configs = {}
if custom_services:
for service in custom_services.values():
service_proto = get_service_configuration(service)
service_configs[service.name] = NodeServiceConfig(
node_id=node.id,
service=service.name,
data=service_proto,
files=service.config_data,
)
# check for config service configs
config_service_configs = {}
if isinstance(node, CoreNode):
for service in node.config_services.values():
if not service.custom_templates and not service.custom_config:
continue
config_service_configs[service.name] = ConfigServiceConfig(
node_id=node.id,
name=service.name,
templates=service.custom_templates,
config=service.custom_config,
)
return core_pb2.Node(
id=node.id,
name=node.name,
emane=emane_model,
model=node.model,
type=node_type.value,
position=position,
geo=geo,
services=services,
icon=node.icon,
image=image,
config_services=config_services,
dir=node_dir,
channel=channel,
canvas=node.canvas,
wlan_config=wlan_config,
wireless_config=wireless_config,
mobility_config=mobility_config,
service_configs=service_configs,
config_service_configs=config_service_configs,
emane_configs=emane_configs,
)
def get_links(session: Session, node: NodeBase) -> list[core_pb2.Link]:
"""
Retrieve a list of links for grpc to use.
:param session: session to get links for node
:param node: node to get links from
:return: protobuf links
"""
link_protos = []
for core_link in session.link_manager.node_links(node):
link_protos.extend(convert_core_link(core_link))
if isinstance(node, (WlanNode, EmaneNet)):
for link_data in node.links():
link_protos.append(convert_link_data(link_data))
return link_protos
def convert_iface(iface: CoreInterface) -> core_pb2.Interface:
"""
Convert interface to protobuf.
:param iface: interface to convert
:return: protobuf interface
"""
if isinstance(iface.node, CoreNetwork):
return core_pb2.Interface(id=iface.id)
else:
ip4 = iface.get_ip4()
ip4_mask = ip4.prefixlen if ip4 else None
ip4 = str(ip4.ip) if ip4 else None
ip6 = iface.get_ip6()
ip6_mask = ip6.prefixlen if ip6 else None
ip6 = str(ip6.ip) if ip6 else None
mac = str(iface.mac) if iface.mac else None
return core_pb2.Interface(
id=iface.id,
name=iface.name,
mac=mac,
ip4=ip4,
ip4_mask=ip4_mask,
ip6=ip6,
ip6_mask=ip6_mask,
)
def convert_core_link(core_link: CoreLink) -> list[core_pb2.Link]:
"""
Convert core link to protobuf data.
:param core_link: core link to convert
:return: protobuf link data
"""
links = []
node1, iface1 = core_link.node1, core_link.iface1
node2, iface2 = core_link.node2, core_link.iface2
unidirectional = core_link.is_unidirectional()
link = convert_link(node1, iface1, node2, iface2, iface1.options, unidirectional)
links.append(link)
if unidirectional:
link = convert_link(
node2, iface2, node1, iface1, iface2.options, unidirectional
)
links.append(link)
return links
def convert_link_data(link_data: LinkData) -> core_pb2.Link:
"""
Convert link_data into core protobuf link.
:param link_data: link to convert
:return: core protobuf Link
"""
iface1 = None
if link_data.iface1 is not None:
iface1 = convert_iface_data(link_data.iface1)
iface2 = None
if link_data.iface2 is not None:
iface2 = convert_iface_data(link_data.iface2)
options = convert_link_options(link_data.options)
return core_pb2.Link(
type=link_data.type.value,
node1_id=link_data.node1_id,
node2_id=link_data.node2_id,
iface1=iface1,
iface2=iface2,
options=options,
network_id=link_data.network_id,
label=link_data.label,
color=link_data.color,
)
def convert_iface_data(iface_data: InterfaceData) -> core_pb2.Interface:
"""
Convert interface data to protobuf.
:param iface_data: interface data to convert
:return: interface protobuf
"""
return core_pb2.Interface(
id=iface_data.id,
name=iface_data.name,
mac=iface_data.mac,
ip4=iface_data.ip4,
ip4_mask=iface_data.ip4_mask,
ip6=iface_data.ip6,
ip6_mask=iface_data.ip6_mask,
)
def convert_link_options(options: LinkOptions) -> core_pb2.LinkOptions:
"""
Convert link options to protobuf.
:param options: link options to convert
:return: link options protobuf
"""
return core_pb2.LinkOptions(
jitter=options.jitter,
key=options.key,
mburst=options.mburst,
mer=options.mer,
loss=options.loss,
bandwidth=options.bandwidth,
burst=options.burst,
delay=options.delay,
dup=options.dup,
buffer=options.buffer,
unidirectional=options.unidirectional,
)
def convert_options_proto(options: core_pb2.LinkOptions) -> LinkOptions:
return LinkOptions(
delay=options.delay,
bandwidth=options.bandwidth,
loss=options.loss,
dup=options.dup,
jitter=options.jitter,
mer=options.mer,
burst=options.burst,
mburst=options.mburst,
buffer=options.buffer,
unidirectional=options.unidirectional,
key=options.key,
)
def convert_link(
node1: NodeBase,
iface1: Optional[CoreInterface],
node2: NodeBase,
iface2: Optional[CoreInterface],
options: LinkOptions,
unidirectional: bool,
) -> core_pb2.Link:
"""
Convert link objects to link protobuf.
:param node1: first node in link
:param iface1: node1 interface
:param node2: second node in link
:param iface2: node2 interface
:param options: link options
:param unidirectional: if this link is considered unidirectional
:return: protobuf link
"""
if iface1 is not None:
iface1 = convert_iface(iface1)
if iface2 is not None:
iface2 = convert_iface(iface2)
is_node1_wireless = isinstance(node1, (WlanNode, EmaneNet))
is_node2_wireless = isinstance(node2, (WlanNode, EmaneNet))
if not (is_node1_wireless or is_node2_wireless):
options = convert_link_options(options)
options.unidirectional = unidirectional
else:
options = None
return core_pb2.Link(
type=LinkTypes.WIRED.value,
node1_id=node1.id,
node2_id=node2.id,
iface1=iface1,
iface2=iface2,
options=options,
network_id=None,
label=None,
color=None,
)
def parse_proc_net_dev(lines: list[str]) -> dict[str, dict[str, float]]:
"""
Parse lines of output from /proc/net/dev.
:param lines: lines of /proc/net/dev
:return: parsed device to tx/rx values
"""
stats = {}
for line in lines[2:]:
line = line.strip()
if not line:
continue
line = line.split()
line[0] = line[0].strip(":")
stats[line[0]] = {"rx": float(line[1]), "tx": float(line[9])}
return stats
def get_net_stats() -> dict[str, dict[str, float]]:
"""
Retrieve status about the current interfaces in the system
:return: send and receive status of the interfaces in the system
"""
with open("/proc/net/dev", "r") as f:
lines = f.readlines()[2:]
return parse_proc_net_dev(lines)
def session_location(session: Session, location: core_pb2.SessionLocation) -> None:
"""
Set session location based on location proto.
:param session: session for location
:param location: location to set
:return: nothing
"""
session.location.refxyz = (location.x, location.y, location.z)
session.location.setrefgeo(location.lat, location.lon, location.alt)
session.location.refscale = location.scale
def service_configuration(session: Session, config: ServiceConfig) -> None:
"""
Convenience method for setting a node service configuration.
:param session: session for service configuration
:param config: service configuration
:return:
"""
session.services.set_service(config.node_id, config.service)
service = session.services.get_service(config.node_id, config.service)
if config.files:
service.configs = tuple(config.files)
if config.directories:
service.dirs = tuple(config.directories)
if config.startup:
service.startup = tuple(config.startup)
if config.validate:
service.validate = tuple(config.validate)
if config.shutdown:
service.shutdown = tuple(config.shutdown)
def get_service_configuration(service: CoreService) -> NodeServiceData:
"""
Convenience for converting a service to service data proto.
:param service: service to get proto data for
:return: service proto data
"""
return NodeServiceData(
executables=service.executables,
dependencies=service.dependencies,
dirs=service.dirs,
configs=service.configs,
startup=service.startup,
validate=service.validate,
validation_mode=service.validation_mode.value,
validation_timer=service.validation_timer,
shutdown=service.shutdown,
meta=service.meta,
)
def iface_to_proto(session: Session, iface: CoreInterface) -> core_pb2.Interface:
"""
Convenience for converting a core interface to the protobuf representation.
:param session: session interface belongs to
:param iface: interface to convert
:return: interface proto
"""
ip4_net = iface.get_ip4()
ip4 = str(ip4_net.ip) if ip4_net else None
ip4_mask = ip4_net.prefixlen if ip4_net else None
ip6_net = iface.get_ip6()
ip6 = str(ip6_net.ip) if ip6_net else None
ip6_mask = ip6_net.prefixlen if ip6_net else None
mac = str(iface.mac) if iface.mac else None
nem_id = None
nem_port = None
if isinstance(iface.net, EmaneNet):
nem_id = session.emane.get_nem_id(iface)
nem_port = session.emane.get_nem_port(iface)
return core_pb2.Interface(
id=iface.id,
name=iface.name,
mac=mac,
mtu=iface.mtu,
flow_id=iface.flow_id,
ip4=ip4,
ip4_mask=ip4_mask,
ip6=ip6,
ip6_mask=ip6_mask,
nem_id=nem_id,
nem_port=nem_port,
)
def get_nem_id(
session: Session, node: CoreNode, iface_id: int, context: ServicerContext
) -> int:
"""
Get nem id for a given node and interface id.
:param session: session node belongs to
:param node: node to get nem id for
:param iface_id: id of interface on node to get nem id for
:param context: request context
:return: nem id
"""
iface = node.ifaces.get(iface_id)
if not iface:
message = f"{node.name} missing interface {iface_id}"
context.abort(grpc.StatusCode.NOT_FOUND, message)
net = iface.net
if not isinstance(net, EmaneNet):
message = f"{node.name} interface {iface_id} is not an EMANE network"
context.abort(grpc.StatusCode.INVALID_ARGUMENT, message)
nem_id = session.emane.get_nem_id(iface)
if nem_id is None:
message = f"{node.name} interface {iface_id} nem id does not exist"
context.abort(grpc.StatusCode.INVALID_ARGUMENT, message)
return nem_id
def get_emane_model_configs_dict(session: Session) -> dict[int, list[NodeEmaneConfig]]:
"""
Get emane model configuration protobuf data.
:param session: session to get emane model configuration for
:return: dict of emane model protobuf configurations
"""
configs = {}
for _id, model_configs in session.emane.node_configs.items():
for model_name in model_configs:
model_class = session.emane.get_model(model_name)
current_config = session.emane.get_config(_id, model_name)
config = get_config_options(current_config, model_class)
node_id, iface_id = utils.parse_iface_config_id(_id)
iface_id = iface_id if iface_id is not None else -1
node_config = NodeEmaneConfig(
model=model_name, iface_id=iface_id, config=config
)
node_configs = configs.setdefault(node_id, [])
node_configs.append(node_config)
return configs
def get_hooks(session: Session) -> list[core_pb2.Hook]:
"""
Retrieve hook protobuf data for a session.
:param session: session to get hooks for
:return: list of hook protobufs
"""
hooks = []
for state in session.hooks:
state_hooks = session.hooks[state]
for file_name, file_data in state_hooks:
hook = core_pb2.Hook(state=state.value, file=file_name, data=file_data)
hooks.append(hook)
return hooks
def get_default_services(session: Session) -> list[ServiceDefaults]:
"""
Retrieve the default service sets for a given session.
:param session: session to get default service sets for
:return: list of default service sets
"""
default_services = []
for model, services in session.services.default_services.items():
default_service = ServiceDefaults(model=model, services=services)
default_services.append(default_service)
return default_services
def get_mobility_node(
session: Session, node_id: int, context: ServicerContext
) -> Union[WlanNode, EmaneNet]:
"""
Get mobility node.
:param session: session to get node from
:param node_id: id of node to get
:param context: grpc context
:return: wlan or emane node
"""
try:
return session.get_node(node_id, WlanNode)
except CoreError:
try:
return session.get_node(node_id, EmaneNet)
except CoreError:
context.abort(grpc.StatusCode.NOT_FOUND, "node id is not for wlan or emane")
def convert_session(session: Session) -> wrappers.Session:
"""
Convert session to its wrapped version.
:param session: session to convert
:return: wrapped session data
"""
emane_configs = get_emane_model_configs_dict(session)
nodes = []
links = []
for _id in session.nodes:
node = session.nodes[_id]
if not isinstance(node, (PtpNet, CtrlNet)):
node_emane_configs = emane_configs.get(node.id, [])
node_proto = get_node_proto(session, node, node_emane_configs)
nodes.append(node_proto)
if isinstance(node, (WlanNode, EmaneNet)):
for link_data in node.links():
links.append(convert_link_data(link_data))
for core_link in session.link_manager.links():
links.extend(convert_core_link(core_link))
default_services = get_default_services(session)
x, y, z = session.location.refxyz
lat, lon, alt = session.location.refgeo
location = core_pb2.SessionLocation(
x=x, y=y, z=z, lat=lat, lon=lon, alt=alt, scale=session.location.refscale
)
hooks = get_hooks(session)
session_file = str(session.file_path) if session.file_path else None
options = convert_session_options(session)
servers = [
core_pb2.Server(name=x.name, host=x.host)
for x in session.distributed.servers.values()
]
return core_pb2.Session(
id=session.id,
state=session.state.value,
nodes=nodes,
links=links,
dir=str(session.directory),
user=session.user,
default_services=default_services,
location=location,
hooks=hooks,
metadata=session.metadata,
file=session_file,
options=options,
servers=servers,
)
def configure_node(
session: Session, node: core_pb2.Node, core_node: NodeBase, context: ServicerContext
) -> None:
"""
Configure a node using all provided protobuf data.
:param session: session for node
:param node: node protobuf data
:param core_node: session node
:param context: grpc context
:return: nothing
"""
for emane_config in node.emane_configs:
_id = utils.iface_config_id(node.id, emane_config.iface_id)
config = {k: v.value for k, v in emane_config.config.items()}
session.emane.set_config(_id, emane_config.model, config)
if node.wlan_config:
config = {k: v.value for k, v in node.wlan_config.items()}
session.mobility.set_model_config(node.id, BasicRangeModel.name, config)
if node.mobility_config:
config = {k: v.value for k, v in node.mobility_config.items()}
session.mobility.set_model_config(node.id, Ns2ScriptedMobility.name, config)
if isinstance(core_node, WirelessNode) and node.wireless_config:
config = {k: v.value for k, v in node.wireless_config.items()}
core_node.set_config(config)
for service_name, service_config in node.service_configs.items():
data = service_config.data
config = ServiceConfig(
node_id=node.id,
service=service_name,
startup=data.startup,
validate=data.validate,
shutdown=data.shutdown,
files=data.configs,
directories=data.dirs,
)
service_configuration(session, config)
for file_name, file_data in service_config.files.items():
session.services.set_service_file(
node.id, service_name, file_name, file_data
)
if node.config_service_configs:
if not isinstance(core_node, CoreNode):
context.abort(
grpc.StatusCode.INVALID_ARGUMENT,
"invalid node type with config service configs",
)
for service_name, service_config in node.config_service_configs.items():
service = core_node.config_services[service_name]
if service_config.config:
service.set_config(service_config.config)
for name, template in service_config.templates.items():
service.set_template(name, template)

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,398 +0,0 @@
"""
Common support for configurable CORE objects.
"""
import logging
from collections import OrderedDict
from core.data import ConfigData
class ConfigShim(object):
"""
Provides helper methods for converting newer configuration values into TLV compatible formats.
"""
@classmethod
def str_to_dict(cls, key_values):
"""
Converts a TLV key/value string into an ordered mapping.
:param str key_values:
:return: ordered mapping of key/value pairs
:rtype: OrderedDict
"""
key_values = key_values.split("|")
values = OrderedDict()
for key_value in key_values:
key, value = key_value.split("=", 1)
values[key] = value
return values
@classmethod
def groups_to_str(cls, config_groups):
"""
Converts configuration groups to a TLV formatted string.
:param list[ConfigGroup] config_groups: configuration groups to format
:return: TLV configuration group string
:rtype: str
"""
group_strings = []
for config_group in config_groups:
group_string = "%s:%s-%s" % (config_group.name, config_group.start, config_group.stop)
group_strings.append(group_string)
return "|".join(group_strings)
@classmethod
def config_data(cls, flags, node_id, type_flags, configurable_options, config):
"""
Convert this class to a Config API message. Some TLVs are defined
by the class, but node number, conf type flags, and values must
be passed in.
:param int flags: message flags
:param int node_id: node id
:param int type_flags: type flags
:param ConfigurableOptions configurable_options: options to create config data for
:param dict config: configuration values for options
:return: configuration data object
:rtype: ConfigData
"""
key_values = None
captions = None
data_types = []
possible_values = []
logging.debug("configurable: %s", configurable_options)
logging.debug("configuration options: %s", configurable_options.configurations)
logging.debug("configuration data: %s", config)
for configuration in configurable_options.configurations():
if not captions:
captions = configuration.label
else:
captions += "|%s" % configuration.label
data_types.append(configuration.type.value)
options = ",".join(configuration.options)
possible_values.append(options)
_id = configuration.id
config_value = config.get(_id, configuration.default)
key_value = "%s=%s" % (_id, config_value)
if not key_values:
key_values = key_value
else:
key_values += "|%s" % key_value
groups_str = cls.groups_to_str(configurable_options.config_groups())
return ConfigData(
message_type=flags,
node=node_id,
object=configurable_options.name,
type=type_flags,
data_types=tuple(data_types),
data_values=key_values,
captions=captions,
possible_values="|".join(possible_values),
bitmap=configurable_options.bitmap,
groups=groups_str
)
class Configuration(object):
"""
Represents a configuration options.
"""
def __init__(self, _id, _type, label=None, default="", options=None):
"""
Creates a Configuration object.
:param str _id: unique name for configuration
:param core.enumerations.ConfigDataTypes _type: configuration data type
:param str label: configuration label for display
:param str default: default value for configuration
:param list options: list options if this is a configuration with a combobox
"""
self.id = _id
self.type = _type
self.default = default
if not options:
options = []
self.options = options
if not label:
label = _id
self.label = label
def __str__(self):
return "%s(id=%s, type=%s, default=%s, options=%s)" % (
self.__class__.__name__, self.id, self.type, self.default, self.options)
class ConfigurableManager(object):
"""
Provides convenience methods for storing and retrieving configuration options for nodes.
"""
_default_node = -1
_default_type = _default_node
def __init__(self):
"""
Creates a ConfigurableManager object.
"""
self.node_configurations = {}
def nodes(self):
"""
Retrieves the ids of all node configurations known by this manager.
:return: list of node ids
:rtype: list
"""
return [node_id for node_id in self.node_configurations.iterkeys() if node_id != self._default_node]
def config_reset(self, node_id=None):
"""
Clears all configurations or configuration for a specific node.
:param int node_id: node id to clear configurations for, default is None and clears all configurations
:return: nothing
"""
logging.debug("resetting all configurations: %s", self.__class__.__name__)
if not node_id:
self.node_configurations.clear()
elif node_id in self.node_configurations:
self.node_configurations.pop(node_id)
def set_config(self, _id, value, node_id=_default_node, config_type=_default_type):
"""
Set a specific configuration value for a node and configuration type.
:param str _id: configuration key
:param str value: configuration value
:param int node_id: node id to store configuration for
:param str config_type: configuration type to store configuration for
:return: nothing
"""
logging.debug("setting config for node(%s) type(%s): %s=%s", node_id, config_type, _id, value)
node_configs = self.node_configurations.setdefault(node_id, OrderedDict())
node_type_configs = node_configs.setdefault(config_type, OrderedDict())
node_type_configs[_id] = value
def set_configs(self, config, node_id=_default_node, config_type=_default_type):
"""
Set configurations for a node and configuration type.
:param dict config: configurations to set
:param int node_id: node id to store configuration for
:param str config_type: configuration type to store configuration for
:return: nothing
"""
logging.debug("setting config for node(%s) type(%s): %s", node_id, config_type, config)
node_configs = self.node_configurations.setdefault(node_id, OrderedDict())
node_configs[config_type] = config
def get_config(self, _id, node_id=_default_node, config_type=_default_type, default=None):
"""
Retrieves a specific configuration for a node and configuration type.
:param str _id: specific configuration to retrieve
:param int node_id: node id to store configuration for
:param str config_type: configuration type to store configuration for
:param default: default value to return when value is not found
:return: configuration value
:rtype str
"""
logging.debug("getting config for node(%s) type(%s): %s", node_id, config_type, _id)
result = default
node_type_configs = self.get_configs(node_id, config_type)
if node_type_configs:
result = node_type_configs.get(_id, default)
return result
def get_configs(self, node_id=_default_node, config_type=_default_type):
"""
Retrieve configurations for a node and configuration type.
:param int node_id: node id to store configuration for
:param str config_type: configuration type to store configuration for
:return: configurations
:rtype: dict
"""
logging.debug("getting configs for node(%s) type(%s)", node_id, config_type)
result = None
node_configs = self.node_configurations.get(node_id)
if node_configs:
result = node_configs.get(config_type)
return result
def get_all_configs(self, node_id=_default_node):
"""
Retrieve all current configuration types for a node.
:param int node_id: node id to retrieve configurations for
:return: all configuration types for a node
:rtype: dict
"""
logging.debug("getting all configs for node(%s)", node_id)
return self.node_configurations.get(node_id)
class ConfigGroup(object):
"""
Defines configuration group tabs used for display by ConfigurationOptions.
"""
def __init__(self, name, start, stop):
"""
Creates a ConfigGroup object.
:param str name: configuration group display name
:param int start: configurations start index for this group
:param int stop: configurations stop index for this group
"""
self.name = name
self.start = start
self.stop = stop
class ConfigurableOptions(object):
"""
Provides a base for defining configuration options within CORE.
"""
name = None
bitmap = None
options = []
@classmethod
def configurations(cls):
"""
Provides the configurations for this class.
:return: configurations
:rtype: list[Configuration]
"""
return cls.options
@classmethod
def config_groups(cls):
"""
Defines how configurations are grouped.
:return: configuration group definition
:rtype: list[ConfigGroup]
"""
return [
ConfigGroup("Options", 1, len(cls.configurations()))
]
@classmethod
def default_values(cls):
"""
Provides an ordered mapping of configuration keys to default values.
:return: ordered configuration mapping default values
:rtype: OrderedDict
"""
return OrderedDict([(config.id, config.default) for config in cls.configurations()])
class ModelManager(ConfigurableManager):
"""
Helps handle setting models for nodes and managing their model configurations.
"""
def __init__(self):
"""
Creates a ModelManager object.
"""
super(ModelManager, self).__init__()
self.models = {}
self.node_models = {}
def set_model_config(self, node_id, model_name, config=None):
"""
Set configuration data for a model.
:param int node_id: node id to set model configuration for
:param str model_name: model to set configuration for
:param dict config: configuration data to set for model
:return: nothing
"""
# get model class to configure
model_class = self.models.get(model_name)
if not model_class:
raise ValueError("%s is an invalid model" % model_name)
# retrieve default values
model_config = self.get_model_config(node_id, model_name)
if not config:
config = {}
for key, value in config.iteritems():
model_config[key] = value
# set as node model for startup
self.node_models[node_id] = model_name
# set configuration
self.set_configs(model_config, node_id=node_id, config_type=model_name)
def get_model_config(self, node_id, model_name):
"""
Set configuration data for a model.
:param int node_id: node id to set model configuration for
:param str model_name: model to set configuration for
:return: current model configuration for node
:rtype: dict
"""
# get model class to configure
model_class = self.models.get(model_name)
if not model_class:
raise ValueError("%s is an invalid model" % model_name)
config = self.get_configs(node_id=node_id, config_type=model_name)
if not config:
# set default values, when not already set
config = model_class.default_values()
self.set_configs(config, node_id=node_id, config_type=model_name)
return config
def set_model(self, node, model_class, config=None):
"""
Set model and model configuration for node.
:param node: node to set model for
:param model_class: model class to set for node
:param dict config: model configuration, None for default configuration
:return: nothing
"""
logging.info("setting mobility model(%s) for node(%s): %s", model_class.name, node.objid, config)
self.set_model_config(node.objid, model_class.name, config)
config = self.get_model_config(node.objid, model_class.name)
node.setmodel(model_class, config)
def get_models(self, node):
"""
Return a list of model classes and values for a net if one has been
configured. This is invoked when exporting a session to XML.
:param node: network node to get models for
:return: list of model and values tuples for the network node
:rtype: list
"""
all_configs = self.get_all_configs(node.objid)
if not all_configs:
all_configs = {}
models = []
for model_name, config in all_configs.iteritems():
if model_name == ModelManager._default_node:
continue
model_class = self.models[model_name]
models.append((model_class, config))
logging.debug("models for node(%s): %s", node.objid, models)
return models

385
daemon/core/config.py Normal file
View file

@ -0,0 +1,385 @@
"""
Common support for configurable CORE objects.
"""
import logging
from collections import OrderedDict
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Any, Optional, Union
from core.emane.nodes import EmaneNet
from core.emulator.enumerations import ConfigDataTypes
from core.errors import CoreConfigError
from core.nodes.network import WlanNode
logger = logging.getLogger(__name__)
if TYPE_CHECKING:
from core.location.mobility import WirelessModel
WirelessModelType = type[WirelessModel]
_BOOL_OPTIONS: set[str] = {"0", "1"}
@dataclass
class ConfigGroup:
"""
Defines configuration group tabs used for display by ConfigurationOptions.
"""
name: str
start: int
stop: int
@dataclass
class Configuration:
"""
Represents a configuration option.
"""
id: str
type: ConfigDataTypes
label: str = None
default: str = ""
options: list[str] = field(default_factory=list)
group: str = "Configuration"
def __post_init__(self) -> None:
self.label = self.label if self.label else self.id
if self.type == ConfigDataTypes.BOOL:
if self.default and self.default not in _BOOL_OPTIONS:
raise CoreConfigError(
f"{self.id} bool value must be one of: {_BOOL_OPTIONS}: "
f"{self.default}"
)
elif self.type == ConfigDataTypes.FLOAT:
if self.default:
try:
float(self.default)
except ValueError:
raise CoreConfigError(
f"{self.id} is not a valid float: {self.default}"
)
elif self.type != ConfigDataTypes.STRING:
if self.default:
try:
int(self.default)
except ValueError:
raise CoreConfigError(
f"{self.id} is not a valid int: {self.default}"
)
@dataclass
class ConfigBool(Configuration):
"""
Represents a boolean configuration option.
"""
type: ConfigDataTypes = ConfigDataTypes.BOOL
value: bool = False
@dataclass
class ConfigFloat(Configuration):
"""
Represents a float configuration option.
"""
type: ConfigDataTypes = ConfigDataTypes.FLOAT
value: float = 0.0
@dataclass
class ConfigInt(Configuration):
"""
Represents an integer configuration option.
"""
type: ConfigDataTypes = ConfigDataTypes.INT32
value: int = 0
@dataclass
class ConfigString(Configuration):
"""
Represents a string configuration option.
"""
type: ConfigDataTypes = ConfigDataTypes.STRING
value: str = ""
class ConfigurableOptions:
"""
Provides a base for defining configuration options within CORE.
"""
name: Optional[str] = None
options: list[Configuration] = []
@classmethod
def configurations(cls) -> list[Configuration]:
"""
Provides the configurations for this class.
:return: configurations
"""
return cls.options
@classmethod
def config_groups(cls) -> list[ConfigGroup]:
"""
Defines how configurations are grouped.
:return: configuration group definition
"""
return [ConfigGroup("Options", 1, len(cls.configurations()))]
@classmethod
def default_values(cls) -> dict[str, str]:
"""
Provides an ordered mapping of configuration keys to default values.
:return: ordered configuration mapping default values
"""
return OrderedDict(
[(config.id, config.default) for config in cls.configurations()]
)
class ConfigurableManager:
"""
Provides convenience methods for storing and retrieving configuration options for
nodes.
"""
_default_node: int = -1
_default_type: int = _default_node
def __init__(self) -> None:
"""
Creates a ConfigurableManager object.
"""
self.node_configurations = {}
def nodes(self) -> list[int]:
"""
Retrieves the ids of all node configurations known by this manager.
:return: list of node ids
"""
return [x for x in self.node_configurations if x != self._default_node]
def config_reset(self, node_id: int = None) -> None:
"""
Clears all configurations or configuration for a specific node.
:param node_id: node id to clear configurations for, default is None and clears
all configurations
:return: nothing
"""
if not node_id:
self.node_configurations.clear()
elif node_id in self.node_configurations:
self.node_configurations.pop(node_id)
def set_config(
self,
_id: str,
value: str,
node_id: int = _default_node,
config_type: str = _default_type,
) -> None:
"""
Set a specific configuration value for a node and configuration type.
:param _id: configuration key
:param value: configuration value
:param node_id: node id to store configuration for
:param config_type: configuration type to store configuration for
:return: nothing
"""
node_configs = self.node_configurations.setdefault(node_id, OrderedDict())
node_type_configs = node_configs.setdefault(config_type, OrderedDict())
node_type_configs[_id] = value
def set_configs(
self,
config: dict[str, str],
node_id: int = _default_node,
config_type: str = _default_type,
) -> None:
"""
Set configurations for a node and configuration type.
:param config: configurations to set
:param node_id: node id to store configuration for
:param config_type: configuration type to store configuration for
:return: nothing
"""
logger.debug(
"setting config for node(%s) type(%s): %s", node_id, config_type, config
)
node_configs = self.node_configurations.setdefault(node_id, OrderedDict())
node_configs[config_type] = config
def get_config(
self,
_id: str,
node_id: int = _default_node,
config_type: str = _default_type,
default: str = None,
) -> str:
"""
Retrieves a specific configuration for a node and configuration type.
:param _id: specific configuration to retrieve
:param node_id: node id to store configuration for
:param config_type: configuration type to store configuration for
:param default: default value to return when value is not found
:return: configuration value
"""
result = default
node_type_configs = self.get_configs(node_id, config_type)
if node_type_configs:
result = node_type_configs.get(_id, default)
return result
def get_configs(
self, node_id: int = _default_node, config_type: str = _default_type
) -> Optional[dict[str, str]]:
"""
Retrieve configurations for a node and configuration type.
:param node_id: node id to store configuration for
:param config_type: configuration type to store configuration for
:return: configurations
"""
result = None
node_configs = self.node_configurations.get(node_id)
if node_configs:
result = node_configs.get(config_type)
return result
def get_all_configs(self, node_id: int = _default_node) -> dict[str, Any]:
"""
Retrieve all current configuration types for a node.
:param node_id: node id to retrieve configurations for
:return: all configuration types for a node
"""
return self.node_configurations.get(node_id)
class ModelManager(ConfigurableManager):
"""
Helps handle setting models for nodes and managing their model configurations.
"""
def __init__(self) -> None:
"""
Creates a ModelManager object.
"""
super().__init__()
self.models: dict[str, Any] = {}
self.node_models: dict[int, str] = {}
def set_model_config(
self, node_id: int, model_name: str, config: dict[str, str] = None
) -> None:
"""
Set configuration data for a model.
:param node_id: node id to set model configuration for
:param model_name: model to set configuration for
:param config: configuration data to set for model
:return: nothing
"""
# get model class to configure
model_class = self.models.get(model_name)
if not model_class:
raise ValueError(f"{model_name} is an invalid model")
# retrieve default values
model_config = self.get_model_config(node_id, model_name)
if not config:
config = {}
for key in config:
value = config[key]
model_config[key] = value
# set as node model for startup
self.node_models[node_id] = model_name
# set configuration
self.set_configs(model_config, node_id=node_id, config_type=model_name)
def get_model_config(self, node_id: int, model_name: str) -> dict[str, str]:
"""
Retrieve configuration data for a model.
:param node_id: node id to set model configuration for
:param model_name: model to set configuration for
:return: current model configuration for node
"""
# get model class to configure
model_class = self.models.get(model_name)
if not model_class:
raise ValueError(f"{model_name} is an invalid model")
config = self.get_configs(node_id=node_id, config_type=model_name)
if not config:
# set default values, when not already set
config = model_class.default_values()
self.set_configs(config, node_id=node_id, config_type=model_name)
return config
def set_model(
self,
node: Union[WlanNode, EmaneNet],
model_class: "WirelessModelType",
config: dict[str, str] = None,
) -> None:
"""
Set model and model configuration for node.
:param node: node to set model for
:param model_class: model class to set for node
:param config: model configuration, None for default configuration
:return: nothing
"""
logger.debug(
"setting model(%s) for node(%s): %s", model_class.name, node.id, config
)
self.set_model_config(node.id, model_class.name, config)
config = self.get_model_config(node.id, model_class.name)
node.setmodel(model_class, config)
def get_models(
self, node: Union[WlanNode, EmaneNet]
) -> list[tuple[type, dict[str, str]]]:
"""
Return a list of model classes and values for a net if one has been
configured. This is invoked when exporting a session to XML.
:param node: network node to get models for
:return: list of model and values tuples for the network node
"""
all_configs = self.get_all_configs(node.id)
if not all_configs:
all_configs = {}
models = []
for model_name in all_configs:
config = all_configs[model_name]
if model_name == ModelManager._default_node:
continue
model_class = self.models[model_name]
models.append((model_class, config))
logger.debug("models for node(%s): %s", node.id, models)
return models

View file

@ -0,0 +1,510 @@
import abc
import enum
import inspect
import logging
import time
from dataclasses import dataclass
from pathlib import Path
from typing import Any, Optional
from mako import exceptions
from mako.lookup import TemplateLookup
from mako.template import Template
from core.config import Configuration
from core.errors import CoreCommandError, CoreError
from core.nodes.base import CoreNode
logger = logging.getLogger(__name__)
TEMPLATES_DIR: str = "templates"
def get_template_path(file_path: Path) -> str:
"""
Utility to convert a given file path to a valid template path format.
:param file_path: file path to convert
:return: template path
"""
if file_path.is_absolute():
template_path = str(file_path.relative_to("/"))
else:
template_path = str(file_path)
return template_path
class ConfigServiceMode(enum.Enum):
BLOCKING = 0
NON_BLOCKING = 1
TIMER = 2
class ConfigServiceBootError(Exception):
pass
class ConfigServiceTemplateError(Exception):
pass
@dataclass
class ShadowDir:
path: str
src: Optional[str] = None
templates: bool = False
has_node_paths: bool = False
class ConfigService(abc.ABC):
"""
Base class for creating configurable services.
"""
# validation period in seconds, how frequent validation is attempted
validation_period: float = 0.5
# time to wait in seconds for determining if service started successfully
validation_timer: int = 5
# directories to shadow and copy files from
shadow_directories: list[ShadowDir] = []
def __init__(self, node: CoreNode) -> None:
"""
Create ConfigService instance.
:param node: node this service is assigned to
"""
self.node: CoreNode = node
class_file = inspect.getfile(self.__class__)
templates_path = Path(class_file).parent.joinpath(TEMPLATES_DIR)
self.templates: TemplateLookup = TemplateLookup(directories=templates_path)
self.config: dict[str, Configuration] = {}
self.custom_templates: dict[str, str] = {}
self.custom_config: dict[str, str] = {}
configs = self.default_configs[:]
self._define_config(configs)
@staticmethod
def clean_text(text: str) -> str:
"""
Returns space stripped text for string literals, while keeping space
indentations.
:param text: text to clean
:return: cleaned text
"""
return inspect.cleandoc(text)
@property
@abc.abstractmethod
def name(self) -> str:
raise NotImplementedError
@property
@abc.abstractmethod
def group(self) -> str:
raise NotImplementedError
@property
@abc.abstractmethod
def directories(self) -> list[str]:
raise NotImplementedError
@property
@abc.abstractmethod
def files(self) -> list[str]:
raise NotImplementedError
@property
@abc.abstractmethod
def default_configs(self) -> list[Configuration]:
raise NotImplementedError
@property
@abc.abstractmethod
def modes(self) -> dict[str, dict[str, str]]:
raise NotImplementedError
@property
@abc.abstractmethod
def executables(self) -> list[str]:
raise NotImplementedError
@property
@abc.abstractmethod
def dependencies(self) -> list[str]:
raise NotImplementedError
@property
@abc.abstractmethod
def startup(self) -> list[str]:
raise NotImplementedError
@property
@abc.abstractmethod
def validate(self) -> list[str]:
raise NotImplementedError
@property
@abc.abstractmethod
def shutdown(self) -> list[str]:
raise NotImplementedError
@property
@abc.abstractmethod
def validation_mode(self) -> ConfigServiceMode:
raise NotImplementedError
def start(self) -> None:
"""
Creates services files/directories, runs startup, and validates based on
validation mode.
:return: nothing
:raises ConfigServiceBootError: when there is an error starting service
"""
logger.info("node(%s) service(%s) starting...", self.node.name, self.name)
self.create_shadow_dirs()
self.create_dirs()
self.create_files()
wait = self.validation_mode == ConfigServiceMode.BLOCKING
self.run_startup(wait)
if not wait:
if self.validation_mode == ConfigServiceMode.TIMER:
self.wait_validation()
else:
self.run_validation()
def stop(self) -> None:
"""
Stop service using shutdown commands.
:return: nothing
"""
for cmd in self.shutdown:
try:
self.node.cmd(cmd)
except CoreCommandError:
logger.exception(
f"node({self.node.name}) service({self.name}) "
f"failed shutdown: {cmd}"
)
def restart(self) -> None:
"""
Restarts service by running stop and then start.
:return: nothing
"""
self.stop()
self.start()
def create_shadow_dirs(self) -> None:
"""
Creates a shadow of a host system directory recursively
to be mapped and live within a node.
:return: nothing
:raises CoreError: when there is a failure creating a directory or file
"""
for shadow_dir in self.shadow_directories:
# setup shadow and src paths, using node unique paths when configured
shadow_path = Path(shadow_dir.path)
if shadow_dir.src is None:
src_path = shadow_path
else:
src_path = Path(shadow_dir.src)
if shadow_dir.has_node_paths:
src_path = src_path / self.node.name
# validate shadow and src paths
if not shadow_path.is_absolute():
raise CoreError(f"shadow dir({shadow_path}) is not absolute")
if not src_path.is_absolute():
raise CoreError(f"shadow source dir({src_path}) is not absolute")
if not src_path.is_dir():
raise CoreError(f"shadow source dir({src_path}) does not exist")
# create root of the shadow path within node
logger.info(
"node(%s) creating shadow directory(%s) src(%s) node paths(%s) "
"templates(%s)",
self.node.name,
shadow_path,
src_path,
shadow_dir.has_node_paths,
shadow_dir.templates,
)
self.node.create_dir(shadow_path)
# find all directories and files to create
dir_paths = []
file_paths = []
for path in src_path.rglob("*"):
shadow_src_path = shadow_path / path.relative_to(src_path)
if path.is_dir():
dir_paths.append(shadow_src_path)
else:
file_paths.append((path, shadow_src_path))
# create all directories within node
for path in dir_paths:
self.node.create_dir(path)
# create all files within node, from templates when configured
data = self.data()
templates = TemplateLookup(directories=src_path)
for path, dst_path in file_paths:
if shadow_dir.templates:
template = templates.get_template(path.name)
rendered = self._render(template, data)
self.node.create_file(dst_path, rendered)
else:
self.node.copy_file(path, dst_path)
def create_dirs(self) -> None:
"""
Creates directories for service.
:return: nothing
:raises CoreError: when there is a failure creating a directory
"""
logger.debug("creating config service directories")
for directory in sorted(self.directories):
dir_path = Path(directory)
try:
self.node.create_dir(dir_path)
except (CoreCommandError, CoreError):
raise CoreError(
f"node({self.node.name}) service({self.name}) "
f"failure to create service directory: {directory}"
)
def data(self) -> dict[str, Any]:
"""
Returns key/value data, used when rendering file templates.
:return: key/value template data
"""
return {}
def set_template(self, name: str, template: str) -> None:
"""
Store custom template to render for a given file.
:param name: file to store custom template for
:param template: custom template to render
:return: nothing
"""
self.custom_templates[name] = template
def get_text_template(self, name: str) -> str:
"""
Retrieves text based template for files that do not have a file based template.
:param name: name of file to get template for
:return: template to render
"""
raise CoreError(f"service({self.name}) unknown template({name})")
def get_templates(self) -> dict[str, str]:
"""
Retrieves mapping of file names to templates for all cases, which
includes custom templates, file templates, and text templates.
:return: mapping of files to templates
"""
templates = {}
for file in self.files:
file_path = Path(file)
template_path = get_template_path(file_path)
if file in self.custom_templates:
template = self.custom_templates[file]
template = self.clean_text(template)
elif self.templates.has_template(template_path):
template = self.templates.get_template(template_path).source
else:
try:
template = self.get_text_template(file)
except Exception as e:
raise ConfigServiceTemplateError(
f"node({self.node.name}) service({self.name}) file({file}) "
f"failure getting template: {e}"
)
template = self.clean_text(template)
templates[file] = template
return templates
def get_rendered_templates(self) -> dict[str, str]:
templates = {}
data = self.data()
for file in sorted(self.files):
rendered = self._get_rendered_template(file, data)
templates[file] = rendered
return templates
def _get_rendered_template(self, file: str, data: dict[str, Any]) -> str:
file_path = Path(file)
template_path = get_template_path(file_path)
if file in self.custom_templates:
text = self.custom_templates[file]
rendered = self.render_text(text, data)
elif self.templates.has_template(template_path):
rendered = self.render_template(template_path, data)
else:
try:
text = self.get_text_template(file)
except Exception as e:
raise ConfigServiceTemplateError(
f"node({self.node.name}) service({self.name}) file({file}) "
f"failure getting template: {e}"
)
rendered = self.render_text(text, data)
return rendered
def create_files(self) -> None:
"""
Creates service files inside associated node.
:return: nothing
"""
data = self.data()
for file in sorted(self.files):
logger.debug(
"node(%s) service(%s) template(%s)", self.node.name, self.name, file
)
rendered = self._get_rendered_template(file, data)
file_path = Path(file)
self.node.create_file(file_path, rendered)
def run_startup(self, wait: bool) -> None:
"""
Run startup commands for service on node.
:param wait: wait successful command exit status when True, ignore status
otherwise
:return: nothing
:raises ConfigServiceBootError: when a command that waits fails
"""
for cmd in self.startup:
try:
self.node.cmd(cmd, wait=wait)
except CoreCommandError as e:
raise ConfigServiceBootError(
f"node({self.node.name}) service({self.name}) failed startup: {e}"
)
def wait_validation(self) -> None:
"""
Waits for a period of time to consider service started successfully.
:return: nothing
"""
time.sleep(self.validation_timer)
def run_validation(self) -> None:
"""
Runs validation commands for service on node.
:return: nothing
:raises ConfigServiceBootError: if there is a validation failure
"""
start = time.monotonic()
cmds = self.validate[:]
index = 0
while cmds:
cmd = cmds[index]
try:
self.node.cmd(cmd)
del cmds[index]
index += 1
except CoreCommandError:
logger.debug(
f"node({self.node.name}) service({self.name}) "
f"validate command failed: {cmd}"
)
time.sleep(self.validation_period)
if cmds and time.monotonic() - start > self.validation_timer:
raise ConfigServiceBootError(
f"node({self.node.name}) service({self.name}) failed to validate"
)
def _render(self, template: Template, data: dict[str, Any] = None) -> str:
"""
Renders template providing all associated data to template.
:param template: template to render
:param data: service specific defined data for template
:return: rendered template
"""
if data is None:
data = {}
return template.render_unicode(
node=self.node, config=self.render_config(), **data
)
def render_text(self, text: str, data: dict[str, Any] = None) -> str:
"""
Renders text based template providing all associated data to template.
:param text: text to render
:param data: service specific defined data for template
:return: rendered template
"""
text = self.clean_text(text)
try:
template = Template(text)
return self._render(template, data)
except Exception:
raise CoreError(
f"node({self.node.name}) service({self.name}) "
f"{exceptions.text_error_template().render_unicode()}"
)
def render_template(self, template_path: str, data: dict[str, Any] = None) -> str:
"""
Renders file based template providing all associated data to template.
:param template_path: path of file to render
:param data: service specific defined data for template
:return: rendered template
"""
try:
template = self.templates.get_template(template_path)
return self._render(template, data)
except Exception:
raise CoreError(
f"node({self.node.name}) service({self.name}) file({template_path})"
f"{exceptions.text_error_template().render_unicode()}"
)
def _define_config(self, configs: list[Configuration]) -> None:
"""
Initializes default configuration data.
:param configs: configs to initialize
:return: nothing
"""
for config in configs:
self.config[config.id] = config
def render_config(self) -> dict[str, str]:
"""
Returns configuration data key/value pairs for rendering a template.
:return: nothing
"""
if self.custom_config:
return self.custom_config
else:
return {k: v.default for k, v in self.config.items()}
def set_config(self, data: dict[str, str]) -> None:
"""
Set configuration data from key/value pairs.
:param data: configuration key/values to set
:return: nothing
:raise CoreError: when an unknown configuration value is given
"""
for key, value in data.items():
if key not in self.config:
raise CoreError(f"unknown config: {key}")
self.custom_config[key] = value

View file

@ -0,0 +1,125 @@
import logging
from typing import TYPE_CHECKING
logger = logging.getLogger(__name__)
if TYPE_CHECKING:
from core.configservice.base import ConfigService
class ConfigServiceDependencies:
"""
Generates sets of services to start in order of their dependencies.
"""
def __init__(self, services: dict[str, "ConfigService"]) -> None:
"""
Create a ConfigServiceDependencies instance.
:param services: services for determining dependency sets
"""
# helpers to check validity
self.dependents: dict[str, set[str]] = {}
self.started: set[str] = set()
self.node_services: dict[str, "ConfigService"] = {}
for service in services.values():
self.node_services[service.name] = service
for dependency in service.dependencies:
dependents = self.dependents.setdefault(dependency, set())
dependents.add(service.name)
# used to find paths
self.path: list["ConfigService"] = []
self.visited: set[str] = set()
self.visiting: set[str] = set()
def startup_paths(self) -> list[list["ConfigService"]]:
"""
Find startup path sets based on service dependencies.
:return: lists of lists of services that can be started in parallel
"""
paths = []
for name in self.node_services:
service = self.node_services[name]
if service.name in self.started:
logger.debug(
"skipping service that will already be started: %s", service.name
)
continue
path = self._start(service)
if path:
paths.append(path)
if self.started != set(self.node_services):
raise ValueError(
f"failure to start all services: {self.started} != "
f"{self.node_services.keys()}"
)
return paths
def _reset(self) -> None:
"""
Clear out metadata used for finding service dependency sets.
:return: nothing
"""
self.path = []
self.visited.clear()
self.visiting.clear()
def _start(self, service: "ConfigService") -> list["ConfigService"]:
"""
Starts a oath for checking dependencies for a given service.
:param service: service to check dependencies for
:return: list of config services to start in order
"""
logger.debug("starting service dependency check: %s", service.name)
self._reset()
return self._visit(service)
def _visit(self, current_service: "ConfigService") -> list["ConfigService"]:
"""
Visits a service when discovering dependency chains for service.
:param current_service: service being visited
:return: list of dependent services for a visited service
"""
logger.debug("visiting service(%s): %s", current_service.name, self.path)
self.visited.add(current_service.name)
self.visiting.add(current_service.name)
# dive down
for service_name in current_service.dependencies:
if service_name not in self.node_services:
raise ValueError(
"required dependency was not included in node "
f"services: {service_name}"
)
if service_name in self.visiting:
raise ValueError(
f"cyclic dependency at service({current_service.name}): "
f"{service_name}"
)
if service_name not in self.visited:
service = self.node_services[service_name]
self._visit(service)
# add service when bottom is found
logger.debug("adding service to startup path: %s", current_service.name)
self.started.add(current_service.name)
self.path.append(current_service)
self.visiting.remove(current_service.name)
# rise back up
for service_name in self.dependents.get(current_service.name, []):
if service_name not in self.visited:
service = self.node_services[service_name]
self._visit(service)
return self.path

View file

@ -0,0 +1,103 @@
import logging
import pathlib
import pkgutil
from pathlib import Path
from core import configservices, utils
from core.configservice.base import ConfigService
from core.errors import CoreError
logger = logging.getLogger(__name__)
class ConfigServiceManager:
"""
Manager for configurable services.
"""
def __init__(self):
"""
Create a ConfigServiceManager instance.
"""
self.services: dict[str, type[ConfigService]] = {}
def get_service(self, name: str) -> type[ConfigService]:
"""
Retrieve a service by name.
:param name: name of service
:return: service class
:raises CoreError: when service is not found
"""
service_class = self.services.get(name)
if service_class is None:
raise CoreError(f"service does not exist {name}")
return service_class
def add(self, service: type[ConfigService]) -> None:
"""
Add service to manager, checking service requirements have been met.
:param service: service to add to manager
:return: nothing
:raises CoreError: when service is a duplicate or has unmet executables
"""
name = service.name
logger.debug(
"loading service: class(%s) name(%s)", service.__class__.__name__, name
)
# avoid duplicate services
if name in self.services:
raise CoreError(f"duplicate service being added: {name}")
# validate dependent executables are present
for executable in service.executables:
try:
utils.which(executable, required=True)
except CoreError as e:
raise CoreError(f"config service({service.name}): {e}")
# make service available
self.services[name] = service
def load_locals(self) -> list[str]:
"""
Search and add config service from local core module.
:return: list of errors when loading services
"""
errors = []
for module_info in pkgutil.walk_packages(
configservices.__path__, f"{configservices.__name__}."
):
services = utils.load_module(module_info.name, ConfigService)
for service in services:
try:
self.add(service)
except CoreError as e:
errors.append(service.name)
logger.debug("not loading config service(%s): %s", service.name, e)
return errors
def load(self, path: Path) -> list[str]:
"""
Search path provided for config services and add them for being managed.
:param path: path to search configurable services
:return: list errors when loading services
"""
path = pathlib.Path(path)
subdirs = [x for x in path.iterdir() if x.is_dir()]
subdirs.append(path)
service_errors = []
for subdir in subdirs:
logger.debug("loading config services from: %s", subdir)
services = utils.load_classes(subdir, ConfigService)
for service in services:
try:
self.add(service)
except CoreError as e:
service_errors.append(service.name)
logger.debug("not loading service(%s): %s", service.name, e)
return service_errors

View file

@ -0,0 +1,420 @@
import abc
from typing import Any
from core.config import Configuration
from core.configservice.base import ConfigService, ConfigServiceMode
from core.emane.nodes import EmaneNet
from core.nodes.base import CoreNodeBase, NodeBase
from core.nodes.interface import DEFAULT_MTU, CoreInterface
from core.nodes.network import PtpNet, WlanNode
from core.nodes.physical import Rj45Node
from core.nodes.wireless import WirelessNode
GROUP: str = "FRR"
FRR_STATE_DIR: str = "/var/run/frr"
def is_wireless(node: NodeBase) -> bool:
"""
Check if the node is a wireless type node.
:param node: node to check type for
:return: True if wireless type, False otherwise
"""
return isinstance(node, (WlanNode, EmaneNet, WirelessNode))
def has_mtu_mismatch(iface: CoreInterface) -> bool:
"""
Helper to detect MTU mismatch and add the appropriate FRR
mtu-ignore command. This is needed when e.g. a node is linked via a
GreTap device.
"""
if iface.mtu != DEFAULT_MTU:
return True
if not iface.net:
return False
for iface in iface.net.get_ifaces():
if iface.mtu != iface.mtu:
return True
return False
def get_min_mtu(iface: CoreInterface) -> int:
"""
Helper to discover the minimum MTU of interfaces linked with the
given interface.
"""
mtu = iface.mtu
if not iface.net:
return mtu
for iface in iface.net.get_ifaces():
if iface.mtu < mtu:
mtu = iface.mtu
return mtu
def get_router_id(node: CoreNodeBase) -> str:
"""
Helper to return the first IPv4 address of a node as its router ID.
"""
for iface in node.get_ifaces(control=False):
ip4 = iface.get_ip4()
if ip4:
return str(ip4.ip)
return "0.0.0.0"
def rj45_check(iface: CoreInterface) -> bool:
"""
Helper to detect whether interface is connected an external RJ45
link.
"""
if iface.net:
for peer_iface in iface.net.get_ifaces():
if peer_iface == iface:
continue
if isinstance(peer_iface.node, Rj45Node):
return True
return False
class FRRZebra(ConfigService):
name: str = "FRRzebra"
group: str = GROUP
directories: list[str] = ["/usr/local/etc/frr", "/var/run/frr", "/var/log/frr"]
files: list[str] = [
"/usr/local/etc/frr/frr.conf",
"frrboot.sh",
"/usr/local/etc/frr/vtysh.conf",
"/usr/local/etc/frr/daemons",
]
executables: list[str] = ["zebra"]
dependencies: list[str] = []
startup: list[str] = ["bash frrboot.sh zebra"]
validate: list[str] = ["pidof zebra"]
shutdown: list[str] = ["killall zebra"]
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
def data(self) -> dict[str, Any]:
frr_conf = self.files[0]
frr_bin_search = self.node.session.options.get(
"frr_bin_search", default="/usr/local/bin /usr/bin /usr/lib/frr"
).strip('"')
frr_sbin_search = self.node.session.options.get(
"frr_sbin_search",
default="/usr/local/sbin /usr/sbin /usr/lib/frr /usr/libexec/frr",
).strip('"')
services = []
want_ip4 = False
want_ip6 = False
for service in self.node.config_services.values():
if self.name not in service.dependencies:
continue
if not isinstance(service, FrrService):
continue
if service.ipv4_routing:
want_ip4 = True
if service.ipv6_routing:
want_ip6 = True
services.append(service)
ifaces = []
for iface in self.node.get_ifaces():
ip4s = []
ip6s = []
for ip4 in iface.ip4s:
ip4s.append(str(ip4.ip))
for ip6 in iface.ip6s:
ip6s.append(str(ip6.ip))
ifaces.append((iface, ip4s, ip6s, iface.control))
return dict(
frr_conf=frr_conf,
frr_sbin_search=frr_sbin_search,
frr_bin_search=frr_bin_search,
frr_state_dir=FRR_STATE_DIR,
ifaces=ifaces,
want_ip4=want_ip4,
want_ip6=want_ip6,
services=services,
)
class FrrService(abc.ABC):
group: str = GROUP
directories: list[str] = []
files: list[str] = []
executables: list[str] = []
dependencies: list[str] = ["FRRzebra"]
startup: list[str] = []
validate: list[str] = []
shutdown: list[str] = []
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
ipv4_routing: bool = False
ipv6_routing: bool = False
@abc.abstractmethod
def frr_iface_config(self, iface: CoreInterface) -> str:
raise NotImplementedError
@abc.abstractmethod
def frr_config(self) -> str:
raise NotImplementedError
class FRROspfv2(FrrService, ConfigService):
"""
The OSPFv2 service provides IPv4 routing for wired networks. It does
not build its own configuration file but has hooks for adding to the
unified frr.conf file.
"""
name: str = "FRROSPFv2"
shutdown: list[str] = ["killall ospfd"]
validate: list[str] = ["pidof ospfd"]
ipv4_routing: bool = True
def frr_config(self) -> str:
router_id = get_router_id(self.node)
addresses = []
for iface in self.node.get_ifaces(control=False):
for ip4 in iface.ip4s:
addresses.append(str(ip4))
data = dict(router_id=router_id, addresses=addresses)
text = """
router ospf
router-id ${router_id}
% for addr in addresses:
network ${addr} area 0
% endfor
ospf opaque-lsa
!
"""
return self.render_text(text, data)
def frr_iface_config(self, iface: CoreInterface) -> str:
has_mtu = has_mtu_mismatch(iface)
has_rj45 = rj45_check(iface)
is_ptp = isinstance(iface.net, PtpNet)
data = dict(has_mtu=has_mtu, is_ptp=is_ptp, has_rj45=has_rj45)
text = """
% if has_mtu:
ip ospf mtu-ignore
% endif
% if has_rj45:
<% return STOP_RENDERING %>
% endif
% if is_ptp:
ip ospf network point-to-point
% endif
ip ospf hello-interval 2
ip ospf dead-interval 6
ip ospf retransmit-interval 5
"""
return self.render_text(text, data)
class FRROspfv3(FrrService, ConfigService):
"""
The OSPFv3 service provides IPv6 routing for wired networks. It does
not build its own configuration file but has hooks for adding to the
unified frr.conf file.
"""
name: str = "FRROSPFv3"
shutdown: list[str] = ["killall ospf6d"]
validate: list[str] = ["pidof ospf6d"]
ipv4_routing: bool = True
ipv6_routing: bool = True
def frr_config(self) -> str:
router_id = get_router_id(self.node)
ifnames = []
for iface in self.node.get_ifaces(control=False):
ifnames.append(iface.name)
data = dict(router_id=router_id, ifnames=ifnames)
text = """
router ospf6
router-id ${router_id}
% for ifname in ifnames:
interface ${ifname} area 0.0.0.0
% endfor
!
"""
return self.render_text(text, data)
def frr_iface_config(self, iface: CoreInterface) -> str:
mtu = get_min_mtu(iface)
if mtu < iface.mtu:
return f"ipv6 ospf6 ifmtu {mtu}"
else:
return ""
class FRRBgp(FrrService, ConfigService):
"""
The BGP service provides interdomain routing.
Peers must be manually configured, with a full mesh for those
having the same AS number.
"""
name: str = "FRRBGP"
shutdown: list[str] = ["killall bgpd"]
validate: list[str] = ["pidof bgpd"]
custom_needed: bool = True
ipv4_routing: bool = True
ipv6_routing: bool = True
def frr_config(self) -> str:
router_id = get_router_id(self.node)
text = f"""
! BGP configuration
! You should configure the AS number below
! along with this router's peers.
router bgp {self.node.id}
bgp router-id {router_id}
redistribute connected
!neighbor 1.2.3.4 remote-as 555
!
"""
return self.clean_text(text)
def frr_iface_config(self, iface: CoreInterface) -> str:
return ""
class FRRRip(FrrService, ConfigService):
"""
The RIP service provides IPv4 routing for wired networks.
"""
name: str = "FRRRIP"
shutdown: list[str] = ["killall ripd"]
validate: list[str] = ["pidof ripd"]
ipv4_routing: bool = True
def frr_config(self) -> str:
text = """
router rip
redistribute static
redistribute connected
redistribute ospf
network 0.0.0.0/0
!
"""
return self.clean_text(text)
def frr_iface_config(self, iface: CoreInterface) -> str:
return ""
class FRRRipng(FrrService, ConfigService):
"""
The RIP NG service provides IPv6 routing for wired networks.
"""
name: str = "FRRRIPNG"
shutdown: list[str] = ["killall ripngd"]
validate: list[str] = ["pidof ripngd"]
ipv6_routing: bool = True
def frr_config(self) -> str:
text = """
router ripng
redistribute static
redistribute connected
redistribute ospf6
network ::/0
!
"""
return self.clean_text(text)
def frr_iface_config(self, iface: CoreInterface) -> str:
return ""
class FRRBabel(FrrService, ConfigService):
"""
The Babel service provides a loop-avoiding distance-vector routing
protocol for IPv6 and IPv4 with fast convergence properties.
"""
name: str = "FRRBabel"
shutdown: list[str] = ["killall babeld"]
validate: list[str] = ["pidof babeld"]
ipv6_routing: bool = True
def frr_config(self) -> str:
ifnames = []
for iface in self.node.get_ifaces(control=False):
ifnames.append(iface.name)
text = """
router babel
% for ifname in ifnames:
network ${ifname}
% endfor
redistribute static
redistribute ipv4 connected
!
"""
data = dict(ifnames=ifnames)
return self.render_text(text, data)
def frr_iface_config(self, iface: CoreInterface) -> str:
if is_wireless(iface.net):
text = """
babel wireless
no babel split-horizon
"""
else:
text = """
babel wired
babel split-horizon
"""
return self.clean_text(text)
class FRRpimd(FrrService, ConfigService):
"""
PIM multicast routing based on XORP.
"""
name: str = "FRRpimd"
shutdown: list[str] = ["killall pimd"]
validate: list[str] = ["pidof pimd"]
ipv4_routing: bool = True
def frr_config(self) -> str:
ifname = "eth0"
for iface in self.node.get_ifaces():
if iface.name != "lo":
ifname = iface.name
break
text = f"""
router mfea
!
router igmp
!
router pim
!ip pim rp-address 10.0.0.1
ip pim bsr-candidate {ifname}
ip pim rp-candidate {ifname}
!ip pim spt-threshold interval 10 bytes 80000
!
"""
return self.clean_text(text)
def frr_iface_config(self, iface: CoreInterface) -> str:
text = """
ip mfea
ip igmp
ip pim
"""
return self.clean_text(text)

View file

@ -0,0 +1,109 @@
#!/bin/sh
# auto-generated by zebra service (frr.py)
FRR_CONF="${frr_conf}"
FRR_SBIN_SEARCH="${frr_sbin_search}"
FRR_BIN_SEARCH="${frr_bin_search}"
FRR_STATE_DIR="${frr_state_dir}"
searchforprog()
{
prog=$1
searchpath=$@
ret=
for p in $searchpath; do
if [ -x $p/$prog ]; then
ret=$p
break
fi
done
echo $ret
}
confcheck()
{
CONF_DIR=`dirname $FRR_CONF`
# if /etc/frr exists, point /etc/frr/frr.conf -> CONF_DIR
if [ "$CONF_DIR" != "/etc/frr" ] && [ -d /etc/frr ] && [ ! -e /etc/frr/frr.conf ]; then
ln -s $CONF_DIR/frr.conf /etc/frr/frr.conf
fi
# if /etc/frr exists, point /etc/frr/vtysh.conf -> CONF_DIR
if [ "$CONF_DIR" != "/etc/frr" ] && [ -d /etc/frr ] && [ ! -e /etc/frr/vtysh.conf ]; then
ln -s $CONF_DIR/vtysh.conf /etc/frr/vtysh.conf
fi
}
bootdaemon()
{
FRR_SBIN_DIR=$(searchforprog $1 $FRR_SBIN_SEARCH)
if [ "z$FRR_SBIN_DIR" = "z" ]; then
echo "ERROR: FRR's '$1' daemon not found in search path:"
echo " $FRR_SBIN_SEARCH"
return 1
fi
flags=""
if [ "$1" = "pimd" ] && \\
grep -E -q '^[[:space:]]*router[[:space:]]+pim6[[:space:]]*$' $FRR_CONF; then
flags="$flags -6"
fi
if [ "$1" = "ospfd" ]; then
flags="$flags --apiserver"
fi
#force FRR to use CORE generated conf file
flags="$flags -d -f $FRR_CONF"
$FRR_SBIN_DIR/$1 $flags
if [ "$?" != "0" ]; then
echo "ERROR: FRR's '$1' daemon failed to start!:"
return 1
fi
}
bootfrr()
{
FRR_BIN_DIR=$(searchforprog 'vtysh' $FRR_BIN_SEARCH)
if [ "z$FRR_BIN_DIR" = "z" ]; then
echo "ERROR: FRR's 'vtysh' program not found in search path:"
echo " $FRR_BIN_SEARCH"
return 1
fi
# fix /var/run/frr permissions
id -u frr 2>/dev/null >/dev/null
if [ "$?" = "0" ]; then
chown frr $FRR_STATE_DIR
fi
bootdaemon "zebra"
if grep -q "^ip route " $FRR_CONF; then
bootdaemon "staticd"
fi
for r in rip ripng ospf6 ospf bgp babel; do
if grep -q "^router \\<$${}{r}\\>" $FRR_CONF; then
bootdaemon "$${}{r}d"
fi
done
if grep -E -q '^[[:space:]]*router[[:space:]]+pim6?[[:space:]]*$' $FRR_CONF; then
bootdaemon "pimd"
fi
$FRR_BIN_DIR/vtysh -b
}
if [ "$1" != "zebra" ]; then
echo "WARNING: '$1': all FRR daemons are launched by the 'zebra' service!"
exit 1
fi
confcheck
bootfrr
# reset interfaces
% for iface, _, _ , _ in ifaces:
ip link set dev ${iface.name} down
sleep 1
ip link set dev ${iface.name} up
% endfor

View file

@ -0,0 +1,60 @@
#
# When activation a daemon at the first time, a config file, even if it is
# empty, has to be present *and* be owned by the user and group "frr", else
# the daemon will not be started by /etc/init.d/frr. The permissions should
# be u=rw,g=r,o=.
# When using "vtysh" such a config file is also needed. It should be owned by
# group "frrvty" and set to ug=rw,o= though. Check /etc/pam.d/frr, too.
#
# The watchfrr and zebra daemons are always started.
#
bgpd=yes
ospfd=yes
ospf6d=yes
ripd=yes
ripngd=yes
isisd=yes
pimd=yes
ldpd=yes
nhrpd=yes
eigrpd=yes
babeld=yes
sharpd=yes
staticd=yes
pbrd=yes
bfdd=yes
fabricd=yes
#
# If this option is set the /etc/init.d/frr script automatically loads
# the config via "vtysh -b" when the servers are started.
# Check /etc/pam.d/frr if you intend to use "vtysh"!
#
vtysh_enable=yes
zebra_options=" -A 127.0.0.1 -s 90000000"
bgpd_options=" -A 127.0.0.1"
ospfd_options=" -A 127.0.0.1"
ospf6d_options=" -A ::1"
ripd_options=" -A 127.0.0.1"
ripngd_options=" -A ::1"
isisd_options=" -A 127.0.0.1"
pimd_options=" -A 127.0.0.1"
ldpd_options=" -A 127.0.0.1"
nhrpd_options=" -A 127.0.0.1"
eigrpd_options=" -A 127.0.0.1"
babeld_options=" -A 127.0.0.1"
sharpd_options=" -A 127.0.0.1"
pbrd_options=" -A 127.0.0.1"
staticd_options="-A 127.0.0.1"
bfdd_options=" -A 127.0.0.1"
fabricd_options="-A 127.0.0.1"
# The list of daemons to watch is automatically generated by the init script.
#watchfrr_options=""
# for debugging purposes, you can specify a "wrap" command to start instead
# of starting the daemon directly, e.g. to use valgrind on ospfd:
# ospfd_wrap="/usr/bin/valgrind"
# or you can use "all_wrap" for all daemons, e.g. to use perf record:
# all_wrap="/usr/bin/perf record --call-graph -"
# the normal daemon command is added to this at the end.

View file

@ -0,0 +1,25 @@
% for iface, ip4s, ip6s, is_control in ifaces:
interface ${iface.name}
% if want_ip4:
% for addr in ip4s:
ip address ${addr}
% endfor
% endif
% if want_ip6:
% for addr in ip6s:
ipv6 address ${addr}
% endfor
% endif
% if not is_control:
% for service in services:
% for line in service.frr_iface_config(iface).split("\n"):
${line}
% endfor
% endfor
% endif
!
% endfor
% for service in services:
${service.frr_config()}
% endfor

View file

@ -0,0 +1 @@
service integrated-vtysh-config

View file

@ -0,0 +1,164 @@
from typing import Any
from core import utils
from core.config import Configuration
from core.configservice.base import ConfigService, ConfigServiceMode
GROUP: str = "ProtoSvc"
class MgenSinkService(ConfigService):
name: str = "MGEN_Sink"
group: str = GROUP
directories: list[str] = []
files: list[str] = ["mgensink.sh", "sink.mgen"]
executables: list[str] = ["mgen"]
dependencies: list[str] = []
startup: list[str] = ["bash mgensink.sh"]
validate: list[str] = ["pidof mgen"]
shutdown: list[str] = ["killall mgen"]
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
def data(self) -> dict[str, Any]:
ifnames = []
for iface in self.node.get_ifaces():
name = utils.sysctl_devname(iface.name)
ifnames.append(name)
return dict(ifnames=ifnames)
class NrlNhdp(ConfigService):
name: str = "NHDP"
group: str = GROUP
directories: list[str] = []
files: list[str] = ["nrlnhdp.sh"]
executables: list[str] = ["nrlnhdp"]
dependencies: list[str] = []
startup: list[str] = ["bash nrlnhdp.sh"]
validate: list[str] = ["pidof nrlnhdp"]
shutdown: list[str] = ["killall nrlnhdp"]
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
def data(self) -> dict[str, Any]:
has_smf = "SMF" in self.node.config_services
ifnames = []
for iface in self.node.get_ifaces(control=False):
ifnames.append(iface.name)
return dict(has_smf=has_smf, ifnames=ifnames)
class NrlSmf(ConfigService):
name: str = "SMF"
group: str = GROUP
directories: list[str] = []
files: list[str] = ["startsmf.sh"]
executables: list[str] = ["nrlsmf", "killall"]
dependencies: list[str] = []
startup: list[str] = ["bash startsmf.sh"]
validate: list[str] = ["pidof nrlsmf"]
shutdown: list[str] = ["killall nrlsmf"]
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
def data(self) -> dict[str, Any]:
has_nhdp = "NHDP" in self.node.config_services
has_olsr = "OLSR" in self.node.config_services
ifnames = []
ip4_prefix = None
for iface in self.node.get_ifaces(control=False):
ifnames.append(iface.name)
ip4 = iface.get_ip4()
if ip4:
ip4_prefix = f"{ip4.ip}/{24}"
break
return dict(
has_nhdp=has_nhdp, has_olsr=has_olsr, ifnames=ifnames, ip4_prefix=ip4_prefix
)
class NrlOlsr(ConfigService):
name: str = "OLSR"
group: str = GROUP
directories: list[str] = []
files: list[str] = ["nrlolsrd.sh"]
executables: list[str] = ["nrlolsrd"]
dependencies: list[str] = []
startup: list[str] = ["bash nrlolsrd.sh"]
validate: list[str] = ["pidof nrlolsrd"]
shutdown: list[str] = ["killall nrlolsrd"]
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
def data(self) -> dict[str, Any]:
has_smf = "SMF" in self.node.config_services
has_zebra = "zebra" in self.node.config_services
ifname = None
for iface in self.node.get_ifaces(control=False):
ifname = iface.name
break
return dict(has_smf=has_smf, has_zebra=has_zebra, ifname=ifname)
class NrlOlsrv2(ConfigService):
name: str = "OLSRv2"
group: str = GROUP
directories: list[str] = []
files: list[str] = ["nrlolsrv2.sh"]
executables: list[str] = ["nrlolsrv2"]
dependencies: list[str] = []
startup: list[str] = ["bash nrlolsrv2.sh"]
validate: list[str] = ["pidof nrlolsrv2"]
shutdown: list[str] = ["killall nrlolsrv2"]
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
def data(self) -> dict[str, Any]:
has_smf = "SMF" in self.node.config_services
ifnames = []
for iface in self.node.get_ifaces(control=False):
ifnames.append(iface.name)
return dict(has_smf=has_smf, ifnames=ifnames)
class OlsrOrg(ConfigService):
name: str = "OLSRORG"
group: str = GROUP
directories: list[str] = ["/etc/olsrd"]
files: list[str] = ["olsrd.sh", "/etc/olsrd/olsrd.conf"]
executables: list[str] = ["olsrd"]
dependencies: list[str] = []
startup: list[str] = ["bash olsrd.sh"]
validate: list[str] = ["pidof olsrd"]
shutdown: list[str] = ["killall olsrd"]
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
def data(self) -> dict[str, Any]:
has_smf = "SMF" in self.node.config_services
ifnames = []
for iface in self.node.get_ifaces(control=False):
ifnames.append(iface.name)
return dict(has_smf=has_smf, ifnames=ifnames)
class MgenActor(ConfigService):
name: str = "MgenActor"
group: str = GROUP
directories: list[str] = []
files: list[str] = ["start_mgen_actor.sh"]
executables: list[str] = ["mgen"]
dependencies: list[str] = []
startup: list[str] = ["bash start_mgen_actor.sh"]
validate: list[str] = ["pidof mgen"]
shutdown: list[str] = ["killall mgen"]
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}

View file

@ -0,0 +1,312 @@
#
# OLSR.org routing daemon config file
# This file contains the usual options for an ETX based
# stationary network without fisheye
# (for other options see olsrd.conf.default.full)
#
# Lines starting with a # are discarded
#
#### ATTENTION for IPv6 users ####
# Because of limitations in the parser IPv6 addresses must NOT
# begin with a ":", so please add a "0" as a prefix.
###########################
### Basic configuration ###
###########################
# keep this settings at the beginning of your first configuration file
# Debug level (0-9)
# If set to 0 the daemon runs in the background, unless "NoFork" is set to true
# (Default is 1)
# DebugLevel 1
# IP version to use (4 or 6)
# (Default is 4)
# IpVersion 4
#################################
### OLSRd agent configuration ###
#################################
# this parameters control the settings of the routing agent which are not
# related to the OLSR protocol and it's extensions
# FIBMetric controls the metric value of the host-routes OLSRd sets.
# - "flat" means that the metric value is always 2. This is the preferred value
# because it helps the linux kernel routing to clean up older routes
# - "correct" use the hopcount as the metric value.
# - "approx" use the hopcount as the metric value too, but does only update the
# hopcount if the nexthop changes too
# (Default is "flat")
# FIBMetric "flat"
#######################################
### Linux specific OLSRd extensions ###
#######################################
# these parameters are only working on linux at the moment
# SrcIpRoutes tells OLSRd to set the Src flag of host routes to the originator-ip
# of the node. In addition to this an additional localhost device is created
# to make sure the returning traffic can be received.
# (Default is "no")
# SrcIpRoutes no
# Specify the proto tag to be used for routes olsr inserts into kernel
# currently only implemented for linux
# valid values under linux are 1 .. 254
# 1 gets remapped by olsrd to 0 UNSPECIFIED (1 is reserved for ICMP redirects)
# 2 KERNEL routes (not very wise to use)
# 3 BOOT (should in fact not be used by routing daemons)
# 4 STATIC
# 8 .. 15 various routing daemons (gated, zebra, bird, & co)
# (defaults to 0 which gets replaced by an OS-specific default value
# under linux 3 (BOOT) (for backward compatibility)
# RtProto 0
# Activates (in IPv6 mode) the automatic use of NIIT
# (see README-Olsr-Extensions)
# (default is "yes")
# UseNiit yes
# Activates the smartgateway ipip tunnel feature.
# See README-Olsr-Extensions for a description of smartgateways.
# (default is "no")
# SmartGateway no
# Signals that the server tunnel must always be removed on shutdown,
# irrespective of the interface up/down state during startup.
# (default is "no")
# SmartGatewayAlwaysRemoveServerTunnel no
# Determines the maximum number of gateways that can be in use at any given
# time. This setting is used to mitigate the effects of breaking connections
# (due to the selection of a new gateway) on a dynamic network.
# (default is 1)
# SmartGatewayUseCount 1
# Determines the take-down percentage for a non-current smart gateway tunnel.
# If the cost of the current smart gateway tunnel is less than this percentage
# of the cost of the non-current smart gateway tunnel, then the non-current smart
# gateway tunnel is taken down because it is then presumed to be 'too expensive'.
# This setting is only relevant when SmartGatewayUseCount is larger than 1;
# a value of 0 will result in the tunnels not being taken down proactively.
# (default is 0)
# SmartGatewayTakeDownPercentage 0
# Determines the policy routing script that is executed during startup and
# shutdown of olsrd. The script is only executed when SmartGatewayUseCount
# is set to a value larger than 1. The script must setup policy routing
# rules such that multi-gateway mode works. A sample script is included.
# (default is not set)
# SmartGatewayPolicyRoutingScript ""
# Determines the egress interfaces that are part of the multi-gateway setup and
# therefore only relevant when SmartGatewayUseCount is larger than 1 (in which
# case it must be explicitly set).
# (default is not set)
# SmartGatewayEgressInterfaces ""
# Determines the routing tables offset for multi-gateway policy routing tables
# See the policy routing script for an explanation.
# (default is 90)
# SmartGatewayTablesOffset 90
# Determines the policy routing rules offset for multi-gateway policy routing
# rules. See the policy routing script for an explanation.
# (default is 0, which indicates that the rules and tables should be aligned and
# puts this value at SmartGatewayTablesOffset - # egress interfaces -
# # olsr interfaces)
# SmartGatewayRulesOffset 87
# Allows the selection of a smartgateway with NAT (only for IPv4)
# (default is "yes")
# SmartGatewayAllowNAT yes
# Determines the period (in milliseconds) on which a new smart gateway
# selection is performed.
# (default is 10000 milliseconds)
# SmartGatewayPeriod 10000
# Determines the number of times the link state database must be stable
# before a new smart gateway is selected.
# (default is 6)
# SmartGatewayStableCount 6
# When another gateway than the current one has a cost of less than the cost
# of the current gateway multiplied by SmartGatewayThreshold then the smart
# gateway is switched to the other gateway. The unit is percentage.
# (defaults to 0)
# SmartGatewayThreshold 0
# The weighing factor for the gateway uplink bandwidth (exit link, uplink).
# See README-Olsr-Extensions for a description of smart gateways.
# (default is 1)
# SmartGatewayWeightExitLinkUp 1
# The weighing factor for the gateway downlink bandwidth (exit link, downlink).
# See README-Olsr-Extensions for a description of smart gateways.
# (default is 1)
# SmartGatewayWeightExitLinkDown 1
# The weighing factor for the ETX costs.
# See README-Olsr-Extensions for a description of smart gateways.
# (default is 1)
# SmartGatewayWeightEtx 1
# The divider for the ETX costs.
# See README-Olsr-Extensions for a description of smart gateways.
# (default is 0)
# SmartGatewayDividerEtx 0
# Defines what kind of Uplink this node will publish as a
# smartgateway. The existence of the uplink is detected by
# a route to 0.0.0.0/0, ::ffff:0:0/96 and/or 2000::/3.
# possible values are "none", "ipv4", "ipv6", "both"
# (default is "both")
# SmartGatewayUplink "both"
# Specifies if the local ipv4 uplink use NAT
# (default is "yes")
# SmartGatewayUplinkNAT yes
# Specifies the speed of the uplink in kilobit/s.
# First parameter is upstream, second parameter is downstream
# (default is 128/1024)
# SmartGatewaySpeed 128 1024
# Specifies the EXTERNAL ipv6 prefix of the uplink. A prefix
# length of more than 64 is not allowed.
# (default is 0::/0
# SmartGatewayPrefix 0::/0
##############################
### OLSR protocol settings ###
##############################
# HNA (Host network association) allows the OLSR to announce
# additional IPs or IP subnets to the net that are reachable
# through this node.
# Syntax for HNA4 is "network-address network-mask"
# Syntax for HNA6 is "network-address prefix-length"
# (default is no HNA)
Hna4
{
# Internet gateway
# 0.0.0.0 0.0.0.0
# specific small networks reachable through this node
# 15.15.0.0 255.255.255.0
}
Hna6
{
# Internet gateway
# 0:: 0
# specific small networks reachable through this node
# fec0:2200:106:0:0:0:0:0 48
}
################################
### OLSR protocol extensions ###
################################
# Link quality algorithm (only for lq level 2)
# (see README-Olsr-Extensions)
# - "etx_float", a floating point ETX with exponential aging
# - "etx_fpm", same as ext_float, but with integer arithmetic
# - "etx_ff" (ETX freifunk), an etx variant which use all OLSR
# traffic (instead of only hellos) for ETX calculation
# - "etx_ffeth", an incompatible variant of etx_ff that allows
# ethernet links with ETX 0.1.
# (defaults to "etx_ff")
# LinkQualityAlgorithm "etx_ff"
# Fisheye mechanism for TCs (0 meansoff, 1 means on)
# (default is 1)
LinkQualityFishEye 0
#####################################
### Example plugin configurations ###
#####################################
# Olsrd plugins to load
# This must be the absolute path to the file
# or the loader will use the following scheme:
# - Try the paths in the LD_LIBRARY_PATH
# environment variable.
# - The list of libraries cached in /etc/ld.so.cache
# - /lib, followed by /usr/lib
#
# the examples in this list are for linux, so check if the plugin is
# available if you use windows.
# each plugin should have a README file in it's lib subfolder
# LoadPlugin "olsrd_txtinfo.dll"
#LoadPlugin "olsrd_txtinfo.so.0.1"
#{
# the default port is 2006 but you can change it like this:
#PlParam "port" "8080"
# You can set a "accept" single address to allow to connect to
# txtinfo. If no address is specified, then localhost (127.0.0.1)
# is allowed by default. txtinfo will only use the first "accept"
# parameter specified and will ignore the rest.
# to allow a specific host:
#PlParam "accept" "172.29.44.23"
# if you set it to 0.0.0.0, it will accept all connections
#PlParam "accept" "0.0.0.0"
#}
#############################################
### OLSRD default interface configuration ###
#############################################
# the default interface section can have the same values as the following
# interface configuration. It will allow you so set common options for all
# interfaces.
InterfaceDefaults {
Ip4Broadcast 255.255.255.255
}
######################################
### OLSRd Interfaces configuration ###
######################################
# multiple interfaces can be specified for a single configuration block
# multiple configuration blocks can be specified
# WARNING, don't forget to insert your interface names here !
#Interface "<OLSRd-Interface1>" "<OLSRd-Interface2>"
#{
# Interface Mode is used to prevent unnecessary
# packet forwarding on switched ethernet interfaces
# valid Modes are "mesh" and "ether"
# (default is "mesh")
# Mode "mesh"
#}

View file

@ -0,0 +1 @@
mgen input sink.mgen output mgen_${node.name}.log

View file

@ -0,0 +1,7 @@
<%
ifaces = "-i " + " -i ".join(ifnames)
smf = ""
if has_smf:
smf = "-flooding ecds -smfClient %s_smf" % node.name
%>
nrlnhdp -l /var/log/nrlnhdp.log -rpipe ${node.name}_nhdp ${smf} ${ifaces}

View file

@ -0,0 +1,9 @@
<%
smf = ""
if has_smf:
smf = "-flooding s-mpr -smfClient %s_smf" % node.name
zebra = ""
if has_zebra:
zebra = "-z"
%>
nrlolsrd -i ${ifname} -l /var/log/nrlolsrd.log -rpipe ${node.name}_olsr ${smf} ${zebra}

View file

@ -0,0 +1,7 @@
<%
ifaces = "-i " + " -i ".join(ifnames)
smf = ""
if has_smf:
smf = "-flooding ecds -smfClient %s_smf" % node.name
%>
nrlolsrv2 -l /var/log/nrlolsrv2.log -rpipe ${node.name}_olsrv2 -p olsr ${smf} ${ifaces}

View file

@ -0,0 +1,4 @@
<%
ifaces = "-i " + " -i ".join(ifnames)
%>
olsrd ${ifaces}

View file

@ -0,0 +1,4 @@
0.0 LISTEN UDP 5000
% for ifname in ifnames:
0.0 Join 224.225.1.2 INTERFACE ${ifname}
% endfor

View file

@ -0,0 +1,3 @@
#!/bin/sh
# auto-generated by MgenActor service
mgenBasicActor.py -n ${node.name} -a 0.0.0.0 < /dev/null > /dev/null 2>&1 &

View file

@ -0,0 +1,12 @@
<%
ifaces = ",".join(ifnames)
if has_nhdp:
flood = "ecds"
elif has_olsr:
flood = "smpr"
else:
flood = "cf"
%>
#!/bin/sh
# auto-generated by NrlSmf service
nrlsmf instance ${node.name}_smf ${flood} ${ifaces} hash MD5 log /var/log/nrlsmf.log < /dev/null > /dev/null 2>&1 &

View file

@ -0,0 +1,453 @@
import abc
import logging
from typing import Any
from core.config import Configuration
from core.configservice.base import ConfigService, ConfigServiceMode
from core.emane.nodes import EmaneNet
from core.nodes.base import CoreNodeBase, NodeBase
from core.nodes.interface import DEFAULT_MTU, CoreInterface
from core.nodes.network import PtpNet, WlanNode
from core.nodes.physical import Rj45Node
from core.nodes.wireless import WirelessNode
logger = logging.getLogger(__name__)
GROUP: str = "Quagga"
QUAGGA_STATE_DIR: str = "/var/run/quagga"
def is_wireless(node: NodeBase) -> bool:
"""
Check if the node is a wireless type node.
:param node: node to check type for
:return: True if wireless type, False otherwise
"""
return isinstance(node, (WlanNode, EmaneNet, WirelessNode))
def has_mtu_mismatch(iface: CoreInterface) -> bool:
"""
Helper to detect MTU mismatch and add the appropriate OSPF
mtu-ignore command. This is needed when e.g. a node is linked via a
GreTap device.
"""
if iface.mtu != DEFAULT_MTU:
return True
if not iface.net:
return False
for iface in iface.net.get_ifaces():
if iface.mtu != iface.mtu:
return True
return False
def get_min_mtu(iface: CoreInterface):
"""
Helper to discover the minimum MTU of interfaces linked with the
given interface.
"""
mtu = iface.mtu
if not iface.net:
return mtu
for iface in iface.net.get_ifaces():
if iface.mtu < mtu:
mtu = iface.mtu
return mtu
def get_router_id(node: CoreNodeBase) -> str:
"""
Helper to return the first IPv4 address of a node as its router ID.
"""
for iface in node.get_ifaces(control=False):
ip4 = iface.get_ip4()
if ip4:
return str(ip4.ip)
return "0.0.0.0"
def rj45_check(iface: CoreInterface) -> bool:
"""
Helper to detect whether interface is connected an external RJ45
link.
"""
if iface.net:
for peer_iface in iface.net.get_ifaces():
if peer_iface == iface:
continue
if isinstance(peer_iface.node, Rj45Node):
return True
return False
class Zebra(ConfigService):
name: str = "zebra"
group: str = GROUP
directories: list[str] = ["/usr/local/etc/quagga", "/var/run/quagga"]
files: list[str] = [
"/usr/local/etc/quagga/Quagga.conf",
"quaggaboot.sh",
"/usr/local/etc/quagga/vtysh.conf",
]
executables: list[str] = ["zebra"]
dependencies: list[str] = []
startup: list[str] = ["bash quaggaboot.sh zebra"]
validate: list[str] = ["pidof zebra"]
shutdown: list[str] = ["killall zebra"]
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
def data(self) -> dict[str, Any]:
quagga_bin_search = self.node.session.options.get(
"quagga_bin_search", default="/usr/local/bin /usr/bin /usr/lib/quagga"
).strip('"')
quagga_sbin_search = self.node.session.options.get(
"quagga_sbin_search", default="/usr/local/sbin /usr/sbin /usr/lib/quagga"
).strip('"')
quagga_state_dir = QUAGGA_STATE_DIR
quagga_conf = self.files[0]
services = []
want_ip4 = False
want_ip6 = False
for service in self.node.config_services.values():
if self.name not in service.dependencies:
continue
if not isinstance(service, QuaggaService):
continue
if service.ipv4_routing:
want_ip4 = True
if service.ipv6_routing:
want_ip6 = True
services.append(service)
ifaces = []
for iface in self.node.get_ifaces():
ip4s = []
ip6s = []
for ip4 in iface.ip4s:
ip4s.append(str(ip4))
for ip6 in iface.ip6s:
ip6s.append(str(ip6))
configs = []
if not iface.control:
for service in services:
config = service.quagga_iface_config(iface)
if config:
configs.append(config.split("\n"))
ifaces.append((iface, ip4s, ip6s, configs))
return dict(
quagga_bin_search=quagga_bin_search,
quagga_sbin_search=quagga_sbin_search,
quagga_state_dir=quagga_state_dir,
quagga_conf=quagga_conf,
ifaces=ifaces,
want_ip4=want_ip4,
want_ip6=want_ip6,
services=services,
)
class QuaggaService(abc.ABC):
group: str = GROUP
directories: list[str] = []
files: list[str] = []
executables: list[str] = []
dependencies: list[str] = ["zebra"]
startup: list[str] = []
validate: list[str] = []
shutdown: list[str] = []
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
ipv4_routing: bool = False
ipv6_routing: bool = False
@abc.abstractmethod
def quagga_iface_config(self, iface: CoreInterface) -> str:
raise NotImplementedError
@abc.abstractmethod
def quagga_config(self) -> str:
raise NotImplementedError
class Ospfv2(QuaggaService, ConfigService):
"""
The OSPFv2 service provides IPv4 routing for wired networks. It does
not build its own configuration file but has hooks for adding to the
unified Quagga.conf file.
"""
name: str = "OSPFv2"
validate: list[str] = ["pidof ospfd"]
shutdown: list[str] = ["killall ospfd"]
ipv4_routing: bool = True
def quagga_iface_config(self, iface: CoreInterface) -> str:
has_mtu = has_mtu_mismatch(iface)
has_rj45 = rj45_check(iface)
is_ptp = isinstance(iface.net, PtpNet)
data = dict(has_mtu=has_mtu, is_ptp=is_ptp, has_rj45=has_rj45)
text = """
% if has_mtu:
ip ospf mtu-ignore
% endif
% if has_rj45:
<% return STOP_RENDERING %>
% endif
% if is_ptp:
ip ospf network point-to-point
% endif
ip ospf hello-interval 2
ip ospf dead-interval 6
ip ospf retransmit-interval 5
"""
return self.render_text(text, data)
def quagga_config(self) -> str:
router_id = get_router_id(self.node)
addresses = []
for iface in self.node.get_ifaces(control=False):
for ip4 in iface.ip4s:
addresses.append(str(ip4))
data = dict(router_id=router_id, addresses=addresses)
text = """
router ospf
router-id ${router_id}
% for addr in addresses:
network ${addr} area 0
% endfor
!
"""
return self.render_text(text, data)
class Ospfv3(QuaggaService, ConfigService):
"""
The OSPFv3 service provides IPv6 routing for wired networks. It does
not build its own configuration file but has hooks for adding to the
unified Quagga.conf file.
"""
name: str = "OSPFv3"
shutdown: list[str] = ["killall ospf6d"]
validate: list[str] = ["pidof ospf6d"]
ipv4_routing: bool = True
ipv6_routing: bool = True
def quagga_iface_config(self, iface: CoreInterface) -> str:
mtu = get_min_mtu(iface)
if mtu < iface.mtu:
return f"ipv6 ospf6 ifmtu {mtu}"
else:
return ""
def quagga_config(self) -> str:
router_id = get_router_id(self.node)
ifnames = []
for iface in self.node.get_ifaces(control=False):
ifnames.append(iface.name)
data = dict(router_id=router_id, ifnames=ifnames)
text = """
router ospf6
instance-id 65
router-id ${router_id}
% for ifname in ifnames:
interface ${ifname} area 0.0.0.0
% endfor
!
"""
return self.render_text(text, data)
class Ospfv3mdr(Ospfv3):
"""
The OSPFv3 MANET Designated Router (MDR) service provides IPv6
routing for wireless networks. It does not build its own
configuration file but has hooks for adding to the
unified Quagga.conf file.
"""
name: str = "OSPFv3MDR"
def quagga_iface_config(self, iface: CoreInterface) -> str:
config = super().quagga_iface_config(iface)
if is_wireless(iface.net):
config = self.clean_text(
f"""
{config}
ipv6 ospf6 hello-interval 2
ipv6 ospf6 dead-interval 6
ipv6 ospf6 retransmit-interval 5
ipv6 ospf6 network manet-designated-router
ipv6 ospf6 twohoprefresh 3
ipv6 ospf6 adjacencyconnectivity uniconnected
ipv6 ospf6 lsafullness mincostlsa
"""
)
return config
class Bgp(QuaggaService, ConfigService):
"""
The BGP service provides interdomain routing.
Peers must be manually configured, with a full mesh for those
having the same AS number.
"""
name: str = "BGP"
shutdown: list[str] = ["killall bgpd"]
validate: list[str] = ["pidof bgpd"]
ipv4_routing: bool = True
ipv6_routing: bool = True
def quagga_config(self) -> str:
router_id = get_router_id(self.node)
text = f"""
! BGP configuration
! You should configure the AS number below
! along with this router's peers.
router bgp {self.node.id}
bgp router-id {router_id}
redistribute connected
!neighbor 1.2.3.4 remote-as 555
!
"""
return self.clean_text(text)
def quagga_iface_config(self, iface: CoreInterface) -> str:
return ""
class Rip(QuaggaService, ConfigService):
"""
The RIP service provides IPv4 routing for wired networks.
"""
name: str = "RIP"
shutdown: list[str] = ["killall ripd"]
validate: list[str] = ["pidof ripd"]
ipv4_routing: bool = True
def quagga_config(self) -> str:
text = """
router rip
redistribute static
redistribute connected
redistribute ospf
network 0.0.0.0/0
!
"""
return self.clean_text(text)
def quagga_iface_config(self, iface: CoreInterface) -> str:
return ""
class Ripng(QuaggaService, ConfigService):
"""
The RIP NG service provides IPv6 routing for wired networks.
"""
name: str = "RIPNG"
shutdown: list[str] = ["killall ripngd"]
validate: list[str] = ["pidof ripngd"]
ipv6_routing: bool = True
def quagga_config(self) -> str:
text = """
router ripng
redistribute static
redistribute connected
redistribute ospf6
network ::/0
!
"""
return self.clean_text(text)
def quagga_iface_config(self, iface: CoreInterface) -> str:
return ""
class Babel(QuaggaService, ConfigService):
"""
The Babel service provides a loop-avoiding distance-vector routing
protocol for IPv6 and IPv4 with fast convergence properties.
"""
name: str = "Babel"
shutdown: list[str] = ["killall babeld"]
validate: list[str] = ["pidof babeld"]
ipv6_routing: bool = True
def quagga_config(self) -> str:
ifnames = []
for iface in self.node.get_ifaces(control=False):
ifnames.append(iface.name)
text = """
router babel
% for ifname in ifnames:
network ${ifname}
% endfor
redistribute static
redistribute connected
!
"""
data = dict(ifnames=ifnames)
return self.render_text(text, data)
def quagga_iface_config(self, iface: CoreInterface) -> str:
if is_wireless(iface.net):
text = """
babel wireless
no babel split-horizon
"""
else:
text = """
babel wired
babel split-horizon
"""
return self.clean_text(text)
class Xpimd(QuaggaService, ConfigService):
"""
PIM multicast routing based on XORP.
"""
name: str = "Xpimd"
shutdown: list[str] = ["killall xpimd"]
validate: list[str] = ["pidof xpimd"]
ipv4_routing: bool = True
def quagga_config(self) -> str:
ifname = "eth0"
for iface in self.node.get_ifaces():
if iface.name != "lo":
ifname = iface.name
break
text = f"""
router mfea
!
router igmp
!
router pim
!ip pim rp-address 10.0.0.1
ip pim bsr-candidate {ifname}
ip pim rp-candidate {ifname}
!ip pim spt-threshold interval 10 bytes 80000
!
"""
return self.clean_text(text)
def quagga_iface_config(self, iface: CoreInterface) -> str:
text = """
ip mfea
ip pim
"""
return self.clean_text(text)

View file

@ -0,0 +1,92 @@
#!/bin/sh
# auto-generated by zebra service (quagga.py)
QUAGGA_CONF="${quagga_conf}"
QUAGGA_SBIN_SEARCH="${quagga_sbin_search}"
QUAGGA_BIN_SEARCH="${quagga_bin_search}"
QUAGGA_STATE_DIR="${quagga_state_dir}"
searchforprog()
{
prog=$1
searchpath=$@
ret=
for p in $searchpath; do
if [ -x $p/$prog ]; then
ret=$p
break
fi
done
echo $ret
}
confcheck()
{
CONF_DIR=`dirname $QUAGGA_CONF`
# if /etc/quagga exists, point /etc/quagga/Quagga.conf -> CONF_DIR
if [ "$CONF_DIR" != "/etc/quagga" ] && [ -d /etc/quagga ] && [ ! -e /etc/quagga/Quagga.conf ]; then
ln -s $CONF_DIR/Quagga.conf /etc/quagga/Quagga.conf
fi
# if /etc/quagga exists, point /etc/quagga/vtysh.conf -> CONF_DIR
if [ "$CONF_DIR" != "/etc/quagga" ] && [ -d /etc/quagga ] && [ ! -e /etc/quagga/vtysh.conf ]; then
ln -s $CONF_DIR/vtysh.conf /etc/quagga/vtysh.conf
fi
}
bootdaemon()
{
QUAGGA_SBIN_DIR=$(searchforprog $1 $QUAGGA_SBIN_SEARCH)
if [ "z$QUAGGA_SBIN_DIR" = "z" ]; then
echo "ERROR: Quagga's '$1' daemon not found in search path:"
echo " $QUAGGA_SBIN_SEARCH"
return 1
fi
flags=""
if [ "$1" = "xpimd" ] && \\
grep -E -q '^[[:space:]]*router[[:space:]]+pim6[[:space:]]*$' $QUAGGA_CONF; then
flags="$flags -6"
fi
$QUAGGA_SBIN_DIR/$1 $flags -d
if [ "$?" != "0" ]; then
echo "ERROR: Quagga's '$1' daemon failed to start!:"
return 1
fi
}
bootquagga()
{
QUAGGA_BIN_DIR=$(searchforprog 'vtysh' $QUAGGA_BIN_SEARCH)
if [ "z$QUAGGA_BIN_DIR" = "z" ]; then
echo "ERROR: Quagga's 'vtysh' program not found in search path:"
echo " $QUAGGA_BIN_SEARCH"
return 1
fi
# fix /var/run/quagga permissions
id -u quagga 2>/dev/null >/dev/null
if [ "$?" = "0" ]; then
chown quagga $QUAGGA_STATE_DIR
fi
bootdaemon "zebra"
for r in rip ripng ospf6 ospf bgp babel; do
if grep -q "^router \\<$${}{r}\\>" $QUAGGA_CONF; then
bootdaemon "$${}{r}d"
fi
done
if grep -E -q '^[[:space:]]*router[[:space:]]+pim6?[[:space:]]*$' $QUAGGA_CONF; then
bootdaemon "xpimd"
fi
$QUAGGA_BIN_DIR/vtysh -b
}
if [ "$1" != "zebra" ]; then
echo "WARNING: '$1': all Quagga daemons are launched by the 'zebra' service!"
exit 1
fi
confcheck
bootquagga

View file

@ -0,0 +1,23 @@
% for iface, ip4s, ip6s, configs in ifaces:
interface ${iface.name}
% if want_ip4:
% for addr in ip4s:
ip address ${addr}
% endfor
% endif
% if want_ip6:
% for addr in ip6s:
ipv6 address ${addr}
% endfor
% endif
% for config in configs:
% for line in config:
${line}
% endfor
% endfor
!
% endfor
% for service in services:
${service.quagga_config()}
% endfor

View file

@ -0,0 +1 @@
service integrated-vtysh-config

View file

@ -0,0 +1,104 @@
from typing import Any
from core.config import ConfigString, Configuration
from core.configservice.base import ConfigService, ConfigServiceMode
GROUP_NAME: str = "Security"
class VpnClient(ConfigService):
name: str = "VPNClient"
group: str = GROUP_NAME
directories: list[str] = []
files: list[str] = ["vpnclient.sh"]
executables: list[str] = ["openvpn", "ip", "killall"]
dependencies: list[str] = []
startup: list[str] = ["bash vpnclient.sh"]
validate: list[str] = ["pidof openvpn"]
shutdown: list[str] = ["killall openvpn"]
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = [
ConfigString(id="keydir", label="Key Dir", default="/etc/core/keys"),
ConfigString(id="keyname", label="Key Name", default="client1"),
ConfigString(id="server", label="Server", default="10.0.2.10"),
]
modes: dict[str, dict[str, str]] = {}
class VpnServer(ConfigService):
name: str = "VPNServer"
group: str = GROUP_NAME
directories: list[str] = []
files: list[str] = ["vpnserver.sh"]
executables: list[str] = ["openvpn", "ip", "killall"]
dependencies: list[str] = []
startup: list[str] = ["bash vpnserver.sh"]
validate: list[str] = ["pidof openvpn"]
shutdown: list[str] = ["killall openvpn"]
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = [
ConfigString(id="keydir", label="Key Dir", default="/etc/core/keys"),
ConfigString(id="keyname", label="Key Name", default="server"),
ConfigString(id="subnet", label="Subnet", default="10.0.200.0"),
]
modes: dict[str, dict[str, str]] = {}
def data(self) -> dict[str, Any]:
address = None
for iface in self.node.get_ifaces(control=False):
ip4 = iface.get_ip4()
if ip4:
address = str(ip4.ip)
break
return dict(address=address)
class IPsec(ConfigService):
name: str = "IPsec"
group: str = GROUP_NAME
directories: list[str] = []
files: list[str] = ["ipsec.sh"]
executables: list[str] = ["racoon", "ip", "setkey", "killall"]
dependencies: list[str] = []
startup: list[str] = ["bash ipsec.sh"]
validate: list[str] = ["pidof racoon"]
shutdown: list[str] = ["killall racoon"]
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
class Firewall(ConfigService):
name: str = "Firewall"
group: str = GROUP_NAME
directories: list[str] = []
files: list[str] = ["firewall.sh"]
executables: list[str] = ["iptables"]
dependencies: list[str] = []
startup: list[str] = ["bash firewall.sh"]
validate: list[str] = []
shutdown: list[str] = []
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
class Nat(ConfigService):
name: str = "NAT"
group: str = GROUP_NAME
directories: list[str] = []
files: list[str] = ["nat.sh"]
executables: list[str] = ["iptables"]
dependencies: list[str] = []
startup: list[str] = ["bash nat.sh"]
validate: list[str] = []
shutdown: list[str] = []
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
def data(self) -> dict[str, Any]:
ifnames = []
for iface in self.node.get_ifaces(control=False):
ifnames.append(iface.name)
return dict(ifnames=ifnames)

View file

@ -0,0 +1,114 @@
# -------- CUSTOMIZATION REQUIRED --------
#
# The IPsec service builds ESP tunnels between the specified peers using the
# racoon IKEv2 keying daemon. You need to provide keys and the addresses of
# peers, along with subnets to tunnel.
# directory containing the certificate and key described below
keydir=/etc/core/keys
# the name used for the "$certname.pem" x509 certificate and
# "$certname.key" RSA private key, which can be generated using openssl
certname=ipsec1
# list the public-facing IP addresses, starting with the localhost and followed
# by each tunnel peer, separated with a single space
tunnelhosts="172.16.0.1AND172.16.0.2 172.16.0.1AND172.16.2.1"
# Define T<i> where i is the index for each tunnel peer host from
# the tunnel_hosts list above (0 is localhost).
# T<i> is a list of IPsec tunnels with peer i, with a local subnet address
# followed by the remote subnet address:
# T<i>="<local>AND<remote> <local>AND<remote>"
# For example, 172.16.0.0/24 is a local network (behind this node) to be
# tunneled and 172.16.2.0/24 is a remote network (behind peer 1)
T1="172.16.3.0/24AND172.16.5.0/24"
T2="172.16.4.0/24AND172.16.5.0/24 172.16.4.0/24AND172.16.6.0/24"
# -------- END CUSTOMIZATION --------
echo "building config $PWD/ipsec.conf..."
echo "building config $PWD/ipsec.conf..." > $PWD/ipsec.log
checkip=0
if [ "$(dpkg -l | grep " sipcalc ")" = "" ]; then
echo "WARNING: ip validation disabled because package sipcalc not installed
" >> $PWD/ipsec.log
checkip=1
fi
echo "#!/usr/sbin/setkey -f
# Flush the SAD and SPD
flush;
spdflush;
# Security policies " > $PWD/ipsec.conf
i=0
for hostpair in $tunnelhosts; do
i=`expr $i + 1`
# parse tunnel host IP
thishost=$${}{hostpair%%AND*}
peerhost=$${}{hostpair##*AND}
if [ $checkip = "0" ] &&
[ "$(sipcalc "$thishost" "$peerhost" | grep ERR)" != "" ]; then
echo "ERROR: invalid host address $thishost or $peerhost " >> $PWD/ipsec.log
fi
# parse each tunnel addresses
tunnel_list_var_name=T$i
eval tunnels="$"$tunnel_list_var_name""
for ttunnel in $tunnels; do
lclnet=$${}{ttunnel%%AND*}
rmtnet=$${}{ttunnel##*AND}
if [ $checkip = "0" ] &&
[ "$(sipcalc "$lclnet" "$rmtnet"| grep ERR)" != "" ]; then
echo "ERROR: invalid tunnel address $lclnet and $rmtnet " >> $PWD/ipsec.log
fi
# add tunnel policies
echo "
spdadd $lclnet $rmtnet any -P out ipsec
esp/tunnel/$thishost-$peerhost/require;
spdadd $rmtnet $lclnet any -P in ipsec
esp/tunnel/$peerhost-$thishost/require; " >> $PWD/ipsec.conf
done
done
echo "building config $PWD/racoon.conf..."
if [ ! -e $keydir\/$certname.key ] || [ ! -e $keydir\/$certname.pem ]; then
echo "ERROR: missing certification files under $keydir $certname.key or $certname.pem " >> $PWD/ipsec.log
fi
echo "
path certificate \"$keydir\";
listen {
adminsock disabled;
}
remote anonymous
{
exchange_mode main;
certificate_type x509 \"$certname.pem\" \"$certname.key\";
ca_type x509 \"ca-cert.pem\";
my_identifier asn1dn;
peers_identifier asn1dn;
proposal {
encryption_algorithm 3des ;
hash_algorithm sha1;
authentication_method rsasig ;
dh_group modp768;
}
}
sainfo anonymous
{
pfs_group modp768;
lifetime time 1 hour ;
encryption_algorithm 3des, blowfish 448, rijndael ;
authentication_algorithm hmac_sha1, hmac_md5 ;
compression_algorithm deflate ;
}
" > $PWD/racoon.conf
# the setkey program is required from the ipsec-tools package
echo "running setkey -f $PWD/ipsec.conf..."
setkey -f $PWD/ipsec.conf
echo "running racoon -d -f $PWD/racoon.conf..."
racoon -d -f $PWD/racoon.conf -l racoon.log

View file

@ -0,0 +1,14 @@
#!/bin/sh
# generated by security.py
# NAT out the first interface by default
% for index, ifname in enumerate(ifnames):
% if index == 0:
iptables -t nat -A POSTROUTING -o ${ifname} -j MASQUERADE
iptables -A FORWARD -i ${ifname} -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i ${ifname} -j DROP
% else:
# iptables -t nat -A POSTROUTING -o ${ifname} -j MASQUERADE
# iptables -A FORWARD -i ${ifname} -m state --state RELATED,ESTABLISHED -j ACCEPT
# iptables -A FORWARD -i ${ifname} -j DROP
% endif
% endfor

View file

@ -0,0 +1,61 @@
# -------- CUSTOMIZATION REQUIRED --------
#
# The VPNClient service builds a VPN tunnel to the specified VPN server using
# OpenVPN software and a virtual TUN/TAP device.
# directory containing the certificate and key described below
keydir=${config["keydir"]}
# the name used for a "$keyname.crt" certificate and "$keyname.key" private key.
keyname=${config["keyname"]}
# the public IP address of the VPN server this client should connect with
vpnserver=${config["server"]}
# optional next hop for adding a static route to reach the VPN server
#nexthop="10.0.1.1"
# --------- END CUSTOMIZATION --------
# validate addresses
if [ "$(dpkg -l | grep " sipcalc ")" = "" ]; then
echo "WARNING: ip validation disabled because package sipcalc not installed
" > $PWD/vpnclient.log
else
if [ "$(sipcalc "$vpnserver" "$nexthop" | grep ERR)" != "" ]; then
echo "ERROR: invalide address $vpnserver or $nexthop " > $PWD/vpnclient.log
fi
fi
# validate key and certification files
if [ ! -e $keydir\/$keyname.key ] || [ ! -e $keydir\/$keyname.crt ] \
|| [ ! -e $keydir\/ca.crt ] || [ ! -e $keydir\/dh1024.pem ]; then
echo "ERROR: missing certification or key files under $keydir $keyname.key or $keyname.crt or ca.crt or dh1024.pem" >> $PWD/vpnclient.log
fi
# if necessary, add a static route for reaching the VPN server IP via the IF
vpnservernet=$${}{vpnserver%.*}.0/24
if [ "$nexthop" != "" ]; then
ip route add $vpnservernet via $nexthop
fi
# create openvpn client.conf
(
cat << EOF
client
dev tun
proto udp
remote $vpnserver 1194
nobind
ca $keydir/ca.crt
cert $keydir/$keyname.crt
key $keydir/$keyname.key
dh $keydir/dh1024.pem
cipher AES-256-CBC
log $PWD/openvpn-client.log
verb 4
daemon
EOF
) > client.conf
openvpn --config client.conf

View file

@ -0,0 +1,147 @@
# -------- CUSTOMIZATION REQUIRED --------
#
# The VPNServer service sets up the OpenVPN server for building VPN tunnels
# that allow access via TUN/TAP device to private networks.
#
# note that the IPForward and DefaultRoute services should be enabled
# directory containing the certificate and key described below, in addition to
# a CA certificate and DH key
keydir=${config["keydir"]}
# the name used for a "$keyname.crt" certificate and "$keyname.key" private key.
keyname=${config["keyname"]}
# the VPN subnet address from which the client VPN IP (for the TUN/TAP)
# will be allocated
vpnsubnet=${config["subnet"]}
# public IP address of this vpn server (same as VPNClient vpnserver= setting)
vpnserver=${address}
# optional list of private subnets reachable behind this VPN server
# each subnet and next hop is separated by a space
# "<subnet1>,<nexthop1> <subnet2>,<nexthop2> ..."
#privatenets="10.0.11.0,10.0.10.1 10.0.12.0,10.0.10.1"
# optional list of VPN clients, for statically assigning IP addresses to
# clients; also, an optional client subnet can be specified for adding static
# routes via the client
# Note: VPN addresses x.x.x.0-3 are reserved
# "<keyname>,<vpnIP>,<subnetIP> <keyname>,<vpnIP>,<subnetIP> ..."
#vpnclients="client1KeyFilename,10.0.200.5,10.0.0.0 client2KeyFilename,,"
# NOTE: you may need to enable the StaticRoutes service on nodes within the
# private subnet, in order to have routes back to the client.
# /sbin/ip ro add <vpnsubnet>/24 via <vpnServerRemoteInterface>
# /sbin/ip ro add <vpnClientSubnet>/24 via <vpnServerRemoteInterface>
# -------- END CUSTOMIZATION --------
echo > $PWD/vpnserver.log
rm -f -r $PWD/ccd
# validate key and certification files
if [ ! -e $keydir\/$keyname.key ] || [ ! -e $keydir\/$keyname.crt ] \
|| [ ! -e $keydir\/ca.crt ] || [ ! -e $keydir\/dh1024.pem ]; then
echo "ERROR: missing certification or key files under $keydir \
$keyname.key or $keyname.crt or ca.crt or dh1024.pem" >> $PWD/vpnserver.log
fi
# validate configuration IP addresses
checkip=0
if [ "$(dpkg -l | grep " sipcalc ")" = "" ]; then
echo "WARNING: ip validation disabled because package sipcalc not installed\
" >> $PWD/vpnserver.log
checkip=1
else
if [ "$(sipcalc "$vpnsubnet" "$vpnserver" | grep ERR)" != "" ]; then
echo "ERROR: invalid vpn subnet or server address \
$vpnsubnet or $vpnserver " >> $PWD/vpnserver.log
fi
fi
# create client vpn ip pool file
(
cat << EOF
EOF
)> $PWD/ippool.txt
# create server.conf file
(
cat << EOF
# openvpn server config
local $vpnserver
server $vpnsubnet 255.255.255.0
push "redirect-gateway def1"
EOF
)> $PWD/server.conf
# add routes to VPN server private subnets, and push these routes to clients
for privatenet in $privatenets; do
if [ $privatenet != "" ]; then
net=$${}{privatenet%%,*}
nexthop=$${}{privatenet##*,}
if [ $checkip = "0" ] &&
[ "$(sipcalc "$net" "$nexthop" | grep ERR)" != "" ]; then
echo "ERROR: invalid vpn server private net address \
$net or $nexthop " >> $PWD/vpnserver.log
fi
echo push route $net 255.255.255.0 >> $PWD/server.conf
ip ro add $net/24 via $nexthop
ip ro add $vpnsubnet/24 via $nexthop
fi
done
# allow subnet through this VPN, one route for each client subnet
for client in $vpnclients; do
if [ $client != "" ]; then
cSubnetIP=$${}{client##*,}
cVpnIP=$${}{client#*,}
cVpnIP=$${}{cVpnIP%%,*}
cKeyFilename=$${}{client%%,*}
if [ "$cSubnetIP" != "" ]; then
if [ $checkip = "0" ] &&
[ "$(sipcalc "$cSubnetIP" "$cVpnIP" | grep ERR)" != "" ]; then
echo "ERROR: invalid vpn client and subnet address \
$cSubnetIP or $cVpnIP " >> $PWD/vpnserver.log
fi
echo route $cSubnetIP 255.255.255.0 >> $PWD/server.conf
if ! test -d $PWD/ccd; then
mkdir -p $PWD/ccd
echo client-config-dir $PWD/ccd >> $PWD/server.conf
fi
if test -e $PWD/ccd/$cKeyFilename; then
echo iroute $cSubnetIP 255.255.255.0 >> $PWD/ccd/$cKeyFilename
else
echo iroute $cSubnetIP 255.255.255.0 > $PWD/ccd/$cKeyFilename
fi
fi
if [ "$cVpnIP" != "" ]; then
echo $cKeyFilename,$cVpnIP >> $PWD/ippool.txt
fi
fi
done
(
cat << EOF
keepalive 10 120
ca $keydir/ca.crt
cert $keydir/$keyname.crt
key $keydir/$keyname.key
dh $keydir/dh1024.pem
cipher AES-256-CBC
status /var/log/openvpn-status.log
log /var/log/openvpn-server.log
ifconfig-pool-linear
ifconfig-pool-persist $PWD/ippool.txt
port 1194
proto udp
dev tun
verb 4
daemon
EOF
)>> $PWD/server.conf
# start vpn server
openvpn --config server.conf

View file

@ -0,0 +1,291 @@
from typing import Any
import netaddr
from core import utils
from core.config import Configuration
from core.configservice.base import ConfigService, ConfigServiceMode
GROUP_NAME = "Utility"
class DefaultRouteService(ConfigService):
name: str = "DefaultRoute"
group: str = GROUP_NAME
directories: list[str] = []
files: list[str] = ["defaultroute.sh"]
executables: list[str] = ["ip"]
dependencies: list[str] = []
startup: list[str] = ["bash defaultroute.sh"]
validate: list[str] = []
shutdown: list[str] = []
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
def data(self) -> dict[str, Any]:
# only add default routes for linked routing nodes
routes = []
ifaces = self.node.get_ifaces()
if ifaces:
iface = ifaces[0]
for ip in iface.ips():
net = ip.cidr
if net.size > 1:
router = net[1]
routes.append(str(router))
return dict(routes=routes)
class DefaultMulticastRouteService(ConfigService):
name: str = "DefaultMulticastRoute"
group: str = GROUP_NAME
directories: list[str] = []
files: list[str] = ["defaultmroute.sh"]
executables: list[str] = []
dependencies: list[str] = []
startup: list[str] = ["bash defaultmroute.sh"]
validate: list[str] = []
shutdown: list[str] = []
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
def data(self) -> dict[str, Any]:
ifname = None
for iface in self.node.get_ifaces(control=False):
ifname = iface.name
break
return dict(ifname=ifname)
class StaticRouteService(ConfigService):
name: str = "StaticRoute"
group: str = GROUP_NAME
directories: list[str] = []
files: list[str] = ["staticroute.sh"]
executables: list[str] = []
dependencies: list[str] = []
startup: list[str] = ["bash staticroute.sh"]
validate: list[str] = []
shutdown: list[str] = []
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
def data(self) -> dict[str, Any]:
routes = []
for iface in self.node.get_ifaces(control=False):
for ip in iface.ips():
address = str(ip.ip)
if netaddr.valid_ipv6(address):
dst = "3ffe:4::/64"
else:
dst = "10.9.8.0/24"
if ip[-2] != ip[1]:
routes.append((dst, ip[1]))
return dict(routes=routes)
class IpForwardService(ConfigService):
name: str = "IPForward"
group: str = GROUP_NAME
directories: list[str] = []
files: list[str] = ["ipforward.sh"]
executables: list[str] = ["sysctl"]
dependencies: list[str] = []
startup: list[str] = ["bash ipforward.sh"]
validate: list[str] = []
shutdown: list[str] = []
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
def data(self) -> dict[str, Any]:
devnames = []
for iface in self.node.get_ifaces():
devname = utils.sysctl_devname(iface.name)
devnames.append(devname)
return dict(devnames=devnames)
class SshService(ConfigService):
name: str = "SSH"
group: str = GROUP_NAME
directories: list[str] = ["/etc/ssh", "/var/run/sshd"]
files: list[str] = ["startsshd.sh", "/etc/ssh/sshd_config"]
executables: list[str] = ["sshd"]
dependencies: list[str] = []
startup: list[str] = ["bash startsshd.sh"]
validate: list[str] = []
shutdown: list[str] = ["killall sshd"]
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
def data(self) -> dict[str, Any]:
return dict(
sshcfgdir=self.directories[0],
sshstatedir=self.directories[1],
sshlibdir="/usr/lib/openssh",
)
class DhcpService(ConfigService):
name: str = "DHCP"
group: str = GROUP_NAME
directories: list[str] = ["/etc/dhcp", "/var/lib/dhcp"]
files: list[str] = ["/etc/dhcp/dhcpd.conf"]
executables: list[str] = ["dhcpd"]
dependencies: list[str] = []
startup: list[str] = ["touch /var/lib/dhcp/dhcpd.leases", "dhcpd"]
validate: list[str] = ["pidof dhcpd"]
shutdown: list[str] = ["killall dhcpd"]
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
def data(self) -> dict[str, Any]:
subnets = []
for iface in self.node.get_ifaces(control=False):
for ip4 in iface.ip4s:
if ip4.size == 1:
continue
# divide the address space in half
index = (ip4.size - 2) / 2
rangelow = ip4[index]
rangehigh = ip4[-2]
subnets.append((ip4.cidr.ip, ip4.netmask, rangelow, rangehigh, ip4.ip))
return dict(subnets=subnets)
class DhcpClientService(ConfigService):
name: str = "DHCPClient"
group: str = GROUP_NAME
directories: list[str] = []
files: list[str] = ["startdhcpclient.sh"]
executables: list[str] = ["dhclient"]
dependencies: list[str] = []
startup: list[str] = ["bash startdhcpclient.sh"]
validate: list[str] = ["pidof dhclient"]
shutdown: list[str] = ["killall dhclient"]
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
def data(self) -> dict[str, Any]:
ifnames = []
for iface in self.node.get_ifaces(control=False):
ifnames.append(iface.name)
return dict(ifnames=ifnames)
class FtpService(ConfigService):
name: str = "FTP"
group: str = GROUP_NAME
directories: list[str] = ["/var/run/vsftpd/empty", "/var/ftp"]
files: list[str] = ["vsftpd.conf"]
executables: list[str] = ["vsftpd"]
dependencies: list[str] = []
startup: list[str] = ["vsftpd ./vsftpd.conf"]
validate: list[str] = ["pidof vsftpd"]
shutdown: list[str] = ["killall vsftpd"]
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
class PcapService(ConfigService):
name: str = "pcap"
group: str = GROUP_NAME
directories: list[str] = []
files: list[str] = ["pcap.sh"]
executables: list[str] = ["tcpdump"]
dependencies: list[str] = []
startup: list[str] = ["bash pcap.sh start"]
validate: list[str] = ["pidof tcpdump"]
shutdown: list[str] = ["bash pcap.sh stop"]
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
def data(self) -> dict[str, Any]:
ifnames = []
for iface in self.node.get_ifaces(control=False):
ifnames.append(iface.name)
return dict(ifnames=ifnames)
class RadvdService(ConfigService):
name: str = "radvd"
group: str = GROUP_NAME
directories: list[str] = ["/etc/radvd", "/var/run/radvd"]
files: list[str] = ["/etc/radvd/radvd.conf"]
executables: list[str] = ["radvd"]
dependencies: list[str] = []
startup: list[str] = [
"radvd -C /etc/radvd/radvd.conf -m logfile -l /var/log/radvd.log"
]
validate: list[str] = ["pidof radvd"]
shutdown: list[str] = ["pkill radvd"]
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
def data(self) -> dict[str, Any]:
ifaces = []
for iface in self.node.get_ifaces(control=False):
prefixes = []
for ip6 in iface.ip6s:
prefixes.append(str(ip6))
if not prefixes:
continue
ifaces.append((iface.name, prefixes))
return dict(ifaces=ifaces)
class AtdService(ConfigService):
name: str = "atd"
group: str = GROUP_NAME
directories: list[str] = ["/var/spool/cron/atjobs", "/var/spool/cron/atspool"]
files: list[str] = ["startatd.sh"]
executables: list[str] = ["atd"]
dependencies: list[str] = []
startup: list[str] = ["bash startatd.sh"]
validate: list[str] = ["pidof atd"]
shutdown: list[str] = ["pkill atd"]
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
class HttpService(ConfigService):
name: str = "HTTP"
group: str = GROUP_NAME
directories: list[str] = [
"/etc/apache2",
"/var/run/apache2",
"/var/log/apache2",
"/run/lock",
"/var/lock/apache2",
"/var/www",
]
files: list[str] = [
"/etc/apache2/apache2.conf",
"/etc/apache2/envvars",
"/var/www/index.html",
]
executables: list[str] = ["apache2ctl"]
dependencies: list[str] = []
startup: list[str] = ["chown www-data /var/lock/apache2", "apache2ctl start"]
validate: list[str] = ["pidof apache2"]
shutdown: list[str] = ["apache2ctl stop"]
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
default_configs: list[Configuration] = []
modes: dict[str, dict[str, str]] = {}
def data(self) -> dict[str, Any]:
ifaces = []
for iface in self.node.get_ifaces(control=False):
ifaces.append(iface)
return dict(ifaces=ifaces)

View file

@ -0,0 +1,4 @@
#!/bin/sh
# auto-generated by DefaultMulticastRoute service (utility.py)
# the first interface is chosen below; please change it as needed
ip route add 224.0.0.0/4 dev ${ifname}

View file

@ -0,0 +1,5 @@
#!/bin/sh
# auto-generated by DefaultRoute service
% for route in routes:
ip route add default via ${route}
% endfor

View file

@ -0,0 +1,102 @@
# apache2.conf generated by utility.py:HttpService
Mutex file:$APACHE_LOCK_DIR default
PidFile $APACHE_PID_FILE
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
LoadModule mpm_worker_module /usr/lib/apache2/modules/mod_mpm_worker.so
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
<IfModule mpm_worker_module>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
<IfModule mpm_event_module>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
User $APACHE_RUN_USER
Group $APACHE_RUN_GROUP
AccessFileName .htaccess
<Files ~ "^\\.ht">
Require all denied
</Files>
DefaultType None
HostnameLookups Off
ErrorLog $APACHE_LOG_DIR/error.log
LogLevel warn
#Include mods-enabled/*.load
#Include mods-enabled/*.conf
LoadModule alias_module /usr/lib/apache2/modules/mod_alias.so
LoadModule auth_basic_module /usr/lib/apache2/modules/mod_auth_basic.so
LoadModule authz_core_module /usr/lib/apache2/modules/mod_authz_core.so
LoadModule authz_host_module /usr/lib/apache2/modules/mod_authz_host.so
LoadModule authz_user_module /usr/lib/apache2/modules/mod_authz_user.so
LoadModule autoindex_module /usr/lib/apache2/modules/mod_autoindex.so
LoadModule dir_module /usr/lib/apache2/modules/mod_dir.so
LoadModule env_module /usr/lib/apache2/modules/mod_env.so
NameVirtualHost *:80
Listen 80
<IfModule mod_ssl.c>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
LogFormat "%v:%p %h %l %u %t \\"%r\\" %>s %O \\"%{Referer}i\\" \\"%{User-Agent}i\\"" vhost_combined
LogFormat "%h %l %u %t \\"%r\\" %>s %O \\"%{Referer}i\\" \\"%{User-Agent}i\\"" combined
LogFormat "%h %l %u %t \\"%r\\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
ServerTokens OS
ServerSignature On
TraceEnable Off
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Require all granted
</Directory>
ErrorLog $APACHE_LOG_DIR/error.log
LogLevel warn
CustomLog $APACHE_LOG_DIR/access.log combined
</VirtualHost>

View file

@ -0,0 +1,10 @@
# this file is used by apache2ctl - generated by utility.py:HttpService
# these settings come from a default Ubuntu apache2 installation
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
export APACHE_PID_FILE=/var/run/apache2.pid
export APACHE_RUN_DIR=/var/run/apache2
export APACHE_LOCK_DIR=/var/lock/apache2
export APACHE_LOG_DIR=/var/log/apache2
export LANG=C
export LANG

View file

@ -0,0 +1,22 @@
# auto-generated by DHCP service (utility.py)
# NOTE: move these option lines into the desired pool { } block(s) below
#option domain-name "test.com";
#option domain-name-servers 10.0.0.1;
#option routers 10.0.0.1;
log-facility local6;
default-lease-time 600;
max-lease-time 7200;
ddns-update-style none;
% for subnet, netmask, rangelow, rangehigh, addr in subnets:
subnet ${subnet} netmask ${netmask} {
pool {
range ${rangelow} ${rangehigh};
default-lease-time 600;
option routers ${addr};
}
}
% endfor

View file

@ -0,0 +1,19 @@
# auto-generated by RADVD service (utility.py)
% for ifname, prefixes in ifaces:
interface ${ifname}
{
AdvSendAdvert on;
MinRtrAdvInterval 3;
MaxRtrAdvInterval 10;
AdvDefaultPreference low;
AdvHomeAgentFlag off;
% for prefix in prefixes:
prefix ${prefix}
{
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr on;
};
% endfor
};
% endfor

View file

@ -0,0 +1,37 @@
# auto-generated by SSH service (utility.py)
Port 22
Protocol 2
HostKey ${sshcfgdir}/ssh_host_rsa_key
UsePrivilegeSeparation yes
PidFile ${sshstatedir}/sshd.pid
KeyRegenerationInterval 3600
ServerKeyBits 768
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
AcceptEnv LANG LC_*
Subsystem sftp ${sshlibdir}/sftp-server
UsePAM yes
UseDNS no

View file

@ -0,0 +1,17 @@
#!/bin/sh
# auto-generated by IPForward service (utility.py)
sysctl -w net.ipv4.conf.all.forwarding=1
sysctl -w net.ipv4.conf.default.forwarding=1
sysctl -w net.ipv6.conf.all.forwarding=1
sysctl -w net.ipv6.conf.default.forwarding=1
sysctl -w net.ipv4.conf.all.send_redirects=0
sysctl -w net.ipv4.conf.default.send_redirects=0
sysctl -w net.ipv4.conf.all.rp_filter=0
sysctl -w net.ipv4.conf.default.rp_filter=0
# setup forwarding for node interfaces
% for devname in devnames:
sysctl -w net.ipv4.conf.${devname}.forwarding=1
sysctl -w net.ipv4.conf.${devname}.send_redirects=0
sysctl -w net.ipv4.conf.${devname}.rp_filter=0
sysctl -w net.ipv6.conf.${devname}.forwarding=1
% endfor

View file

@ -0,0 +1,11 @@
#!/bin/sh
# set tcpdump options here (see 'man tcpdump' for help)
# (-s snap length, -C limit pcap file length, -n disable name resolution)
if [ "x$1" = "xstart" ]; then
% for ifname in ifnames:
tcpdump -s 12288 -C 10 -n -w ${node.name}.${ifname}.pcap -i ${ifname} > /dev/null 2>&1 &
% endfor
elif [ "x$1" = "xstop" ]; then
mkdir -p $SESSION_DIR/pcap
mv *.pcap $SESSION_DIR/pcap
fi;

View file

@ -0,0 +1,5 @@
#!/bin/sh
echo 00001 > /var/spool/cron/atjobs/.SEQ
chown -R daemon /var/spool/cron/*
chmod -R 700 /var/spool/cron/*
atd

View file

@ -0,0 +1,8 @@
#!/bin/sh
# auto-generated by DHCPClient service (utility.py)
# uncomment this mkdir line and symlink line to enable client-side DNS\n# resolution based on the DHCP server response.
#mkdir -p /var/run/resolvconf/interface
% for ifname in ifnames:
#ln -s /var/run/resolvconf/interface/${ifname}.dhclient /var/run/resolvconf/resolv.conf
dhclient -nw -pf /var/run/dhclient-${ifname}.pid -lf /var/run/dhclient-${ifname}.lease ${ifname}
% endfor

View file

@ -0,0 +1,6 @@
#!/bin/sh
# auto-generated by SSH service (utility.py)
ssh-keygen -q -t rsa -N "" -f ${sshcfgdir}/ssh_host_rsa_key
chmod 655 ${sshstatedir}
# wait until RSA host key has been generated to launch sshd
$(which sshd) -f ${sshcfgdir}/sshd_config

View file

@ -0,0 +1,7 @@
#!/bin/sh
# auto-generated by StaticRoute service (utility.py)
# NOTE: this service must be customized to be of any use
# Below are samples that you can uncomment and edit.
% for dest, addr in routes:
#ip route add ${dest} via ${addr}
% endfor

View file

@ -0,0 +1,13 @@
<!-- generated by utility.py:HttpService -->
<html>
<body>
<h1>${node.name} web server</h1>
<p>This is the default web page for this server.</p>
<p>The web server software is running but no content has been added, yet.</p>
<ul>
% for iface in ifaces:
<li>${iface.name} - ${iface.addrlist}</li>
% endfor
</ul>
</body>
</html>

View file

@ -0,0 +1,12 @@
# vsftpd.conf auto-generated by FTP service (utility.py)
listen=YES
anonymous_enable=YES
local_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/vsftpd.log
ftpd_banner=Welcome to the CORE FTP service
secure_chroot_dir=/var/run/vsftpd/empty
anon_root=/var/ftp

View file

@ -1,28 +1,5 @@
import os from pathlib import Path
COREDPY_VERSION = "@PACKAGE_VERSION@" COREDPY_VERSION: str = "@PACKAGE_VERSION@"
CORE_STATE_DIR = "@CORE_STATE_DIR@" CORE_CONF_DIR: Path = Path("@CORE_CONF_DIR@")
CORE_CONF_DIR = "@CORE_CONF_DIR@" CORE_DATA_DIR: Path = Path("@CORE_DATA_DIR@")
CORE_DATA_DIR = "@CORE_DATA_DIR@"
QUAGGA_STATE_DIR = "@CORE_STATE_DIR@/run/quagga"
FRR_STATE_DIR = "@CORE_STATE_DIR@/run/frr"
def which(command):
for path in os.environ["PATH"].split(os.pathsep):
command_path = os.path.join(path, command)
if os.path.isfile(command_path) and os.access(command_path, os.X_OK):
return command_path
VNODED_BIN = which("vnoded")
VCMD_BIN = which("vcmd")
BRCTL_BIN = which("brctl")
SYSCTL_BIN = which("sysctl")
IP_BIN = which("ip")
TC_BIN = which("tc")
EBTABLES_BIN = which("ebtables")
MOUNT_BIN = which("mount")
UMOUNT_BIN = which("umount")
OVS_BIN = which("ovs-vsctl")
OVS_FLOW_BIN = which("ovs-ofctl")

File diff suppressed because it is too large Load diff

View file

@ -1,758 +0,0 @@
"""
Defines the basic objects for CORE emulation: the PyCoreObj base class, along with PyCoreNode,
PyCoreNet, and PyCoreNetIf.
"""
import os
import shutil
import socket
import threading
from socket import AF_INET
from socket import AF_INET6
from core.data import NodeData, LinkData
from core.enumerations import LinkTypes
from core.misc import ipaddress
class Position(object):
"""
Helper class for Cartesian coordinate position
"""
def __init__(self, x=None, y=None, z=None):
"""
Creates a Position instance.
:param x: x position
:param y: y position
:param z: z position
:return:
"""
self.x = x
self.y = y
self.z = z
def set(self, x=None, y=None, z=None):
"""
Returns True if the position has actually changed.
:param float x: x position
:param float y: y position
:param float z: z position
:return: True if position changed, False otherwise
:rtype: bool
"""
if self.x == x and self.y == y and self.z == z:
return False
self.x = x
self.y = y
self.z = z
return True
def get(self):
"""
Retrieve x,y,z position.
:return: x,y,z position tuple
:rtype: tuple
"""
return self.x, self.y, self.z
class PyCoreObj(object):
"""
Base class for CORE objects (nodes and networks)
"""
apitype = None
# TODO: appears start has no usage, verify and remove
def __init__(self, session, objid=None, name=None, start=True):
"""
Creates a PyCoreObj instance.
:param core.session.Session session: CORE session object
:param int objid: object id
:param str name: object name
:param bool start: start value
:return:
"""
self.session = session
if objid is None:
objid = session.get_object_id()
self.objid = objid
if name is None:
name = "o%s" % self.objid
self.name = name
self.type = None
self.server = None
self.services = None
# ifindex is key, PyCoreNetIf instance is value
self._netif = {}
self.ifindex = 0
self.canvas = None
self.icon = None
self.opaque = None
self.position = Position()
def startup(self):
"""
Each object implements its own startup method.
:return: nothing
"""
raise NotImplementedError
def shutdown(self):
"""
Each object implements its own shutdown method.
:return: nothing
"""
raise NotImplementedError
def setposition(self, x=None, y=None, z=None):
"""
Set the (x,y,z) position of the object.
:param float x: x position
:param float y: y position
:param float z: z position
:return: True if position changed, False otherwise
:rtype: bool
"""
return self.position.set(x=x, y=y, z=z)
def getposition(self):
"""
Return an (x,y,z) tuple representing this object's position.
:return: x,y,z position tuple
:rtype: tuple
"""
return self.position.get()
def ifname(self, ifindex):
"""
Retrieve interface name for index.
:param int ifindex: interface index
:return: interface name
:rtype: str
"""
return self._netif[ifindex].name
def netifs(self, sort=False):
"""
Retrieve network interfaces, sorted if desired.
:param bool sort: boolean used to determine if interfaces should be sorted
:return: network interfaces
:rtype: list
"""
if sort:
return map(lambda k: self._netif[k], sorted(self._netif.keys()))
else:
return self._netif.itervalues()
def numnetif(self):
"""
Return the attached interface count.
:return: number of network interfaces
:rtype: int
"""
return len(self._netif)
def getifindex(self, netif):
"""
Retrieve index for an interface.
:param PyCoreNetIf netif: interface to get index for
:return: interface index if found, -1 otherwise
:rtype: int
"""
for ifindex in self._netif:
if self._netif[ifindex] is netif:
return ifindex
return -1
def newifindex(self):
"""
Create a new interface index.
:return: interface index
:rtype: int
"""
while self.ifindex in self._netif:
self.ifindex += 1
ifindex = self.ifindex
self.ifindex += 1
return ifindex
def data(self, message_type, lat=None, lon=None, alt=None):
"""
Build a data object for this node.
:param message_type: purpose for the data object we are creating
:param str lat: latitude
:param str lon: longitude
:param str alt: altitude
:return: node data object
:rtype: core.data.NodeData
"""
if self.apitype is None:
return None
x, y, _ = self.getposition()
model = self.type
emulation_server = self.server
services = self.services
if services is not None:
services = "|".join([service.name for service in services])
node_data = NodeData(
message_type=message_type,
id=self.objid,
node_type=self.apitype,
name=self.name,
emulation_id=self.objid,
canvas=self.canvas,
icon=self.icon,
opaque=self.opaque,
x_position=x,
y_position=y,
latitude=lat,
longitude=lon,
altitude=alt,
model=model,
emulation_server=emulation_server,
services=services
)
return node_data
def all_link_data(self, flags):
"""
Build CORE Link data for this object. There is no default
method for PyCoreObjs as PyCoreNodes do not implement this but
PyCoreNets do.
:param flags: message flags
:return: list of link data
:rtype: core.data.LinkData
"""
return []
class PyCoreNode(PyCoreObj):
"""
Base class for CORE nodes.
"""
def __init__(self, session, objid=None, name=None, start=True):
"""
Create a PyCoreNode instance.
:param core.session.Session session: CORE session object
:param int objid: object id
:param str name: object name
:param bool start: boolean for starting
"""
super(PyCoreNode, self).__init__(session, objid, name, start=start)
self.services = []
self.nodedir = None
self.tmpnodedir = False
def addservice(self, service):
"""
Add a services to the service list.
:param core.service.CoreService service: service to add
:return: nothing
"""
if service is not None:
self.services.append(service)
def makenodedir(self):
"""
Create the node directory.
:return: nothing
"""
if self.nodedir is None:
self.nodedir = os.path.join(self.session.session_dir, self.name + ".conf")
os.makedirs(self.nodedir)
self.tmpnodedir = True
else:
self.tmpnodedir = False
def rmnodedir(self):
"""
Remove the node directory, unless preserve directory has been set.
:return: nothing
"""
preserve = self.session.options.get_config("preservedir") == "1"
if preserve:
return
if self.tmpnodedir:
shutil.rmtree(self.nodedir, ignore_errors=True)
def addnetif(self, netif, ifindex):
"""
Add network interface to node and set the network interface index if successful.
:param PyCoreNetIf netif: network interface to add
:param int ifindex: interface index
:return: nothing
"""
if ifindex in self._netif:
raise ValueError("ifindex %s already exists" % ifindex)
self._netif[ifindex] = netif
# TODO: this should have probably been set ahead, seems bad to me, check for failure and fix
netif.netindex = ifindex
def delnetif(self, ifindex):
"""
Delete a network interface
:param int ifindex: interface index to delete
:return: nothing
"""
if ifindex not in self._netif:
raise ValueError("ifindex %s does not exist" % ifindex)
netif = self._netif.pop(ifindex)
netif.shutdown()
del netif
# TODO: net parameter is not used, remove
def netif(self, ifindex, net=None):
"""
Retrieve network interface.
:param int ifindex: index of interface to retrieve
:param PyCoreNetIf net: network node
:return: network interface, or None if not found
:rtype: PyCoreNetIf
"""
if ifindex in self._netif:
return self._netif[ifindex]
else:
return None
def attachnet(self, ifindex, net):
"""
Attach a network.
:param int ifindex: interface of index to attach
:param PyCoreNetIf net: network to attach
:return:
"""
if ifindex not in self._netif:
raise ValueError("ifindex %s does not exist" % ifindex)
self._netif[ifindex].attachnet(net)
def detachnet(self, ifindex):
"""
Detach network interface.
:param int ifindex: interface index to detach
:return: nothing
"""
if ifindex not in self._netif:
raise ValueError("ifindex %s does not exist" % ifindex)
self._netif[ifindex].detachnet()
def setposition(self, x=None, y=None, z=None):
"""
Set position.
:param x: x position
:param y: y position
:param z: z position
:return: nothing
"""
changed = super(PyCoreNode, self).setposition(x, y, z)
if changed:
for netif in self.netifs(sort=True):
netif.setposition(x, y, z)
def commonnets(self, obj, want_ctrl=False):
"""
Given another node or net object, return common networks between
this node and that object. A list of tuples is returned, with each tuple
consisting of (network, interface1, interface2).
:param obj: object to get common network with
:param want_ctrl: flag set to determine if control network are wanted
:return: tuples of common networks
:rtype: list
"""
common = []
for netif1 in self.netifs():
if not want_ctrl and hasattr(netif1, "control"):
continue
for netif2 in obj.netifs():
if netif1.net == netif2.net:
common.append((netif1.net, netif1, netif2))
return common
def check_cmd(self, args):
"""
Runs shell command on node.
:param list[str]|str args: command to run
:return: combined stdout and stderr
:rtype: str
:raises CoreCommandError: when a non-zero exit status occurs
"""
raise NotImplementedError
def cmd(self, args, wait=True):
"""
Runs shell command on node, with option to not wait for a result.
:param list[str]|str args: command to run
:param bool wait: wait for command to exit, defaults to True
:return: exit status for command
:rtype: int
"""
raise NotImplementedError
def cmd_output(self, args):
"""
Runs shell command on node and get exit status and output.
:param list[str]|str args: command to run
:return: exit status and combined stdout and stderr
:rtype: tuple[int, str]
"""
raise NotImplementedError
def termcmdstring(self, sh):
"""
Create a terminal command string.
:param str sh: shell to execute command in
:return: str
"""
raise NotImplementedError
class PyCoreNet(PyCoreObj):
"""
Base class for networks
"""
linktype = LinkTypes.WIRED.value
def __init__(self, session, objid, name, start=True):
"""
Create a PyCoreNet instance.
:param core.session.Session session: CORE session object
:param int objid: object id
:param str name: object name
:param bool start: should object start
"""
super(PyCoreNet, self).__init__(session, objid, name, start=start)
self._linked = {}
self._linked_lock = threading.Lock()
def startup(self):
"""
Each object implements its own startup method.
:return: nothing
"""
raise NotImplementedError
def shutdown(self):
"""
Each object implements its own shutdown method.
:return: nothing
"""
raise NotImplementedError
def attach(self, netif):
"""
Attach network interface.
:param PyCoreNetIf netif: network interface to attach
:return: nothing
"""
i = self.newifindex()
self._netif[i] = netif
netif.netifi = i
with self._linked_lock:
self._linked[netif] = {}
def detach(self, netif):
"""
Detach network interface.
:param PyCoreNetIf netif: network interface to detach
:return: nothing
"""
del self._netif[netif.netifi]
netif.netifi = None
with self._linked_lock:
del self._linked[netif]
def all_link_data(self, flags):
"""
Build link data objects for this network. Each link object describes a link
between this network and a node.
"""
all_links = []
# build a link message from this network node to each node having a
# connected interface
for netif in self.netifs(sort=True):
if not hasattr(netif, "node"):
continue
otherobj = netif.node
uni = False
if otherobj is None:
# two layer-2 switches/hubs linked together via linknet()
if not hasattr(netif, "othernet"):
continue
otherobj = netif.othernet
if otherobj.objid == self.objid:
continue
netif.swapparams('_params_up')
upstream_params = netif.getparams()
netif.swapparams('_params_up')
if netif.getparams() != upstream_params:
uni = True
unidirectional = 0
if uni:
unidirectional = 1
interface2_ip4 = None
interface2_ip4_mask = None
interface2_ip6 = None
interface2_ip6_mask = None
for address in netif.addrlist:
ip, _sep, mask = address.partition("/")
mask = int(mask)
if ipaddress.is_ipv4_address(ip):
family = AF_INET
ipl = socket.inet_pton(family, ip)
interface2_ip4 = ipaddress.IpAddress(af=family, address=ipl)
interface2_ip4_mask = mask
else:
family = AF_INET6
ipl = socket.inet_pton(family, ip)
interface2_ip6 = ipaddress.IpAddress(af=family, address=ipl)
interface2_ip6_mask = mask
link_data = LinkData(
message_type=flags,
node1_id=self.objid,
node2_id=otherobj.objid,
link_type=self.linktype,
unidirectional=unidirectional,
interface2_id=otherobj.getifindex(netif),
interface2_mac=netif.hwaddr,
interface2_ip4=interface2_ip4,
interface2_ip4_mask=interface2_ip4_mask,
interface2_ip6=interface2_ip6,
interface2_ip6_mask=interface2_ip6_mask,
delay=netif.getparam("delay"),
bandwidth=netif.getparam("bw"),
dup=netif.getparam("duplicate"),
jitter=netif.getparam("jitter"),
per=netif.getparam("loss")
)
all_links.append(link_data)
if not uni:
continue
netif.swapparams('_params_up')
link_data = LinkData(
message_type=0,
node1_id=otherobj.objid,
node2_id=self.objid,
unidirectional=1,
delay=netif.getparam("delay"),
bandwidth=netif.getparam("bw"),
dup=netif.getparam("duplicate"),
jitter=netif.getparam("jitter"),
per=netif.getparam("loss")
)
netif.swapparams('_params_up')
all_links.append(link_data)
return all_links
class PyCoreNetIf(object):
"""
Base class for network interfaces.
"""
def __init__(self, node, name, mtu):
"""
Creates a PyCoreNetIf instance.
:param core.coreobj.PyCoreNode node: node for interface
:param str name: interface name
:param mtu: mtu value
"""
self.node = node
self.name = name
if not isinstance(mtu, (int, long)):
raise ValueError
self.mtu = mtu
self.net = None
self._params = {}
self.addrlist = []
self.hwaddr = None
# placeholder position hook
self.poshook = lambda a, b, c, d: None
# used with EMANE
self.transport_type = None
# interface index on the network
self.netindex = None
# index used to find flow data
self.flow_id = None
def startup(self):
"""
Startup method for the interface.
:return: nothing
"""
pass
def shutdown(self):
"""
Shutdown method for the interface.
:return: nothing
"""
pass
def attachnet(self, net):
"""
Attach network.
:param core.coreobj.PyCoreNet net: network to attach
:return: nothing
"""
if self.net:
self.detachnet()
self.net = None
net.attach(self)
self.net = net
def detachnet(self):
"""
Detach from a network.
:return: nothing
"""
if self.net is not None:
self.net.detach(self)
def addaddr(self, addr):
"""
Add address.
:param str addr: address to add
:return: nothing
"""
self.addrlist.append(addr)
def deladdr(self, addr):
"""
Delete address.
:param str addr: address to delete
:return: nothing
"""
self.addrlist.remove(addr)
def sethwaddr(self, addr):
"""
Set hardware address.
:param core.misc.ipaddress.MacAddress addr: hardware address to set to.
:return: nothing
"""
self.hwaddr = addr
def getparam(self, key):
"""
Retrieve a parameter from the, or None if the parameter does not exist.
:param key: parameter to get value for
:return: parameter value
"""
return self._params.get(key)
def getparams(self):
"""
Return (key, value) pairs for parameters.
"""
parameters = []
for k in sorted(self._params.keys()):
parameters.append((k, self._params[k]))
return parameters
def setparam(self, key, value):
"""
Set a parameter value, returns True if the parameter has changed.
:param key: parameter name to set
:param value: parameter value
:return: True if parameter changed, False otherwise
"""
# treat None and 0 as unchanged values
current_value = self._params.get(key)
if current_value == value or current_value <= 0 and value <= 0:
return False
self._params[key] = value
return True
def swapparams(self, name):
"""
Swap out parameters dict for name. If name does not exist,
intialize it. This is for supporting separate upstream/downstream
parameters when two layer-2 nodes are linked together.
:param str name: name of parameter to swap
:return: nothing
"""
tmp = self._params
if not hasattr(self, name):
setattr(self, name, {})
self._params = getattr(self, name)
setattr(self, name, tmp)
def setposition(self, x, y, z):
"""
Dispatch position hook handler.
:param x: x position
:param y: y position
:param z: z position
:return: nothing
"""
self.poshook(self, x, y, z)

View file

@ -1,30 +0,0 @@
"""
Defines core server for handling TCP connections.
"""
import SocketServer
from core.emulator.coreemu import CoreEmu
class CoreServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer):
"""
TCP server class, manages sessions and spawns request handlers for
incoming connections.
"""
daemon_threads = True
allow_reuse_address = True
def __init__(self, server_address, handler_class, config=None):
"""
Server class initialization takes configuration data and calls
the SocketServer constructor
:param tuple[str, int] server_address: server host and port to use
:param class handler_class: request handler
:param dict config: configuration setting
:return:
"""
self.coreemu = CoreEmu(config)
self.config = config
SocketServer.TCPServer.__init__(self, server_address, handler_class)

View file

@ -1,120 +0,0 @@
"""
CORE data objects.
"""
import collections
ConfigData = collections.namedtuple("ConfigData", [
"message_type",
"node",
"object",
"type",
"data_types",
"data_values",
"captions",
"bitmap",
"possible_values",
"groups",
"session",
"interface_number",
"network_id",
"opaque"
])
ConfigData.__new__.__defaults__ = (None,) * len(ConfigData._fields)
EventData = collections.namedtuple("EventData", [
"node",
"event_type",
"name",
"data",
"time",
"session"
])
EventData.__new__.__defaults__ = (None,) * len(EventData._fields)
ExceptionData = collections.namedtuple("ExceptionData", [
"node",
"session",
"level",
"source",
"date",
"text",
"opaque"
])
ExceptionData.__new__.__defaults__ = (None,) * len(ExceptionData._fields)
FileData = collections.namedtuple("FileData", [
"message_type",
"node",
"name",
"mode",
"number",
"type",
"source",
"session",
"data",
"compressed_data"
])
FileData.__new__.__defaults__ = (None,) * len(FileData._fields)
NodeData = collections.namedtuple("NodeData", [
"message_type",
"id",
"node_type",
"name",
"ip_address",
"mac_address",
"ip6_address",
"model",
"emulation_id",
"emulation_server",
"session",
"x_position",
"y_position",
"canvas",
"network_id",
"services",
"latitude",
"longitude",
"altitude",
"icon",
"opaque"
])
NodeData.__new__.__defaults__ = (None,) * len(NodeData._fields)
LinkData = collections.namedtuple("LinkData", [
"message_type",
"node1_id",
"node2_id",
"delay",
"bandwidth",
"per",
"dup",
"jitter",
"mer",
"burst",
"session",
"mburst",
"link_type",
"gui_attributes",
"unidirectional",
"emulation_id",
"network_id",
"key",
"interface1_id",
"interface1_name",
"interface1_ip4",
"interface1_ip4_mask",
"interface1_mac",
"interface1_ip6",
"interface1_ip6_mask",
"interface2_id",
"interface2_name",
"interface2_ip4",
"interface2_ip4_mask",
"interface2_mac",
"interface2_ip6",
"interface2_ip6_mask",
"opaque"
])
LinkData.__new__.__defaults__ = (None,) * len(LinkData._fields)

View file

@ -1,42 +0,0 @@
"""
EMANE Bypass model for CORE
"""
from core.conf import ConfigGroup
from core.conf import Configuration
from core.emane import emanemodel
from core.enumerations import ConfigDataTypes
class EmaneBypassModel(emanemodel.EmaneModel):
name = "emane_bypass"
# values to ignore, when writing xml files
config_ignore = {"none"}
# mac definitions
mac_library = "bypassmaclayer"
mac_config = [
Configuration(
_id="none",
_type=ConfigDataTypes.BOOL,
default="0",
options=["True", "False"],
label="There are no parameters for the bypass model."
)
]
# phy definitions
phy_library = "bypassphylayer"
phy_config = []
@classmethod
def load(cls, emane_prefix):
# ignore default logic
pass
# override config groups
@classmethod
def config_groups(cls):
return [
ConfigGroup("Bypass Parameters", 1, 1),
]

View file

@ -1,142 +0,0 @@
"""
commeffect.py: EMANE CommEffect model for CORE
"""
import logging
import os
from lxml import etree
from core.conf import ConfigGroup
from core.emane import emanemanifest
from core.emane import emanemodel
from core.xml import emanexml
try:
from emane.events.commeffectevent import CommEffectEvent
except ImportError:
try:
from emanesh.events.commeffectevent import CommEffectEvent
except ImportError:
logging.debug("compatible emane python bindings not installed")
def convert_none(x):
"""
Helper to use 0 for None values.
"""
if isinstance(x, basestring):
x = float(x)
if x is None:
return 0
else:
return int(x)
class EmaneCommEffectModel(emanemodel.EmaneModel):
name = "emane_commeffect"
shim_library = "commeffectshim"
shim_xml = "commeffectshim.xml"
shim_defaults = {}
config_shim = []
# comm effect does not need the default phy and external configurations
phy_config = []
external_config = []
@classmethod
def load(cls, emane_prefix):
shim_xml_path = os.path.join(emane_prefix, "share/emane/manifest", cls.shim_xml)
cls.config_shim = emanemanifest.parse(shim_xml_path, cls.shim_defaults)
@classmethod
def configurations(cls):
return cls.config_shim
@classmethod
def config_groups(cls):
return [
ConfigGroup("CommEffect SHIM Parameters", 1, len(cls.configurations()))
]
def build_xml_files(self, config, interface=None):
"""
Build the necessary nem and commeffect XMLs in the given path.
If an individual NEM has a nonstandard config, we need to build
that file also. Otherwise the WLAN-wide
nXXemane_commeffectnem.xml, nXXemane_commeffectshim.xml are used.
:param dict config: emane model configuration for the node and interface
:param interface: interface for the emane node
:return: nothing
"""
# retrieve xml names
nem_name = emanexml.nem_file_name(self, interface)
shim_name = emanexml.shim_file_name(self, interface)
# create and write nem document
nem_element = etree.Element("nem", name="%s NEM" % self.name, type="unstructured")
transport_type = "virtual"
if interface and interface.transport_type == "raw":
transport_type = "raw"
transport_file = emanexml.transport_file_name(self.object_id, transport_type)
etree.SubElement(nem_element, "transport", definition=transport_file)
# set shim configuration
etree.SubElement(nem_element, "shim", definition=shim_name)
nem_file = os.path.join(self.session.session_dir, nem_name)
emanexml.create_file(nem_element, "nem", nem_file)
# create and write shim document
shim_element = etree.Element("shim", name="%s SHIM" % self.name, library=self.shim_library)
# append all shim options (except filterfile) to shimdoc
for configuration in self.config_shim:
name = configuration.id
if name == "filterfile":
continue
value = config[name]
emanexml.add_param(shim_element, name, value)
# empty filterfile is not allowed
ff = config["filterfile"]
if ff.strip() != "":
emanexml.add_param(shim_element, "filterfile", ff)
shim_file = os.path.join(self.session.session_dir, shim_name)
emanexml.create_file(shim_element, "shim", shim_file)
def linkconfig(self, netif, bw=None, delay=None, loss=None, duplicate=None, jitter=None, netif2=None):
"""
Generate CommEffect events when a Link Message is received having
link parameters.
"""
service = self.session.emane.service
if service is None:
logging.warn("%s: EMANE event service unavailable", self.name)
return
if netif is None or netif2 is None:
logging.warn("%s: missing NEM information", self.name)
return
# TODO: batch these into multiple events per transmission
# TODO: may want to split out seconds portion of delay and jitter
event = CommEffectEvent()
emane_node = self.session.get_object(self.object_id)
nemid = emane_node.getnemid(netif)
nemid2 = emane_node.getnemid(netif2)
mbw = bw
logging.info("sending comm effect event")
event.append(
nemid,
latency=convert_none(delay),
jitter=convert_none(jitter),
loss=convert_none(loss),
duplicate=convert_none(duplicate),
unicast=long(convert_none(bw)),
broadcast=long(convert_none(mbw))
)
service.publish(nemid2, event)

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,10 @@
import logging import logging
from pathlib import Path
from core.conf import Configuration from core.config import Configuration
from core.enumerations import ConfigDataTypes from core.emulator.enumerations import ConfigDataTypes
logger = logging.getLogger(__name__)
manifest = None manifest = None
try: try:
@ -10,15 +13,16 @@ except ImportError:
try: try:
from emanesh import manifest from emanesh import manifest
except ImportError: except ImportError:
logging.debug("compatible emane python bindings not installed") manifest = None
logger.debug("compatible emane python bindings not installed")
def _type_value(config_type): def _type_value(config_type: str) -> ConfigDataTypes:
""" """
Convert emane configuration type to core configuration value. Convert emane configuration type to core configuration value.
:param str config_type: emane configuration type :param config_type: emane configuration type
:return: :return: core config type
""" """
config_type = config_type.upper() config_type = config_type.upper()
if config_type == "DOUBLE": if config_type == "DOUBLE":
@ -28,14 +32,13 @@ def _type_value(config_type):
return ConfigDataTypes[config_type] return ConfigDataTypes[config_type]
def _get_possible(config_type, config_regex): def _get_possible(config_type: str, config_regex: str) -> list[str]:
""" """
Retrieve possible config value options based on emane regexes. Retrieve possible config value options based on emane regexes.
:param str config_type: emane configuration type :param config_type: emane configuration type
:param str config_regex: emane configuration regex :param config_regex: emane configuration regex
:return: a string listing comma delimited values, if needed, empty string otherwise :return: a string listing comma delimited values, if needed, empty string otherwise
:rtype: list
""" """
if config_type == "bool": if config_type == "bool":
return ["On", "Off"] return ["On", "Off"]
@ -47,16 +50,14 @@ def _get_possible(config_type, config_regex):
return [] return []
def _get_default(config_type_name, config_value): def _get_default(config_type_name: str, config_value: list[str]) -> str:
""" """
Convert default configuration values to one used by core. Convert default configuration values to one used by core.
:param str config_type_name: emane configuration type name :param config_type_name: emane configuration type name
:param list config_value: emane configuration value list :param config_value: emane configuration value list
:return: default core config value :return: default core config value
:rtype: str
""" """
config_default = "" config_default = ""
if config_type_name == "bool": if config_type_name == "bool":
@ -72,14 +73,14 @@ def _get_default(config_type_name, config_value):
return config_default return config_default
def parse(manifest_path, defaults): def parse(manifest_path: Path, defaults: dict[str, str]) -> list[Configuration]:
""" """
Parses a valid emane manifest file and converts the provided configuration values into ones used by core. Parses a valid emane manifest file and converts the provided configuration values
into ones used by core.
:param str manifest_path: absolute manifest file path :param manifest_path: absolute manifest file path
:param dict defaults: used to override default values for configurations :param defaults: used to override default values for configurations
:return: list of core configuration values :return: list of core configuration values
:rtype: list
""" """
# no results when emane bindings are not present # no results when emane bindings are not present
@ -87,7 +88,7 @@ def parse(manifest_path, defaults):
return [] return []
# load configuration file # load configuration file
manifest_file = manifest.Manifest(manifest_path) manifest_file = manifest.Manifest(str(manifest_path))
manifest_configurations = manifest_file.getAllConfiguration() manifest_configurations = manifest_file.getAllConfiguration()
configurations = [] configurations = []
@ -115,14 +116,14 @@ def parse(manifest_path, defaults):
# define description and account for gui quirks # define description and account for gui quirks
config_descriptions = config_name config_descriptions = config_name
if config_name.endswith("uri"): if config_name.endswith("uri"):
config_descriptions = "%s file" % config_descriptions config_descriptions = f"{config_descriptions} file"
configuration = Configuration( configuration = Configuration(
_id=config_name, id=config_name,
_type=config_type_value, type=config_type_value,
default=config_default, default=config_default,
options=possible, options=possible,
label=config_descriptions label=config_descriptions,
) )
configurations.append(configuration) configurations.append(configuration)

View file

@ -2,15 +2,21 @@
Defines Emane Models used within CORE. Defines Emane Models used within CORE.
""" """
import logging import logging
import os from pathlib import Path
from typing import Optional
from core.conf import ConfigGroup from core.config import ConfigBool, ConfigGroup, ConfigString, Configuration
from core.conf import Configuration
from core.emane import emanemanifest from core.emane import emanemanifest
from core.enumerations import ConfigDataTypes from core.emulator.data import LinkOptions
from core.mobility import WirelessModel from core.errors import CoreError
from core.location.mobility import WirelessModel
from core.nodes.interface import CoreInterface
from core.xml import emanexml from core.xml import emanexml
logger = logging.getLogger(__name__)
DEFAULT_DEV: str = "ctrl0"
MANIFEST_PATH: str = "share/emane/manifest"
class EmaneModel(WirelessModel): class EmaneModel(WirelessModel):
""" """
@ -18,142 +24,151 @@ class EmaneModel(WirelessModel):
handling configuration messages based on the list of handling configuration messages based on the list of
configurable parameters. Helper functions also live here. configurable parameters. Helper functions also live here.
""" """
# default platform configuration settings
platform_controlport: str = "controlportendpoint"
platform_xml: str = "nemmanager.xml"
platform_defaults: dict[str, str] = {
"eventservicedevice": DEFAULT_DEV,
"eventservicegroup": "224.1.2.8:45703",
"otamanagerdevice": DEFAULT_DEV,
"otamanagergroup": "224.1.2.8:45702",
}
platform_config: list[Configuration] = []
# default mac configuration settings # default mac configuration settings
mac_library = None mac_library: Optional[str] = None
mac_xml = None mac_xml: Optional[str] = None
mac_defaults = {} mac_defaults: dict[str, str] = {}
mac_config = [] mac_config: list[Configuration] = []
# default phy configuration settings, using the universal model # default phy configuration settings, using the universal model
phy_library = None phy_library: Optional[str] = None
phy_xml = "emanephy.xml" phy_xml: str = "emanephy.xml"
phy_defaults = { phy_defaults: dict[str, str] = {
"subid": "1", "subid": "1",
"propagationmodel": "2ray", "propagationmodel": "2ray",
"noisemode": "none" "noisemode": "none",
} }
phy_config = [] phy_config: list[Configuration] = []
# support for external configurations # support for external configurations
external_config = [ external_config: list[Configuration] = [
Configuration("external", ConfigDataTypes.BOOL, default="0"), ConfigBool(id="external", default="0"),
Configuration("platformendpoint", ConfigDataTypes.STRING, default="127.0.0.1:40001"), ConfigString(id="platformendpoint", default="127.0.0.1:40001"),
Configuration("transportendpoint", ConfigDataTypes.STRING, default="127.0.0.1:50002") ConfigString(id="transportendpoint", default="127.0.0.1:50002"),
] ]
config_ignore = set() config_ignore: set[str] = set()
@classmethod @classmethod
def load(cls, emane_prefix): def load(cls, emane_prefix: Path) -> None:
""" """
Called after being loaded within the EmaneManager. Provides configured emane_prefix for Called after being loaded within the EmaneManager. Provides configured
parsing xml files. emane_prefix for parsing xml files.
:param str emane_prefix: configured emane prefix path :param emane_prefix: configured emane prefix path
:return: nothing :return: nothing
""" """
manifest_path = "share/emane/manifest" cls._load_platform_config(emane_prefix)
# load mac configuration # load mac configuration
mac_xml_path = os.path.join(emane_prefix, manifest_path, cls.mac_xml) mac_xml_path = emane_prefix / MANIFEST_PATH / cls.mac_xml
cls.mac_config = emanemanifest.parse(mac_xml_path, cls.mac_defaults) cls.mac_config = emanemanifest.parse(mac_xml_path, cls.mac_defaults)
# load phy configuration # load phy configuration
phy_xml_path = os.path.join(emane_prefix, manifest_path, cls.phy_xml) phy_xml_path = emane_prefix / MANIFEST_PATH / cls.phy_xml
cls.phy_config = emanemanifest.parse(phy_xml_path, cls.phy_defaults) cls.phy_config = emanemanifest.parse(phy_xml_path, cls.phy_defaults)
@classmethod @classmethod
def configurations(cls): def _load_platform_config(cls, emane_prefix: Path) -> None:
platform_xml_path = emane_prefix / MANIFEST_PATH / cls.platform_xml
cls.platform_config = emanemanifest.parse(
platform_xml_path, cls.platform_defaults
)
# remove controlport configuration, since core will set this directly
controlport_index = None
for index, configuration in enumerate(cls.platform_config):
if configuration.id == cls.platform_controlport:
controlport_index = index
break
if controlport_index is not None:
cls.platform_config.pop(controlport_index)
@classmethod
def configurations(cls) -> list[Configuration]:
""" """
Returns the combination all all configurations (mac, phy, and external). Returns the combination all all configurations (mac, phy, and external).
:return: all configurations :return: all configurations
:rtype: list[Configuration]
""" """
return cls.mac_config + cls.phy_config + cls.external_config return (
cls.platform_config + cls.mac_config + cls.phy_config + cls.external_config
)
@classmethod @classmethod
def config_groups(cls): def config_groups(cls) -> list[ConfigGroup]:
""" """
Returns the defined configuration groups. Returns the defined configuration groups.
:return: list of configuration groups. :return: list of configuration groups.
:rtype: list[ConfigGroup]
""" """
mac_len = len(cls.mac_config) platform_len = len(cls.platform_config)
mac_len = len(cls.mac_config) + platform_len
phy_len = len(cls.phy_config) + mac_len phy_len = len(cls.phy_config) + mac_len
config_len = len(cls.configurations()) config_len = len(cls.configurations())
return [ return [
ConfigGroup("MAC Parameters", 1, mac_len), ConfigGroup("Platform Parameters", 1, platform_len),
ConfigGroup("MAC Parameters", platform_len + 1, mac_len),
ConfigGroup("PHY Parameters", mac_len + 1, phy_len), ConfigGroup("PHY Parameters", mac_len + 1, phy_len),
ConfigGroup("External Parameters", phy_len + 1, config_len) ConfigGroup("External Parameters", phy_len + 1, config_len),
] ]
def build_xml_files(self, config, interface=None): def build_xml_files(self, config: dict[str, str], iface: CoreInterface) -> None:
""" """
Builds xml files for this emane model. Creates a nem.xml file that points to both mac.xml and phy.xml Builds xml files for this emane model. Creates a nem.xml file that points to
definitions. both mac.xml and phy.xml definitions.
:param dict config: emane model configuration for the node and interface :param config: emane model configuration for the node and interface
:param interface: interface for the emane node :param iface: interface to run emane for
:return: nothing :return: nothing
""" """
nem_name = emanexml.nem_file_name(self, interface) # create nem, mac, and phy xml files
mac_name = emanexml.mac_file_name(self, interface) emanexml.create_nem_xml(self, iface, config)
phy_name = emanexml.phy_file_name(self, interface) emanexml.create_mac_xml(self, iface, config)
emanexml.create_phy_xml(self, iface, config)
emanexml.create_transport_xml(iface, config)
# check if this is external def post_startup(self, iface: CoreInterface) -> None:
transport_type = "virtual"
if interface and interface.transport_type == "raw":
transport_type = "raw"
transport_name = emanexml.transport_file_name(self.object_id, transport_type)
# create nem xml file
nem_file = os.path.join(self.session.session_dir, nem_name)
emanexml.create_nem_xml(self, config, nem_file, transport_name, mac_name, phy_name)
# create mac xml file
mac_file = os.path.join(self.session.session_dir, mac_name)
emanexml.create_mac_xml(self, config, mac_file)
# create phy xml file
phy_file = os.path.join(self.session.session_dir, phy_name)
emanexml.create_phy_xml(self, config, phy_file)
def post_startup(self):
""" """
Logic to execute after the emane manager is finished with startup. Logic to execute after the emane manager is finished with startup.
:param iface: interface for post startup
:return: nothing :return: nothing
""" """
logging.info("emane model(%s) has no post setup tasks", self.name) logger.debug("emane model(%s) has no post setup tasks", self.name)
def update(self, moved, moved_netifs): def update(self, moved_ifaces: list[CoreInterface]) -> None:
""" """
Invoked from MobilityModel when nodes are moved; this causes Invoked from MobilityModel when nodes are moved; this causes
emane location events to be generated for the nodes in the moved emane location events to be generated for the nodes in the moved
list, making EmaneModels compatible with Ns2ScriptedMobility. list, making EmaneModels compatible with Ns2ScriptedMobility.
:param bool moved: were nodes moved :param moved_ifaces: interfaces that were moved
:param list moved_netifs: interfaces that were moved :return: nothing
:return:
""" """
try: try:
wlan = self.session.get_object(self.object_id) self.session.emane.set_nem_positions(moved_ifaces)
wlan.setnempositions(moved_netifs) except CoreError:
except KeyError: logger.exception("error during update")
logging.exception("error during update")
def linkconfig(self, netif, bw=None, delay=None, loss=None, duplicate=None, jitter=None, netif2=None): def linkconfig(
self, iface: CoreInterface, options: LinkOptions, iface2: CoreInterface = None
) -> None:
""" """
Invoked when a Link Message is received. Default is unimplemented. Invoked when a Link Message is received. Default is unimplemented.
:param core.netns.vif.Veth netif: interface one :param iface: interface one
:param bw: bandwidth to set to :param options: options for configuring link
:param delay: packet delay to set to :param iface2: interface two
:param loss: packet loss to set to
:param duplicate: duplicate percentage to set to
:param jitter: jitter to set to
:param core.netns.vif.Veth netif2: interface two
:return: nothing :return: nothing
""" """
logging.warn("emane model(%s) does not support link configuration", self.name) logger.warning("emane model(%s) does not support link config", self.name)

View file

@ -1,23 +0,0 @@
"""
ieee80211abg.py: EMANE IEEE 802.11abg model for CORE
"""
import os
from core.emane import emanemodel
class EmaneIeee80211abgModel(emanemodel.EmaneModel):
# model name
name = "emane_ieee80211abg"
# mac configuration
mac_library = "ieee80211abgmaclayer"
mac_xml = "ieee80211abgmaclayer.xml"
@classmethod
def load(cls, emane_prefix):
cls.mac_defaults["pcrcurveuri"] = os.path.join(
emane_prefix,
"share/emane/xml/models/mac/ieee80211abg/ieee80211pcr.xml"
)
super(EmaneIeee80211abgModel, cls).load(emane_prefix)

View file

@ -0,0 +1,328 @@
import logging
import sched
import threading
import time
from typing import TYPE_CHECKING, Optional
from lxml import etree
from core.emane.nodes import EmaneNet
from core.emulator.data import LinkData
from core.emulator.enumerations import LinkTypes, MessageFlags
from core.nodes.network import CtrlNet
logger = logging.getLogger(__name__)
try:
from emane import shell
except ImportError:
try:
from emanesh import shell
except ImportError:
shell = None
logger.debug("compatible emane python bindings not installed")
if TYPE_CHECKING:
from core.emane.emanemanager import EmaneManager
MAC_COMPONENT_INDEX: int = 1
EMANE_RFPIPE: str = "rfpipemaclayer"
EMANE_80211: str = "ieee80211abgmaclayer"
EMANE_TDMA: str = "tdmaeventschedulerradiomodel"
SINR_TABLE: str = "NeighborStatusTable"
NEM_SELF: int = 65535
class LossTable:
def __init__(self, losses: dict[float, float]) -> None:
self.losses: dict[float, float] = losses
self.sinrs: list[float] = sorted(self.losses.keys())
self.loss_lookup: dict[int, float] = {}
for index, value in enumerate(self.sinrs):
self.loss_lookup[index] = self.losses[value]
self.mac_id: Optional[str] = None
def get_loss(self, sinr: float) -> float:
index = self._get_index(sinr)
loss = 100.0 - self.loss_lookup[index]
return loss
def _get_index(self, current_sinr: float) -> int:
for index, sinr in enumerate(self.sinrs):
if current_sinr <= sinr:
return index
return len(self.sinrs) - 1
class EmaneLink:
def __init__(self, from_nem: int, to_nem: int, sinr: float) -> None:
self.from_nem: int = from_nem
self.to_nem: int = to_nem
self.sinr: float = sinr
self.last_seen: Optional[float] = None
self.updated: bool = False
self.touch()
def update(self, sinr: float) -> None:
self.updated = self.sinr != sinr
self.sinr = sinr
self.touch()
def touch(self) -> None:
self.last_seen = time.monotonic()
def is_dead(self, timeout: int) -> bool:
return (time.monotonic() - self.last_seen) >= timeout
def __repr__(self) -> str:
return f"EmaneLink({self.from_nem}, {self.to_nem}, {self.sinr})"
class EmaneClient:
def __init__(self, address: str, port: int) -> None:
self.address: str = address
self.client: shell.ControlPortClient = shell.ControlPortClient(
self.address, port
)
self.nems: dict[int, LossTable] = {}
self.setup()
def setup(self) -> None:
manifest = self.client.getManifest()
for nem_id, components in manifest.items():
# get mac config
mac_id, _, emane_model = components[MAC_COMPONENT_INDEX]
mac_config = self.client.getConfiguration(mac_id)
logger.debug(
"address(%s) nem(%s) emane(%s)", self.address, nem_id, emane_model
)
# create loss table based on current configuration
if emane_model == EMANE_80211:
loss_table = self.handle_80211(mac_config)
elif emane_model == EMANE_RFPIPE:
loss_table = self.handle_rfpipe(mac_config)
else:
logger.warning("unknown emane link model: %s", emane_model)
continue
logger.info("monitoring links nem(%s) model(%s)", nem_id, emane_model)
loss_table.mac_id = mac_id
self.nems[nem_id] = loss_table
def check_links(
self, links: dict[tuple[int, int], EmaneLink], loss_threshold: int
) -> None:
for from_nem, loss_table in self.nems.items():
tables = self.client.getStatisticTable(loss_table.mac_id, (SINR_TABLE,))
table = tables[SINR_TABLE][1:][0]
for row in table:
row = row
to_nem = row[0][0]
sinr = row[5][0]
age = row[-1][0]
# exclude invalid links
is_self = to_nem == NEM_SELF
has_valid_age = 0 <= age <= 1
if is_self or not has_valid_age:
continue
# check if valid link loss
link_key = (from_nem, to_nem)
loss = loss_table.get_loss(sinr)
if loss < loss_threshold:
link = links.get(link_key)
if link:
link.update(sinr)
else:
link = EmaneLink(from_nem, to_nem, sinr)
links[link_key] = link
def handle_tdma(self, config: dict[str, tuple]):
pcr = config["pcrcurveuri"][0][0]
logger.debug("tdma pcr: %s", pcr)
def handle_80211(self, config: dict[str, tuple]) -> LossTable:
unicastrate = config["unicastrate"][0][0]
pcr = config["pcrcurveuri"][0][0]
logger.debug("80211 pcr: %s", pcr)
tree = etree.parse(pcr)
root = tree.getroot()
table = root.find("table")
losses = {}
for rate in table.iter("datarate"):
index = int(rate.get("index"))
if index == unicastrate:
for row in rate.iter("row"):
sinr = float(row.get("sinr"))
por = float(row.get("por"))
losses[sinr] = por
return LossTable(losses)
def handle_rfpipe(self, config: dict[str, tuple]) -> LossTable:
pcr = config["pcrcurveuri"][0][0]
logger.debug("rfpipe pcr: %s", pcr)
tree = etree.parse(pcr)
root = tree.getroot()
table = root.find("table")
losses = {}
for row in table.iter("row"):
sinr = float(row.get("sinr"))
por = float(row.get("por"))
losses[sinr] = por
return LossTable(losses)
def stop(self) -> None:
self.client.stop()
class EmaneLinkMonitor:
def __init__(self, emane_manager: "EmaneManager") -> None:
self.emane_manager: "EmaneManager" = emane_manager
self.clients: list[EmaneClient] = []
self.links: dict[tuple[int, int], EmaneLink] = {}
self.complete_links: set[tuple[int, int]] = set()
self.loss_threshold: Optional[int] = None
self.link_interval: Optional[int] = None
self.link_timeout: Optional[int] = None
self.scheduler: Optional[sched.scheduler] = None
self.running: bool = False
def start(self) -> None:
options = self.emane_manager.session.options
self.loss_threshold = options.get_int("loss_threshold")
self.link_interval = options.get_int("link_interval")
self.link_timeout = options.get_int("link_timeout")
self.initialize()
if not self.clients:
logger.info("no valid emane models to monitor links")
return
self.scheduler = sched.scheduler()
self.scheduler.enter(0, 0, self.check_links)
self.running = True
thread = threading.Thread(target=self.scheduler.run, daemon=True)
thread.start()
def initialize(self) -> None:
addresses = self.get_addresses()
for address, port in addresses:
client = EmaneClient(address, port)
if client.nems:
self.clients.append(client)
def get_addresses(self) -> list[tuple[str, int]]:
addresses = []
nodes = self.emane_manager.getnodes()
for node in nodes:
control = None
ports = []
for iface in node.get_ifaces():
if isinstance(iface.net, CtrlNet):
ip4 = iface.get_ip4()
if ip4:
control = str(ip4.ip)
if isinstance(iface.net, EmaneNet):
port = self.emane_manager.get_nem_port(iface)
ports.append(port)
if control:
for port in ports:
addresses.append((control, port))
return addresses
def check_links(self) -> None:
# check for new links
previous_links = set(self.links.keys())
for client in self.clients:
try:
client.check_links(self.links, self.loss_threshold)
except shell.ControlPortException:
if self.running:
logger.exception("link monitor error")
# find new links
current_links = set(self.links.keys())
new_links = current_links - previous_links
# find updated and dead links
dead_links = []
for link_id, link in self.links.items():
complete_id = self.get_complete_id(link_id)
if link.is_dead(self.link_timeout):
dead_links.append(link_id)
elif link.updated and complete_id in self.complete_links:
link.updated = False
self.send_link(MessageFlags.NONE, complete_id)
# announce dead links
for link_id in dead_links:
complete_id = self.get_complete_id(link_id)
if complete_id in self.complete_links:
self.complete_links.remove(complete_id)
self.send_link(MessageFlags.DELETE, complete_id)
del self.links[link_id]
# announce new links
for link_id in new_links:
complete_id = self.get_complete_id(link_id)
if complete_id in self.complete_links:
continue
if self.is_complete_link(link_id):
self.complete_links.add(complete_id)
self.send_link(MessageFlags.ADD, complete_id)
if self.running:
self.scheduler.enter(self.link_interval, 0, self.check_links)
def get_complete_id(self, link_id: tuple[int, int]) -> tuple[int, int]:
value1, value2 = link_id
if value1 < value2:
return value1, value2
else:
return value2, value1
def is_complete_link(self, link_id: tuple[int, int]) -> bool:
reverse_id = link_id[1], link_id[0]
return link_id in self.links and reverse_id in self.links
def get_link_label(self, link_id: tuple[int, int]) -> str:
source_id = tuple(sorted(link_id))
source_link = self.links[source_id]
dest_id = link_id[::-1]
dest_link = self.links[dest_id]
return f"{source_link.sinr:.1f} / {dest_link.sinr:.1f}"
def send_link(self, message_type: MessageFlags, link_id: tuple[int, int]) -> None:
nem1, nem2 = link_id
link = self.emane_manager.get_nem_link(nem1, nem2, message_type)
if link:
label = self.get_link_label(link_id)
link.label = label
self.emane_manager.session.broadcast_link(link)
def send_message(
self,
message_type: MessageFlags,
label: str,
node1: int,
node2: int,
emane_id: int,
) -> None:
color = self.emane_manager.session.get_link_color(emane_id)
link_data = LinkData(
message_type=message_type,
type=LinkTypes.WIRELESS,
label=label,
node1_id=node1,
node2_id=node2,
network_id=emane_id,
color=color,
)
self.emane_manager.session.broadcast_link(link_data)
def stop(self) -> None:
self.running = False
for client in self.clients:
client.stop()
self.clients.clear()
self.links.clear()
self.complete_links.clear()

View file

@ -0,0 +1,69 @@
import logging
import pkgutil
from pathlib import Path
from core import utils
from core.emane import models as emane_models
from core.emane.emanemodel import EmaneModel
from core.errors import CoreError
logger = logging.getLogger(__name__)
class EmaneModelManager:
models: dict[str, type[EmaneModel]] = {}
@classmethod
def load_locals(cls, emane_prefix: Path) -> list[str]:
"""
Load local core emane models and make them available.
:param emane_prefix: installed emane prefix
:return: list of errors encountered loading emane models
"""
errors = []
for module_info in pkgutil.walk_packages(
emane_models.__path__, f"{emane_models.__name__}."
):
models = utils.load_module(module_info.name, EmaneModel)
for model in models:
logger.debug("loading emane model: %s", model.name)
try:
model.load(emane_prefix)
cls.models[model.name] = model
except CoreError as e:
errors.append(model.name)
logger.debug("not loading emane model(%s): %s", model.name, e)
return errors
@classmethod
def load(cls, path: Path, emane_prefix: Path) -> list[str]:
"""
Search and load custom emane models and make them available.
:param path: path to search for custom emane models
:param emane_prefix: installed emane prefix
:return: list of errors encountered loading emane models
"""
subdirs = [x for x in path.iterdir() if x.is_dir()]
subdirs.append(path)
errors = []
for subdir in subdirs:
logger.debug("loading emane models from: %s", subdir)
models = utils.load_classes(subdir, EmaneModel)
for model in models:
logger.debug("loading emane model: %s", model.name)
try:
model.load(emane_prefix)
cls.models[model.name] = model
except CoreError as e:
errors.append(model.name)
logger.debug("not loading emane model(%s): %s", model.name, e)
return errors
@classmethod
def get(cls, name: str) -> type[EmaneModel]:
model = cls.models.get(name)
if model is None:
raise CoreError(f"emame model does not exist {name}")
return model

View file

View file

@ -0,0 +1,32 @@
"""
EMANE Bypass model for CORE
"""
from pathlib import Path
from core.config import ConfigBool, Configuration
from core.emane import emanemodel
class EmaneBypassModel(emanemodel.EmaneModel):
name: str = "emane_bypass"
# values to ignore, when writing xml files
config_ignore: set[str] = {"none"}
# mac definitions
mac_library: str = "bypassmaclayer"
mac_config: list[Configuration] = [
ConfigBool(
id="none",
default="0",
label="There are no parameters for the bypass model.",
)
]
# phy definitions
phy_library: str = "bypassphylayer"
phy_config: list[Configuration] = []
@classmethod
def load(cls, emane_prefix: Path) -> None:
cls._load_platform_config(emane_prefix)

View file

@ -0,0 +1,142 @@
"""
commeffect.py: EMANE CommEffect model for CORE
"""
import logging
from pathlib import Path
from lxml import etree
from core.config import ConfigGroup, Configuration
from core.emane import emanemanifest, emanemodel
from core.emulator.data import LinkOptions
from core.nodes.interface import CoreInterface
from core.xml import emanexml
logger = logging.getLogger(__name__)
try:
from emane.events.commeffectevent import CommEffectEvent
except ImportError:
try:
from emanesh.events.commeffectevent import CommEffectEvent
except ImportError:
CommEffectEvent = None
logger.debug("compatible emane python bindings not installed")
def convert_none(x: float) -> int:
"""
Helper to use 0 for None values.
"""
if isinstance(x, str):
x = float(x)
if x is None:
return 0
else:
return int(x)
class EmaneCommEffectModel(emanemodel.EmaneModel):
name: str = "emane_commeffect"
shim_library: str = "commeffectshim"
shim_xml: str = "commeffectshim.xml"
shim_defaults: dict[str, str] = {}
config_shim: list[Configuration] = []
# comm effect does not need the default phy and external configurations
phy_config: list[Configuration] = []
external_config: list[Configuration] = []
@classmethod
def load(cls, emane_prefix: Path) -> None:
cls._load_platform_config(emane_prefix)
shim_xml_path = emane_prefix / "share/emane/manifest" / cls.shim_xml
cls.config_shim = emanemanifest.parse(shim_xml_path, cls.shim_defaults)
@classmethod
def configurations(cls) -> list[Configuration]:
return cls.platform_config + cls.config_shim
@classmethod
def config_groups(cls) -> list[ConfigGroup]:
platform_len = len(cls.platform_config)
return [
ConfigGroup("Platform Parameters", 1, platform_len),
ConfigGroup(
"CommEffect SHIM Parameters",
platform_len + 1,
len(cls.configurations()),
),
]
def build_xml_files(self, config: dict[str, str], iface: CoreInterface) -> None:
"""
Build the necessary nem and commeffect XMLs in the given path.
If an individual NEM has a nonstandard config, we need to build
that file also. Otherwise the WLAN-wide
nXXemane_commeffectnem.xml, nXXemane_commeffectshim.xml are used.
:param config: emane model configuration for the node and interface
:param iface: interface for the emane node
:return: nothing
"""
# create and write nem document
nem_element = etree.Element("nem", name=f"{self.name} NEM", type="unstructured")
transport_name = emanexml.transport_file_name(iface)
etree.SubElement(nem_element, "transport", definition=transport_name)
# set shim configuration
nem_name = emanexml.nem_file_name(iface)
shim_name = emanexml.shim_file_name(iface)
etree.SubElement(nem_element, "shim", definition=shim_name)
emanexml.create_node_file(iface.node, nem_element, "nem", nem_name)
# create and write shim document
shim_element = etree.Element(
"shim", name=f"{self.name} SHIM", library=self.shim_library
)
# append all shim options (except filterfile) to shimdoc
for configuration in self.config_shim:
name = configuration.id
if name == "filterfile":
continue
value = config[name]
emanexml.add_param(shim_element, name, value)
# empty filterfile is not allowed
ff = config["filterfile"]
if ff.strip() != "":
emanexml.add_param(shim_element, "filterfile", ff)
emanexml.create_node_file(iface.node, shim_element, "shim", shim_name)
# create transport xml
emanexml.create_transport_xml(iface, config)
def linkconfig(
self, iface: CoreInterface, options: LinkOptions, iface2: CoreInterface = None
) -> None:
"""
Generate CommEffect events when a Link Message is received having
link parameters.
"""
if iface is None or iface2 is None:
logger.warning("%s: missing NEM information", self.name)
return
# TODO: batch these into multiple events per transmission
# TODO: may want to split out seconds portion of delay and jitter
event = CommEffectEvent()
nem1 = self.session.emane.get_nem_id(iface)
nem2 = self.session.emane.get_nem_id(iface2)
logger.info("sending comm effect event")
event.append(
nem1,
latency=convert_none(options.delay),
jitter=convert_none(options.jitter),
loss=convert_none(options.loss),
duplicate=convert_none(options.dup),
unicast=int(convert_none(options.bandwidth)),
broadcast=int(convert_none(options.bandwidth)),
)
self.session.emane.publish_event(nem2, event)

View file

@ -0,0 +1,22 @@
"""
ieee80211abg.py: EMANE IEEE 802.11abg model for CORE
"""
from pathlib import Path
from core.emane import emanemodel
class EmaneIeee80211abgModel(emanemodel.EmaneModel):
# model name
name: str = "emane_ieee80211abg"
# mac configuration
mac_library: str = "ieee80211abgmaclayer"
mac_xml: str = "ieee80211abgmaclayer.xml"
@classmethod
def load(cls, emane_prefix: Path) -> None:
cls.mac_defaults["pcrcurveuri"] = str(
emane_prefix / "share/emane/xml/models/mac/ieee80211abg/ieee80211pcr.xml"
)
super().load(emane_prefix)

View file

@ -0,0 +1,22 @@
"""
rfpipe.py: EMANE RF-PIPE model for CORE
"""
from pathlib import Path
from core.emane import emanemodel
class EmaneRfPipeModel(emanemodel.EmaneModel):
# model name
name: str = "emane_rfpipe"
# mac configuration
mac_library: str = "rfpipemaclayer"
mac_xml: str = "rfpipemaclayer.xml"
@classmethod
def load(cls, emane_prefix: Path) -> None:
cls.mac_defaults["pcrcurveuri"] = str(
emane_prefix / "share/emane/xml/models/mac/rfpipe/rfpipepcr.xml"
)
super().load(emane_prefix)

View file

@ -0,0 +1,65 @@
"""
tdma.py: EMANE TDMA model bindings for CORE
"""
import logging
from pathlib import Path
from core import constants, utils
from core.config import ConfigString
from core.emane import emanemodel
from core.emane.nodes import EmaneNet
from core.nodes.interface import CoreInterface
logger = logging.getLogger(__name__)
class EmaneTdmaModel(emanemodel.EmaneModel):
# model name
name: str = "emane_tdma"
# mac configuration
mac_library: str = "tdmaeventschedulerradiomodel"
mac_xml: str = "tdmaeventschedulerradiomodel.xml"
# add custom schedule options and ignore it when writing emane xml
schedule_name: str = "schedule"
default_schedule: Path = (
constants.CORE_DATA_DIR / "examples" / "tdma" / "schedule.xml"
)
config_ignore: set[str] = {schedule_name}
@classmethod
def load(cls, emane_prefix: Path) -> None:
cls.mac_defaults["pcrcurveuri"] = str(
emane_prefix
/ "share/emane/xml/models/mac/tdmaeventscheduler/tdmabasemodelpcr.xml"
)
super().load(emane_prefix)
config_item = ConfigString(
id=cls.schedule_name,
default=str(cls.default_schedule),
label="TDMA schedule file (core)",
)
cls.mac_config.insert(0, config_item)
def post_startup(self, iface: CoreInterface) -> None:
# get configured schedule
emane_net = self.session.get_node(self.id, EmaneNet)
config = self.session.emane.get_iface_config(emane_net, iface)
schedule = Path(config[self.schedule_name])
if not schedule.is_file():
logger.error("ignoring invalid tdma schedule: %s", schedule)
return
# initiate tdma schedule
nem_id = self.session.emane.get_nem_id(iface)
if not nem_id:
logger.error("could not find nem for interface")
return
service = self.session.emane.nem_service.get(nem_id)
if service:
device = service.device
logger.info(
"setting up tdma schedule: schedule(%s) device(%s)", schedule, device
)
utils.cmd(f"emaneevent-tdmaschedule -i {device} {schedule}")

View file

@ -1,15 +1,26 @@
""" """
nodes.py: definition of an EmaneNode class for implementing configuration Provides an EMANE network node class, which has several attached NEMs that
control of an EMANE emulation. An EmaneNode has several attached NEMs that
share the same MAC+PHY model. share the same MAC+PHY model.
""" """
import logging import logging
import time
from dataclasses import dataclass
from typing import TYPE_CHECKING, Callable, Optional, Union
from core.coreobj import PyCoreNet from core.emulator.data import InterfaceData, LinkData, LinkOptions
from core.enumerations import LinkTypes from core.emulator.distributed import DistributedServer
from core.enumerations import NodeTypes from core.emulator.enumerations import MessageFlags, RegisterTlvs
from core.enumerations import RegisterTlvs from core.errors import CoreCommandError, CoreError
from core.nodes.base import CoreNetworkBase, CoreNode, NodeOptions
from core.nodes.interface import CoreInterface
logger = logging.getLogger(__name__)
if TYPE_CHECKING:
from core.emane.emanemodel import EmaneModel
from core.emulator.session import Session
from core.location.mobility import WayPointMobility
try: try:
from emane.events import LocationEvent from emane.events import LocationEvent
@ -17,194 +28,263 @@ except ImportError:
try: try:
from emanesh.events import LocationEvent from emanesh.events import LocationEvent
except ImportError: except ImportError:
logging.debug("compatible emane python bindings not installed") LocationEvent = None
logger.debug("compatible emane python bindings not installed")
class EmaneNet(PyCoreNet): class TunTap(CoreInterface):
""" """
EMANE network base class. TUN/TAP virtual device in TAP mode
""" """
apitype = NodeTypes.EMANE.value
linktype = LinkTypes.WIRELESS.value def __init__(
# icon used self,
type = "wlan" _id: int,
name: str,
localname: str,
use_ovs: bool,
node: CoreNode = None,
server: "DistributedServer" = None,
) -> None:
super().__init__(_id, name, localname, use_ovs, node=node, server=server)
self.node: CoreNode = node
def startup(self) -> None:
"""
Startup logic for a tunnel tap.
:return: nothing
"""
self.up = True
def shutdown(self) -> None:
"""
Shutdown functionality for a tunnel tap.
:return: nothing
"""
if not self.up:
return
self.up = False
def waitfor(
self, func: Callable[[], int], attempts: int = 10, maxretrydelay: float = 0.25
) -> bool:
"""
Wait for func() to return zero with exponential backoff.
:param func: function to wait for a result of zero
:param attempts: number of attempts to wait for a zero result
:param maxretrydelay: maximum retry delay
:return: True if wait succeeded, False otherwise
"""
delay = 0.01
result = False
for i in range(1, attempts + 1):
r = func()
if r == 0:
result = True
break
msg = f"attempt {i} failed with nonzero exit status {r}"
if i < attempts + 1:
msg += ", retrying..."
logger.info(msg)
time.sleep(delay)
delay += delay
if delay > maxretrydelay:
delay = maxretrydelay
else:
msg += ", giving up"
logger.info(msg)
return result
def nodedevexists(self) -> int:
"""
Checks if device exists.
:return: 0 if device exists, 1 otherwise
"""
try:
self.node.node_net_client.device_show(self.name)
return 0
except CoreCommandError:
return 1
def waitfordevicenode(self) -> None:
"""
Check for presence of a node device - tap device may not appear right away waits.
:return: nothing
"""
logger.debug("waiting for device node: %s", self.name)
count = 0
while True:
result = self.waitfor(self.nodedevexists)
if result:
break
should_retry = count < 5
is_emane_running = self.node.session.emane.emanerunning(self.node)
if all([should_retry, is_emane_running]):
count += 1
else:
raise RuntimeError("node device failed to exist")
def set_ips(self) -> None:
"""
Set interface ip addresses.
:return: nothing
"""
self.waitfordevicenode()
for ip in self.ips():
self.node.node_net_client.create_address(self.name, str(ip))
class EmaneNode(EmaneNet): @dataclass
class EmaneOptions(NodeOptions):
emane_model: str = None
"""name of emane model to associate an emane network to"""
class EmaneNet(CoreNetworkBase):
""" """
EMANE node contains NEM configuration and causes connected nodes EMANE node contains NEM configuration and causes connected nodes
to have TAP interfaces (instead of VEth). These are managed by the to have TAP interfaces (instead of VEth). These are managed by the
Emane controller object that exists in a session. Emane controller object that exists in a session.
""" """
def __init__(self, session, objid=None, name=None, start=True): def __init__(
super(EmaneNode, self).__init__(session, objid, name, start) self,
self.conf = "" session: "Session",
self.up = False _id: int = None,
self.nemidmap = {} name: str = None,
self.model = None server: DistributedServer = None,
self.mobility = None options: EmaneOptions = None,
) -> None:
options = options or EmaneOptions()
super().__init__(session, _id, name, server, options)
self.conf: str = ""
self.mobility: Optional[WayPointMobility] = None
model_class = self.session.emane.get_model(options.emane_model)
self.wireless_model: Optional["EmaneModel"] = model_class(self.session, self.id)
if self.session.is_running():
self.session.emane.add_node(self)
def linkconfig(self, netif, bw=None, delay=None, loss=None, duplicate=None, jitter=None, netif2=None): @classmethod
def create_options(cls) -> EmaneOptions:
return EmaneOptions()
def linkconfig(
self, iface: CoreInterface, options: LinkOptions, iface2: CoreInterface = None
) -> None:
""" """
The CommEffect model supports link configuration. The CommEffect model supports link configuration.
""" """
if not self.model: if not self.wireless_model:
return return
return self.model.linkconfig(netif=netif, bw=bw, delay=delay, loss=loss, self.wireless_model.linkconfig(iface, options, iface2)
duplicate=duplicate, jitter=jitter, netif2=netif2)
def config(self, conf): def startup(self) -> None:
self.conf = conf self.up = True
def shutdown(self): def shutdown(self) -> None:
self.up = False
def link(self, iface1: CoreInterface, iface2: CoreInterface) -> None:
pass pass
def link(self, netif1, netif2): def unlink(self, iface1: CoreInterface, iface2: CoreInterface) -> None:
pass pass
def unlink(self, netif1, netif2): def updatemodel(self, config: dict[str, str]) -> None:
pass """
Update configuration for the current model.
def updatemodel(self, config): :param config: configuration to update model with
if not self.model: :return: nothing
raise ValueError("no model set to update for node(%s)", self.objid) """
logging.info("node(%s) updating model(%s): %s", self.objid, self.model.name, config) if not self.wireless_model:
self.model.set_configs(config, node_id=self.objid) raise CoreError(f"no model set to update for node({self.name})")
logger.info(
"node(%s) updating model(%s): %s", self.id, self.wireless_model.name, config
)
self.wireless_model.update_config(config)
def setmodel(self, model, config): def setmodel(
self,
model: Union[type["EmaneModel"], type["WayPointMobility"]],
config: dict[str, str],
) -> None:
""" """
set the EmaneModel associated with this node set the EmaneModel associated with this node
""" """
logging.info("adding model: %s", model.name) if model.config_type == RegisterTlvs.WIRELESS:
if model.config_type == RegisterTlvs.WIRELESS.value: self.wireless_model = model(session=self.session, _id=self.id)
# EmaneModel really uses values from ConfigurableManager self.wireless_model.update_config(config)
# when buildnemxml() is called, not during init() elif model.config_type == RegisterTlvs.MOBILITY:
self.model = model(session=self.session, object_id=self.objid) self.mobility = model(session=self.session, _id=self.id)
self.model.update_config(config)
elif model.config_type == RegisterTlvs.MOBILITY.value:
self.mobility = model(session=self.session, object_id=self.objid)
self.mobility.update_config(config) self.mobility.update_config(config)
def setnemid(self, netif, nemid): def links(self, flags: MessageFlags = MessageFlags.NONE) -> list[LinkData]:
""" links = []
Record an interface to numerical ID mapping. The Emane controller emane_manager = self.session.emane
object manages and assigns these IDs for all NEMs. # gather current emane links
""" nem_ids = set()
self.nemidmap[netif] = nemid for iface in self.get_ifaces():
nem_id = emane_manager.get_nem_id(iface)
def getnemid(self, netif): nem_ids.add(nem_id)
""" emane_links = emane_manager.link_monitor.links
Given an interface, return its numerical ID. considered = set()
""" for link_key in emane_links:
if netif not in self.nemidmap: considered_key = tuple(sorted(link_key))
return None if considered_key in considered:
else:
return self.nemidmap[netif]
def getnemnetif(self, nemid):
"""
Given a numerical NEM ID, return its interface. This returns the
first interface that matches the given NEM ID.
"""
for netif in self.nemidmap:
if self.nemidmap[netif] == nemid:
return netif
return None
def netifs(self, sort=True):
"""
Retrieve list of linked interfaces sorted by node number.
"""
return sorted(self._netif.values(), key=lambda ifc: ifc.node.objid)
def installnetifs(self):
"""
Install TAP devices into their namespaces. This is done after
EMANE daemons have been started, because that is their only chance
to bind to the TAPs.
"""
if self.session.emane.genlocationevents() and self.session.emane.service is None:
warntxt = "unable to publish EMANE events because the eventservice "
warntxt += "Python bindings failed to load"
logging.error(warntxt)
for netif in self.netifs():
external = self.session.emane.get_config("external", self.objid, self.model.name)
if external == "0":
netif.setaddrs()
if not self.session.emane.genlocationevents():
netif.poshook = None
continue continue
considered.add(considered_key)
# at this point we register location handlers for generating nem1, nem2 = considered_key
# EMANE location events # ignore links not related to this node
netif.poshook = self.setnemposition if nem1 not in nem_ids and nem2 not in nem_ids:
x, y, z = netif.node.position.get()
self.setnemposition(netif, x, y, z)
def deinstallnetifs(self):
"""
Uninstall TAP devices. This invokes their shutdown method for
any required cleanup; the device may be actually removed when
emanetransportd terminates.
"""
for netif in self.netifs():
if "virtual" in netif.transport_type.lower():
netif.shutdown()
netif.poshook = None
def setnemposition(self, netif, x, y, z):
"""
Publish a NEM location change event using the EMANE event service.
"""
if self.session.emane.service is None:
logging.info("position service not available")
return
nemid = self.getnemid(netif)
ifname = netif.localname
if nemid is None:
logging.info("nemid for %s is unknown" % ifname)
return
lat, long, alt = self.session.location.getgeo(x, y, z)
logging.info("setnemposition %s (%s) x,y,z=(%d,%d,%s)(%.6f,%.6f,%.6f)", ifname, nemid, x, y, z, lat, long, alt)
event = LocationEvent()
# altitude must be an integer or warning is printed
# unused: yaw, pitch, roll, azimuth, elevation, velocity
alt = int(round(alt))
event.append(nemid, latitude=lat, longitude=long, altitude=alt)
self.session.emane.service.publish(0, event)
def setnempositions(self, moved_netifs):
"""
Several NEMs have moved, from e.g. a WaypointMobilityModel
calculation. Generate an EMANE Location Event having several
entries for each netif that has moved.
"""
if len(moved_netifs) == 0:
return
if self.session.emane.service is None:
logging.info("position service not available")
return
event = LocationEvent()
i = 0
for netif in moved_netifs:
nemid = self.getnemid(netif)
ifname = netif.localname
if nemid is None:
logging.info("nemid for %s is unknown" % ifname)
continue continue
x, y, z = netif.node.getposition() # ignore incomplete links
lat, long, alt = self.session.location.getgeo(x, y, z) if (nem2, nem1) not in emane_links:
logging.info("setnempositions %d %s (%s) x,y,z=(%d,%d,%s)(%.6f,%.6f,%.6f)", continue
i, ifname, nemid, x, y, z, lat, long, alt) link = emane_manager.get_nem_link(nem1, nem2, flags)
# altitude must be an integer or warning is printed if link:
alt = int(round(alt)) links.append(link)
event.append(nemid, latitude=lat, longitude=long, altitude=alt) return links
i += 1
self.session.emane.service.publish(0, event) def create_tuntap(self, node: CoreNode, iface_data: InterfaceData) -> CoreInterface:
"""
Create a tuntap interface for the provided node.
:param node: node to create tuntap interface for
:param iface_data: interface data to create interface with
:return: created tuntap interface
"""
with node.lock:
if iface_data.id is not None and iface_data.id in node.ifaces:
raise CoreError(
f"node({self.id}) interface({iface_data.id}) already exists"
)
iface_id = (
iface_data.id if iface_data.id is not None else node.next_iface_id()
)
name = iface_data.name if iface_data.name is not None else f"eth{iface_id}"
session_id = self.session.short_session_id()
localname = f"tap{node.id}.{iface_id}.{session_id}"
iface = TunTap(iface_id, name, localname, self.session.use_ovs(), node=node)
if iface_data.mac:
iface.set_mac(iface_data.mac)
for ip in iface_data.get_ips():
iface.add_ip(ip)
node.ifaces[iface_id] = iface
self.attach(iface)
if self.up:
iface.startup()
if self.session.is_running():
self.session.emane.start_iface(self, iface)
return iface
def adopt_iface(self, iface: CoreInterface, name: str) -> None:
raise CoreError(
f"emane network({self.name}) do not support adopting interfaces"
)

View file

@ -1,23 +0,0 @@
"""
rfpipe.py: EMANE RF-PIPE model for CORE
"""
import os
from core.emane import emanemodel
class EmaneRfPipeModel(emanemodel.EmaneModel):
# model name
name = "emane_rfpipe"
# mac configuration
mac_library = "rfpipemaclayer"
mac_xml = "rfpipemaclayer.xml"
@classmethod
def load(cls, emane_prefix):
cls.mac_defaults["pcrcurveuri"] = os.path.join(
emane_prefix,
"share/emane/xml/models/mac/rfpipe/rfpipepcr.xml"
)
super(EmaneRfPipeModel, cls).load(emane_prefix)

Some files were not shown because too many files have changed in this diff Show more