Commit f3dc94fa authored by Pedro Oliveira's avatar Pedro Oliveira

support having different processes manipulating different VRFs

parent abf25568
......@@ -11,7 +11,7 @@ from pimdm import Main
from pimdm.daemon.Daemon import Daemon
from pimdm.tree.globals import MULTICAST_TABLE_ID
VERSION = "1.1.1"
VERSION = "1.1.1.1"
def client_socket(data_to_send):
......@@ -19,7 +19,7 @@ def client_socket(data_to_send):
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
# Connect the socket to the port where the server is listening
server_address = '/tmp/pim_uds_socket'
server_address = '/tmp/pim_uds_socket' + str(MULTICAST_TABLE_ID)
#print('connecting to %s' % server_address)
try:
sock.connect(server_address)
......@@ -37,7 +37,7 @@ def client_socket(data_to_send):
class MyDaemon(Daemon):
def run(self):
Main.main()
server_address = '/tmp/pim_uds_socket'
server_address = '/tmp/pim_uds_socket' + str(MULTICAST_TABLE_ID)
# Make sure the socket does not already exist
try:
......@@ -146,7 +146,7 @@ def main():
if os.geteuid() != 0:
sys.exit('PIM-DM must be run as root!')
daemon = MyDaemon('/tmp/Daemon-pim.pid')
daemon = MyDaemon('/tmp/Daemon-pim' + str(MULTICAST_TABLE_ID) + '.pid')
if args.start:
print("start")
daemon.start()
......@@ -159,7 +159,7 @@ def main():
daemon.restart()
sys.exit(0)
elif args.verbose:
os.system("tail -f /var/log/pimdm/stdout")
os.system("tail -f /var/log/pimdm/stdout" + str(MULTICAST_TABLE_ID))
sys.exit(0)
elif args.multicast_routes:
if args.ipv4 or not args.ipv6:
......
"""Generic linux daemon base class for python 3.x."""
import sys, os, time, atexit, signal
from pimdm.tree.globals import MULTICAST_TABLE_ID
class Daemon:
"""A generic Daemon class.
......@@ -43,8 +45,8 @@ class Daemon:
sys.stdout.flush()
sys.stderr.flush()
si = open(os.devnull, 'r')
so = open('stdout', 'a+')
se = open('stderror', 'a+')
so = open('stdout' + str(MULTICAST_TABLE_ID), 'a+')
se = open('stderror' + str(MULTICAST_TABLE_ID), 'a+')
os.dup2(si.fileno(), sys.stdin.fileno())
os.dup2(so.fileno(), sys.stdout.fileno())
......
......@@ -12,8 +12,8 @@ setup(
description="PIM-DM protocol",
long_description=open("README.md", "r").read(),
long_description_content_type="text/markdown",
keywords="PIM-DM Multicast Routing Protocol Dense-Mode Router RFC3973 IPv4 IPv6",
version="1.1.1",
keywords="PIM-DM Multicast Routing Protocol PIM Dense-Mode Router RFC3973 IPv4 IPv6",
version="1.1.1.1",
url="http://github.com/pedrofran12/pim_dm",
author="Pedro Oliveira",
author_email="pedro.francisco.oliveira@tecnico.ulisboa.pt",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment