tcp_dooptions(struct tcpcb *tp, u_char *cp, int cnt, struct tcpiphdr *ti)

{

	uint16_t mss;

	int opt, optlen;



	DEBUG_CALL("tcp_dooptions");

	DEBUG_ARGS((dfd," tp = %lx  cnt=%i \n", (long )tp, cnt));



	for (; cnt > 0; cnt -= optlen, cp += optlen) {

		opt = cp[0];

		if (opt == TCPOPT_EOL)

			break;

		if (opt == TCPOPT_NOP)

			optlen = 1;

		else {

			optlen = cp[1];

			if (optlen <= 0)

				break;

		}

		switch (opt) {



		default:

			continue;



		case TCPOPT_MAXSEG:

			if (optlen != TCPOLEN_MAXSEG)

				continue;

			if (!(ti->ti_flags & TH_SYN))

				continue;

			memcpy((char *) &mss, (char *) cp + 2, sizeof(mss));

			NTOHS(mss);

			(void) tcp_mss(tp, mss);	/* sets t_maxseg */

			break;

		}

	}

}

tcp_dooptions(struct tcpcb *tp, u_char *cp, int cnt, struct tcpiphdr *ti)

{

	uint16_t mss;

	int opt, optlen;



	DEBUG_CALL("tcp_dooptions");

	DEBUG_ARGS((dfd," tp = %lx  cnt=%i \n", (long )tp, cnt));



	for (; cnt > 0; cnt -= optlen, cp += optlen) {

		opt = cp[0];

		if (opt == TCPOPT_EOL)

			break;

		if (opt == TCPOPT_NOP)

			optlen = 1;

		else {

			optlen = cp[1];

			if (optlen <= 0)

				break;

		}

		switch (opt) {



		default:

			continue;



		case TCPOPT_MAXSEG:

			if (optlen != TCPOLEN_MAXSEG)

				continue;

			if (!(ti->ti_flags & TH_SYN))

				continue;

			memcpy((char *) &mss, (char *) cp + 2, sizeof(mss));

			NTOHS(mss);

			(void) tcp_mss(tp, mss);	

			break;

		}

	}

}

FUNC_0(struct tcpcb *VAR_0, u_char *VAR_1, int VAR_2, struct tcpiphdr *VAR_3)

{

	uint16_t mss;

	int VAR_4, VAR_5;



	DEBUG_CALL("FUNC_0");

	DEBUG_ARGS((dfd," VAR_0 = %lx  VAR_2=%i \n", (long )VAR_0, VAR_2));



	for (; VAR_2 > 0; VAR_2 -= VAR_5, VAR_1 += VAR_5) {

		VAR_4 = VAR_1[0];

		if (VAR_4 == TCPOPT_EOL)

			break;

		if (VAR_4 == TCPOPT_NOP)

			VAR_5 = 1;

		else {

			VAR_5 = VAR_1[1];

			if (VAR_5 <= 0)

				break;

		}

		switch (VAR_4) {



		default:

			continue;



		case TCPOPT_MAXSEG:

			if (VAR_5 != TCPOLEN_MAXSEG)

				continue;

			if (!(VAR_3->ti_flags & TH_SYN))

				continue;

			memcpy((char *) &mss, (char *) VAR_1 + 2, sizeof(mss));

			NTOHS(mss);

			(void) tcp_mss(VAR_0, mss);	

			break;

		}

	}

}

FUNC_0(struct tcpcb *VAR_0, u_char *VAR_1, int VAR_2, struct tcpiphdr *VAR_3)
{ uint16_t mss; int VAR_4, VAR_5; DEBUG_CALL("FUNC_0"); DEBUG_ARGS((dfd," VAR_0 = %lx  VAR_2=%i \n", (long )VAR_0, VAR_2)); for (; VAR_2 > 0; VAR_2 -= VAR_5, VAR_1 += VAR_5) { VAR_4 = VAR_1[0]; if (VAR_4 == TCPOPT_EOL)
break; if (VAR_4 == TCPOPT_NOP)
VAR_5 = 1; else { VAR_5 = VAR_1[1]; if (VAR_5 <= 0)
break; } switch (VAR_4) { default:
continue; case TCPOPT_MAXSEG:
if (VAR_5 != TCPOLEN_MAXSEG)
continue; if (!(VAR_3->ti_flags & TH_SYN))
continue; memcpy((char *) &mss, (char *) VAR_1 + 2, sizeof(mss)); NTOHS(mss); (void) tcp_mss(VAR_0, mss); break; } } }