ANSIfy function declarations and remove register keywords for variables.

Consistently apply style to all function declarations.
This commit is contained in:
andre 2007-03-21 19:37:55 +00:00
parent 844ebe3715
commit 8aefbb6179
8 changed files with 73 additions and 146 deletions

View File

@ -236,11 +236,7 @@ tcp_reass_init()
} }
static int static int
tcp_reass(tp, th, tlenp, m) tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tlenp, struct mbuf *m)
register struct tcpcb *tp;
register struct tcphdr *th;
int *tlenp;
struct mbuf *m;
{ {
struct tseg_qent *q; struct tseg_qent *q;
struct tseg_qent *p = NULL; struct tseg_qent *p = NULL;
@ -310,7 +306,7 @@ tcp_reass(tp, th, tlenp, m)
* segment. If it provides all of our data, drop us. * segment. If it provides all of our data, drop us.
*/ */
if (p != NULL) { if (p != NULL) {
register int i; int i;
/* conversion to int (in i) handles seq wraparound */ /* conversion to int (in i) handles seq wraparound */
i = p->tqe_th->th_seq + p->tqe_len - th->th_seq; i = p->tqe_th->th_seq + p->tqe_len - th->th_seq;
if (i > 0) { if (i > 0) {
@ -342,7 +338,7 @@ tcp_reass(tp, th, tlenp, m)
* if they are completely covered, dequeue them. * if they are completely covered, dequeue them.
*/ */
while (q) { while (q) {
register int i = (th->th_seq + *tlenp) - q->tqe_th->th_seq; int i = (th->th_seq + *tlenp) - q->tqe_th->th_seq;
if (i <= 0) if (i <= 0)
break; break;
if (i < q->tqe_len) { if (i < q->tqe_len) {
@ -408,11 +404,9 @@ present:
*/ */
#ifdef INET6 #ifdef INET6
int int
tcp6_input(mp, offp, proto) tcp6_input(struct mbuf **mp, int *offp, int proto)
struct mbuf **mp;
int *offp, proto;
{ {
register struct mbuf *m = *mp; struct mbuf *m = *mp;
struct in6_ifaddr *ia6; struct in6_ifaddr *ia6;
IP6_EXTHDR_CHECK(m, *offp, sizeof(struct tcphdr), IPPROTO_DONE); IP6_EXTHDR_CHECK(m, *offp, sizeof(struct tcphdr), IPPROTO_DONE);
@ -437,20 +431,18 @@ tcp6_input(mp, offp, proto)
#endif #endif
void void
tcp_input(m, off0) tcp_input(struct mbuf *m, int off0)
register struct mbuf *m;
int off0;
{ {
register struct tcphdr *th; struct tcphdr *th;
register struct ip *ip = NULL; struct ip *ip = NULL;
register struct ipovly *ipov; struct ipovly *ipov;
register struct inpcb *inp = NULL; struct inpcb *inp = NULL;
u_char *optp = NULL; u_char *optp = NULL;
int optlen = 0; int optlen = 0;
int len, tlen, off; int len, tlen, off;
int drop_hdrlen; int drop_hdrlen;
register struct tcpcb *tp = 0; struct tcpcb *tp = 0;
register int thflags; int thflags;
struct socket *so = 0; struct socket *so = 0;
int todrop, acked, ourfinisacked, needoutput = 0; int todrop, acked, ourfinisacked, needoutput = 0;
u_long tiwin; u_long tiwin;
@ -2137,8 +2129,8 @@ process_ACK:
*/ */
if ((!tcp_do_newreno && !tp->sack_enable) || if ((!tcp_do_newreno && !tp->sack_enable) ||
!IN_FASTRECOVERY(tp)) { !IN_FASTRECOVERY(tp)) {
register u_int cw = tp->snd_cwnd; u_int cw = tp->snd_cwnd;
register u_int incr = tp->t_maxseg; u_int incr = tp->t_maxseg;
if (cw > tp->snd_ssthresh) if (cw > tp->snd_ssthresh)
incr = incr * incr / cw; incr = incr * incr / cw;
tp->snd_cwnd = min(cw+incr, TCP_MAXWIN<<tp->snd_scale); tp->snd_cwnd = min(cw+incr, TCP_MAXWIN<<tp->snd_scale);
@ -2597,11 +2589,7 @@ drop:
* Parse TCP options and place in tcpopt. * Parse TCP options and place in tcpopt.
*/ */
static void static void
tcp_dooptions(to, cp, cnt, flags) tcp_dooptions(struct tcpopt *to, u_char *cp, int cnt, int flags)
struct tcpopt *to;
u_char *cp;
int cnt;
int flags;
{ {
int opt, optlen; int opt, optlen;
@ -2691,11 +2679,8 @@ tcp_dooptions(to, cp, cnt, flags)
* sequencing purposes. * sequencing purposes.
*/ */
static void static void
tcp_pulloutofband(so, th, m, off) tcp_pulloutofband(struct socket *so, struct tcphdr *th, struct mbuf *m,
struct socket *so; int off)
struct tcphdr *th;
register struct mbuf *m;
int off; /* delayed to be droped hdrlen */
{ {
int cnt = off + th->th_urp - 1; int cnt = off + th->th_urp - 1;
@ -2725,11 +2710,9 @@ tcp_pulloutofband(so, th, m, off)
* and update averages and current timeout. * and update averages and current timeout.
*/ */
static void static void
tcp_xmit_timer(tp, rtt) tcp_xmit_timer(struct tcpcb *tp, int rtt)
register struct tcpcb *tp;
int rtt;
{ {
register int delta; int delta;
INP_LOCK_ASSERT(tp->t_inpcb); INP_LOCK_ASSERT(tp->t_inpcb);
@ -2833,9 +2816,7 @@ tcp_xmit_timer(tp, rtt)
* segment. Outgoing SYN/ACK MSS settings are handled in tcp_mssopt(). * segment. Outgoing SYN/ACK MSS settings are handled in tcp_mssopt().
*/ */
void void
tcp_mss(tp, offer) tcp_mss(struct tcpcb *tp, int offer)
struct tcpcb *tp;
int offer;
{ {
int rtt, mss; int rtt, mss;
u_long bufsize; u_long bufsize;
@ -3079,8 +3060,7 @@ tcp_mss(tp, offer)
* Determine the MSS option to send on an outgoing SYN. * Determine the MSS option to send on an outgoing SYN.
*/ */
int int
tcp_mssopt(inc) tcp_mssopt(struct in_conninfo *inc)
struct in_conninfo *inc;
{ {
int mss = 0; int mss = 0;
u_long maxmtu = 0; u_long maxmtu = 0;
@ -3122,9 +3102,7 @@ tcp_mssopt(inc)
* be started again. * be started again.
*/ */
static void static void
tcp_newreno_partial_ack(tp, th) tcp_newreno_partial_ack(struct tcpcb *tp, struct tcphdr *th)
struct tcpcb *tp;
struct tcphdr *th;
{ {
tcp_seq onxt = tp->snd_nxt; tcp_seq onxt = tp->snd_nxt;
u_long ocwnd = tp->snd_cwnd; u_long ocwnd = tp->snd_cwnd;
@ -3158,12 +3136,8 @@ tcp_newreno_partial_ack(tp, th)
* looking for a pcb in the listen state. Returns 0 otherwise. * looking for a pcb in the listen state. Returns 0 otherwise.
*/ */
static int static int
tcp_timewait(inp, to, th, m, tlen) tcp_timewait(struct inpcb *inp, struct tcpopt *to, struct tcphdr *th,
struct inpcb *inp; struct mbuf *m, int tlen)
struct tcpopt *to;
struct tcphdr *th;
struct mbuf *m;
int tlen;
{ {
struct tcptw *tw; struct tcptw *tw;
int thflags; int thflags;

View File

@ -1226,8 +1226,7 @@ out:
} }
void void
tcp_setpersist(tp) tcp_setpersist(struct tcpcb *tp)
register struct tcpcb *tp;
{ {
int t = ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1; int t = ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1;
int tt; int tt;

View File

@ -236,11 +236,7 @@ tcp_reass_init()
} }
static int static int
tcp_reass(tp, th, tlenp, m) tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tlenp, struct mbuf *m)
register struct tcpcb *tp;
register struct tcphdr *th;
int *tlenp;
struct mbuf *m;
{ {
struct tseg_qent *q; struct tseg_qent *q;
struct tseg_qent *p = NULL; struct tseg_qent *p = NULL;
@ -310,7 +306,7 @@ tcp_reass(tp, th, tlenp, m)
* segment. If it provides all of our data, drop us. * segment. If it provides all of our data, drop us.
*/ */
if (p != NULL) { if (p != NULL) {
register int i; int i;
/* conversion to int (in i) handles seq wraparound */ /* conversion to int (in i) handles seq wraparound */
i = p->tqe_th->th_seq + p->tqe_len - th->th_seq; i = p->tqe_th->th_seq + p->tqe_len - th->th_seq;
if (i > 0) { if (i > 0) {
@ -342,7 +338,7 @@ tcp_reass(tp, th, tlenp, m)
* if they are completely covered, dequeue them. * if they are completely covered, dequeue them.
*/ */
while (q) { while (q) {
register int i = (th->th_seq + *tlenp) - q->tqe_th->th_seq; int i = (th->th_seq + *tlenp) - q->tqe_th->th_seq;
if (i <= 0) if (i <= 0)
break; break;
if (i < q->tqe_len) { if (i < q->tqe_len) {
@ -408,11 +404,9 @@ present:
*/ */
#ifdef INET6 #ifdef INET6
int int
tcp6_input(mp, offp, proto) tcp6_input(struct mbuf **mp, int *offp, int proto)
struct mbuf **mp;
int *offp, proto;
{ {
register struct mbuf *m = *mp; struct mbuf *m = *mp;
struct in6_ifaddr *ia6; struct in6_ifaddr *ia6;
IP6_EXTHDR_CHECK(m, *offp, sizeof(struct tcphdr), IPPROTO_DONE); IP6_EXTHDR_CHECK(m, *offp, sizeof(struct tcphdr), IPPROTO_DONE);
@ -437,20 +431,18 @@ tcp6_input(mp, offp, proto)
#endif #endif
void void
tcp_input(m, off0) tcp_input(struct mbuf *m, int off0)
register struct mbuf *m;
int off0;
{ {
register struct tcphdr *th; struct tcphdr *th;
register struct ip *ip = NULL; struct ip *ip = NULL;
register struct ipovly *ipov; struct ipovly *ipov;
register struct inpcb *inp = NULL; struct inpcb *inp = NULL;
u_char *optp = NULL; u_char *optp = NULL;
int optlen = 0; int optlen = 0;
int len, tlen, off; int len, tlen, off;
int drop_hdrlen; int drop_hdrlen;
register struct tcpcb *tp = 0; struct tcpcb *tp = 0;
register int thflags; int thflags;
struct socket *so = 0; struct socket *so = 0;
int todrop, acked, ourfinisacked, needoutput = 0; int todrop, acked, ourfinisacked, needoutput = 0;
u_long tiwin; u_long tiwin;
@ -2137,8 +2129,8 @@ process_ACK:
*/ */
if ((!tcp_do_newreno && !tp->sack_enable) || if ((!tcp_do_newreno && !tp->sack_enable) ||
!IN_FASTRECOVERY(tp)) { !IN_FASTRECOVERY(tp)) {
register u_int cw = tp->snd_cwnd; u_int cw = tp->snd_cwnd;
register u_int incr = tp->t_maxseg; u_int incr = tp->t_maxseg;
if (cw > tp->snd_ssthresh) if (cw > tp->snd_ssthresh)
incr = incr * incr / cw; incr = incr * incr / cw;
tp->snd_cwnd = min(cw+incr, TCP_MAXWIN<<tp->snd_scale); tp->snd_cwnd = min(cw+incr, TCP_MAXWIN<<tp->snd_scale);
@ -2597,11 +2589,7 @@ drop:
* Parse TCP options and place in tcpopt. * Parse TCP options and place in tcpopt.
*/ */
static void static void
tcp_dooptions(to, cp, cnt, flags) tcp_dooptions(struct tcpopt *to, u_char *cp, int cnt, int flags)
struct tcpopt *to;
u_char *cp;
int cnt;
int flags;
{ {
int opt, optlen; int opt, optlen;
@ -2691,11 +2679,8 @@ tcp_dooptions(to, cp, cnt, flags)
* sequencing purposes. * sequencing purposes.
*/ */
static void static void
tcp_pulloutofband(so, th, m, off) tcp_pulloutofband(struct socket *so, struct tcphdr *th, struct mbuf *m,
struct socket *so; int off)
struct tcphdr *th;
register struct mbuf *m;
int off; /* delayed to be droped hdrlen */
{ {
int cnt = off + th->th_urp - 1; int cnt = off + th->th_urp - 1;
@ -2725,11 +2710,9 @@ tcp_pulloutofband(so, th, m, off)
* and update averages and current timeout. * and update averages and current timeout.
*/ */
static void static void
tcp_xmit_timer(tp, rtt) tcp_xmit_timer(struct tcpcb *tp, int rtt)
register struct tcpcb *tp;
int rtt;
{ {
register int delta; int delta;
INP_LOCK_ASSERT(tp->t_inpcb); INP_LOCK_ASSERT(tp->t_inpcb);
@ -2833,9 +2816,7 @@ tcp_xmit_timer(tp, rtt)
* segment. Outgoing SYN/ACK MSS settings are handled in tcp_mssopt(). * segment. Outgoing SYN/ACK MSS settings are handled in tcp_mssopt().
*/ */
void void
tcp_mss(tp, offer) tcp_mss(struct tcpcb *tp, int offer)
struct tcpcb *tp;
int offer;
{ {
int rtt, mss; int rtt, mss;
u_long bufsize; u_long bufsize;
@ -3079,8 +3060,7 @@ tcp_mss(tp, offer)
* Determine the MSS option to send on an outgoing SYN. * Determine the MSS option to send on an outgoing SYN.
*/ */
int int
tcp_mssopt(inc) tcp_mssopt(struct in_conninfo *inc)
struct in_conninfo *inc;
{ {
int mss = 0; int mss = 0;
u_long maxmtu = 0; u_long maxmtu = 0;
@ -3122,9 +3102,7 @@ tcp_mssopt(inc)
* be started again. * be started again.
*/ */
static void static void
tcp_newreno_partial_ack(tp, th) tcp_newreno_partial_ack(struct tcpcb *tp, struct tcphdr *th)
struct tcpcb *tp;
struct tcphdr *th;
{ {
tcp_seq onxt = tp->snd_nxt; tcp_seq onxt = tp->snd_nxt;
u_long ocwnd = tp->snd_cwnd; u_long ocwnd = tp->snd_cwnd;
@ -3158,12 +3136,8 @@ tcp_newreno_partial_ack(tp, th)
* looking for a pcb in the listen state. Returns 0 otherwise. * looking for a pcb in the listen state. Returns 0 otherwise.
*/ */
static int static int
tcp_timewait(inp, to, th, m, tlen) tcp_timewait(struct inpcb *inp, struct tcpopt *to, struct tcphdr *th,
struct inpcb *inp; struct mbuf *m, int tlen)
struct tcpopt *to;
struct tcphdr *th;
struct mbuf *m;
int tlen;
{ {
struct tcptw *tw; struct tcptw *tw;
int thflags; int thflags;

View File

@ -319,7 +319,7 @@ tcp_sackhole_free(struct tcpcb *tp, struct sackhole *hole)
*/ */
static struct sackhole * static struct sackhole *
tcp_sackhole_insert(struct tcpcb *tp, tcp_seq start, tcp_seq end, tcp_sackhole_insert(struct tcpcb *tp, tcp_seq start, tcp_seq end,
struct sackhole *after) struct sackhole *after)
{ {
struct sackhole *hole; struct sackhole *hole;
@ -582,9 +582,7 @@ tcp_free_sackholes(struct tcpcb *tp)
* of sack recovery. * of sack recovery.
*/ */
void void
tcp_sack_partialack(tp, th) tcp_sack_partialack(struct tcpcb *tp, struct tcphdr *th)
struct tcpcb *tp;
struct tcphdr *th;
{ {
int num_segs = 1; int num_segs = 1;

View File

@ -466,10 +466,10 @@ tcpip_maketemplate(struct inpcb *inp)
* NOTE: If m != NULL, then ti must point to *inside* the mbuf. * NOTE: If m != NULL, then ti must point to *inside* the mbuf.
*/ */
void void
tcp_respond(struct tcpcb *tp, void *ipgen, register struct tcphdr *th, tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th,
register struct mbuf *m, tcp_seq ack, tcp_seq seq, int flags) struct mbuf *m, tcp_seq ack, tcp_seq seq, int flags)
{ {
register int tlen; int tlen;
int win = 0; int win = 0;
struct ip *ip; struct ip *ip;
struct tcphdr *nth; struct tcphdr *nth;
@ -1058,7 +1058,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
} }
SYSCTL_PROC(_net_inet_tcp, TCPCTL_PCBLIST, pcblist, CTLFLAG_RD, 0, 0, SYSCTL_PROC(_net_inet_tcp, TCPCTL_PCBLIST, pcblist, CTLFLAG_RD, 0, 0,
tcp_pcblist, "S,xtcpcb", "List of active TCP connections"); tcp_pcblist, "S,xtcpcb", "List of active TCP connections");
static int static int
tcp_getcred(SYSCTL_HANDLER_ARGS) tcp_getcred(SYSCTL_HANDLER_ARGS)

View File

@ -146,8 +146,7 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, timer_race, CTLFLAG_RD, &tcp_timer_race,
*/ */
void void
tcp_timer_delack(xtp) tcp_timer_delack(void *xtp)
void *xtp;
{ {
struct tcpcb *tp = xtp; struct tcpcb *tp = xtp;
struct inpcb *inp; struct inpcb *inp;
@ -182,8 +181,7 @@ tcp_timer_delack(xtp)
} }
void void
tcp_timer_2msl(xtp) tcp_timer_2msl(void *xtp)
void *xtp;
{ {
struct tcpcb *tp = xtp; struct tcpcb *tp = xtp;
struct inpcb *inp; struct inpcb *inp;
@ -306,8 +304,7 @@ tcp_timer_2msl_tw(int reuse)
} }
void void
tcp_timer_keep(xtp) tcp_timer_keep(void *xtp)
void *xtp;
{ {
struct tcpcb *tp = xtp; struct tcpcb *tp = xtp;
struct tcptemp *t_template; struct tcptemp *t_template;
@ -398,8 +395,7 @@ dropit:
} }
void void
tcp_timer_persist(xtp) tcp_timer_persist(void *xtp)
void *xtp;
{ {
struct tcpcb *tp = xtp; struct tcpcb *tp = xtp;
struct inpcb *inp; struct inpcb *inp;
@ -465,8 +461,7 @@ out:
} }
void void
tcp_timer_rexmt(xtp) tcp_timer_rexmt(void * xtp)
void *xtp;
{ {
struct tcpcb *tp = xtp; struct tcpcb *tp = xtp;
int rexmt; int rexmt;

View File

@ -466,10 +466,10 @@ tcpip_maketemplate(struct inpcb *inp)
* NOTE: If m != NULL, then ti must point to *inside* the mbuf. * NOTE: If m != NULL, then ti must point to *inside* the mbuf.
*/ */
void void
tcp_respond(struct tcpcb *tp, void *ipgen, register struct tcphdr *th, tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th,
register struct mbuf *m, tcp_seq ack, tcp_seq seq, int flags) struct mbuf *m, tcp_seq ack, tcp_seq seq, int flags)
{ {
register int tlen; int tlen;
int win = 0; int win = 0;
struct ip *ip; struct ip *ip;
struct tcphdr *nth; struct tcphdr *nth;
@ -1058,7 +1058,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
} }
SYSCTL_PROC(_net_inet_tcp, TCPCTL_PCBLIST, pcblist, CTLFLAG_RD, 0, 0, SYSCTL_PROC(_net_inet_tcp, TCPCTL_PCBLIST, pcblist, CTLFLAG_RD, 0, 0,
tcp_pcblist, "S,xtcpcb", "List of active TCP connections"); tcp_pcblist, "S,xtcpcb", "List of active TCP connections");
static int static int
tcp_getcred(SYSCTL_HANDLER_ARGS) tcp_getcred(SYSCTL_HANDLER_ARGS)

View File

@ -777,7 +777,7 @@ out:
*/ */
static int static int
tcp_usr_send(struct socket *so, int flags, struct mbuf *m, tcp_usr_send(struct socket *so, int flags, struct mbuf *m,
struct sockaddr *nam, struct mbuf *control, struct thread *td) struct sockaddr *nam, struct mbuf *control, struct thread *td)
{ {
int error = 0; int error = 0;
struct inpcb *inp; struct inpcb *inp;
@ -1100,10 +1100,7 @@ struct pr_usrreqs tcp6_usrreqs = {
* Initialize connection parameters and enter SYN-SENT state. * Initialize connection parameters and enter SYN-SENT state.
*/ */
static int static int
tcp_connect(tp, nam, td) tcp_connect(struct tcpcb *tp, struct sockaddr *nam, struct thread *td)
register struct tcpcb *tp;
struct sockaddr *nam;
struct thread *td;
{ {
struct inpcb *inp = tp->t_inpcb, *oinp; struct inpcb *inp = tp->t_inpcb, *oinp;
struct socket *so = inp->inp_socket; struct socket *so = inp->inp_socket;
@ -1159,10 +1156,7 @@ tcp_connect(tp, nam, td)
#ifdef INET6 #ifdef INET6
static int static int
tcp6_connect(tp, nam, td) tcp6_connect(struct tcpcb *tp, struct sockaddr *nam, struct thread *td)
register struct tcpcb *tp;
struct sockaddr *nam;
struct thread *td;
{ {
struct inpcb *inp = tp->t_inpcb, *oinp; struct inpcb *inp = tp->t_inpcb, *oinp;
struct socket *so = inp->inp_socket; struct socket *so = inp->inp_socket;
@ -1232,9 +1226,7 @@ tcp6_connect(tp, nam, td)
* from Linux. * from Linux.
*/ */
static void static void
tcp_fill_info(tp, ti) tcp_fill_info(struct tcpcb *tp, struct tcp_info *ti)
struct tcpcb *tp;
struct tcp_info *ti;
{ {
INP_LOCK_ASSERT(tp->t_inpcb); INP_LOCK_ASSERT(tp->t_inpcb);
@ -1276,9 +1268,7 @@ tcp_fill_info(tp, ti)
* the inpcb lock. * the inpcb lock.
*/ */
int int
tcp_ctloutput(so, sopt) tcp_ctloutput(struct socket *so, struct sockopt *sopt)
struct socket *so;
struct sockopt *sopt;
{ {
int error, opt, optval; int error, opt, optval;
struct inpcb *inp; struct inpcb *inp;
@ -1440,10 +1430,9 @@ SYSCTL_ULONG(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace, CTLFLAG_RW,
* bufer space, and entering LISTEN state if to accept connections. * bufer space, and entering LISTEN state if to accept connections.
*/ */
static int static int
tcp_attach(so) tcp_attach(struct socket *so)
struct socket *so;
{ {
register struct tcpcb *tp; struct tcpcb *tp;
struct inpcb *inp; struct inpcb *inp;
int error; int error;
#ifdef INET6 #ifdef INET6
@ -1503,8 +1492,7 @@ tcp_attach(so)
* send segment to peer (with FIN). * send segment to peer (with FIN).
*/ */
static void static void
tcp_disconnect(tp) tcp_disconnect(struct tcpcb *tp)
register struct tcpcb *tp;
{ {
struct inpcb *inp = tp->t_inpcb; struct inpcb *inp = tp->t_inpcb;
struct socket *so = inp->inp_socket; struct socket *so = inp->inp_socket;
@ -1544,8 +1532,7 @@ tcp_disconnect(tp)
* We can let the user exit from the close as soon as the FIN is acked. * We can let the user exit from the close as soon as the FIN is acked.
*/ */
static void static void
tcp_usrclosed(tp) tcp_usrclosed(struct tcpcb *tp)
register struct tcpcb *tp;
{ {
INP_INFO_WLOCK_ASSERT(&tcbinfo); INP_INFO_WLOCK_ASSERT(&tcbinfo);