Commit e127df07 authored by Dan Melnic's avatar Dan Melnic Committed by Facebook GitHub Bot

Fix OSS build - move struct/enums into their own namespace

Summary: Fix OSS build - move struct/enums into their own namespace

Reviewed By: danobi, lnicco

Differential Revision: D25769992

fbshipit-source-id: 1e337820edbd986bdd47099cf8af942698e6fc75
parent 0cc9b77f
...@@ -1177,11 +1177,11 @@ AsyncUDPSocket::TXTime AsyncUDPSocket::getTXTime() { ...@@ -1177,11 +1177,11 @@ AsyncUDPSocket::TXTime AsyncUDPSocket::getTXTime() {
if (FOLLY_UNLIKELY(!txTime_.has_value())) { if (FOLLY_UNLIKELY(!txTime_.has_value())) {
TXTime txTime; TXTime txTime;
#ifdef FOLLY_HAVE_MSG_ERRQUEUE #ifdef FOLLY_HAVE_MSG_ERRQUEUE
struct net_sock_txtime val = {}; folly::netops::sock_txtime val = {};
socklen_t optlen = sizeof(val); socklen_t optlen = sizeof(val);
if (!netops::getsockopt(fd_, SOL_SOCKET, SO_TXTIME, &val, &optlen)) { if (!netops::getsockopt(fd_, SOL_SOCKET, SO_TXTIME, &val, &optlen)) {
txTime.clockid = val.clockid; txTime.clockid = val.clockid;
txTime.deadline = (val.flags & SOF_TXTIME_DEADLINE_MODE); txTime.deadline = (val.flags & folly::netops::SOF_TXTIME_DEADLINE_MODE);
} }
#endif #endif
txTime_ = txTime; txTime_ = txTime;
...@@ -1192,9 +1192,9 @@ AsyncUDPSocket::TXTime AsyncUDPSocket::getTXTime() { ...@@ -1192,9 +1192,9 @@ AsyncUDPSocket::TXTime AsyncUDPSocket::getTXTime() {
bool AsyncUDPSocket::setTXTime(TXTime txTime) { bool AsyncUDPSocket::setTXTime(TXTime txTime) {
#ifdef FOLLY_HAVE_MSG_ERRQUEUE #ifdef FOLLY_HAVE_MSG_ERRQUEUE
struct net_sock_txtime val; folly::netops::sock_txtime val;
val.clockid = txTime.clockid; val.clockid = txTime.clockid;
val.flags = txTime.deadline ? SOF_TXTIME_DEADLINE_MODE : 0; val.flags = txTime.deadline ? folly::netops::SOF_TXTIME_DEADLINE_MODE : 0;
int ret = int ret =
netops::setsockopt(fd_, SOL_SOCKET, SO_TIMESTAMPING, &val, sizeof(val)); netops::setsockopt(fd_, SOL_SOCKET, SO_TIMESTAMPING, &val, sizeof(val));
......
...@@ -60,7 +60,9 @@ ...@@ -60,7 +60,9 @@
#endif #endif
#ifdef FOLLY_HAVE_MSG_ERRQUEUE #ifdef FOLLY_HAVE_MSG_ERRQUEUE
enum net_txtime_flags { namespace folly {
namespace netops {
enum txtime_flags {
SOF_TXTIME_DEADLINE_MODE = (1 << 0), SOF_TXTIME_DEADLINE_MODE = (1 << 0),
SOF_TXTIME_REPORT_ERRORS = (1 << 1), SOF_TXTIME_REPORT_ERRORS = (1 << 1),
...@@ -68,10 +70,12 @@ enum net_txtime_flags { ...@@ -68,10 +70,12 @@ enum net_txtime_flags {
SOF_TXTIME_FLAGS_MASK = (SOF_TXTIME_FLAGS_LAST - 1) | SOF_TXTIME_FLAGS_LAST SOF_TXTIME_FLAGS_MASK = (SOF_TXTIME_FLAGS_LAST - 1) | SOF_TXTIME_FLAGS_LAST
}; };
struct net_sock_txtime { struct sock_txtime {
__kernel_clockid_t clockid; /* reference clockid */ __kernel_clockid_t clockid; /* reference clockid */
__u32 flags; /* as defined by enum txtime_flags */ __u32 flags; /* as defined by enum txtime_flags */
}; };
} // namespace netops
} // namespace folly
#endif #endif
#ifndef MSG_ZEROCOPY #ifndef MSG_ZEROCOPY
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment