sctp_var.h (228653) | sctp_var.h (228907) |
---|---|
1/*- 2 * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. 3 * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. 4 * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are met: 8 * --- 19 unchanged lines hidden (view full) --- 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33/* $KAME: sctp_var.h,v 1.24 2005/03/06 16:04:19 itojun Exp $ */ 34 35#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. 3 * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. 4 * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are met: 8 * --- 19 unchanged lines hidden (view full) --- 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33/* $KAME: sctp_var.h,v 1.24 2005/03/06 16:04:19 itojun Exp $ */ 34 35#include <sys/cdefs.h> |
36__FBSDID("$FreeBSD: head/sys/netinet/sctp_var.h 228653 2011-12-17 19:21:40Z tuexen $"); | 36__FBSDID("$FreeBSD: head/sys/netinet/sctp_var.h 228907 2011-12-27 10:16:24Z tuexen $"); |
37 38#ifndef _NETINET_SCTP_VAR_H_ 39#define _NETINET_SCTP_VAR_H_ 40 41#include <netinet/sctp_uio.h> 42 43#if defined(_KERNEL) || defined(__Userspace__) 44 45extern struct pr_usrreqs sctp_usrreqs; 46 47 48#define sctp_feature_on(inp, feature) (inp->sctp_features |= feature) 49#define sctp_feature_off(inp, feature) (inp->sctp_features &= ~feature) 50#define sctp_is_feature_on(inp, feature) ((inp->sctp_features & feature) == feature) 51#define sctp_is_feature_off(inp, feature) ((inp->sctp_features & feature) == 0) 52 53#define sctp_stcb_feature_on(inp, stcb, feature) {\ 54 if (stcb) { \ 55 stcb->asoc.sctp_features |= feature; \ | 37 38#ifndef _NETINET_SCTP_VAR_H_ 39#define _NETINET_SCTP_VAR_H_ 40 41#include <netinet/sctp_uio.h> 42 43#if defined(_KERNEL) || defined(__Userspace__) 44 45extern struct pr_usrreqs sctp_usrreqs; 46 47 48#define sctp_feature_on(inp, feature) (inp->sctp_features |= feature) 49#define sctp_feature_off(inp, feature) (inp->sctp_features &= ~feature) 50#define sctp_is_feature_on(inp, feature) ((inp->sctp_features & feature) == feature) 51#define sctp_is_feature_off(inp, feature) ((inp->sctp_features & feature) == 0) 52 53#define sctp_stcb_feature_on(inp, stcb, feature) {\ 54 if (stcb) { \ 55 stcb->asoc.sctp_features |= feature; \ |
56 } else { \ | 56 } else if (inp) { \ |
57 inp->sctp_features |= feature; \ 58 } \ 59} 60#define sctp_stcb_feature_off(inp, stcb, feature) {\ 61 if (stcb) { \ 62 stcb->asoc.sctp_features &= ~feature; \ | 57 inp->sctp_features |= feature; \ 58 } \ 59} 60#define sctp_stcb_feature_off(inp, stcb, feature) {\ 61 if (stcb) { \ 62 stcb->asoc.sctp_features &= ~feature; \ |
63 } else { \ | 63 } else if (inp) { \ |
64 inp->sctp_features &= ~feature; \ 65 } \ 66} 67#define sctp_stcb_is_feature_on(inp, stcb, feature) \ 68 (((stcb != NULL) && \ 69 ((stcb->asoc.sctp_features & feature) == feature)) || \ | 64 inp->sctp_features &= ~feature; \ 65 } \ 66} 67#define sctp_stcb_is_feature_on(inp, stcb, feature) \ 68 (((stcb != NULL) && \ 69 ((stcb->asoc.sctp_features & feature) == feature)) || \ |
70 ((stcb == NULL) && \ | 70 ((stcb == NULL) && (inp != NULL) && \ |
71 ((inp->sctp_features & feature) == feature))) 72#define sctp_stcb_is_feature_off(inp, stcb, feature) \ 73 (((stcb != NULL) && \ 74 ((stcb->asoc.sctp_features & feature) == 0)) || \ | 71 ((inp->sctp_features & feature) == feature))) 72#define sctp_stcb_is_feature_off(inp, stcb, feature) \ 73 (((stcb != NULL) && \ 74 ((stcb->asoc.sctp_features & feature) == 0)) || \ |
75 ((stcb == NULL) && \ 76 ((inp->sctp_features & feature) == 0))) | 75 ((stcb == NULL) && (inp != NULL) && \ 76 ((inp->sctp_features & feature) == 0)) || \ 77 ((stcb == NULL) && (inp == NULL))) |
77 78/* managing mobility_feature in inpcb (by micchie) */ 79#define sctp_mobility_feature_on(inp, feature) (inp->sctp_mobility_features |= feature) 80#define sctp_mobility_feature_off(inp, feature) (inp->sctp_mobility_features &= ~feature) 81#define sctp_is_mobility_feature_on(inp, feature) (inp->sctp_mobility_features & feature) 82#define sctp_is_mobility_feature_off(inp, feature) ((inp->sctp_mobility_features & feature) == 0) 83 84#define sctp_maxspace(sb) (max((sb)->sb_hiwat,SCTP_MINIMAL_RWND)) --- 145 unchanged lines hidden (view full) --- 230 } else { \ 231 val = 0; \ 232 } \ 233} 234 235#define sctp_mbuf_crush(data) do { \ 236 struct mbuf *_m; \ 237 _m = (data); \ | 78 79/* managing mobility_feature in inpcb (by micchie) */ 80#define sctp_mobility_feature_on(inp, feature) (inp->sctp_mobility_features |= feature) 81#define sctp_mobility_feature_off(inp, feature) (inp->sctp_mobility_features &= ~feature) 82#define sctp_is_mobility_feature_on(inp, feature) (inp->sctp_mobility_features & feature) 83#define sctp_is_mobility_feature_off(inp, feature) ((inp->sctp_mobility_features & feature) == 0) 84 85#define sctp_maxspace(sb) (max((sb)->sb_hiwat,SCTP_MINIMAL_RWND)) --- 145 unchanged lines hidden (view full) --- 231 } else { \ 232 val = 0; \ 233 } \ 234} 235 236#define sctp_mbuf_crush(data) do { \ 237 struct mbuf *_m; \ 238 _m = (data); \ |
238 while(_m && (SCTP_BUF_LEN(_m) == 0)) { \ | 239 while (_m && (SCTP_BUF_LEN(_m) == 0)) { \ |
239 (data) = SCTP_BUF_NEXT(_m); \ 240 SCTP_BUF_NEXT(_m) = NULL; \ 241 sctp_m_free(_m); \ 242 _m = (data); \ 243 } \ 244} while (0) 245 246#define sctp_flight_size_decrease(tp1) do { \ --- 124 unchanged lines hidden --- | 240 (data) = SCTP_BUF_NEXT(_m); \ 241 SCTP_BUF_NEXT(_m) = NULL; \ 242 sctp_m_free(_m); \ 243 _m = (data); \ 244 } \ 245} while (0) 246 247#define sctp_flight_size_decrease(tp1) do { \ --- 124 unchanged lines hidden --- |