Use const and static as needed, disable unused code

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3452 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
blueswir1 2007-10-26 19:01:16 +00:00
parent 31a60e2275
commit 9634d9031c
28 changed files with 163 additions and 221 deletions

View file

@ -36,17 +36,14 @@
#include <slirp.h>
int tcp_keepidle = TCPTV_KEEP_IDLE;
int tcp_keepintvl = TCPTV_KEEPINTVL;
int tcp_maxidle;
int so_options = DO_KEEPALIVE;
#ifdef LOG_ENABLED
struct tcpstat tcpstat; /* tcp statistics */
#endif
u_int32_t tcp_now; /* for RFC 1323 timestamps */
static struct tcpcb *tcp_timers(register struct tcpcb *tp, int timer);
/*
* Fast timeout routine for processing delayed acks
*/
@ -84,7 +81,6 @@ tcp_slowtimo()
DEBUG_CALL("tcp_slowtimo");
tcp_maxidle = TCPTV_KEEPCNT * tcp_keepintvl;
/*
* Search through tcb's and update active timers.
*/
@ -130,16 +126,14 @@ tcp_canceltimers(tp)
tp->t_timer[i] = 0;
}
int tcp_backoff[TCP_MAXRXTSHIFT + 1] =
const int tcp_backoff[TCP_MAXRXTSHIFT + 1] =
{ 1, 2, 4, 8, 16, 32, 64, 64, 64, 64, 64, 64, 64 };
/*
* TCP timer processing.
*/
struct tcpcb *
tcp_timers(tp, timer)
register struct tcpcb *tp;
int timer;
static struct tcpcb *
tcp_timers(register struct tcpcb *tp, int timer)
{
register int rexmt;
@ -155,8 +149,8 @@ tcp_timers(tp, timer)
*/
case TCPT_2MSL:
if (tp->t_state != TCPS_TIME_WAIT &&
tp->t_idle <= tcp_maxidle)
tp->t_timer[TCPT_2MSL] = tcp_keepintvl;
tp->t_idle <= TCP_MAXIDLE)
tp->t_timer[TCPT_2MSL] = TCPTV_KEEPINTVL;
else
tp = tcp_close(tp);
break;
@ -287,8 +281,8 @@ tcp_timers(tp, timer)
goto dropit;
/* if (tp->t_socket->so_options & SO_KEEPALIVE && */
if ((so_options) && tp->t_state <= TCPS_CLOSE_WAIT) {
if (tp->t_idle >= tcp_keepidle + tcp_maxidle)
if ((SO_OPTIONS) && tp->t_state <= TCPS_CLOSE_WAIT) {
if (tp->t_idle >= TCPTV_KEEP_IDLE + TCP_MAXIDLE)
goto dropit;
/*
* Send a packet designed to force a response
@ -314,9 +308,9 @@ tcp_timers(tp, timer)
tcp_respond(tp, &tp->t_template, (struct mbuf *)NULL,
tp->rcv_nxt, tp->snd_una - 1, 0);
#endif
tp->t_timer[TCPT_KEEP] = tcp_keepintvl;
tp->t_timer[TCPT_KEEP] = TCPTV_KEEPINTVL;
} else
tp->t_timer[TCPT_KEEP] = tcp_keepidle;
tp->t_timer[TCPT_KEEP] = TCPTV_KEEP_IDLE;
break;
dropit: