/* Get the tcplen (datalen + SYN/FIN) of a segment (by index) on the ooseq list */
static int tcp_oos_seg_tcplen(struct tcp_pcb *pcb, int seg_index)
/* Get the tcplen (datalen + SYN/FIN) of a segment (by index) on the ooseq list */
static int tcp_oos_seg_tcplen(struct tcp_pcb *pcb, int seg_index)
{
  int num = 0;
  struct tcp_seg* seg = pcb->ooseq;
  while(seg != NULL) {
    if(num == seg_index) {
      return TCP_TCPLEN(seg);
    }
    num++;
    seg = seg->next;
  }
  fail();
  return -1;
}