Skip to content

Commit

Permalink
Adding gNOI Certificate stub.
Browse files Browse the repository at this point in the history
  • Loading branch information
rhalstea authored and divyagayathri-hcl committed Jul 19, 2024
1 parent 294a324 commit 2028411
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions thinkit/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ cc_library(
hdrs = ["switch.h"],
deps = [
"@com_github_gnmi//proto/gnmi:gnmi_cc_grpc_proto",
"@com_github_gnoi//cert:cert_cc_grpc_proto",
"@com_github_gnoi//diag:diag_cc_grpc_proto",
"@com_github_gnoi//system:system_cc_grpc_proto",
"@com_github_grpc_grpc//:grpc++",
Expand All @@ -54,6 +55,7 @@ cc_library(
deps = [
":switch",
"@com_github_gnmi//proto/gnmi:gnmi_cc_grpc_proto",
"@com_github_gnoi//cert:cert_cc_grpc_proto",
"@com_github_gnoi//diag:diag_cc_grpc_proto",
"@com_github_gnoi//system:system_cc_grpc_proto",
"@com_github_p4lang_p4runtime//:p4runtime_cc_grpc",
Expand Down
5 changes: 5 additions & 0 deletions thinkit/mock_switch.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "absl/status/statusor.h"
#include "absl/strings/string_view.h"
#include "cert/cert.grpc.pb.h"
#include "diag/diag.grpc.pb.h"
#include "gmock/gmock.h"
#include "p4/v1/p4runtime.grpc.pb.h"
Expand All @@ -41,6 +42,10 @@ class MockSwitch : public Switch {
CreateGnoiSystemStub, (), (override));
MOCK_METHOD(absl::StatusOr<std::unique_ptr<gnoi::diag::Diag::Stub>>,
CreateGnoiDiagStub, (), (override));
MOCK_METHOD(
absl::StatusOr<
std::unique_ptr<gnoi::certificate::CertificateManagement::Stub>>,
CreateGnoiCertificateStub, (), (override));
};

} // namespace thinkit
Expand Down
6 changes: 6 additions & 0 deletions thinkit/switch.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "absl/status/statusor.h"
#include "absl/strings/string_view.h"
#include "cert/cert.grpc.pb.h"
#include "diag/diag.grpc.pb.h"
#include "p4/v1/p4runtime.grpc.pb.h"
#include "proto/gnmi/gnmi.grpc.pb.h"
Expand Down Expand Up @@ -55,6 +56,11 @@ class Switch {
// Creates and returns a stub to the gNOI Diag service.
virtual absl::StatusOr<std::unique_ptr<gnoi::diag::Diag::Stub>>
CreateGnoiDiagStub() = 0;

// Creates and returns a stub to the gNOI Certificate service.
virtual absl::StatusOr<
std::unique_ptr<gnoi::certificate::CertificateManagement::Stub>>
CreateGnoiCertificateStub() = 0;
};

} // namespace thinkit
Expand Down

0 comments on commit 2028411

Please sign in to comment.