Merge branch 'master' into socket_address

This commit is contained in:
Cort Buffington 2018-09-25 20:06:33 -05:00
commit 24d1e9f198
5 changed files with 20 additions and 10 deletions

View File

@ -22,7 +22,7 @@ This work represents the author's interpretation of the HomeBrew Repeater Protoc
None. The owners of this work make absolutely no warranty, express or implied. Use this software at your own risk.
**PRE-REQUISITE KNOWLEDGE:**
This document assumes the reader is familiar with the Python programming language and DMR.
This document assumes the reader is familiar with Linux/UNIX, the Python programming language and DMR.
**MORE DOCUMENTATION TO COME**

View File

@ -269,6 +269,9 @@ if __name__ == '__main__':
# Set signal handers so that we can gracefully exit if need be
for sig in [signal.SIGTERM, signal.SIGINT]:
signal.signal(sig, sig_handler)
# Build the Access Control List
REG_ACL = build_reg_acl('reg_acl', logger)
# ID ALIAS CREATION
# Download

View File

@ -100,13 +100,14 @@ def make_bridges(_hb_confbridge_bridges):
# Global action is to allow or deny them. Multiple lists with different actions and ranges
# are not yet implemented.
def build_acl(_sub_acl):
ACL = set()
try:
logger.info('ACL file found, importing entries. This will take about 1.5 seconds per 1 million IDs')
acl_file = import_module(_sub_acl)
logger.info('ACL file found, importing entries. This will take about 1.5 seconds per 1 million IDs')
sections = acl_file.ACL.split(':')
ACL_ACTION = sections[0]
entries_str = sections[1]
ACL = set()
for entry in entries_str.split(','):
if '-' in entry:
@ -486,6 +487,9 @@ if __name__ == '__main__':
for sig in [signal.SIGTERM, signal.SIGINT]:
signal.signal(sig, sig_handler)
# Build the Access Control List
REG_ACL = build_reg_acl('reg_acl', logger)
# ID ALIAS CREATION
# Download
if CONFIG['ALIASES']['TRY_DOWNLOAD'] == True:

View File

@ -35,7 +35,7 @@ from twisted.protocols.basic import NetstringReceiver
from twisted.internet import reactor, task
# Things we import from the main hblink module
from hblink import HBSYSTEM, systems, hblink_handler, reportFactory, REPORT_OPCODES, config_reports
from hblink import HBSYSTEM, systems, hblink_handler, reportFactory, REPORT_OPCODES, config_reports, build_reg_acl
from dmr_utils.utils import hex_str_3, int_id, get_alias
from dmr_utils import decode, bptc, const
import hb_config
@ -194,6 +194,9 @@ if __name__ == '__main__':
# Set signal handers so that we can gracefully exit if need be
for sig in [signal.SIGTERM, signal.SIGINT]:
signal.signal(sig, sig_handler)
# Build the Access Control List
REG_ACL = build_reg_acl('reg_acl', logger)
# ID ALIAS CREATION
# Download

View File

@ -1,9 +1,9 @@
# PROGRAM-WIDE PARAMETERS GO HERE
# PATH - working path for files, leave it alone unless you NEED to change it
# PING_TIME - the interval that clients will ping the master, and re-try registraion
# PING_TIME - the interval that peers will ping the master, and re-try registraion
# - how often the Master maintenance loop runs
# MAX_MISSED - how many pings are missed before we give up and re-register
# - number of times the master maintenance loop runs before de-registering a client
# - number of times the master maintenance loop runs before de-registering a peer
[GLOBAL]
PATH: ./
PING_TIME: 5
@ -34,7 +34,7 @@ REPORT_CLIENTS: 127.0.0.1
# This allows the logger to be configured without chaning the individual
# python logger stuff. LOG_FILE should be a complete path/filename for *your*
# system -- use /dev/null for non-file handlers.
# LOG_HANDERLS may be any of the following, please, no spaces in the
# LOG_HANDLERS may be any of the following, please, no spaces in the
# list if you use several:
# null
# console
@ -80,7 +80,7 @@ EXPORT_PORT: 1234
# IP may be left blank if there's one interface on your system.
# Port should be the port you want this master to listen on. It must be unique
# and unused by anything else.
# Repeat - if True, the master repeats traffic to clients, False, it does nothing.
# Repeat - if True, the master repeats traffic to peers, False, it does nothing.
[MASTER-1]
MODE: MASTER
ENABLED: True
@ -91,7 +91,7 @@ PORT: 54000
PASSPHRASE: s3cr37w0rd
GROUP_HANGTIME: 5
# CLIENT INSTANCES - DUPLICATE SECTION FOR MULTIPLE CLIENTS
# PEER INSTANCES - DUPLICATE SECTION FOR MULTIPLE PEERS
# There are a LOT of errors in the HB Protocol specifications on this one!
# MOST of these items are just strings and will be properly dealt with by the program
# The TX & RX Frequencies are 9-digit numbers, and are the frequency in Hz.
@ -101,7 +101,7 @@ GROUP_HANGTIME: 5
# Setting Loose to True relaxes the validation on packets received from the master.
# This will allow HBlink to connect to a non-compliant system such as XLXD, DMR+ etc.
[REPEATER-1]
MODE: CLIENT
MODE: PEER
ENABLED: True
LOOSE: False
EXPORT_AMBE: False