summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/socket_test_util.h
diff options
context:
space:
mode:
authorRahat Mahmood <rahat@google.com>2019-06-13 17:23:35 -0700
committerShentubot <shentubot@google.com>2019-06-13 17:24:51 -0700
commit05ff1ffaadaa0ac370365eb14febc761506735ce (patch)
treee6505afe1536c60c7a2e362aa8355e01ec34f91a /test/syscalls/linux/socket_test_util.h
parent7b0f068258146b4081060ae793ba6b73399f1452 (diff)
Implement getsockopt() SO_DOMAIN, SO_PROTOCOL and SO_TYPE.
SO_TYPE was already implemented for everything but netlink sockets. PiperOrigin-RevId: 253138157
Diffstat (limited to 'test/syscalls/linux/socket_test_util.h')
-rw-r--r--test/syscalls/linux/socket_test_util.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/syscalls/linux/socket_test_util.h b/test/syscalls/linux/socket_test_util.h
index 058313986..4fd59767a 100644
--- a/test/syscalls/linux/socket_test_util.h
+++ b/test/syscalls/linux/socket_test_util.h
@@ -287,6 +287,9 @@ Creator<FileDescriptor> UnboundSocketCreator(int domain, int type,
// a function that creates such a socket pair.
struct SocketPairKind {
std::string description;
+ int domain;
+ int type;
+ int protocol;
Creator<SocketPair> creator;
// Create creates a socket pair of this kind.
@@ -297,6 +300,9 @@ struct SocketPairKind {
// a function that creates such a socket.
struct SocketKind {
std::string description;
+ int domain;
+ int type;
+ int protocol;
Creator<FileDescriptor> creator;
// Create creates a socket pair of this kind.
@@ -353,6 +359,7 @@ Middleware SetSockOpt(int level, int optname, T* value) {
return SocketPairKind{
absl::StrCat("setsockopt(", level, ", ", optname, ", ", *value, ") ",
base.description),
+ base.domain, base.type, base.protocol,
[creator, level, optname,
value]() -> PosixErrorOr<std::unique_ptr<SocketPair>> {
ASSIGN_OR_RETURN_ERRNO(auto creator_value, creator());