Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Experiments on the integration of Python extensions with C++ OSPF base implementation

License

Notifications You must be signed in to change notification settings

migueldgoncalves/ospf_cplusplus_python_integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ospf_cplusplus_python_integration

Experiments on the integration of Python extensions with C++ OSPF base implementation.

The base code is the Release 2.16 of the ospfd routing software created by John T. Moy, and described in the book OSPF Complete Implementation.

Executed in Docker containers running Ubuntu 16.04 integrated with GNS3.

Installing and running

A Dockerfile is included in this repository, with the required packages to run the program.

Before running the program, a configuration file ospfd.conf must be created or placed inside the /etc directory of the machine or Docker container running the program. A sample configuration file is included in this repository.

It is necessary to provide the absolute path to the /python directory of the source code in the line 98 of the ospfd_linux.C file. Currently, it is assumed that the path is /ospf/python.

After copying the content of this repository to the machine, it is necessary to open a terminal and go to the /linux directory of the source code. The program is compiled by running make install, and then executed by running ospfd. The command ospfd can be executed anywhere, and must be run as root.

Note: When running Docker containers inside GNS3 networks, an /etc directory can be seen inside the directories for each container, inside the respective GNS3 network directory in the host machine. This /etc directory is different from the Ubuntu /etc directory, and is inaccessible from inside the container.

Python code

Two Python modules have been created along with C++ code interacting with them, producing some output. The Python code is stored in the /python directory of this repository, while the C++ code interacting with Python is stored in the file ospfd_linux.C. The Makefile was also updated with Python-specific flags.

The experiments involve calling Python functions with different types of arguments and returns, and manipulating Python objects of different types.

See also