| Index: runtime/bin/socket_base_fuchsia.cc
|
| diff --git a/runtime/bin/socket_base_fuchsia.cc b/runtime/bin/socket_base_fuchsia.cc
|
| index f927f4281edb0810d6a8510d2e2c266c529be139..6c204a08654e016eb05b970c8f34d905d0b8f0ac 100644
|
| --- a/runtime/bin/socket_base_fuchsia.cc
|
| +++ b/runtime/bin/socket_base_fuchsia.cc
|
| @@ -67,13 +67,11 @@ SocketAddress::SocketAddress(struct sockaddr* sa) {
|
| memmove(reinterpret_cast<void*>(&addr_), sa, salen);
|
| }
|
|
|
| -
|
| bool SocketBase::Initialize() {
|
| // Nothing to do on Fuchsia.
|
| return true;
|
| }
|
|
|
| -
|
| bool SocketBase::FormatNumericAddress(const RawAddr& addr,
|
| char* address,
|
| int len) {
|
| @@ -83,13 +81,11 @@ bool SocketBase::FormatNumericAddress(const RawAddr& addr,
|
| 0, NI_NUMERICHOST) == 0));
|
| }
|
|
|
| -
|
| bool SocketBase::IsBindError(intptr_t error_number) {
|
| return error_number == EADDRINUSE || error_number == EADDRNOTAVAIL ||
|
| error_number == EINVAL;
|
| }
|
|
|
| -
|
| intptr_t SocketBase::Available(intptr_t fd) {
|
| IOHandle* handle = reinterpret_cast<IOHandle*>(fd);
|
| ASSERT(handle->fd() >= 0);
|
| @@ -98,7 +94,6 @@ intptr_t SocketBase::Available(intptr_t fd) {
|
| return available;
|
| }
|
|
|
| -
|
| intptr_t SocketBase::Read(intptr_t fd,
|
| void* buffer,
|
| intptr_t num_bytes,
|
| @@ -123,7 +118,6 @@ intptr_t SocketBase::Read(intptr_t fd,
|
| return read_bytes;
|
| }
|
|
|
| -
|
| intptr_t SocketBase::RecvFrom(intptr_t fd,
|
| void* buffer,
|
| intptr_t num_bytes,
|
| @@ -134,7 +128,6 @@ intptr_t SocketBase::RecvFrom(intptr_t fd,
|
| return -1;
|
| }
|
|
|
| -
|
| intptr_t SocketBase::Write(intptr_t fd,
|
| const void* buffer,
|
| intptr_t num_bytes,
|
| @@ -159,7 +152,6 @@ intptr_t SocketBase::Write(intptr_t fd,
|
| return written_bytes;
|
| }
|
|
|
| -
|
| intptr_t SocketBase::SendTo(intptr_t fd,
|
| const void* buffer,
|
| intptr_t num_bytes,
|
| @@ -170,7 +162,6 @@ intptr_t SocketBase::SendTo(intptr_t fd,
|
| return -1;
|
| }
|
|
|
| -
|
| intptr_t SocketBase::GetPort(intptr_t fd) {
|
| IOHandle* handle = reinterpret_cast<IOHandle*>(fd);
|
| ASSERT(handle->fd() >= 0);
|
| @@ -183,7 +174,6 @@ intptr_t SocketBase::GetPort(intptr_t fd) {
|
| return SocketAddress::GetAddrPort(raw);
|
| }
|
|
|
| -
|
| SocketAddress* SocketBase::GetRemotePeer(intptr_t fd, intptr_t* port) {
|
| IOHandle* handle = reinterpret_cast<IOHandle*>(fd);
|
| ASSERT(handle->fd() >= 0);
|
| @@ -196,27 +186,23 @@ SocketAddress* SocketBase::GetRemotePeer(intptr_t fd, intptr_t* port) {
|
| return new SocketAddress(&raw.addr);
|
| }
|
|
|
| -
|
| void SocketBase::GetError(intptr_t fd, OSError* os_error) {
|
| LOG_ERR("SocketBase::GetError is unimplemented\n");
|
| UNIMPLEMENTED();
|
| }
|
|
|
| -
|
| int SocketBase::GetType(intptr_t fd) {
|
| LOG_ERR("SocketBase::GetType is unimplemented\n");
|
| UNIMPLEMENTED();
|
| return File::kOther;
|
| }
|
|
|
| -
|
| intptr_t SocketBase::GetStdioHandle(intptr_t num) {
|
| LOG_ERR("SocketBase::GetStdioHandle is unimplemented\n");
|
| UNIMPLEMENTED();
|
| return num;
|
| }
|
|
|
| -
|
| AddressList<SocketAddress>* SocketBase::LookupAddress(const char* host,
|
| int type,
|
| OSError** os_error) {
|
| @@ -261,7 +247,6 @@ AddressList<SocketAddress>* SocketBase::LookupAddress(const char* host,
|
| return addresses;
|
| }
|
|
|
| -
|
| bool SocketBase::ReverseLookup(const RawAddr& addr,
|
| char* host,
|
| intptr_t host_len,
|
| @@ -271,7 +256,6 @@ bool SocketBase::ReverseLookup(const RawAddr& addr,
|
| return false;
|
| }
|
|
|
| -
|
| bool SocketBase::ParseAddress(int type, const char* address, RawAddr* addr) {
|
| int result;
|
| if (type == SocketAddress::TYPE_IPV4) {
|
| @@ -284,7 +268,6 @@ bool SocketBase::ParseAddress(int type, const char* address, RawAddr* addr) {
|
| return (result == 1);
|
| }
|
|
|
| -
|
| static bool ShouldIncludeIfaAddrs(netc_if_info_t* if_info, int lookup_family) {
|
| const int family = if_info->addr.ss_family;
|
| return ((lookup_family == family) ||
|
| @@ -292,12 +275,10 @@ static bool ShouldIncludeIfaAddrs(netc_if_info_t* if_info, int lookup_family) {
|
| ((family == AF_INET) || (family == AF_INET6)))));
|
| }
|
|
|
| -
|
| bool SocketBase::ListInterfacesSupported() {
|
| return true;
|
| }
|
|
|
| -
|
| AddressList<InterfaceSocketAddress>* SocketBase::ListInterfaces(
|
| int type,
|
| OSError** os_error) {
|
| @@ -343,21 +324,18 @@ AddressList<InterfaceSocketAddress>* SocketBase::ListInterfaces(
|
| return addresses;
|
| }
|
|
|
| -
|
| void SocketBase::Close(intptr_t fd) {
|
| IOHandle* handle = reinterpret_cast<IOHandle*>(fd);
|
| ASSERT(handle->fd() >= 0);
|
| NO_RETRY_EXPECTED(close(handle->fd()));
|
| }
|
|
|
| -
|
| bool SocketBase::GetNoDelay(intptr_t fd, bool* enabled) {
|
| LOG_ERR("SocketBase::GetNoDelay is unimplemented\n");
|
| UNIMPLEMENTED();
|
| return false;
|
| }
|
|
|
| -
|
| bool SocketBase::SetNoDelay(intptr_t fd, bool enabled) {
|
| IOHandle* handle = reinterpret_cast<IOHandle*>(fd);
|
| int on = enabled ? 1 : 0;
|
| @@ -366,7 +344,6 @@ bool SocketBase::SetNoDelay(intptr_t fd, bool enabled) {
|
| sizeof(on))) == 0;
|
| }
|
|
|
| -
|
| bool SocketBase::GetMulticastLoop(intptr_t fd,
|
| intptr_t protocol,
|
| bool* enabled) {
|
| @@ -375,7 +352,6 @@ bool SocketBase::GetMulticastLoop(intptr_t fd,
|
| return false;
|
| }
|
|
|
| -
|
| bool SocketBase::SetMulticastLoop(intptr_t fd,
|
| intptr_t protocol,
|
| bool enabled) {
|
| @@ -384,35 +360,30 @@ bool SocketBase::SetMulticastLoop(intptr_t fd,
|
| return false;
|
| }
|
|
|
| -
|
| bool SocketBase::GetMulticastHops(intptr_t fd, intptr_t protocol, int* value) {
|
| LOG_ERR("SocketBase::GetMulticastHops is unimplemented\n");
|
| UNIMPLEMENTED();
|
| return false;
|
| }
|
|
|
| -
|
| bool SocketBase::SetMulticastHops(intptr_t fd, intptr_t protocol, int value) {
|
| LOG_ERR("SocketBase::SetMulticastHops is unimplemented\n");
|
| UNIMPLEMENTED();
|
| return false;
|
| }
|
|
|
| -
|
| bool SocketBase::GetBroadcast(intptr_t fd, bool* enabled) {
|
| LOG_ERR("SocketBase::GetBroadcast is unimplemented\n");
|
| UNIMPLEMENTED();
|
| return false;
|
| }
|
|
|
| -
|
| bool SocketBase::SetBroadcast(intptr_t fd, bool enabled) {
|
| LOG_ERR("SocketBase::SetBroadcast is unimplemented\n");
|
| UNIMPLEMENTED();
|
| return false;
|
| }
|
|
|
| -
|
| bool SocketBase::JoinMulticast(intptr_t fd,
|
| const RawAddr& addr,
|
| const RawAddr&,
|
| @@ -422,7 +393,6 @@ bool SocketBase::JoinMulticast(intptr_t fd,
|
| return false;
|
| }
|
|
|
| -
|
| bool SocketBase::LeaveMulticast(intptr_t fd,
|
| const RawAddr& addr,
|
| const RawAddr&,
|
|
|