commonLib

package module
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: MIT Imports: 13 Imported by: 0

README

About

NetLOX에서 사용하는 소프트웨어의 제어를 위한 공용 라이브러리 입니다.

Author

NETLOX inho

License

This software is licensed under the MIT license, see LICENSE for more information.

Documentation

Overview

package commonLib

nanomsg를 통해 LOXILIGHT코어에 API를 날리는 함수를 모아놓은 패키지입니다.

헬리오스가 로컬에 켜져있을때 사용해야 작동이 됩니다. 디폴트 서버 주소가 127.0.0.1입니다.

만약 켰는데 안되면 ifconfig lo 를 확인해서 up인지 아닌지 확인 해보세요.

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_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 Controller_ip string = "tcp://127.0.0.1:8861"

LOXILIGHT Controller 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{"Host-IP", "Flags", "VRF", "NextHop", "Is Install", "HW Install", "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 added in v1.1.3

func AclExtract(raw string) []string

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

func AddAclConfig added in v1.1.3

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 added in v1.1.27

func AddMirrorPortConfig(MirrorId int, InterfaceName string) error

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

func AddMirrorRspanConfig added in v1.1.27

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

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

func AddMirrorSpanConfig added in v1.1.27

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 added in v1.0.11

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

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

func AddVxlanBridgeWithoutVlanID added in v1.0.11

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 ChangeControllerIp added in v1.1.7

func ChangeControllerIp(url string)

func ChangeHexIpToDec added in v1.1.10

func ChangeHexIpToDec(hexip string) string

func CloseConnection

func CloseConnection(sock mangos.Socket)

func ConntrackDetailExtract added in v1.1.10

func ConntrackDetailExtract(raw string) []string

func ConntrackExtract added in v1.1.0

func ConntrackExtract(raw string) []string

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

func ConntrackStatExtract added in v1.1.13

func ConntrackStatExtract(raw string) []string

func DelAclConfig added in v1.1.3

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) error

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

func DelIpsecConfig

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

func DelMirrorConfig added in v1.1.27

func DelMirrorConfig(MirrorId int) error

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

func DelMirrorPortConfig added in v1.1.27

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 added in v1.1.3

func GetAclConfig() (string, error)

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

func GetConnection

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

func GetConnectionCheck added in v1.1.6

func GetConnectionCheck(url string) error

func GetConntrackConfig added in v1.1.0

func GetConntrackConfig() (string, error)

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

func GetFdbConfig

func GetFdbConfig() (string, error)

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

func GetFdbVlanConfig

func GetFdbVlanConfig(vlan_id int) (string, error)

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

func GetFdbVxlanConfig

func GetFdbVxlanConfig(vxlan_id int) (string, error)

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

func GetIpNeighborConfig added in v1.0.1

func GetIpNeighborConfig() (string, error)

func GetIpNeighborOneConfig added in v1.0.10

func GetIpNeighborOneConfig(interface_name string) (string, error)

func GetIpRouteConfig added in v1.0.1

func GetIpRouteConfig() (string, error)

func GetIpsecConfig added in v1.0.1

func GetIpsecConfig() (string, error)

func GetMirrorConfig added in v1.1.27

func GetMirrorConfig() (string, error)

func GetRemovedTagPort

func GetRemovedTagPort(portname string) string

func GetRunningConfig added in v1.0.1

func GetRunningConfig() (string, error)

func GetVifConfig added in v1.1.27

func GetVifConfig() (string, error)

func GetVifOneConfig added in v1.1.27

func GetVifOneConfig(IfName string) (string, error)

func GetVlanBriefData

func GetVlanBriefData() (string, error)

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

func GetVlanIdConfig

func GetVlanIdConfig(vlan_id int) (string, error)

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

func GetVxFdbConfig

func GetVxFdbConfig() (string, error)

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

func GetVxlanBriefConfig

func GetVxlanBriefConfig() (string, error)

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

func GetVxlanIdConfig

func GetVxlanIdConfig(vxlan_id int) (string, error)

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

func IpaddressInVifExtract added in v1.1.27

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 added in v1.1.11

func IsValidUUID(uuid string) bool

func MakeAclMessage added in v1.1.3

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

func MirrorExtract added in v1.1.27

func MirrorExtract(raw string) []string

func NeighborExtract added in v1.0.10

func NeighborExtract(raw string) []string

func OldSendMessage added in v1.3.0

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

OldSendMessage 는 req로 nanomsg를 전송 했을 경우입니다.

func ParseAclConfig added in v1.1.3

func ParseAclConfig(res string) [][]string

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

func ParseConntrackData added in v1.1.0

func ParseConntrackData(res string) [][]string

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

func ParseFdbConfig added in v1.0.1

func ParseFdbConfig(res string) [][]string

func ParseFdbVlanConfig added in v1.0.4

func ParseFdbVlanConfig(res string) [][]string

func ParseFdbVxlanConfig added in v1.0.4

func ParseFdbVxlanConfig(res string) [][]string

func ParseIPBothPrefix

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

func ParseIpNeighborConfig added in v1.0.10

func ParseIpNeighborConfig(res string) [][]string

func ParseIpRouteConfig added in v1.0.10

func ParseIpRouteConfig(res string) [][]string

func ParseMirrorConfig added in v1.1.27

func ParseMirrorConfig(res string) [][]string

func ParseVlanBridgeData added in v1.0.1

func ParseVlanBridgeData(res string) [][]string

func ParseVlanIdConfig added in v1.0.4

func ParseVlanIdConfig(res string) [][]string

func ParseVxFdbConfig added in v1.0.1

func ParseVxFdbConfig(res string) [][]string

func ParseVxlanBriefConfig added in v1.1.0

func ParseVxlanBriefConfig(res string) [][]string

