linux-2.1.101-ftcp.tgz: Linux kernel 2.1.101 source distribution with freeze TCP support. To enable, select Freeze TCP support (CONFIG_FTCP) under Networking Options when compiling. ftcp.h: Include file needed for user access to the ftcp system call. The behavior is meant to imitate a function declared as: int ftcp(func, ftcp_t *fp); and really just calls the sys_ftcp() function shown below. Type ftcp_t is defined by: typedef struct { char *ifname; int val; } ftcp_t; where ifname is a pointer to the name of the network interface to use (eth0, ppp0, etc.). The result of the called function gets returned in val. The return value of the function itself just reflects success (0) or failure (-1). On failure the global variable errno can get set to the values below. EACCES user has insufficient privileges EINVAL for invalid function int sys_ftcp(int func, ftcp_t *fp); System call interface to the kernel functions below. The func parameter can take any of the values below and selects which kernel function gets called. FTCP_FREEZE_CHECK FTCP_FREEZE_OFF FTCP_FREEZE_ON FTCP_IF_CHECK FTCP_IF_DISABLE FTCP_IF_ENABLE FTCP_DUP_ACKS1 FTCP_DUP_ACKS3 Kernel functions: The kernel functions that implement freeze TCP are described below. All of them may return fp->val equal to -ENODEV if an invalid network interface is given. void ftcp_freeze_check(ftcp_t *fp); Check if an interface is frozen. Returns fp->val equal to 1 if so, 0 if not. void ftcp_freeze_on(ftcp_t *fp); Turn freeze TCP on for an interface. Returns fp->val equal to 1 if interface was previously frozen, 0 otherwise. void ftcp_freeze_off(ftcp_t *fp); Turn freeze TCP off for an interface. Returns fp->val equal to 1 if interface was previously frozen, 0 otherwise. void ftcp_if_check(ftcp_t *fp); Check if an interface is enabled. Returns fp->val equal to 1 if so, 0 if not. void ftcp_if_disable(ftcp_t *fp); Disable an interface (drop all IP packets going through the interface). Returns fp->val equal to 1 if interface was previously disabled, 0 otherwise. void ftcp_if_enable(ftcp_t *fp); Enable an interface (pass IP packets through the interface). Returns fp->val equal to 1 if interface was previously disabled, 0 otherwise. void ftcp_send_dup_acks(ftcp_t *fp, int num); Send num duplicate ACKs on all established TCP sockets. Returns fp->val equal to the number of sockets where duplicate ACKs were on. example.c: An example program using the freeze TCP system call. This simple program is meant to be run while TCP connections are active through network interface IFNAME defined on line 7 (eth0 by default). First freeze TCP is enabled for IFNAME, which should put TCP peers into persist mode. Then IFNAME is disabled so all packets going through it are dropped, simulating a network disconnection. After waiting a while freeze TCP is disabled for IFNAME, the interface is enabled, and three duplicate ACKs are sent to bring TCP peers out of persists mode.