commonLib

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

README

About

A common library for controlling software used by NetLOX.

Author

NETLOX

Documentation

Overview

package commonLib

nanomsg를 통해 LOXILIGHT코어에 API를 전송하는 함수를 모아놓은 라이브러리입니다. 디폴트 서버 주소는 127.0.0.1입니다.

Index

Constants

View Source
const (
	LOXILIGHT_PACKET_IN                     = iota + 1 /* Legacy packet in from SDN edge */
	LOXILIGHT_PACKET_OUT                               /* Legacy packet out toward SDN edge */
	LOXILIGHT_VERSION_SHOW                             /* *Version show */
	LOXILIGHT_RUN_CONFIG_SHOW                          /* *Legacy current configuration show */
	LOXILIGHT_START_CONFIG_SHOW                        /* *Legacy start up configuration show */
	LOXILIGHT_INTERFACE_STAT_SHOW_BRIEF                /* *Legacy Interface statistics counter show all */
	LOXILIGHT_INTERFACE_STAT_SHOW_INTERFACE            /* *Legacy Interface statistics counter show with interface name */
	LOXILIGHT_INTERFACE_SHOW_BRIEF                     /* *Legacy Interface information show (MAC, Speed, Port mode etc.)*/
	LOXILIGHT_INTERFACE_SHOW_INTERFACE                 /* *Legacy Interface information show with interface name */
	LOXILIGHT_IP_ADDR_ADD                              /* Legacy Interface address addition */
	LOXILIGHT_IP_ADDR_DEL                              /* Legacy Interface address deletion */
	LOXILIGHT_IPV6_ADDR_ADD                            /* Legacy ipv6 Interface address addition */
	LOXILIGHT_IPV6_ADDR_DEL                            /* Legacy ipv6 Interface address deletion */
	LOXILIGHT_IP_INTERFACE_BRIEF                       /* *Legacy IP information show (IP address, MTU, Proxy arp etc. )*/
	LOXILIGHT_IP_INTERFACE                             /* *Legacy IP information show with interface name */
	LOXILIGHT_RT_ADD                                   /* Legacy route addition */
	LOXILIGHT_RT_DEL                                   /* Legacy route deletion */
	LOXILIGHT_IPV6_RT_ADD                              /* Legacy ipv6 route addition */
	LOXILIGHT_IPV6_RT_DEL                              /* Legacy ipv6 route deletion */
	LOXILIGHT_RT_SHOW_ALL                              /* *Legacy route show both of IPv4 and IPv6*/
	LOXILIGHT_NH_ADD                                   /* Legacy next-hop addition */
	LOXILIGHT_NH_DEL                                   /* Legacy next-hop deletion */
	LOXILIGHT_IPV6_NH_ADD                              /* Legacy next-hop addition */
	LOXILIGHT_IPV6_NH_DEL                              /* Legacy next-hop deletion */
	LOXILIGHT_NH_SHOW_ALL                              /* *Legacy next-hop show both of IPv4 and IPv6 */
	LOXILIGHT_NH_SHOW_INTERFACE                        /* *Legacy next-hop show both of IPv4 and IPv6 with interface name */
	LOXILIGHT_VBR_ADD                                  /* VLAN Bridge Creation/Modification*/
	LOXILIGHT_VBR_DEL                                  /* VLAN Bridge Deletion */
	LOXILIGHT_VBR_SHOW_ALL                             /* *VLAN Bridge Show with brief infomation*/
	LOXILIGHT_VBR_SHOW_ID                              /* *VLAN Bridge Show using vlan id*/
	LOXILIGHT_VBR_PORT_ADD                             /* Port Add to VLAN Bridge*/
	LOXILIGHT_VBR_PORT_DEL                             /* Port Delete from VLAN Bridge */
	LOXILIGHT_VXBR_ADD                                 /* VxLAN Bridge Creation/Modification*/
	LOXILIGHT_VXBR_DEL                                 /* VxLAN Bridge Deletion */
	LOXILIGHT_VXBR_AP_ADD                              /* VxLAN Bridge Access Point add*/
	LOXILIGHT_VXBR_AP_DEL                              /* VxLAN Bridge Access Point del*/
	LOXILIGHT_VXBR_EP_RIP_ADD                          /* VxLAN Bridge Remote IP add*/
	LOXILIGHT_VXBR_EP_RIP_DEL                          /* VxLAN Bridge Remote IP del*/
	LOXILIGHT_VXBR_SHOW_ALL                            /* VxLAN Bridge Show */
	LOXILIGHT_VXBR_SHOW_ID                             /* VxLAN Bridge Show using vxlan id*/
	LOXILIGHT_VTEP_SHOW_ALL                            /* VxLAN Tunnel Endpoint Show */
	LOXILIGHT_L2FDB_ADD                                /* MAC entry add in Legacy L2 Table */
	LOXILIGHT_L2FDB_DEL                                /* MAC entry del from Legacy L2 Table */
	LOXILIGHT_VXFDB_ADD                                /* MAC entry add in Legacy L2 Table */
	LOXILIGHT_VXFDB_DEL                                /* MAC entry del from Legacy L2 Table */
	LOXILIGHT_L2FDB_SHOW_ALL                           /* MAC entry show from Legacy L2 Table */
	LOXILIGHT_L2FDB_SHOW_VLAN                          /* MAC entry show from Legacy L2 Table for vlan id */
	LOXILIGHT_VXFDB_SHOW_ALL                           /* MAC entry show from Legacy L2 Table */
	LOXILIGHT_VXFDB_SHOW_VXLAN                         /* MAC entry show from Legacy L2 Table for vxlan id */
	LOXILIGHT_LAG_INTF_ADD                             /* LAG Interface Creation/Modification*/
	LOXILIGHT_LAG_INTF_DEL                             /* LAG Interface Deletion */
	LOXILIGHT_LAG_PORT_ADD                             /* Port Add to LAG Interface*/
	LOXILIGHT_LAG_PORT_DEL                             /* Port Delete from LAG Interface */
	LOXILIGHT_LAG_MODE_SET                             /* LAG Interface mode set*/
	LOXILIGHT_IPSEC_POLICY_ADD                         /* IPSEC policy add */
	LOXILIGHT_IPSEC_POLICY_DEL                         /* IPSEC policy del */
	LOXILIGHT_IPSEC_POLICY_SHOW                        /* IPSEC policy show */
	LOXILIGHT_STP_STATE                                /* STP state from Port state in bridge*/
	LOXILIGHT_SDN_VIRT_IF_ADD                          /* Virtual interface addition from SDN core */
	LOXILIGHT_SDN_VIRT_IF_DEL                          /* Virtual interface deletion from SDN core */
	LOXILIGHT_SDN_VIRT_IF_UPDATE                       /* Virtual interface update */
	LOXILIGHT_VIF_SHOW_ALL                             /* Virtual interface show all */
	LOXILIGHT_VIF_SHOW_NAME                            /* Virtual interface show by name */
	LOXILIGHT_MIRROR_ADD                               /* MIRROR add */
	LOXILIGHT_MIRROR_DEL                               /* MIRROR del */
	LOXILIGHT_MIRROR_PORT_ADD                          /* MIRROR inbound port add */
	LOXILIGHT_MIRROR_PORT_DEL                          /* MIRROR inbound port del */
	LOXILIGHT_MIRROR_SHOW                              /* MIRROR show */
	LOXILIGHT_ACL_ADD                                  /* ACL add */
	LOXILIGHT_ACL_DEL                                  /* ACL del */
	LOXILIGHT_ACL_DEL_ALL                              /* ACL del all */
	LOXILIGHT_ACL_SHOW                                 /* ACL show */
	LOXILIGHT_CT_SHOW                                  /* Connection tracking show */
	LOXILIGHT_APPFLOW_SHOW                             /* Cache flow show */
	LOXILIGHT_SERVICE_ECHO
	LOXILIGHT_SERVICE_SUCCESS
	LOXILIGHT_SERVICE_ERROR
)
View Source
const VERSION = 1

