Watt-32 tcp/ip  2.2 dev-rel.10
Todo List
Global _arp_add_gateway (const char *config_string, DWORD ip)
Move to route.c and rename to route_add().
Global _arp_gateways_get (const struct gate_entry **)
: Move to route.c and prefix with '_route'.
Global _arp_gateways_get (const struct gate_entry **)
: Move to route.c and prefix with '_route'.
Global _dx_real_alloc (int paras, WORD *para, WORD *largest)
Global _dx_real_alloc (int paras, WORD *para, WORD *largest)
Global _eth_arrived (WORD *type_ptr, BOOL *broadcast)
push back packet, else it's lost
Global _eth_arrived (WORD *type_ptr, BOOL *broadcast)
push back packet, else it's lost
Global _ip4_handler (const in_Header *ip, BOOL broadcast)

check for LSRR option and replace ip->source with actual source-address burried in option (ref. RFC-1122)

handle compressed IP (use zlib)

Global _ip4_output (in_Header *ip, DWORD src_ip, DWORD dst_ip, BYTE protocol, BYTE ttl, BYTE tos, WORD ip_id, int data_len, const void *sock, const char *file, unsigned line)
Handle IP-fragments here (call ip4_send_fragments() when needed)
Global _ip4_send_fragments (sock_type *sk, BYTE proto, DWORD dest, const void *buf, unsigned len, const char *file, unsigned line)
Maybe send highest offset fragment first?
Global _ip4_send_fragments (sock_type *sk, BYTE proto, DWORD dest, const void *buf, unsigned len, const char *file, unsigned line)
Maybe send highest offset fragment first?
Global _ip6_output (in6_Header *ip, ip6_address *src_ip, ip6_address *dst_ip, BYTE next_hdr, unsigned data_len, int hop_lim, const void *sock, const char *file, unsigned line)
: Support fragments
Global _ip6_output (in6_Header *ip, ip6_address *src_ip, ip6_address *dst_ip, BYTE next_hdr, unsigned data_len, int hop_lim, const void *sock, const char *file, unsigned line)
: Support fragments
Global _sock_append (_tcp_Socket **tcp)

Implement SYN-cookies. Ref. http://cr.yp.to/syncookies.html

Implement SYN-cookies and drop the segment if no match

drop the oldest (or a random) slot in the listen-queue.

Global _sock_set_rcv_buf (sock_type *s, size_t len)
allow user to define size using SO_RCVBUF/SO_SNDBUF before calling connect().
Global _TCP6_listen (Socket *socket, const void *host, WORD loc_port)
Support TCP listen() for AF_INET6
Global _TCP6_open (Socket *socket, const void *host, WORD loc_port, WORD rem_port)

use mss from setsockopt()

Yield for IPv6 sockets

use TCP_NODELAY set in setsockopt()

Global _TCP6_open (Socket *socket, const void *host, WORD loc_port, WORD rem_port)

use mss from setsockopt()

Yield for IPv6 sockets

use TCP_NODELAY set in setsockopt()

