diff options
Diffstat (limited to 'sys/netinet/sctp_var.h')
-rw-r--r-- | sys/netinet/sctp_var.h | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/sys/netinet/sctp_var.h b/sys/netinet/sctp_var.h index f05a368..b6e1d06 100644 --- a/sys/netinet/sctp_var.h +++ b/sys/netinet/sctp_var.h @@ -90,6 +90,7 @@ extern struct pr_usrreqs sctp_usrreqs; #define sctp_free_a_chunk(_stcb, _chk) { \ + SCTP_TCB_LOCK_ASSERT((_stcb)); \ if ((_chk)->whoTo) { \ sctp_free_remote_addr((_chk)->whoTo); \ (_chk)->whoTo = NULL; \ @@ -223,7 +224,6 @@ extern struct pr_usrreqs sctp_usrreqs; } \ } while (0) -#ifdef RANDY_WILL_USE_LATER /* this will be the non-invarant version */ #define sctp_flight_size_decrease(tp1) do { \ if (tp1->whoTo->flight_size >= tp1->book_size) \ tp1->whoTo->flight_size -= tp1->book_size; \ @@ -231,8 +231,21 @@ extern struct pr_usrreqs sctp_usrreqs; tp1->whoTo->flight_size = 0; \ } while (0) +#define sctp_flight_size_increase(tp1) do { \ + (tp1)->whoTo->flight_size += (tp1)->book_size; \ +} while (0) +#ifdef SCTP_FS_SPEC_LOG #define sctp_total_flight_decrease(stcb, tp1) do { \ + if(stcb->asoc.fs_index > SCTP_FS_SPEC_LOG_SIZE) \ + stcb->asoc.fs_index = 0;\ + stcb->asoc.fslog[stcb->asoc.fs_index].total_flight = stcb->asoc.total_flight; \ + stcb->asoc.fslog[stcb->asoc.fs_index].tsn = tp1->rec.data.TSN_seq; \ + stcb->asoc.fslog[stcb->asoc.fs_index].book = tp1->book_size; \ + stcb->asoc.fslog[stcb->asoc.fs_index].sent = tp1->sent; \ + stcb->asoc.fslog[stcb->asoc.fs_index].incr = 0; \ + stcb->asoc.fslog[stcb->asoc.fs_index].decr = 1; \ + stcb->asoc.fs_index++; \ if (stcb->asoc.total_flight >= tp1->book_size) { \ stcb->asoc.total_flight -= tp1->book_size; \ if (stcb->asoc.total_flight_count > 0) \ @@ -243,15 +256,21 @@ extern struct pr_usrreqs sctp_usrreqs; } \ } while (0) -#else - -#define sctp_flight_size_decrease(tp1) do { \ - if (tp1->whoTo->flight_size >= tp1->book_size) \ - tp1->whoTo->flight_size -= tp1->book_size; \ - else \ - panic("flight size corruption"); \ +#define sctp_total_flight_increase(stcb, tp1) do { \ + if(stcb->asoc.fs_index > SCTP_FS_SPEC_LOG_SIZE) \ + stcb->asoc.fs_index = 0;\ + stcb->asoc.fslog[stcb->asoc.fs_index].total_flight = stcb->asoc.total_flight; \ + stcb->asoc.fslog[stcb->asoc.fs_index].tsn = tp1->rec.data.TSN_seq; \ + stcb->asoc.fslog[stcb->asoc.fs_index].book = tp1->book_size; \ + stcb->asoc.fslog[stcb->asoc.fs_index].sent = tp1->sent; \ + stcb->asoc.fslog[stcb->asoc.fs_index].incr = 1; \ + stcb->asoc.fslog[stcb->asoc.fs_index].decr = 0; \ + stcb->asoc.fs_index++; \ + (stcb)->asoc.total_flight_count++; \ + (stcb)->asoc.total_flight += (tp1)->book_size; \ } while (0) +#else #define sctp_total_flight_decrease(stcb, tp1) do { \ if (stcb->asoc.total_flight >= tp1->book_size) { \ @@ -259,22 +278,18 @@ extern struct pr_usrreqs sctp_usrreqs; if (stcb->asoc.total_flight_count > 0) \ stcb->asoc.total_flight_count--; \ } else { \ - panic("total flight size corruption"); \ + stcb->asoc.total_flight = 0; \ + stcb->asoc.total_flight_count = 0; \ } \ } while (0) -#endif - -#define sctp_flight_size_increase(tp1) do { \ - (tp1)->whoTo->flight_size += (tp1)->book_size; \ -} while (0) - - #define sctp_total_flight_increase(stcb, tp1) do { \ (stcb)->asoc.total_flight_count++; \ (stcb)->asoc.total_flight += (tp1)->book_size; \ } while (0) +#endif + struct sctp_nets; struct sctp_inpcb; struct sctp_tcb; |