version

Variables

View Source
var LoxilightMgmtIp string = "tcp://127.0.0.1:8861"

LOXILIGHT LoxilightMgmt IP주소

View Source
var TitleAcl = []string{"UUID", "Filter", "Action", "Statistic"}
View Source
var TitleAutoneg = []string{"Interface", "Auto-Neg Mode", "Speed", "Adv Speeds", "Type", "Adv Types", "Oper", "Admin"}
View Source
var TitleBreakout = []string{"Interface", "Current Breakout Mode"}
View Source
var TitleConntrack = []string{"Date", "Time", "Source IP", "Port", "Destinaion IP", "Port", "Protocol", "Timeout", "Total timeout", "Status", "Statistic[Count:byte]"}
View Source
var TitleCounters = []string{"IFACE", "STATE", "RX_OK", "RX_BPS", "RX_UTIL", "RX_ERR", "RX_DRP", "RX_OVR", "TX_OK", "TX_BPS", "TX_UTIL", "TX_ERR", "TX_DRP", "TX_OVR"}
View Source
var TitleFdb = []string{"MAC", "VLAN", "VRF", "Interface", "Status"}
View Source
var TitleInterfaceBrief = []string{"Ethernet_Interface", "VLAN", "Type", "Mode", "Status", "Reason", "Speed", "Port_Ch#"}
View Source
var TitleIpBrief = []string{"Interface", "IP-Address", "OK?", "Method", "Status", "Protocol"}

Title Declare

View Source
var TitleNeighborTable = []string{"VRF", "Next hop", "Source MAC", "Destinaion MAC", "Interface", "Is Install", "HW Install"}
View Source
var TitleRouteTable = []string{"VRF", "Route", "Is Install", "NextHop", "interface"}
View Source
var TitleVlanBrief = []string{"Name", "VLAN", "Status", "Ports"}
View Source
var TitleVlanDetail = []string{"Name", "VLAN", "VRF", "MAC", "Status", "Address", "Ports"}

var TitleVlanDetail = []string{"VLAN", "Type", "SAID", "MTU", "Parent", "RingNo", "BridgeNo", "Stp", "BrdgMode", "Trans1", "Trans2"}

View Source
var TitleVxfdb = []string{"MAC", "VxLAN", "VRF", "Destinaion IP", "VETP id", "Status"}
View Source
var TitleVxlanBrief = []string{"VxLAN-Name", "VxLAN-ID", "UIF", "MAC"}
View Source
var TitleVxlanDetail = []string{"VxLAN-Name", "VxLAN-ID", "VRF", "Local IP", "UDP port", "UIF", "MAC"}

