sctputil.h (163953) | sctputil.h (163996) |
---|---|
1/*- 2 * Copyright (c) 2001-2006, Cisco Systems, Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are met: 6 * 7 * a) Redistributions of source code must retain the above copyright notice, 8 * this list of conditions and the following disclaimer. --- 18 unchanged lines hidden (view full) --- 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 * THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31 32/* $KAME: sctputil.h,v 1.15 2005/03/06 16:04:19 itojun Exp $ */ 33 34#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001-2006, Cisco Systems, Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are met: 6 * 7 * a) Redistributions of source code must retain the above copyright notice, 8 * this list of conditions and the following disclaimer. --- 18 unchanged lines hidden (view full) --- 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 * THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31 32/* $KAME: sctputil.h,v 1.15 2005/03/06 16:04:19 itojun Exp $ */ 33 34#include <sys/cdefs.h> |
35__FBSDID("$FreeBSD: head/sys/netinet/sctputil.h 163953 2006-11-03 15:23:16Z rrs $"); | 35__FBSDID("$FreeBSD: head/sys/netinet/sctputil.h 163996 2006-11-05 13:25:18Z rrs $"); |
36#ifndef __sctputil_h__ 37#define __sctputil_h__ 38 39 40 41#if defined(_KERNEL) 42 43#ifdef SCTP_MBUF_LOGGING --- 149 unchanged lines hidden (view full) --- 193void 194sctp_free_bufspace(struct sctp_tcb *, struct sctp_association *, 195 struct sctp_tmit_chunk *); 196 197#else 198#define sctp_free_bufspace(stcb, asoc, tp1, chk_cnt) \ 199do { \ 200 if (tp1->data != NULL) { \ | 36#ifndef __sctputil_h__ 37#define __sctputil_h__ 38 39 40 41#if defined(_KERNEL) 42 43#ifdef SCTP_MBUF_LOGGING --- 149 unchanged lines hidden (view full) --- 193void 194sctp_free_bufspace(struct sctp_tcb *, struct sctp_association *, 195 struct sctp_tmit_chunk *); 196 197#else 198#define sctp_free_bufspace(stcb, asoc, tp1, chk_cnt) \ 199do { \ 200 if (tp1->data != NULL) { \ |
201 atomic_add_16(&((asoc)->chunks_on_out_queue), -chk_cnt); \ | 201 atomic_add_int(&((asoc)->chunks_on_out_queue), -chk_cnt); \ |
202 if ((asoc)->total_output_queue_size >= tp1->book_size) { \ 203 atomic_add_int(&((asoc)->total_output_queue_size), -tp1->book_size); \ 204 } else { \ 205 (asoc)->total_output_queue_size = 0; \ 206 } \ 207 if (stcb->sctp_socket && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \ 208 (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \ 209 if (stcb->sctp_socket->so_snd.sb_cc >= tp1->book_size) { \ --- 5 unchanged lines hidden (view full) --- 215 } \ 216} while (0) 217 218#endif 219 220#define sctp_free_spbufspace(stcb, asoc, sp) \ 221do { \ 222 if (sp->data != NULL) { \ | 202 if ((asoc)->total_output_queue_size >= tp1->book_size) { \ 203 atomic_add_int(&((asoc)->total_output_queue_size), -tp1->book_size); \ 204 } else { \ 205 (asoc)->total_output_queue_size = 0; \ 206 } \ 207 if (stcb->sctp_socket && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \ 208 (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \ 209 if (stcb->sctp_socket->so_snd.sb_cc >= tp1->book_size) { \ --- 5 unchanged lines hidden (view full) --- 215 } \ 216} while (0) 217 218#endif 219 220#define sctp_free_spbufspace(stcb, asoc, sp) \ 221do { \ 222 if (sp->data != NULL) { \ |
223 atomic_add_16(&(asoc)->chunks_on_out_queue, -1); \ | 223 atomic_add_int(&(asoc)->chunks_on_out_queue, -1); \ |
224 if ((asoc)->total_output_queue_size >= sp->length) { \ 225 atomic_add_int(&(asoc)->total_output_queue_size,sp->length); \ 226 } else { \ 227 (asoc)->total_output_queue_size = 0; \ 228 } \ 229 if (stcb->sctp_socket && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \ 230 (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \ 231 if (stcb->sctp_socket->so_snd.sb_cc >= sp->length) { \ --- 83 unchanged lines hidden --- | 224 if ((asoc)->total_output_queue_size >= sp->length) { \ 225 atomic_add_int(&(asoc)->total_output_queue_size,sp->length); \ 226 } else { \ 227 (asoc)->total_output_queue_size = 0; \ 228 } \ 229 if (stcb->sctp_socket && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \ 230 (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \ 231 if (stcb->sctp_socket->so_snd.sb_cc >= sp->length) { \ --- 83 unchanged lines hidden --- |