Documentation
¶
Index ¶
- Constants
- Variables
- func GetYangPath() string
- type AclApp
- type ActionRequest
- type ActionResponse
- type BulkRequest
- type BulkResponse
- type CommonApp
- type ErrSource
- type GetRequest
- type GetResponse
- type IsSubscribeRequest
- type IsSubscribeResponse
- type JSONEeprom
- type ModelData
- type NotificationType
- type PathInfo
- type PlatformApp
- type SetRequest
- type SetResponse
- type StpApp
- type SubscribeRequest
- type SubscribeResponse
- type UserRoles
Constants ¶
const ( TABLE_SEPARATOR = "|" KEY_SEPARATOR = "|" ACL_TABLE = "ACL_TABLE" RULE_TABLE = "ACL_RULE" ACL_COUNTERS = "ACL_COUNTERS" ACL_TYPE = "type" ACL_DESCRIPTION = "policy_desc" SONIC_ACL_TYPE_L2 = "L2" SONIC_ACL_TYPE_IPV4 = "L3" SONIC_ACL_TYPE_IPV6 = "L3V6" OPENCONFIG_ACL_TYPE_IPV4 = "ACL_IPV4" OPENCONFIG_ACL_TYPE_IPV6 = "ACL_IPV6" OPENCONFIG_ACL_TYPE_L2 = "ACL_L2" OC_ACL_APP_MODULE_NAME = "/openconfig-acl:acl" OC_ACL_YANG_PATH_PREFIX = "/device/acl" MIN_PRIORITY = 1 MAX_PRIORITY = 65536 )
const ( LLDP_REMOTE_CAP_ENABLED = "lldp_rem_sys_cap_enabled" LLDP_REMOTE_SYS_NAME = "lldp_rem_sys_name" LLDP_REMOTE_PORT_DESC = "lldp_rem_port_desc" LLDP_REMOTE_CHASS_ID = "lldp_rem_chassis_id" LLDP_REMOTE_CAP_SUPPORTED = "lldp_rem_sys_cap_supported" LLDP_REMOTE_PORT_ID_SUBTYPE = "lldp_rem_port_id_subtype" LLDP_REMOTE_SYS_DESC = "lldp_rem_sys_desc" LLDP_REMOTE_REM_TIME = "lldp_rem_time_mark" LLDP_REMOTE_PORT_ID = "lldp_rem_port_id" LLDP_REMOTE_REM_ID = "lldp_rem_index" LLDP_REMOTE_CHASS_ID_SUBTYPE = "lldp_rem_chassis_id_subtype" LLDP_REMOTE_MAN_ADDR = "lldp_rem_man_addr" )
const ( GET = 1 + iota CREATE REPLACE UPDATE DELETE )
const ( STP_GLOBAL_TABLE = "STP" STP_VLAN_TABLE = "STP_VLAN" STP_VLAN_PORT_TABLE = "STP_VLAN_PORT" STP_PORT_TABLE = "STP_PORT" STP_VLAN_OPER_TABLE = "_STP_VLAN_TABLE" STP_VLAN_PORT_OPER_TABLE = "_STP_VLAN_PORT_TABLE" STP_PORT_OPER_TABLE = "_STP_PORT_TABLE" STP_MODE = "mode" OC_STP_APP_MODULE_NAME = "/openconfig-spanning-tree:stp" OC_STP_YANG_PATH_PREFIX = "/device/stp" PVST_MAX_INSTANCES = 255 STP_DEFAULT_ROOT_GUARD_TIMEOUT = "30" STP_DEFAULT_FORWARD_DELAY = "15" STP_DEFAULT_HELLO_INTERVAL = "2" STP_DEFAULT_MAX_AGE = "20" STP_DEFAULT_BRIDGE_PRIORITY = "32768" STP_DEFAULT_BPDU_FILTER = "false" )
Variables ¶
var ETHERTYPE_MAP = map[ocbinds.E_OpenconfigPacketMatchTypes_ETHERTYPE]uint32{ ocbinds.OpenconfigPacketMatchTypes_ETHERTYPE_ETHERTYPE_LLDP: 0x88CC, ocbinds.OpenconfigPacketMatchTypes_ETHERTYPE_ETHERTYPE_VLAN: 0x8100, ocbinds.OpenconfigPacketMatchTypes_ETHERTYPE_ETHERTYPE_ROCE: 0x8915, ocbinds.OpenconfigPacketMatchTypes_ETHERTYPE_ETHERTYPE_ARP: 0x0806, ocbinds.OpenconfigPacketMatchTypes_ETHERTYPE_ETHERTYPE_IPV4: 0x0800, ocbinds.OpenconfigPacketMatchTypes_ETHERTYPE_ETHERTYPE_IPV6: 0x86DD, ocbinds.OpenconfigPacketMatchTypes_ETHERTYPE_ETHERTYPE_MPLS: 0x8847, }
var IP_PROTOCOL_MAP = map[ocbinds.E_OpenconfigPacketMatchTypes_IP_PROTOCOL]uint8{ ocbinds.OpenconfigPacketMatchTypes_IP_PROTOCOL_IP_ICMP: 1, ocbinds.OpenconfigPacketMatchTypes_IP_PROTOCOL_IP_IGMP: 2, ocbinds.OpenconfigPacketMatchTypes_IP_PROTOCOL_IP_TCP: 6, ocbinds.OpenconfigPacketMatchTypes_IP_PROTOCOL_IP_UDP: 17, ocbinds.OpenconfigPacketMatchTypes_IP_PROTOCOL_IP_RSVP: 46, ocbinds.OpenconfigPacketMatchTypes_IP_PROTOCOL_IP_GRE: 47, ocbinds.OpenconfigPacketMatchTypes_IP_PROTOCOL_IP_AUTH: 51, ocbinds.OpenconfigPacketMatchTypes_IP_PROTOCOL_IP_PIM: 103, ocbinds.OpenconfigPacketMatchTypes_IP_PROTOCOL_IP_L2TP: 115, }
Functions ¶
func GetYangPath ¶
func GetYangPath() string
GetYangPath returns directory containing yang files. Use transformer.YangPath for now.
Types ¶
type ActionRequest ¶
type ActionResponse ¶
func Action ¶
func Action(req ActionRequest) (ActionResponse, error)
type BulkRequest ¶
type BulkRequest struct { DeleteRequest []SetRequest ReplaceRequest []SetRequest UpdateRequest []SetRequest CreateRequest []SetRequest User UserRoles AuthEnabled bool }
type BulkResponse ¶
type BulkResponse struct { DeleteResponse []SetResponse ReplaceResponse []SetResponse UpdateResponse []SetResponse CreateResponse []SetResponse }
func Bulk ¶
func Bulk(req BulkRequest) (BulkResponse, error)
type GetRequest ¶
type GetResponse ¶
func Get ¶
func Get(req GetRequest) (GetResponse, error)
Gets data from the redis DB and converts it to northbound format
type IsSubscribeRequest ¶
type IsSubscribeResponse ¶
type IsSubscribeResponse struct { Path string IsOnChangeSupported bool MinInterval int Err error PreferredType NotificationType }
func IsSubscribeSupported ¶
func IsSubscribeSupported(req IsSubscribeRequest) ([]*IsSubscribeResponse, error)
Check if subscribe is supported on the given paths
func Subscribe ¶
func Subscribe(req SubscribeRequest) ([]*IsSubscribeResponse, error)
Subscribes to the paths requested and sends notifications when the data changes in DB
type JSONEeprom ¶
type JSONEeprom struct { Product_Name string `json:"Product Name"` Part_Number string `json:"Part Number"` Serial_Number string `json:"Serial Number"` Base_MAC_Address string `json:"Base MAC Address"` Manufacture_Date string `json:"Manufacture Date"` Device_Version string `json:"Device Version"` Label_Revision string `json:"Label Revision"` Platform_Name string `json:"Platform Name"` ONIE_Version string `json:"ONIE Version"` MAC_Addresses int `json:"MAC Addresses"` Manufacturer string `json:"Manufacturer"` Manufacture_Country string `json:"Manufacture Country"` Vendor_Name string `json:"Vendor Name"` Diag_Version string `json:"Diag Version"` Service_Tag string `json:"Service Tag"` Vendor_Extension string `json:"Vendor Extension"` Magic_Number int `json:"Magic Number"` Card_Type string `json:"Card Type"` Hardware_Version string `json:"Hardware Version"` Software_Version string `json:"Software Version"` Model_Name string `json:"Model Name"` }
* Structures to read syseeprom from json file
type PathInfo ¶
PathInfo structure contains parsed path information.
func NewPathInfo ¶
NewPathInfo parses given path string into a PathInfo structure.
func (*PathInfo) HasPrefix ¶
HasPrefix checks if this path template starts with given prefix.. Shorthand for strings.HasPrefix(p.Template, s)
func (*PathInfo) HasSuffix ¶
HasSuffix checks if this path template ends with given suffix.. Shorthand for strings.HasSuffix(p.Template, s)
type PlatformApp ¶
type PlatformApp struct {
// contains filtered or unexported fields
}
type SetRequest ¶
type SetResponse ¶
func Create ¶
func Create(req SetRequest) (SetResponse, error)
Creates entries in the redis DB pertaining to the path and payload
func Delete ¶
func Delete(req SetRequest) (SetResponse, error)
Deletes entries in the redis DB pertaining to the path
func Replace ¶
func Replace(req SetRequest) (SetResponse, error)
Replaces entries in the redis DB pertaining to the path and payload
func Update ¶
func Update(req SetRequest) (SetResponse, error)
Updates entries in the redis DB pertaining to the path and payload
type SubscribeRequest ¶
type SubscribeRequest struct { Paths []string Q *queue.PriorityQueue Stop chan struct{} User UserRoles AuthEnabled bool }