var title_vlan_detail = []string{"VLAN", "Type", "SAID", "MTU", "Parent", "RingNo", "BridgeNo", "Stp", "BrdgMode", "Trans1", "Trans2"}

Functions

func AclExtract

func AclExtract(raw string) []string

AclExtract 데이터에서 ACL 부분의 정보를 추출합니다.

func AddAclConfig

func AddAclConfig(acl ACLModel) (string, error)

AddAclConfig 는 스태틱 라우팅 테이블 엔트리를 추가합니다.

func AddFdbConfig

func AddFdbConfig(vlan_id string, mac_address string, interface_name string) error

AddFdbConfig 는 vlan id를 기반으로 L2FDB 주소를 추가합니다.

func AddIpAddressConfig

func AddIpAddressConfig(interface_name string, ip_address string, prefix int) error

AddIpAddressConfig 는 인터페이스에 IP 주소를 추가합니다.

func AddIpNeighborConfig

func AddIpNeighborConfig(interface_name string, ip_address string, mac_address string) error

AddIpNeighborConfig 는 스태틱 neighbor정보를 추가합니다.

func AddIpRouteConfig

func AddIpRouteConfig(ip_address string, prefix int, next_hop string) error

AddIpRouteConfig 는 스태틱 라우팅 테이블 엔트리를 추가합니다.

func AddIpsecConfig

func AddIpsecConfig(source_ip string, destination_ip string, protocol string, spi string, direction string, reqid string, key string, key_len string, interface_name string) error

func AddMirrorPortConfig

func AddMirrorPortConfig(MirrorId int, InterfaceName string) error

AddMirrorPortConfig 는 미러링 포트를 추가합니다.

func AddMirrorRspanConfig

func AddMirrorRspanConfig(MirrorId int, OutInterfaceName string, VlanId int) error

AddMirrorRspanConfig 는 RSPAN미러링 아웃풋 포트 및 설정을 추가합니다.

func AddMirrorSpanConfig

func AddMirrorSpanConfig(MirrorId int, OutInterfaceName string) error

AddMirrorSpanConfig 는 SPAN 미러링 아웃풋 포트 및 설정을 추가합니다.

func AddVlanBridge

func AddVlanBridge(vlan_id int) error

AddVlanBridge은 vlan bridge를 추가합니다.

func AddVlanMember

func AddVlanMember(vlan_id int, interface_name string, tagging_status string) error

AddVlanMember은 기 생성된 vlan bridge에 port를 추가합니다.

func AddVxfdbConfig

func AddVxfdbConfig(vxlan_id int, mac_address string, ip_address string) error

AddVxfdbConfig 는 vxlan id를 기반으로 L2FDB 주소를 추가합니다.

func AddVxlanBridgeWithVlanID

func AddVxlanBridgeWithVlanID(vxlan_id int, interface_name string, vlan_id int) error

AddVxlanBridgeWithVlanID는 vxlan을 추가하는 함수입니다.

func AddVxlanBridgeWithoutVlanID

func AddVxlanBridgeWithoutVlanID(vxlan_id int, interface_name string) error

AddVxlanBridgeWithoutVlanID는 vxlan을 추가하는 함수입니다.

func AddVxlanMember

func AddVxlanMember(vxlan_id int, interface_name string, tagging_status string) error

AddVxlanMember는 호스트부분의 vxlan 설정을 추가하는 함수입니다.

func AddVxlanPeer

func AddVxlanPeer(vxlan_id int, remote_ip string) error

AddVxlanPeer 는 vxlan의 remote ip 주소를 추가하는 함수입니다.

func ChangeHexIpToDec

func ChangeHexIpToDec(hexip string) string

func ChangeLoxilightMgmtIp

func ChangeLoxilightMgmtIp(url string)

func CloseConnection

func CloseConnection(sock mangos.Socket)

func ConntrackDetailExtract

func ConntrackDetailExtract(raw string) []string

func ConntrackExtract

func ConntrackExtract(raw string) []string

ConntrackExtract는 데이터에서 Conntrack 부분의 정보를 추출합니다.

func ConntrackStatExtract

func ConntrackStatExtract(raw string) []string

func DelAclAllConfig

func DelAclAllConfig() error

DelAclAllConfig 모든 ACL의 정보를 삭제합니다.

func DelAclConfig

func DelAclConfig(UUID string) error

DelAclConfig 는 스태틱 라우팅 테이블 엔트리를 삭제합니다.

func DelFdbConfig

func DelFdbConfig(vlan_id string, mac_address string, interface_name string) error

DelFdbConfig 는 vlan id를 기반으로 L2FDB 주소를 삭제합니다.

func DelIpAddressConfig

func DelIpAddressConfig(interface_name string, ip_address string, prefix int) error

DelIpAddressConfig 는 인터페이스에 IP 주소를 삭제합니다.

func DelIpNeighborConfig

func DelIpNeighborConfig(interface_name string, ip_address string) error

DelIpNeighborConfig 는 스태틱 neighbor정보를 삭제합니다.

func DelIpRouteConfig

func DelIpRouteConfig(ip_address string, prefix int, nextHop string) error

DelIpRouteConfig 는 스태틱 라우팅 테이블 엔트리중 넥스트홉을 명시하여 삭제합니다.

func DelIpsecConfig

func DelIpsecConfig(source_ip string, destination_ip string, protocol string, spi string, direction string) error

func DelMirrorConfig

func DelMirrorConfig(MirrorId int) error

