1syntax = "proto3";
2
3package sniffer;
4
5// Sniffer simulation
6service Sniffer {
7    // Start the sniffer
8    rpc Start(StartRequest) returns (StartResponse) {}
9
10    // Transfer the capture file
11    rpc TransferPcapng(TransferPcapngRequest) returns (stream TransferPcapngResponse) {}
12
13    // Let the sniffer sniff these nodes only
14    rpc FilterNodes(FilterNodesRequest) returns (FilterNodesResponse) {}
15
16    // Stop the sniffer
17    rpc Stop(StopRequest) returns (StopResponse) {}
18}
19
20// Possible Status which the RPCs may return
21enum Status {
22    // Default value which is unused
23    STATUS_UNSPECIFIED = 0;
24
25    // Everything goes well
26    OK = 1;
27
28    // Unable to run the specified RPC currently
29    OPERATION_ERROR = 2;
30
31    // The parameters passed to the RPC is erroneous
32    VALUE_ERROR = 3;
33}
34
35message StartRequest {
36    // Specify the channel that the sniffer is going to sniff
37    int32 channel = 1;
38
39    // Specify whether to include Ethernet packets between OTBR and infra
40    bool includeEthernet = 2;
41}
42
43message StartResponse {
44    Status status = 1;
45}
46
47message TransferPcapngRequest {
48}
49
50message TransferPcapngResponse {
51    bytes content = 1;
52}
53
54message FilterNodesRequest {
55    repeated int32 nodeids = 1;
56}
57
58message FilterNodesResponse {
59    Status status = 1;
60}
61
62message StopRequest {
63}
64
65message StopResponse {
66    Status status = 1;
67}
68