summaryrefslogtreecommitdiffhomepage
path: root/test/packetimpact/proto
diff options
context:
space:
mode:
authorEyal Soha <eyalsoha@google.com>2020-04-06 17:52:25 -0700
committergVisor bot <gvisor-bot@google.com>2020-04-06 17:53:43 -0700
commit32fc11ee3e39b7ef1152825090112f4b239887c4 (patch)
tree54386c26273f46942da2ced5c7368ebc6e835d06 /test/packetimpact/proto
parentdd98fdd5beb7f02e7c7b3aeb4f07f5d00ffc41e7 (diff)
Sort posix service functions
PiperOrigin-RevId: 305157179
Diffstat (limited to 'test/packetimpact/proto')
-rw-r--r--test/packetimpact/proto/posix_server.proto74
1 files changed, 38 insertions, 36 deletions
diff --git a/test/packetimpact/proto/posix_server.proto b/test/packetimpact/proto/posix_server.proto
index 53ec49410..1565f31fa 100644
--- a/test/packetimpact/proto/posix_server.proto
+++ b/test/packetimpact/proto/posix_server.proto
@@ -16,17 +16,6 @@ syntax = "proto3";
package posix_server;
-message SocketRequest {
- int32 domain = 1;
- int32 type = 2;
- int32 protocol = 3;
-}
-
-message SocketResponse {
- int32 fd = 1;
- int32 errno_ = 2; // "errno" may fail to compile in c++.
-}
-
message SockaddrIn {
int32 family = 1;
uint32 port = 2;
@@ -48,6 +37,23 @@ message Sockaddr {
}
}
+message Timeval {
+ int64 seconds = 1;
+ int64 microseconds = 2;
+}
+
+// Request and Response pairs for each Posix service RPC call, sorted.
+
+message AcceptRequest {
+ int32 sockfd = 1;
+}
+
+message AcceptResponse {
+ int32 fd = 1;
+ int32 errno_ = 2; // "errno" may fail to compile in c++.
+ Sockaddr addr = 3;
+}
+
message BindRequest {
int32 sockfd = 1;
Sockaddr addr = 2;
@@ -58,6 +64,15 @@ message BindResponse {
int32 errno_ = 2; // "errno" may fail to compile in c++.
}
+message CloseRequest {
+ int32 fd = 1;
+}
+
+message CloseResponse {
+ int32 ret = 1;
+ int32 errno_ = 2; // "errno" may fail to compile in c++.
+}
+
message GetSockNameRequest {
int32 sockfd = 1;
}
@@ -78,16 +93,6 @@ message ListenResponse {
int32 errno_ = 2; // "errno" may fail to compile in c++.
}
-message AcceptRequest {
- int32 sockfd = 1;
-}
-
-message AcceptResponse {
- int32 fd = 1;
- int32 errno_ = 2; // "errno" may fail to compile in c++.
- Sockaddr addr = 3;
-}
-
message SetSockOptRequest {
int32 sockfd = 1;
int32 level = 2;
@@ -100,11 +105,6 @@ message SetSockOptResponse {
int32 errno_ = 2; // "errno" may fail to compile in c++.
}
-message Timeval {
- int64 seconds = 1;
- int64 microseconds = 2;
-}
-
message SetSockOptTimevalRequest {
int32 sockfd = 1;
int32 level = 2;
@@ -117,12 +117,14 @@ message SetSockOptTimevalResponse {
int32 errno_ = 2; // "errno" may fail to compile in c++.
}
-message CloseRequest {
- int32 fd = 1;
+message SocketRequest {
+ int32 domain = 1;
+ int32 type = 2;
+ int32 protocol = 3;
}
-message CloseResponse {
- int32 ret = 1;
+message SocketResponse {
+ int32 fd = 1;
int32 errno_ = 2; // "errno" may fail to compile in c++.
}
@@ -139,16 +141,16 @@ message RecvResponse {
}
service Posix {
- // Call socket() on the DUT.
- rpc Socket(SocketRequest) returns (SocketResponse);
+ // Call accept() on the DUT.
+ rpc Accept(AcceptRequest) returns (AcceptResponse);
// Call bind() on the DUT.
rpc Bind(BindRequest) returns (BindResponse);
+ // Call close() on the DUT.
+ rpc Close(CloseRequest) returns (CloseResponse);
// Call getsockname() on the DUT.
rpc GetSockName(GetSockNameRequest) returns (GetSockNameResponse);
// Call listen() on the DUT.
rpc Listen(ListenRequest) returns (ListenResponse);
- // Call accept() on the DUT.
- rpc Accept(AcceptRequest) returns (AcceptResponse);
// Call setsockopt() on the DUT. You should prefer one of the other
// SetSockOpt* functions with a more structured optval or else you may get the
// encoding wrong, such as making a bad assumption about the server's word
@@ -157,8 +159,8 @@ service Posix {
// Call setsockopt() on the DUT with a Timeval optval.
rpc SetSockOptTimeval(SetSockOptTimevalRequest)
returns (SetSockOptTimevalResponse);
- // Call close() on the DUT.
- rpc Close(CloseRequest) returns (CloseResponse);
+ // Call socket() on the DUT.
+ rpc Socket(SocketRequest) returns (SocketResponse);
// Call recv() on the DUT.
rpc Recv(RecvRequest) returns (RecvResponse);
}