-t_open(tp, mode) /* set up a tcb for a connection */
- register struct tcb *tp;
- int mode;
-{
- register struct ucb *up;
-COUNT(T_OPEN);
-
- /* enqueue the tcb */
-
- if (netcb.n_tcb_head == NULL) {
- netcb.n_tcb_head = tp;
- netcb.n_tcb_tail = tp;
- } else {
- tp->t_tcb_next = netcb.n_tcb_head;
- netcb.n_tcb_head->t_tcb_prev = tp;
- netcb.n_tcb_head = tp;
- }
-
- /* initialize non-zero tcb fields */
-
- tp->t_rcv_next = (struct th *)tp;
- tp->t_rcv_prev = (struct th *)tp;
- tp->t_xmtime = T_REXMT;
- tp->snd_end = tp->seq_fin = tp->snd_nxt = tp->snd_hi =
- tp->snd_una = tp->iss = netcb.n_iss;
- tp->snd_off = tp->iss + 1;
- netcb.n_iss += (ISSINCR >> 1) + 1;
-
- /* set timeout for open */
-
- up = tp->t_ucb;
- tp->t_init = (up->uc_timeo != 0 ? up->uc_timeo :
- (mode == ACTIVE ? T_INIT : 0));
- up->uc_timeo = 0; /* overlays uc_ssize */
-}
-
-t_close(tp, state)
- register struct tcb *tp;
- short state;
+int tcp_sendspace = 1024*2;
+int tcp_recvspace = 1024*2;
+/*
+ * Attach TCP protocol to socket, allocating
+ * internet protocol control block, tcp control block,
+ * bufer space, and entering LISTEN state if to accept connections.
+ */
+tcp_attach(so)
+ struct socket *so;