DelMirrorConfig 는 미러링 아웃풋 포트 및 설정을 삭제합니다.

func DelMirrorPortConfig

func DelMirrorPortConfig(MirrorId int, InterfaceName string) error

DelMirrorPortConfig 는 미러링 포트를 삭제합니다.

func DelVlanBridge

func DelVlanBridge(vlan_id int) error

DelVlanBridge은 vlan bridge를 삭제합니다.

func DelVlanMember

func DelVlanMember(vlan_id int, interface_name string, tagging_status string) error

DelVlanMember은 기 생성된 vlan bridge에 port를 삭제합니다.

func DelVxfdbConfig

func DelVxfdbConfig(vxlan_id int, mac_address string, ip_address string) error

DelVxfdbConfig 는 vxlan id를 기반으로 L2FDB 주소를 삭제합니다.

func DelVxlanBridge

func DelVxlanBridge(vxlan_id int) error

DelVxlanBridge는 vxlan을 삭제하는 함수입니다.

func DelVxlanMember

func DelVxlanMember(vxlan_id int, interface_name string, tagging_status string) error

DelVxlanMember는 호스트부분의 vxlan 설정을 삭제하는 함수입니다.

func DelVxlanPeer

func DelVxlanPeer(vxlan_id int, remote_ip string) error

DelVxlanPeer 는 vxlan의 remote ip 주소를 삭제하는 함수입니다.

func FdbExtract

func FdbExtract(raw string) []string

func GetAclConfig

func GetAclConfig() string

GetAclConfig 모든 Nat의 정보를 리턴합니다.

func GetConnection

func GetConnection(url string) (mangos.Socket, error)

func GetConnectionCheck

func GetConnectionCheck(url string) error

func GetConntrackConfig

func GetConntrackConfig() string

GetConntrackConfig는 모든 Conntrack의 정보를 리턴합니다.

func GetFdbConfig

func GetFdbConfig() string

GetFdbConfig 는 모든 L2FDB의 데이터를 리턴합니다.

func GetFdbVlanConfig

func GetFdbVlanConfig(vlan_id string) string

GetFdbVlanConfig 는 vlan에 설정된 L2FDB값을 리턴합니다.

func GetFdbVxlanConfig

func GetFdbVxlanConfig(vxlan_id string) string

GetFdbVxlanConfig 는 Vxlan에 설정된 L2FDB의 값을 리턴합니다.

func GetHealthCheckConfig

func GetHealthCheckConfig() error

GetHealthCheckConfig는 모든 Health 정보를 리턴합니다.

func GetIpNeighborConfig

func GetIpNeighborConfig() string

func GetIpNeighborOneConfig

func GetIpNeighborOneConfig(interface_name string) string

func GetIpRouteConfig

func GetIpRouteConfig() string

func GetIpsecConfig

func GetIpsecConfig() string

func GetMirrorConfig

func GetMirrorConfig() string

func GetRemovedTagPort

func GetRemovedTagPort(portname string) string

func GetRunningConfig

func GetRunningConfig() string

func GetVifConfig

func GetVifConfig() string

func GetVifOneConfig

func GetVifOneConfig(IfName string) string

func GetVlanBriefData

func GetVlanBriefData() string

GetVlanBriefData는 모든 vlan의 정보를 리턴합니다.

func GetVlanIdConfig

func GetVlanIdConfig(vlan_id int) string

GetVlanIdConfig 는 한 개의 vlan의 자세한 정보를 리턴합니다.

func GetVxFdbConfig

func GetVxFdbConfig() string

GetVxFdbConfig 는 VxLAN관련 FDB데이터를 리턴합니다.

func GetVxlanBriefConfig

func GetVxlanBriefConfig() string

GetVxlanBriefConfig 는 설정된 간략한 VxLAN 정보를 리턴합니다.

func GetVxlanIdConfig

func GetVxlanIdConfig(vxlan_id int) string

GetVxlanIdConfig 는 자세한 vxlan 정보를 리턴합니다.

func GetVxlanVtepConfig

func GetVxlanVtepConfig() [][]string

GetVxlanVtepConfig 는 설정된 간략한 vtep 정보를 리턴합니다. 현재는 작동하지 않습니다.

func HexToIPBackString

func HexToIPBackString(hexip string) string

func HexToIPString

func HexToIPString(hexip string) string

func IpaddressInVifExtract

func IpaddressInVifExtract(raw string) []string

func IpaddressInVlanExtract

func IpaddressInVlanExtract(raw string) []string

func IsHexID

func IsHexID(hex_string string) bool

IsHexID 는 "0x"로 시작하는것에 대해서만 검사합니다.

func IsV4

func IsV4(ipstr string) bool

func IsValidIP

func IsValidIP(ipstr string) bool

func IsValidUUID

func IsValidUUID(uuid string) bool

func MakeAclMessage

func MakeAclMessage(acl ACLModel) (matches string, err error)

func MirrorExtract

func MirrorExtract(raw string) []string

func NeighborExtract

func NeighborExtract(raw string) []string

func ParseAclConfig

func ParseAclConfig(res string) [][]string

ParseAclConfig 라인별로 추출이 가능하게 도와줍니다.

func ParseConntrackData

func ParseConntrackData(res string) [][]string

ParseConntrackData은 라인별로 추출이 가능하게 도와줍니다.

func ParseFdbConfig

