Skip to content

Commit 68cf9e0

Browse files
committed
rollup merge of rust-lang#23517: vhbit/ext-socket-options
Continuation of rust-lang#23380 - added corresponding constants for Windows, Linux, *BSDs r? @alexcrichton Alex, can you also cc to a person who can check correctness for Windows as I'm not that confident in header file I've downloaded.
2 parents 0678f0b + 6f09dfc commit 68cf9e0

File tree

1 file changed

+106
-12
lines changed

1 file changed

+106
-12
lines changed

src/liblibc/lib.rs

Lines changed: 106 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2495,10 +2495,24 @@ pub mod consts {
24952495

24962496
pub const TCP_NODELAY: c_int = 0x0001;
24972497
pub const SOL_SOCKET: c_int = 0xffff;
2498-
pub const SO_KEEPALIVE: c_int = 8;
2499-
pub const SO_BROADCAST: c_int = 32;
2500-
pub const SO_REUSEADDR: c_int = 4;
2498+
2499+
pub const SO_DEBUG: c_int = 0x0001;
2500+
pub const SO_ACCEPTCONN: c_int = 0x0002;
2501+
pub const SO_REUSEADDR: c_int = 0x0004;
2502+
pub const SO_KEEPALIVE: c_int = 0x0008;
2503+
pub const SO_DONTROUTE: c_int = 0x0010;
2504+
pub const SO_BROADCAST: c_int = 0x0020;
2505+
pub const SO_USELOOPBACK: c_int = 0x0040;
2506+
pub const SO_LINGER: c_int = 0x0080;
2507+
pub const SO_OOBINLINE: c_int = 0x0100;
2508+
pub const SO_SNDBUF: c_int = 0x1001;
2509+
pub const SO_RCVBUF: c_int = 0x1002;
2510+
pub const SO_SNDLOWAT: c_int = 0x1003;
2511+
pub const SO_RCVLOWAT: c_int = 0x1004;
2512+
pub const SO_SNDTIMEO: c_int = 0x1005;
2513+
pub const SO_RCVTIMEO: c_int = 0x1006;
25012514
pub const SO_ERROR: c_int = 0x1007;
2515+
pub const SO_TYPE: c_int = 0x1008;
25022516

25032517
pub const IFF_LOOPBACK: c_int = 4;
25042518

@@ -3441,10 +3455,24 @@ pub mod consts {
34413455

34423456
pub const TCP_NODELAY: c_int = 1;
34433457
pub const SOL_SOCKET: c_int = 1;
3444-
pub const SO_KEEPALIVE: c_int = 9;
3445-
pub const SO_BROADCAST: c_int = 6;
3458+
3459+
pub const SO_DEBUG: c_int = 1;
34463460
pub const SO_REUSEADDR: c_int = 2;
3461+
pub const SO_TYPE: c_int = 3;
34473462
pub const SO_ERROR: c_int = 4;
3463+
pub const SO_DONTROUTE: c_int = 5;
3464+
pub const SO_BROADCAST: c_int = 6;
3465+
pub const SO_SNDBUF: c_int = 7;
3466+
pub const SO_RCVBUF: c_int = 8;
3467+
pub const SO_KEEPALIVE: c_int = 9;
3468+
pub const SO_OOBINLINE: c_int = 10;
3469+
pub const SO_LINGER: c_int = 13;
3470+
pub const SO_REUSEPORT: c_int = 15;
3471+
pub const SO_RCVLOWAT: c_int = 18;
3472+
pub const SO_SNDLOWAT: c_int = 19;
3473+
pub const SO_RCVTIMEO: c_int = 20;
3474+
pub const SO_SNDTIMEO: c_int = 21;
3475+
pub const SO_ACCEPTCONN: c_int = 30;
34483476

34493477
pub const SHUT_RD: c_int = 0;
34503478
pub const SHUT_WR: c_int = 1;
@@ -3487,10 +3515,24 @@ pub mod consts {
34873515

34883516
pub const TCP_NODELAY: c_int = 1;
34893517
pub const SOL_SOCKET: c_int = 65535;
3490-
pub const SO_KEEPALIVE: c_int = 8;
3491-
pub const SO_BROADCAST: c_int = 32;
3492-
pub const SO_REUSEADDR: c_int = 4;
3493-
pub const SO_ERROR: c_int = 4103;
3518+
3519+
pub const SO_DEBUG: c_int = 0x0001;
3520+
pub const SO_REUSEADDR: c_int = 0x0004;
3521+
pub const SO_KEEPALIVE: c_int = 0x0008;
3522+
pub const SO_DONTROUTE: c_int = 0x0010;
3523+
pub const SO_BROADCAST: c_int = 0x0020;
3524+
pub const SO_LINGER: c_int = 0x0080;
3525+
pub const SO_OOBINLINE: c_int = 0x100;
3526+
pub const SO_REUSEPORT: c_int = 0x0200;
3527+
pub const SO_SNDBUF: c_int = 0x1001;
3528+
pub const SO_RCVBUF: c_int = 0x1002;
3529+
pub const SO_SNDLOWAT: c_int = 0x1003;
3530+
pub const SO_RCVLOWAT: c_int = 0x1004;
3531+
pub const SO_SNDTIMEO: c_int = 0x1005;
3532+
pub const SO_RCVTIMEO: c_int = 0x1006;
3533+
pub const SO_ERROR: c_int = 0x1007;
3534+
pub const SO_TYPE: c_int = 0x1008;
3535+
pub const SO_ACCEPTCONN: c_int = 0x1009;
34943536

34953537
pub const SHUT_RD: c_int = 0;
34963538
pub const SHUT_WR: c_int = 1;
@@ -4002,10 +4044,24 @@ pub mod consts {
40024044
pub const TCP_NODELAY: c_int = 1;
40034045
pub const TCP_KEEPIDLE: c_int = 256;
40044046
pub const SOL_SOCKET: c_int = 0xffff;
4047+
pub const SO_DEBUG: c_int = 0x01;
4048+
pub const SO_ACCEPTCONN: c_int = 0x0002;
4049+
pub const SO_REUSEADDR: c_int = 0x0004;
40054050
pub const SO_KEEPALIVE: c_int = 0x0008;
4051+
pub const SO_DONTROUTE: c_int = 0x0010;
40064052
pub const SO_BROADCAST: c_int = 0x0020;
4007-
pub const SO_REUSEADDR: c_int = 0x0004;
4053+
pub const SO_USELOOPBACK: c_int = 0x0040;
4054+
pub const SO_LINGER: c_int = 0x0080;
4055+
pub const SO_OOBINLINE: c_int = 0x0100;
4056+
pub const SO_REUSEPORT: c_int = 0x0200;
4057+
pub const SO_SNDBUF: c_int = 0x1001;
4058+
pub const SO_RCVBUF: c_int = 0x1002;
4059+
pub const SO_SNDLOWAT: c_int = 0x1003;
4060+
pub const SO_RCVLOWAT: c_int = 0x1004;
4061+
pub const SO_SNDTIMEO: c_int = 0x1005;
4062+
pub const SO_RCVTIMEO: c_int = 0x1006;
40084063
pub const SO_ERROR: c_int = 0x1007;
4064+
pub const SO_TYPE: c_int = 0x1008;
40094065

40104066
pub const IFF_LOOPBACK: c_int = 0x8;
40114067

@@ -4403,10 +4459,24 @@ pub mod consts {
44034459

44044460
pub const TCP_NODELAY: c_int = 0x01;
44054461
pub const SOL_SOCKET: c_int = 0xffff;
4462+
pub const SO_DEBUG: c_int = 0x01;
4463+
pub const SO_ACCEPTCONN: c_int = 0x0002;
4464+
pub const SO_REUSEADDR: c_int = 0x0004;
44064465
pub const SO_KEEPALIVE: c_int = 0x0008;
4466+
pub const SO_DONTROUTE: c_int = 0x0010;
44074467
pub const SO_BROADCAST: c_int = 0x0020;
4408-
pub const SO_REUSEADDR: c_int = 0x0004;
4468+
pub const SO_USELOOPBACK: c_int = 0x0040;
4469+
pub const SO_LINGER: c_int = 0x0080;
4470+
pub const SO_OOBINLINE: c_int = 0x0100;
4471+
pub const SO_REUSEPORT: c_int = 0x0200;
4472+
pub const SO_SNDBUF: c_int = 0x1001;
4473+
pub const SO_RCVBUF: c_int = 0x1002;
4474+
pub const SO_SNDLOWAT: c_int = 0x1003;
4475+
pub const SO_RCVLOWAT: c_int = 0x1004;
4476+
pub const SO_SNDTIMEO: c_int = 0x1005;
4477+
pub const SO_RCVTIMEO: c_int = 0x1006;
44094478
pub const SO_ERROR: c_int = 0x1007;
4479+
pub const SO_TYPE: c_int = 0x1008;
44104480

44114481
pub const IFF_LOOPBACK: c_int = 0x8;
44124482

@@ -4820,10 +4890,25 @@ pub mod consts {
48204890
pub const TCP_NODELAY: c_int = 0x01;
48214891
pub const TCP_KEEPALIVE: c_int = 0x10;
48224892
pub const SOL_SOCKET: c_int = 0xffff;
4893+
4894+
pub const SO_DEBUG: c_int = 0x01;
4895+
pub const SO_ACCEPTCONN: c_int = 0x0002;
4896+
pub const SO_REUSEADDR: c_int = 0x0004;
48234897
pub const SO_KEEPALIVE: c_int = 0x0008;
4898+
pub const SO_DONTROUTE: c_int = 0x0010;
48244899
pub const SO_BROADCAST: c_int = 0x0020;
4825-
pub const SO_REUSEADDR: c_int = 0x0004;
4900+
pub const SO_USELOOPBACK: c_int = 0x0040;
4901+
pub const SO_LINGER: c_int = 0x0080;
4902+
pub const SO_OOBINLINE: c_int = 0x0100;
4903+
pub const SO_REUSEPORT: c_int = 0x0200;
4904+
pub const SO_SNDBUF: c_int = 0x1001;
4905+
pub const SO_RCVBUF: c_int = 0x1002;
4906+
pub const SO_SNDLOWAT: c_int = 0x1003;
4907+
pub const SO_RCVLOWAT: c_int = 0x1004;
4908+
pub const SO_SNDTIMEO: c_int = 0x1005;
4909+
pub const SO_RCVTIMEO: c_int = 0x1006;
48264910
pub const SO_ERROR: c_int = 0x1007;
4911+
pub const SO_TYPE: c_int = 0x1008;
48274912

48284913
pub const IFF_LOOPBACK: c_int = 0x8;
48294914

@@ -4849,6 +4934,15 @@ pub mod consts {
48494934
pub const MAP_STACK : c_int = 0;
48504935

48514936
pub const IPPROTO_RAW : c_int = 255;
4937+
4938+
pub const SO_NREAD: c_int = 0x1020;
4939+
pub const SO_NKE: c_int = 0x1021;
4940+
pub const SO_NOSIGPIPE: c_int = 0x1022;
4941+
pub const SO_NOADDRERR: c_int = 0x1023;
4942+
pub const SO_NWRITE: c_int = 0x1024;
4943+
pub const SO_DONTTRUNC: c_int = 0x2000;
4944+
pub const SO_WANTMORE: c_int = 0x4000;
4945+
pub const SO_WANTOOBFLAG: c_int = 0x8000;
48524946
}
48534947
pub mod sysconf {
48544948
use types::os::arch::c95::c_int;

0 commit comments

Comments
 (0)