[VOL-4371] Voltha protos cleanup
Change-Id: If17761734c21223a9340fea10ca46a10b22a5d00
diff --git a/internal/pkg/core/device_handler.go b/internal/pkg/core/device_handler.go
index 02bc895..b9f1e2e 100644
--- a/internal/pkg/core/device_handler.go
+++ b/internal/pkg/core/device_handler.go
@@ -32,7 +32,6 @@
"github.com/golang/protobuf/ptypes/empty"
vgrpc "github.com/opencord/voltha-lib-go/v7/pkg/grpc"
- "github.com/opencord/voltha-protos/v5/go/adapter_services"
"github.com/cenkalti/backoff/v3"
"github.com/gogo/protobuf/proto"
@@ -49,8 +48,11 @@
"github.com/opencord/voltha-openolt-adapter/internal/pkg/olterrors"
rsrcMgr "github.com/opencord/voltha-openolt-adapter/internal/pkg/resourcemanager"
"github.com/opencord/voltha-protos/v5/go/common"
+ ca "github.com/opencord/voltha-protos/v5/go/core_adapter"
"github.com/opencord/voltha-protos/v5/go/extension"
- ic "github.com/opencord/voltha-protos/v5/go/inter_container"
+ "github.com/opencord/voltha-protos/v5/go/health"
+ ia "github.com/opencord/voltha-protos/v5/go/inter_adapter"
+ "github.com/opencord/voltha-protos/v5/go/onu_inter_adapter_service"
of "github.com/opencord/voltha-protos/v5/go/openflow_13"
oop "github.com/opencord/voltha-protos/v5/go/openolt"
"github.com/opencord/voltha-protos/v5/go/voltha"
@@ -146,11 +148,11 @@
//There are MaxNumOfGroupHandlerChannels number of mcastFlowOrGroupChannelHandlerRoutine routines which monitor for any incoming mcast flow/group messages
//and process them serially. The mcast flow/group are assigned these routines based on formula (group-id modulo MaxNumOfGroupHandlerChannels)
type McastFlowOrGroupControlBlock struct {
- ctx context.Context // Flow/group handler context
- flowOrGroupAction string // one of McastFlowOrGroupAdd, McastFlowOrGroupModify or McastFlowOrGroupDelete
- flow *voltha.OfpFlowStats // Flow message (can be nil or valid flow)
- group *voltha.OfpGroupEntry // Group message (can be nil or valid group)
- errChan *chan error // channel to report the mcast Flow/group handling error
+ ctx context.Context // Flow/group handler context
+ flowOrGroupAction string // one of McastFlowOrGroupAdd, McastFlowOrGroupModify or McastFlowOrGroupDelete
+ flow *of.OfpFlowStats // Flow message (can be nil or valid flow)
+ group *of.OfpGroupEntry // Group message (can be nil or valid group)
+ errChan *chan error // channel to report the mcast Flow/group handling error
}
var pmNames = []string{
@@ -332,13 +334,13 @@
}
// Check if port exists
- port, err := dh.getPortFromCore(ctx, &ic.PortFilter{
+ port, err := dh.getPortFromCore(ctx, &ca.PortFilter{
DeviceId: dh.device.Id,
Port: portNum,
})
if err == nil && port.Type == portType {
logger.Debug(ctx, "port-already-exists-updating-oper-status-of-port")
- err = dh.updatePortStateInCore(ctx, &ic.PortState{
+ err = dh.updatePortStateInCore(ctx, &ca.PortState{
DeviceId: dh.device.Id,
PortType: portType,
PortNo: portNum,
@@ -683,7 +685,7 @@
}
// Synchronous call to update device state - this method is run in its own go routine
- if err := dh.updateDeviceStateInCore(ctx, &ic.DeviceStateFilter{
+ if err := dh.updateDeviceStateInCore(ctx, &ca.DeviceStateFilter{
DeviceId: dh.device.Id,
OperStatus: voltha.OperStatus_ACTIVE,
ConnStatus: voltha.ConnectStatus_REACHABLE,
@@ -730,7 +732,7 @@
dh.device = cloned
dh.lockDevice.Unlock()
- if err = dh.updateDeviceStateInCore(ctx, &ic.DeviceStateFilter{
+ if err = dh.updateDeviceStateInCore(ctx, &ca.DeviceStateFilter{
DeviceId: cloned.Id,
OperStatus: cloned.OperStatus,
ConnStatus: cloned.ConnectStatus,
@@ -753,7 +755,7 @@
return err
}
subCtx, cancel := context.WithTimeout(log.WithSpanFromContext(context.Background(), ctx), dh.cfg.RPCTimeout)
- _, err = ogClient.OnuIndication(subCtx, &ic.OnuIndicationMessage{
+ _, err = ogClient.OnuIndication(subCtx, &ia.OnuIndicationMessage{
DeviceId: onuDevice.Id,
OnuIndication: &onuInd,
})
@@ -837,7 +839,7 @@
cloned.OperStatus = voltha.OperStatus_UNKNOWN
dh.device = cloned
- if err = dh.updateDeviceStateInCore(ctx, &ic.DeviceStateFilter{
+ if err = dh.updateDeviceStateInCore(ctx, &ca.DeviceStateFilter{
DeviceId: cloned.Id,
OperStatus: cloned.OperStatus,
ConnStatus: cloned.ConnectStatus,
@@ -1048,8 +1050,8 @@
}
//GetOfpDeviceInfo Gets the Ofp information of the given device
-func (dh *DeviceHandler) GetOfpDeviceInfo(device *voltha.Device) (*ic.SwitchCapability, error) {
- return &ic.SwitchCapability{
+func (dh *DeviceHandler) GetOfpDeviceInfo(device *voltha.Device) (*ca.SwitchCapability, error) {
+ return &ca.SwitchCapability{
Desc: &of.OfpDesc{
MfrDesc: "VOLTHA Project",
HwDesc: "open_pon",
@@ -1068,7 +1070,7 @@
}
// GetTechProfileDownloadMessage fetches the TechProfileDownloadMessage for the caller.
-func (dh *DeviceHandler) GetTechProfileDownloadMessage(ctx context.Context, request *ic.TechProfileInstanceRequestMessage) (*ic.TechProfileDownloadMessage, error) {
+func (dh *DeviceHandler) GetTechProfileDownloadMessage(ctx context.Context, request *ia.TechProfileInstanceRequestMessage) (*ia.TechProfileDownloadMessage, error) {
ifID, err := plt.IntfIDFromPonPortNum(ctx, request.ParentPonPort)
if err != nil {
return nil, err
@@ -1096,7 +1098,7 @@
logger.Debugw(ctx, "omci-indication-for-a-device-not-in-cache.", log.Fields{"intf-id": omciInd.IntfId, "onu-id": omciInd.OnuId, "device-id": dh.device.Id})
ponPort := plt.IntfIDToPortNo(omciInd.GetIntfId(), voltha.Port_PON_OLT)
- onuDevice, err := dh.getChildDeviceFromCore(ctx, &ic.ChildDeviceFilter{
+ onuDevice, err := dh.getChildDeviceFromCore(ctx, &ca.ChildDeviceFilter{
ParentId: dh.device.Id,
OnuId: omciInd.OnuId,
ParentPortNo: ponPort,
@@ -1121,7 +1123,7 @@
childAdapterEndpoint = onuInCache.(*OnuDevice).adapterEndpoint
}
- if err := dh.sendOmciIndicationToChildAdapter(ctx, childAdapterEndpoint, &ic.OmciMessage{
+ if err := dh.sendOmciIndicationToChildAdapter(ctx, childAdapterEndpoint, &ia.OmciMessage{
ParentDeviceId: proxyDeviceID,
ChildDeviceId: deviceID,
Message: omciInd.Pkt,
@@ -1139,16 +1141,16 @@
// //ProcessInterAdapterMessage sends the proxied messages to the target device
// // If the proxy address is not found in the unmarshalled message, it first fetches the onu device for which the message
// // is meant, and then send the unmarshalled omci message to this onu
-// func (dh *DeviceHandler) ProcessInterAdapterMessage(ctx context.Context, msg *ic.InterAdapterMessage) error {
+// func (dh *DeviceHandler) ProcessInterAdapterMessage(ctx context.Context, msg *ca.InterAdapterMessage) error {
// logger.Debugw(ctx, "process-inter-adapter-message", log.Fields{"msgID": msg.Header.Id})
-// if msg.Header.Type == ic.InterAdapterMessageType_OMCI_REQUEST {
+// if msg.Header.Type == ca.InterAdapterMessageType_OMCI_REQUEST {
// return dh.handleInterAdapterOmciMsg(ctx, msg)
// }
// return olterrors.NewErrInvalidValue(log.Fields{"inter-adapter-message-type": msg.Header.Type}, nil)
// }
// ProxyOmciMessage sends the proxied OMCI message to the target device
-func (dh *DeviceHandler) ProxyOmciMessage(ctx context.Context, omciMsg *ic.OmciMessage) error {
+func (dh *DeviceHandler) ProxyOmciMessage(ctx context.Context, omciMsg *ia.OmciMessage) error {
logger.Debugw(ctx, "proxy-omci-message", log.Fields{"parent-device-id": omciMsg.ParentDeviceId, "child-device-id": omciMsg.ChildDeviceId, "proxy-address": omciMsg.ProxyAddress, "connect-status": omciMsg.ConnectStatus})
if omciMsg.GetProxyAddress() == nil {
@@ -1175,7 +1177,7 @@
return nil
}
-func (dh *DeviceHandler) sendProxiedMessage(ctx context.Context, onuDevice *voltha.Device, omciMsg *ic.OmciMessage) error {
+func (dh *DeviceHandler) sendProxiedMessage(ctx context.Context, onuDevice *voltha.Device, omciMsg *ia.OmciMessage) error {
var intfID uint32
var onuID uint32
var connectStatus common.ConnectStatus_Types
@@ -1284,7 +1286,7 @@
// check the ONU is already know to the OLT
// NOTE the second time the ONU is discovered this should return a device
- onuDevice, err := dh.getChildDeviceFromCore(ctx, &ic.ChildDeviceFilter{
+ onuDevice, err := dh.getChildDeviceFromCore(ctx, &ca.ChildDeviceFilter{
ParentId: dh.device.Id,
SerialNumber: sn,
})
@@ -1323,7 +1325,7 @@
"serial-number": sn}, err)
}
- if onuDevice, err = dh.sendChildDeviceDetectedToCore(ctx, &ic.DeviceDiscovery{
+ if onuDevice, err = dh.sendChildDeviceDetectedToCore(ctx, &ca.DeviceDiscovery{
ParentId: dh.device.Id,
ParentPortNo: parentPortNo,
ChannelId: channelID,
@@ -1371,7 +1373,7 @@
log.Fields{"onu": onuDev,
"sn": sn})
- if err := dh.updateDeviceStateInCore(ctx, &ic.DeviceStateFilter{
+ if err := dh.updateDeviceStateInCore(ctx, &ca.DeviceStateFilter{
DeviceId: onuDevice.Id,
ParentDeviceId: dh.device.Id,
OperStatus: common.OperStatus_DISCOVERED,
@@ -1420,7 +1422,7 @@
errFields["onu-id"] = onuInd.OnuId
errFields["parent-port-no"] = ponPort
}
- onuDevice, err = dh.getChildDeviceFromCore(ctx, &ic.ChildDeviceFilter{
+ onuDevice, err = dh.getChildDeviceFromCore(ctx, &ca.ChildDeviceFilter{
ParentId: dh.device.Id,
SerialNumber: serialNumber,
OnuId: onuInd.OnuId,
@@ -1479,7 +1481,7 @@
case "up", "down":
logger.Debugw(ctx, "sending-interadapter-onu-indication", log.Fields{"onuIndication": onuInd, "device-id": onuDevice.Id, "operStatus": onuDevice.OperStatus, "adminStatus": onuDevice.AdminState})
- err := dh.sendOnuIndicationToChildAdapter(ctx, onuDevice.AdapterEndpoint, &ic.OnuIndicationMessage{
+ err := dh.sendOnuIndicationToChildAdapter(ctx, onuDevice.AdapterEndpoint, &ia.OnuIndicationMessage{
DeviceId: onuDevice.Id,
OnuIndication: onuInd,
})
@@ -1540,7 +1542,7 @@
"onu-id": onuID,
"device-id": dh.device.Id})
- onuDevice, err := dh.getChildDeviceFromCore(ctx, &ic.ChildDeviceFilter{
+ onuDevice, err := dh.getChildDeviceFromCore(ctx, &ca.ChildDeviceFilter{
ParentId: dh.device.Id,
OnuId: onuID,
ParentPortNo: parentPort,
@@ -1567,7 +1569,7 @@
})
}
- if err := dh.sendPacketToCore(ctx, &ic.PacketIn{
+ if err := dh.sendPacketToCore(ctx, &ca.PacketIn{
DeviceId: dh.device.Id,
Port: logicalPort,
Packet: packetPayload,
@@ -1606,7 +1608,7 @@
}
}
-func (dh *DeviceHandler) handleFlows(ctx context.Context, device *voltha.Device, flows *of.FlowChanges, flowMetadata *voltha.FlowMetadata) []error {
+func (dh *DeviceHandler) handleFlows(ctx context.Context, device *voltha.Device, flows *of.FlowChanges, flowMetadata *of.FlowMetadata) []error {
var err error
var errorsList []error
@@ -1687,7 +1689,7 @@
}
//UpdateFlowsIncrementally updates the device flow
-func (dh *DeviceHandler) UpdateFlowsIncrementally(ctx context.Context, device *voltha.Device, flows *of.FlowChanges, groups *of.FlowGroupChanges, flowMetadata *voltha.FlowMetadata) error {
+func (dh *DeviceHandler) UpdateFlowsIncrementally(ctx context.Context, device *voltha.Device, flows *of.FlowChanges, groups *of.FlowGroupChanges, flowMetadata *of.FlowMetadata) error {
var errorsList []error
@@ -1738,7 +1740,7 @@
dh.device = cloned
// Update the all pon ports state on that device to disable and NNI remains active as NNI remains active in openolt agent.
- if err := dh.updatePortsStateInCore(ctx, &ic.PortStateFilter{
+ if err := dh.updatePortsStateInCore(ctx, &ca.PortStateFilter{
DeviceId: cloned.Id,
PortTypeFilter: ^uint32(1 << voltha.Port_PON_OLT),
OperStatus: voltha.OperStatus_UNKNOWN,
@@ -1761,7 +1763,7 @@
}
if onuDevices != nil {
for _, onuDevice := range onuDevices.Items {
- err := dh.sendOnuIndicationToChildAdapter(ctx, onuDevice.AdapterEndpoint, &ic.OnuIndicationMessage{
+ err := dh.sendOnuIndicationToChildAdapter(ctx, onuDevice.AdapterEndpoint, &ia.OnuIndicationMessage{
DeviceId: onuDevice.Id,
OnuIndication: &onuInd,
})
@@ -1807,7 +1809,7 @@
}
dh.device = device
- if err := dh.updateDeviceStateInCore(ctx, &ic.DeviceStateFilter{
+ if err := dh.updateDeviceStateInCore(ctx, &ca.DeviceStateFilter{
DeviceId: device.Id,
OperStatus: device.OperStatus,
ConnStatus: device.ConnectStatus,
@@ -1962,7 +1964,7 @@
})
}
- if err := dh.sendPacketToCore(ctx, &ic.PacketIn{
+ if err := dh.sendPacketToCore(ctx, &ca.PacketIn{
DeviceId: dh.device.Id,
Port: logicalPortNum,
Packet: packetIn.Pkt,
@@ -2156,7 +2158,7 @@
logger.Debugw(ctx, "update-state-unreachable", log.Fields{"device-id": dh.device.Id, "connect-status": device.ConnectStatus,
"admin-state": device.AdminState, "oper-status": device.OperStatus})
if device.ConnectStatus == voltha.ConnectStatus_REACHABLE {
- if err = dh.updateDeviceStateInCore(ctx, &ic.DeviceStateFilter{
+ if err = dh.updateDeviceStateInCore(ctx, &ca.DeviceStateFilter{
DeviceId: dh.device.Id,
OperStatus: voltha.OperStatus_UNKNOWN,
ConnStatus: voltha.ConnectStatus_UNREACHABLE,
@@ -2164,7 +2166,7 @@
_ = olterrors.NewErrAdapter("device-state-update-failed", log.Fields{"device-id": dh.device.Id}, err).LogAt(log.ErrorLevel)
}
- if err = dh.updatePortsStateInCore(ctx, &ic.PortStateFilter{
+ if err = dh.updatePortsStateInCore(ctx, &ca.PortStateFilter{
DeviceId: dh.device.Id,
PortTypeFilter: 0,
OperStatus: voltha.OperStatus_UNKNOWN,
@@ -2260,7 +2262,7 @@
dh.activePorts.Store(ponID, false)
logger.Infow(ctx, "disabled-pon-port", log.Fields{"out": out, "device-id": dh.device, "Port": port})
}
- if err := dh.updatePortStateInCore(ctx, &ic.PortState{
+ if err := dh.updatePortStateInCore(ctx, &ca.PortState{
DeviceId: dh.device.Id,
PortType: voltha.Port_PON_OLT,
PortNo: port.PortNo,
@@ -2438,11 +2440,11 @@
dh.onus.Store(onuKey, onuDevice)
}
-func (dh *DeviceHandler) getExtValue(ctx context.Context, device *voltha.Device, value voltha.ValueType_Type) (*voltha.ReturnValues, error) {
+func (dh *DeviceHandler) getExtValue(ctx context.Context, device *voltha.Device, value extension.ValueType_Type) (*extension.ReturnValues, error) {
var err error
var sn *oop.SerialNumber
var ID uint32
- resp := new(voltha.ReturnValues)
+ resp := new(extension.ReturnValues)
valueparam := new(oop.ValueParam)
ctx = log.WithSpanFromContext(context.Background(), ctx)
logger.Infow(ctx, "getExtValue", log.Fields{"onu-id": device.Id, "pon-intf": device.ParentPortNo})
@@ -2552,7 +2554,7 @@
// RouteMcastFlowOrGroupMsgToChannel routes incoming mcast flow or group to a channel to be handled by the a specific
// instance of mcastFlowOrGroupChannelHandlerRoutine meant to handle messages for that group.
-func (dh *DeviceHandler) RouteMcastFlowOrGroupMsgToChannel(ctx context.Context, flow *voltha.OfpFlowStats, group *voltha.OfpGroupEntry, action string) error {
+func (dh *DeviceHandler) RouteMcastFlowOrGroupMsgToChannel(ctx context.Context, flow *of.OfpFlowStats, group *of.OfpGroupEntry, action string) error {
// Step1 : Fill McastFlowOrGroupControlBlock
// Step2 : Push the McastFlowOrGroupControlBlock to appropriate channel
// Step3 : Wait on response channel for response
@@ -2835,7 +2837,7 @@
return cClient.GetDevice(subCtx, &common.ID{Id: deviceID})
}
-func (dh *DeviceHandler) getChildDeviceFromCore(ctx context.Context, childDeviceFilter *ic.ChildDeviceFilter) (*voltha.Device, error) {
+func (dh *DeviceHandler) getChildDeviceFromCore(ctx context.Context, childDeviceFilter *ca.ChildDeviceFilter) (*voltha.Device, error) {
cClient, err := dh.coreClient.GetCoreServiceClient()
if err != nil || cClient == nil {
return nil, err
@@ -2845,7 +2847,7 @@
return cClient.GetChildDevice(subCtx, childDeviceFilter)
}
-func (dh *DeviceHandler) updateDeviceStateInCore(ctx context.Context, deviceStateFilter *ic.DeviceStateFilter) error {
+func (dh *DeviceHandler) updateDeviceStateInCore(ctx context.Context, deviceStateFilter *ca.DeviceStateFilter) error {
cClient, err := dh.coreClient.GetCoreServiceClient()
if err != nil || cClient == nil {
return err
@@ -2887,7 +2889,7 @@
return err
}
-func (dh *DeviceHandler) sendChildDeviceDetectedToCore(ctx context.Context, deviceDiscoveryInfo *ic.DeviceDiscovery) (*voltha.Device, error) {
+func (dh *DeviceHandler) sendChildDeviceDetectedToCore(ctx context.Context, deviceDiscoveryInfo *ca.DeviceDiscovery) (*voltha.Device, error) {
cClient, err := dh.coreClient.GetCoreServiceClient()
if err != nil || cClient == nil {
return nil, err
@@ -2897,7 +2899,7 @@
return cClient.ChildDeviceDetected(subCtx, deviceDiscoveryInfo)
}
-func (dh *DeviceHandler) sendPacketToCore(ctx context.Context, pkt *ic.PacketIn) error {
+func (dh *DeviceHandler) sendPacketToCore(ctx context.Context, pkt *ca.PacketIn) error {
cClient, err := dh.coreClient.GetCoreServiceClient()
if err != nil || cClient == nil {
return err
@@ -2919,7 +2921,7 @@
return err
}
-func (dh *DeviceHandler) updatePortsStateInCore(ctx context.Context, portFilter *ic.PortStateFilter) error {
+func (dh *DeviceHandler) updatePortsStateInCore(ctx context.Context, portFilter *ca.PortStateFilter) error {
cClient, err := dh.coreClient.GetCoreServiceClient()
if err != nil || cClient == nil {
return err
@@ -2930,7 +2932,7 @@
return err
}
-func (dh *DeviceHandler) updatePortStateInCore(ctx context.Context, portState *ic.PortState) error {
+func (dh *DeviceHandler) updatePortStateInCore(ctx context.Context, portState *ca.PortState) error {
cClient, err := dh.coreClient.GetCoreServiceClient()
if err != nil || cClient == nil {
return err
@@ -2941,7 +2943,7 @@
return err
}
-func (dh *DeviceHandler) getPortFromCore(ctx context.Context, portFilter *ic.PortFilter) (*voltha.Port, error) {
+func (dh *DeviceHandler) getPortFromCore(ctx context.Context, portFilter *ca.PortFilter) (*voltha.Port, error) {
cClient, err := dh.coreClient.GetCoreServiceClient()
if err != nil || cClient == nil {
return nil, err
@@ -2955,7 +2957,7 @@
Helper functions to communicate with child adapter
*/
-func (dh *DeviceHandler) sendOmciIndicationToChildAdapter(ctx context.Context, childEndpoint string, response *ic.OmciMessage) error {
+func (dh *DeviceHandler) sendOmciIndicationToChildAdapter(ctx context.Context, childEndpoint string, response *ia.OmciMessage) error {
aClient, err := dh.getChildAdapterServiceClient(childEndpoint)
if err != nil || aClient == nil {
return err
@@ -2967,7 +2969,7 @@
return err
}
-func (dh *DeviceHandler) sendOnuIndicationToChildAdapter(ctx context.Context, childEndpoint string, onuInd *ic.OnuIndicationMessage) error {
+func (dh *DeviceHandler) sendOnuIndicationToChildAdapter(ctx context.Context, childEndpoint string, onuInd *ia.OnuIndicationMessage) error {
aClient, err := dh.getChildAdapterServiceClient(childEndpoint)
if err != nil || aClient == nil {
return err
@@ -2979,7 +2981,7 @@
return err
}
-func (dh *DeviceHandler) sendDeleteTContToChildAdapter(ctx context.Context, childEndpoint string, tContInfo *ic.DeleteTcontMessage) error {
+func (dh *DeviceHandler) sendDeleteTContToChildAdapter(ctx context.Context, childEndpoint string, tContInfo *ia.DeleteTcontMessage) error {
aClient, err := dh.getChildAdapterServiceClient(childEndpoint)
if err != nil || aClient == nil {
return err
@@ -2991,7 +2993,7 @@
return err
}
-func (dh *DeviceHandler) sendDeleteGemPortToChildAdapter(ctx context.Context, childEndpoint string, gemPortInfo *ic.DeleteGemPortMessage) error {
+func (dh *DeviceHandler) sendDeleteGemPortToChildAdapter(ctx context.Context, childEndpoint string, gemPortInfo *ia.DeleteGemPortMessage) error {
aClient, err := dh.getChildAdapterServiceClient(childEndpoint)
if err != nil || aClient == nil {
return err
@@ -3003,7 +3005,7 @@
return err
}
-func (dh *DeviceHandler) sendDownloadTechProfileToChildAdapter(ctx context.Context, childEndpoint string, tpDownloadInfo *ic.TechProfileDownloadMessage) error {
+func (dh *DeviceHandler) sendDownloadTechProfileToChildAdapter(ctx context.Context, childEndpoint string, tpDownloadInfo *ia.TechProfileDownloadMessage) error {
aClient, err := dh.getChildAdapterServiceClient(childEndpoint)
if err != nil || aClient == nil {
return err
@@ -3061,16 +3063,7 @@
return nil
}
-// func (dh *DeviceHandler) getChildAdapterServiceClient(endpoint string) (adapter_services.OnuInterAdapterServiceClient, error) {
-// dh.lockChildAdapterClients.RLock()
-// defer dh.lockChildAdapterClients.RUnlock()
-// if cgClient, ok := dh.childAdapterClients[endpoint]; ok {
-// return cgClient.GetOnuInterAdapterServiceClient()
-// }
-// return nil, fmt.Errorf("no-client-for-endpoint-%s", endpoint)
-// }
-
-func (dh *DeviceHandler) getChildAdapterServiceClient(endpoint string) (adapter_services.OnuInterAdapterServiceClient, error) {
+func (dh *DeviceHandler) getChildAdapterServiceClient(endpoint string) (onu_inter_adapter_service.OnuInterAdapterServiceClient, error) {
// First check from cache
dh.lockChildAdapterClients.RLock()
@@ -3114,8 +3107,8 @@
// setAndTestAdapterServiceHandler is used to test whether the remote gRPC service is up
func setAndTestAdapterServiceHandler(ctx context.Context, conn *grpc.ClientConn) interface{} {
- svc := adapter_services.NewOnuInterAdapterServiceClient(conn)
- if h, err := svc.GetHealthStatus(ctx, &empty.Empty{}); err != nil || h.State != voltha.HealthStatus_HEALTHY {
+ svc := onu_inter_adapter_service.NewOnuInterAdapterServiceClient(conn)
+ if h, err := svc.GetHealthStatus(ctx, &empty.Empty{}); err != nil || h.State != health.HealthStatus_HEALTHY {
return nil
}
return svc
diff --git a/internal/pkg/core/device_handler_test.go b/internal/pkg/core/device_handler_test.go
index 6595315..108fd4c 100644
--- a/internal/pkg/core/device_handler_test.go
+++ b/internal/pkg/core/device_handler_test.go
@@ -37,7 +37,7 @@
"github.com/opencord/voltha-openolt-adapter/internal/pkg/olterrors"
"github.com/opencord/voltha-openolt-adapter/internal/pkg/resourcemanager"
"github.com/opencord/voltha-openolt-adapter/pkg/mocks"
- ic "github.com/opencord/voltha-protos/v5/go/inter_container"
+ ia "github.com/opencord/voltha-protos/v5/go/inter_adapter"
of "github.com/opencord/voltha-protos/v5/go/openflow_13"
ofp "github.com/opencord/voltha-protos/v5/go/openflow_13"
oop "github.com/opencord/voltha-protos/v5/go/openolt"
@@ -471,15 +471,15 @@
// ctx := context.Background()
// dh := newMockDeviceHandler()
// proxyAddr := dh.device.ProxyAddress
-// body := &ic.InterAdapterOmciMessage{
+// body := &ca.InterAdapterOmciMessage{
// Message: []byte("asdfasdfasdfasdfas"),
// ProxyAddress: proxyAddr,
// }
-// body2 := &ic.InterAdapterOmciMessage{
+// body2 := &ca.InterAdapterOmciMessage{
// Message: []byte("asdfasdfasdfasdfas"),
// //ProxyAddress: &voltha.Device_ProxyAddress{},
// }
-// body3 := &ic.InterAdapterTechProfileDownloadMessage{}
+// body3 := &ca.InterAdapterTechProfileDownloadMessage{}
// var marshalledData *any.Any
// var err error
@@ -498,7 +498,7 @@
// logger.Errorw(ctx, "cannot-marshal-request", log.Fields{"err": err})
// }
// type args struct {
-// msg *ic.InterAdapterMessage
+// msg *ca.InterAdapterMessage
// }
// invalid := reflect.TypeOf(&olterrors.ErrInvalidValue{})
// tests := []struct {
@@ -506,73 +506,73 @@
// args args
// wantErr reflect.Type
// }{
-// {"ProcessInterAdapterMessage-1", args{msg: &ic.InterAdapterMessage{
-// Header: &ic.InterAdapterHeader{
+// {"ProcessInterAdapterMessage-1", args{msg: &ca.InterAdapterMessage{
+// Header: &ca.InterAdapterHeader{
// Id: "012345",
-// Type: ic.InterAdapterMessageType_FLOW_REQUEST,
+// Type: ca.InterAdapterMessageType_FLOW_REQUEST,
// },
// Body: marshalledData,
// }}, invalid},
-// {"ProcessInterAdapterMessage-2", args{msg: &ic.InterAdapterMessage{
-// Header: &ic.InterAdapterHeader{
+// {"ProcessInterAdapterMessage-2", args{msg: &ca.InterAdapterMessage{
+// Header: &ca.InterAdapterHeader{
// Id: "012345",
-// Type: ic.InterAdapterMessageType_FLOW_RESPONSE,
+// Type: ca.InterAdapterMessageType_FLOW_RESPONSE,
// },
// Body: marshalledData1,
// }}, invalid},
-// {"ProcessInterAdapterMessage-3", args{msg: &ic.InterAdapterMessage{
-// Header: &ic.InterAdapterHeader{
+// {"ProcessInterAdapterMessage-3", args{msg: &ca.InterAdapterMessage{
+// Header: &ca.InterAdapterHeader{
// Id: "012345",
-// Type: ic.InterAdapterMessageType_OMCI_REQUEST,
+// Type: ca.InterAdapterMessageType_OMCI_REQUEST,
// },
// Body: marshalledData,
// }}, reflect.TypeOf(&olterrors.ErrCommunication{})},
-// {"ProcessInterAdapterMessage-4", args{msg: &ic.InterAdapterMessage{
-// Header: &ic.InterAdapterHeader{
+// {"ProcessInterAdapterMessage-4", args{msg: &ca.InterAdapterMessage{
+// Header: &ca.InterAdapterHeader{
// Id: "012345",
-// Type: ic.InterAdapterMessageType_OMCI_RESPONSE,
+// Type: ca.InterAdapterMessageType_OMCI_RESPONSE,
// }, Body: marshalledData,
// }}, invalid},
-// {"ProcessInterAdapterMessage-5", args{msg: &ic.InterAdapterMessage{
-// Header: &ic.InterAdapterHeader{
+// {"ProcessInterAdapterMessage-5", args{msg: &ca.InterAdapterMessage{
+// Header: &ca.InterAdapterHeader{
// Id: "012345",
-// Type: ic.InterAdapterMessageType_METRICS_REQUEST,
+// Type: ca.InterAdapterMessageType_METRICS_REQUEST,
// }, Body: marshalledData1,
// }}, invalid},
-// {"ProcessInterAdapterMessage-6", args{msg: &ic.InterAdapterMessage{
-// Header: &ic.InterAdapterHeader{
+// {"ProcessInterAdapterMessage-6", args{msg: &ca.InterAdapterMessage{
+// Header: &ca.InterAdapterHeader{
// Id: "012345",
-// Type: ic.InterAdapterMessageType_METRICS_RESPONSE,
+// Type: ca.InterAdapterMessageType_METRICS_RESPONSE,
// }, Body: marshalledData,
// }}, invalid},
-// {"ProcessInterAdapterMessage-7", args{msg: &ic.InterAdapterMessage{
-// Header: &ic.InterAdapterHeader{
+// {"ProcessInterAdapterMessage-7", args{msg: &ca.InterAdapterMessage{
+// Header: &ca.InterAdapterHeader{
// Id: "012345",
-// Type: ic.InterAdapterMessageType_ONU_IND_REQUEST,
+// Type: ca.InterAdapterMessageType_ONU_IND_REQUEST,
// }, Body: marshalledData,
// }}, invalid},
-// {"ProcessInterAdapterMessage-8", args{msg: &ic.InterAdapterMessage{
-// Header: &ic.InterAdapterHeader{
+// {"ProcessInterAdapterMessage-8", args{msg: &ca.InterAdapterMessage{
+// Header: &ca.InterAdapterHeader{
// Id: "012345",
-// Type: ic.InterAdapterMessageType_ONU_IND_RESPONSE,
+// Type: ca.InterAdapterMessageType_ONU_IND_RESPONSE,
// }, Body: marshalledData,
// }}, invalid},
-// {"ProcessInterAdapterMessage-9", args{msg: &ic.InterAdapterMessage{
-// Header: &ic.InterAdapterHeader{
+// {"ProcessInterAdapterMessage-9", args{msg: &ca.InterAdapterMessage{
+// Header: &ca.InterAdapterHeader{
// Id: "012345",
-// Type: ic.InterAdapterMessageType_TECH_PROFILE_DOWNLOAD_REQUEST,
+// Type: ca.InterAdapterMessageType_TECH_PROFILE_DOWNLOAD_REQUEST,
// }, Body: marshalledData,
// }}, invalid},
-// {"ProcessInterAdapterMessage-10", args{msg: &ic.InterAdapterMessage{
-// Header: &ic.InterAdapterHeader{
+// {"ProcessInterAdapterMessage-10", args{msg: &ca.InterAdapterMessage{
+// Header: &ca.InterAdapterHeader{
// Id: "012345",
-// Type: ic.InterAdapterMessageType_DELETE_GEM_PORT_REQUEST,
+// Type: ca.InterAdapterMessageType_DELETE_GEM_PORT_REQUEST,
// }, Body: marshalledData2,
// }}, invalid},
-// {"ProcessInterAdapterMessage-11", args{msg: &ic.InterAdapterMessage{
-// Header: &ic.InterAdapterHeader{
+// {"ProcessInterAdapterMessage-11", args{msg: &ca.InterAdapterMessage{
+// Header: &ca.InterAdapterHeader{
// Id: "012345",
-// Type: ic.InterAdapterMessageType_DELETE_TCONT_REQUEST,
+// Type: ca.InterAdapterMessageType_DELETE_TCONT_REQUEST,
// }, Body: marshalledData2,
// }}, invalid},
// }
@@ -604,7 +604,7 @@
}
device2 := device1
device2.ConnectStatus = 2
- iaomciMsg1 := &ic.OmciMessage{
+ iaomciMsg1 := &ia.OmciMessage{
ProxyAddress: &voltha.Device_ProxyAddress{
DeviceId: "onu2",
DeviceType: "onu",
@@ -613,7 +613,7 @@
},
ConnectStatus: 1,
}
- iaomciMsg2 := &ic.OmciMessage{
+ iaomciMsg2 := &ia.OmciMessage{
ProxyAddress: &voltha.Device_ProxyAddress{
DeviceId: "onu3",
DeviceType: "onu",
@@ -624,19 +624,19 @@
}
type args struct {
onuDevice *voltha.Device
- omciMsg *ic.OmciMessage
+ omciMsg *ia.OmciMessage
}
tests := []struct {
name string
devicehandler *DeviceHandler
args args
}{
- {"sendProxiedMessage-1", dh1, args{onuDevice: device1, omciMsg: &ic.OmciMessage{}}},
- {"sendProxiedMessage-2", dh1, args{onuDevice: device2, omciMsg: &ic.OmciMessage{}}},
+ {"sendProxiedMessage-1", dh1, args{onuDevice: device1, omciMsg: &ia.OmciMessage{}}},
+ {"sendProxiedMessage-2", dh1, args{onuDevice: device2, omciMsg: &ia.OmciMessage{}}},
{"sendProxiedMessage-3", dh1, args{onuDevice: nil, omciMsg: iaomciMsg1}},
{"sendProxiedMessage-4", dh1, args{onuDevice: nil, omciMsg: iaomciMsg2}},
{"sendProxiedMessage-5", dh2, args{onuDevice: nil, omciMsg: iaomciMsg2}},
- {"sendProxiedMessage-6", dh2, args{onuDevice: device1, omciMsg: &ic.OmciMessage{}}},
+ {"sendProxiedMessage-6", dh2, args{onuDevice: device1, omciMsg: &ia.OmciMessage{}}},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
@@ -1316,23 +1316,23 @@
{"update-flow-when-device-handler-is-nil", dh1, true},
}
- flowMetadata0 := voltha.FlowMetadata{Meters: []*voltha.OfpMeterConfig{
+ flowMetadata0 := of.FlowMetadata{Meters: []*of.OfpMeterConfig{
{
Flags: 5,
MeterId: 1,
- Bands: []*voltha.OfpMeterBandHeader{
+ Bands: []*of.OfpMeterBandHeader{
{
- Type: voltha.OfpMeterBandType_OFPMBT_DROP,
+ Type: of.OfpMeterBandType_OFPMBT_DROP,
Rate: 16000,
BurstSize: 0,
},
{
- Type: voltha.OfpMeterBandType_OFPMBT_DROP,
+ Type: of.OfpMeterBandType_OFPMBT_DROP,
Rate: 32000,
BurstSize: 30,
},
{
- Type: voltha.OfpMeterBandType_OFPMBT_DROP,
+ Type: of.OfpMeterBandType_OFPMBT_DROP,
Rate: 64000,
BurstSize: 30,
},
@@ -1365,9 +1365,9 @@
}
flow0, _ := fu.MkFlowStat(fa0)
- flowAdd := of.Flows{Items: make([]*voltha.OfpFlowStats, 0)}
+ flowAdd := of.Flows{Items: make([]*of.OfpFlowStats, 0)}
flowAdd.Items = append(flowAdd.Items, flow0)
- flowRemove := of.Flows{Items: make([]*voltha.OfpFlowStats, 0)}
+ flowRemove := of.Flows{Items: make([]*of.OfpFlowStats, 0)}
flowChanges := &ofp.FlowChanges{ToAdd: &flowAdd, ToRemove: &flowRemove}
for _, tt := range tests {
diff --git a/internal/pkg/core/openolt.go b/internal/pkg/core/openolt.go
index 30aa33c..9e7cba2 100644
--- a/internal/pkg/core/openolt.go
+++ b/internal/pkg/core/openolt.go
@@ -31,8 +31,11 @@
"github.com/opencord/voltha-openolt-adapter/internal/pkg/config"
"github.com/opencord/voltha-openolt-adapter/internal/pkg/olterrors"
"github.com/opencord/voltha-protos/v5/go/common"
+ ca "github.com/opencord/voltha-protos/v5/go/core_adapter"
"github.com/opencord/voltha-protos/v5/go/extension"
- ic "github.com/opencord/voltha-protos/v5/go/inter_container"
+ "github.com/opencord/voltha-protos/v5/go/health"
+ ia "github.com/opencord/voltha-protos/v5/go/inter_adapter"
+ "github.com/opencord/voltha-protos/v5/go/omci"
"github.com/opencord/voltha-protos/v5/go/voltha"
)
@@ -119,8 +122,8 @@
}
// GetHealthStatus is used as a service readiness validation as a grpc connection
-func (oo *OpenOLT) GetHealthStatus(ctx context.Context, empty *empty.Empty) (*voltha.HealthStatus, error) {
- return &voltha.HealthStatus{State: voltha.HealthStatus_HEALTHY}, nil
+func (oo *OpenOLT) GetHealthStatus(ctx context.Context, empty *empty.Empty) (*health.HealthStatus, error) {
+ return &health.HealthStatus{State: health.HealthStatus_HEALTHY}, nil
}
// AdoptDevice creates a new device handler if not present already and then adopts the device
@@ -139,7 +142,7 @@
}
//GetOfpDeviceInfo returns OFP information for the given device
-func (oo *OpenOLT) GetOfpDeviceInfo(ctx context.Context, device *voltha.Device) (*ic.SwitchCapability, error) {
+func (oo *OpenOLT) GetOfpDeviceInfo(ctx context.Context, device *voltha.Device) (*ca.SwitchCapability, error) {
logger.Infow(ctx, "get_ofp_device_info", log.Fields{"device-id": device.Id})
if handler := oo.getDeviceHandler(device.Id); handler != nil {
return handler.GetOfpDeviceInfo(device)
@@ -162,7 +165,7 @@
}
subCtx, cancel := context.WithTimeout(log.WithSpanFromContext(context.Background(), ctx), oo.rpcTimeout)
defer cancel()
- if _, err := cgClient.DeviceStateUpdate(subCtx, &ic.DeviceStateFilter{
+ if _, err := cgClient.DeviceStateUpdate(subCtx, &ca.DeviceStateFilter{
DeviceId: device.Id,
OperStatus: voltha.OperStatus_RECONCILING,
ConnStatus: device.ConnectStatus,
@@ -234,7 +237,7 @@
}
//UpdateFlowsIncrementally updates (add/remove) the flows on a given device
-func (oo *OpenOLT) UpdateFlowsIncrementally(ctx context.Context, incrFlows *ic.IncrementalFlows) (*empty.Empty, error) {
+func (oo *OpenOLT) UpdateFlowsIncrementally(ctx context.Context, incrFlows *ca.IncrementalFlows) (*empty.Empty, error) {
logger.Infow(ctx, "update_flows_incrementally", log.Fields{"device-id": incrFlows.Device.Id, "flows": incrFlows.Flows, "flowMetadata": incrFlows.FlowMetadata})
if handler := oo.getDeviceHandler(incrFlows.Device.Id); handler != nil {
if err := handler.UpdateFlowsIncrementally(log.WithSpanFromContext(context.Background(), ctx), incrFlows.Device, incrFlows.Flows, incrFlows.Groups, incrFlows.FlowMetadata); err != nil {
@@ -246,7 +249,7 @@
}
//UpdatePmConfig returns PmConfigs nil or error
-func (oo *OpenOLT) UpdatePmConfig(ctx context.Context, configs *ic.PmConfigsInfo) (*empty.Empty, error) {
+func (oo *OpenOLT) UpdatePmConfig(ctx context.Context, configs *ca.PmConfigsInfo) (*empty.Empty, error) {
logger.Debugw(ctx, "update_pm_config", log.Fields{"device-id": configs.DeviceId, "pm-configs": configs.PmConfigs})
if handler := oo.getDeviceHandler(configs.DeviceId); handler != nil {
handler.UpdatePmConfig(log.WithSpanFromContext(context.Background(), ctx), configs.PmConfigs)
@@ -256,7 +259,7 @@
}
//SendPacketOut sends packet out to the device
-func (oo *OpenOLT) SendPacketOut(ctx context.Context, packet *ic.PacketOut) (*empty.Empty, error) {
+func (oo *OpenOLT) SendPacketOut(ctx context.Context, packet *ca.PacketOut) (*empty.Empty, error) {
logger.Debugw(ctx, "send_packet_out", log.Fields{"device-id": packet.DeviceId, "egress_port_no": packet.EgressPortNo, "pkt": packet.Packet})
if handler := oo.getDeviceHandler(packet.DeviceId); handler != nil {
if err := handler.PacketOut(log.WithSpanFromContext(context.Background(), ctx), packet.EgressPortNo, packet.Packet); err != nil {
@@ -323,9 +326,9 @@
}
// GetExtValue retrieves a value on a particular ONU
-func (oo *OpenOLT) GetExtValue(ctx context.Context, extInfo *ic.GetExtValueMessage) (*voltha.ReturnValues, error) {
+func (oo *OpenOLT) GetExtValue(ctx context.Context, extInfo *ca.GetExtValueMessage) (*extension.ReturnValues, error) {
var err error
- resp := new(voltha.ReturnValues)
+ resp := new(extension.ReturnValues)
logger.Infow(ctx, "get_ext_value", log.Fields{"parent-device-id": extInfo.ParentDevice.Id, "onu-id": extInfo.ChildDevice.Id})
if handler := oo.getDeviceHandler(extInfo.ParentDevice.Id); handler != nil {
if resp, err = handler.getExtValue(ctx, extInfo.ChildDevice, extInfo.ValueType); err != nil {
@@ -372,7 +375,7 @@
*/
// ProxyOmciRequest proxies an OMCI request from the child adapter
-func (oo *OpenOLT) ProxyOmciRequest(ctx context.Context, request *ic.OmciMessage) (*empty.Empty, error) {
+func (oo *OpenOLT) ProxyOmciRequest(ctx context.Context, request *ia.OmciMessage) (*empty.Empty, error) {
logger.Debugw(ctx, "proxy-omci-request", log.Fields{"request": request})
if handler := oo.getDeviceHandler(request.ParentDeviceId); handler != nil {
@@ -385,7 +388,7 @@
}
// GetTechProfileInstance returns an instance of a tech profile
-func (oo *OpenOLT) GetTechProfileInstance(ctx context.Context, request *ic.TechProfileInstanceRequestMessage) (*ic.TechProfileDownloadMessage, error) {
+func (oo *OpenOLT) GetTechProfileInstance(ctx context.Context, request *ia.TechProfileInstanceRequestMessage) (*ia.TechProfileDownloadMessage, error) {
logger.Debugw(ctx, "getting-tech-profile-request", log.Fields{"request": request})
targetDeviceID := request.ParentDeviceId
@@ -406,12 +409,12 @@
*/
//SimulateAlarm is unimplemented
-func (oo *OpenOLT) SimulateAlarm(context.Context, *ic.SimulateAlarmMessage) (*voltha.OperationResp, error) {
+func (oo *OpenOLT) SimulateAlarm(context.Context, *ca.SimulateAlarmMessage) (*voltha.OperationResp, error) {
return nil, olterrors.ErrNotImplemented
}
//SetExtValue is unimplemented
-func (oo *OpenOLT) SetExtValue(context.Context, *ic.SetExtValueMessage) (*empty.Empty, error) {
+func (oo *OpenOLT) SetExtValue(context.Context, *ca.SetExtValueMessage) (*empty.Empty, error) {
return nil, olterrors.ErrNotImplemented
}
@@ -421,7 +424,7 @@
}
//StartOmciTest not implemented
-func (oo *OpenOLT) StartOmciTest(ctx context.Context, test *ic.OMCITest) (*voltha.TestResponse, error) {
+func (oo *OpenOLT) StartOmciTest(ctx context.Context, test *ca.OMCITest) (*omci.TestResponse, error) {
return nil, olterrors.ErrNotImplemented
}
@@ -436,27 +439,27 @@
}
//DownloadImage is unimplemented
-func (oo *OpenOLT) DownloadImage(ctx context.Context, imageInfo *ic.ImageDownloadMessage) (*voltha.ImageDownload, error) {
+func (oo *OpenOLT) DownloadImage(ctx context.Context, imageInfo *ca.ImageDownloadMessage) (*voltha.ImageDownload, error) {
return nil, olterrors.ErrNotImplemented
}
//GetImageDownloadStatus is unimplemented
-func (oo *OpenOLT) GetImageDownloadStatus(ctx context.Context, imageInfo *ic.ImageDownloadMessage) (*voltha.ImageDownload, error) {
+func (oo *OpenOLT) GetImageDownloadStatus(ctx context.Context, imageInfo *ca.ImageDownloadMessage) (*voltha.ImageDownload, error) {
return nil, olterrors.ErrNotImplemented
}
//CancelImageDownload is unimplemented
-func (oo *OpenOLT) CancelImageDownload(ctx context.Context, imageInfo *ic.ImageDownloadMessage) (*voltha.ImageDownload, error) {
+func (oo *OpenOLT) CancelImageDownload(ctx context.Context, imageInfo *ca.ImageDownloadMessage) (*voltha.ImageDownload, error) {
return nil, olterrors.ErrNotImplemented
}
//ActivateImageUpdate is unimplemented
-func (oo *OpenOLT) ActivateImageUpdate(ctx context.Context, imageInfo *ic.ImageDownloadMessage) (*voltha.ImageDownload, error) {
+func (oo *OpenOLT) ActivateImageUpdate(ctx context.Context, imageInfo *ca.ImageDownloadMessage) (*voltha.ImageDownload, error) {
return nil, olterrors.ErrNotImplemented
}
//RevertImageUpdate is unimplemented
-func (oo *OpenOLT) RevertImageUpdate(ctx context.Context, imageInfo *ic.ImageDownloadMessage) (*voltha.ImageDownload, error) {
+func (oo *OpenOLT) RevertImageUpdate(ctx context.Context, imageInfo *ca.ImageDownloadMessage) (*voltha.ImageDownload, error) {
return nil, olterrors.ErrNotImplemented
}
@@ -491,7 +494,7 @@
}
// UpdateFlowsBulk is unimplemented
-func (oo *OpenOLT) UpdateFlowsBulk(ctx context.Context, flows *ic.BulkFlows) (*empty.Empty, error) {
+func (oo *OpenOLT) UpdateFlowsBulk(ctx context.Context, flows *ca.BulkFlows) (*empty.Empty, error) {
return nil, olterrors.ErrNotImplemented
}
diff --git a/internal/pkg/core/openolt_eventmgr.go b/internal/pkg/core/openolt_eventmgr.go
index 858d5f7..a3bf003 100644
--- a/internal/pkg/core/openolt_eventmgr.go
+++ b/internal/pkg/core/openolt_eventmgr.go
@@ -23,7 +23,7 @@
"fmt"
"strconv"
- ic "github.com/opencord/voltha-protos/v5/go/inter_container"
+ ca "github.com/opencord/voltha-protos/v5/go/core_adapter"
"github.com/opencord/voltha-lib-go/v7/pkg/events/eventif"
"github.com/opencord/voltha-lib-go/v7/pkg/log"
@@ -669,7 +669,7 @@
// oltIntfOperIndication handles Up and Down state of an OLT PON ports
func (em *OpenOltEventMgr) oltIntfOperIndication(ctx context.Context, ifindication *oop.IntfOperIndication, deviceID string, raisedTs int64) {
portNo := plt.IntfIDToPortNo(ifindication.IntfId, voltha.Port_PON_OLT)
- if port, err := em.handler.getPortFromCore(ctx, &ic.PortFilter{
+ if port, err := em.handler.getPortFromCore(ctx, &ca.PortFilter{
DeviceId: deviceID,
Port: portNo,
}); err != nil {
diff --git a/internal/pkg/core/openolt_flowmgr.go b/internal/pkg/core/openolt_flowmgr.go
index 8699740..57833fa 100644
--- a/internal/pkg/core/openolt_flowmgr.go
+++ b/internal/pkg/core/openolt_flowmgr.go
@@ -35,7 +35,7 @@
tp "github.com/opencord/voltha-lib-go/v7/pkg/techprofile"
rsrcMgr "github.com/opencord/voltha-openolt-adapter/internal/pkg/resourcemanager"
"github.com/opencord/voltha-protos/v5/go/common"
- ic "github.com/opencord/voltha-protos/v5/go/inter_container"
+ ia "github.com/opencord/voltha-protos/v5/go/inter_adapter"
ofp "github.com/opencord/voltha-protos/v5/go/openflow_13"
openoltpb2 "github.com/opencord/voltha-protos/v5/go/openolt"
tp_pb "github.com/opencord/voltha-protos/v5/go/tech_profile"
@@ -166,7 +166,7 @@
uniPort uint32
tpInst interface{}
meterID uint32
- flowMetadata *voltha.FlowMetadata
+ flowMetadata *ofp.FlowMetadata
}
type flowContext struct {
@@ -189,11 +189,11 @@
// There is on perOnuFlowHandlerRoutine routine per ONU that constantly monitors for any incoming
// flow and processes it serially
type flowControlBlock struct {
- ctx context.Context // Flow handler context
- addFlow bool // if true flow to be added, else removed
- flow *voltha.OfpFlowStats // Flow message
- flowMetadata *voltha.FlowMetadata // FlowMetadata that contains flow meter information. This can be nil for Flow remove
- errChan *chan error // channel to report the Flow handling error
+ ctx context.Context // Flow handler context
+ addFlow bool // if true flow to be added, else removed
+ flow *ofp.OfpFlowStats // Flow message
+ flowMetadata *ofp.FlowMetadata // FlowMetadata that contains flow meter information. This can be nil for Flow remove
+ errChan *chan error // channel to report the Flow handling error
}
//OpenOltFlowMgr creates the Structure of OpenOltFlowMgr obj
@@ -320,7 +320,7 @@
func (f *OpenOltFlowMgr) processAddFlow(ctx context.Context, intfID uint32, onuID uint32, uniID uint32, portNo uint32,
classifierInfo map[string]interface{}, actionInfo map[string]interface{}, flow *ofp.OfpFlowStats, TpID uint32,
- UsMeterID uint32, DsMeterID uint32, flowMetadata *voltha.FlowMetadata) error {
+ UsMeterID uint32, DsMeterID uint32, flowMetadata *ofp.FlowMetadata) error {
var allocID uint32
var gemPorts []uint32
var TpInst interface{}
@@ -787,7 +787,7 @@
}
// This function allocates tconts and GEM ports for an ONU
-func (f *OpenOltFlowMgr) createTcontGemports(ctx context.Context, intfID uint32, onuID uint32, uniID uint32, uni string, uniPort uint32, TpID uint32, UsMeterID uint32, DsMeterID uint32, flowMetadata *voltha.FlowMetadata) (uint32, []uint32, interface{}) {
+func (f *OpenOltFlowMgr) createTcontGemports(ctx context.Context, intfID uint32, onuID uint32, uniID uint32, uni string, uniPort uint32, TpID uint32, UsMeterID uint32, DsMeterID uint32, flowMetadata *ofp.FlowMetadata) (uint32, []uint32, interface{}) {
var allocIDs []uint32
var allgemPortIDs []uint32
var gemPortIDs []uint32
@@ -888,7 +888,7 @@
// Send Tconts and GEM ports to KV store
f.storeTcontsGEMPortsIntoKVStore(ctx, intfID, onuID, uniID, allocIDs, allgemPortIDs)
return allocID, gemPortIDs, techProfileInstance
- case *openoltpb2.EponTechProfileInstance:
+ case *tp_pb.EponTechProfileInstance:
// CreateSchedulerQueues for EPON needs to be implemented here
// when voltha-protos for EPON is completed.
allocID := tpInst.AllocId
@@ -1788,7 +1788,7 @@
return err
}
- delGemPortMsg := &ic.DeleteGemPortMessage{
+ delGemPortMsg := &ia.DeleteGemPortMessage{
DeviceId: onuDev.deviceID,
UniId: uniID,
TpInstancePath: tpPath,
@@ -1828,7 +1828,7 @@
return err
}
- delTcontMsg := &ic.DeleteTcontMessage{
+ delTcontMsg := &ia.DeleteTcontMessage{
DeviceId: onuDev.deviceID,
UniId: uniID,
TpInstancePath: tpPath,
@@ -2181,7 +2181,7 @@
}
// RouteFlowToOnuChannel routes incoming flow to ONU specific channel
-func (f *OpenOltFlowMgr) RouteFlowToOnuChannel(ctx context.Context, flow *voltha.OfpFlowStats, addFlow bool, flowMetadata *voltha.FlowMetadata) error {
+func (f *OpenOltFlowMgr) RouteFlowToOnuChannel(ctx context.Context, flow *ofp.OfpFlowStats, addFlow bool, flowMetadata *ofp.FlowMetadata) error {
// Step1 : Fill flowControlBlock
// Step2 : Push the flowControlBlock to ONU channel
// Step3 : Wait on response channel for response
@@ -2257,7 +2257,7 @@
// AddFlow add flow to device
// nolint: gocyclo
-func (f *OpenOltFlowMgr) AddFlow(ctx context.Context, flow *ofp.OfpFlowStats, flowMetadata *voltha.FlowMetadata) error {
+func (f *OpenOltFlowMgr) AddFlow(ctx context.Context, flow *ofp.OfpFlowStats, flowMetadata *ofp.FlowMetadata) error {
classifierInfo := make(map[string]interface{})
actionInfo := make(map[string]interface{})
var UsMeterID uint32
@@ -2450,11 +2450,11 @@
logger.Debugw(ctx, "got-child-device-from-olt-device-handler", log.Fields{"onu-id": onuDev.deviceID})
tpPath := f.getTPpath(ctx, intfID, uni, TpID)
- tpDownloadMsg := &ic.TechProfileDownloadMessage{
+ tpDownloadMsg := &ia.TechProfileDownloadMessage{
DeviceId: onuDev.deviceID,
UniId: uniID,
TpInstancePath: tpPath,
- TechTpInstance: &ic.TechProfileDownloadMessage_TpInstance{TpInstance: &tpInst},
+ TechTpInstance: &ia.TechProfileDownloadMessage_TpInstance{TpInstance: &tpInst},
}
logger.Debugw(ctx, "sending-load-tech-profile-request-to-brcm-onu-adapter", log.Fields{"tpDownloadMsg": *tpDownloadMsg})
@@ -2869,7 +2869,7 @@
// Trim the bitMapPrefix form the binary string and then iterate each character in the binary string.
// If the character is set to pbit1, extract the pcp value from the position of this character in the string.
// Update the pbitToGem map with key being the pcp bit and the value being the gemPortID that consumes
- // this pcp bit traffic.
+ // this pcp bit traffca.
for pos, pbitSet := range strings.TrimPrefix(pBitMap, bitMapPrefix) {
if pbitSet == pbit1 {
pcp := uint32(len(strings.TrimPrefix(pBitMap, bitMapPrefix))) - 1 - uint32(pos)
@@ -3380,7 +3380,7 @@
return nil
}
-func (f *OpenOltFlowMgr) getTechProfileDownloadMessage(ctx context.Context, tpPath string, uniID uint32, onuDeviceID string) (*ic.TechProfileDownloadMessage, error) {
+func (f *OpenOltFlowMgr) getTechProfileDownloadMessage(ctx context.Context, tpPath string, uniID uint32, onuDeviceID string) (*ia.TechProfileDownloadMessage, error) {
tpInst, err := f.techprofile.GetTPInstance(ctx, tpPath)
if err != nil {
logger.Errorw(ctx, "error-fetching-tp-instance", log.Fields{"tpPath": tpPath})
@@ -3390,23 +3390,23 @@
switch tpInst := tpInst.(type) {
case *tp_pb.TechProfileInstance:
logger.Debugw(ctx, "fetched-tp-instance-successfully-formulating-tp-download-msg", log.Fields{"tpPath": tpPath})
- return &ic.TechProfileDownloadMessage{
+ return &ia.TechProfileDownloadMessage{
DeviceId: onuDeviceID,
UniId: uniID,
TpInstancePath: tpPath,
- TechTpInstance: &ic.TechProfileDownloadMessage_TpInstance{TpInstance: tpInst},
+ TechTpInstance: &ia.TechProfileDownloadMessage_TpInstance{TpInstance: tpInst},
}, nil
- case *openoltpb2.EponTechProfileInstance:
- return &ic.TechProfileDownloadMessage{
+ case *tp_pb.EponTechProfileInstance:
+ return &ia.TechProfileDownloadMessage{
DeviceId: onuDeviceID,
UniId: uniID,
TpInstancePath: tpPath,
- TechTpInstance: &ic.TechProfileDownloadMessage_EponTpInstance{EponTpInstance: tpInst},
+ TechTpInstance: &ia.TechProfileDownloadMessage_EponTpInstance{EponTpInstance: tpInst},
}, nil
default:
logger.Errorw(ctx, "unknown-tech", log.Fields{"tpPath": tpPath})
}
- return &ic.TechProfileDownloadMessage{
+ return &ia.TechProfileDownloadMessage{
DeviceId: onuDeviceID,
UniId: uniID,
TpInstancePath: tpPath,
diff --git a/internal/pkg/core/openolt_flowmgr_test.go b/internal/pkg/core/openolt_flowmgr_test.go
index 0a557ca..45cd79e 100644
--- a/internal/pkg/core/openolt_flowmgr_test.go
+++ b/internal/pkg/core/openolt_flowmgr_test.go
@@ -29,8 +29,6 @@
"github.com/opencord/voltha-openolt-adapter/pkg/mocks"
- "github.com/opencord/voltha-protos/v5/go/voltha"
-
fu "github.com/opencord/voltha-lib-go/v7/pkg/flows"
"github.com/opencord/voltha-lib-go/v7/pkg/log"
rsrcMgr "github.com/opencord/voltha-openolt-adapter/internal/pkg/resourcemanager"
@@ -74,12 +72,12 @@
ProfileType: "pt1", NumGemPorts: 1, Version: 1,
InstanceControl: &tp_pb.InstanceControl{Onu: "1", Uni: "1", MaxGemPayloadSize: "1"},
}
- tprofile.UsScheduler = &openoltpb2.SchedulerAttributes{}
+ tprofile.UsScheduler = &tp_pb.SchedulerAttributes{}
tprofile.UsScheduler.Direction = tp_pb.Direction_UPSTREAM
tprofile.UsScheduler.QSchedPolicy = tp_pb.SchedulingPolicy_WRR
tprofile2 := tprofile
- tprofile2.DsScheduler = &openoltpb2.SchedulerAttributes{}
+ tprofile2.DsScheduler = &tp_pb.SchedulerAttributes{}
tprofile2.DsScheduler.Direction = tp_pb.Direction_DOWNSTREAM
tprofile2.DsScheduler.QSchedPolicy = tp_pb.SchedulingPolicy_WRR
@@ -108,11 +106,11 @@
{"CreateSchedulerQueues-6", schedQueue{tp_pb.Direction_DOWNSTREAM, 1, 2, 2, 65, 2, tprofile2, 2, createFlowMetadata(tprofile2, 3, Downstream)}, true},
//Negative testcases
- {"CreateSchedulerQueues-7", schedQueue{tp_pb.Direction_UPSTREAM, 0, 1, 1, 64, 1, tprofile, 1, &voltha.FlowMetadata{}}, false},
- {"CreateSchedulerQueues-8", schedQueue{tp_pb.Direction_UPSTREAM, 0, 1, 1, 64, 1, tprofile, 0, &voltha.FlowMetadata{}}, true},
- {"CreateSchedulerQueues-9", schedQueue{tp_pb.Direction_DOWNSTREAM, 0, 1, 1, 65, 1, tprofile2, 1, &voltha.FlowMetadata{}}, false},
- {"CreateSchedulerQueues-10", schedQueue{tp_pb.Direction_UPSTREAM, 0, 1, 1, 64, 1, tprofile, 2, &voltha.FlowMetadata{}}, true},
- {"CreateSchedulerQueues-11", schedQueue{tp_pb.Direction_DOWNSTREAM, 0, 1, 1, 65, 1, tprofile2, 2, &voltha.FlowMetadata{}}, true},
+ {"CreateSchedulerQueues-7", schedQueue{tp_pb.Direction_UPSTREAM, 0, 1, 1, 64, 1, tprofile, 1, &ofp.FlowMetadata{}}, false},
+ {"CreateSchedulerQueues-8", schedQueue{tp_pb.Direction_UPSTREAM, 0, 1, 1, 64, 1, tprofile, 0, &ofp.FlowMetadata{}}, true},
+ {"CreateSchedulerQueues-9", schedQueue{tp_pb.Direction_DOWNSTREAM, 0, 1, 1, 65, 1, tprofile2, 1, &ofp.FlowMetadata{}}, false},
+ {"CreateSchedulerQueues-10", schedQueue{tp_pb.Direction_UPSTREAM, 0, 1, 1, 64, 1, tprofile, 2, &ofp.FlowMetadata{}}, true},
+ {"CreateSchedulerQueues-11", schedQueue{tp_pb.Direction_DOWNSTREAM, 0, 1, 1, 65, 1, tprofile2, 2, &ofp.FlowMetadata{}}, true},
{"CreateSchedulerQueues-12", schedQueue{tp_pb.Direction_DOWNSTREAM, 0, 1, 1, 65, 1, tprofile2, 2, nil}, true},
}
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
@@ -126,8 +124,8 @@
}
}
-func createFlowMetadata(techProfile *tp_pb.TechProfileInstance, tcontType int, direction string) *voltha.FlowMetadata {
- var additionalBw openoltpb2.AdditionalBW
+func createFlowMetadata(techProfile *tp_pb.TechProfileInstance, tcontType int, direction string) *ofp.FlowMetadata {
+ var additionalBw tp_pb.AdditionalBW
bands := make([]*ofp.OfpMeterBandHeader, 0)
switch tcontType {
case 1:
@@ -166,7 +164,7 @@
}
ofpMeterConfig := &ofp.OfpMeterConfig{Flags: 1, MeterId: 1, Bands: bands}
- return &voltha.FlowMetadata{
+ return &ofp.FlowMetadata{
Meters: []*ofp.OfpMeterConfig{ofpMeterConfig}}
}
@@ -175,13 +173,13 @@
ProfileType: "pt1", NumGemPorts: 1, Version: 1,
InstanceControl: &tp_pb.InstanceControl{Onu: "1", Uni: "1", MaxGemPayloadSize: "1"},
}
- tprofile.UsScheduler = &openoltpb2.SchedulerAttributes{}
+ tprofile.UsScheduler = &tp_pb.SchedulerAttributes{}
tprofile.UsScheduler.Direction = tp_pb.Direction_UPSTREAM
tprofile.UsScheduler.AdditionalBw = tp_pb.AdditionalBW_AdditionalBW_None
tprofile.UsScheduler.QSchedPolicy = tp_pb.SchedulingPolicy_WRR
tprofile2 := tprofile
- tprofile2.DsScheduler = &openoltpb2.SchedulerAttributes{}
+ tprofile2.DsScheduler = &tp_pb.SchedulerAttributes{}
tprofile2.DsScheduler.Direction = tp_pb.Direction_DOWNSTREAM
tprofile2.DsScheduler.AdditionalBw = tp_pb.AdditionalBW_AdditionalBW_None
tprofile2.DsScheduler.QSchedPolicy = tp_pb.SchedulingPolicy_WRR
@@ -215,7 +213,7 @@
bands[0] = &ofp.OfpMeterBandHeader{Type: ofp.OfpMeterBandType_OFPMBT_DROP, Rate: 1000, BurstSize: 5000, Data: &ofp.OfpMeterBandHeader_Drop{}}
bands[1] = &ofp.OfpMeterBandHeader{Type: ofp.OfpMeterBandType_OFPMBT_DROP, Rate: 2000, BurstSize: 5000, Data: &ofp.OfpMeterBandHeader_Drop{}}
ofpMeterConfig := &ofp.OfpMeterConfig{Flags: 1, MeterId: 1, Bands: bands}
- flowmetadata := &voltha.FlowMetadata{
+ flowmetadata := &ofp.FlowMetadata{
Meters: []*ofp.OfpMeterConfig{ofpMeterConfig},
}
type args struct {
@@ -227,7 +225,7 @@
TpID uint32
UsMeterID uint32
DsMeterID uint32
- flowMetadata *voltha.FlowMetadata
+ flowMetadata *ofp.FlowMetadata
}
tests := []struct {
name string
@@ -579,12 +577,12 @@
fmt.Println(ofpstats6, ofpstats9, ofpstats10)
ofpMeterConfig := &ofp.OfpMeterConfig{Flags: 1, MeterId: 1}
- flowMetadata := &voltha.FlowMetadata{
+ flowMetadata := &ofp.FlowMetadata{
Meters: []*ofp.OfpMeterConfig{ofpMeterConfig},
}
type args struct {
flow *ofp.OfpFlowStats
- flowMetadata *voltha.FlowMetadata
+ flowMetadata *ofp.FlowMetadata
}
tests := []struct {
name string
@@ -1066,8 +1064,8 @@
Onu: "1",
Uni: "16",
},
- UsScheduler: &openoltpb2.SchedulerAttributes{},
- DsScheduler: &openoltpb2.SchedulerAttributes{},
+ UsScheduler: &tp_pb.SchedulerAttributes{},
+ DsScheduler: &tp_pb.SchedulerAttributes{},
}
TpInst.UsScheduler.Priority = 1
TpInst.UsScheduler.Direction = tp_pb.Direction_UPSTREAM
@@ -1245,7 +1243,7 @@
}
ofpStats, _ := fu.MkFlowStat(multicastFlowArgs)
fmt.Println(ofpStats.Id)
- err = flowMgr[0].AddFlow(ctx, ofpStats, &voltha.FlowMetadata{})
+ err = flowMgr[0].AddFlow(ctx, ofpStats, &ofp.FlowMetadata{})
if err != nil {
t.Error("Multicast flow-add failed", err)
return
@@ -1289,23 +1287,23 @@
kwTable0Meter1["meter_id"] = 1
kwTable0Meter1["write_metadata"] = 0x4000000000 // Tech-Profile-ID 64
- flowMetadata1 := voltha.FlowMetadata{Meters: []*voltha.OfpMeterConfig{
+ flowMetadata1 := ofp.FlowMetadata{Meters: []*ofp.OfpMeterConfig{
{
Flags: 5,
MeterId: 1,
- Bands: []*voltha.OfpMeterBandHeader{
+ Bands: []*ofp.OfpMeterBandHeader{
{
- Type: voltha.OfpMeterBandType_OFPMBT_DROP,
+ Type: ofp.OfpMeterBandType_OFPMBT_DROP,
Rate: 16000,
BurstSize: 0,
},
{
- Type: voltha.OfpMeterBandType_OFPMBT_DROP,
+ Type: ofp.OfpMeterBandType_OFPMBT_DROP,
Rate: 32000,
BurstSize: 30,
},
{
- Type: voltha.OfpMeterBandType_OFPMBT_DROP,
+ Type: ofp.OfpMeterBandType_OFPMBT_DROP,
Rate: 64000,
BurstSize: 30,
},
@@ -1489,7 +1487,7 @@
ctx context.Context
flow *ofp.OfpFlowStats
addFlow bool
- flowMetadata *voltha.FlowMetadata
+ flowMetadata *ofp.FlowMetadata
}
tests := []struct {
name string
diff --git a/internal/pkg/core/openolt_test.go b/internal/pkg/core/openolt_test.go
index c9486b6..c549d44 100644
--- a/internal/pkg/core/openolt_test.go
+++ b/internal/pkg/core/openolt_test.go
@@ -36,7 +36,7 @@
"github.com/opencord/voltha-lib-go/v7/pkg/log"
"github.com/opencord/voltha-openolt-adapter/internal/pkg/config"
"github.com/opencord/voltha-openolt-adapter/internal/pkg/olterrors"
- ic "github.com/opencord/voltha-protos/v5/go/inter_container"
+ ca "github.com/opencord/voltha-protos/v5/go/core_adapter"
"github.com/opencord/voltha-protos/v5/go/openflow_13"
ofp "github.com/opencord/voltha-protos/v5/go/openflow_13"
"github.com/opencord/voltha-protos/v5/go/voltha"
@@ -116,7 +116,7 @@
func TestOpenOLT_ActivateImageUpdate(t *testing.T) {
type args struct {
- request *ic.ImageDownloadMessage
+ request *ca.ImageDownloadMessage
}
tests := []struct {
name string
@@ -177,7 +177,7 @@
func TestOpenOLT_CancelImageDownload(t *testing.T) {
type args struct {
- request *ic.ImageDownloadMessage
+ request *ca.ImageDownloadMessage
}
tests := []struct {
name string
@@ -253,7 +253,7 @@
func TestOpenOLT_DownloadImage(t *testing.T) {
type args struct {
- request *ic.ImageDownloadMessage
+ request *ca.ImageDownloadMessage
}
tests := []struct {
name string
@@ -282,7 +282,7 @@
func TestOpenOLT_GetImageDownloadStatus(t *testing.T) {
type args struct {
- request *ic.ImageDownloadMessage
+ request *ca.ImageDownloadMessage
}
tests := []struct {
name string
@@ -318,10 +318,10 @@
name string
fields *fields
args args
- want *ic.SwitchCapability
+ want *ca.SwitchCapability
wantErr error
}{
- {"get_ofp_device_info-1", mockOlt(), args{mockDevice()}, &ic.SwitchCapability{
+ {"get_ofp_device_info-1", mockOlt(), args{mockDevice()}, &ca.SwitchCapability{
Desc: &openflow_13.OfpDesc{
MfrDesc: "VOLTHA Project",
HwDesc: "open_pon",
@@ -348,63 +348,6 @@
}
}
-// func TestOpenOLT_Process_inter_adapter_message(t *testing.T) {
-// type args struct {
-// msg *ic.InterAdapterMessage
-// }
-// var message1 = args{
-// msg: &ic.InterAdapterMessage{
-// Header: &ic.InterAdapterHeader{
-// Id: "olt",
-// ProxyDeviceId: "",
-// ToDeviceId: "onu1",
-// },
-// },
-// }
-// var message2 = args{
-// msg: &ic.InterAdapterMessage{
-// Header: &ic.InterAdapterHeader{
-// Id: "olt",
-// ProxyDeviceId: "olt",
-// ToDeviceId: "olt",
-// Type: ic.InterAdapterMessageType_OMCI_REQUEST,
-// },
-// },
-// }
-// var message3 = args{
-// msg: &ic.InterAdapterMessage{
-// Header: &ic.InterAdapterHeader{
-// Id: "olt",
-// ProxyDeviceId: "olt",
-// ToDeviceId: "olt",
-// Type: ic.InterAdapterMessageType_FLOW_REQUEST,
-// },
-// },
-// }
-// tests := []struct {
-// name string
-// fields *fields
-// args args
-// wantErrType reflect.Type
-// }{
-// {"process_inter_adaptor_messgae-1", mockOlt(), message1,
-// reflect.TypeOf(&olterrors.ErrNotFound{})},
-// {"process_inter_adaptor_messgae-2", mockOlt(), message2,
-// reflect.TypeOf(&olterrors.ErrAdapter{})},
-// {"process_inter_adaptor_messgae-3", mockOlt(), message3,
-// reflect.TypeOf(&olterrors.ErrInvalidValue{})},
-// }
-// for _, tt := range tests {
-// t.Run(tt.name, func(t *testing.T) {
-// oo := testOltObject(tt.fields)
-// if err := oo.Process_inter_adapter_message(context.Background(), tt.args.msg); reflect.TypeOf(err) != tt.wantErrType {
-// t.Errorf("Process_inter_adapter_message() error = %v, wantErr %v",
-// reflect.TypeOf(err), tt.wantErrType)
-// }
-// })
-// }
-// }
-
func TestOpenOLT_RebootDevice(t *testing.T) {
type args struct {
device *voltha.Device
@@ -456,7 +399,7 @@
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
oo := testOltObject(tt.fields)
- if _, err := oo.SendPacketOut(context.Background(), &ic.PacketOut{
+ if _, err := oo.SendPacketOut(context.Background(), &ca.PacketOut{
DeviceId: tt.args.deviceID,
EgressPortNo: uint32(tt.args.egressPortNo),
Packet: tt.args.packet}); !reflect.DeepEqual(err, tt.wantErr) {
@@ -517,7 +460,7 @@
func TestOpenOLT_RevertImageUpdate(t *testing.T) {
type args struct {
- request *ic.ImageDownloadMessage
+ request *ca.ImageDownloadMessage
}
tests := []struct {
name string
@@ -666,9 +609,9 @@
func TestOpenOLT_UpdateFlowsBulk(t *testing.T) {
type args struct {
device *voltha.Device
- flows *voltha.Flows
- groups *voltha.FlowGroups
- flowMetadata *voltha.FlowMetadata
+ flows *ofp.Flows
+ groups *ofp.FlowGroups
+ flowMetadata *ofp.FlowMetadata
}
tests := []struct {
name string
@@ -683,7 +626,7 @@
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
oo := testOltObject(tt.fields)
- if _, err := oo.UpdateFlowsBulk(context.Background(), &ic.BulkFlows{
+ if _, err := oo.UpdateFlowsBulk(context.Background(), &ca.BulkFlows{
Device: tt.args.device,
Flows: tt.args.flows,
Groups: tt.args.groups,
@@ -700,7 +643,7 @@
device *voltha.Device
flows *openflow_13.FlowChanges
groups *openflow_13.FlowGroupChanges
- flowMetadata *voltha.FlowMetadata
+ flowMetadata *ofp.FlowMetadata
}
tests := []struct {
@@ -716,7 +659,7 @@
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
oo := testOltObject(tt.fields)
- if _, err := oo.UpdateFlowsIncrementally(context.Background(), &ic.IncrementalFlows{
+ if _, err := oo.UpdateFlowsIncrementally(context.Background(), &ca.IncrementalFlows{
Device: tt.args.device,
Flows: tt.args.flows,
Groups: tt.args.groups,
@@ -744,7 +687,7 @@
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
oo := testOltObject(tt.fields)
- if _, err := oo.UpdatePmConfig(context.Background(), &ic.PmConfigsInfo{DeviceId: tt.args.device.Id, PmConfigs: tt.args.pmConfigs}); !reflect.DeepEqual(err, tt.wantErr) {
+ if _, err := oo.UpdatePmConfig(context.Background(), &ca.PmConfigsInfo{DeviceId: tt.args.device.Id, PmConfigs: tt.args.pmConfigs}); !reflect.DeepEqual(err, tt.wantErr) {
t.Errorf("Update_pm_config() error = %v, wantErr %v", err, tt.wantErr)
}