Tcpctl

Tcpctl

概要

実装

  192: /*
  193:  *  the qlock in the Conv locks this structure
  194:  */
  195: typedef struct Tcpctl Tcpctl;
  196: struct Tcpctl
  197: {
  198:         uchar  state;                   /* Connection state */
  199:         uchar  type;                    /* Listening or active connection */
  200:         uchar  code;                    /* Icmp code */
  201:         struct {
  202:                 ulong una;            /* Unacked data pointer */
  203:                 ulong nxt;            /* Next sequence expected */
  204:                 ulong ptr;            /* Data pointer */
  205:                 ulong wnd;            /* Tcp send window */
  206:                 ulong urg;            /* Urgent data pointer */
  207:                 ulong wl2;
  208:                 int   scale;            /* how much to right shift window in xmitted packets */
  209:                 /* to implement tahoe and reno TCP */
  210:                 ulong dupacks;        /* number of duplicate acks rcvd */
  211:                 int   recovery; /* loss recovery flag */
  212:                 ulong rxt;            /* right window marker for recovery */
  213:         } snd;
  214:         struct {
  215:                 ulong nxt;            /* Receive pointer to next uchar slot */
  216:                 ulong wnd;            /* Receive window incoming */
  217:                 ulong urg;            /* Urgent pointer */
  218:                 int   blocked;
  219:                 int   una;              /* unacked data segs */
  220:                 int   scale;            /* how much to left shift window in rcved packets */
  221:         } rcv;
  222:         ulong  iss;                     /* Initial sequence number */
  223:         int    sawwsopt;          /* true if we saw a wsopt on the incoming SYN */
  224:         ulong  cwind;                   /* Congestion window */
  225:         int    scale;                     /* desired snd.scale */
  226:         ushort ssthresh;               /* Slow start threshold */
  227:         int    resent;                    /* Bytes just resent */
  228:         int    irs;                       /* Initial received squence */
  229:         ushort mss;                    /* Mean segment size */
  230:         int    rerecv;                    /* Overlap of data rerecevived */
  231:         ulong  window;                  /* Recevive window */
  232:         uchar  backoff;         /* Exponential backoff counter */
  233:         int    backedoff;         /* ms we've backed off for rexmits */
  234:         uchar  flags;                   /* State flags */
  235:         Reseq  *reseq;                  /* Resequencing queue */
  236:         Tcptimer       timer;                        /* Activity timer */
  237:         Tcptimer       acktimer;             /* Acknowledge timer */
  238:         Tcptimer       rtt_timer;            /* Round trip timer */
  239:         Tcptimer       katimer;              /* keep alive timer */
  240:         ulong  rttseq;                  /* Round trip sequence */
  241:         int    srtt;                      /* Shortened round trip */
  242:         int    mdev;                      /* Mean deviation of round trip */
  243:         int    kacounter;         /* count down for keep alive */
  244:         uint   sndsyntime;               /* time syn sent */
  245:         ulong  time;                    /* time Finwait2 or Syn_received was sent */
  246:         int    nochecksum;                /* non-zero means don't send checksums */
  247:         int    flgcnt;                    /* number of flags in the sequence (FIN,SEQ) */
  248: 
  249:         union {
  250:                 Tcp4hdr       tcp4hdr;
  251:                 Tcp6hdr       tcp6hdr;
  252:         } protohdr;            /* prototype header */
  253: };