DMR NAT Function Added
There is concern about the maximum available DMR RadioID space. Just like running out of IPv4 on the Internet, I created an evil DMR NAT function.
This commit is contained in:
parent
45618999a1
commit
800969bb39
39
ipsc.py
39
ipsc.py
@ -20,6 +20,7 @@ import hashlib
|
|||||||
import socket
|
import socket
|
||||||
import csv
|
import csv
|
||||||
import time
|
import time
|
||||||
|
import re
|
||||||
|
|
||||||
#************************************************
|
#************************************************
|
||||||
# IMPORTING OTHER FILES - '#include'
|
# IMPORTING OTHER FILES - '#include'
|
||||||
@ -61,6 +62,35 @@ except ImportError:
|
|||||||
# PARSE THE CONFIG FILE AND BUILD STRUCTURE
|
# PARSE THE CONFIG FILE AND BUILD STRUCTURE
|
||||||
#************************************************
|
#************************************************
|
||||||
|
|
||||||
|
'''
|
||||||
|
***LINKING STATUS: Byte 6***
|
||||||
|
|
||||||
|
Byte 1 - BIT FLAGS:
|
||||||
|
xx.. .... = Peer Operational (01 only known valid value)
|
||||||
|
..xx .... = Peer MODE: 00 - No Radio, 01 - Analog, 10 - Digital
|
||||||
|
.... xx.. = IPSC Slot 1: 10 on, 01 off
|
||||||
|
.... ..xx = IPSC Slot 2: 10 on, 01 off
|
||||||
|
|
||||||
|
***SERVICE FLAGS: Bytes 7-10 (or 7-12)***
|
||||||
|
|
||||||
|
Byte 1 - 0x00 = Unknown
|
||||||
|
Byte 2 - 0x00 = Unknown
|
||||||
|
Byte 3 - BIT FLAGS:
|
||||||
|
x... .... = CSBK Message
|
||||||
|
.x.. .... = Repeater Call Monitoring
|
||||||
|
..x. .... = 3rd Party "Console" Application
|
||||||
|
...x xxxx = Unknown - default to 0
|
||||||
|
Byte 4 = BIT FLAGS:
|
||||||
|
x... .... = XNL Connected (1=true)
|
||||||
|
.x.. .... = XNL Master Device
|
||||||
|
..x. .... = XNL Slave Device
|
||||||
|
...x .... = Set if packets are authenticated
|
||||||
|
.... x... = Set if data calls are supported
|
||||||
|
.... .x.. = Set if voice calls are supported
|
||||||
|
.... ..x. = Unknown - default to 0
|
||||||
|
.... ...x = Set if master
|
||||||
|
'''
|
||||||
|
|
||||||
ACTIVE_CALLS = []
|
ACTIVE_CALLS = []
|
||||||
|
|
||||||
NETWORK = {}
|
NETWORK = {}
|
||||||
@ -255,6 +285,15 @@ def unknown_message(_network, _packettype, _data):
|
|||||||
# UTILITY FUNCTIONS FOR INTERNAL USE
|
# UTILITY FUNCTIONS FOR INTERNAL USE
|
||||||
#************************************************
|
#************************************************
|
||||||
|
|
||||||
|
# Re-Write Source Radio-ID (DMR NAT)
|
||||||
|
#
|
||||||
|
def dmr_nat(_data, _nat_id):
|
||||||
|
# _log = logger.warning
|
||||||
|
src_radio_id = _data[6:9]
|
||||||
|
_data = re.sub(src_radio_id, _nat_id, _data)
|
||||||
|
# _log('DMR NAT: Source %s re-written as %s', int(binascii.b2a_hex(src_radio_id), 16), int(binascii.b2a_hex(_nat_id), 16))
|
||||||
|
return _data
|
||||||
|
|
||||||
# Lookup text data for numeric IDs
|
# Lookup text data for numeric IDs
|
||||||
#
|
#
|
||||||
def get_info(_id):
|
def get_info(_id):
|
||||||
|
Loading…
Reference in New Issue
Block a user