Prototypes.

This commit is contained in:
mycroft 1994-01-08 23:07:16 +00:00
parent 4fe12e6e88
commit e43117185e
7 changed files with 84 additions and 13 deletions

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tcp_debug.c 7.6 (Berkeley) 6/28/90
* $Id: tcp_debug.c,v 1.5 1994/01/08 21:21:57 mycroft Exp $
* $Id: tcp_debug.c,v 1.6 1994/01/08 23:07:16 mycroft Exp $
*/
#ifdef TCPDEBUG
@ -72,6 +72,7 @@ int tcpconsdebug = 0;
/*
* Tcp debug routines
*/
void
tcp_trace(act, ostate, tp, ti, req)
short act, ostate;
struct tcpcb *tp;

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tcp_input.c 7.25 (Berkeley) 6/30/90
* $Id: tcp_input.c,v 1.4 1994/01/08 21:21:58 mycroft Exp $
* $Id: tcp_input.c,v 1.5 1994/01/08 23:07:18 mycroft Exp $
*/
#include <sys/param.h>
@ -96,6 +96,7 @@ struct tcpcb *tcp_newtcpcb();
} \
}
int
tcp_reass(tp, ti, m)
register struct tcpcb *tp;
register struct tcpiphdr *ti;
@ -203,6 +204,7 @@ present:
* TCP input routine, follows pages 65-76 of the
* protocol specification dated September, 1981 very closely.
*/
void
tcp_input(m, iphlen)
register struct mbuf *m;
int iphlen;
@ -647,8 +649,15 @@ trimthenstep6:
todrop = ti->ti_len;
tiflags &= ~TH_FIN;
tp->t_flags |= TF_ACKNOW;
} else
goto dropafterack;
} else {
/*
* Handle the case when a bound socket connects
* to itself. Allow packets with a SYN and
* an ACK to continue with the processing.
*/
if (todrop != 0 || (tiflags & TH_ACK) == 0)
goto dropafterack;
}
} else {
tcpstat.tcps_rcvpartduppack++;
tcpstat.tcps_rcvpartdupbyte += todrop;
@ -1207,6 +1216,7 @@ drop:
return;
}
void
tcp_dooptions(tp, om, ti)
struct tcpcb *tp;
struct mbuf *om;
@ -1254,6 +1264,7 @@ tcp_dooptions(tp, om, ti)
* It is still reflected in the segment length for
* sequencing purposes.
*/
void
tcp_pulloutofband(so, ti, m)
struct socket *so;
struct tcpiphdr *ti;
@ -1284,6 +1295,7 @@ tcp_pulloutofband(so, ti, m)
* Collect new round-trip time estimate
* and update averages and current timeout.
*/
void
tcp_xmit_timer(tp)
register struct tcpcb *tp;
{
@ -1367,7 +1379,7 @@ tcp_xmit_timer(tp)
* While looking at the routing entry, we also initialize other path-dependent
* parameters from pre-set or cached values in the routing entry.
*/
int
tcp_mss(tp, offer)
register struct tcpcb *tp;
u_short offer;

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tcp_output.c 7.22 (Berkeley) 8/31/90
* $Id: tcp_output.c,v 1.5 1994/01/08 21:22:00 mycroft Exp $
* $Id: tcp_output.c,v 1.6 1994/01/08 23:07:20 mycroft Exp $
*/
#include <sys/param.h>
@ -71,6 +71,7 @@ u_char tcp_initopt[4] = { TCPOPT_MAXSEG, 4, 0x0, 0x0, };
/*
* Tcp output routine: figure out what should be sent and send it.
*/
int
tcp_output(tp)
register struct tcpcb *tp;
{
@ -460,7 +461,7 @@ send:
if (error) {
out:
if (error == ENOBUFS) {
tcp_quench(tp->t_inpcb);
tcp_quench(tp->t_inpcb, 0);
return (0);
}
if ((error == EHOSTUNREACH || error == ENETDOWN)
@ -486,6 +487,7 @@ out:
return (0);
}
void
tcp_setpersist(tp)
register struct tcpcb *tp;
{

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tcp_subr.c 7.20 (Berkeley) 12/1/90
* $Id: tcp_subr.c,v 1.6 1994/01/08 21:22:01 mycroft Exp $
* $Id: tcp_subr.c,v 1.7 1994/01/08 23:07:21 mycroft Exp $
*/
#include <sys/param.h>
@ -69,6 +69,7 @@ extern struct inpcb *tcp_last_inpcb;
/*
* Tcp initialization
*/
void
tcp_init()
{
@ -133,6 +134,7 @@ tcp_template(tp)
* In any case the ack and sequence number of the transmitted
* segment are as specified by the parameters.
*/
void
tcp_respond(tp, ti, m, ack, seq, flags)
struct tcpcb *tp;
register struct tcpiphdr *ti;
@ -359,6 +361,7 @@ tcp_close(tp)
return ((struct tcpcb *)0);
}
void
tcp_drain()
{
@ -369,6 +372,7 @@ tcp_drain()
* store error as soft error, but wake up user
* (for now, won't do anything until can select for soft error).
*/
void
tcp_notify(inp, error)
register struct inpcb *inp;
int error;
@ -380,6 +384,7 @@ tcp_notify(inp, error)
sowwakeup(inp->inp_socket);
}
void
tcp_ctlinput(cmd, sa, ip)
int cmd;
struct sockaddr *sa;
@ -388,7 +393,7 @@ tcp_ctlinput(cmd, sa, ip)
register struct tcphdr *th;
extern struct in_addr zeroin_addr;
extern u_char inetctlerrmap[];
int (*notify)() = tcp_notify, tcp_quench();
void (*notify) __P((struct inpcb *, int)) = tcp_notify;
if (cmd == PRC_QUENCH)
notify = tcp_quench;
@ -409,8 +414,10 @@ tcp_ctlinput(cmd, sa, ip)
* When a source quench is received, close congestion window
* to one segment. We will gradually open it again as we proceed.
*/
tcp_quench(inp)
void
tcp_quench(inp, errno)
struct inpcb *inp;
int errno;
{
struct tcpcb *tp = intotcpcb(inp);

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tcp_timer.c 7.18 (Berkeley) 6/28/90
* $Id: tcp_timer.c,v 1.5 1994/01/08 21:22:02 mycroft Exp $
* $Id: tcp_timer.c,v 1.6 1994/01/08 23:07:22 mycroft Exp $
*/
#include <sys/param.h>
@ -61,9 +61,11 @@
int tcp_keepidle = TCPTV_KEEP_IDLE;
int tcp_keepintvl = TCPTV_KEEPINTVL;
int tcp_maxidle;
/*
* Fast timeout routine for processing delayed acks
*/
void
tcp_fasttimo()
{
register struct inpcb *inp;
@ -88,6 +90,7 @@ tcp_fasttimo()
* Updates the timers in all active tcb's and
* causes finite state machine actions if timers expire.
*/
void
tcp_slowtimo()
{
register struct inpcb *ip, *ipnxt;
@ -135,6 +138,7 @@ tpgone:
/*
* Cancel all timers for TCP tp.
*/
void
tcp_canceltimers(tp)
struct tcpcb *tp;
{

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tcp_usrreq.c 7.15 (Berkeley) 6/28/90
* $Id: tcp_usrreq.c,v 1.5 1993/12/18 00:42:13 mycroft Exp $
* $Id: tcp_usrreq.c,v 1.6 1994/01/08 23:07:23 mycroft Exp $
*/
#include <sys/param.h>
@ -72,6 +72,7 @@ struct tcpcb *tcp_newtcpcb();
* (called from the software clock routine), then timertype tells which timer.
*/
/*ARGSUSED*/
int
tcp_usrreq(so, req, m, nam, control)
struct socket *so;
int req;
@ -337,6 +338,7 @@ tcp_usrreq(so, req, m, nam, control)
return (error);
}
int
tcp_ctloutput(op, so, level, optname, mp)
int op;
struct socket *so;
@ -403,6 +405,7 @@ u_long tcp_recvspace = 1024*8;
* internet protocol control block, tcp control block,
* bufer space, and entering LISTEN state if to accept connections.
*/
int
tcp_attach(so)
struct socket *so;
{

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tcp_var.h 7.10 (Berkeley) 6/28/90
* $Id: tcp_var.h,v 1.4 1994/01/08 21:22:04 mycroft Exp $
* $Id: tcp_var.h,v 1.5 1994/01/08 23:07:24 mycroft Exp $
*/
#ifndef _NETINET_TCP_VAR_H_
@ -219,6 +219,48 @@ struct tcpstat tcpstat; /* tcp statistics */
struct tcpiphdr *tcp_template();
struct tcpcb *tcp_close(), *tcp_drop();
struct tcpcb *tcp_timers(), *tcp_disconnect(), *tcp_usrclosed();
int tcp_attach __P((struct socket *));
void tcp_canceltimers __P((struct tcpcb *));
struct tcpcb *
tcp_close __P((struct tcpcb *));
void tcp_ctlinput __P((int, struct sockaddr *, struct ip *));
int tcp_ctloutput
__P((int, struct socket *, int, int, struct mbuf **));
struct tcpcb *
tcp_disconnect __P((struct tcpcb *));
void tcp_dooptions __P((struct tcpcb *, struct mbuf *, struct tcpiphdr *));
void tcp_drain __P((void));
struct tcpcb *
tcp_drop __P((struct tcpcb *, int));
void tcp_fasttimo __P((void));
void tcp_init __P((void));
void tcp_input __P((struct mbuf *, int));
int tcp_mss __P((struct tcpcb *, u_short));
struct tcpcb *
tcp_newtcpcb __P((struct inpcb *));
void tcp_notify __P((struct inpcb *, int));
int tcp_output __P((struct tcpcb *));
void tcp_pulloutofband
__P((struct socket *, struct tcpiphdr *, struct mbuf *));
void tcp_quench __P((struct inpcb *, int));
int tcp_reass __P((struct tcpcb *, struct tcpiphdr *, struct mbuf *));
void tcp_respond
__P((struct tcpcb *, struct tcpiphdr *, struct mbuf *, tcp_seq,
tcp_seq, int));
void tcp_setpersist __P((struct tcpcb *));
void tcp_slowtimo __P((void));
struct tcpiphdr *
tcp_template __P((struct tcpcb *));
struct tcpcb *
tcp_timers __P((struct tcpcb *, int));
void tcp_trace __P((short, short, struct tcpcb *, struct tcpiphdr *, int));
struct tcpcb *
tcp_usrclosed __P((struct tcpcb *));
int tcp_usrreq
__P((struct socket *, int, struct mbuf *, struct mbuf *,
struct mbuf *));
void tcp_xmit_timer __P((struct tcpcb *));
#endif
#endif /* !_NETINET_TCP_VAR_H_ */