Skip to content

Commit ddfd71e

Browse files
phlogistonjohnmergify[bot]
authored andcommitted
grpc/protobufs: add initial .proto file
Add a new control.proto file that will be the basis for a cloud-ready gRPC remote-control API for certain samba commands. Signed-off-by: John Mulligan <[email protected]>
1 parent 8ca9224 commit ddfd71e

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed

sambacc/grpc/protobufs/control.proto

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// Use proto3 as the older protobuf we need for centos doesn't support
2+
// 2023 edition.
3+
syntax = "proto3";
4+
5+
// Some requests and respose types are currently empty. However, we don't use
6+
// Empty in the case we want to extend them in the future.
7+
8+
// --- Info ---
9+
// Provide version numbers and basic information about the samba
10+
// container instance. Mainly for debugging.
11+
12+
message InfoRequest {}
13+
14+
message SambaInfo {
15+
string version = 1;
16+
bool clustered = 2;
17+
}
18+
19+
message SambaContainerInfo {
20+
string sambacc_version = 1;
21+
string container_version = 2;
22+
}
23+
24+
message GeneralInfo {
25+
SambaInfo samba_info = 1;
26+
SambaContainerInfo container_info = 2;
27+
}
28+
29+
// --- Status ---
30+
// Fetch status information from the samba instance. Includes basic
31+
// information about connected clients.
32+
33+
message StatusRequest {}
34+
35+
message SessionInfo {
36+
string session_id = 1;
37+
string username = 2;
38+
string groupname = 3;
39+
string remote_machine = 4;
40+
string hostname = 5;
41+
string session_dialect = 6;
42+
uint32 uid = 7;
43+
uint32 gid = 8;
44+
}
45+
46+
message ConnInfo {
47+
string tcon_id = 1;
48+
string session_id = 2;
49+
string service_name = 3;
50+
}
51+
52+
message StatusInfo {
53+
string server_timestamp = 1;
54+
repeated SessionInfo sessions = 2;
55+
repeated ConnInfo tree_connections = 3;
56+
}
57+
58+
// --- CloseShare ---
59+
// Close shares to clients.
60+
61+
message CloseShareRequest {
62+
string share_name = 1;
63+
bool denied_users = 2;
64+
}
65+
66+
message CloseShareInfo {}
67+
68+
// --- KillClientConnection ---
69+
// Forcibly disconnect a client.
70+
71+
message KillClientRequest {
72+
string ip_address = 1;
73+
}
74+
75+
message KillClientInfo {}
76+
77+
// --- define rpcs ---
78+
79+
service SambaControl {
80+
rpc Info (InfoRequest) returns (GeneralInfo);
81+
rpc Status (StatusRequest) returns (StatusInfo);
82+
rpc CloseShare (CloseShareRequest) returns (CloseShareInfo);
83+
rpc KillClientConnection (KillClientRequest) returns (KillClientInfo);
84+
}

0 commit comments

Comments
 (0)