Implement sock_addr_remote syscall (#1360)
Slightly changed the interface sock_addr_remote - since we already have a `__wasi_addr_t` structure which is an union, there's no need for passing length around - the address buffer will always have the right length (i.e. max of all address families).
This commit is contained in:
@ -393,6 +393,25 @@ int
|
||||
os_socket_addr_local(bh_socket_t socket, uint8_t *buf, size_t buflen,
|
||||
uint16_t *port, uint8_t *is_ipv4);
|
||||
|
||||
/**
|
||||
* Returns an binary address and a port of the remote socket
|
||||
*
|
||||
* @param socket the remote socket
|
||||
*
|
||||
* @param buf buffer to store the address
|
||||
*
|
||||
* @param buflen length of the buf buffer
|
||||
*
|
||||
* @param port a buffer for storing socket's port
|
||||
*
|
||||
* @param is_ipv4 a buffer for storing information about the address family
|
||||
*
|
||||
* @return On success, returns 0; otherwise, it returns -1.
|
||||
*/
|
||||
int
|
||||
os_socket_addr_remote(bh_socket_t socket, uint8_t *buf, size_t buflen,
|
||||
uint16_t *port, uint8_t *is_ipv4);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user