| /* |
| * Copyright 2019, Data61, CSIRO (ABN 41 687 119 230) |
| * |
| * SPDX-License-Identifier: GPL-2.0-only |
| */ |
| |
| procedure PicoControl { |
| include "picoserver_peer.h"; |
| include "picoserver_event.h"; |
| /* Only support IPv4 and UDP/TCP at the moment */ |
| int open(in bool is_udp); |
| /* |
| * For bind and connect, the addresses will be expected in network order (1.2.3.4 -> 0x04030201), |
| * ports in non-network order (port 9000 -> (uint16_t) 9000) |
| */ |
| int bind(in int socket_fd, in uint32_t local_addr, in uint16_t port); |
| int connect(in int socket_fd, in uint32_t server_addr, in uint16_t port); |
| int listen(in int socket_fd, in int backlog); |
| picoserver_peer_t accept(in int socket_fd); |
| int shutdown(in int socket_fd, in int mode); |
| int close(in int socket_fd); |
| picoserver_event_t event_poll(void); |
| int get_ipv4(out uint32_t ipaddr); |
| int set_async(in int socket_fd, in bool enabled); |
| }; |