passh

package
v0.0.0-...-2fa181f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Palo Alto SSH includes all things relate to Palo Alto devices using SSH

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseActionFromPolicyMatch

func ParseActionFromPolicyMatch(s string) (string, error)

ParseActionFromPolicyMatch gets an XML then parses it and returns to get only the Action part of given Test Security Policy Match result

func ParseInterfaceFromFIB

func ParseInterfaceFromFIB(s string) (string, error)

ParseInterfaceFromFIB gets an XML then parses it and returns to get only interface name.

func ParseZoneFromInterface

func ParseZoneFromInterface(s string) (string, error)

ParseZoneFromInterface gets an XML then parses it and returns to get only Zone name of the given interface.

func ShowInterfaceCmd

func ShowInterfaceCmd(Intrfc string) string

ShowInterfaceCmd generates the command 'show interface <interface>' on the given <interface>. Intrfc is Interface Name

Example
cmd := ShowInterfaceCmd("ae1.1345")
fmt.Println(cmd)
Output:

show interface ae1.1345

func TestRouteFibLookupCmd

func TestRouteFibLookupCmd(vr, dip string) string

TestRouteFibLookupCmd generates the command 'test routing fib-lookup virtual-router <virtual-router> ip <ip-address>' on the given <virtual-router> and <ip-address>. This function gets: dip is Destination IP vr is Virtual Router

Example
cmd := TestRouteFibLookupCmd("default", "192.168.1.1")
fmt.Println(cmd)
Output:

test routing fib-lookup virtual-router default ip 192.168.1.1

func TestSecurityPolicyMatchCmd

func TestSecurityPolicyMatchCmd(cfg [7]string) (result string, err error)

TestSecurityPolicyMatchCmd generates the command ' test security-policy-match protocol 6 from <source-zone> to <destination-zone> source <source-ip-address> destination <destination-ip-address> destination-port <destination-port> application <application-name>. This function gets cfg which is an 7-cell array in which: cfg[0] is Protocol Number (e.g. 6) cfg[1] is Source Zone cfg[2] is Destination Zone cfg[3] is Source IP cfg[4] is Destination IP cfg[5] is Destination Port cfg[6] is Application

Example
// cfg[0] is Protocol Number (e.g. 6)
// cfg[1] is Source Zone
// cfg[2] is Destination Zone
// cfg[3] is Source IP
// cfg[4] is Destination IP
// cfg[5] is Destination Port
// cfg[6] is Application
var cfg [7]string

cfg[0] = "6"
cfg[1] = "ZONE1"
cfg[2] = "ZONE2"
cfg[3] = "192.168.0.1"
cfg[4] = "172.16.0.1"
cfg[5] = "22"
cfg[6] = "ssh"

cmd, _ := TestSecurityPolicyMatchCmd(cfg)
fmt.Println(cmd)
Output:

test security-policy-match protocol 6 from ZONE1 to ZONE2 source 192.168.0.1 destination 172.16.0.1 destination-port 22 application ssh

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL