Skip to content

Commit a96955a

Browse files
committed
RFC 2292 struct and constant definitions
This PR adds the icmp6_filter struct and constants as defined by RFC 2292 - Advanced Sockets API for IPv6. These constants are available for use in get/setsockopt on supported Unix platforms. The operations defined on the icmp6_filter struct are defined as C macros, so the implementations are not included here. See the RFC for definitions and use.
1 parent 34527ca commit a96955a

File tree

4 files changed

+326
-0
lines changed

4 files changed

+326
-0
lines changed

libc-test/build.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ fn test_apple(target: &str) {
254254
"netinet/ip.h",
255255
"netinet/tcp.h",
256256
"netinet/udp.h",
257+
"netinet/icmp6.h",
258+
"netinet/ip6.h",
257259
"netinet6/in6_var.h",
258260
"os/clock.h",
259261
"os/lock.h",
@@ -467,6 +469,8 @@ fn test_openbsd(target: &str) {
467469
"netinet/ip.h",
468470
"netinet/tcp.h",
469471
"netinet/udp.h",
472+
"netinet/icmp6.h",
473+
"netinet/ip6.h",
470474
"net/bpf.h",
471475
"regex.h",
472476
"resolv.h",
@@ -885,6 +889,8 @@ fn test_redox(target: &str) {
885889
"netinet/in.h",
886890
"netinet/ip.h",
887891
"netinet/tcp.h",
892+
"netinet/icmp6.h",
893+
"netinet/ip6.h",
888894
"poll.h",
889895
"pwd.h",
890896
"semaphore.h",
@@ -963,6 +969,8 @@ fn test_solarish(target: &str) {
963969
"netinet/ip.h",
964970
"netinet/tcp.h",
965971
"netinet/udp.h",
972+
"netinet/icmp6.h",
973+
"netinet/ip6.h",
966974
"poll.h",
967975
"port.h",
968976
"pthread.h",
@@ -1247,6 +1255,8 @@ fn test_netbsd(target: &str) {
12471255
"netinet/ip.h",
12481256
"netinet/tcp.h",
12491257
"netinet/udp.h",
1258+
"netinet/icmp6.h",
1259+
"netinet/ip6.h",
12501260
"poll.h",
12511261
"pthread.h",
12521262
"pwd.h",
@@ -1538,6 +1548,8 @@ fn test_dragonflybsd(target: &str) {
15381548
"netinet/ip.h",
15391549
"netinet/tcp.h",
15401550
"netinet/udp.h",
1551+
"netinet/icmp6.h",
1552+
"netinet/ip6.h",
15411553
"poll.h",
15421554
"pthread.h",
15431555
"pthread_np.h",
@@ -1853,6 +1865,8 @@ fn test_android(target: &str) {
18531865
"netinet/ip.h",
18541866
"netinet/tcp.h",
18551867
"netinet/udp.h",
1868+
"netinet/icmp6.h",
1869+
"netinet/ip6.h",
18561870
"netpacket/packet.h",
18571871
"poll.h",
18581872
"pthread.h",
@@ -2372,6 +2386,8 @@ fn test_freebsd(target: &str) {
23722386
"netinet/sctp.h",
23732387
"netinet/tcp.h",
23742388
"netinet/udp.h",
2389+
"netinet/icmp6.h",
2390+
"netinet/ip6.h",
23752391
"poll.h",
23762392
"pthread.h",
23772393
"pthread_np.h",
@@ -3002,6 +3018,8 @@ fn test_emscripten(target: &str) {
30023018
"netinet/ip.h",
30033019
"netinet/tcp.h",
30043020
"netinet/udp.h",
3021+
"netinet/icmp6.h",
3022+
"netinet/ip6.h",
30053023
"netpacket/packet.h",
30063024
"poll.h",
30073025
"pthread.h",
@@ -3270,6 +3288,8 @@ fn test_neutrino(target: &str) {
32703288
"netinet/tcp.h",
32713289
"netinet/udp.h",
32723290
"netinet/ip_var.h",
3291+
"netinet/icmp6.h",
3292+
"netinet/ip6.h",
32733293
"sys/poll.h",
32743294
"pthread.h",
32753295
"pwd.h",
@@ -3774,8 +3794,10 @@ fn test_linux(target: &str) {
37743794
"netdb.h",
37753795
"netinet/in.h",
37763796
"netinet/ip.h",
3797+
"netinet/ip6.h",
37773798
"netinet/tcp.h",
37783799
"netinet/udp.h",
3800+
"netinet/icmp6.h",
37793801
(l4re, "netpacket/packet.h"),
37803802
"poll.h",
37813803
"pthread.h",
@@ -5065,6 +5087,7 @@ fn test_haiku(target: &str) {
50655087
"netinet/ip_var.h",
50665088
"netinet/tcp.h",
50675089
"netinet/udp.h",
5090+
"netinet/icmp6.h",
50685091
"netinet6/in6.h",
50695092
"nl_types.h",
50705093
"null.h",

src/unix/bsd/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ pub const IPV6_UNICAST_HOPS: c_int = 4;
211211
pub const IPV6_MULTICAST_IF: c_int = 9;
212212
pub const IPV6_MULTICAST_HOPS: c_int = 10;
213213
pub const IPV6_MULTICAST_LOOP: c_int = 11;
214+
pub const ICMP6_FILTER: c_int = 18;
214215
pub const IPV6_V6ONLY: c_int = 27;
215216
pub const IPV6_DONTFRAG: c_int = 62;
216217

src/unix/linux_like/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,8 @@ pub const IPV6_PMTUDISC_PROBE: c_int = 3;
977977
pub const IPV6_PMTUDISC_INTERFACE: c_int = 4;
978978
pub const IPV6_PMTUDISC_OMIT: c_int = 5;
979979

980+
pub const ICMP6_FILTER: c_int = 1;
981+
980982
pub const TCP_NODELAY: c_int = 1;
981983
pub const TCP_MAXSEG: c_int = 2;
982984
pub const TCP_CORK: c_int = 3;

0 commit comments

Comments
 (0)