summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/socket_netlink_util.h
diff options
context:
space:
mode:
authorJianfeng Tan <henry.tjf@antfin.com>2020-01-28 12:31:58 -0800
committergVisor bot <gvisor-bot@google.com>2020-01-28 12:32:59 -0800
commitd99329e58492ef91b44a0bac346f757e8af2a7ec (patch)
tree0188f72f1edd543040041bf3377db4756fdf7e03 /test/syscalls/linux/socket_netlink_util.h
parent1119644080ae57c206b9b0d8d127cf48423af7f2 (diff)
netlink: add support for RTM_F_LOOKUP_TABLE
Test command: $ ip route get 1.1.1.1 Fixes: #1099 Signed-off-by: Jianfeng Tan <henry.tjf@antfin.com> COPYBARA_INTEGRATE_REVIEW=https://github.com/google/gvisor/pull/1121 from tanjianfeng:fix-1099 e6919f3d4ede5aa51a48b3d2be0d7a4b482dd53d PiperOrigin-RevId: 291990716
Diffstat (limited to 'test/syscalls/linux/socket_netlink_util.h')
-rw-r--r--test/syscalls/linux/socket_netlink_util.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/syscalls/linux/socket_netlink_util.h b/test/syscalls/linux/socket_netlink_util.h
index 76e772c48..3678c0599 100644
--- a/test/syscalls/linux/socket_netlink_util.h
+++ b/test/syscalls/linux/socket_netlink_util.h
@@ -32,12 +32,21 @@ PosixErrorOr<FileDescriptor> NetlinkBoundSocket(int protocol);
// Returns the port ID of the passed socket.
PosixErrorOr<uint32_t> NetlinkPortID(int fd);
-// Send the passed request and call fn will all response netlink messages.
+// Send the passed request and call fn on all response netlink messages.
+//
+// To be used on requests with NLM_F_MULTI reponses.
PosixError NetlinkRequestResponse(
const FileDescriptor& fd, void* request, size_t len,
const std::function<void(const struct nlmsghdr* hdr)>& fn,
bool expect_nlmsgerr);
+// Send the passed request and call fn on all response netlink messages.
+//
+// To be used on requests without NLM_F_MULTI reponses.
+PosixError NetlinkRequestResponseSingle(
+ const FileDescriptor& fd, void* request, size_t len,
+ const std::function<void(const struct nlmsghdr* hdr)>& fn);
+
} // namespace testing
} // namespace gvisor