summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/BUILD
diff options
context:
space:
mode:
authorKevin Krakauer <krakauer@google.com>2019-02-27 14:30:20 -0800
committerShentubot <shentubot@google.com>2019-02-27 14:31:21 -0800
commit121db29a93c651b8b62e8701bb0f16c231b08257 (patch)
treec6b235b72340de44c8ee0e9398d337a8cc6c30f3 /test/syscalls/linux/BUILD
parent6df212b831dcc3350b7677423ec7835ed40b3f22 (diff)
Ping support via IPv4 raw sockets.
Broadly, this change: * Enables sockets to be created via `socket(AF_INET, SOCK_RAW, IPPROTO_ICMP)`. * Passes the network-layer (IP) header up the stack to the transport endpoint, which can pass it up to the socket layer. This allows a raw socket to return the entire IP packet to users. * Adds functions to stack.TransportProtocol, stack.Stack, stack.transportDemuxer that enable incoming packets to be delivered to raw endpoints. New raw sockets of other protocols (not ICMP) just need to register with the stack. * Enables ping.endpoint to return IP headers when created via SOCK_RAW. PiperOrigin-RevId: 235993280 Change-Id: I60ed994f5ff18b2cbd79f063a7fdf15d093d845a
Diffstat (limited to 'test/syscalls/linux/BUILD')
-rw-r--r--test/syscalls/linux/BUILD16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/syscalls/linux/BUILD b/test/syscalls/linux/BUILD
index beece8930..4c818238b 100644
--- a/test/syscalls/linux/BUILD
+++ b/test/syscalls/linux/BUILD
@@ -1530,6 +1530,22 @@ cc_binary(
)
cc_binary(
+ name = "raw_socket_ipv4_test",
+ testonly = 1,
+ srcs = ["raw_socket_ipv4.cc"],
+ linkstatic = 1,
+ deps = [
+ ":socket_test_util",
+ "//test/util:capability_util",
+ "//test/util:file_descriptor",
+ "//test/util:test_main",
+ "//test/util:test_util",
+ "@com_google_absl//absl/base:core_headers",
+ "@com_google_googletest//:gtest",
+ ],
+)
+
+cc_binary(
name = "read_test",
testonly = 1,
srcs = ["read.cc"],