sonic

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VLAN_TABLE        = "VLAN"
	VLAN_MEMBER_TABLE = "VLAN_MEMBER"
	PORT_TABLE        = "PORT_TABLE"
)
View Source
const (
	APPL_DB = iota
	ASIC_DB
	COUNTERS_DB
	CONFIG_DB                 = 4
	TRANSPORT_CONFIG_DB       = 7
	TRANSPORT_STATE_DB        = 8
	TRANSPORT_NOTIFICATION    = "TRANSPORT_NOTIFICATION"
	DEFAULT_REDIS_UNIX_SOCKET = "/var/run/redis/redis.sock"
)
View Source
const (
	CONFIG_TABLE      = "MODULE_CONFIG_TABLE"
	STATE_TABLE       = "MODULE_STATE_TABLE"
	MAPPING_TABLE     = "MODULE_MAPPING"
	NETIF_STATE_TABLE = "NETIF_STATE_TABLE"
)

Variables

This section is empty.

Functions

func ConfigureTransport

func ConfigureTransport(m *model.PacketTransponder) error

func FillInterfaceState

func FillInterfaceState(name string, t *model.PacketTransponder_Interface) error

func FillTransportDefaultConfig added in v0.7.0

func FillTransportDefaultConfig(t *model.PacketTransponder_OpticalModule, current *model.PacketTransponder) error

func FillTransportState

func FillTransportState(name string, t *model.PacketTransponder_OpticalModule) error

func HandleInterfaceDiff

func HandleInterfaceDiff(newConfig, oldConfig *model.PacketTransponder, name string, task []DiffTask) error

func HandleOptDiff

func HandleOptDiff(name string, task []DiffTask) error

func HandlePortDiff

func HandlePortDiff(name string, task []DiffTask) (bool, error)

Types

type DiffTask

type DiffTask struct {
	Type  DiffType
	Path  PathElems
	Value *gnmipb.TypedValue
}

type DiffType

type DiffType int
const (
	DiffAdded DiffType = iota
	DiffDeleted
	DiffModified
)

type PathElems added in v0.5.0

type PathElems []*gnmipb.PathElem

func (PathElems) String added in v0.5.0

func (m PathElems) String() string

type SONiCDBClient

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

func NewSONiCDBClient

func NewSONiCDBClient(network string, addr string, db int) (*SONiCDBClient, error)

func (*SONiCDBClient) GetEntry

func (c *SONiCDBClient) GetEntry(table string, keys ...string) (map[string]interface{}, error)

func (*SONiCDBClient) GetTable

func (c *SONiCDBClient) GetTable(table string) (map[string]map[string]interface{}, error)

func (*SONiCDBClient) ModEntry

func (c *SONiCDBClient) ModEntry(table, key string, entry map[string]interface{}) error

func (*SONiCDBClient) SendNotification

func (c *SONiCDBClient) SendNotification(channel, op, data string, message []interface{}) (int, error)

func (*SONiCDBClient) SetEntry

func (c *SONiCDBClient) SetEntry(table, key string, entry map[string]interface{}) error

Jump to

Keyboard shortcuts

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