func ParseVxlanIdConfig added in v1.0.2

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 added in v1.1.3

func ShowAclConfig()

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

func ShowConntrackConfig added in v1.1.0

func ShowConntrackConfig()

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

func ShowFdbConfig

func ShowFdbConfig()

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

func ShowFdbVlanConfig

func ShowFdbVlanConfig(vlan_id int)

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

func ShowFdbVxlanConfig

func ShowFdbVxlanConfig(vxlan_id int)

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 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 added in v1.1.27

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 added in v1.1.10

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 added in v1.1.0

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

type ACLReturnModel added in v1.1.0

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 added in v1.1.7

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

func GetAclModel added in v1.1.10

func GetAclModel() (ACLReturnModels, error)

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

type ACLStatisticModel added in v1.1.0

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

type ACLValueModel added in v1.1.7

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 added in v1.1.0

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

type ConntrackModel added in v1.1.10

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 added in v1.1.10

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

func GetConntrackModel added in v1.1.10

func GetConntrackModel() (ConntrackReturnModel, error)

type ControllerReturnModel added in v1.1.0

type ControllerReturnModel struct {
	Controller_ip string `json:"controller_ip"`
}

type ErrorInner added in v1.1.0

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 added in v1.1.0

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

type EthernetIpaddressModel added in v1.1.0

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

type EthernetMacModel added in v1.1.0

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

type EthernetNeighborCLIModel added in v1.1.0

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 added in v1.1.0

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

type EthernetNeighborModel added in v1.1.0

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

type EthernetNeighborReturnModel added in v1.1.0

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

func GetIpNeighborModel added in v1.1.0

func GetIpNeighborModel() (EthernetNeighborReturnModel, error)

func GetIpNeighborOneModel added in v1.1.0

func GetIpNeighborOneModel(interface_name string) (EthernetNeighborReturnModel, error)

func GetMirrorModel added in v1.1.27

func GetMirrorModel() EthernetNeighborReturnModel

TODO:

type HeartbeatReturnModel added in v1.1.0

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 added in v1.1.0

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"`
}

type IProuteDeleteModel added in v1.1.0

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

type IProuteModel added in v1.1.0

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

type IProuteReturnModel added in v1.1.0

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

func GetIPRouteModel added in v1.1.0

func GetIPRouteModel() (IProuteReturnModel, error)

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

type InterfaceModel added in v1.1.0

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

type InterfaceReturnModel added in v1.1.0

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

type InvalidFormatError added in v1.1.0

type InvalidFormatError struct {
	Field   string
	Message string
}

func (*InvalidFormatError) Error added in v1.1.0

func (e *InvalidFormatError) Error() string

type IpsecDeleteModel added in v1.1.0

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 added in v1.1.0

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 MissingValueError added in v1.1.0

type MissingValueError struct {
	Field string
}

func (*MissingValueError) Error added in v1.1.0

func (e *MissingValueError) Error() string

type PingRequestModel added in v1.1.0

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

type PingReturnModel added in v1.1.0

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 added in v1.1.0

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 added in v1.1.0

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

type TunnelDecapModel added in v1.1.0

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

type TunnelDecapReturnModel added in v1.1.0

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

type VifModel added in v1.1.27

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 added in v1.1.27

func GetVifOneModel(IfName string) (VifModel, error)

type VifReturnModel added in v1.1.27

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

func GetVifModel added in v1.1.27

func GetVifModel() (VifReturnModel, error)

type VlanFDBModel added in v1.1.0

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 added in v1.1.0

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

func GetFdbModel added in v1.1.0

func GetFdbModel() (VlanFDBReturn VlanFDBReturnModel, err error)

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

func GetFdbVlanModel added in v1.1.39

func GetFdbVlanModel(VlanId int) (VlanFDBReturn VlanFDBReturnModel, err error)

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

type VlanMemberModel added in v1.1.0

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

type VlanMemberReturnModel added in v1.1.0

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

type VlanMembersModel added in v1.1.0

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

type VlanMembersReturnModel added in v1.1.0

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

type VlanModel added in v1.1.0

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 added in v1.1.0

func GetVlanIdModel(vlan_id int) (VlanModel, error)

type VlanNeighborReturnModel added in v1.1.0

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

type VlanNeighborsModel added in v1.1.0

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

type VlanNeighborsReturnModel added in v1.1.0

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

type VlanReturnModel added in v1.1.0

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

type VlansPerVnetModel added in v1.1.0

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

type VlansPerVnetReturnModel added in v1.1.0

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

type VlansReturnModel added in v1.1.0

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

func GetVlanIdBriefModel added in v1.1.0

func GetVlanIdBriefModel() (VlansReturnModel, error)

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

type VnetModel added in v1.1.0

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

type VnetReturnModel added in v1.1.0

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

type VxlanBridgesModel added in v1.1.0

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

type VxlanFDBModel added in v1.1.0

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 added in v1.1.0

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

func GetFdbVxlanModel added in v1.1.39

func GetFdbVxlanModel(vxlan_id int) (VxlanFDBReturnModel, error)

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

func GetVxFdbModel added in v1.1.0

func GetVxFdbModel() (VxlanFDBReturnModel, error)

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

type VxlanMACModel added in v1.1.0

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

type VxlanMemberModel added in v1.1.0

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

type VxlanModel added in v1.1.0

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 added in v1.1.0

func GetVxlanIdModel(vxlan_id int) (VxlanModel, error)

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

type VxlanPeerModel added in v1.1.0

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

type VxlanReturnModel added in v1.1.0

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

func GetVxlanBriefModel added in v1.1.0

func GetVxlanBriefModel() (VxlanReturnModel, error)

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

Jump to

Keyboard shortcuts

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