10 /* socket management structure */
13 struct sockaddr_sw addr;
14 enum sock_bind_state bind_state;
15 struct sock_list *next;
16 struct sock_list *prev;
19 static struct sock_list sock_list_head = {
20 .next = &sock_list_head,
21 .prev = &sock_list_head
25 * Add new socket to list. Called by sw_socket "syscall".
27 struct sock_list *list_add_socket(int s);
30 * Bind socket to given address. Called by sw_bind "syscall".
33 struct sock_list *list_update_socket_address(int s, __CONST_SOCKADDR_ARG addr);
36 * Get list element containing socket s. Called by sw_send* "syscalls".
39 struct sock_list *list_elem_from_socket(int s);
42 * Get list element containing address addr. Called by sw_bind "syscall".
45 struct sock_list *list_elem_from_address(__CONST_SOCKADDR_ARG addr);
48 * Remove socket from list. Called by sw_close "syscall".
51 int list_remove_socket(int s);
54 * Check if a socket is bound.
56 int list_socket_is_bound(int s);