From b176cca9e7e9b53a2a2f5caea1c01fec57b9eb04 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 31 Jan 2022 01:53:12 +0000 Subject: [PATCH 01/13] tweak hops handling --- hblink.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hblink.py b/hblink.py index a532936..f70d2a4 100755 --- a/hblink.py +++ b/hblink.py @@ -362,8 +362,8 @@ class OPENBRIDGE(DatagramProtocol): #Increment max hops _inthops = _hops +1 - if _inthops > 10: - logger.warning('(%s) MAX HOPS exceed, dropping', self._system) + if _inthops > 20: + logger.warning('(%s) MAX HOPS exceed, dropping. Hops: %s, DST: %s', self._system, _inthops, _int_dst_id) return From 37701657382406b99b2a1c446ef6b86bf61fdc43 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 31 Jan 2022 01:55:49 +0000 Subject: [PATCH 02/13] tweak hops handling 2 --- hblink.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hblink.py b/hblink.py index f70d2a4..8920b9a 100755 --- a/hblink.py +++ b/hblink.py @@ -362,7 +362,7 @@ class OPENBRIDGE(DatagramProtocol): #Increment max hops _inthops = _hops +1 - if _inthops > 20: + if _inthops > 15: logger.warning('(%s) MAX HOPS exceed, dropping. Hops: %s, DST: %s', self._system, _inthops, _int_dst_id) return From 4d1e680154812b542c75e86a6c4beba541793ddb Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 31 Jan 2022 02:00:07 +0000 Subject: [PATCH 03/13] add bcsq to max hops --- hblink.py | 1 + 1 file changed, 1 insertion(+) diff --git a/hblink.py b/hblink.py index 8920b9a..bc0ace5 100755 --- a/hblink.py +++ b/hblink.py @@ -364,6 +364,7 @@ class OPENBRIDGE(DatagramProtocol): if _inthops > 15: logger.warning('(%s) MAX HOPS exceed, dropping. Hops: %s, DST: %s', self._system, _inthops, _int_dst_id) + self.send_bcsq(_dst_id,_stream_id) return From c6d7e2d6bc8f8814928382db9558c7df21af9c63 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 31 Jan 2022 02:00:44 +0000 Subject: [PATCH 04/13] put max back to 10 --- hblink.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hblink.py b/hblink.py index bc0ace5..76ed3c1 100755 --- a/hblink.py +++ b/hblink.py @@ -362,7 +362,7 @@ class OPENBRIDGE(DatagramProtocol): #Increment max hops _inthops = _hops +1 - if _inthops > 15: + if _inthops > 10: logger.warning('(%s) MAX HOPS exceed, dropping. Hops: %s, DST: %s', self._system, _inthops, _int_dst_id) self.send_bcsq(_dst_id,_stream_id) return From 9318d72de7f5f1cfb6c1866962f399be71cfdd6d Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 2 Feb 2022 11:51:47 +0000 Subject: [PATCH 05/13] flkl --- hblink.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hblink.py b/hblink.py index 76ed3c1..471cb0e 100755 --- a/hblink.py +++ b/hblink.py @@ -316,8 +316,8 @@ class OPENBRIDGE(DatagramProtocol): h,p = _sockaddr logger.warning('(%s) OpenBridge HMAC failed, packet discarded - OPCODE: %s DATA: %s HMAC LENGTH: %s HMAC: %s SRC IP: %s SRC PORT: %s', self._system, _packet[:4], repr(_packet[:53]), len(_packet[53:]), repr(_packet[53:]),h,p) - elif _packet[:4] == DMRE: - logger.warning('(%s) *ProtoControl* KF7EEL DMRE protocol not supported',self._system) + elif _packet[:4] == EOBP: + logger.warning('(%s) *ProtoControl* KF7EEL EOBP protocol not supported',self._system) return elif _packet[:4] == DMRF: From e0aceca7e486b52357a957aa14837b7e59697a17 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 4 Feb 2022 23:46:10 +0000 Subject: [PATCH 06/13] int_dst_id --- hblink.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hblink.py b/hblink.py index 471cb0e..2d189e5 100755 --- a/hblink.py +++ b/hblink.py @@ -329,6 +329,8 @@ class OPENBRIDGE(DatagramProtocol): _h = blake2b(key=self._config['PASSPHRASE'], digest_size=16) _h.update(_packet[:61]) _ckhs = _h.digest() + + _int_dst_id = int_id(_dst_id) if compare_digest(_hash, _ckhs) and (_sockaddr == self._config['TARGET_SOCK'] or self._config['RELAX_CHECKS']): _peer_id = _data[11:15] From 4d8cf76e0308016d328f263282fef3bb407455cd Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 4 Feb 2022 23:52:24 +0000 Subject: [PATCH 07/13] eobp --- const.py | 1 + 1 file changed, 1 insertion(+) diff --git a/const.py b/const.py index 92b921c..1da03cb 100755 --- a/const.py +++ b/const.py @@ -54,6 +54,7 @@ DMR = b'DMR' DMRD = b'DMRD' DMRE = b'DMRE' DMRF = b'DMRF' +EOBP = b'EOBP' MSTCL = b'MSTCL' MSTNAK = b'MSTNAK' MSTPONG = b'MSTPONG' From 16a06bf9f7474ba647e144fa1120d9560bc4dc72 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 4 Feb 2022 23:54:46 +0000 Subject: [PATCH 08/13] hi --- hblink.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hblink.py b/hblink.py index 2d189e5..42ae6df 100755 --- a/hblink.py +++ b/hblink.py @@ -329,8 +329,6 @@ class OPENBRIDGE(DatagramProtocol): _h = blake2b(key=self._config['PASSPHRASE'], digest_size=16) _h.update(_packet[:61]) _ckhs = _h.digest() - - _int_dst_id = int_id(_dst_id) if compare_digest(_hash, _ckhs) and (_sockaddr == self._config['TARGET_SOCK'] or self._config['RELAX_CHECKS']): _peer_id = _data[11:15] @@ -340,6 +338,7 @@ class OPENBRIDGE(DatagramProtocol): _seq = _data[4] _rf_src = _data[5:8] _dst_id = _data[8:11] + _int_dst_id = int_id(_dst_id) _bits = _data[15] _slot = 2 if (_bits & 0x80) else 1 #_call_type = 'unit' if (_bits & 0x40) else 'group' From 9703e1629233b8f0bd096cbfc852e3e673db5089 Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 5 Feb 2022 00:04:41 +0000 Subject: [PATCH 09/13] hops --- bridge_master.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridge_master.py b/bridge_master.py index 437da19..a3d3911 100644 --- a/bridge_master.py +++ b/bridge_master.py @@ -1423,7 +1423,7 @@ class routerOBP(OPENBRIDGE): if CONFIG['REPORTS']['REPORT']: systems[_d_system]._report.send_bridgeEvent('UNIT DATA,START,TX,{},{},{},{},{},{}'.format(_d_system, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), 1, _int_dst_id).encode(encoding='utf-8', errors='ignore')) - def sendDataToOBP(self,_target,_data,dmrpkt,pkt_time,_stream_id,_dst_id,_peer_id,_rf_src,_bits,_slot,_hops = b''): + def sendDataToOBP(self,_target,_data,dmrpkt,pkt_time,_stream_id,_dst_id,_peer_id,_rf_src,_bits,_slot): _int_dst_id = int_id(_dst_id) _target_status = systems[_target].STATUS From ed59b1f71f16314d5e81aca33307196f5922d98c Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 5 Feb 2022 00:16:50 +0000 Subject: [PATCH 10/13] packets in quotes --- bridge_master.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridge_master.py b/bridge_master.py index a3d3911..57cf3f9 100644 --- a/bridge_master.py +++ b/bridge_master.py @@ -1499,7 +1499,7 @@ class routerOBP(OPENBRIDGE): } self.STATUS[_stream_id]['LAST'] = pkt_time - self.STATUS[_stream_id][packets] = self.STATUS[_stream_id][packets] + 1 + self.STATUS[_stream_id]['packets'] = self.STATUS[_stream_id]['packets'] + 1 hr_times = {} for system in systems: From bfe8037aa691de18cd11ffa11df32cd8d2cd0f52 Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 5 Feb 2022 00:44:05 +0000 Subject: [PATCH 11/13] missing hops --- bridge_master.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridge_master.py b/bridge_master.py index 57cf3f9..a158d93 100644 --- a/bridge_master.py +++ b/bridge_master.py @@ -1423,7 +1423,7 @@ class routerOBP(OPENBRIDGE): if CONFIG['REPORTS']['REPORT']: systems[_d_system]._report.send_bridgeEvent('UNIT DATA,START,TX,{},{},{},{},{},{}'.format(_d_system, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), 1, _int_dst_id).encode(encoding='utf-8', errors='ignore')) - def sendDataToOBP(self,_target,_data,dmrpkt,pkt_time,_stream_id,_dst_id,_peer_id,_rf_src,_bits,_slot): + def sendDataToOBP(self,_target,_data,dmrpkt,pkt_time,_stream_id,_dst_id,_peer_id,_rf_src,_bits,_slot,_hops = b''): _int_dst_id = int_id(_dst_id) _target_status = systems[_target].STATUS From 1d1b146b945d4e5576928d8aaa698b273dcd2c1c Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 5 Feb 2022 00:50:33 +0000 Subject: [PATCH 12/13] no hops --- bridge_master.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridge_master.py b/bridge_master.py index a158d93..38e139c 100644 --- a/bridge_master.py +++ b/bridge_master.py @@ -1418,7 +1418,7 @@ class routerOBP(OPENBRIDGE): #Assemble transmit HBP packet header _tmp_data = b''.join([_data[:15], _tmp_bits.to_bytes(1, 'big'), _data[16:20]]) _tmp_data = b''.join([_tmp_data, dmrpkt]) - systems[_d_system].send_system(_tmp_data,_hops) + systems[_d_system].send_system(_tmp_data) logger.info('(%s) UNIT Data Bridged to HBP on slot 1: %s DST_ID: %s',self._system,_d_system,_int_dst_id) if CONFIG['REPORTS']['REPORT']: systems[_d_system]._report.send_bridgeEvent('UNIT DATA,START,TX,{},{},{},{},{},{}'.format(_d_system, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), 1, _int_dst_id).encode(encoding='utf-8', errors='ignore')) From ac0228bce80ec89c04a99206b52438f137e5894c Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 5 Feb 2022 00:56:10 +0000 Subject: [PATCH 13/13] no hops --- bridge_master.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridge_master.py b/bridge_master.py index 38e139c..5708ac7 100644 --- a/bridge_master.py +++ b/bridge_master.py @@ -2168,7 +2168,7 @@ class routerHBP(HBSYSTEM): _tmp_bits = _bits ^ 1 << 7 else: _tmp_bits = _bits - self.sendDataToHBP(_d_system,_d_slot,_dst_id,_tmp_bits,_data,dmrpkt,_rf_src,_stream_id,_peer_id,None) + self.sendDataToHBP(_d_system,_d_slot,_dst_id,_tmp_bits,_data,dmrpkt,_rf_src,_stream_id,_peer_id) else: logger.info('(%s) UNIT Data not bridged to HBP on slot 1 - target busy: %s DST_ID: %s',self._system,_d_system,_int_dst_id)