diff --git a/assets/platforms/aruba_wlc.yaml b/assets/platforms/aruba_wlc.yaml new file mode 100644 index 0000000..bfdec7e --- /dev/null +++ b/assets/platforms/aruba_wlc.yaml @@ -0,0 +1,57 @@ +--- +platform-type: 'aruba_wlc' +default: + driver-type: 'network' + privilege-levels: + exec: + name: 'exec' + pattern: '(?im)^[\w.\-@/: ()*]{1,63}>$' + previous-priv: + deescalate: + escalate: + escalate-auth: false + escalate-prompt: + privilege-exec: + name: 'privilege-exec' + pattern: '(?im)^[\w.\-@/: ()*]{1,63}#$' + previous-priv: 'exec' + deescalate: 'disable' + escalate: 'enable' + escalate-auth: true + escalate-prompt: '(?im)^(?:enable\s){0,1}password:\s?$' + configuration: + name: 'configuration' + pattern: '(?im)^[\w.\-@/: ()*]{1,63}\([\+\w.\-@/:+]{0,32}\)#$' + not-contains: + - 'tcl)' + previous-priv: 'privilege-exec' + deescalate: 'end' + escalate: 'configure terminal' + escalate-auth: false + escalate-prompt: + tclsh: + name: 'tclsh' + pattern: '(?im)^([\w.\-@/+>:]+\(tcl\)[>#]|\+>)$' + previous-priv: 'privilege-exec' + deescalate: 'tclquit' + escalate: 'tclsh' + escalate-auth: false + escalate-prompt: + default-desired-privilege-level: 'privilege-exec' + failed-when-contains: + - '% Unrecognized command' + - '% Ambiguous command' + - '% Wrong parameter' + - "% Incomplete command" + - "% Too many parameters" + - "% Invalid input" + textfsm-platform: 'aruba_wlc' # ignored in go because no ntc-templates + network-on-open: + - operation: 'acquire-priv' # targets default desired priv by default + - operation: 'driver.send-command' + command: 'no paging' + network-on-close: + - operation: 'acquire-priv' + - operation: 'channel.write' + input: 'exit' + - operation: 'channel.return' diff --git a/assets/platforms/hp_comware.yaml b/assets/platforms/hp_comware.yaml new file mode 100644 index 0000000..a7a50f3 --- /dev/null +++ b/assets/platforms/hp_comware.yaml @@ -0,0 +1,38 @@ +--- +platform-type: 'hp_comware' +default: + driver-type: 'network' + privilege-levels: + user-view: + name: 'user-view' + pattern: '(?im)^<[\w.\-@/:]{1,63}>$' + previous-priv: + deescalate: + escalate: + escalate-auth: false + escalate-prompt: + system-view: + name: 'system-view' + pattern: '(?im)^[[\w.\-@/:]{1,63}]$' + previous-priv: 'user-view' + deescalate: 'quit' + escalate: 'system-view' + escalate-auth: false + escalate-prompt: + default-desired-privilege-level: 'user-view' + failed-when-contains: + - '% Unrecognized command' + - '% Ambiguous command' + - '% Wrong parameter' + - "% Incomplete command" + - "% Too many parameters" + textfsm-platform: 'hp_comware' # ignored in go because no ntc-templates + network-on-open: + - operation: 'acquire-priv' # targets default desired priv by default + - operation: 'driver.send-command' + command: 'screen-length disable' + network-on-close: + - operation: 'acquire-priv' + - operation: 'channel.write' + input: 'quit' + - operation: 'channel.return' diff --git a/assets/platforms/huawei_vrp.yaml b/assets/platforms/huawei_vrp.yaml index 49b320b..b73c023 100644 --- a/assets/platforms/huawei_vrp.yaml +++ b/assets/platforms/huawei_vrp.yaml @@ -25,6 +25,7 @@ default: - 'Error: Wrong parameter' # missing whitespace is intentional below - 'Error:Ambiguous command' + - 'Error:Too many parameters' - 'Error:Incomplete command' textfsm-platform: 'huawei_vrp' # ignored in go because no ntc-templates network-on-open: diff --git a/assets/platforms/ruijie_rjos.yaml b/assets/platforms/ruijie_rjos.yaml new file mode 100644 index 0000000..9d15a14 --- /dev/null +++ b/assets/platforms/ruijie_rjos.yaml @@ -0,0 +1,55 @@ +--- +platform-type: 'ruijie_rgos' +default: + driver-type: 'network' + privilege-levels: + exec: + name: 'exec' + pattern: '(?im)^[\w.\-@/:]{1,63}>$' + previous-priv: + deescalate: + escalate: + escalate-auth: false + escalate-prompt: + privilege-exec: + name: 'privilege-exec' + pattern: '(?im)^[\w.\-@/:]{1,63}#$' + previous-priv: 'exec' + deescalate: 'disable' + escalate: 'enable' + escalate-auth: true + escalate-prompt: '(?im)^(?:enable\s){0,1}password:\s?$' + configuration: + name: 'configuration' + pattern: '(?im)^[\w.\-@/:]{1,63}\([\+\w.\-@/:+]{0,32}\)#$' + not-contains: + - 'tcl)' + previous-priv: 'privilege-exec' + deescalate: 'end' + escalate: 'configure terminal' + escalate-auth: false + escalate-prompt: + tclsh: + name: 'tclsh' + pattern: '(?im)^([\w.\-@/+>:]+\(tcl\)[>#]|\+>)$' + previous-priv: 'privilege-exec' + deescalate: 'tclquit' + escalate: 'tclsh' + escalate-auth: false + escalate-prompt: + default-desired-privilege-level: 'privilege-exec' + failed-when-contains: + - '% Ambiguous command' + - '% Incomplete command' + - '% Invalid input detected' + - '% Unknown command' + textfsm-platform: '' # ignored in go because no ntc-templates + network-on-open: + - operation: 'acquire-priv' # targets default desired priv by default + - operation: 'driver.send-command' + command: 'terminal length 0' + network-on-close: + - operation: 'acquire-priv' + - operation: 'channel.write' + input: 'exit' + - operation: 'channel.return' diff --git a/platform/definition.go b/platform/definition.go index 186c0a9..819d48d 100644 --- a/platform/definition.go +++ b/platform/definition.go @@ -18,23 +18,65 @@ import ( const ( // AristaEos is a constant representing the platform string/name for Arista EOS devices. AristaEos = "arista_eos" + // ArubaWlc is a constant representing the platform string/name for Aruba Wireless controller + // AOS devices. + ArubaWlc = "aruba_wlc" // CiscoIosxe is a constant representing the platform string/name for Cisco IOSXE devices. CiscoIosxe = "cisco_iosxe" // CiscoIosxr is a constant representing the platform string/name for Cisco IOSXR devices. CiscoIosxr = "cisco_iosxr" // CiscoNxos is a constant representing the platform string/name for Cisco NXOS devices. CiscoNxos = "cisco_nxos" + // CumulusLinux is a constant representing the platform string/name for Cumulus devices. + CumulusLinux = "cumulus_linux" + // CumulusVtysh is a constant representing the platform string/name for Cumulus vtysh devices. + CumulusVtysh = "cumulus_vtysh" + // HpComware is a constant representing the platform string/name for H3C devices. + HpComware = "hp_comware" + // HuaweiVrp is a constant representing the platform string/name for Huawei VRP devices. + HuaweiVrp = "huawei_vrp" + // IpinfusionOcnos is a constant representing the platform string/name for Ipinfusion OCNos + // devices. + IpinfusionOcnos = "ipinfusion_ocnos" // JuniperJunos is a constant representing the platform string/name for Juniper JunOS devices. JuniperJunos = "juniper_junos" // NokiaSrl is a constant representing the platform string/name for Nokia SRL/SRLinux devices. NokiaSrl = "nokia_srl" + // NokiaSros is a constant representing the platform string/name for Nokia SROS devices. + NokiaSros = "nokia_sros" + // NokiaSrosClassic is a constant representing the platform string/name for Nokia SROS devices + // in classic mode. + NokiaSrosClassic = "nokia_sros_classic" + // PaloAltoPanos is a constant representing the platform string/name for Palo Alto PanOS + // devices. + PaloAltoPanos = "paloalto_panos" + // RuijieRgos is a constant representing the platform string/name for Ruijie network devices. + RuijieRgos = "ruijie_rgos" + // VyattaVyos is a constant representing the platform string/name for Vyos devices. + VyattaVyos = "vyatta_vyos" ) // GetPlatformNames is used to get the "core" (as in embedded in assets and used in testing) // platform names. func GetPlatformNames() []string { return []string{ - AristaEos, CiscoIosxe, CiscoIosxr, CiscoNxos, JuniperJunos, NokiaSrl, + AristaEos, + ArubaWlc, + CiscoIosxe, + CiscoIosxr, + CiscoNxos, + CumulusLinux, + CumulusVtysh, + HpComware, + HuaweiVrp, + IpinfusionOcnos, + JuniperJunos, + NokiaSrl, + NokiaSros, + NokiaSrosClassic, + PaloAltoPanos, + RuijieRgos, + VyattaVyos, } }