def ipv6_connection(act, target={}, args={}, *extra_args, **extra_kwargs): if not isinstance(args, dict) and len(set(args) - ValidArgs) > 0: print("Invalid Allow Args") return exceptions.bad_argument() return exceptions.action_exception('allow', except_msg='target implementation TBD')
def slpf(act, target={}, args={}, *extra_args, **extra_kwargs): if not isinstance(args, dict) and len( set(args) - {"response_requested", "start_time"}) > 0: print("Invalid Delete Args") return exceptions.bad_argument() return exceptions.action_exception('delete', except_msg='target implementation TBD')
def ipv6_addr(act, target="", args={}, *extra_args, **extra_kwargs): if not isinstance(args, dict) and len(set(args) - ValidArgs) > 0: print("Invalid Deny Args") return exceptions.bad_argument() ip = valid_ip(target) if ip: direction = args.get("direction", None) # Apply to both INPUT and OUTPUT if None print(f"Deny ipv6_addr: {ip} - {direction}") return exceptions.action_exception('deny', except_msg='target implementation TBD') print("Invalid Deny/IPv6_Addr target") return exceptions.bad_request(except_msg="Validation Error: Target: ipv6_addr")