From 7b1cc735538005d7d9671884fde65070c04fd63c Mon Sep 17 00:00:00 2001 From: Peter Kurfer Date: Sat, 20 Feb 2021 14:31:39 +0100 Subject: [PATCH] Squashed 'api/' changes from 4504b96..24ae082 24ae082 Rename gRPC PCAP entities e30a129 Complete CLI integration d01a9de Initial draft of PCAP capturing git-subtree-dir: api git-subtree-split: 24ae0820e80e5aafce79d982e70bb93a899d9f7c --- proto/rpc/audit.proto | 4 +-- proto/rpc/pcap.proto | 59 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 proto/rpc/pcap.proto diff --git a/proto/rpc/audit.proto b/proto/rpc/audit.proto index 4d01b7b..2bd2caa 100644 --- a/proto/rpc/audit.proto +++ b/proto/rpc/audit.proto @@ -21,12 +21,10 @@ message WatchEventsRequest { message RegisterFileSinkRequest { string targetPath = 1; - FileOpenMode openMode = 2; - uint32 permissions = 3; } message RegisterFileSinkResponse { - + string resolvedPath = 1; } message RemoveFileSinkRequest { diff --git a/proto/rpc/pcap.proto b/proto/rpc/pcap.proto new file mode 100644 index 0000000..07ac7d2 --- /dev/null +++ b/proto/rpc/pcap.proto @@ -0,0 +1,59 @@ +syntax = "proto3"; + +option go_package = "gitlab.com/inetmock/inetmock/pkg/rpc"; +option java_multiple_files = true; +option java_package = "com.github.baez90.inetmock.rpc"; +option java_outer_classname = "AuditProto"; +option csharp_namespace = "INetMock.Client.Rpc"; + +package inetmock.rpc; + +import "google/protobuf/duration.proto"; + +message ListAvailableDevicesRequest { + +} + +message ListAvailableDevicesResponse { + + message PCAPDevice { + string name = 1; + repeated bytes addresses = 2; + } + + repeated PCAPDevice availableDevices = 1; +} + +message ListRecordingsRequest { + +} + +message ListRecordingsResponse { + repeated string subscriptions = 1; +} + +message StartPCAPFileRecordRequest { + string device = 1; + string targetPath = 2; + bool promiscuous = 3; + google.protobuf.Duration readTimeout = 4; +} + +message StartPCAPFileRecordResponse { + string resolvedPath = 1; +} + +message StopPCAPFileRecordRequest { + string consumerKey = 1; +} + +message StopPCAPFileRecordResponse { + bool removed = 1; +} + +service PCAP { + rpc ListAvailableDevices(ListAvailableDevicesRequest) returns (ListAvailableDevicesResponse); + rpc ListActiveRecordings(ListRecordingsRequest) returns (ListRecordingsResponse); + rpc StartPCAPFileRecording(StartPCAPFileRecordRequest) returns (StartPCAPFileRecordResponse); + rpc StopPCAPFileRecord(StopPCAPFileRecordRequest) returns (StopPCAPFileRecordResponse); +}