Skip to content

Commit d5989eb

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 293d8cf commit d5989eb

File tree

4 files changed

+337
-0
lines changed

4 files changed

+337
-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",
@@ -2373,6 +2387,8 @@ fn test_freebsd(target: &str) {
23732387
"netinet/sctp.h",
23742388
"netinet/tcp.h",
23752389
"netinet/udp.h",
2390+
"netinet/icmp6.h",
2391+
"netinet/ip6.h",
23762392
"poll.h",
23772393
"pthread.h",
23782394
"pthread_np.h",
@@ -3000,6 +3016,8 @@ fn test_emscripten(target: &str) {
30003016
"netinet/ip.h",
30013017
"netinet/tcp.h",
30023018
"netinet/udp.h",
3019+
"netinet/icmp6.h",
3020+
"netinet/ip6.h",
30033021
"netpacket/packet.h",
30043022
"poll.h",
30053023
"pthread.h",
@@ -3268,6 +3286,8 @@ fn test_neutrino(target: &str) {
32683286
"netinet/tcp.h",
32693287
"netinet/udp.h",
32703288
"netinet/ip_var.h",
3289+
"netinet/icmp6.h",
3290+
"netinet/ip6.h",
32713291
"sys/poll.h",
32723292
"pthread.h",
32733293
"pwd.h",
@@ -3762,8 +3782,10 @@ fn test_linux(target: &str) {
37623782
"netdb.h",
37633783
"netinet/in.h",
37643784
"netinet/ip.h",
3785+
"netinet/ip6.h",
37653786
"netinet/tcp.h",
37663787
"netinet/udp.h",
3788+
"netinet/icmp6.h",
37673789
(l4re, "netpacket/packet.h"),
37683790
"poll.h",
37693791
"pthread.h",
@@ -5022,6 +5044,7 @@ fn test_haiku(target: &str) {
50225044
"netinet/ip_var.h",
50235045
"netinet/tcp.h",
50245046
"netinet/udp.h",
5047+
"netinet/icmp6.h",
50255048
"netinet6/in6.h",
50265049
"nl_types.h",
50275050
"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)