sctp_constants.h (ceaad40ae729dea2c5d8ffcfdd45bb96fb8969d2) sctp_constants.h (851b7298b3f8f09d1a337bcd5bbe7222543872f5)
1/*-
2 * Copyright (c) 2001-2007, 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.

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

466#define SCTP_SUCCESS_REPORT 0xc005
467#define SCTP_ULP_ADAPTATION 0xc006
468
469/* Notification error codes */
470#define SCTP_NOTIFY_DATAGRAM_UNSENT 0x0001
471#define SCTP_NOTIFY_DATAGRAM_SENT 0x0002
472#define SCTP_FAILED_THRESHOLD 0x0004
473#define SCTP_HEARTBEAT_SUCCESS 0x0008
1/*-
2 * Copyright (c) 2001-2007, 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.

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

466#define SCTP_SUCCESS_REPORT 0xc005
467#define SCTP_ULP_ADAPTATION 0xc006
468
469/* Notification error codes */
470#define SCTP_NOTIFY_DATAGRAM_UNSENT 0x0001
471#define SCTP_NOTIFY_DATAGRAM_SENT 0x0002
472#define SCTP_FAILED_THRESHOLD 0x0004
473#define SCTP_HEARTBEAT_SUCCESS 0x0008
474#define SCTP_RESPONSE_TO_USER_REQ 0x000f
475#define SCTP_INTERNAL_ERROR 0x0010
476#define SCTP_SHUTDOWN_GUARD_EXPIRES 0x0020
477#define SCTP_RECEIVED_SACK 0x0040
478#define SCTP_PEER_FAULTY 0x0080
474#define SCTP_RESPONSE_TO_USER_REQ 0x0010
475#define SCTP_INTERNAL_ERROR 0x0020
476#define SCTP_SHUTDOWN_GUARD_EXPIRES 0x0040
477#define SCTP_RECEIVED_SACK 0x0080
478#define SCTP_PEER_FAULTY 0x0100
479#define SCTP_ICMP_REFUSED 0x0200
479
480/* bits for TOS field */
481#define SCTP_ECT0_BIT 0x02
482#define SCTP_ECT1_BIT 0x01
483#define SCTP_CE_BITS 0x03
484
485/* below turns off above */
486#define SCTP_FLEXIBLE_ADDRESS 0x20

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

586#define SCTP_TIMER_TYPE_STRRESET 14
587#define SCTP_TIMER_TYPE_INPKILL 15
588#define SCTP_TIMER_TYPE_ITERATOR 16
589#define SCTP_TIMER_TYPE_EARLYFR 17
590#define SCTP_TIMER_TYPE_ASOCKILL 18
591#define SCTP_TIMER_TYPE_ADDR_WQ 19
592#define SCTP_TIMER_TYPE_ZERO_COPY 20
593#define SCTP_TIMER_TYPE_ZCOPY_SENDQ 21
480
481/* bits for TOS field */
482#define SCTP_ECT0_BIT 0x02
483#define SCTP_ECT1_BIT 0x01
484#define SCTP_CE_BITS 0x03
485
486/* below turns off above */
487#define SCTP_FLEXIBLE_ADDRESS 0x20

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

