diff --git a/py-json/LANforge/lf_json_autogen.py b/py-json/LANforge/lf_json_autogen.py index 9ecc4a30..ef504126 100644 --- a/py-json/LANforge/lf_json_autogen.py +++ b/py-json/LANforge/lf_json_autogen.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated by LANforge JsonApiPythonGenerator, Fri Aug 13 12:39:58 PDT 2021 + Generated by LANforge JsonApiPythonGenerator, Fri Aug 13 15:25:24 PDT 2021 - - WORK IN PROGRESS - - The API this library provides is actively being changed. This file expects to live in py-json/LANforge directory. @@ -2259,6 +2259,63 @@ class LFJsonPost(LFCliBase): _exit_on_fail=_exit_on_fail, _proxy_str=_proxy_str, _capture_signal_list=_capture_signal_list) + + @staticmethod + def set_flags(flag_class: IntFlag, starting_value: int, flag_names=None): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + value = LFJsonPost.add_flags(SetPortMumble, 0, flag_names=['bridge', 'dhcp']) + print('value now: '+value) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if starting_value is None: + raise ValueError("starting_value should be an integer greater or equal than zero, not None") + if not flag_names: + raise ValueError("flag_names should be a name or a list of names, not None") + if type(flag_names) is list: + selected_flags = [] + for flag in flag_names: + if flag not in flag_class.__members__: + raise ValueError("%s has no member:[%s]" % (flag_class.__class__.__name__, flag)) + selected_flags.extend([flag_class[member].value for member in flag_class.__members__ if member == flag]) + selected_flags.append(starting_value) + return sum(selected_flags) + f_name = None + if type(flag_names) is str: + f_name = flag_names + print('f_name is str %s' % f_name) + else: + print('f_name is %s' % type(flag_names)) + if flag_names not in flag_class.__members__: + raise ValueError("%s has no member:[%s]" % (flag_class.__class__.__name__, flag_names)) + return flag_class.valueof(flag_names) + + @staticmethod + def clear_flags(flag_class: IntFlag, starting_value: int, flag_names=None): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + value = LFJsonPost.clear_flags(SetPortMumble, 0, flag_names=['bridge', 'dhcp']) + print('value now: '+value) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + if starting_value is None: + raise ValueError("starting_value should be an integer greater than zero and not None") + if not flag_names: + raise ValueError("flag_names should be a name or a list of names, not None") + if type(flag_names) is list: + unselected_val = starting_value + for flag in flag_names: + if flag not in flag_class.__members__: + raise ValueError("%s has no member:[%s]" % (flag_class.__class__.__name__, flag)) + print("unselected a[%s]" % (hex(unselected_val))) + unselected_val &= ~(flag_class[flag]) + print("unselected b[%s]" % (hex(unselected_val))) + return unselected_val + if flag_names not in flag_class.__members__: + raise ValueError("%s has no member:[%s]" % (flag_class.__class__.__name__, flag_names)) + unselected_val = starting_value + print("unselected a[%s]" % (hex(unselected_val))) + unselected_val &= ~flag_class + print("unselected b[%s]" % (hex(unselected_val))) + return unselected_val """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Notes for type requests @@ -2311,7 +2368,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = AddBgpPeerFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(AddBgpPeerFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" ENABLE_PEER = 0x1 # Set this to zero if you don't want this peer enabled. @@ -2319,29 +2376,6 @@ class LFJsonPost(LFCliBase): PEER_CONFED_MEMBER = 0x4 # Sets corresponding Xorp flag in BGP Peer section. PEER_UNICAST_V4 = 0x8 # Sets corresponding Xorp flag in BGP Peer section. - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - AddBgpPeerFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+AddBgpPeerFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("AddBgpPeerFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("AddBgpPeerFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -2429,8 +2463,6 @@ class LFJsonPost(LFCliBase): class AddBrBrFlags(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - AddBrBrFlags.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+AddBrBrFlags.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" none = 0 # no features stp_enabled = 1 # Enable Spanning Tree Protocol (STP) @@ -2480,8 +2512,6 @@ class LFJsonPost(LFCliBase): class AddCdFlags(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - AddCdFlags.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+AddCdFlags.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" ERR = 2 # Set to kernel mode. RUNNING = 1 # Set to running state. @@ -2580,36 +2610,13 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = AddChamberChamberFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(AddChamberChamberFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" OPEN = 0x4 # (3) Door is open, no real isolation right now. PHANTOM = 0x1 # (1) Chamber is not actually here right now. VIRTUAL = 0x2 # (2) No real chamber, open-air grouping of equipment. - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - AddChamberChamberFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+AddChamberChamberFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("AddChamberChamberFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("AddChamberChamberFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -2685,8 +2692,6 @@ class LFJsonPost(LFCliBase): class AddChamberCxChamberCxFlags(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - AddChamberCxChamberCxFlags.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+AddChamberCxChamberCxFlags.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" CONNECTED = 1 # (1) Connected to something. If flag is not set, connection is open to the air # +(maybe with antenna) @@ -2773,8 +2778,6 @@ class LFJsonPost(LFCliBase): class AddChannelGroupTypes(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - AddChannelGroupTypes.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+AddChannelGroupTypes.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" clear = "clear" # Channel(s) are bundled into a single span. No conversion or e_m = "e&m" # Channel(s) are signalled using E&M signalling (specific @@ -2863,7 +2866,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = AddDutDutFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(AddDutDutFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" p_11r = 0x200 # Use .11r connection logic on all ssids, deprecated, see add_dut_ssid. @@ -2880,29 +2883,6 @@ class LFJsonPost(LFCliBase): WPA2 = 0x20 # Use WPA2 encryption on all ssids, deprecated, see add_dut_ssid. WPA3 = 0x100 # Use WPA3 encryption on all ssids, deprecated, see add_dut_extras. - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - AddDutDutFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+AddDutDutFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("AddDutDutFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("AddDutDutFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -3023,7 +3003,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = AddDutSsidDutFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(AddDutSsidDutFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" p_11r = 0x200 # Use .11r connection logic @@ -3034,29 +3014,6 @@ class LFJsonPost(LFCliBase): WPA2 = 0x20 # Use WPA2 encryption WPA3 = 0x100 # Use WPA3 encryption - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - AddDutSsidDutFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+AddDutSsidDutFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("AddDutSsidDutFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("AddDutSsidDutFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -3105,8 +3062,6 @@ class LFJsonPost(LFCliBase): class AddEndpPayloadPattern(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - AddEndpPayloadPattern.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+AddEndpPayloadPattern.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" PRBS_11_8_10 = "PRBS_11_8_10" # PRBS (see above) PRBS_15_0_14 = "PRBS_15_0_14" # PRBS (see above) @@ -3123,8 +3078,6 @@ class LFJsonPost(LFCliBase): class AddEndpType(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - AddEndpType.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+AddEndpType.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" custom_ether = "custom_ether" # LF frames with custom options, use with playback custom_mc_udp = "custom_mc_udp" # LF Multicast UDP IPv4 @@ -3235,7 +3188,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = AddFileEndpFioFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(AddFileEndpFioFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" AUTO_MOUNT = 0x2 # (2) Attempt to mount with the provided information if not already mounted. @@ -3252,29 +3205,6 @@ class LFJsonPost(LFCliBase): UNMOUNT_LAZY = 0x80 # (128) Use -l flag when calling umount USE_FSTATFS = 0x100 # (256) Use fstatfs system call to verify file-system type when opening files. - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - AddFileEndpFioFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+AddFileEndpFioFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("AddFileEndpFioFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("AddFileEndpFioFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -3287,8 +3217,6 @@ class LFJsonPost(LFCliBase): class AddFileEndpPayloadPattern(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - AddFileEndpPayloadPattern.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+AddFileEndpPayloadPattern.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" PRBS_11_8_10 = "PRBS_11_8_10" # PRBS (see above) PRBS_15_0_14 = "PRBS_15_0_14" # PRBS (see above) @@ -3433,34 +3361,11 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = AddGroupFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(AddGroupFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" group_total_rates = 0x4 # Set rates as total for group. - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - AddGroupFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+AddGroupFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("AddGroupFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("AddGroupFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -3504,7 +3409,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = AddL4EndpHttpAuthType.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(AddL4EndpHttpAuthType0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" BASIC = 0x1 # Basic authentication @@ -3512,29 +3417,6 @@ class LFJsonPost(LFCliBase): GSSNEGOTIATE = 0x4 # GSS authentication NTLM = 0x8 # NTLM authentication - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - AddL4EndpHttpAuthType.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+AddL4EndpHttpAuthType.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("AddL4EndpHttpAuthType has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("AddL4EndpHttpAuthType has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -3549,7 +3431,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = AddL4EndpProxyAuthType.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(AddL4EndpProxyAuthType0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" BASIC = 0x1 # 1 Basic authentication @@ -3565,29 +3447,6 @@ class LFJsonPost(LFCliBase): USE_IPV6 = 0x400 # 1024 Resolve URL is IPv6. Will use IPv4 if not selected. USE_PROXY_CACHE = 0x20 # 32 Use proxy cache - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - AddL4EndpProxyAuthType.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+AddL4EndpProxyAuthType.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("AddL4EndpProxyAuthType has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("AddL4EndpProxyAuthType has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -3602,34 +3461,11 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = AddL4EndpType.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(AddL4EndpType0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" l4_generic = 0x0 # Layer 4 type - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - AddL4EndpType.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+AddL4EndpType.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("AddL4EndpType has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("AddL4EndpType has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -3714,36 +3550,13 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = AddMonitorFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(AddMonitorFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" disable_ht40 = 0x800 # Disable HT-40 even if hardware and AP support it. disable_ht80 = 0x8000000 # Disable HT80 (for AC chipset NICs only) ht160_enable = 0x100000000 # Enable HT160 mode. - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - AddMonitorFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+AddMonitorFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("AddMonitorFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("AddMonitorFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -3904,7 +3717,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = AddProfileProfileFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(AddProfileProfileFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" p_11r = 0x40 # Use 802.11r roaming setup. @@ -3919,29 +3732,6 @@ class LFJsonPost(LFCliBase): WPA2 = 0x8 # Use WPA2 encryption WPA3 = 0x20 # Use WPA3 encryption - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - AddProfileProfileFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+AddProfileProfileFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("AddProfileProfileFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("AddProfileProfileFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -3954,8 +3744,6 @@ class LFJsonPost(LFCliBase): class AddProfileWifiMode(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - AddProfileWifiMode.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+AddProfileWifiMode.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" p_802_11a = "802.11a" # 802.11a AUTO = "AUTO" # 802.11g @@ -4133,7 +3921,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = AddStaFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(AddStaFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" p_80211r_pmska_cache = 0x4000000 # Enable oportunistic PMSKA caching for WPA2 (Related to @@ -4181,29 +3969,6 @@ class LFJsonPost(LFCliBase): wpa2_enable = 0x400 # Use wpa_supplicant configured for WPA2 encryption. wpa_enable = 0x10 # Enable WPA - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - AddStaFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+AddStaFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("AddStaFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("AddStaFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -4216,8 +3981,6 @@ class LFJsonPost(LFCliBase): class AddStaMode(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - AddStaMode.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+AddStaMode.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" p_802_11a = 1 # 802.11a AUTO = 0 # 802.11g @@ -4239,8 +4002,6 @@ class LFJsonPost(LFCliBase): class AddStaRate(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - AddStaRate.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+AddStaRate.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" p_a_g = "/a/g" # 6 Mbps, 9 Mbps, 12 Mbps, 18 Mbps, 24 Mbps, 36 Mbps, 48 Mbps, 54 Mbps p_b = "/b" # 1Mbps, 2Mbps, 5.5 Mbps, 11 Mbps @@ -4325,8 +4086,6 @@ class LFJsonPost(LFCliBase): class AddT1SpanBuildout(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - AddT1SpanBuildout.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+AddT1SpanBuildout.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" p_15db = 6 # -15db (CSU) p_22_5db = 7 # -22.5db (CSU) @@ -4442,8 +4201,6 @@ class LFJsonPost(LFCliBase): class AddThresholdThreshId(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - AddThresholdThreshId.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+AddThresholdThreshId.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" Delete_Marked = -3 # Delete any marked. Mark_All = -2 # Mark all @@ -4451,8 +4208,6 @@ class LFJsonPost(LFCliBase): class AddThresholdThreshType(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - AddThresholdThreshType.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+AddThresholdThreshType.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" NO_RX_SINCE = 6 # Have not received any bytes/packets in specified time. RX_BPS_RATE_OOR_1m = 5 # rx-bps over last 1 minute is out of range. @@ -4525,36 +4280,13 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = AddTrafficProfileTrafficProfileFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(AddTrafficProfileTrafficProfileFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" BI_DIRECTIONAL = 0x2 # Should we do bi-directional traffic? IPERF_UDP = 0x4 # If Iperf, should use UDP. If not set, then will use TCP. UP = 0x1 # Upload direction (this not set means download) - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - AddTrafficProfileTrafficProfileFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+AddTrafficProfileTrafficProfileFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("AddTrafficProfileTrafficProfileFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("AddTrafficProfileTrafficProfileFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -4567,8 +4299,6 @@ class LFJsonPost(LFCliBase): class AddTrafficProfileWifiMode(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - AddTrafficProfileWifiMode.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+AddTrafficProfileWifiMode.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" Iperf3_Client = "Iperf3-Client" # iperf3 client Iperf3_Server = "Iperf3-Server" # iperf3 server @@ -4652,7 +4382,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = AddVapFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(AddVapFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" p_80211h_enable = 0x10000000 # Enable 802.11h (needed for running on DFS channels) Requires @@ -4690,29 +4420,6 @@ class LFJsonPost(LFCliBase): wep_enable = 0x200 # Enable WEP Encryption wpa2_enable = 0x400 # Enable WPA2 Encryption - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - AddVapFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+AddVapFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("AddVapFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("AddVapFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -4725,8 +4432,6 @@ class LFJsonPost(LFCliBase): class AddVapMode(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - AddVapMode.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+AddVapMode.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" p_802_11a = 1 # 802.11a AUTO = 0 # 802.11g @@ -4815,7 +4520,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = AddVenueFreq24.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(AddVenueFreq240, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" ALL = 0xffff # ALL @@ -4823,29 +4528,6 @@ class LFJsonPost(LFCliBase): Ch_2 = 0x2 # Channel 2 Ch_3 = 0x4 # Channel 3 - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - AddVenueFreq24.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+AddVenueFreq24.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("AddVenueFreq24 has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("AddVenueFreq24 has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -4860,7 +4542,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = AddVenueFreq5.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(AddVenueFreq50, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" Ch_100 = 0x800 # Channel 100 5500 @@ -4891,29 +4573,6 @@ class LFJsonPost(LFCliBase): Ch_60 = 0x200 # Channel 60 5300 Ch_64 = 0x400 # Channel 64 5320 - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - AddVenueFreq5.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+AddVenueFreq5.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("AddVenueFreq5 has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("AddVenueFreq5 has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -5063,7 +4722,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = AddVrFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(AddVrFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" p_4BYTE_AS_NUMBER = 0x40 # Sets corresponding Xorp flag. @@ -5080,29 +4739,6 @@ class LFJsonPost(LFCliBase): USE_XORP_OSPF = 0x1 # Enable Xorp router daemon with OSPF (IPv4) protocol USE_XORP_SHA = 0x4 # Enable Telcordia's Xorp SHA option (requires OSPF to be enabled) - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - AddVrFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+AddVrFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("AddVrFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("AddVrFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -5161,7 +4797,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = AddVrBgpFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(AddVrBgpFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" p_4BYTE_AS_NUMBER = 0x40 # Sets corresponding Xorp flag. @@ -5170,29 +4806,6 @@ class LFJsonPost(LFCliBase): ENABLE_BGP = 0x20 # Set this to zero if you don't want BGP on this VR. ROUTE_REFLECTOR = 0x80 # Act as BGP Route Reflector. - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - AddVrBgpFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+AddVrBgpFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("AddVrBgpFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("AddVrBgpFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -5253,7 +4866,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = AddVrcxFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(AddVrcxFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" custom_dhcpd = 0x400 # Use custom DHCP config file @@ -5271,29 +4884,6 @@ class LFJsonPost(LFCliBase): use_multicast = 0x800 # Use this interface for multicast and-rp use_vrrp = 0x1000 # Use this interface for VRRP - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - AddVrcxFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+AddVrcxFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("AddVrcxFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("AddVrcxFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -5428,8 +5018,6 @@ class LFJsonPost(LFCliBase): class AddWlEndpWleFlags(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - AddWlEndpWleFlags.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+AddWlEndpWleFlags.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" SHOW_WP = 1 # Show WanPaths in wanlink endpoint table in GUI @@ -5637,7 +5225,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = CShowPortsProbeFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(CShowPortsProbeFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" BRIDGE = 0x8 # 8 include bridges @@ -5648,29 +5236,6 @@ class LFJsonPost(LFCliBase): MII = 0x2 # 2 include MII WIFI = 0x1 # 1 include wifi stations - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - CShowPortsProbeFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+CShowPortsProbeFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("CShowPortsProbeFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("CShowPortsProbeFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -5840,8 +5405,6 @@ class LFJsonPost(LFCliBase): class ClearPortCountersExtra(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - ClearPortCountersExtra.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+ClearPortCountersExtra.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" dhcp4_lease = "dhcp4_lease" # Remove dhcp lease files for IPv4 DHCP dhcp6_lease = "dhcp6_lease" # Remove dhcp lease files for IPv6 DHCP @@ -6536,7 +6099,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = LogLevelLevel.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(LogLevelLevel0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" ALL = 0xffffffff # Log everything @@ -6557,29 +6120,6 @@ class LFJsonPost(LFCliBase): WRN = 0x4 # warnings (4) XMT = 0x100 # Output going to clients (256) - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - LogLevelLevel.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+LogLevelLevel.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("LogLevelLevel has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("LogLevelLevel has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -6792,7 +6332,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = NcShowPortsProbeFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(NcShowPortsProbeFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" BRIDGE = 0x8 # 8 include bridges @@ -6803,29 +6343,6 @@ class LFJsonPost(LFCliBase): MII = 0x2 # 2 include MII WIFI = 0x1 # 1 include wifi stations - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - NcShowPortsProbeFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+NcShowPortsProbeFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("NcShowPortsProbeFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("NcShowPortsProbeFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -7221,8 +6738,6 @@ class LFJsonPost(LFCliBase): class ResetPortPreIfdown(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - ResetPortPreIfdown.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+ResetPortPreIfdown.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" P_IN = "P-IN" # Only call the portal login (do not reset drivers/supplicant/dhcp) P_OUT = "P-OUT" # Only call the portal logout (do not reset drivers/supplicant/dhcp) @@ -8082,8 +7597,6 @@ class LFJsonPost(LFCliBase): class ScanWifiExtra(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - ScanWifiExtra.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+ScanWifiExtra.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" NA = "NA" # (or left blank) the system does a full scan dump = "dump" # then only cached values are returned @@ -8126,7 +7639,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = SetArmInfoArmFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(SetArmInfoArmFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" random_payload = 0x10000 # Use random payload sizes instead of linear increase @@ -8136,29 +7649,6 @@ class LFJsonPost(LFCliBase): use_gw_mac = 0x1000 # Use default gateway's MAC for destination MAC. use_tcp = 0x8000 # Use TCP instead of UDP protocol. (Note this is NOT stateful TCP!) - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - SetArmInfoArmFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+SetArmInfoArmFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("SetArmInfoArmFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("SetArmInfoArmFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -8343,8 +7833,6 @@ class LFJsonPost(LFCliBase): class SetCxStateCxState(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - SetCxStateCxState.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+SetCxStateCxState.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" DELETED = "DELETED" # Deletes the CX(s). QUIESCE = "QUIESCE" # Stop transmitting and gracefully stop cross-connect. @@ -8506,8 +7994,6 @@ class LFJsonPost(LFCliBase): class SetEndpFlagFlag(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - SetEndpFlagFlag.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+SetEndpFlagFlag.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" AutoHelper = "AutoHelper" # Automatically run on helper process ClearPortOnStart = "ClearPortOnStart" # clear stats on start @@ -8553,8 +8039,6 @@ class LFJsonPost(LFCliBase): class SetEndpPayloadPayloadType(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - SetEndpPayloadPayloadType.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+SetEndpPayloadPayloadType.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" PRBS_11_8_10 = "PRBS_11_8_10" # PRBS (see above) PRBS_15_0_14 = "PRBS_15_0_14" # PRBS (see above) @@ -8711,8 +8195,6 @@ class LFJsonPost(LFCliBase): class SetEndpTosTos(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - SetEndpTosTos.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+SetEndpTosTos.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" LOWCOST = "LOWCOST" # LOWDELAY = "LOWDELAY" # @@ -8781,35 +8263,12 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = SetEventInterestEiFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(SetEventInterestEiFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" CLEAR = 0x0 # will clear interest SET = 0x1 # set interest flag - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - SetEventInterestEiFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+SetEventInterestEiFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("SetEventInterestEiFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("SetEventInterestEiFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -8824,7 +8283,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = SetEventInterestEvents1.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(SetEventInterestEvents10, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" BAD_TOS = 0x400000 # Endpoint has bad ToS values configured. @@ -8860,29 +8319,6 @@ class LFJsonPost(LFCliBase): TX_BPS_OOR_3S = 0x80000000 # Endpoint threshold alert. WiFi_Config = 0x80000 # WiFi Configuration Error. - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - SetEventInterestEvents1.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+SetEventInterestEvents1.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("SetEventInterestEvents1 has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("SetEventInterestEvents1 has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -8897,7 +8333,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = SetEventInterestEvents2.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(SetEventInterestEvents20, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" FW_CRASH = 0x800 # Firmware for entity has crashed. @@ -8918,29 +8354,6 @@ class LFJsonPost(LFCliBase): TX_BPS_OOR_30S_CLEARED = 0x4 # Endpoint threshold alert cleared. TX_BPS_OOR_3S_CLEARED = 0x1 # Endpoint threshold alert cleared. - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - SetEventInterestEvents2.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+SetEventInterestEvents2.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("SetEventInterestEvents2 has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("SetEventInterestEvents2 has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -8989,8 +8402,6 @@ class LFJsonPost(LFCliBase): class SetEventPriorityEvent(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - SetEventPriorityEvent.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+SetEventPriorityEvent.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" Bad_MAC = 20 # Invalid MAC address configured. Cleared = 13 # Counters were cleared for some entity. @@ -9018,8 +8429,6 @@ class LFJsonPost(LFCliBase): class SetEventPriorityPriority(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - SetEventPriorityPriority.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+SetEventPriorityPriority.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" AUTO = "AUTO" # Let event creator decide the priority. CRITICAL = "CRITICAL" # @@ -9099,8 +8508,6 @@ class LFJsonPost(LFCliBase): class SetFlagFlag(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - SetFlagFlag.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+SetFlagFlag.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" brief = "brief" # Request more abbreviated output to various commands. prompt_newlines = "prompt_newlines" # Add a newline after every prompt. Can help with scripts @@ -9343,7 +8750,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = SetPortCmdFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(SetPortCmdFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" abort_if_scripts = 0x400 # Forceably abort all ifup/down scripts on this Port. @@ -9359,29 +8766,6 @@ class LFJsonPost(LFCliBase): skip_port_bounce = 0x100 # skip-port-bounce (Don't ifdown/up use_pre_ifdown = 0x800 # Call pre-ifdown script before bringing interface down. - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - SetPortCmdFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+SetPortCmdFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("SetPortCmdFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("SetPortCmdFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -9396,7 +8780,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = SetPortCurrentFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(SetPortCurrentFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" adv_100bt_fd = 0x800000 # advert-100bt-FD @@ -9435,29 +8819,6 @@ class LFJsonPost(LFCliBase): use_dhcp = 0x80000000 # USE-DHCP use_dhcpv6 = 0x20000000000 # USE-DHCPv6 - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - SetPortCurrentFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+SetPortCurrentFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("SetPortCurrentFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("SetPortCurrentFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -9470,8 +8831,6 @@ class LFJsonPost(LFCliBase): class SetPortDhcpClientId(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - SetPortDhcpClientId.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+SetPortDhcpClientId.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" NA = "NA" # Do not change from current value. NONE = "NONE" # Do not use dhcp client ID. @@ -9482,8 +8841,6 @@ class LFJsonPost(LFCliBase): class SetPortDhcpHostname(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - SetPortDhcpHostname.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+SetPortDhcpHostname.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" NA = "NA" # Do not change from current value. NONE = "NONE" # Do not use dhcp Hostname @@ -9494,8 +8851,6 @@ class LFJsonPost(LFCliBase): class SetPortDhcpVendorId(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - SetPortDhcpVendorId.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+SetPortDhcpVendorId.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" NA = "NA" # Do not change from current value. NONE = "NONE" # Do not use dhcp vendor ID @@ -9506,7 +8861,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = SetPortFlags2.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(SetPortFlags20, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" bypass_disconnect = 0x200 # Logically disconnect the cable (link-down) @@ -9516,29 +8871,6 @@ class LFJsonPost(LFCliBase): supports_bypass = 0x2 # Support Bypass Devices use_stp = 0x1 # Use Spanning Tree Protocol - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - SetPortFlags2.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+SetPortFlags2.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("SetPortFlags2 has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("SetPortFlags2 has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -9553,7 +8885,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = SetPortInterest.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(SetPortInterest0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" alias = 0x1000 # Port alias @@ -9590,29 +8922,6 @@ class LFJsonPost(LFCliBase): svc_httpd = 0x8000000 # Enable/disable HTTP Service for a port tx_queue_length = 0x200 # TX Queue Length - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - SetPortInterest.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+SetPortInterest.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("SetPortInterest has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("SetPortInterest has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -9797,8 +9106,6 @@ class LFJsonPost(LFCliBase): class SetResourceResourceFlags(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - SetResourceResourceFlags.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+SetResourceResourceFlags.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" skip_load_db_on_start = 1 # Should we skip loading the DB on start? @@ -9856,35 +9163,12 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = SetRfgenRfgenFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(SetRfgenRfgenFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" one_burst = 0x8 # Run for about 1 second and stop. Uses 5-sec sweep time for single pulse train. running = 0x2 # Should we start the RF Generator or not? - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - SetRfgenRfgenFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+SetRfgenRfgenFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("SetRfgenRfgenFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("SetRfgenRfgenFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -9947,7 +9231,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = SetScriptFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(SetScriptFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" SCR_COMPLETED = 0x80 # Set automatically by LANforge. @@ -9970,29 +9254,6 @@ class LFJsonPost(LFCliBase): SCR_USE_MSS = 0x8000 # When setting packet size, set TCP MSS instead if endpoint supports # +that. - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - SetScriptFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+SetScriptFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("SetScriptFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("SetScriptFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -10005,8 +9266,6 @@ class LFJsonPost(LFCliBase): class SetScriptType(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - SetScriptType.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+SetScriptType.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" NONE = "NONE" # Delete any existing script. Script2544 = "Script2544" # For RFC 2544 type testing. @@ -10275,7 +9534,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = SetWanpathCorruptionFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(SetWanpathCorruptionFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" BIT_FLIP = 0x4 # Flip a random bit in a byte. @@ -10285,29 +9544,6 @@ class LFJsonPost(LFCliBase): OVERWRITE_RANDOM = 0x1 # Write a random value to a byte. RECALC_CSUMS = 0x20 # Attempt to re-calculate UDP and TCP checksums. - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - SetWanpathCorruptionFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+SetWanpathCorruptionFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("SetWanpathCorruptionFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("SetWanpathCorruptionFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -10400,8 +9636,6 @@ class LFJsonPost(LFCliBase): class SetWanpathRunningRunning(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - SetWanpathRunningRunning.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+SetWanpathRunningRunning.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" AS_PARENT = "AS_PARENT" # then it will be started and stopped as the parent WanLink is. RUNNING = "RUNNING" # then it will be running at all times @@ -10440,7 +9674,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = SetWifiCorruptionsCorruptFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(SetWifiCorruptionsCorruptFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" MSG_TYPE_DEAUTH = 0x2 # de-authentication message @@ -10458,29 +9692,6 @@ class LFJsonPost(LFCliBase): MST_TYPE_EAPOL_OTHER_REQ = 0x1000 # EAP Requests that do not match other things. MST_TYPE_EAPOL_OTHER_RESP = 0x2000 # EAP Responses that do not match other things. - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - SetWifiCorruptionsCorruptFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+SetWifiCorruptionsCorruptFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("SetWifiCorruptionsCorruptFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("SetWifiCorruptionsCorruptFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -10734,7 +9945,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = SetWifiRadioFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(SetWifiRadioFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" ct_sta_mode = 0x40000 # Enable CT-STA mode if radio supports it. Efficiently replaces sw-crypt in @@ -10748,29 +9959,6 @@ class LFJsonPost(LFCliBase): use_syslog = 0x20000000 # Put supplicant logs in syslog instead of a file. verbose = 0x10000 # Verbose-Debug: Increase debug info in wpa-supplicant and hostapd logs. - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - SetWifiRadioFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+SetWifiRadioFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("SetWifiRadioFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("SetWifiRadioFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -10783,8 +9971,6 @@ class LFJsonPost(LFCliBase): class SetWifiRadioMode(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - SetWifiRadioMode.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+SetWifiRadioMode.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" p_802_11a = 1 # 802.11a AUTO = 0 # 802.11g @@ -10953,7 +10139,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = SetWlCorruptionFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(SetWlCorruptionFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" BIT_FLIP = 0x4 # Flip a random bit in a byte. @@ -10963,29 +10149,6 @@ class LFJsonPost(LFCliBase): OVERWRITE_RANDOM = 0x1 # Write a random value to a byte. RECALC_CSUMS = 0x20 # Attempt to re-calculate UDP and TCP checksums. - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - SetWlCorruptionFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+SetWlCorruptionFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("SetWlCorruptionFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("SetWlCorruptionFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None): @@ -11037,8 +10200,6 @@ class LFJsonPost(LFCliBase): class SetWlQdiscQdisc(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - SetWlQdiscQdisc.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+SetWlQdiscQdisc.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" FIFO = "FIFO" # is the default queuing discipline, no arguments WRR__queue_queue_____ = "WRR,[queue,queue,...]" # Weighted Round Robbin is also available @@ -11072,8 +10233,6 @@ class LFJsonPost(LFCliBase): class ShowAlertsType(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - ShowAlertsType.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+ShowAlertsType.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" All = "All" # CX = "CX" # @@ -11439,8 +10598,6 @@ class LFJsonPost(LFCliBase): class ShowEventsType(Enum): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: - ShowEventsType.clear_flags(['bridge', 'dhcp']) - print( 'value now: '+ShowEventsType.value()) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" All = "All" # CX = "CX" # @@ -12042,7 +11199,7 @@ class LFJsonPost(LFCliBase): This class is stateless. It can do binary flag math, returning the integer value. Example Usage: int:flag_val = 0 - flag_val = SniffPortFlags.set_flags( flag_names=['bridge', 'dhcp']) + flag_val = LFPost.set_flags(SniffPortFlags0, flag_names=['bridge', 'dhcp']) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" DUMPCAP = 0x2 # Use command-line dumpcap, more efficient than tshark @@ -12050,29 +11207,6 @@ class LFJsonPost(LFCliBase): MATE_XTERM = 0x8 # Launch tshark/dumpcap in xterm TSHARK = 0x1 # Use command-line tshark instead of wireshark - @classmethod - def set_flags(cls, starting_value: int, flag_names=None): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Example Usage: - SniffPortFlags.add_flags(flag_names=['bridge', 'dhcp']) - print('value now: '+SniffPortFlags.value()) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if starting_value is None: - raise ValueError("starting_value should be an integer greater or equal than zero, not None") - if not flag_names: - raise ValueError("flag_names should be a name or a list of names, not None") - if type(flag_names) is list: - selected_flags = [] - for flag in flag_names: - if flag not in cls.__members__: - raise ValueError("SniffPortFlags has no member:[%s]" % flag) - selected_flags.extend([cls[member].value for member in cls.__members__ if member == flag]) - selected_flags.append(starting_value) - return sum(selected_flags) - if flag_names not in cls.__members__: - raise ValueError("SniffPortFlags has no member:[%s]" % flag_names) - return cls.valueof(flag_names) - # use to get in value of flag @classmethod def valueof(cls, name=None):