func ParseFdbConfig(res string) [][]string

func ParseFdbVlanConfig

func ParseFdbVlanConfig(res string) [][]string

func ParseFdbVxlanConfig

func ParseFdbVxlanConfig(res string) [][]string

func ParseIPBothPrefix

func ParseIPBothPrefix(ipprefix string) (ipstr string, length int, err error)

func ParseIpNeighborConfig

func ParseIpNeighborConfig(res string) [][]string

func ParseIpRouteConfig

func ParseIpRouteConfig(res string) [][]string

func ParseMirrorConfig

func ParseMirrorConfig(res string) [][]string

func ParseVlanBridgeData

func ParseVlanBridgeData(res string) [][]string

func ParseVlanIdConfig

func ParseVlanIdConfig(res string) [][]string

func ParseVxFdbConfig

func ParseVxFdbConfig(res string) [][]string

func ParseVxlanBriefConfig

func ParseVxlanBriefConfig(res string) [][]string

func ParseVxlanIdConfig

func ParseVxlanIdConfig(res string) [][]string

func RouteExtract

func RouteExtract(raw string) []string

func RouteOnlyExtract

func RouteOnlyExtract(raw string) []string

func SendMessage

func SendMessage(sock mangos.Socket, txt_msg []byte) string

func ShowAclConfig

func ShowAclConfig()

ShowAclConfig 는 모든 Nat 의 간략한 정보를 CLI 테이블로 변환하여 보여줍니다.

func ShowConntrackConfig

func ShowConntrackConfig()

ShowConntrackConfig 는 모든 Conntrack 의 간략한 정보를 CLI 테이블로 변환하여 보여줍니다.

func ShowFdbConfig

func ShowFdbConfig()

ShowFdbConfig 는 모든 L2FDB의 값을 보여줍니다.

func ShowFdbVlanConfig

func ShowFdbVlanConfig(vlan_id string)

ShowFdbVlanConfig는 vlan에 설정된 L2FDB의 값을 보여줍니다.

func ShowFdbVxlanConfig

func ShowFdbVxlanConfig(vxlan_id string)

ShowFdbVxlanConfig는 vxlan에 설정된 L2FDB의 값을 보여줍니다.

func ShowInterfaceAllCounter

func ShowInterfaceAllCounter()

ShowInterfaceAllCounter는 현재 모든 인터페이스의 통계 카운트를 보여줍니다. 현재는 사용하지 못합니다.

func ShowInterfaceAllStatus

func ShowInterfaceAllStatus()

ShowInterfaceAllStatus 는 현재 모든 인터페이스의 간략한 정보를 보여줍니다. 현재는 사용하지 못합니다.

func ShowInterfaceOneCounter

func ShowInterfaceOneCounter(interface_name string)

ShowInterfaceOneCounter는 한 개의 인터페이스의 통계 카운트를 보여줍니다. 현재는 사용하지 못합니다.

func ShowInterfaceOneStatus

func ShowInterfaceOneStatus(interface_name string)

ShowInterfaceOneStatus 는 한 개의 인터페이스의 간략한 정보를 보여줍니다. 현재는 사용하지 못합니다.

func ShowIpNeighborConfig

func ShowIpNeighborConfig(interface_name string)

ShowIpNeighborConfig 는 모든 neighbor정보 혹은 한개의 인터페이스에 대한 neighbor정보를 호출합니다.

func ShowIpRouteConfig

func ShowIpRouteConfig(interface_name string)

ShowIpRouteConfig 는 모든 routing table을 호출합니다.

func ShowIpsecConfig

func ShowIpsecConfig()

func ShowStartupConfig

func ShowStartupConfig()

func ShowVersion

func ShowVersion()

func ShowVlanBriefConfig

func ShowVlanBriefConfig()

ShowVlanBriefConfig 는 모든 vlan 의 간략한 정보를 보여줍니다.

func ShowVlanIdConfig

func ShowVlanIdConfig(vlan_id int)

ShowVlanIdConfig 는 한 개의 vlan 의 자세한 정보를 보여줍니다.

func ShowVxlanBriefConfig

func ShowVxlanBriefConfig()

ShowVxlanBriefConfig 는 설정된 간략한 vxlan 정보를 보여줍니다.

func ShowVxlanIdConfig

func ShowVxlanIdConfig(vxlan_id int)

ShowVxlanIdConfig 는 자세한 vxlan 정보를 보여줍니다.

func ShowVxlanVtepConfig

func ShowVxlanVtepConfig()

ShowVxlanVtepConfig 는 설정된 간략한 vtep 정보를 보여줍니다. 현재는 작동하지 않습니다.

func ValidateIPBoth

func ValidateIPBoth(ipstr string) (string, bool)

func ValidateIsV4

func ValidateIsV4(ipstr string) (string, bool)

func ValidateVlanID

func ValidateVlanID(vlan_id_str string) (vlanID int, err error)

func ValidateVxlanID

func ValidateVxlanID(vlan_id_str string) (vxlanID int, err error)

func VifExtract

func VifExtract(raw string) []string

func VlanExtract

func VlanExtract(raw string) []string

func VlanPortDetailExtract

func VlanPortDetailExtract(raw string, tagged string) []string

func VlanPortExtract

func VlanPortExtract(raw string) []string

func VxFdbExtract

func VxFdbExtract(raw string) []string

func VxlanExtract

func VxlanExtract(raw string) []string

