[VOL-4371] Voltha protos cleanup
Change-Id: Id8dc0fc56aaf4228e9f6c7e4629a6a1897de5b31
diff --git a/internal/pkg/mock/voltha_client_mock.go b/internal/pkg/mock/voltha_client_mock.go
index 735c4e4..7c1933e 100644
--- a/internal/pkg/mock/voltha_client_mock.go
+++ b/internal/pkg/mock/voltha_client_mock.go
@@ -21,6 +21,7 @@
. "github.com/golang/protobuf/ptypes/empty"
"github.com/opencord/voltha-protos/v5/go/common"
+ "github.com/opencord/voltha-protos/v5/go/extension"
"github.com/opencord/voltha-protos/v5/go/omci"
"github.com/opencord/voltha-protos/v5/go/openflow_13"
. "github.com/opencord/voltha-protos/v5/go/voltha"
@@ -32,14 +33,6 @@
LogicalPorts LogicalPorts
}
-func (c MockVolthaClient) GetMembership(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Membership, error) {
- return &Membership{}, nil
-}
-
-func (c MockVolthaClient) UpdateMembership(ctx context.Context, in *Membership, opts ...grpc.CallOption) (*Empty, error) {
- return &Empty{}, nil
-}
-
func (c MockVolthaClient) GetVoltha(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Voltha, error) {
return &Voltha{}, nil
}
@@ -196,10 +189,6 @@
return &DeviceType{}, nil
}
-func (c MockVolthaClient) ListDeviceGroups(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*DeviceGroups, error) {
- return &DeviceGroups{}, nil
-}
-
func (c MockVolthaClient) StreamPacketsOut(ctx context.Context, opts ...grpc.CallOption) (VolthaService_StreamPacketsOutClient, error) {
return nil, nil
}
@@ -212,10 +201,6 @@
return nil, nil
}
-func (c MockVolthaClient) GetDeviceGroup(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*DeviceGroup, error) {
- return &DeviceGroup{}, nil
-}
-
func (c MockVolthaClient) CreateEventFilter(ctx context.Context, in *EventFilter, opts ...grpc.CallOption) (*EventFilter, error) {
return &EventFilter{}, nil
}
@@ -256,10 +241,6 @@
return &common.OperationResp{}, nil
}
-func (c MockVolthaClient) Subscribe(ctx context.Context, in *OfAgentSubscriber, opts ...grpc.CallOption) (*OfAgentSubscriber, error) {
- return &OfAgentSubscriber{}, nil
-}
-
func (c MockVolthaClient) EnablePort(ctx context.Context, in *Port, opts ...grpc.CallOption) (*Empty, error) {
return &Empty{}, nil
}
@@ -268,19 +249,19 @@
return &Empty{}, nil
}
-func (c MockVolthaClient) GetExtValue(ctx context.Context, in *common.ValueSpecifier, opts ...grpc.CallOption) (*common.ReturnValues, error) {
- return &common.ReturnValues{}, nil
+func (c MockVolthaClient) GetExtValue(ctx context.Context, in *extension.ValueSpecifier, opts ...grpc.CallOption) (*extension.ReturnValues, error) {
+ return &extension.ReturnValues{}, nil
}
-func (c MockVolthaClient) StartOmciTestAction(ctx context.Context, in *OmciTestRequest, opts ...grpc.CallOption) (*TestResponse, error) {
- return &TestResponse{}, nil
+func (c MockVolthaClient) StartOmciTestAction(ctx context.Context, in *omci.OmciTestRequest, opts ...grpc.CallOption) (*omci.TestResponse, error) {
+ return &omci.TestResponse{}, nil
}
func (c MockVolthaClient) ForceDeleteDevice(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*Empty, error) {
return &Empty{}, nil
}
-func (c MockVolthaClient) SetExtValue(ctx context.Context, in *ValueSet, opts ...grpc.CallOption) (*Empty, error) {
+func (c MockVolthaClient) SetExtValue(ctx context.Context, in *extension.ValueSet, opts ...grpc.CallOption) (*Empty, error) {
return &Empty{}, nil
}
diff --git a/internal/pkg/ofagent/ofagent.go b/internal/pkg/ofagent/ofagent.go
index efaf39c..bb1ee32 100644
--- a/internal/pkg/ofagent/ofagent.go
+++ b/internal/pkg/ofagent/ofagent.go
@@ -26,7 +26,6 @@
"github.com/opencord/voltha-lib-go/v7/pkg/log"
"github.com/opencord/voltha-lib-go/v7/pkg/probe"
"github.com/opencord/voltha-protos/v5/go/openflow_13"
- "github.com/opencord/voltha-protos/v5/go/voltha"
"google.golang.org/grpc"
)
@@ -57,8 +56,8 @@
clientMap map[string]*openflow.OFClient
events chan ofaEvent
- packetInChannel chan *voltha.PacketIn
- packetOutChannel chan *voltha.PacketOut
+ packetInChannel chan *openflow_13.PacketIn
+ packetOutChannel chan *openflow_13.PacketOut
changeEventChannel chan *openflow_13.ChangeEvent
}
@@ -70,8 +69,8 @@
ConnectionMaxRetries: config.ConnectionMaxRetries,
ConnectionRetryDelay: config.ConnectionRetryDelay,
volthaClient: &holder.VolthaServiceClientHolder{},
- packetInChannel: make(chan *voltha.PacketIn),
- packetOutChannel: make(chan *voltha.PacketOut),
+ packetInChannel: make(chan *openflow_13.PacketIn),
+ packetOutChannel: make(chan *openflow_13.PacketOut),
changeEventChannel: make(chan *openflow_13.ChangeEvent),
clientMap: make(map[string]*openflow.OFClient),
events: make(chan ofaEvent, 100),
diff --git a/internal/pkg/ofagent/packetIn.go b/internal/pkg/ofagent/packetIn.go
index 375e84f..7b396fc 100644
--- a/internal/pkg/ofagent/packetIn.go
+++ b/internal/pkg/ofagent/packetIn.go
@@ -26,7 +26,6 @@
"github.com/opencord/ofagent-go/internal/pkg/openflow"
"github.com/opencord/voltha-lib-go/v7/pkg/log"
"github.com/opencord/voltha-protos/v5/go/openflow_13"
- "github.com/opencord/voltha-protos/v5/go/voltha"
"google.golang.org/grpc"
)
@@ -109,37 +108,37 @@
field := oxmField.GetField()
ofbField := field.(*openflow_13.OfpOxmField_OfbField).OfbField
switch ofbField.Type {
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_IN_PORT:
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_IN_PORT:
ofpInPort := ofp.NewOxmInPort()
val := ofbField.GetValue().(*openflow_13.OfpOxmOfbField_Port)
ofpInPort.Value = ofp.Port(val.Port)
fields = append(fields, ofpInPort)
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_ETH_TYPE:
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_ETH_TYPE:
ofpEthType := ofp.NewOxmEthType()
val := ofbField.GetValue().(*openflow_13.OfpOxmOfbField_EthType)
ofpEthType.Value = ofp.EthernetType(val.EthType)
fields = append(fields, ofpEthType)
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_IN_PHY_PORT:
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_IN_PHY_PORT:
ofpInPhyPort := ofp.NewOxmInPhyPort()
val := ofbField.GetValue().(*openflow_13.OfpOxmOfbField_PhysicalPort)
ofpInPhyPort.Value = ofp.Port(val.PhysicalPort)
fields = append(fields, ofpInPhyPort)
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_IP_PROTO:
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_IP_PROTO:
ofpIpProto := ofp.NewOxmIpProto()
val := ofbField.GetValue().(*openflow_13.OfpOxmOfbField_IpProto)
ofpIpProto.Value = ofp.IpPrototype(val.IpProto)
fields = append(fields, ofpIpProto)
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_UDP_SRC:
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_UDP_SRC:
ofpUdpSrc := ofp.NewOxmUdpSrc()
val := ofbField.GetValue().(*openflow_13.OfpOxmOfbField_UdpSrc)
ofpUdpSrc.Value = uint16(val.UdpSrc)
fields = append(fields, ofpUdpSrc)
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_UDP_DST:
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_UDP_DST:
ofpUdpDst := ofp.NewOxmUdpDst()
val := ofbField.GetValue().(*openflow_13.OfpOxmOfbField_UdpDst)
ofpUdpDst.Value = uint16(val.UdpDst)
fields = append(fields, ofpUdpDst)
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_VLAN_VID:
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_VLAN_VID:
ofpVlanVid := ofp.NewOxmVlanVid()
val := ofbField.GetValue()
if val != nil {
diff --git a/internal/pkg/openflow/client.go b/internal/pkg/openflow/client.go
index 594f307..9097444 100644
--- a/internal/pkg/openflow/client.go
+++ b/internal/pkg/openflow/client.go
@@ -25,7 +25,7 @@
ofp "github.com/opencord/goloxi/of13"
"github.com/opencord/ofagent-go/internal/pkg/holder"
"github.com/opencord/voltha-lib-go/v7/pkg/log"
- "github.com/opencord/voltha-protos/v5/go/voltha"
+ "github.com/opencord/voltha-protos/v5/go/openflow_13"
)
var NoVolthaConnectionError = errors.New("no-voltha-connection")
@@ -112,7 +112,7 @@
OFControllerEndPoints []string
DeviceID string
VolthaClient *holder.VolthaServiceClientHolder
- PacketOutChannel chan *voltha.PacketOut
+ PacketOutChannel chan *openflow_13.PacketOut
ConnectionMaxRetries int
ConnectionRetryDelay time.Duration
diff --git a/internal/pkg/openflow/connection.go b/internal/pkg/openflow/connection.go
index 1806a99..c625aac 100644
--- a/internal/pkg/openflow/connection.go
+++ b/internal/pkg/openflow/connection.go
@@ -30,14 +30,14 @@
ofp "github.com/opencord/goloxi/of13"
"github.com/opencord/ofagent-go/internal/pkg/holder"
"github.com/opencord/voltha-lib-go/v7/pkg/log"
- "github.com/opencord/voltha-protos/v5/go/voltha"
+ "github.com/opencord/voltha-protos/v5/go/openflow_13"
)
type OFConnection struct {
OFControllerEndPoint string
DeviceID string
VolthaClient *holder.VolthaServiceClientHolder
- PacketOutChannel chan *voltha.PacketOut
+ PacketOutChannel chan *openflow_13.PacketOut
ConnectionMaxRetries int
ConnectionRetryDelay time.Duration
diff --git a/internal/pkg/openflow/flowMod.go b/internal/pkg/openflow/flowMod.go
index fd71798..a391488 100644
--- a/internal/pkg/openflow/flowMod.go
+++ b/internal/pkg/openflow/flowMod.go
@@ -25,7 +25,6 @@
ofp "github.com/opencord/goloxi/of13"
"github.com/opencord/voltha-lib-go/v7/pkg/log"
"github.com/opencord/voltha-protos/v5/go/openflow_13"
- "github.com/opencord/voltha-protos/v5/go/voltha"
)
var oxmMap = map[string]int32{
@@ -92,88 +91,88 @@
}
// Construct the match
- var oxmList []*voltha.OfpOxmField
+ var oxmList []*openflow_13.OfpOxmField
for _, oxmField := range flowAdd.Match.GetOxmList() {
name := oxmMap[oxmField.GetOXMName()]
val := oxmField.GetOXMValue()
- field := voltha.OfpOxmOfbField{Type: voltha.OxmOfbFieldTypes(name)}
- ofpOxmField := voltha.OfpOxmField{
+ field := openflow_13.OfpOxmOfbField{Type: openflow_13.OxmOfbFieldTypes(name)}
+ ofpOxmField := openflow_13.OfpOxmField{
OxmClass: ofp.OFPXMCOpenflowBasic,
Field: &openflow_13.OfpOxmField_OfbField{OfbField: &field},
}
- switch voltha.OxmOfbFieldTypes(name) {
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_IN_PORT:
- field.Value = &voltha.OfpOxmOfbField_Port{
+ switch openflow_13.OxmOfbFieldTypes(name) {
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_IN_PORT:
+ field.Value = &openflow_13.OfpOxmOfbField_Port{
Port: uint32(val.(ofp.Port)),
}
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_IN_PHY_PORT:
- field.Value = &voltha.OfpOxmOfbField_PhysicalPort{
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_IN_PHY_PORT:
+ field.Value = &openflow_13.OfpOxmOfbField_PhysicalPort{
PhysicalPort: val.(uint32),
}
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_METADATA:
- field.Value = &voltha.OfpOxmOfbField_TableMetadata{
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_METADATA:
+ field.Value = &openflow_13.OfpOxmOfbField_TableMetadata{
TableMetadata: val.(uint64),
}
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_ETH_TYPE:
- field.Value = &voltha.OfpOxmOfbField_EthType{
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_ETH_TYPE:
+ field.Value = &openflow_13.OfpOxmOfbField_EthType{
EthType: uint32(val.(ofp.EthernetType)),
}
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_IP_PROTO:
- field.Value = &voltha.OfpOxmOfbField_IpProto{
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_IP_PROTO:
+ field.Value = &openflow_13.OfpOxmOfbField_IpProto{
IpProto: uint32(val.(ofp.IpPrototype)),
}
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_IPV4_DST:
- field.Value = &voltha.OfpOxmOfbField_Ipv4Dst{
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_IPV4_DST:
+ field.Value = &openflow_13.OfpOxmOfbField_Ipv4Dst{
Ipv4Dst: binary.BigEndian.Uint32(val.(net.IP)),
}
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_ETH_DST:
- field.Value = &voltha.OfpOxmOfbField_EthDst{
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_ETH_DST:
+ field.Value = &openflow_13.OfpOxmOfbField_EthDst{
EthDst: val.(net.HardwareAddr),
}
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_ETH_SRC:
- field.Value = &voltha.OfpOxmOfbField_EthSrc{
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_ETH_SRC:
+ field.Value = &openflow_13.OfpOxmOfbField_EthSrc{
EthSrc: val.(net.HardwareAddr),
}
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_UDP_SRC:
- field.Value = &voltha.OfpOxmOfbField_UdpSrc{
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_UDP_SRC:
+ field.Value = &openflow_13.OfpOxmOfbField_UdpSrc{
UdpSrc: uint32(val.(uint16)),
}
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_UDP_DST:
- field.Value = &voltha.OfpOxmOfbField_UdpDst{
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_UDP_DST:
+ field.Value = &openflow_13.OfpOxmOfbField_UdpDst{
UdpDst: uint32(val.(uint16)),
}
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_VLAN_VID:
- field.Value = &voltha.OfpOxmOfbField_VlanVid{
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_VLAN_VID:
+ field.Value = &openflow_13.OfpOxmOfbField_VlanVid{
VlanVid: uint32((val.(uint16) & 0xfff) | 0x1000),
}
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_VLAN_PCP:
- field.Value = &voltha.OfpOxmOfbField_VlanPcp{
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_VLAN_PCP:
+ field.Value = &openflow_13.OfpOxmOfbField_VlanPcp{
VlanPcp: uint32(val.(uint8)),
}
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_MPLS_LABEL:
- field.Value = &voltha.OfpOxmOfbField_MplsLabel{
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_MPLS_LABEL:
+ field.Value = &openflow_13.OfpOxmOfbField_MplsLabel{
MplsLabel: val.(uint32),
}
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_MPLS_BOS:
- field.Value = &voltha.OfpOxmOfbField_MplsBos{
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_MPLS_BOS:
+ field.Value = &openflow_13.OfpOxmOfbField_MplsBos{
MplsBos: uint32(val.(uint8)),
}
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_MPLS_TC:
- field.Value = &voltha.OfpOxmOfbField_MplsTc{
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_MPLS_TC:
+ field.Value = &openflow_13.OfpOxmOfbField_MplsTc{
MplsTc: val.(uint32),
}
case 200: // voltha-protos doesn't actually have a type for vlan_mask
- field = voltha.OfpOxmOfbField{Type: voltha.OxmOfbFieldTypes(oxmMap["vlan_vid"])}
+ field = openflow_13.OfpOxmOfbField{Type: openflow_13.OxmOfbFieldTypes(oxmMap["vlan_vid"])}
field.HasMask = true
- ofpOxmField = voltha.OfpOxmField{
+ ofpOxmField = openflow_13.OfpOxmField{
OxmClass: ofp.OFPXMCOpenflowBasic,
Field: &openflow_13.OfpOxmField_OfbField{OfbField: &field},
}
- field.Value = &voltha.OfpOxmOfbField_VlanVid{
+ field.Value = &openflow_13.OfpOxmOfbField_VlanVid{
VlanVid: uint32(val.(uint16)),
}
vidMask := val.(uint16)
- field.Mask = &voltha.OfpOxmOfbField_VlanVidMask{
+ field.Mask = &openflow_13.OfpOxmOfbField_VlanVidMask{
VlanVidMask: uint32(vidMask),
}
}
@@ -181,10 +180,10 @@
}
// Construct the instructions
- var instructions []*voltha.OfpInstruction
+ var instructions []*openflow_13.OfpInstruction
for _, ofpInstruction := range flowAdd.GetInstructions() {
instructionType := ofpInstruction.GetType()
- instruction := voltha.OfpInstruction{Type: uint32(instructionType)}
+ instruction := openflow_13.OfpInstruction{Type: uint32(instructionType)}
switch instructionType {
case ofp.OFPITGotoTable:
instruction.Data = &openflow_13.OfpInstruction_GotoTable{
@@ -232,11 +231,11 @@
// Construct the request
flowUpdate := openflow_13.FlowTableUpdate{
Id: ofc.DeviceID,
- FlowMod: &voltha.OfpFlowMod{
+ FlowMod: &openflow_13.OfpFlowMod{
Cookie: flowAdd.Cookie,
CookieMask: flowAdd.CookieMask,
TableId: uint32(flowAdd.TableId),
- Command: voltha.OfpFlowModCommand_OFPFC_ADD,
+ Command: openflow_13.OfpFlowModCommand_OFPFC_ADD,
IdleTimeout: uint32(flowAdd.IdleTimeout),
HardTimeout: uint32(flowAdd.HardTimeout),
Priority: uint32(flowAdd.Priority),
@@ -244,8 +243,8 @@
OutPort: uint32(flowAdd.OutPort),
OutGroup: uint32(flowAdd.OutGroup),
Flags: uint32(flowAdd.Flags),
- Match: &voltha.OfpMatch{
- Type: voltha.OfpMatchType(flowAdd.Match.GetType()),
+ Match: &openflow_13.OfpMatch{
+ Type: openflow_13.OfpMatchType(flowAdd.Match.GetType()),
OxmFields: oxmList,
},
@@ -363,76 +362,76 @@
}
// Construct match
- var oxmList []*voltha.OfpOxmField
+ var oxmList []*openflow_13.OfpOxmField
for _, oxmField := range flowDeleteStrict.Match.GetOxmList() {
name := oxmMap[oxmField.GetOXMName()]
val := oxmField.GetOXMValue()
- var ofpOxmField voltha.OfpOxmField
+ var ofpOxmField openflow_13.OfpOxmField
ofpOxmField.OxmClass = ofp.OFPXMCOpenflowBasic
- var field voltha.OfpOxmOfbField
- field.Type = voltha.OxmOfbFieldTypes(name)
+ var field openflow_13.OfpOxmOfbField
+ field.Type = openflow_13.OxmOfbFieldTypes(name)
var x openflow_13.OfpOxmField_OfbField
x.OfbField = &field
ofpOxmField.Field = &x
- switch voltha.OxmOfbFieldTypes(name) {
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_IN_PORT:
- field.Value = &voltha.OfpOxmOfbField_Port{
+ switch openflow_13.OxmOfbFieldTypes(name) {
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_IN_PORT:
+ field.Value = &openflow_13.OfpOxmOfbField_Port{
Port: uint32(val.(ofp.Port)),
}
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_IN_PHY_PORT:
- field.Value = &voltha.OfpOxmOfbField_PhysicalPort{
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_IN_PHY_PORT:
+ field.Value = &openflow_13.OfpOxmOfbField_PhysicalPort{
PhysicalPort: val.(uint32),
}
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_METADATA:
- field.Value = &voltha.OfpOxmOfbField_TableMetadata{
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_METADATA:
+ field.Value = &openflow_13.OfpOxmOfbField_TableMetadata{
TableMetadata: val.(uint64),
}
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_ETH_TYPE:
- field.Value = &voltha.OfpOxmOfbField_EthType{
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_ETH_TYPE:
+ field.Value = &openflow_13.OfpOxmOfbField_EthType{
EthType: uint32(val.(ofp.EthernetType)),
}
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_IP_PROTO:
- field.Value = &voltha.OfpOxmOfbField_IpProto{
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_IP_PROTO:
+ field.Value = &openflow_13.OfpOxmOfbField_IpProto{
IpProto: uint32(val.(ofp.IpPrototype)),
}
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_IPV4_DST:
- field.Value = &voltha.OfpOxmOfbField_Ipv4Dst{
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_IPV4_DST:
+ field.Value = &openflow_13.OfpOxmOfbField_Ipv4Dst{
Ipv4Dst: binary.BigEndian.Uint32(val.(net.IP)),
}
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_ETH_DST:
- field.Value = &voltha.OfpOxmOfbField_EthDst{
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_ETH_DST:
+ field.Value = &openflow_13.OfpOxmOfbField_EthDst{
EthDst: val.(net.HardwareAddr),
}
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_UDP_SRC:
- field.Value = &voltha.OfpOxmOfbField_UdpSrc{
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_UDP_SRC:
+ field.Value = &openflow_13.OfpOxmOfbField_UdpSrc{
UdpSrc: uint32(val.(uint16)),
}
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_UDP_DST:
- field.Value = &voltha.OfpOxmOfbField_UdpDst{
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_UDP_DST:
+ field.Value = &openflow_13.OfpOxmOfbField_UdpDst{
UdpDst: uint32(val.(uint16)),
}
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_VLAN_VID:
- field.Value = &voltha.OfpOxmOfbField_VlanVid{
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_VLAN_VID:
+ field.Value = &openflow_13.OfpOxmOfbField_VlanVid{
VlanVid: uint32(val.(uint16)),
}
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_VLAN_PCP:
- field.Value = &voltha.OfpOxmOfbField_VlanPcp{
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_VLAN_PCP:
+ field.Value = &openflow_13.OfpOxmOfbField_VlanPcp{
VlanPcp: uint32(val.(uint8)),
}
case 200: // voltha-protos doesn't actually have a type for vlan_mask
- field = voltha.OfpOxmOfbField{Type: voltha.OxmOfbFieldTypes(oxmMap["vlan_vid"])}
+ field = openflow_13.OfpOxmOfbField{Type: openflow_13.OxmOfbFieldTypes(oxmMap["vlan_vid"])}
field.HasMask = true
- ofpOxmField = voltha.OfpOxmField{
+ ofpOxmField = openflow_13.OfpOxmField{
OxmClass: ofp.OFPXMCOpenflowBasic,
Field: &openflow_13.OfpOxmField_OfbField{OfbField: &field},
}
- field.Value = &voltha.OfpOxmOfbField_VlanVid{
+ field.Value = &openflow_13.OfpOxmOfbField_VlanVid{
VlanVid: uint32(val.(uint16)),
}
vidMask := val.(uint16)
- field.Mask = &voltha.OfpOxmOfbField_VlanVidMask{
+ field.Mask = &openflow_13.OfpOxmOfbField_VlanVidMask{
VlanVidMask: uint32(vidMask),
}
}
@@ -449,11 +448,11 @@
// Construct request
flowUpdate := openflow_13.FlowTableUpdate{
Id: ofc.DeviceID,
- FlowMod: &voltha.OfpFlowMod{
+ FlowMod: &openflow_13.OfpFlowMod{
Cookie: flowDeleteStrict.Cookie,
CookieMask: flowDeleteStrict.CookieMask,
TableId: uint32(flowDeleteStrict.TableId),
- Command: voltha.OfpFlowModCommand_OFPFC_DELETE_STRICT,
+ Command: openflow_13.OfpFlowModCommand_OFPFC_DELETE_STRICT,
IdleTimeout: uint32(flowDeleteStrict.IdleTimeout),
HardTimeout: uint32(flowDeleteStrict.HardTimeout),
Priority: uint32(flowDeleteStrict.Priority),
@@ -461,8 +460,8 @@
OutPort: uint32(flowDeleteStrict.OutPort),
OutGroup: uint32(flowDeleteStrict.OutGroup),
Flags: uint32(flowDeleteStrict.Flags),
- Match: &voltha.OfpMatch{
- Type: voltha.OfpMatchType(flowDeleteStrict.Match.GetType()),
+ Match: &openflow_13.OfpMatch{
+ Type: openflow_13.OfpMatchType(flowDeleteStrict.Match.GetType()),
OxmFields: oxmList,
},
},
diff --git a/internal/pkg/openflow/group.go b/internal/pkg/openflow/group.go
index ae45ede..6d55867 100644
--- a/internal/pkg/openflow/group.go
+++ b/internal/pkg/openflow/group.go
@@ -24,7 +24,6 @@
ofp "github.com/opencord/goloxi/of13"
"github.com/opencord/voltha-lib-go/v7/pkg/log"
"github.com/opencord/voltha-protos/v5/go/openflow_13"
- "github.com/opencord/voltha-protos/v5/go/voltha"
)
func (ofc *OFConnection) handleGroupMod(ctx context.Context, groupMod ofp.IGroupMod) {
@@ -40,7 +39,7 @@
groupUpdate := &openflow_13.FlowGroupTableUpdate{
Id: ofc.DeviceID,
- GroupMod: &voltha.OfpGroupMod{
+ GroupMod: &openflow_13.OfpGroupMod{
Command: openflowGroupModCommandToVoltha(ctx, groupMod.GetCommand()),
Type: openflowGroupTypeToVoltha(ctx, groupMod.GetGroupType()),
GroupId: groupMod.GetGroupId(),
diff --git a/internal/pkg/openflow/packet.go b/internal/pkg/openflow/packet.go
index 7e7b591..b01579e 100644
--- a/internal/pkg/openflow/packet.go
+++ b/internal/pkg/openflow/packet.go
@@ -22,7 +22,7 @@
ofp "github.com/opencord/goloxi/of13"
"github.com/opencord/voltha-lib-go/v7/pkg/log"
- "github.com/opencord/voltha-protos/v5/go/voltha"
+ "github.com/opencord/voltha-protos/v5/go/openflow_13"
)
func (ofc *OFConnection) handlePacketOut(ctx context.Context, packetOut *ofp.PacketOut) {
@@ -38,15 +38,15 @@
}
// Collection actions
- var actions []*voltha.OfpAction
+ var actions []*openflow_13.OfpAction
for _, action := range packetOut.GetActions() {
actions = append(actions, extractAction(action))
}
// Build packet out
- pbPacketOut := voltha.PacketOut{
+ pbPacketOut := openflow_13.PacketOut{
Id: ofc.DeviceID,
- PacketOut: &voltha.OfpPacketOut{
+ PacketOut: &openflow_13.OfpPacketOut{
BufferId: packetOut.GetBufferId(),
InPort: uint32(packetOut.GetInPort()),
Actions: actions,
diff --git a/internal/pkg/openflow/parseGrpcReturn.go b/internal/pkg/openflow/parseGrpcReturn.go
index 67de283..b6c3ecb 100644
--- a/internal/pkg/openflow/parseGrpcReturn.go
+++ b/internal/pkg/openflow/parseGrpcReturn.go
@@ -37,27 +37,27 @@
}
switch ofbField.Type {
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_IN_PORT:
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_IN_PORT:
ofpInPort := ofp.NewOxmInPort()
val := ofbField.GetValue().(*openflow_13.OfpOxmOfbField_Port)
ofpInPort.Value = ofp.Port(val.Port)
return ofpInPort, nil
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_ETH_TYPE:
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_ETH_TYPE:
ofpEthType := ofp.NewOxmEthType()
val := ofbField.GetValue().(*openflow_13.OfpOxmOfbField_EthType)
ofpEthType.Value = ofp.EthernetType(val.EthType)
return ofpEthType, nil
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_IN_PHY_PORT:
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_IN_PHY_PORT:
ofpInPhyPort := ofp.NewOxmInPhyPort()
val := ofbField.GetValue().(*openflow_13.OfpOxmOfbField_PhysicalPort)
ofpInPhyPort.Value = ofp.Port(val.PhysicalPort)
return ofpInPhyPort, nil
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_IP_PROTO:
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_IP_PROTO:
ofpIpProto := ofp.NewOxmIpProto()
val := ofbField.GetValue().(*openflow_13.OfpOxmOfbField_IpProto)
ofpIpProto.Value = ofp.IpPrototype(val.IpProto)
return ofpIpProto, nil
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_IPV4_DST:
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_IPV4_DST:
ofpIpv4Dst := ofp.NewOxmIpv4Dst()
val := ofbField.GetValue().(*openflow_13.OfpOxmOfbField_Ipv4Dst)
buf := new(bytes.Buffer)
@@ -68,17 +68,17 @@
}
ofpIpv4Dst.Value = buf.Bytes()
return ofpIpv4Dst, nil
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_UDP_SRC:
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_UDP_SRC:
ofpUdpSrc := ofp.NewOxmUdpSrc()
val := ofbField.GetValue().(*openflow_13.OfpOxmOfbField_UdpSrc)
ofpUdpSrc.Value = uint16(val.UdpSrc)
return ofpUdpSrc, nil
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_UDP_DST:
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_UDP_DST:
ofpUdpDst := ofp.NewOxmUdpDst()
val := ofbField.GetValue().(*openflow_13.OfpOxmOfbField_UdpDst)
ofpUdpDst.Value = uint16(val.UdpDst)
return ofpUdpDst, nil
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_VLAN_VID:
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_VLAN_VID:
ofpVlanVid := ofp.NewOxmVlanVid()
val := ofbField.GetValue()
if val == nil {
@@ -102,18 +102,18 @@
}
ofpVlanVid.Value = uint16(vlanId.VlanVid) | 0x1000
return ofpVlanVid, nil
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_METADATA:
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_METADATA:
ofpMetadata := ofp.NewOxmMetadata()
val := ofbField.GetValue().(*openflow_13.OfpOxmOfbField_TableMetadata)
ofpMetadata.Value = val.TableMetadata
return ofpMetadata, nil
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_VLAN_PCP:
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_VLAN_PCP:
ofpVlanPcp := ofp.NewOxmVlanPcp()
val := ofbField.GetValue()
vlanPcp := val.(*openflow_13.OfpOxmOfbField_VlanPcp)
ofpVlanPcp.Value = uint8(vlanPcp.VlanPcp)
return ofpVlanPcp, nil
- case voltha.OxmOfbFieldTypes_OFPXMT_OFB_ETH_DST:
+ case openflow_13.OxmOfbFieldTypes_OFPXMT_OFB_ETH_DST:
ofpEthDst := ofp.NewOxmEthDst()
val := ofbField.GetValue().(*openflow_13.OfpOxmOfbField_EthDst)
ofpEthDst.Value = val.EthDst