Skip to content

Commit b39d909

Browse files
committed
Merge #647
647: merge socket constants r=Susurrus > Refactor the constant declarations such that all constants are only declared once with a #[cfg] that only enables the constant on the correct platforms. Closes #637 (same PR as #646 but from another branch, to see if buildbot has a problem with PR made from master branch)
2 parents f8768e9 + c0c8e5e commit b39d909

File tree

8 files changed

+391
-643
lines changed

8 files changed

+391
-643
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@ This project adheres to [Semantic Versioning](http://semver.org/).
55

66
## [Unreleased]
77

8+
### Added
9+
- Added protocol families in `AddressFamily` enum.
10+
([#647](https://github.com/nix-rust/nix/pull/647))
11+
812
### Changed
913
- Renamed existing `ptrace` wrappers to encourage namespacing ([#692](https://github.com/nix-rust/nix/pull/692))
14+
- Changed function signature of `socket()` and `socketpair()`. The `protocol` argument
15+
has changed type from `c_int` to `SockProtocol`.
16+
It accepts a `None` value for default protocol that was specified with zero using `c_int`.
17+
([#647](https://github.com/nix-rust/nix/pull/647))
1018

1119
## [0.9.0] 2017-07-23
1220

nix-test/src/const.c

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -238,86 +238,6 @@ get_int_const(const char* err) {
238238
GET_CONST(ECAPMODE);
239239
#endif
240240

241-
/*
242-
*
243-
* ===== SOCKET OPTIONS =====
244-
*
245-
*/
246-
247-
GET_CONST(AF_UNIX);
248-
GET_CONST(AF_LOCAL);
249-
GET_CONST(AF_INET);
250-
GET_CONST(AF_INET6);
251-
GET_CONST(SOCK_STREAM);
252-
GET_CONST(SOCK_DGRAM);
253-
GET_CONST(SOCK_SEQPACKET);
254-
GET_CONST(SOCK_RAW);
255-
GET_CONST(SOCK_RDM);
256-
GET_CONST(SOL_SOCKET);
257-
GET_CONST(IPPROTO_IP);
258-
GET_CONST(IPPROTO_IPV6);
259-
GET_CONST(IPPROTO_TCP);
260-
GET_CONST(IPPROTO_UDP);
261-
GET_CONST(SO_ACCEPTCONN);
262-
GET_CONST(SO_BROADCAST);
263-
GET_CONST(SO_DEBUG);
264-
GET_CONST(SO_ERROR);
265-
GET_CONST(SO_DONTROUTE);
266-
GET_CONST(SO_KEEPALIVE);
267-
GET_CONST(SO_LINGER);
268-
GET_CONST(SO_OOBINLINE);
269-
GET_CONST(SO_RCVBUF);
270-
GET_CONST(SO_RCVLOWAT);
271-
GET_CONST(SO_SNDLOWAT);
272-
GET_CONST(SO_RCVTIMEO);
273-
GET_CONST(SO_SNDTIMEO);
274-
GET_CONST(SO_REUSEADDR);
275-
// GET_CONST(SO_REUSEPORT);
276-
GET_CONST(SO_SNDBUF);
277-
GET_CONST(SO_TIMESTAMP);
278-
GET_CONST(SO_TYPE);
279-
GET_CONST(TCP_NODELAY);
280-
GET_CONST(TCP_MAXSEG);
281-
GET_CONST(IP_MULTICAST_IF);
282-
GET_CONST(IP_MULTICAST_TTL);
283-
GET_CONST(IP_MULTICAST_LOOP);
284-
GET_CONST(IP_ADD_MEMBERSHIP);
285-
GET_CONST(IP_DROP_MEMBERSHIP);
286-
GET_CONST(INADDR_ANY);
287-
GET_CONST(INADDR_NONE);
288-
GET_CONST(INADDR_BROADCAST);
289-
GET_CONST(MSG_OOB);
290-
GET_CONST(MSG_PEEK);
291-
GET_CONST(MSG_DONTWAIT);
292-
GET_CONST(MSG_EOR);
293-
GET_CONST(MSG_TRUNC);
294-
GET_CONST(MSG_CTRUNC);
295-
GET_CONST(SHUT_RD);
296-
GET_CONST(SHUT_WR);
297-
GET_CONST(SHUT_RDWR);
298-
299-
#ifdef LINUX
300-
GET_CONST(SOL_IP);
301-
GET_CONST(SOL_TCP);
302-
GET_CONST(SOL_IPV6);
303-
GET_CONST(SOL_UDP);
304-
GET_CONST(SO_BINDTODEVICE);
305-
GET_CONST(SO_BSDCOMPAT);
306-
// GET_CONST(SO_DOMAIN);
307-
// GET_CONST(SO_MARK);
308-
GET_CONST(TCP_CORK);
309-
// GET_CONST(SO_BUSY_POLL);
310-
// GET_CONST(SO_RXQ_OVFL);
311-
GET_CONST(SO_PASSCRED);
312-
GET_CONST(SO_PRIORITY);
313-
// GET_CONST(SO_PROTOCOL);
314-
GET_CONST(SO_RCVBUFFORCE);
315-
// GET_CONST(SO_PEEK_OFF);
316-
GET_CONST(SO_PEERCRED);
317-
GET_CONST(SO_SNDBUFFORCE);
318-
GET_CONST(MSG_ERRQUEUE);
319-
#endif
320-
321241
return -1;
322242

323243
}

0 commit comments

Comments
 (0)