Skip to content
Snippets Groups Projects
Unverified Commit c356e5b6 authored by Annika Wickert's avatar Annika Wickert Committed by GitHub
Browse files

Merge pull request #5 from wolf128058/fix_meshif-replace-for-m

just use "batctl meshif" instead of "batctl -m"
parents 5f4a5a30 f9effbb6
No related branches found
No related tags found
No related merge requests found
...@@ -33,7 +33,7 @@ class Neighbours(Respondd): ...@@ -33,7 +33,7 @@ class Neighbours(Respondd):
def getMeshInterfaces(batmanInterface): def getMeshInterfaces(batmanInterface):
ret = {} ret = {}
lines = lib.helper.call(['batctl', '-m', batmanInterface, 'if']) lines = lib.helper.call(['batctl', 'meshif', batmanInterface, 'if'])
for line in lines: for line in lines:
lineMatch = re.match(r'^([^:]*)', line) lineMatch = re.match(r'^([^:]*)', line)
interface = lineMatch.group(1) interface = lineMatch.group(1)
...@@ -52,7 +52,7 @@ class Neighbours(Respondd): ...@@ -52,7 +52,7 @@ class Neighbours(Respondd):
meshInterfaces = self.getMeshInterfaces(self._config['batman']) meshInterfaces = self.getMeshInterfaces(self._config['batman'])
lines = lib.helper.call(['batctl', '-m', self._config['batman'], 'o', '-n']) lines = lib.helper.call(['batctl', 'meshif', self._config['batman'], 'o', '-n'])
for line in lines: for line in lines:
# * e2:ad:db:b7:66:63 2.712s (175) be:b7:25:4f:8f:96 [mesh-vpn-l2tp-1] # * e2:ad:db:b7:66:63 2.712s (175) be:b7:25:4f:8f:96 [mesh-vpn-l2tp-1]
lineMatch = re.match(r'^[ \*\t]*([0-9a-f:]+)[ ]*([\d\.]*)s[ ]*\(([ ]*\d*)\)[ ]*([0-9a-f:]+)[ ]*\[[ ]*(.*)\]', line, re.I) lineMatch = re.match(r'^[ \*\t]*([0-9a-f:]+)[ ]*([\d\.]*)s[ ]*\(([ ]*\d*)\)[ ]*([0-9a-f:]+)[ ]*\[[ ]*(.*)\]', line, re.I)
......
...@@ -30,7 +30,7 @@ class Nodeinfo(Respondd): ...@@ -30,7 +30,7 @@ class Nodeinfo(Respondd):
def getBatmanInterfaces(self, batmanInterface): def getBatmanInterfaces(self, batmanInterface):
ret = {} ret = {}
lines = lib.helper.call(['batctl', '-m', batmanInterface, 'if']) lines = lib.helper.call(['batctl', 'meshif', batmanInterface, 'if'])
for line in lines: for line in lines:
lineMatch = re.match(r'^([^:]*)', line) lineMatch = re.match(r'^([^:]*)', line)
interface = lineMatch.group(0) interface = lineMatch.group(0)
...@@ -77,7 +77,7 @@ class Nodeinfo(Respondd): ...@@ -77,7 +77,7 @@ class Nodeinfo(Respondd):
@staticmethod @staticmethod
def getVPNFlag(batmanInterface): def getVPNFlag(batmanInterface):
lines = lib.helper.call(['batctl', '-m', batmanInterface, 'gw_mode']) lines = lib.helper.call(['batctl', 'meshif', batmanInterface, 'gw_mode'])
if re.match(r'^server', lines[0]): if re.match(r'^server', lines[0]):
return True return True
else: else:
......
...@@ -42,7 +42,7 @@ class ResponddClient: ...@@ -42,7 +42,7 @@ class ResponddClient:
self._sock.setsockopt(socket.SOL_SOCKET,socket.SO_BINDTODEVICE,bytes(self._config['bridge'].encode())) self._sock.setsockopt(socket.SOL_SOCKET,socket.SO_BINDTODEVICE,bytes(self._config['bridge'].encode()))
self._sock.bind(('::', self._config['port'])) self._sock.bind(('::', self._config['port']))
lines = lib.helper.call(['batctl', '-m', self._config['batman'], 'if']) lines = lib.helper.call(['batctl', 'meshif', self._config['batman'], 'if'])
for line in lines: for line in lines:
lineMatch = re.match(r'^([^:]*)', line) lineMatch = re.match(r'^([^:]*)', line)
self.joinMCAST(self._sock, self._config['addr'], lineMatch.group(1)) self.joinMCAST(self._sock, self._config['addr'], lineMatch.group(1))
......
...@@ -19,7 +19,7 @@ class Statistics(Respondd): ...@@ -19,7 +19,7 @@ class Statistics(Respondd):
macBridge = lib.helper.getInterfaceMAC(self._config['bridge']) macBridge = lib.helper.getInterfaceMAC(self._config['bridge'])
lines = lib.helper.call(['batctl', '-m', self._config['batman'], 'tl', '-n']) lines = lib.helper.call(['batctl', 'meshif', self._config['batman'], 'tl', '-n'])
for line in lines: for line in lines:
# batman-adv -> translation-table.c -> batadv_tt_local_seq_print_text # batman-adv -> translation-table.c -> batadv_tt_local_seq_print_text
# R = BATADV_TT_CLIENT_ROAM # R = BATADV_TT_CLIENT_ROAM
...@@ -139,7 +139,7 @@ class Statistics(Respondd): ...@@ -139,7 +139,7 @@ class Statistics(Respondd):
def getGateway(self): def getGateway(self):
ret = None ret = None
lines = lib.helper.call(['batctl', '-m', self._config['batman'], 'gwl', '-n']) lines = lib.helper.call(['batctl', 'meshif', self._config['batman'], 'gwl', '-n'])
for line in lines: for line in lines:
lineMatch = re.match(r'(\*|=>)\s+([0-9a-f:]+)\s\([\d \.]+\)\s+([0-9a-f:]+)', line) lineMatch = re.match(r'(\*|=>)\s+([0-9a-f:]+)\s\([\d \.]+\)\s+([0-9a-f:]+)', line)
if lineMatch: if lineMatch:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment