Documentation ¶
Index ¶
- Constants
- Variables
- func GetIPAddr(ifname string) (string, error)
- func InitializePublisher(NewAsyncProducer func([]string, *sarama.Config) (sarama.AsyncProducer, error), ...) error
- func KafkaPublisher(eventChannel chan Event)
- func OnuSnToString(sn *openolt.SerialNumber) string
- func SetLogLevel(logger *log.Logger, level string, caller bool)
- type BBRCliOptions
- type BBRConfig
- type BBSimConfig
- type BBSimYamlConfig
- type Event
- type OltConfig
- type SadisFormat
- type TagAllocation
Constants ¶
View Source
const OltNniLos = "OLT_NNI_LOS"
View Source
const OltPonLos = "OLT_PON_LOS"
Variables ¶
View Source
var OLTAlarms = map[string]bbsim.AlarmType_Types{ OltNniLos: bbsim.AlarmType_LOS, OltPonLos: bbsim.AlarmType_LOS, }
View Source
var ONUAlarms = make(map[string]bbsim.AlarmType_Types)
Functions ¶
func GetIPAddr ¶ added in v0.0.9
GetIPAddr returns the IPv4 address of an interface. 0.0.0.0 is returned if the IP cannot be determined.
func InitializePublisher ¶ added in v0.0.18
func InitializePublisher(NewAsyncProducer func([]string, *sarama.Config) (sarama.AsyncProducer, error), oltID int) error
InitializePublisher initalizes kafka publisher
func KafkaPublisher ¶ added in v0.0.18
func KafkaPublisher(eventChannel chan Event)
KafkaPublisher receives messages on eventChannel and publish them to kafka
func OnuSnToString ¶
func OnuSnToString(sn *openolt.SerialNumber) string
Types ¶
type BBRCliOptions ¶
type BBRCliOptions struct { *BBSimYamlConfig BBSimIp string BBSimPort string BBSimApiPort string LogFile string }
func GetBBROpts ¶
func GetBBROpts() BBRCliOptions
type BBSimConfig ¶ added in v0.0.8
type BBSimConfig struct { DhcpRetry bool `yaml:"dhcp_retry"` AuthRetry bool `yaml:"auth_retry"` EnableIgmp bool `yaml:"enable_igmp"` EnableDhcp bool `yaml:"enable_dhcp"` EnableAuth bool `yaml:"enable_auth"` LogLevel string `yaml:"log_level"` LogCaller bool `yaml:"log_caller"` Delay int `yaml:"delay"` CpuProfile *string `yaml:"cpu_profile"` CTagAllocation TagAllocation `yaml:"c_tag_allocation"` CTag int `yaml:"c_tag"` STagAllocation TagAllocation `yaml:"s_tag_allocation"` STag int `yaml:"s_tag"` OpenOltAddress string `yaml:"openolt_address"` ApiAddress string `yaml:"api_address"` RestApiAddress string `yaml:"rest_api_address"` LegacyApiAddress string `yaml:"legacy_api_address"` LegacyRestApiAddress string `yaml:"legacy_rest_api_address"` SadisRestAddress string `yaml:"sadis_rest_address"` SadisServer bool `yaml:"sadis_server"` SadisFormat SadisFormat `yaml:"sadis_format"` KafkaAddress string `yaml:"kafka_address"` Events bool `yaml:"enable_events"` ControlledActivation string `yaml:"controlled_activation"` EnablePerf bool `yaml:"enable_perf"` KafkaEventTopic string `yaml:"kafka_event_topic` }
type BBSimYamlConfig ¶ added in v0.0.8
type BBSimYamlConfig struct { BBSim BBSimConfig Olt OltConfig BBR BBRConfig }
var Options *BBSimYamlConfig
func GetBBSimOpts ¶
func GetBBSimOpts() *BBSimYamlConfig
GetBBSimOpts loads the BBSim configuration file and over-rides options with corresponding CLI flags if set
func LoadBBSimConf ¶ added in v0.0.8
func LoadBBSimConf(filename string) (*BBSimYamlConfig, error)
LoadBBSimConf loads the BBSim configuration from a YAML file
type Event ¶ added in v0.0.18
type Event struct { EventType string OnuSerial string OltID int IntfID int32 OnuID int32 EpochTime int64 Timestamp string }
Event defines structure for bbsim events
type OltConfig ¶ added in v0.0.8
type OltConfig struct { Model string `yaml:"model"` Vendor string `yaml:"vendor"` HardwareVersion string `yaml:"hardware_version"` FirmwareVersion string `yaml:"firmware_version"` DeviceId string `yaml:"device_id"` DeviceSerialNumber string `yaml:"device_serial_number"` PonPorts uint32 `yaml:"pon_ports"` NniPorts uint32 `yaml:"nni_ports"` OnusPonPort uint32 `yaml:"onus_per_port"` Technology string `yaml:"technology"` ID int `yaml:"id"` OltRebootDelay int `yaml:"reboot_delay"` PortStatsInterval int `yaml: "port_stats_interval"` }
type SadisFormat ¶ added in v0.2.0
type SadisFormat int
const ( SadisFormatAtt SadisFormat SadisFormatDt SadisFormatTt )
func (SadisFormat) String ¶ added in v0.2.0
func (s SadisFormat) String() string
type TagAllocation ¶ added in v0.2.0
type TagAllocation int
const ( TagAllocationUnique )
func (TagAllocation) String ¶ added in v0.2.0
func (t TagAllocation) String() string
Click to show internal directories.
Click to hide internal directories.