Types

type ACLFilterModel

type ACLFilterModel struct {
	EthernetType    string `json:"ethernet_type,omitempty"`
	DestinationIp   string `json:"destination_ip,omitempty"`
	SourceIp        string `json:"source_ip,omitempty"`
	DestinationPort int    `json:"destination_port,omitempty"`
	SourcePort      int    `json:"source_port,omitempty"`
	Protocol        int    `json:"protocol,omitempty"`
	Port            int    `json:"port,omitempty"`
}

type ACLModel

type ACLModel struct {
	Filters ACLFilterModel  `json:"filters,omitempty"`
	Actions []ACLValueModel `json:"actions"`
}

type ACLReturnModel

type ACLReturnModel struct {
	UUID      string            `json:"uuid"`
	Table     string            `json:"table_id"`
	Filters   ACLFilterModel    `json:"filters"`
	Actions   []ACLValueModel   `json:"actions"`
	Statistic ACLStatisticModel `json:"statistic"`
}

type ACLReturnModels

type ACLReturnModels struct {
	Attr []ACLReturnModel `json:"attr"`
}

func GetAclModel

func GetAclModel() ACLReturnModels

GetAclModel 는 필터 스트링을 ACL모델로 변경합니다.

type ACLStatisticModel

type ACLStatisticModel struct {
	Packet int `json:"packets"`
	Bytes  int `json:"bytes"`
}

type ACLValueModel

type ACLValueModel struct {
	ActionName string `json:"action_name"`
	IpAddress  string `json:"ip_address,omitempty"`
	Port       int    `json:"port,omitempty"`
	Weight     int    `json:"weight,omitempty"`
}

type ConfigResetStatusModel

type ConfigResetStatusModel struct {
	ResetStatus string `json:"reset_status,omitempty"`
}

type ConntrackModel

type ConntrackModel struct {
	Date            string `json:"date"`
	Time            string `json:"time"`
	DestinationIp   string `json:"destination_ip"`
	SourceIp        string `json:"source_ip"`
	DestinationPort int    `json:"destination_port"`
	SourcePort      int    `json:"source_port"`
	Protocol        string `json:"protocol"`
	Timeout         string `json:"timeout"`
	ExpireTime      string `json:"expire_time"`
	Status          string `json:"status"`
	PacketBtye      int    `json:"byte"`
	PacketCount     int    `json:"count"`
}

type ConntrackReturnModel

type ConntrackReturnModel struct {
	Attr []ConntrackModel `json:"attr"`
}

func GetConntrackModel

func GetConntrackModel() ConntrackReturnModel

type ErrorInner

type ErrorInner struct {
	Code    int      `json:"code"`
	SubCode *int     `json:"sub-code,omitempty"`
	Message string   `json:"message"`
	Fields  []string `json:"fields,omitempty"`
	Details string   `json:"details,omitempty"`
}

type ErrorModel

type ErrorModel struct {
	Error ErrorInner `json:"error"`
}

type EthernetIpaddressModel

type EthernetIpaddressModel struct {
	Ip_addr string `json:"ip_addr"`
	Prefix  int    `json:"prefix"`
}

type EthernetMacModel

type EthernetMacModel struct {
	VlanID int    `json:"vlan_id"`
	Mac    string `json:"mac_addr"`
}

type EthernetNeighborCLIModel

type EthernetNeighborCLIModel struct {
	Vrf       int    `json:"vrf"`
	IpAddress string `json:"ip_addr"`
	SrcMac    string `json:"src_mac_addr"`
	DstMac    string `json:"dst_mac_addr"`
	Interface string `json:"interface"`
	Status    string `json:"status"`
	IsInstall string `json:"is_install"`
}

type EthernetNeighborDeleteModel

type EthernetNeighborDeleteModel struct {
	Ip_addr string `json:"ip_addr"`
}

type EthernetNeighborModel

type EthernetNeighborModel struct {
	Ip_addr string `json:"ip_addr"`
	Mac     string `json:"mac_addr"`
}

type EthernetNeighborReturnModel

type EthernetNeighborReturnModel struct {
	Attr []EthernetNeighborCLIModel `json:"attr"`
}

func GetIpNeighborModel

func GetIpNeighborModel() EthernetNeighborReturnModel

func GetIpNeighborOneModel

func GetIpNeighborOneModel(interface_name string) EthernetNeighborReturnModel

func GetMirrorModel

func GetMirrorModel() EthernetNeighborReturnModel

type HeartbeatReturnModel

type HeartbeatReturnModel struct {
	ServerVersion   string `json:"server_version,omitempty"`
	ResetGUID       string `json:"reset_GUID,omitempty"`
	ResetTime       string `json:"reset_time,omitempty"`
	RoutesAvailable int    `json:"routes_available,omitempty"`
}

type Hls_idl_byte_hdr

type Hls_idl_byte_hdr struct {
	// contains filtered or unexported fields
}

func MakeMessage

func MakeMessage(command uint8, msg string) (Hls_idl_byte_hdr, []byte)

func (Hls_idl_byte_hdr) Byte

func (hdr Hls_idl_byte_hdr) Byte() []byte

type Hls_idl_hdr

type Hls_idl_hdr struct {
	// contains filtered or unexported fields
}

func MakeHeader

func MakeHeader(command uint8, msg string) (Hls_idl_hdr, string)

func (Hls_idl_hdr) String

