From dd1528567e3163241c555e81512a092f966f87b5 Mon Sep 17 00:00:00 2001 From: Cort Buffington Date: Sun, 25 Aug 2013 16:13:23 -0500 Subject: [PATCH] Group Voice Re-Write Added Group Voice re-writes of both sourc IPSC radio ID and group translation work. Packets are not yet actually sent to the destination network. Right now the code prints out the original packet and the re-written packet (with hash added) --- ipsc.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/ipsc.py b/ipsc.py index 75c11a5..2260bc7 100644 --- a/ipsc.py +++ b/ipsc.py @@ -111,17 +111,15 @@ def validate_auth(_key, _data): def fwd_group_voice(_network, _data): _src_group = _data[9:12] _src_ipsc = _data[1:5] + for source in NETWORK[_network]['RULES']['GROUP_VOICE']: - print(binascii.b2a_hex(_src_group), ' ', binascii.b2a_hex(source['SRC_GROUP'])) if source['SRC_GROUP'] == _src_group: - print(binascii.b2a_hex(_src_ipsc), ' ', networks[source['DST_NET']]) - _data.replace(_src_ipsc, source['DST_NET']['LOCAL']['RADIO_ID']) - _data.replace(_src_group, source['DST_GROUP']) - _data = hashed_packet(NETWORK[source]['DST_NET']['LOCAL']['AUTH_KEY'], _data) print(binascii.b2a_hex(_data)) - # Match source group to a rule - # Write destination group to packet - # Hash packet + _data = _data.replace(_src_ipsc, NETWORK[(source['DST_NET'])]['LOCAL']['RADIO_ID']) + _data = _data.replace(_src_group, source['DST_GROUP']) + _data = hashed_packet(NETWORK[(source['DST_NET'])]['LOCAL']['AUTH_KEY'], _data) + print(binascii.b2a_hex(_data)) + print() # Send packet # Take a recieved peer list and the network it belongs to, process and populate the