Skip to content

Commit

Permalink
Merge #647
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
bors[bot] committed Aug 1, 2017
2 parents f8768e9 + c0c8e5e commit b39d909
Show file tree
Hide file tree
Showing 8 changed files with 391 additions and 643 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

### Added
- Added protocol families in `AddressFamily` enum.
([#647](https://github.com/nix-rust/nix/pull/647))

### Changed
- Renamed existing `ptrace` wrappers to encourage namespacing ([#692](https://github.com/nix-rust/nix/pull/692))
- Changed function signature of `socket()` and `socketpair()`. The `protocol` argument
has changed type from `c_int` to `SockProtocol`.
It accepts a `None` value for default protocol that was specified with zero using `c_int`.
([#647](https://github.com/nix-rust/nix/pull/647))

## [0.9.0] 2017-07-23

Expand Down
80 changes: 0 additions & 80 deletions nix-test/src/const.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,86 +238,6 @@ get_int_const(const char* err) {
GET_CONST(ECAPMODE);
#endif

/*
*
* ===== SOCKET OPTIONS =====
*
*/

GET_CONST(AF_UNIX);
GET_CONST(AF_LOCAL);
GET_CONST(AF_INET);
GET_CONST(AF_INET6);
GET_CONST(SOCK_STREAM);
GET_CONST(SOCK_DGRAM);
GET_CONST(SOCK_SEQPACKET);
GET_CONST(SOCK_RAW);
GET_CONST(SOCK_RDM);
GET_CONST(SOL_SOCKET);
GET_CONST(IPPROTO_IP);
GET_CONST(IPPROTO_IPV6);
GET_CONST(IPPROTO_TCP);
GET_CONST(IPPROTO_UDP);
GET_CONST(SO_ACCEPTCONN);
GET_CONST(SO_BROADCAST);
GET_CONST(SO_DEBUG);
GET_CONST(SO_ERROR);
GET_CONST(SO_DONTROUTE);
GET_CONST(SO_KEEPALIVE);
GET_CONST(SO_LINGER);
GET_CONST(SO_OOBINLINE);
GET_CONST(SO_RCVBUF);
GET_CONST(SO_RCVLOWAT);
GET_CONST(SO_SNDLOWAT);
GET_CONST(SO_RCVTIMEO);
GET_CONST(SO_SNDTIMEO);
GET_CONST(SO_REUSEADDR);
// GET_CONST(SO_REUSEPORT);
GET_CONST(SO_SNDBUF);
GET_CONST(SO_TIMESTAMP);
GET_CONST(SO_TYPE);
GET_CONST(TCP_NODELAY);
GET_CONST(TCP_MAXSEG);
GET_CONST(IP_MULTICAST_IF);
GET_CONST(IP_MULTICAST_TTL);
GET_CONST(IP_MULTICAST_LOOP);
GET_CONST(IP_ADD_MEMBERSHIP);
GET_CONST(IP_DROP_MEMBERSHIP);
GET_CONST(INADDR_ANY);
GET_CONST(INADDR_NONE);
GET_CONST(INADDR_BROADCAST);
GET_CONST(MSG_OOB);
GET_CONST(MSG_PEEK);
GET_CONST(MSG_DONTWAIT);
GET_CONST(MSG_EOR);
GET_CONST(MSG_TRUNC);
GET_CONST(MSG_CTRUNC);
GET_CONST(SHUT_RD);
GET_CONST(SHUT_WR);
GET_CONST(SHUT_RDWR);

#ifdef LINUX
GET_CONST(SOL_IP);
GET_CONST(SOL_TCP);
GET_CONST(SOL_IPV6);
GET_CONST(SOL_UDP);
GET_CONST(SO_BINDTODEVICE);
GET_CONST(SO_BSDCOMPAT);
// GET_CONST(SO_DOMAIN);
// GET_CONST(SO_MARK);
GET_CONST(TCP_CORK);
// GET_CONST(SO_BUSY_POLL);
// GET_CONST(SO_RXQ_OVFL);
GET_CONST(SO_PASSCRED);
GET_CONST(SO_PRIORITY);
// GET_CONST(SO_PROTOCOL);
GET_CONST(SO_RCVBUFFORCE);
// GET_CONST(SO_PEEK_OFF);
GET_CONST(SO_PEERCRED);
GET_CONST(SO_SNDBUFFORCE);
GET_CONST(MSG_ERRQUEUE);
#endif

return -1;

}
Loading

0 comments on commit b39d909

Please sign in to comment.