Documentation ¶
Index ¶
- Constants
- Variables
- func HexDecode(pkt []byte) []byte
- func InterfaceIDToPortNo(intfID uint32, intfType string) uint32
- type DefaultExecutor
- type Executor
- type FlowAddSpy
- type FlowKey
- type Message
- type MessageType
- type NniIndicationMessage
- type NniPort
- type OltDevice
- func (o *OltDevice) ActivateOnu(context context.Context, onu *openolt.Onu) (*openolt.Empty, error)
- func (o *OltDevice) CollectStatistics(context.Context, *openolt.Empty) (*openolt.Empty, error)
- func (s *OltDevice) CreateTrafficQueues(context.Context, *tech_profile.TrafficQueues) (*openolt.Empty, error)
- func (s *OltDevice) CreateTrafficSchedulers(context context.Context, trafficSchedulers *tech_profile.TrafficSchedulers) (*openolt.Empty, error)
- func (o *OltDevice) DeactivateOnu(context.Context, *openolt.Onu) (*openolt.Empty, error)
- func (o *OltDevice) DeleteGroup(ctx context.Context, group *openolt.Group) (*openolt.Empty, error)
- func (o *OltDevice) DeleteOnu(_ context.Context, onu *openolt.Onu) (*openolt.Empty, error)
- func (o *OltDevice) DisableOlt(context.Context, *openolt.Empty) (*openolt.Empty, error)
- func (o *OltDevice) DisablePonIf(_ context.Context, intf *openolt.Interface) (*openolt.Empty, error)
- func (o *OltDevice) Enable(stream openolt.Openolt_EnableIndicationServer)
- func (o *OltDevice) EnableIndication(_ *openolt.Empty, stream openolt.Openolt_EnableIndicationServer) error
- func (o *OltDevice) EnablePonIf(_ context.Context, intf *openolt.Interface) (*openolt.Empty, error)
- func (o *OltDevice) FindOnuById(intfId uint32, onuId uint32) (*Onu, error)
- func (o *OltDevice) FindOnuBySn(serialNumber string) (*Onu, error)
- func (o *OltDevice) FindServiceByMacAddress(mac net.HardwareAddr) (ServiceIf, error)
- func (o *OltDevice) FlowAdd(ctx context.Context, flow *openolt.Flow) (*openolt.Empty, error)
- func (o *OltDevice) FlowRemove(_ context.Context, flow *openolt.Flow) (*openolt.Empty, error)
- func (o *OltDevice) GetDeviceInfo(context.Context, *openolt.Empty) (*openolt.DeviceInfo, error)
- func (o *OltDevice) GetExtValue(ctx context.Context, in *openolt.ValueParam) (*common_protos.ReturnValues, error)
- func (o *OltDevice) GetLogicalOnuDistance(ctx context.Context, in *openolt.Onu) (*openolt.OnuLogicalDistance, error)
- func (o *OltDevice) GetLogicalOnuDistanceZero(ctx context.Context, in *openolt.Onu) (*openolt.OnuLogicalDistance, error)
- func (o *OltDevice) GetOnuByFlowId(flowId uint32) (*Onu, error)
- func (o *OltDevice) GetOnuInfo(context context.Context, packet *openolt.Onu) (*openolt.OnuIndication, error)
- func (o *OltDevice) GetPonById(id uint32) (*PonPort, error)
- func (o *OltDevice) GetPonIf(context context.Context, packet *openolt.Interface) (*openolt.IntfIndication, error)
- func (o *OltDevice) HeartbeatCheck(context.Context, *openolt.Empty) (*openolt.Heartbeat, error)
- func (o *OltDevice) InitOlt()
- func (o *OltDevice) OmciMsgOut(ctx context.Context, omci_msg *openolt.OmciMsg) (*openolt.Empty, error)
- func (o *OltDevice) OnuItuPonAlarmSet(ctx context.Context, in *config.OnuItuPonAlarm) (*openolt.Empty, error)
- func (o *OltDevice) OnuPacketOut(ctx context.Context, onuPkt *openolt.OnuPacket) (*openolt.Empty, error)
- func (o *OltDevice) PerformGroupOperation(ctx context.Context, group *openolt.Group) (*openolt.Empty, error)
- func (o *OltDevice) Reboot(context.Context, *openolt.Empty) (*openolt.Empty, error)
- func (o *OltDevice) ReenableOlt(context.Context, *openolt.Empty) (*openolt.Empty, error)
- func (s *OltDevice) RemoveTrafficQueues(context.Context, *tech_profile.TrafficQueues) (*openolt.Empty, error)
- func (s *OltDevice) RemoveTrafficSchedulers(context context.Context, trafficSchedulers *tech_profile.TrafficSchedulers) (*openolt.Empty, error)
- func (o *OltDevice) RestartOLT() error
- func (o *OltDevice) SendAlarmIndication(context context.Context, ind *openolt.AlarmIndication) error
- func (o *OltDevice) StopOltServer() error
- func (o *OltDevice) UplinkPacketOut(context context.Context, packet *openolt.UplinkPacket) (*openolt.Empty, error)
- type OltIndicationMessage
- type OmciIndicationMessage
- type OmciMessage
- type Onu
- func (onu *Onu) DeleteFlow(key FlowKey)
- func (o Onu) NewSN(oltid int, intfid uint32, onuid uint32) *openolt.SerialNumber
- func (o *Onu) ProcessOnuMessages(ctx context.Context, stream openolt.Openolt_EnableIndicationServer, ...)
- func (onu *Onu) ReDiscoverOnu()
- func (o *Onu) SetID(id uint32)
- func (o *Onu) Sn() string
- func (o *Onu) StartOmci(client openolt.OpenoltClient)
- type OnuDiscIndicationMessage
- type OnuFlowUpdateMessage
- type OnuIndicationMessage
- type OnuPacketMessage
- type OperState
- type PacketMessage
- type PonIndicationMessage
- type PonPort
- type Runnable
- type Service
- type ServiceIf
Constants ¶
const ( Default mode = iota OnlyONU OnlyPON Both )
Constants for Controlled Activation modes
Variables ¶
var ControlledActivationModes = map[string]mode{ "default": Default, "only-onu": OnlyONU, "only-pon": OnlyPON, "both": Both, }
ControlledActivationModes maps string to int value of mode
Functions ¶
func InterfaceIDToPortNo ¶ added in v0.0.19
InterfaceIDToPortNo converts InterfaceID to voltha PortID Refer openolt adapter code(master) voltha-openolt-adapter/adaptercore/olt_platform.go: IntfIDToPortNo()
Types ¶
type DefaultExecutor ¶ added in v0.0.2
type DefaultExecutor struct{}
type FlowAddSpy ¶ added in v0.0.5
type Message ¶
type Message struct { Type MessageType Data interface{} }
type MessageType ¶
type MessageType int
const ( OltIndication MessageType = 0 NniIndication MessageType = 1 PonIndication MessageType = 2 OnuDiscIndication MessageType = 3 OnuIndication MessageType = 4 OMCI MessageType = 5 FlowAdd MessageType = 6 FlowRemoved MessageType = 18 StartEAPOL MessageType = 7 StartDHCP MessageType = 8 OnuPacketOut MessageType = 9 // BBR messages OmciIndication MessageType = 10 // this are OMCI messages going from the OLT to VOLTHA SendEapolFlow MessageType = 11 SendDhcpFlow MessageType = 12 OnuPacketIn MessageType = 13 //IGMP IGMPMembershipReportV2 MessageType = 14 // Version 2 Membership Report (JOIN) IGMPLeaveGroup MessageType = 15 // Leave Group AlarmIndication MessageType = 16 // message data is an openolt.AlarmIndication IGMPMembershipReportV3 MessageType = 17 // Version 3 Membership Report )
func (MessageType) String ¶
func (m MessageType) String() string
type NniIndicationMessage ¶
type NniPort ¶
type OltDevice ¶
type OltDevice struct { sync.Mutex // BBSIM Internals ID int SerialNumber string NumNni int NumPon int NumOnuPerPon int InternalState *fsm.FSM Flows map[FlowKey]openolt.Flow Delay int ControlledActivation mode EventChannel chan common.Event PublishEvents bool PortStatsInterval int Pons []*PonPort Nnis []*NniPort // OLT Attributes OperState *fsm.FSM OpenoltStream openolt.Openolt_EnableIndicationServer // contains filtered or unexported fields }
func CreateOLT ¶
func CreateOLT(options common.GlobalConfig, services []common.ServiceYaml, isMock bool) *OltDevice
func (*OltDevice) ActivateOnu ¶
func (*OltDevice) CollectStatistics ¶
func (*OltDevice) CreateTrafficQueues ¶
func (s *OltDevice) CreateTrafficQueues(context.Context, *tech_profile.TrafficQueues) (*openolt.Empty, error)
func (*OltDevice) CreateTrafficSchedulers ¶
func (s *OltDevice) CreateTrafficSchedulers(context context.Context, trafficSchedulers *tech_profile.TrafficSchedulers) (*openolt.Empty, error)
func (*OltDevice) DeactivateOnu ¶
func (*OltDevice) DeleteGroup ¶ added in v1.0.0
func (*OltDevice) DisableOlt ¶
func (*OltDevice) DisablePonIf ¶
func (*OltDevice) Enable ¶
func (o *OltDevice) Enable(stream openolt.Openolt_EnableIndicationServer)
Enable implements the OpenOLT EnableIndicationServer functionality
func (*OltDevice) EnableIndication ¶
func (*OltDevice) EnablePonIf ¶
func (*OltDevice) FindOnuById ¶ added in v0.0.2
returns an ONU with a given interface/Onu Id
func (*OltDevice) FindOnuBySn ¶ added in v0.0.2
returns an ONU with a given Serial Number
func (*OltDevice) FindServiceByMacAddress ¶ added in v1.0.0
func (o *OltDevice) FindServiceByMacAddress(mac net.HardwareAddr) (ServiceIf, error)
returns a Service with a given Mac Address
func (*OltDevice) FlowRemove ¶
FlowRemove request from VOLTHA
func (*OltDevice) GetDeviceInfo ¶
func (*OltDevice) GetExtValue ¶ added in v1.0.0
func (o *OltDevice) GetExtValue(ctx context.Context, in *openolt.ValueParam) (*common_protos.ReturnValues, error)
func (*OltDevice) GetLogicalOnuDistance ¶ added in v1.0.0
func (*OltDevice) GetLogicalOnuDistanceZero ¶ added in v1.0.0
func (*OltDevice) GetOnuByFlowId ¶ added in v0.2.5
func (*OltDevice) GetOnuInfo ¶
func (*OltDevice) GetPonById ¶ added in v0.0.2
func (*OltDevice) HeartbeatCheck ¶
func (*OltDevice) OmciMsgOut ¶
func (*OltDevice) OnuItuPonAlarmSet ¶ added in v1.0.0
func (*OltDevice) OnuPacketOut ¶
func (*OltDevice) PerformGroupOperation ¶ added in v1.0.0
func (*OltDevice) ReenableOlt ¶
func (*OltDevice) RemoveTrafficQueues ¶
func (s *OltDevice) RemoveTrafficQueues(context.Context, *tech_profile.TrafficQueues) (*openolt.Empty, error)
func (*OltDevice) RemoveTrafficSchedulers ¶
func (s *OltDevice) RemoveTrafficSchedulers(context context.Context, trafficSchedulers *tech_profile.TrafficSchedulers) (*openolt.Empty, error)
func (*OltDevice) RestartOLT ¶ added in v0.0.7
func (*OltDevice) SendAlarmIndication ¶ added in v0.0.12
func (o *OltDevice) SendAlarmIndication(context context.Context, ind *openolt.AlarmIndication) error
assumes caller has properly formulated an openolt.AlarmIndication
func (*OltDevice) StopOltServer ¶ added in v0.0.8
StopOltServer stops the OpenOLT grpc server
func (*OltDevice) UplinkPacketOut ¶
type OltIndicationMessage ¶
type OltIndicationMessage struct {
OperState OperState
}
type OmciIndicationMessage ¶ added in v0.0.2
type OmciIndicationMessage struct { OnuSN *openolt.SerialNumber OnuID uint32 OmciInd *openolt.OmciIndication }
type OmciMessage ¶
type OmciMessage struct { OnuSN *openolt.SerialNumber OnuID uint32 // contains filtered or unexported fields }
type Onu ¶
type Onu struct { ID uint32 PonPortID uint32 PonPort *PonPort InternalState *fsm.FSM DiscoveryRetryDelay time.Duration // this is the time between subsequent Discovery Indication DiscoveryDelay time.Duration // this is the time to send the first Discovery Indication Services []ServiceIf Backoff *backoff.Backoff // ONU State // PortNo comes with flows and it's used when sending packetIndications, // There is one PortNo per UNI Port, for now we're only storing the first one // FIXME add support for multiple UNIs (each UNI has a different PortNo) PortNo uint32 // deprecated (gemPort is on a Service basis) GemPortAdded bool Flows []FlowKey FlowIds []uint32 // keep track of the flows we currently have in the ONU OperState *fsm.FSM SerialNumber *openolt.SerialNumber Channel chan Message // this Channel is to track state changes OMCI messages, EAPOL and DHCP packets DoneChannel chan bool // this channel is used to signal once the onu is complete (when the struct is used by BBR) TrafficSchedulers *tech_profile.TrafficSchedulers // contains filtered or unexported fields }
func (*Onu) DeleteFlow ¶ added in v0.0.18
DeleteFlow method search and delete flowKey from the onu flows slice
func (*Onu) ProcessOnuMessages ¶ added in v0.0.2
func (o *Onu) ProcessOnuMessages(ctx context.Context, stream openolt.Openolt_EnableIndicationServer, client openolt.OpenoltClient)
ProcessOnuMessages starts indication channel for each ONU
func (*Onu) ReDiscoverOnu ¶ added in v0.3.0
func (onu *Onu) ReDiscoverOnu()
func (*Onu) StartOmci ¶ added in v0.0.2
func (o *Onu) StartOmci(client openolt.OpenoltClient)
TODO move this method in responders/omcisim
type OnuFlowUpdateMessage ¶
type OnuIndicationMessage ¶
type OnuIndicationMessage struct { OperState OperState PonPortID uint32 OnuID uint32 OnuSN *openolt.SerialNumber }
type OnuPacketMessage ¶ added in v0.0.2
type OnuPacketMessage struct { IntfId uint32 OnuId uint32 Packet gopacket.Packet Type packetHandlers.PacketType MacAddress net.HardwareAddr GemPortId uint32 // this is used by BBR }
type PacketMessage ¶
type PonIndicationMessage ¶
type PonPort ¶
type PonPort struct { // BBSIM Internals ID uint32 NumOnu int Onus []*Onu Olt *OltDevice PacketCount uint64 InternalState *fsm.FSM // PON Attributes OperState *fsm.FSM Type string }
func CreatePonPort ¶ added in v0.0.10
CreatePonPort creates pon port object
func (PonPort) GetNumOfActiveOnus ¶ added in v0.0.19
GetNumOfActiveOnus returns number of active ONUs for PON port
func (PonPort) GetOnuBySn ¶ added in v0.0.2
func (p PonPort) GetOnuBySn(sn *openolt.SerialNumber) (*Onu, error)
type Service ¶ added in v1.0.0
type Service struct { Name string HwAddress net.HardwareAddr Onu *Onu CTag int STag int NeedsEapol bool NeedsDhcp bool NeedsIgmp bool TechnologyProfileID int UniTagMatch int ConfigureMacAddress bool UsPonCTagPriority uint8 UsPonSTagPriority uint8 DsPonCTagPriority uint8 DsPonSTagPriority uint8 // state GemPort uint32 InternalState *fsm.FSM EapolState *fsm.FSM DHCPState *fsm.FSM IGMPState *fsm.FSM Channel chan Message // drive Service lifecycle PacketCh chan OnuPacketMessage // handle packets Stream bbsimTypes.Stream // the gRPC stream to communicate with the adapter, created in the initialize transition }
func NewService ¶ added in v1.0.0
func NewService(name string, hwAddress net.HardwareAddr, onu *Onu, cTag int, sTag int, needsEapol bool, needsDchp bool, needsIgmp bool, tpID int, uniTagMatch int, configMacAddress bool, usPonCTagPriority uint8, usPonSTagPriority uint8, dsPonCTagPriority uint8, dsPonSTagPriority uint8) (*Service, error)
func (*Service) HandleAuth ¶ added in v1.0.0
func (s *Service) HandleAuth()
HandleAuth is used to start EAPOL for a particular Service when the corresponding flow is received
func (*Service) HandleChannel ¶ added in v1.0.0
func (s *Service) HandleChannel()
func (*Service) HandleDhcp ¶ added in v1.0.0
HandleDhcp is used to start DHCP for a particular Service when the corresponding flow is received
func (*Service) HandlePackets ¶ added in v1.0.0
func (s *Service) HandlePackets()
func (*Service) Initialize ¶ added in v1.0.0
func (s *Service) Initialize(stream bbsimTypes.Stream)