use existing HMAC for obp CRC

options
Simon 4 years ago
parent e15bab90b0
commit 5e1dc45ca2
No known key found for this signature in database
GPG Key ID: 6ACF11630B5D8F82

@ -39,7 +39,7 @@ import importlib.util
import re import re
import copy import copy
from setproctitle import setproctitle from setproctitle import setproctitle
from crccheck.crc import Crc32 #from crccheck.crc import Crc32
from hashlib import sha1 from hashlib import sha1
# Twisted is pretty important, so I keep it separate # Twisted is pretty important, so I keep it separate
@ -1461,12 +1461,13 @@ class routerOBP(OPENBRIDGE):
systems[_target]._report.send_bridgeEvent('UNIT DATA,START,TX,{},{},{},{},{},{}'.format(_target, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), 1, _int_dst_id).encode(encoding='utf-8', errors='ignore')) systems[_target]._report.send_bridgeEvent('UNIT DATA,START,TX,{},{},{},{},{},{}'.format(_target, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), 1, _int_dst_id).encode(encoding='utf-8', errors='ignore'))
def dmrd_received(self, _peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data): def dmrd_received(self, _peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data,_hash):
pkt_time = time() pkt_time = time()
dmrpkt = _data[20:53] dmrpkt = _data[20:53]
_bits = _data[15] _bits = _data[15]
_pkt_crc = Crc32.calc(_data[4:53]) _#pkt_crc = Crc32.calc(_data[4:53])
#_pkt_crc = Crc32.calc(dmrpkt) #_pkt_crc = Crc32.calc(dmrpkt)
)pkt_crc = _hash
# Match UNIT data, SMS/GPS, and send it to the dst_id if it is in SUB_MAP # Match UNIT data, SMS/GPS, and send it to the dst_id if it is in SUB_MAP

@ -166,7 +166,7 @@ class OPENBRIDGE(DatagramProtocol):
logger.debug('(%s) *BridgeControl* Not sent BCSQ Source Quench TARGET_IP not known , TG: %s, Stream ID: %s',self._system,int_id(_tgid)) logger.debug('(%s) *BridgeControl* Not sent BCSQ Source Quench TARGET_IP not known , TG: %s, Stream ID: %s',self._system,int_id(_tgid))
def dmrd_received(self, _peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data): def dmrd_received(self, _peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data,_hash):
pass pass
#print(int_id(_peer_id), int_id(_rf_src), int_id(_dst_id), int_id(_seq), _slot, _call_type, _frame_type, repr(_dtype_vseq), int_id(_stream_id)) #print(int_id(_peer_id), int_id(_rf_src), int_id(_dst_id), int_id(_seq), _slot, _call_type, _frame_type, repr(_dtype_vseq), int_id(_stream_id))
@ -245,7 +245,7 @@ class OPENBRIDGE(DatagramProtocol):
return return
# Userland actions -- typically this is the function you subclass for an application # Userland actions -- typically this is the function you subclass for an application
self.dmrd_received(_peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data) self.dmrd_received(_peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data,_hash)
#Silently treat a DMRD packet like a keepalive - this is because it's traffic and the #Silently treat a DMRD packet like a keepalive - this is because it's traffic and the
#Other end may not have enabled ENAHNCED_OBP #Other end may not have enabled ENAHNCED_OBP
self._config['_bcka'] = time() self._config['_bcka'] = time()

Loading…
Cancel
Save

Powered by TurnKey Linux.