46#define FIONREAD 0x541B
48#define MSG_PEEK 0x0002
49#define MSG_TRUNC 0x0020
55#define INET_RECEIVE_MAX (64 * 1024)
56#define INET_PORT_FIRST 49152
uint8_t flags
Definition idt.c:3
int32_t inet_socket_send(file_t *file, const kiovec_t *iov, uint32_t iov_count, const ksockaddr_in_t *to, uint32_t flags)
send one datagram from user memory, or data on a stream (as much as fits; it blocks for room unless t...
Definition inet_socket.c:266
int32_t inet_socket_connect(file_t *file, const ksockaddr_in_t *addr)
a datagram socket: set the address datagrams go to and the only one they come from; AF_UNSPEC (family...
Definition inet_socket.c:192
bool inet_socket_deliver_udp(uint32_t dst, uint16_t dst_port, uint32_t src, uint16_t src_port, const uint8_t *data, uint32_t length)
give a received UDP datagram to the socket it is for (net_lock held).
Definition inet_socket.c:654
void inet_socket_deliver_echo(uint32_t src, uint16_t id, const uint8_t *message, uint32_t length)
give a received echo reply to the ICMP socket with its identifier (net_lock held).
Definition inet_socket.c:682
int32_t inet_socket_accept(file_t *file, uint32_t flags, file_t **out, ksockaddr_in_t *peer)
take the next connection of a listening stream socket (blocks unless the file is non-blocking).
Definition inet_socket.c:796
int32_t inet_socket_create(uint32_t type, uint32_t protocol, uint32_t flags, file_t **out)
make a new socket and its open file.
Definition inet_socket.c:42
int32_t inet_socket_name(inet_socket_t *s, bool peer, ksockaddr_in_t *out)
the local address (peer false) or the connected one (peer true).
Definition inet_socket.c:466
int32_t inet_socket_receive(file_t *file, const kiovec_t *iov, uint32_t iov_count, ksockaddr_in_t *from, uint32_t flags, bool dontwait, uint32_t *full)
receive one datagram into user memory (blocks unless the file is non-blocking or dontwait).
Definition inet_socket.c:372
int32_t inet_socket_get_option(inet_socket_t *s, int32_t level, int32_t name, int32_t *value)
Definition inet_socket.c:526
int32_t inet_socket_shutdown(inet_socket_t *s, int32_t how)
shutdown: SHUT_RD, SHUT_WR or SHUT_RDWR.
Definition inet_socket.c:576
int32_t inet_socket_set_option(inet_socket_t *s, int32_t level, int32_t name, int32_t value)
setsockopt and getsockopt (an int value).
Definition inet_socket.c:497
int32_t inet_socket_listen(inet_socket_t *s, uint32_t backlog)
a stream socket takes connections.
Definition inet_socket.c:791
inet_socket_t * inet_socket_of(file_t *file)
the socket of an open file, or NULL if the file is not an IPv4 socket.
Definition inet_socket.c:37
int32_t inet_socket_bind(inet_socket_t *s, const ksockaddr_in_t *addr)
give a socket a local address and port (port 0: one not in use).
Definition inet_socket.c:154
struct inet_socket inet_socket_t
Definition inet_socket.h:66
unsigned int uint32_t
Definition fb.h:17
unsigned char uint8_t
Definition fb.h:18
unsigned short uint16_t
Definition stdint.h:13
int int32_t
Definition stdint.h:14
an open-file description.
Definition file.h:64
Definition inet_internal.h:23
uint8_t protocol
Definition inet_internal.h:25
Definition unix_socket.h:49
Definition inet_socket.h:59
uint16_t sin_family
Definition inet_socket.h:60
uint16_t sin_port
Definition inet_socket.h:61
uint32_t sin_addr
Definition inet_socket.h:62
uint8_t sin_zero[8]
Definition inet_socket.h:63
Unix domain stream sockets, with file descriptor passing.