Global _UDP6_listen (Socket *socket, const void *host, WORD port)
Support UDP listen() for AF_INET6
Global _UDP6_open (Socket *socket, const void *host, WORD loc_port, WORD rem_port)
Support UDP connect() for AF_INET6
Global _w_watt_optarg
make a wide-char version of getopt()
Global accept (int, struct sockaddr *, int *)
Should maybe loop over all maxconn TCBs and accept the one with oldest 'syn_timestamp'.
Global accept (int, struct sockaddr *, int *)
Should maybe loop over all maxconn TCBs and accept the one with oldest 'syn_timestamp'.
Global bind (int, const struct sockaddr *, int)
check for "sleeping" ports (lport_inuse in pctcp.c) also. And return EADDRINUSE if local port not free.
Global bind (int, const struct sockaddr *, int)
check for "sleeping" ports (lport_inuse in pctcp.c) also. And return EADDRINUSE if local port not free.
Global dbg_mode_all
make them static.
Global DHCP_offer (const struct dhcp *in)
make a hook for SMB-lib
Class DNS_Header
Rewrite to use only 'struct DNS_Header'.
Global dns_opcodes [16]
parse the SRV resource record (RFC 2052)
Global echo_discard_daemon (void)
handle jumbo packets (IP-fragments)
Global eth_ifnet (void)
fill info
Global exc_app_start
find the real application start
Global exc_select (int s, Socket *socket)
Only arrival of OOB-data should count here
Global except_handler (int sig)
Disassemble crash address. Don't confuse this yet-to-be function with the function ShowStack() in stkwalk.cpp. That one is for Win32 only.
Global expand_var_str (const char *str)
support several in one line and malloc the result.
Global fcntlsocket (int s, int cmd,...)
handle O_TEXT and O_BINARY
Global fix_llc_head (void **mac)
handle IEEE 802.3 encapsulation also.
Class gate_entry
Move the gateway/route stuff to route.c
Global get_if_type_airpcap (const AIR_ADAPTER *adapter, WORD *type)
Fix me
Global get_if_type_swsvpkt (const struct SwsVpktUsr *usr, WORD *type)
Fix me
Global get_sol_opt (Socket *s, int opt, void *val, int *len)

Handle urgent (OOB) data

Handle these SOL_OPTIONS:

Global gethostbyaddr6_internal (const char *addr, struct _hostent6 *ret)

should check all addresses

should be the new aliases

Global gethostbyaddr_internal (const char *addr_name, int len, int type, struct _hostent *ret)

Should return all our addresses if we're multihomed.

should be the new aliases

Global gethostbyname_internal (const char *name, const char **alias, struct _hostent *ret)
should be canonical name
Global icmp4_dump (const in_Header *ip)
Handle debugging of these
Global icmp6_neigh_solic (const void *addr, eth_address *eth)
wait for Neighbor Advertisement
Global icmp_handler (const in_Header *ip, BOOL broadcast)

Handle cancelling raw sockets

!!

!!

send reply?

should store

send reply

send reply upwards

Global icmp_loopback (ICMP_PKT *icmp, unsigned icmp_len)
fall-through to another ICMP loopback handler
Global IDNA_convert_from_ACE (char *name, size_t *size)
Check for over-run on output.
Global iface_ioctrl (Socket *socket, long cmd, char *argp)

Get point-to-point address

Set point-to-point address

Set interface metric

Handle deleting interface address

Handle add/change interface alias

Global init_frag (int argc, char **argv)
Simulate fragment timeout
Global init_localport (void)

Make empherical port range configurable.

Use some hashing technique to speed up find_free_port().

Global init_misc (void)
Global init_timers (void)
check if 8254 PIT is really working
Global ip4_transmit (Socket *socket, const void *tx, unsigned len)
Handle sending fragments with IP optons
Global ip6_transmit (Socket *socket, const void *tx, unsigned len)
support fragmentation
Global is_in_stack_init (void)

Make CS writeable

Make CS read-only

Global is_watt32_func (const char *func)
Fill in the rest (use a generated table?)
Global main (int argc, char **argv)
Make a echo client/server test program
Global match_ip6_dest (const in6_Header *ip)
needs work
Global mtu_blackhole
Add PMTU blackhole detection
Global mtu_discover
Add PMTU discovery method
Global new_abort_handler (int sig)
: show a better MessageBox(). Show backtrace from where abort() was called; skip the 2 first CRT locations (raise, abort). Indent the printout 2 spaces.
Global ods_printf (const char *fmt, va_list arg)
: Needs to be rewritten to handle line-buffering. !!
Global open_airpcap_adapter (const char *name)
Global open_wanpacket_adapter (const char *name)
File pcigmp.c
Support IGMP v3 (draft-ietf-idmr-igmp-v3-??.txt)
Global pkt_api_entry (IREGS *reg, unsigned line)
Use 32-bit API; accessing card via pmode driver
Global pkt_eth_init (mac_address *mac_addr)
Support Win-9x/ME/CE too
Global pkt_eth_init (mac_address *mac_addr)
Support Win-9x/ME/CE too
Global pkt_release (void)
We might be called between 1st and 2nd packet-driver upcall. Need to wait for 2nd upcall to finish or else freeing the RMCB too early could cause a crash or a stuck PKTDRVR.
Global pkt_send (const void *tx, int length)
Change this so that we doesn't retry if the driver was stuck for "too long". I've seen drivers using approx. 100 msec on each iteration below. Retrying if the driver is stuck is not worth the time.
Global pkt_strerror (int code)
Return strings for these: PDERR_GEN_FAIL PDERR_NO_DRIVER PDERR_NO_CLASS PDERR_NO_MULTICAST PDERR_NO_SPACE
  • GetLastError(). Use win_strerror()
