Watt-32 tcp/ip  2.2 dev-rel.10
Functions | Variables
echo.c File Reference

Go to the source code of this file.

Functions

static void (W32_CALL *prev_hook)(const char *
 
static const char *static void echo_discard_daemon (void)
 "background" process handling echo + discard TCP sockets. More...
 
static void W32_CALL udp_handler (sock_type *s, void *data, int len, const tcp_PseudoHeader *ph, const void *udp)
 Callback handler for echo + discard UDP sockets.
 
static void W32_CALL echo_config (const char *name, const char *value)
 
static void echo_discard_exit (void)
 Don't bother resetting any connections. More...
 
void echo_discard_init (void)
 Called from watt_sock_init(): Setup config-file parser for "echo..." and "discard.." keywords.
 
void echo_discard_start (void)
 Starts the echo/discard services (udp/tcp).
 
int main (int argc, char **argv)
 

Variables

static _udp_Socketudp_echo_sock
 
static _udp_Socketudp_disc_sock
 
static _tcp_Sockettcp_echo_sock
 
static _tcp_Sockettcp_disc_sock
 
static BOOL do_echo = 0
 
static WORD echo_port = 7
 
static DWORD echo_host = 0
 
static BOOL do_disc = 0
 
static WORD disc_port = 9
 
static DWORD disc_host = 0
 

Detailed Description

A simple echo/discard daemon. Listens for traffic on udp/tcp ports 7 and 9.

Definition in file echo.c.

Function Documentation

static void echo_discard_daemon ( void  )
static

"background" process handling echo + discard TCP sockets.

Todo:
handle jumbo packets (IP-fragments)

Definition at line 181 of file echo.c.

References sock_dataready(), sock_read(), and sock_write().

static void echo_discard_exit ( void  )
static

Don't bother resetting any connections.

Just remove daemon and free allocated memory.

Definition at line 100 of file echo.c.

References echo_discard_daemon().

int main ( int  argc,
char **  argv 
)
Todo:
Make a echo client/server test program

Definition at line 223 of file echo.c.