func (hdr Hls_idl_hdr) String() string

type IProuteCLIModel

type IProuteCLIModel struct {
	IPPrefix   string `json:"ip_prefix"`
	Flags      string `json:"flags,omitempty"`
	Vrf        int    `json:"vrf"`
	Interface  string `json:"interface,omitempty"`
	NextHop    string `json:"next_hop,omitempty"`
	IsInstall  string `json:"is_install"`
	IsHareWare string `json:"hw_install,omitempty"`
}

type IProuteDeleteModel

type IProuteDeleteModel struct {
	Ip_addr string `json:"ip_addr"`
	Prefix  int    `json:"prefix"`
}

type IProuteModel

type IProuteModel struct {
	Ip_addr  string `json:"ip_addr"`
	Prefix   int    `json:"prefix"`
	Next_hop string `json:"next_hop"`
}

type IProuteReturnModel

type IProuteReturnModel struct {
	Attr []IProuteCLIModel `json:"attr"`
}

func GetIPRouteModel

func GetIPRouteModel() IProuteReturnModel

GetIPRouteModel 은 모든 Routing Table을 struct로 제공합니다.

type InterfaceModel

type InterfaceModel struct {
	AdminState string `json:"admin-state"`
}

type InterfaceReturnModel

type InterfaceReturnModel struct {
	Port string         `json:"port"`
	Attr InterfaceModel `json:"attr"`
}

type InvalidFormatError

type InvalidFormatError struct {
	Field   string
	Message string
}

func (*InvalidFormatError) Error

func (e *InvalidFormatError) Error() string

type IpsecDeleteModel

type IpsecDeleteModel struct {
	Source_ip      string `json:"source_ip"`
	Destination_ip string `json:"destination_ip"`
	Protocol       string `json:"protocol"`
	SPI            string `json:"spi"`
	Direction      string `json:"direction"`
}

type IpsecModel

type IpsecModel struct {
	Source_ip      string `json:"source_ip"`
	Destination_ip string `json:"destination_ip"`
	Protocol       string `json:"protocol"`
	SPI            string `json:"spi"`
	Direction      string `json:"direction"`
	Reqid          string `json:"reqid"`
	Security_key   string `json:"security_key"`
	Key_length     int    `json:"key_length"`
	Interface      string `json:"interface"`
}

type LoxilightMgmtReturnModel

type LoxilightMgmtReturnModel struct {
	LoxilightMgmtIp string `json:"loxilight_mgmt_ip"`
}

type MissingValueError

type MissingValueError struct {
	Field string
}

func (*MissingValueError) Error

func (e *MissingValueError) Error() string

type PingRequestModel

type PingRequestModel struct {
	IpAddress string `json:"ip_addr"`
	VnetId    string `json:"vnet_id"`
	Count     string `json:"count"`
}

type PingReturnModel

type PingReturnModel struct {
	PacketsTransmitted string `json:"packets_transmitted"`
	PacketsReceived    string `json:"packets_received"`
	MinRTT             string `json:"min_rtt"`
	MaxRTT             string `json:"max_rtt"`
	AvgRTT             string `json:"avg_rtt"`
}

type RouteModel

type RouteModel struct {
	Cmd         string `json:"cmd,omitempty"`
	IPPrefix    string `json:"ip_prefix"`
	IfName      string `json:"ifname,omitempty"`
	NextHopType string `json:"nexthop_type,omitempty"`
	NextHop     string `json:"nexthop"`
	MACAddress  string `json:"mac_address,omitempty"`
	Vnid        int    `json:"vnid,omitempty"`
	Error_code  int    `json:"error_code,omitempty"`
	Error_msg   string `json:"error_msg,omitempty"`
}

type RouteReturnModel

type RouteReturnModel struct {
	Failed []RouteModel `json:"failed,omitempty"`
}

type TunnelDecapModel

type TunnelDecapModel struct {
	IPAddr string `json:"ip_addr"`
}

type TunnelDecapReturnModel

type TunnelDecapReturnModel struct {
	TunnelType string           `json:"tunnel_type"`
	Attr       TunnelDecapModel `json:"attr"`
}

type VifModel

type VifModel struct {
	IfName   string   `json:"if_name"`
	Mac      string   `json:"mac_addr"`
	Port     int      `json:"port"`
	Flags    int      `json:"flags"`
	Status   string   `json:"status"`
	Rvid     int      `json:"rvid"`
	IPPrefix []string `json:"ip_addr,omitempty"`
}

func GetVifOneModel

func GetVifOneModel(IfName string) VifModel

type VifReturnModel

type VifReturnModel struct {
	Attr []VifModel `json:"attr"`
}

func GetVifModel

func GetVifModel() VifReturnModel

type VlanFDBModel

type VlanFDBModel struct {
	Mac    string `json:"mac_addr"`
	VlanID int    `json:"vxlan_id"`
	Vrf    int    `json:"vrf"`
	Ifname string `json:"if_name"`
	Status string `json:"status"`
}

type VlanFDBReturnModel

type VlanFDBReturnModel struct {
	Attr []VlanFDBModel `json:"attr"`
}

func GetFdbModel

func GetFdbModel() (VlanFDBReturn VlanFDBReturnModel)

GetFdbModel 는 모든 L2FDB의 데이터를 모델 형식으로 리턴합니다.

func GetFdbVlanModel

