Deleted Added
full compact
sctp_constants.h (202516) sctp_constants.h (206137)
1/*-
2 * Copyright (c) 2001-2008, by 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.

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

26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
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/* $KAME: sctp_constants.h,v 1.17 2005/03/06 16:04:17 itojun Exp $ */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2001-2008, by 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.

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

26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
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/* $KAME: sctp_constants.h,v 1.17 2005/03/06 16:04:17 itojun Exp $ */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_constants.h 202516 2010-01-17 19:17:16Z rrs $");
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_constants.h 206137 2010-04-03 15:40:14Z tuexen $");
35
36#ifndef __sctp_constants_h__
37#define __sctp_constants_h__
38
39/* IANA assigned port number for SCTP over UDP encapsulation */
40/* For freebsd we cannot bind the port at
41 * startup. Otherwise what will happen is
42 * we really won't be bound. The user must

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

539
540/* Maximum the mapping array will grow to (TSN mapping array) */
541#define SCTP_MAPPING_ARRAY 512
542
543/* size of the inital malloc on the mapping array */
544#define SCTP_INITIAL_MAPPING_ARRAY 16
545/* how much we grow the mapping array each call */
546#define SCTP_MAPPING_ARRAY_INCR 32
35
36#ifndef __sctp_constants_h__
37#define __sctp_constants_h__
38
39/* IANA assigned port number for SCTP over UDP encapsulation */
40/* For freebsd we cannot bind the port at
41 * startup. Otherwise what will happen is
42 * we really won't be bound. The user must

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

539
540/* Maximum the mapping array will grow to (TSN mapping array) */
541#define SCTP_MAPPING_ARRAY 512
542
543/* size of the inital malloc on the mapping array */
544#define SCTP_INITIAL_MAPPING_ARRAY 16
545/* how much we grow the mapping array each call */
546#define SCTP_MAPPING_ARRAY_INCR 32
547/* EY 05/13/08 - nr_sack version of the previous 3 constants */
548/* Maximum the nr mapping array will grow to (TSN mapping array) */
549#define SCTP_NR_MAPPING_ARRAY 512
550/* size of the inital malloc on the nr mapping array */
551#define SCTP_INITIAL_NR_MAPPING_ARRAY 16
552/* how much we grow the nr mapping array each call */
553#define SCTP_NR_MAPPING_ARRAY_INCR 32
547
554/*
555 * Here we define the timer types used by the implementation as arguments in
556 * the set/get timer type calls.
557 */
558#define SCTP_TIMER_INIT 0
559#define SCTP_TIMER_RECV 1
560#define SCTP_TIMER_SEND 2
561#define SCTP_TIMER_HEARTBEAT 3

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

928#define compare_with_wrap(a, b, M) (((a > b) && ((a - b) < ((M >> 1) + 1))) || \
929 ((b > a) && ((b - a) > ((M >> 1) + 1))))
930
931
932/* Mapping array manipulation routines */
933#define SCTP_IS_TSN_PRESENT(arry, gap) ((arry[(gap >> 3)] >> (gap & 0x07)) & 0x01)
934#define SCTP_SET_TSN_PRESENT(arry, gap) (arry[(gap >> 3)] |= (0x01 << ((gap & 0x07))))
935#define SCTP_UNSET_TSN_PRESENT(arry, gap) (arry[(gap >> 3)] &= ((~(0x01 << ((gap & 0x07)))) & 0xff))
548/*
549 * Here we define the timer types used by the implementation as arguments in
550 * the set/get timer type calls.
551 */
552#define SCTP_TIMER_INIT 0
553#define SCTP_TIMER_RECV 1
554#define SCTP_TIMER_SEND 2
555#define SCTP_TIMER_HEARTBEAT 3

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

922#define compare_with_wrap(a, b, M) (((a > b) && ((a - b) < ((M >> 1) + 1))) || \
923 ((b > a) && ((b - a) > ((M >> 1) + 1))))
924
925
926/* Mapping array manipulation routines */
927#define SCTP_IS_TSN_PRESENT(arry, gap) ((arry[(gap >> 3)] >> (gap & 0x07)) & 0x01)
928#define SCTP_SET_TSN_PRESENT(arry, gap) (arry[(gap >> 3)] |= (0x01 << ((gap & 0x07))))
929#define SCTP_UNSET_TSN_PRESENT(arry, gap) (arry[(gap >> 3)] &= ((~(0x01 << ((gap & 0x07)))) & 0xff))
930#define SCTP_CALC_TSN_TO_GAP(gap, tsn, mapping_tsn) do { \
931 if (tsn >= mapping_tsn) { \
932 gap = tsn - mapping_tsn; \
933 } else { \
934 gap = (MAX_TSN - mapping_tsn) + tsn + 1; \
935 } \
936 } while(0)
936
937
938#define SCTP_RETRAN_DONE -1
939#define SCTP_RETRAN_EXIT -2
940
941/*
942 * This value defines the number of vtag block time wait entry's per list
943 * element. Each entry will take 2 4 byte ints (and of course the overhead

--- 116 unchanged lines hidden ---
937
938
939#define SCTP_RETRAN_DONE -1
940#define SCTP_RETRAN_EXIT -2
941
942/*
943 * This value defines the number of vtag block time wait entry's per list
944 * element. Each entry will take 2 4 byte ints (and of course the overhead

--- 116 unchanged lines hidden ---