# #include "util.h" #include "telnet.h" /* This module manages the tcp/user receive data interface which is special to application */ /* usr_reset connection being reset - shut down user world */ usr_reset(ptcb) struct tcb *ptcb; { scb.s_state = UCLOSED; } #ifndef TCPTEST /* usr_cfin Tcp has received FIN, if user is not in DRCV mode, invoke usr_fin. */ usr_cfin() { if (!(scb.s_state & DRCV)) usr_fin(); } /* usr_fin User has received all its data and its FIN from fhost. Now read as much as possible from its local buffers and then ask tcp to close (send FIN) after all data is sent */ usr_fin() { tel_snd(); scb.s_state &= ~DRCV; tcp_close(); } #endif