587#define SCTP_TIMER_TYPE_STRRESET 14
588#define SCTP_TIMER_TYPE_INPKILL 15
589#define SCTP_TIMER_TYPE_ITERATOR 16
590#define SCTP_TIMER_TYPE_EARLYFR 17
591#define SCTP_TIMER_TYPE_ASOCKILL 18
592#define SCTP_TIMER_TYPE_ADDR_WQ 19
593#define SCTP_TIMER_TYPE_ZERO_COPY 20
594#define SCTP_TIMER_TYPE_ZCOPY_SENDQ 21
595#define SCTP_TIMER_TYPE_PRIM_DELETED 22
594/* add new timers here - and increment LAST */
596/* add new timers here - and increment LAST */
595#define SCTP_TIMER_TYPE_LAST 22
597#define SCTP_TIMER_TYPE_LAST 23
596
597#define SCTP_IS_TIMER_TYPE_VALID(t) (((t) > SCTP_TIMER_TYPE_NONE) && \
598 ((t) < SCTP_TIMER_TYPE_LAST))
599
600
601
602/*
603 * Number of ticks before the soxwakeup() event that is delayed is sent AFTER

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

647 * sends a large message down .. the fragmented chunks don't count until
648 * AFTER the message is on queue.. it would be the next send that blocks
649 * things. This number will get tuned up at boot in the sctp_init and use the
650 * number of clusters as a base. This way high bandwidth environments will
651 * not get impacted by the lower bandwidth sending a bunch of 1 byte chunks
652 */
653#define SCTP_ASOC_MAX_CHUNKS_ON_QUEUE 512
654
598
599#define SCTP_IS_TIMER_TYPE_VALID(t) (((t) > SCTP_TIMER_TYPE_NONE) && \
600 ((t) < SCTP_TIMER_TYPE_LAST))
601
602
603
604/*
605 * Number of ticks before the soxwakeup() event that is delayed is sent AFTER

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

649 * sends a large message down .. the fragmented chunks don't count until
650 * AFTER the message is on queue.. it would be the next send that blocks
651 * things. This number will get tuned up at boot in the sctp_init and use the
652 * number of clusters as a base. This way high bandwidth environments will
653 * not get impacted by the lower bandwidth sending a bunch of 1 byte chunks
654 */
655#define SCTP_ASOC_MAX_CHUNKS_ON_QUEUE 512
656
657
655/* The conversion from time to ticks and vice versa is done by rounding
656 * upwards. This way we can test in the code the time to be positive and
657 * know that this corresponds to a positive number of ticks.
658 */
659#define MSEC_TO_TICKS(x) ((hz == 1000) ? x : ((((x) * hz) + 999) / 1000))
660#define TICKS_TO_MSEC(x) ((hz == 1000) ? x : ((((x) * 1000) + (hz - 1)) / hz))
661
662#define SEC_TO_TICKS(x) ((x) * hz)

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

1031/*-
1032 * defines for socket lock states.
1033 * Used by __APPLE__ and SCTP_SO_LOCK_TESTING
1034 */
1035#define SCTP_SO_LOCKED 1
1036#define SCTP_SO_NOT_LOCKED 0
1037
1038
658/* The conversion from time to ticks and vice versa is done by rounding
659 * upwards. This way we can test in the code the time to be positive and
660 * know that this corresponds to a positive number of ticks.
661 */
662#define MSEC_TO_TICKS(x) ((hz == 1000) ? x : ((((x) * hz) + 999) / 1000))
663#define TICKS_TO_MSEC(x) ((hz == 1000) ? x : ((((x) * 1000) + (hz - 1)) / hz))
664
665#define SEC_TO_TICKS(x) ((x) * hz)

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

1034/*-
1035 * defines for socket lock states.
1036 * Used by __APPLE__ and SCTP_SO_LOCK_TESTING
1037 */
1038#define SCTP_SO_LOCKED 1
1039#define SCTP_SO_NOT_LOCKED 0
1040
1041
1042/*-
1043 * For address locks, do we hold the lock?
1044 */
1045#define SCTP_ADDR_LOCKED 1
1046#define SCTP_ADDR_NOT_LOCKED 0
1047
1039#define IN4_ISPRIVATE_ADDRESS(a) \
1040 ((((uint8_t *)&(a)->s_addr)[0] == 10) || \
1041 ((((uint8_t *)&(a)->s_addr)[0] == 172) && \
1042 (((uint8_t *)&(a)->s_addr)[1] >= 16) && \
1043 (((uint8_t *)&(a)->s_addr)[1] <= 32)) || \
1044 ((((uint8_t *)&(a)->s_addr)[0] == 192) && \
1045 (((uint8_t *)&(a)->s_addr)[1] == 168)))
1046

--- 61 unchanged lines hidden ---
1048#define IN4_ISPRIVATE_ADDRESS(a) \
1049 ((((uint8_t *)&(a)->s_addr)[0] == 10) || \
1050 ((((uint8_t *)&(a)->s_addr)[0] == 172) && \
1051 (((uint8_t *)&(a)->s_addr)[1] >= 16) && \
1052 (((uint8_t *)&(a)->s_addr)[1] <= 32)) || \
1053 ((((uint8_t *)&(a)->s_addr)[0] == 192) && \
1054 (((uint8_t *)&(a)->s_addr)[1] == 168)))
1055

--- 61 unchanged lines hidden ---