Deleted Added
full compact
sctputil.c (235077) sctputil.c (235081)
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: sctputil.c,v 1.37 2005/03/07 23:26:09 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: sctputil.c,v 1.37 2005/03/07 23:26:09 itojun Exp $ */
34
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/sys/netinet/sctputil.c 235077 2012-05-06 11:37:41Z tuexen $");
36__FBSDID("$FreeBSD: head/sys/netinet/sctputil.c 235081 2012-05-06 13:09:13Z tuexen $");
37
38#include <netinet/sctp_os.h>
39#include <netinet/sctp_pcb.h>
40#include <netinet/sctputil.h>
41#include <netinet/sctp_var.h>
42#include <netinet/sctp_sysctl.h>
43#ifdef INET6
44#endif

--- 2552 unchanged lines hidden (view full) ---

2597#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING)
2598 SCTP_UNUSED
2599#endif
2600)
2601{
2602 struct mbuf *m_notify;
2603 struct sctp_assoc_change *sac;
2604 struct sctp_queued_to_read *control;
37
38#include <netinet/sctp_os.h>
39#include <netinet/sctp_pcb.h>
40#include <netinet/sctputil.h>
41#include <netinet/sctp_var.h>
42#include <netinet/sctp_sysctl.h>
43#ifdef INET6
44#endif

--- 2552 unchanged lines hidden (view full) ---

2597#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING)
2598 SCTP_UNUSED
2599#endif
2600)
2601{
2602 struct mbuf *m_notify;
2603 struct sctp_assoc_change *sac;
2604 struct sctp_queued_to_read *control;
2605 unsigned int i;
2605
2606#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
2607 struct socket *so;
2608
2609#endif
2610
2611 /*
2612 * For TCP model AND UDP connected sockets we will send an error up

--- 48 unchanged lines hidden (view full) ---

2661 sac->sac_flags = 0;
2662 sac->sac_length = sizeof(struct sctp_assoc_change);
2663 sac->sac_state = event;
2664 sac->sac_error = error;
2665 /* XXX verify these stream counts */
2666 sac->sac_outbound_streams = stcb->asoc.streamoutcnt;
2667 sac->sac_inbound_streams = stcb->asoc.streamincnt;
2668 sac->sac_assoc_id = sctp_get_associd(stcb);
2606
2607#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
2608 struct socket *so;
2609
2610#endif
2611
2612 /*
2613 * For TCP model AND UDP connected sockets we will send an error up

--- 48 unchanged lines hidden (view full) ---

2662 sac->sac_flags = 0;
2663 sac->sac_length = sizeof(struct sctp_assoc_change);
2664 sac->sac_state = event;
2665 sac->sac_error = error;
2666 /* XXX verify these stream counts */
2667 sac->sac_outbound_streams = stcb->asoc.streamoutcnt;
2668 sac->sac_inbound_streams = stcb->asoc.streamincnt;
2669 sac->sac_assoc_id = sctp_get_associd(stcb);
2669 SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_assoc_change);
2670 i = 0;
2671 if (stcb->asoc.peer_supports_prsctp) {
2672 sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_PR;
2673 }
2674 if (stcb->asoc.peer_supports_auth) {
2675 sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_AUTH;
2676 }
2677 if (stcb->asoc.peer_supports_asconf) {
2678 sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_ASCONF;
2679 }
2680 sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_MULTIBUF;
2681 if (stcb->asoc.peer_supports_strreset) {
2682 sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_RE_CONFIG;
2683 }
2684 sac->sac_length += i;
2685 SCTP_BUF_LEN(m_notify) = sac->sac_length;
2670 SCTP_BUF_NEXT(m_notify) = NULL;
2671 control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination,
2672 0, 0, stcb->asoc.context, 0, 0, 0,
2673 m_notify);
2674 if (control == NULL) {
2675 /* no memory */
2676 sctp_m_freem(m_notify);
2677 return;

--- 4219 unchanged lines hidden ---
2686 SCTP_BUF_NEXT(m_notify) = NULL;
2687 control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination,
2688 0, 0, stcb->asoc.context, 0, 0, 0,
2689 m_notify);
2690 if (control == NULL) {
2691 /* no memory */
2692 sctp_m_freem(m_notify);
2693 return;

--- 4219 unchanged lines hidden ---