Skip to content

Commit 8700997

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 a41bc08 commit 8700997

File tree

4 files changed

+323
-0
lines changed

4 files changed

+323
-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",
@@ -449,6 +451,8 @@ fn test_openbsd(target: &str) {
449451
"netinet/ip.h",
450452
"netinet/tcp.h",
451453
"netinet/udp.h",
454+
"netinet/icmp6.h",
455+
"netinet/ip6.h",
452456
"net/bpf.h",
453457
"regex.h",
454458
"resolv.h",
@@ -867,6 +871,8 @@ fn test_redox(target: &str) {
867871
"netinet/in.h",
868872
"netinet/ip.h",
869873
"netinet/tcp.h",
874+
"netinet/icmp6.h",
875+
"netinet/ip6.h",
870876
"poll.h",
871877
"pwd.h",
872878
"semaphore.h",
@@ -945,6 +951,8 @@ fn test_solarish(target: &str) {
945951
"netinet/ip.h",
946952
"netinet/tcp.h",
947953
"netinet/udp.h",
954+
"netinet/icmp6.h",
955+
"netinet/ip6.h",
948956
"poll.h",
949957
"port.h",
950958
"pthread.h",
@@ -1229,6 +1237,8 @@ fn test_netbsd(target: &str) {
12291237
"netinet/ip.h",
12301238
"netinet/tcp.h",
12311239
"netinet/udp.h",
1240+
"netinet/icmp6.h",
1241+
"netinet/ip6.h",
12321242
"poll.h",
12331243
"pthread.h",
12341244
"pwd.h",
@@ -1518,6 +1528,8 @@ fn test_dragonflybsd(target: &str) {
15181528
"netinet/ip.h",
15191529
"netinet/tcp.h",
15201530
"netinet/udp.h",
1531+
"netinet/icmp6.h",
1532+
"netinet/ip6.h",
15211533
"poll.h",
15221534
"pthread.h",
15231535
"pthread_np.h",
@@ -1833,6 +1845,8 @@ fn test_android(target: &str) {
18331845
"netinet/ip.h",
18341846
"netinet/tcp.h",
18351847
"netinet/udp.h",
1848+
"netinet/icmp6.h",
1849+
"netinet/ip6.h",
18361850
"netpacket/packet.h",
18371851
"poll.h",
18381852
"pthread.h",
@@ -2352,6 +2366,8 @@ fn test_freebsd(target: &str) {
23522366
"netinet/sctp.h",
23532367
"netinet/tcp.h",
23542368
"netinet/udp.h",
2369+
"netinet/icmp6.h",
2370+
"netinet/ip6.h",
23552371
"poll.h",
23562372
"pthread.h",
23572373
"pthread_np.h",
@@ -2979,6 +2995,8 @@ fn test_emscripten(target: &str) {
29792995
"netinet/ip.h",
29802996
"netinet/tcp.h",
29812997
"netinet/udp.h",
2998+
"netinet/icmp6.h",
2999+
"netinet/ip6.h",
29823000
"netpacket/packet.h",
29833001
"poll.h",
29843002
"pthread.h",
@@ -3247,6 +3265,8 @@ fn test_neutrino(target: &str) {
32473265
"netinet/tcp.h",
32483266
"netinet/udp.h",
32493267
"netinet/ip_var.h",
3268+
"netinet/icmp6.h",
3269+
"netinet/ip6.h",
32503270
"sys/poll.h",
32513271
"pthread.h",
32523272
"pwd.h",
@@ -3749,8 +3769,10 @@ fn test_linux(target: &str) {
37493769
"netdb.h",
37503770
"netinet/in.h",
37513771
"netinet/ip.h",
3772+
"netinet/ip6.h",
37523773
"netinet/tcp.h",
37533774
"netinet/udp.h",
3775+
"netinet/icmp6.h",
37543776
(l4re, "netpacket/packet.h"),
37553777
"poll.h",
37563778
"pthread.h",
@@ -5027,6 +5049,7 @@ fn test_haiku(target: &str) {
50275049
"netinet/ip_var.h",
50285050
"netinet/tcp.h",
50295051
"netinet/udp.h",
5052+
"netinet/icmp6.h",
50305053
"netinet6/in6.h",
50315054
"nl_types.h",
50325055
"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)