tcp_output.c (125396) | tcp_output.c (125680) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)tcp_output.c 8.4 (Berkeley) 5/24/95 | 1/* 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)tcp_output.c 8.4 (Berkeley) 5/24/95 |
34 * $FreeBSD: head/sys/netinet/tcp_output.c 125396 2004-02-03 18:20:55Z ume $ | 34 * $FreeBSD: head/sys/netinet/tcp_output.c 125680 2004-02-11 04:26:04Z bms $ |
35 */ 36 | 35 */ 36 |
37#include "opt_inet.h" |
|
37#include "opt_inet6.h" 38#include "opt_ipsec.h" 39#include "opt_mac.h" 40#include "opt_tcpdebug.h" 41 42#include <sys/param.h> 43#include <sys/systm.h> 44#include <sys/domain.h> --- 65 unchanged lines hidden (view full) --- 110 * Tcp output routine: figure out what should be sent and send it. 111 */ 112int 113tcp_output(struct tcpcb *tp) 114{ 115 struct socket *so = tp->t_inpcb->inp_socket; 116 long len, recwin, sendwin; 117 int off, flags, error; | 38#include "opt_inet6.h" 39#include "opt_ipsec.h" 40#include "opt_mac.h" 41#include "opt_tcpdebug.h" 42 43#include <sys/param.h> 44#include <sys/systm.h> 45#include <sys/domain.h> --- 65 unchanged lines hidden (view full) --- 111 * Tcp output routine: figure out what should be sent and send it. 112 */ 113int 114tcp_output(struct tcpcb *tp) 115{ 116 struct socket *so = tp->t_inpcb->inp_socket; 117 long len, recwin, sendwin; 118 int off, flags, error; |
119 int sigoff = 0; |
|
118 struct mbuf *m; 119 struct ip *ip = NULL; 120 struct ipovly *ipov = NULL; 121 struct tcphdr *th; 122 u_char opt[TCP_MAXOLEN]; 123 unsigned ipoptlen, optlen, hdrlen; 124 int idle, sendalot; 125#if 0 --- 406 unchanged lines hidden (view full) --- 532 *(u_int32_t *)&opt[optlen] = 533 htonl(tp->cc_recv); 534 optlen += 4; 535 } 536 break; 537 } 538 } 539 | 120 struct mbuf *m; 121 struct ip *ip = NULL; 122 struct ipovly *ipov = NULL; 123 struct tcphdr *th; 124 u_char opt[TCP_MAXOLEN]; 125 unsigned ipoptlen, optlen, hdrlen; 126 int idle, sendalot; 127#if 0 --- 406 unchanged lines hidden (view full) --- 534 *(u_int32_t *)&opt[optlen] = 535 htonl(tp->cc_recv); 536 optlen += 4; 537 } 538 break; 539 } 540 } 541 |
542#ifdef TCP_SIGNATURE 543#ifdef INET6 544 if (!isipv6) 545#endif 546 if (tp->t_flags & TF_SIGNATURE) { 547 int i; 548 u_char *bp; 549 /* 550 * Initialize TCP-MD5 option (RFC2385) 551 */ 552 bp = (u_char *)opt + optlen; 553 *bp++ = TCPOPT_SIGNATURE; 554 *bp++ = TCPOLEN_SIGNATURE; 555 sigoff = optlen + 2; 556 for (i = 0; i < TCP_SIGLEN; i++) 557 *bp++ = 0; 558 optlen += TCPOLEN_SIGNATURE; 559 /* 560 * Terminate options list and maintain 32-bit alignment. 561 */ 562 *bp++ = TCPOPT_NOP; 563 *bp++ = TCPOPT_EOL; 564 optlen += 2; 565 } 566#endif /* TCP_SIGNATURE */ 567 |
|
540 hdrlen += optlen; 541 542#ifdef INET6 543 if (isipv6) 544 ipoptlen = ip6_optlen(tp->t_inpcb); 545 else 546#endif 547 if (tp->t_inpcb->inp_options) --- 201 unchanged lines hidden (view full) --- 749 /* 750 * If no urgent pointer to send, then we pull 751 * the urgent pointer to the left edge of the send window 752 * so that it doesn't drift into the send window on sequence 753 * number wraparound. 754 */ 755 tp->snd_up = tp->snd_una; /* drag it along */ 756 | 568 hdrlen += optlen; 569 570#ifdef INET6 571 if (isipv6) 572 ipoptlen = ip6_optlen(tp->t_inpcb); 573 else 574#endif 575 if (tp->t_inpcb->inp_options) --- 201 unchanged lines hidden (view full) --- 777 /* 778 * If no urgent pointer to send, then we pull 779 * the urgent pointer to the left edge of the send window 780 * so that it doesn't drift into the send window on sequence 781 * number wraparound. 782 */ 783 tp->snd_up = tp->snd_una; /* drag it along */ 784 |
785#ifdef TCP_SIGNATURE 786#ifdef INET6 787 if (!isipv6) 788#endif 789 if (tp->t_flags & TF_SIGNATURE) 790 tcpsignature_compute(m, sizeof(struct ip), len, optlen, 791 (u_char *)(th + 1) + sigoff, IPSEC_DIR_OUTBOUND); 792#endif /* TCP_SIGNATURE */ 793 |
|
757 /* 758 * Put TCP length in extended header, and then 759 * checksum extended header and data. 760 */ 761 m->m_pkthdr.len = hdrlen + len; /* in6_cksum() need this */ 762#ifdef INET6 763 if (isipv6) 764 /* --- 228 unchanged lines hidden --- | 794 /* 795 * Put TCP length in extended header, and then 796 * checksum extended header and data. 797 */ 798 m->m_pkthdr.len = hdrlen + len; /* in6_cksum() need this */ 799#ifdef INET6 800 if (isipv6) 801 /* --- 228 unchanged lines hidden --- |