Skip to content

Commit 92f0a65

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 85a95b8 commit 92f0a65

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",
@@ -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",
@@ -1520,6 +1530,8 @@ fn test_dragonflybsd(target: &str) {
15201530
"netinet/ip.h",
15211531
"netinet/tcp.h",
15221532
"netinet/udp.h",
1533+
"netinet/icmp6.h",
1534+
"netinet/ip6.h",
15231535
"poll.h",
15241536
"pthread.h",
15251537
"pthread_np.h",
@@ -1835,6 +1847,8 @@ fn test_android(target: &str) {
18351847
"netinet/ip.h",
18361848
"netinet/tcp.h",
18371849
"netinet/udp.h",
1850+
"netinet/icmp6.h",
1851+
"netinet/ip6.h",
18381852
"netpacket/packet.h",
18391853
"poll.h",
18401854
"pthread.h",
@@ -2354,6 +2368,8 @@ fn test_freebsd(target: &str) {
23542368
"netinet/sctp.h",
23552369
"netinet/tcp.h",
23562370
"netinet/udp.h",
2371+
"netinet/icmp6.h",
2372+
"netinet/ip6.h",
23572373
"poll.h",
23582374
"pthread.h",
23592375
"pthread_np.h",
@@ -2984,6 +3000,8 @@ fn test_emscripten(target: &str) {
29843000
"netinet/ip.h",
29853001
"netinet/tcp.h",
29863002
"netinet/udp.h",
3003+
"netinet/icmp6.h",
3004+
"netinet/ip6.h",
29873005
"netpacket/packet.h",
29883006
"poll.h",
29893007
"pthread.h",
@@ -3252,6 +3270,8 @@ fn test_neutrino(target: &str) {
32523270
"netinet/tcp.h",
32533271
"netinet/udp.h",
32543272
"netinet/ip_var.h",
3273+
"netinet/icmp6.h",
3274+
"netinet/ip6.h",
32553275
"sys/poll.h",
32563276
"pthread.h",
32573277
"pwd.h",
@@ -3756,8 +3776,10 @@ fn test_linux(target: &str) {
37563776
"netdb.h",
37573777
"netinet/in.h",
37583778
"netinet/ip.h",
3779+
"netinet/ip6.h",
37593780
"netinet/tcp.h",
37603781
"netinet/udp.h",
3782+
"netinet/icmp6.h",
37613783
(l4re, "netpacket/packet.h"),
37623784
"poll.h",
37633785
"pthread.h",
@@ -5047,6 +5069,7 @@ fn test_haiku(target: &str) {
50475069
"netinet/ip_var.h",
50485070
"netinet/tcp.h",
50495071
"netinet/udp.h",
5072+
"netinet/icmp6.h",
50505073
"netinet6/in6.h",
50515074
"nl_types.h",
50525075
"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)