summaryrefslogtreecommitdiffhomepage
path: root/test/packetimpact/proto/posix_server.proto
diff options
context:
space:
mode:
authorZeling Feng <zeling@google.com>2021-02-25 14:58:37 -0800
committergVisor bot <gvisor-bot@google.com>2021-02-25 15:01:14 -0800
commit67761345c8f2d01f41eb8bbeb0dc8f5d94b4e576 (patch)
tree445e2c35ac05ca8e493515f1e57bb975743acdfa /test/packetimpact/proto/posix_server.proto
parent38c42bbf4ad2200f0ec72e51d1cfbbd83d782a63 (diff)
Move SetNonblocking into posix_server
- open flags can be different on different OSs, by putting SetNonblocking into the posix_server rather than the testbench, we can always get the right value for O_NONBLOCK - merged the tcp_queue_{send,receive}_in_syn_sent into a single file PiperOrigin-RevId: 359620630
Diffstat (limited to 'test/packetimpact/proto/posix_server.proto')
-rw-r--r--test/packetimpact/proto/posix_server.proto29
1 files changed, 16 insertions, 13 deletions
diff --git a/test/packetimpact/proto/posix_server.proto b/test/packetimpact/proto/posix_server.proto
index b4c68764a..521f03465 100644
--- a/test/packetimpact/proto/posix_server.proto
+++ b/test/packetimpact/proto/posix_server.proto
@@ -91,17 +91,6 @@ message ConnectResponse {
int32 errno_ = 2; // "errno" may fail to compile in c++.
}
-message FcntlRequest {
- int32 fd = 1;
- int32 cmd = 2;
- int32 arg = 3;
-}
-
-message FcntlResponse {
- int32 ret = 1;
- int32 errno_ = 2;
-}
-
message GetSockNameRequest {
int32 sockfd = 1;
}
@@ -184,6 +173,18 @@ message SendToResponse {
int32 errno_ = 2; // "errno" may fail to compile in c++.
}
+message SetNonblockingRequest {
+ int32 fd = 1;
+ bool nonblocking = 2;
+}
+
+message SetNonblockingResponse {
+ int32 ret = 1;
+ int32 errno_ = 2; // "errno" may fail to compile in c++.
+ // The failed fcntl cmd.
+ string cmd = 3;
+}
+
message SetSockOptRequest {
int32 sockfd = 1;
int32 level = 2;
@@ -237,8 +238,6 @@ service Posix {
rpc Close(CloseRequest) returns (CloseResponse);
// Call connect() on the DUT.
rpc Connect(ConnectRequest) returns (ConnectResponse);
- // Call fcntl() on the DUT.
- rpc Fcntl(FcntlRequest) returns (FcntlResponse);
// Call getsockname() on the DUT.
rpc GetSockName(GetSockNameRequest) returns (GetSockNameResponse);
// Call getsockopt() on the DUT.
@@ -253,6 +252,10 @@ service Posix {
rpc Send(SendRequest) returns (SendResponse);
// Call sendto() on the DUT.
rpc SendTo(SendToRequest) returns (SendToResponse);
+ // Set/Clear O_NONBLOCK flag on the requested fd. This is needed because the
+ // operating system on DUT may have a different definition for O_NONBLOCK, it
+ // is not sound to assemble flags on testbench.
+ rpc SetNonblocking(SetNonblockingRequest) returns (SetNonblockingResponse);
// Call setsockopt() on the DUT.
rpc SetSockOpt(SetSockOptRequest) returns (SetSockOptResponse);
// Call socket() on the DUT.