func GetFdbVlanModel(VlanId string) (VlanFDBReturn VlanFDBReturnModel)

GetFdbVlanModel 는 특정 VLAN의 L2FDB의 데이터를 모델 형식으로 리턴합니다.

type VlanMemberModel

type VlanMemberModel struct {
	Tagging string `json:"tagging_mode"`
}

type VlanMemberReturnModel

type VlanMemberReturnModel struct {
	VlanID  int             `json:"vlan_id"`
	If_name string          `json:"if_name"`
	Attr    VlanMemberModel `json:"attr"`
}

type VlanMembersModel

type VlanMembersModel struct {
	If_name string `json:"if_name"`
	Tagging string `json:"tagging_mode"`
}

type VlanMembersReturnModel

type VlanMembersReturnModel struct {
	VlanID int                `json:"vlan_id"`
	Attr   []VlanMembersModel `json:"attr"`
}

type VlanModel

type VlanModel struct {
	VlanName string             `json:"vlan_name"`
	VlanID   int                `json:"vlan_id"`
	Vrf      int                `json:"vrf"`
	Mac      string             `json:"mac_addr"`
	IPPrefix []string           `json:"ip_addr,omitempty"`
	Member   []VlanMembersModel `json:"member,omitempty"`
}

func GetVlanIdModel

func GetVlanIdModel(vlan_id int) VlanModel

type VlanNeighborReturnModel

type VlanNeighborReturnModel struct {
	VlanID  int    `json:"vlan_id"`
	Ip_addr string `json:"ip_addr"`
}

type VlanNeighborsModel

type VlanNeighborsModel struct {
	Ip_addr string `json:"ip_addr"`
}

type VlanNeighborsReturnModel

type VlanNeighborsReturnModel struct {
	VlanID int                  `json:"vlan_id"`
	Attr   []VlanNeighborsModel `json:"attr"`
}

type VlanReturnModel

type VlanReturnModel struct {
	VlanID int       `json:"vlan_id"`
	Attr   VlanModel `json:"attr"`
}

type VlansPerVnetModel

type VlansPerVnetModel struct {
	VlanID   int    `json:"vlan_id"`
	IPPrefix string `json:"ip_prefix,omitempty"`
}

type VlansPerVnetReturnModel

type VlansPerVnetReturnModel struct {
	Vnet_id string              `json:"vnet_id,omitempty"`
	Attr    []VlansPerVnetModel `json:"attr"`
}

type VlansReturnModel

type VlansReturnModel struct {
	Attr []VlanModel `json:"attr"`
}

func GetVlanIdBriefModel

func GetVlanIdBriefModel() VlansReturnModel

GetVlanIdModel 은 Vlan에 대한 내용을 Model로 정리해서 제공합니다.

type VnetModel

type VnetModel struct {
	Vnid int `json:"vnid"`
}

type VnetReturnModel

type VnetReturnModel struct {
	VnetName string    `json:"vnet_id"`
	Attr     VnetModel `json:"attr"`
}

type VxlanBridgesModel

type VxlanBridgesModel struct {
	Uif_name string `json:"uif"`
	VlanID   *int   `json:"vlan_id,omitempty"`
}

type VxlanFDBModel

type VxlanFDBModel struct {
	Mac     string `json:"mac_addr"`
	VxlanID int    `json:"vxlan_id"`
	Vrf     int    `json:"vrf"`
	DstIP   string `json:"destination_ip"`
	VtepID  string `json:"vtep_id"`
	Status  string `json:"status"`
}

type VxlanFDBReturnModel

type VxlanFDBReturnModel struct {
	Attr []VxlanFDBModel `json:"attr"`
}

func GetFdbVxlanModel

func GetFdbVxlanModel(vxlan_id string) VxlanFDBReturnModel

GetFdbVxlanModel 는 Vxlan에 설정된 L2FDB의 모델을 리턴합니다.

func GetVxFdbModel

func GetVxFdbModel() VxlanFDBReturnModel

GetVxFdbModel 는 VxLAN관련 FDB데이터를 모델 형식으로 리턴합니다.

type VxlanMACModel

type VxlanMACModel struct {
	Mac     string `json:"mac_addr"`
	Ip_addr string `json:"ip_addr"`
}

type VxlanMemberModel

type VxlanMemberModel struct {
	If_name string `json:"if_name"`
	Tagging string `json:"tagging_mode"`
}

type VxlanModel

type VxlanModel struct {
	VxlanName string `json:"vxlan_name"`
	VxlanID   int    `json:"vxlan_id"`
	Vrf       int    `json:"vrf"`
	LocalIP   string `json:"local_ip_addr"`
	Udp       string `json:"udp"`
	Uif       string `json:"uif"`
	Mac       string `json:"mac_addr"`
}

func GetVxlanIdModel

func GetVxlanIdModel(vxlan_id int) VxlanModel

GetVxlanIdConfig 는 1개의 vxlan 정보를 모델로 리턴합니다.

type VxlanPeerModel

type VxlanPeerModel struct {
	PeerIP string `json:"peer_ip"`
}

type VxlanReturnModel

type VxlanReturnModel struct {
	Attr []VxlanModel `json:"attr"`
}

func GetVxlanBriefModel

func GetVxlanBriefModel() VxlanReturnModel

GetVxlanBriefModel 는 설정된 간략한 VxLAN 정보를 모델로 리턴합니다.

Jump to

Keyboard shortcuts

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