Global PmGlueEnd (void)
Support 32-bit Watcom with X32VM
Global pppoe_start (void)
Fix-me: The new MTU/MSS affects all connections (also those which doesn't use PPPoE framing).
Global priv_addr (DWORD ip)
: rewrite using mask_len().
Global query_init_ip6 (struct DNS_query *q, const void *addr)
Use "ip6.arpa" bitstring format ?
Global raw6_rx_buf (_raw6_Socket *raw, DWORD size)
Support setting Rx-buffer size of raw IPv6 sockets
Global raw6_tx_buf (_raw6_Socket *raw, DWORD size)
Support setting Tx-buffer size of raw IPv6 sockets
Global raw_rx_buf (_raw_Socket *raw, DWORD size)
Support setting Rx-buffer size of raw IPv4 sockets
Global raw_tx_buf (_raw_Socket *raw, DWORD size)
Support setting Tx-buffer size of raw IPv4 sockets
Global ReadEthersFile (void)
: Assert that.
Global res_mkquery (int op, const char *dname, int Class, int type, const u_char *data, int datalen, const u_char *newrr_in, u_char *buf, int buflen)
Handle STATUS case
Global res_mkquery (int op, const char *dname, int Class, int type, const u_char *data, int datalen, const u_char *newrr_in, u_char *buf, int buflen)
Handle STATUS case
Global rmcb [MAX_WRAPPERS]
find the real application start
Class route_entry
: Move to route.c
Global sarp_receive (const struct sarp_Packet *sarp)
Global sel_min_block
Should be configurable.
Global set_proto (int type, BOOL is_ip6, int *proto)
IPPROTO_XTP
Global set_vend_class (const char *value)
Support setting vendor class
Global sethostname (const char *fqdn, SETHOSTNAME_ARG2 len)
: should do complete alpha/digit/underscore check here
Global setup_pkt_inf (void)
Make dynamic allocation based on 'pkt_num_rx_bufs'. Allocate multiple 64kB blocks if needed (would involve messy 16-bit coding in asmpkt.nas).
Global shutdown (int, int)

For tcp, should send RST if we get incoming data. Don't send ICMP error.

For tcp, should send FIN when all Tx data has been ack'ed. close_s(s) should be same as shutdown(s,SHUT_WR)

Global shutdown (int, int)

For tcp, should send RST if we get incoming data. Don't send ICMP error.

For tcp, should send FIN when all Tx data has been ack'ed. close_s(s) should be same as shutdown(s,SHUT_WR)

Global sock_getcw (sock_type *s)
Wide character version of sock_getc()
Global sock_getsw (sock_type *s, wchar_t *data, int n)
Wide character version of sock_gets()
Global sock_packet_receive (Socket *sock, void *buf, unsigned len, struct sockaddr *from, size_t *fromlen)

This should loop until some packet is received.

should check fromlen is large enough

Global sock_putcw (sock_type *s, wchar_t ch)
Wide character versions of above functions.
Global sock_puts (sock_type *s, const BYTE *data)
suppport UDP frags
Global sock_puts (sock_type *s, const BYTE *data)
suppport UDP frags
Global sock_putsw (sock_type *s, const wchar_t *data)
Wide character version of sock_puts()
Global sock_raw4_recv (const in_Header *ip)
Handle receiving bad IP-packets for SOCK_RAW sockets.
Global split_ip6 (struct pkt_split *, const in6_Header *)
Handle Fragment, ESP, AUTH, IPv6 encap
Global std_negotiation (struct ppp_state *state, struct ppp_xcp *xcp)
extract LCP_MRU option
File syslog.c
configure variables in syslog2.c when calling openlog() thus making syslog() independent of watt_sock_init().
Global tcp_listen (_tcp_Socket *s, WORD lport, DWORD ip, WORD port, ProtoHandler handler, WORD timeout)
use mss from setsockopt()
Global tcp_listen (_tcp_Socket *s, WORD lport, DWORD ip, WORD port, ProtoHandler handler, WORD timeout)
use mss from setsockopt()
Global tcp_open (_tcp_Socket *s, WORD lport, DWORD ip, WORD rport, ProtoHandler handler)

use mss from setsockopt()

use TCP_NODELAY set in setsockopt()

Global tcp_open (_tcp_Socket *s, WORD lport, DWORD ip, WORD rport, ProtoHandler handler)

use mss from setsockopt()

use TCP_NODELAY set in setsockopt()

Global tcp_process_data (_tcp_Socket *s, const tcp_Header *tcp, int len, int *flags)
Handle Out-of-Order urgent data. Raise SIGURG.
Global tcp_reassemble (_tcp_Socket *s, const tcp_Header *tcp, const BYTE *data, UINT len, int *flags)
Create a better TCP reassembler some day. Current logic only handles 1 missed segment. We should handle at least 2.
Global tcp_receive (Socket *sock, void *buf, int len, int flags, struct sockaddr *from, size_t *fromlen)
Handle receiving Out-of-Band data
Global tcp_Retransmitter (BOOL force)

set "Slow-start" threshold

Allow for 3 SYN before giving up

Global tcp_rtt_win (_tcp_Socket *s)
Use the threshold to signify "end-of-Slow-Start" (equilibrium)
Global tcp_Socket::missed_seq [2]
Make a proper re-assembly queue. missed_seq[0] is left edge of missing segment. missed_seq[1] is right edge (in peer's absolute SEQ space)
Global tcp_Socket::tx_wscale
window scales shifts, Tx/Rx
Global tcp_synsent_state (_tcp_Socket **, const in_Header *, tcp_Header *, int)
recalculate RTT-timer
Global tcp_tick (sock_type *s)
Limit the time spent here (clamp # of loops)
Global tcp_transmit (Socket *socket, const void *buf, unsigned len, int flags)
Allow non-blocking sockets to send in SYNSENT state
File tftp.c
Support option negotiation and ETFTP (RFC-1986)
File timer.c
To get rid of the timer problem once and for all we need a timer ISR that increments a 32-bit value no regard to day roll-over etc. Maybe hook up IRQ 8 to call a real-mode stub that we opy to DOS-memory (similar to the pkt_receiver stub code. Then far-peek at that timer variable.
Global tok_ifnet (void)
fill info
Global udp_demux (const in_Header *ip, BOOL ip_bcast, DWORD destin, WORD srcPort, WORD dstPort, BOOL *udp_err)
use some kind of hashing to speed up the search.
Global udp_loopback (udp_Header *udp, unsigned udp_len)

UDP loopback handler should handle ECHO protocol

UDP loopback handler should handle DISCARD protocol

Global udp_receive (Socket *sock, void *buf, int len, int flags, struct sockaddr *from, size_t *fromlen)
This needs a redesign
Global update_in_stat (void)

Count PPP protocols LCP and IPCP

Count these IPv6 protocols

Global update_out_stat (void)

Count the PPP protocols LCP and IPCP

Count these IPv6 protocols

Global user_name [MAX_VALUELEN+1]
PPP user/passwd not handled
Global waterm_ioctrl (Socket *socket, long cmd, char *argp)

set high watermark

get high watermark

set low watermark

get low watermark

OOB data available?

Global watt_sock_init (size_t tcp_Sock_size, size_t udp_Sock_size, size_t time_t_size)
Use auto-configuration and set 'my_ip_addr' to 169.254/16
Global wattcpBuildCflags (void)
Remove excessive spaces between args. Using strtok_r() in a loop?
Global winpcap_recv_thread (void *arg)
: Take the 'adapter' info from 'arg' instead of using the global '_pkt_inf' structure.