Skip to content

Commit

Permalink
[VOL-5378]-ppoeIA and DHCPRA support in voltha openolt adapter
Browse files Browse the repository at this point in the history
Change-Id: I12d304294eca680a64b7f0b02b9ef1783854438f
Signed-off-by: Akash Soni <akash.soni@radisys.com>
  • Loading branch information
akasoni committed Dec 12, 2024
1 parent 07e5755 commit 3bcf5e0
Show file tree
Hide file tree
Showing 7 changed files with 1,134 additions and 258 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.5.3
4.5.3-dev1
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/golang/protobuf v1.5.2
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/opencord/voltha-lib-go/v7 v7.5.3
github.com/opencord/voltha-protos/v5 v5.4.11
github.com/opencord/voltha-protos/v5 v5.6.0
github.com/stretchr/testify v1.7.0
go.etcd.io/etcd v3.3.25+incompatible
google.golang.org/grpc v1.44.0
Expand Down
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,9 @@ github.com/onsi/gomega v1.14.0 h1:ep6kpPVwmr/nTbklSx2nrLNSIO62DoYAhnPNIMhK8gI=
github.com/onsi/gomega v1.14.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0=
github.com/opencord/voltha-lib-go/v7 v7.5.3 h1:pIw5056O8UocHyZcT77rh9YIoYo+f7E1cC3Yo+y57Ys=
github.com/opencord/voltha-lib-go/v7 v7.5.3/go.mod h1:rlKcpoY1VJeM6WUA4d0DYeWddKTJ6AQSCiX0CLSv6rA=
github.com/opencord/voltha-protos/v5 v5.4.11 h1:Q9j8yJO5HDf0D3jE8KmIgUWJjV4GIYgqiDEiPI3Zcmc=
github.com/opencord/voltha-protos/v5 v5.4.11/go.mod h1:E/Jn3DNu8VGRBCgIWSSg4sWtTBiNuQGSFvHyNH1XlyM=
github.com/opencord/voltha-protos/v5 v5.6.0 h1:rOy1PftAmmGqly2Iyuz3U877Wi2izi5Ji/0kZK5YQpc=
github.com/opencord/voltha-protos/v5 v5.6.0/go.mod h1:E/Jn3DNu8VGRBCgIWSSg4sWtTBiNuQGSFvHyNH1XlyM=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
Expand Down
25 changes: 25 additions & 0 deletions internal/pkg/core/device_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -3649,6 +3649,31 @@ func (dh *DeviceHandler) getOltPortCounters(ctx context.Context, oltPortInfo *ex
return errResp(extension.GetValueResponse_ERROR, extension.GetValueResponse_INTERNAL_ERROR)
}

func (dh *DeviceHandler) getOltOffloadStats(ctx context.Context, oltPortInfo *extension.GetOffloadedAppsStatisticsRequest) *extension.SingleGetValueResponse {

singleValResp := extension.SingleGetValueResponse{
Response: &extension.GetValueResponse{
Status: extension.GetValueResponse_OK,
Response: &extension.GetValueResponse_OffloadedAppsStats{
OffloadedAppsStats: &extension.GetOffloadedAppsStatisticsResponse{},
},
},
}

return &singleValResp
}

func (dh *DeviceHandler) setOltOffloadStats(ctx context.Context, congig *extension.AppOffloadConfig) *extension.SingleSetValueResponse {

singleValResp := extension.SingleSetValueResponse{
Response: &extension.SetValueResponse{
Status: extension.SetValueResponse_OK,
},
}

return &singleValResp
}

func (dh *DeviceHandler) getOnuPonCounters(ctx context.Context, onuPonInfo *extension.GetOnuCountersRequest) *extension.SingleGetValueResponse {

singleValResp := extension.SingleGetValueResponse{
Expand Down
33 changes: 28 additions & 5 deletions internal/pkg/core/openolt.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,8 @@ func (oo *OpenOLT) GetSingleValue(ctx context.Context, request *extension.Single
return handler.getRxPower(ctx, reqType.RxPower), nil
case *extension.GetValueRequest_OltRxPower:
return handler.getPONRxPower(ctx, reqType.OltRxPower), nil
case *extension.GetValueRequest_OffloadedAppsStats:
return handler.getOltOffloadStats(ctx, reqType.OffloadedAppsStats), nil
default:
return errResp(extension.GetValueResponse_ERROR, extension.GetValueResponse_UNSUPPORTED), nil
}
Expand All @@ -416,6 +418,32 @@ func (oo *OpenOLT) GetSingleValue(ctx context.Context, request *extension.Single
return errResp(extension.GetValueResponse_ERROR, extension.GetValueResponse_INVALID_DEVICE_ID), nil
}

// SetSingleValue is implemented
func (oo *OpenOLT) SetSingleValue(ctx context.Context, request *extension.SingleSetValueRequest) (*extension.SingleSetValueResponse, error) {
logger.Infow(ctx, "single_set_value_request", log.Fields{"request": request})

errResp := func(status extension.SetValueResponse_Status,
reason extension.SetValueResponse_ErrorReason) *extension.SingleSetValueResponse {
return &extension.SingleSetValueResponse{
Response: &extension.SetValueResponse{
Status: status,
ErrReason: reason,
},
}
}
if handler := oo.getDeviceHandler(request.TargetId); handler != nil {
switch reqType := request.GetRequest().GetRequest().(type) {
case *extension.SetValueRequest_AppOffloadConfig:
return handler.setOltOffloadStats(ctx, reqType.AppOffloadConfig), nil
default:
return errResp(extension.SetValueResponse_ERROR, extension.SetValueResponse_UNSUPPORTED), nil
}
}

logger.Infow(ctx, "Single_set_value_request failed ", log.Fields{"request": request})
return errResp(extension.SetValueResponse_ERROR, extension.SetValueResponse_INVALID_DEVICE_ID), nil
}

/*
* OLT Inter-adapter service
*/
Expand Down Expand Up @@ -519,11 +547,6 @@ func (oo *OpenOLT) SetExtValue(context.Context, *ca.SetExtValueMessage) (*empty.
return nil, olterrors.ErrNotImplemented
}

// SetSingleValue is unimplemented
func (oo *OpenOLT) SetSingleValue(context.Context, *extension.SingleSetValueRequest) (*extension.SingleSetValueResponse, error) {
return nil, olterrors.ErrNotImplemented
}

// StartOmciTest not implemented
func (oo *OpenOLT) StartOmciTest(ctx context.Context, test *ca.OMCITest) (*omci.TestResponse, error) {
return nil, olterrors.ErrNotImplemented
Expand Down
Loading

0 comments on commit 3bcf5e0

Please sign in to comment.