Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pim_dm
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
pim_dm
Commits
f3dc94fa
Commit
f3dc94fa
authored
Jun 26, 2020
by
Pedro Oliveira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support having different processes manipulating different VRFs
parent
abf25568
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
9 deletions
+11
-9
pimdm/Run.py
pimdm/Run.py
+5
-5
pimdm/daemon/Daemon.py
pimdm/daemon/Daemon.py
+4
-2
setup.py
setup.py
+2
-2
No files found.
pimdm/Run.py
View file @
f3dc94fa
...
...
@@ -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
:
...
...
pimdm/daemon/Daemon.py
View file @
f3dc94fa
"""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
())
...
...
setup.py
View file @
f3dc94fa
...
...
@@ -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"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment