def __init__(self): DMObject.__init__(self, FailoverConfig.__name__) ifc_asa_keys = (("lan_unit", "failover lan unit"), ("key_secret", "failover key"), ("key_in_hex", "failover key hex"), ("interface_policy", "failover interface-policy")) for ifc, asa in ifc_asa_keys: self.register_child( SimpleType(ifc, asa, response_parser=failover_response_parser)) self.register_child( DMBoolean('http_replication', 'failover replication http', on_value="enable", response_parser=failover_response_parser)) self.register_child( DMList('mgmt_standby_ip', MgmtStandbyIP, asa_key='ip address')) self.register_child( DMList('failover_lan_interface', FailoverLANInterface, asa_key='failover lan interface')) self.register_child( DMList('failover_link_interface', FailoverLinkInterface, asa_key='failover link')) self.register_child( DMList('failover_ip', FailoverIP, asa_key='failover interface ip')) self.register_child( DMList('polltime', FailoverPolltime, asa_key='failover polltime')) self.response_parser = failover_response_parser self.register_child( DMBoolean(ifc_key="failover", asa_key="failover", on_value="enable", response_parser=failover_response_parser))
def __init__(self): ''' Constructor ''' DMObject.__init__(self, ScanningThreatDetection.__name__) self.register_child( SimpleScanning('scanning_threat', self.THREAT_DETECTION_SCANNING)) self.register_child( SimpleShun('shun_status', self.THREAT_DETECTION_SCANNING_SHUN)) rate_translator = DMList('ScanningThreatRate', ScanningThreatRate, asa_key=self.THREAT_DETECTION_SCANNING_RATE) self.register_child(rate_translator) rate_translator = DMList('ScanningThreatShunExceptIP', ShunExceptIP, asa_key=self.THREAT_DETECTION_SCANNING_SHUN + " except ip-address") self.register_child(rate_translator) rate_translator = DMList('ScanningThreatShunExceptObject', ShunExceptObject, asa_key=self.THREAT_DETECTION_SCANNING_SHUN + " except object-group") self.register_child(rate_translator) self.register_child( ShunDuration('ScanningThreatShunDuration', self.THREAT_DETECTION_SCANNING_SHUN + " duration"))
def __init__(self, name, child_class, asa_key='', rate_type = ''): ''' @param self: DMList instance this class instance @param name: str the key for this configuration from the device specification file. @param child_class: class the type of elements in the list @param rate_type: string the type of rate ''' DMList.__init__(self, name, child_class, asa_key) self.rate_type = rate_type
def __init__(self): DMObject.__init__(self, LoggingConfig.__name__) ifc_asa_keys = (("facility", "logging facility"), ("buffered_level", "logging buffered"), ("buffer_size", "logging buffer-size"), ("flash_maximum_allocation", "logging flash-maximum-allocation"), ("flash_minimum_free", "logging flash-minimum-free")) for (ifc, asa) in ifc_asa_keys: self.register_child( SimpleType(ifc, asa, is_removable=True, response_parser=cli_interaction. ignore_warning_response_parser)) self.register_child(LoggingTrap()) ifc_asa_keys_boolean_type = (("enable_logging", "logging enable"), ("standby", "logging standby"), ("flash_bufferwrap", "logging flash-bufferwrap"), ("permit_hostdown", "logging permit-hostdown")) for (ifc, asa) in ifc_asa_keys_boolean_type: self.register_child( DMBoolean(ifc, asa, on_value="enable", response_parser=cli_interaction. ignore_warning_response_parser)) self.register_child( DMList('logging_host', LoggingHost, asa_key='logging host')) self.register_child( DMList('logging_message', LoggingMessage, asa_key='logging message')) self.response_parser = cli_interaction.ignore_warning_response_parser
def gen_diff_ifc_asa(self, cli_dict): my_state = [] if not cli_dict: return for cli in cli_dict.values(): result = DMList.get_translator(self, cli) if result: my_state.append(result.gen_diff_ifc_asa(cli)) if State.MODIFY in my_state: return State.MODIFY if State.DESTROY in my_state: return State.DESTROY if State.NOCHANGE in my_state: return State.NOCHANGE
def __init__(self, name): SimpleType.__init__(self, name, asa_gen_template='interface TVI1') # Phase 1 only has TVI1 self.register_child(IPv4Addr('ipv4_address')) self.register_child( DMList(name='ipv6_address_with_prefix', child_class=IPv6Addr, asa_key='ipv6 address')) self.register_child(IPv6Enable('ipv6_enable')) self.register_child(IPv6NDDad('ipv6_nd_dad_attempts')) self.register_child(IPv6NDNsInterval('ipv6_nd_ns_interval')) self.register_child(IPv6NDReachable('ipv6_nd_reachable_time')) self.register_child(MACAddr('mac-address')) self.register_child(NameIF('nameif')) self.response_parser = cli_interaction.ignore_info_response_parser
def __init__(self): ''' Constructor ''' self.interface = None DMObject.__init__(self, TemplateAndCollectors.__name__) self.response_parser = self.ignore_msg_response_parser self.register_child( DMList('NetFlowCollectors', NetFlowCollectors, asa_key='flow-export destination')) self.register_child( TemplateTimeout("template_timeout_rate", self.FLOW_EXPORT_TIMEOUT_RATE)) self.register_child( DelayFlowCreate("delay_flow_create", self.FLOW_EXPORT_DELAY_CREATE)) self.register_child( ActiveRefresh("active_refresh_interval", self.FLOW_EXPORT_REFRESH_RATE))
def __init__(self, cmd_prefix, connector): DMList.__init__(self, 'ipv6route', IPv6Route) if 'ipv6' in cmd_prefix \ else DMList.__init__(self, 'route', Route) self.asa_key = cmd_prefix self.connector = connector self.cmd_prefix = cmd_prefix
def __init__(self): DMList.__init__(self, name='TVI', asa_key='interface TVI1', child_class=TVI)
def __init__(self): DMObject.__init__(self, ClusterConfig.__name__) self.register_child(ClusterRole()) self.register_child(DMList('pool_config', PoolConfig, asa_key='ip local pool')) self.register_child(BootstrapConfig()) self.register_child(ClusterMtu())
def __init__(self, name, connector_name): DMList.__init__(self, name, AccessGroup, 'access-group') self.connector_name = connector_name
def __init__(self): DMList.__init__(self, 'AccessList', AccessList, 'access-list')
def __init__(self): DMList.__init__(self, name='IPv6NeighborDiscovery', asa_key='ipv6 nd prefix', child_class=IPv6NeighborDiscovery)
def __init__(self): DMList.__init__(self, 'NATRule', NATRule, 'nat') self.diff_ifc_asa_nat_order = 1
def __init__(self): DMList.__init__(self, name='IPv6Address', asa_key='ipv6 address', child_class=IPv6Addr)
def __init__(self, name, child_class, asa_key=''): DMList.__init__(self, name, child_class, asa_key) self.asa_key = 'interface'
def __init__(self, name, child_class): DMList.__init__(self, name, child_class, asa_key='segment-id') self.segment_key = ''
def __init__(self, instance): DMList.__init__(self, instance, AccessControlEntry, 'access-list') self.diff_ifc_asa_ace_order = 1
def __init__(self): DMList.__init__(self, 'VIF', Vif, 'interface') self.asa_key = 'interface'
def __init__(self): CompositeType.__init__(self, ifc_key = DNSServer.__name__, asa_key = 'dns server-group DefaultDNS') self.register_child(SimpleType("domain_name", "domain-name")) self.register_child(DMList('name_server', DNSNameServer, 'name-server'))