Renamed UDPInterface
This commit is contained in:
parent
b9301a2a8a
commit
a43d485630
8
RNS/Interfaces/UdpInterface.py → RNS/Interfaces/UDPInterface.py
Executable file → Normal file
8
RNS/Interfaces/UdpInterface.py → RNS/Interfaces/UDPInterface.py
Executable file → Normal file
@ -6,7 +6,7 @@ import time
|
|||||||
import sys
|
import sys
|
||||||
import RNS
|
import RNS
|
||||||
|
|
||||||
class UdpInterface(Interface):
|
class UDPInterface(Interface):
|
||||||
|
|
||||||
def __init__(self, owner, name, bindip=None, bindport=None, forwardip=None, forwardport=None):
|
def __init__(self, owner, name, bindip=None, bindport=None, forwardip=None, forwardport=None):
|
||||||
self.IN = True
|
self.IN = True
|
||||||
@ -20,7 +20,7 @@ class UdpInterface(Interface):
|
|||||||
|
|
||||||
def handlerFactory(callback):
|
def handlerFactory(callback):
|
||||||
def createHandler(*args, **keys):
|
def createHandler(*args, **keys):
|
||||||
return UdpInterfaceHandler(callback, *args, **keys)
|
return UDPInterfaceHandler(callback, *args, **keys)
|
||||||
return createHandler
|
return createHandler
|
||||||
|
|
||||||
self.owner = owner
|
self.owner = owner
|
||||||
@ -47,9 +47,9 @@ class UdpInterface(Interface):
|
|||||||
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "UdpInterface["+self.name+"/"+self.bind_ip+":"+str(self.bind_port)+"]"
|
return "UDPInterface["+self.name+"/"+self.bind_ip+":"+str(self.bind_port)+"]"
|
||||||
|
|
||||||
class UdpInterfaceHandler(socketserver.BaseRequestHandler):
|
class UDPInterfaceHandler(socketserver.BaseRequestHandler):
|
||||||
def __init__(self, callback, *args, **keys):
|
def __init__(self, callback, *args, **keys):
|
||||||
self.callback = callback
|
self.callback = callback
|
||||||
socketserver.BaseRequestHandler.__init__(self, *args, **keys)
|
socketserver.BaseRequestHandler.__init__(self, *args, **keys)
|
@ -168,8 +168,8 @@ class Reticulum:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
if ("interface_enabled" in c) and c.as_bool("interface_enabled") == True:
|
if ("interface_enabled" in c) and c.as_bool("interface_enabled") == True:
|
||||||
if c["type"] == "UdpInterface":
|
if c["type"] == "UDPInterface":
|
||||||
interface = UdpInterface.UdpInterface(
|
interface = UDPInterface.UDPInterface(
|
||||||
RNS.Transport,
|
RNS.Transport,
|
||||||
name,
|
name,
|
||||||
c["listen_ip"],
|
c["listen_ip"],
|
||||||
@ -467,7 +467,7 @@ loglevel = 4
|
|||||||
# needs or turn it off completely.
|
# needs or turn it off completely.
|
||||||
|
|
||||||
[[Default UDP Interface]]
|
[[Default UDP Interface]]
|
||||||
type = UdpInterface
|
type = UDPInterface
|
||||||
interface_enabled = True
|
interface_enabled = True
|
||||||
outgoing = True
|
outgoing = True
|
||||||
listen_ip = 0.0.0.0
|
listen_ip = 0.0.0.0
|
||||||
|
Loading…
Reference in New Issue
Block a user