OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "nacl_io/ossocket.h" | 5 #include "nacl_io/ossocket.h" |
6 #ifdef PROVIDES_SOCKET_API | 6 #ifdef PROVIDES_SOCKET_API |
7 | 7 |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <string.h> | 9 #include <string.h> |
10 | 10 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 185 |
186 socklen_t len1 = ResourceToSockAddr(addr1, sizeof(data1), saddr1); | 186 socklen_t len1 = ResourceToSockAddr(addr1, sizeof(data1), saddr1); |
187 socklen_t len2 = ResourceToSockAddr(addr2, sizeof(data2), saddr2); | 187 socklen_t len2 = ResourceToSockAddr(addr2, sizeof(data2), saddr2); |
188 | 188 |
189 if (len1 != len2) | 189 if (len1 != len2) |
190 return false; | 190 return false; |
191 | 191 |
192 return memcmp(saddr1, saddr2, len1) == 0; | 192 return memcmp(saddr1, saddr2, len1) == 0; |
193 } | 193 } |
194 | 194 |
195 Error MountNodeSocket::Accept(PP_Resource* new_sock, struct sockaddr* addr, | 195 Error MountNodeSocket::Accept(const HandleAttr& attr, |
| 196 PP_Resource* new_sock, |
| 197 struct sockaddr* addr, |
196 socklen_t* len) { | 198 socklen_t* len) { |
197 return ENOSYS; | 199 return ENOSYS; |
198 } | 200 } |
199 | 201 |
200 Error MountNodeSocket::Connect(const struct sockaddr* addr, socklen_t len) { | 202 Error MountNodeSocket::Connect(const HandleAttr& attr, |
| 203 const struct sockaddr* addr, |
| 204 socklen_t len) { |
201 if (len < 1) | 205 if (len < 1) |
202 return EINVAL; | 206 return EINVAL; |
203 | 207 |
204 if (NULL == addr) | 208 if (NULL == addr) |
205 return EFAULT; | 209 return EFAULT; |
206 | 210 |
207 return EOPNOTSUPP; | 211 return EOPNOTSUPP; |
208 } | 212 } |
209 | 213 |
210 Error MountNodeSocket::Listen(int backlog) { | 214 Error MountNodeSocket::Listen(int backlog) { |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 *len = ResourceToSockAddr(local_addr_, *len, addr); | 421 *len = ResourceToSockAddr(local_addr_, *len, addr); |
418 return 0; | 422 return 0; |
419 } | 423 } |
420 | 424 |
421 return ENOTCONN; | 425 return ENOTCONN; |
422 } | 426 } |
423 | 427 |
424 } // namespace nacl_io | 428 } // namespace nacl_io |
425 | 429 |
426 #endif // PROVIDES_SOCKET_API | 430 #endif // PROVIDES_SOCKET_API |
OLD | NEW |