Skip to content

Commit c90cc26

Browse files
linux: Add definitions for Multipath TCP
1 parent 458f49c commit c90cc26

File tree

5 files changed

+20
-1
lines changed

5 files changed

+20
-1
lines changed

libc-test/build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2646,6 +2646,10 @@ fn test_linux(target: &str) {
26462646
// Require Linux kernel 5.6:
26472647
"VMADDR_CID_LOCAL" => true,
26482648

2649+
// IPPROTO_MAX was increased in 5.6 for IPPROTO_MPTCP:
2650+
| "IPPROTO_MAX"
2651+
| "IPPROTO_MPTCP" => true,
2652+
26492653
// Defined in kernel headers but musl removes it; need musl 1.2 for definition in musl
26502654
// headers.
26512655
"P_PIDFD" => true,

src/unix/linux_like/android/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,8 @@ pub const SOCK_SEQPACKET: ::c_int = 5;
10081008
pub const SOCK_DCCP: ::c_int = 6;
10091009
pub const SOCK_PACKET: ::c_int = 10;
10101010

1011+
pub const IPPROTO_MAX: ::c_int = 256;
1012+
10111013
pub const SOL_SOCKET: ::c_int = 1;
10121014
pub const SOL_SCTP: ::c_int = 132;
10131015
pub const SOL_IPX: ::c_int = 256;
@@ -1068,6 +1070,8 @@ pub const SO_RXQ_OVFL: ::c_int = 40;
10681070
pub const SO_PEEK_OFF: ::c_int = 42;
10691071
pub const SO_BUSY_POLL: ::c_int = 46;
10701072

1073+
pub const TCP_ULP: ::c_int = 31;
1074+
10711075
pub const IPTOS_ECN_NOTECT: u8 = 0x00;
10721076

10731077
pub const O_ACCMODE: ::c_int = 3;

src/unix/linux_like/emscripten/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,6 +1557,8 @@ pub const SOCK_STREAM: ::c_int = 1;
15571557
pub const SOCK_DGRAM: ::c_int = 2;
15581558
pub const SOCK_SEQPACKET: ::c_int = 5;
15591559

1560+
pub const IPPROTO_MAX: ::c_int = 256;
1561+
15601562
pub const SOL_SOCKET: ::c_int = 1;
15611563

15621564
pub const SO_REUSEADDR: ::c_int = 2;

src/unix/linux_like/linux/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,7 @@ pub const RTLD_NOW: ::c_int = 0x2;
12281228
pub const AT_EACCESS: ::c_int = 0x200;
12291229

12301230
pub const TCP_MD5SIG: ::c_int = 14;
1231+
pub const TCP_ULP: ::c_int = 31;
12311232

12321233
align_const! {
12331234
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
@@ -1262,6 +1263,15 @@ pub const SCHED_RESET_ON_FORK: ::c_int = 0x40000000;
12621263

12631264
// netinet/in.h
12641265
// NOTE: These are in addition to the constants defined in src/unix/mod.rs
1266+
1267+
/// Multipath TCP
1268+
pub const IPPROTO_MPTCP: ::c_int = 262;
1269+
#[deprecated(
1270+
since = "0.2.79",
1271+
note = "IPPROTO_MAX depends on the kernel version on the target system"
1272+
)]
1273+
pub const IPPROTO_MAX: ::c_int = 263;
1274+
12651275
pub const AF_IB: ::c_int = 27;
12661276
pub const AF_MPLS: ::c_int = 28;
12671277
pub const AF_NFC: ::c_int = 39;

src/unix/linux_like/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,6 @@ pub const IPPROTO_UDPLITE: ::c_int = 136;
869869
pub const IPPROTO_MPLS: ::c_int = 137;
870870
/// raw IP packet
871871
pub const IPPROTO_RAW: ::c_int = 255;
872-
pub const IPPROTO_MAX: ::c_int = 256;
873872

874873
pub const MCAST_EXCLUDE: ::c_int = 0;
875874
pub const MCAST_INCLUDE: ::c_int = 1;

0 commit comments

Comments
 (0)