Skip to content

Commit 04d2c7a

Browse files
committed
Auto merge of #508 - APTy:ipproto-icmp, r=alexcrichton
Add IPPROTO_ICMP and IPPROTO_ICMPV6 system constants This adds the protocol value for `ICMP` in both IPv4 and IPv6 variants. ICMP protocol constant for IPv4 defined as `1` per [RFC 792](https://tools.ietf.org/html/rfc792) ICMP protocol constant for IPv6 defined as `58` per [RFC 2463](https://tools.ietf.org/html/rfc2463#section-1) #### Reference [bsd/apple: netinet/in.h](https://opensource.apple.com/source/xnu/xnu-1699.24.8/bsd/netinet/in.h) [bsd/freebsdlike/freebsd: netinet/in.h](https://github.com/freebsd/freebsd/blob/master/sys/netinet/in.h#L42) [bsd/freebsdlike/dragonfly: netinet/in.h](https://github.com/DragonFlyBSD/DragonFlyBSD/blob/1f249c981c4e89e7cde1836a75b61cac36dc7ac5/sys/netinet/in.h#L64) [bsd/netbsdlike: netinet/in.h](https://github.com/IIJ-NetBSD/netbsd-src/blob/af5d253140491f2d1816c59ecb8a4d8a8d927688/sys/netinet/in.h#L77) [unix/haiku: netinet/in.h](https://github.com/haiku/haiku/blob/b65adbdfbc322bb7d86d74049389c688e9962f15/headers/posix/netinet/in.h#L54) [unix/notbsd/linux: in.h](https://github.com/torvalds/linux/blob/8fa3b6f9392bf6d90cb7b908e07bd90166639f0a/include/uapi/linux/in.h#L31) - [unix/notbsd/linux: in6.h](https://github.com/torvalds/linux/blob/8fa3b6f9392bf6d90cb7b908e07bd90166639f0a/include/uapi/linux/in6.h#L134)
2 parents f0898c3 + fdb213e commit 04d2c7a

File tree

6 files changed

+12
-0
lines changed

6 files changed

+12
-0
lines changed

src/unix/bsd/apple/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,8 @@ pub const SOCK_STREAM: ::c_int = 1;
826826
pub const SOCK_DGRAM: ::c_int = 2;
827827
pub const SOCK_RAW: ::c_int = 3;
828828
pub const SOCK_SEQPACKET: ::c_int = 5;
829+
pub const IPPROTO_ICMP: ::c_int = 1;
830+
pub const IPPROTO_ICMPV6: ::c_int = 58;
829831
pub const IPPROTO_TCP: ::c_int = 6;
830832
pub const IPPROTO_IP: ::c_int = 0;
831833
pub const IPPROTO_IPV6: ::c_int = 41;

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,8 @@ pub const SOCK_STREAM: ::c_int = 1;
547547
pub const SOCK_DGRAM: ::c_int = 2;
548548
pub const SOCK_RAW: ::c_int = 3;
549549
pub const SOCK_SEQPACKET: ::c_int = 5;
550+
pub const IPPROTO_ICMP: ::c_int = 1;
551+
pub const IPPROTO_ICMPV6: ::c_int = 58;
550552
pub const IPPROTO_TCP: ::c_int = 6;
551553
pub const IPPROTO_IP: ::c_int = 0;
552554
pub const IPPROTO_IPV6: ::c_int = 41;

src/unix/bsd/netbsdlike/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,8 @@ pub const SOCK_STREAM: ::c_int = 1;
363363
pub const SOCK_DGRAM: ::c_int = 2;
364364
pub const SOCK_RAW: ::c_int = 3;
365365
pub const SOCK_SEQPACKET: ::c_int = 5;
366+
pub const IPPROTO_ICMP: ::c_int = 1;
367+
pub const IPPROTO_ICMPV6: ::c_int = 58;
366368
pub const IPPROTO_TCP: ::c_int = 6;
367369
pub const IPPROTO_IP: ::c_int = 0;
368370
pub const IPPROTO_IPV6: ::c_int = 41;

src/unix/haiku/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,8 @@ pub const AF_UNIX: ::c_int = 9;
536536
pub const AF_INET: ::c_int = 1;
537537
pub const AF_INET6: ::c_int = 6;
538538
pub const SOCK_RAW: ::c_int = 3;
539+
pub const IPPROTO_ICMP: ::c_int = 1;
540+
pub const IPPROTO_ICMPV6: ::c_int = 58;
539541
pub const IPPROTO_TCP: ::c_int = 6;
540542
pub const IPPROTO_IP: ::c_int = 0;
541543
pub const IPPROTO_IPV6: ::c_int = 41;

src/unix/notbsd/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,8 @@ pub const AF_INET6: ::c_int = 10;
437437
pub const AF_UNSPEC: ::c_int = 0;
438438
pub const AF_NETLINK: ::c_int = 16;
439439
pub const SOCK_RAW: ::c_int = 3;
440+
pub const IPPROTO_ICMP: ::c_int = 1;
441+
pub const IPPROTO_ICMPV6: ::c_int = 58;
440442
pub const IPPROTO_TCP: ::c_int = 6;
441443
pub const IPPROTO_IP: ::c_int = 0;
442444
pub const IPPROTO_IPV6: ::c_int = 41;

src/unix/solaris/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,8 @@ pub const SOCK_STREAM: ::c_int = 2;
782782
pub const SOCK_RAW: ::c_int = 4;
783783
pub const SOCK_RDM: ::c_int = 5;
784784
pub const SOCK_SEQPACKET: ::c_int = 6;
785+
pub const IPPROTO_ICMP: ::c_int = 1;
786+
pub const IPPROTO_ICMPV6: ::c_int = 58;
785787
pub const IPPROTO_TCP: ::c_int = 6;
786788
pub const IPPROTO_IP: ::c_int = 0;
787789
pub const IPPROTO_IPV6: ::c_int = 41;

0 commit comments

Comments
 (0)