Definition in file socket.h.
Go to the source code of this file.
Data Structures | |
| struct | sock_packet_buf |
| struct | sock_packet_pool |
| struct | Socket |
Typedefs | |
| typedef sock_packet_pool | sock_packet_pool |
| typedef Socket | Socket |
Functions | |
| W32_FUNC int | close_s (int s) |
| W32_FUNC int | write_s (int s, const char *buf, int num) |
| W32_FUNC int | writev_s (int s, const struct iovec *vec, size_t num) |
| W32_FUNC int | recvmsg (int s, struct msghdr *msg, int flags) |
| W32_FUNC int | read_s (int s, char *buf, int num) |
| W32_FUNC int | select_s (int n, fd_set *r, fd_set *w, fd_set *x, struct timeval *t) |
| The select_s() function. | |
| W32_FUNC int W32_CALL | select (int num_sockets, fd_set *read_events, fd_set *write_events, fd_set *except_events, struct timeval *timeout) |
| int | _sock_sig_setup (void) |
| int | _sock_sig_restore (void) |
| int | _sock_sig_pending (void) |
| int | _sock_sig_epipe (const Socket *s) |
| void | _sock_crit_start (void) |
| Start a critical region. | |
| void | _sock_crit_stop (void) |
| Mark the end of a critical region. | |
| void | _sock_start_timer (void) |
| void | _sock_stop_timer (void) |
| unsigned | sock_packet_transmit (Socket *sock, const void *buf, unsigned len, const struct sockaddr *to, int tolen) |
| unsigned | sock_packet_receive (Socket *sock, void *buf, unsigned len, struct sockaddr *from, int *fromlen) |
| Called from receive.c for AF_PACKET sockets. | |
| unsigned | sock_packet_rbused (Socket *sock) |
| void * | _sock_calloc (size_t size, const char *file, unsigned line) |
| Memory allocation; print some info if allocation fails. | |
| Socket * | _sock_del_fd (int sock, const char *file, unsigned line) |
| Delete the socket from `inuse' array and all memory associated with it. | |
| Socket * | _socklist_find (int s) |
| Returns a pointer to the Socket structure associated with socket 's'. | |
| BOOL | _sock_dos_fd (int s) |
| _sock_dos_fd - Return TRUE if `s' is a valid DOS/Win32 handle. | |
| int | _sock_half_open (const _tcp_Socket *tcp) |
| _sock_half_open - Return true if peer closed his side. | |
| int | _sock_append (_tcp_Socket **tcp) |
| Called from tcp_fsm.c / tcp_listen_state() (via _bsd_socket_hook) to append a new connection to the listen-queue of socket 'sock'. | |
| int | _sock_set_rcv_buf (sock_type *s, size_t len) |
| Setup a bigger receive buffer, the default in Wattcp is only 2k. | |
| void | _sock_free_rcv_buf (sock_type *s) |
| Free receive buffer associated with udp/tcp sockets. | |
| void | _sock_set_syn_hook (int(*func)(_tcp_Socket **)) |
| BOOL | _sock_set_promisc_rx_mode (void) |
| BOOL | _sock_set_mcast_rx_mode (void) |
| BOOL | _sock_set_normal_rx_mode (const Socket *_this) |
| const sock_type * | __get_sock_from_s (int s, int proto) |
| Hack function if user application needs to use Wattcp core functions for BSD sockets. | |
| void | __get_ifname (char *if_name) |
| void | __set_ifname (const char *if_name) |
| int | __scope_ascii_to_id (const char *str) |
| int | __scope_id_to_ascii (int scope) |
| int | _sock_chk_sockaddr (Socket *socket, const struct sockaddr *sa, int len) |
| Check `sockaddr*' passed to bind/connect. | |
| int | _TCP_open (Socket *socket, struct in_addr host, WORD loc_port, WORD rem_port) |
| Open and listen routines for SOCK_STREAM at the socket-level. | |
| int | _UDP_open (Socket *socket, struct in_addr host, WORD loc_port, WORD rem_port) |
| Open and listen routines for SOCK_DGRAM at the socket-level. | |
| int | _TCP_listen (Socket *socket, struct in_addr host, WORD loc_port) |
| int | _UDP_listen (Socket *socket, struct in_addr host, WORD port) |
| int | _TCP6_open (Socket *socket, const void *host, WORD loc_port, WORD rem_port) |
| int | _UDP6_open (Socket *socket, const void *host, WORD loc_port, WORD rem_port) |
| int | _TCP6_listen (Socket *socket, const void *host, WORD loc_port) |
| int | _UDP6_listen (Socket *socket, const void *host, WORD port) |
|
||||||||||||
|
Hack function if user application needs to use Wattcp core functions for BSD sockets. Must *not* modify return value in any way. Definition at line 293 of file SOCKET.C. |
|
|
Called from tcp_fsm.c / tcp_listen_state() (via _bsd_socket_hook) to append a new connection to the listen-queue of socket 'sock'. TCB on input ('orig') has received a SYN. Replace TCB on output with a cloned TCB that we append to the listen-queue and eventually is used by accept() to create a new socket. TCB on input ('orig') must still be listening for further connections on the same port as specified in call to _TCP_listen().
References _bsd_socket_hook(), _sock_set_rcv_buf(), _tcp_allsocs, _tcp_Socket::last_acknum, _tcp_Socket::last_seqnum, _tcp_Socket::my6addr, _tcp_Socket::send_next, set_timeout(), tcp_recv_win, and _tcp_Socket::unhappy. |
|
|
Start a critical region. Prevent `sk_list' being destroyed (e.g. in sock_daemon) and thus confusing select_s(), connect() etc. Definition at line 1282 of file SOCKET.C. |
|
|
Mark the end of a critical region. If blocking-level reached zero, we run our socket-daemon.
References sock_daemon(). |
|
||||||||||||||||
|
Delete the socket from `inuse' array and all memory associated with it. Also unlink it from the socket list (sk_list). Clear _tcp_syn_hook is no more SOCK_STREAM listeners. Return pointer to next node in list or NULL if none/error. Definition at line 686 of file SOCKET.C. References _bsd_socket_hook(), _pkt_rxmode, _sock_free_rcv_buf(), _socklist_find(), inuse, other_tcp_listeners(), RXMODE_BROADCAST, sk_list_del(), sock_abort(), sock_raw_del(), sock_type::tcp, and sock_type::udp. |
|
|
_sock_dos_fd - Return TRUE if `s' is a valid DOS/Win32 handle. Used to differentiate EBADF from ENOTSOCK. Note: for non-djgpp targets `s' may have same value as a DOS-handle. This function should only be used when `s' isn't found in `sk_list'. Definition at line 213 of file SOCKET.C. |
|
|
_sock_half_open - Return true if peer closed his side. There might still be data to read Definition at line 2167 of file SOCKET.C. References _tcp_Socket::state. |
|
||||||||||||
|
Setup a bigger receive buffer, the default in Wattcp is only 2k.
References BYTE. |
|
|
Returns a pointer to the Socket structure associated with socket 's'. If socket `s' was not found, NULL is returned. Definition at line 1500 of file SOCKET.C. References init_sockets(). |
|
||||||||||||||||
|
|
|
||||||||||||||||||||
|
< Definition at line 2038 of file SOCKET.C. References _default_ttl, _eth_is_init, _inet6_ntoa(), _sock_set_rcv_buf(), _tcp_allsocs, _tcp_unthread(), icmp_upcall, my_ip_addr, set_timeout(), socket(), tcp_nagle, tcp_OPEN_TO, tcp_recv_win, UINT, and WORD. |
|
||||||||||||||||||||
|
Open and listen routines for SOCK_STREAM at the socket-level. The parameters to tcp_open() is a bit tricky, but the internal Wattcp socket 's' contains the following elements that must match in the first 'for-loop' of _tcp_handler(). s->hisport != 0 i.e. active (non-listening) port s->myaddr == ip->destination, our IP-address s->hisaddr == ip->source, above 'dest' address s->myport == tcp->dstPort, above 'loc_port' s->hisport == tcp->srcPort, above 'rem_port' Definition at line 1995 of file SOCKET.C. References _sock_set_rcv_buf(), DWORD, icmp_upcall, socket(), tcp_open(), tcp_recv_win, and WORD. |
|
||||||||||||||||
|
|
|
||||||||||||||||||||
|
References _sock_set_rcv_buf(), icmp_upcall, socket(), and WORD. |
|
||||||||||||||||||||||||
|
The select_s() function.
Clear our "working" fd_sets.
|
|
||||||||||||||||||||||||
|
Called from receive.c for AF_PACKET sockets.
References _eth_get_hwtype(), _pkt_ip_ofs, BYTE, and WORD. |
1.3.8