| 628 | } |
| 629 | |
| 630 | void |
| 631 | sctp_auditing(int from, struct sctp_inpcb *inp, struct sctp_tcb *stcb, |
| 632 | struct sctp_nets *net) |
| 633 | { |
| 634 | int resend_cnt, tot_out, rep, tot_book_cnt; |
| 635 | struct sctp_nets *lnet; |
| 636 | struct sctp_tmit_chunk *chk; |
| 637 | |
| 638 | sctp_audit_data[sctp_audit_indx][0] = 0xAA; |
| 639 | sctp_audit_data[sctp_audit_indx][1] = 0x000000ff & from; |
| 640 | sctp_audit_indx++; |
| 641 | if (sctp_audit_indx >= SCTP_AUDIT_SIZE) { |
| 642 | sctp_audit_indx = 0; |
| 643 | } |
| 644 | if (inp == NULL) { |
| 645 | sctp_audit_data[sctp_audit_indx][0] = 0xAF; |
| 646 | sctp_audit_data[sctp_audit_indx][1] = 0x01; |
| 647 | sctp_audit_indx++; |
| 648 | if (sctp_audit_indx >= SCTP_AUDIT_SIZE) { |
| 649 | sctp_audit_indx = 0; |
| 650 | } |
| 651 | return; |
| 652 | } |
| 653 | if (stcb == NULL) { |
| 654 | sctp_audit_data[sctp_audit_indx][0] = 0xAF; |
| 655 | sctp_audit_data[sctp_audit_indx][1] = 0x02; |
| 656 | sctp_audit_indx++; |
| 657 | if (sctp_audit_indx >= SCTP_AUDIT_SIZE) { |
| 658 | sctp_audit_indx = 0; |
| 659 | } |
| 660 | return; |
| 661 | } |
| 662 | sctp_audit_data[sctp_audit_indx][0] = 0xA1; |
| 663 | sctp_audit_data[sctp_audit_indx][1] = |
| 664 | (0x000000ff & stcb->asoc.sent_queue_retran_cnt); |
| 665 | sctp_audit_indx++; |
| 666 | if (sctp_audit_indx >= SCTP_AUDIT_SIZE) { |
| 667 | sctp_audit_indx = 0; |
| 668 | } |
| 669 | rep = 0; |
| 670 | tot_book_cnt = 0; |
| 671 | resend_cnt = tot_out = 0; |
| 672 | TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) { |
| 673 | if (chk->sent == SCTP_DATAGRAM_RESEND) { |
| 674 | resend_cnt++; |
| 675 | } else if (chk->sent < SCTP_DATAGRAM_RESEND) { |
| 676 | tot_out += chk->book_size; |
| 677 | tot_book_cnt++; |
| 678 | } |
| 679 | } |
| 680 | if (resend_cnt != stcb->asoc.sent_queue_retran_cnt) { |
| 681 | sctp_audit_data[sctp_audit_indx][0] = 0xAF; |
| 682 | sctp_audit_data[sctp_audit_indx][1] = 0xA1; |
| 683 | sctp_audit_indx++; |
| 684 | if (sctp_audit_indx >= SCTP_AUDIT_SIZE) { |
| 685 | sctp_audit_indx = 0; |
| 686 | } |
| 687 | SCTP_PRINTF("resend_cnt:%d asoc-tot:%d\n", |
no test coverage detected