Code for TCP/IP program to do option subnegotiation FSM transitions in Networking
#include <sys/types.h>
#include <stdio.h>
#include "telnet.h"
#include "tnfsm.h"externstruct fsm_trans substab[];
externint substate;
extern u_char subfsm[][NCHRS];
int
subopt(FILE *sfp, FILE *tfp, int c)
{
struct fsm_trans *pt;
int ti;
ti = subfsm[substate][c];
pt = &substab[ti];
(pt->ft_action)(sfp, tfp, c);
substate = pt->ft_next;
return 0;
}