diff --git a/includes/decoders/poc.py b/includes/decoders/poc.py index b686cf2..78c3f01 100644 --- a/includes/decoders/poc.py +++ b/includes/decoders/poc.py @@ -35,8 +35,8 @@ def isAllowed(poc_id): allowed = 0 - # 1.) Allow - # If RIC is allowed, return true; otherwise go on + # 1.) If allowed RICs is set, only they will path, + # If RIC is the right one return True, else False if globalVars.config.get("POC", "allow_ric"): if poc_id in globalVars.config.get("POC", "allow_ric"): logging.info("RIC %s is allowed", poc_id) @@ -44,20 +44,24 @@ def isAllowed(poc_id): else: logging.info("RIC %s is not in the allowed list", poc_id) allowed = 0 - - # 2.) Deny - # If RIC is denied, mark as not allowed + # 2.) If denied RIC, return False if poc_id in globalVars.config.get("POC", "deny_ric"): logging.info("RIC %s is denied by config.ini", poc_id) allowed = 0 - - # 3.) Check Range, return true if in between - if globalVars.config.getint("POC", "filter_range_start") <= int(poc_id) <= globalVars.config.getint("POC", "filter_range_end"): + # 3.) Check Range, return False if outside def. range + if globalVars.config.getint("POC", "filter_range_start") < int(poc_id) < globalVars.config.getint("POC", "filter_range_end"): logging.info("RIC %s in between filter range", poc_id) return True else: logging.info("RIC %s out of filter range", poc_id) - allowed = 0 + allowed = + # 4.) Implementation for net identifiers + if globalVars.config.get("POC", "netIdent_ric"): + if poc_id in globalVars.config.get("POC", "netIdent_ric"): + logging.info("RIC %s as net identifier", poc_id) + return True + else: + allowed = 0 if allowed == 0: return False