395 SCTP_INP_RUNLOCK(inp); 396 SCTP_INP_INFO_RUNLOCK(); 397 error = SYSCTL_OUT(req, &xstcb, sizeof(struct xsctp_tcb)); 398 if (error) { 399 SCTP_INP_DECR_REF(inp); 400 atomic_add_int(&stcb->asoc.refcnt, -1); 401 return error; 402 } 403 SCTP_INP_INFO_RLOCK(); 404 SCTP_INP_RLOCK(inp); 405 error = copy_out_local_addresses(inp, stcb, req); 406 if (error) { 407 SCTP_INP_DECR_REF(inp); 408 atomic_add_int(&stcb->asoc.refcnt, -1); 409 return error; 410 } 411 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { 412 xraddr.last = 0; 413 xraddr.address = net->ro._l_addr; 414 xraddr.active = ((net->dest_state & SCTP_ADDR_REACHABLE) == SCTP_ADDR_REACHABLE); 415 xraddr.confirmed = ((net->dest_state & SCTP_ADDR_UNCONFIRMED) == 0); 416 xraddr.heartbeat_enabled = ((net->dest_state & SCTP_ADDR_NOHB) == 0); 417 xraddr.rto = net->RTO; 418 xraddr.max_path_rtx = net->failure_threshold; 419 xraddr.rtx = net->marked_retrans; 420 xraddr.error_counter = net->error_count; 421 xraddr.cwnd = net->cwnd; 422 xraddr.flight_size = net->flight_size; 423 xraddr.mtu = net->mtu; 424 xraddr.start_time = net->start_time; 425 SCTP_INP_RUNLOCK(inp); 426 SCTP_INP_INFO_RUNLOCK(); 427 error = SYSCTL_OUT(req, &xraddr, sizeof(struct xsctp_raddr)); 428 if (error) { 429 SCTP_INP_DECR_REF(inp); 430 atomic_add_int(&stcb->asoc.refcnt, -1); 431 return error; 432 } 433 SCTP_INP_INFO_RLOCK(); 434 SCTP_INP_RLOCK(inp); 435 } 436 atomic_add_int(&stcb->asoc.refcnt, -1); 437 memset((void *)&xraddr, 0, sizeof(struct xsctp_raddr)); 438 xraddr.last = 1; 439 SCTP_INP_RUNLOCK(inp); 440 SCTP_INP_INFO_RUNLOCK(); 441 error = SYSCTL_OUT(req, &xraddr, sizeof(struct xsctp_raddr)); 442 if (error) { 443 SCTP_INP_DECR_REF(inp); 444 return error; 445 } 446 SCTP_INP_INFO_RLOCK(); 447 SCTP_INP_RLOCK(inp); 448 } 449 SCTP_INP_RUNLOCK(inp); 450 SCTP_INP_INFO_RUNLOCK(); 451 memset((void *)&xstcb, 0, sizeof(struct xsctp_tcb)); 452 xstcb.last = 1; 453 error = SYSCTL_OUT(req, &xstcb, sizeof(struct xsctp_tcb)); 454 if (error) { 455 return error; 456 } 457 SCTP_INP_INFO_RLOCK(); 458 SCTP_INP_DECR_REF(inp); 459 } 460 SCTP_INP_INFO_RUNLOCK(); 461 462 memset((void *)&xinpcb, 0, sizeof(struct xsctp_inpcb)); 463 xinpcb.last = 1; 464 error = SYSCTL_OUT(req, &xinpcb, sizeof(struct xsctp_inpcb)); 465 return error; 466} 467 468 469/* 470 * sysctl definitions 471 */ 472 473SYSCTL_INT(_net_inet_sctp, OID_AUTO, sendspace, CTLFLAG_RW, 474 &sctp_sendspace, 0, "Maximum outgoing SCTP buffer size"); 475 476SYSCTL_INT(_net_inet_sctp, OID_AUTO, recvspace, CTLFLAG_RW, 477 &sctp_recvspace, 0, "Maximum incoming SCTP buffer size"); 478 479#if defined(__FreeBSD__) || defined(SCTP_APPLE_AUTO_ASCONF) 480SYSCTL_INT(_net_inet_sctp, OID_AUTO, auto_asconf, CTLFLAG_RW, 481 &sctp_auto_asconf, 0, "Enable SCTP Auto-ASCONF"); 482#endif 483 484SYSCTL_INT(_net_inet_sctp, OID_AUTO, ecn_enable, CTLFLAG_RW, 485 &sctp_ecn_enable, 0, "Enable SCTP ECN"); 486 487SYSCTL_INT(_net_inet_sctp, OID_AUTO, ecn_nonce, CTLFLAG_RW, 488 &sctp_ecn_nonce, 0, "Enable SCTP ECN Nonce"); 489 490SYSCTL_INT(_net_inet_sctp, OID_AUTO, strict_sacks, CTLFLAG_RW, 491 &sctp_strict_sacks, 0, "Enable SCTP Strict SACK checking"); 492 493SYSCTL_INT(_net_inet_sctp, OID_AUTO, loopback_nocsum, CTLFLAG_RW, 494 &sctp_no_csum_on_loopback, 0, 495 "Enable NO Csum on packets sent on loopback"); 496 497SYSCTL_INT(_net_inet_sctp, OID_AUTO, strict_init, CTLFLAG_RW, 498 &sctp_strict_init, 0, 499 "Enable strict INIT/INIT-ACK singleton enforcement"); 500 501SYSCTL_INT(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLFLAG_RW, 502 &sctp_peer_chunk_oh, 0, 503 "Amount to debit peers rwnd per chunk sent"); 504 505SYSCTL_INT(_net_inet_sctp, OID_AUTO, maxburst, CTLFLAG_RW, 506 &sctp_max_burst_default, 0, 507 "Default max burst for sctp endpoints"); 508 509SYSCTL_INT(_net_inet_sctp, OID_AUTO, maxchunks, CTLFLAG_RW, 510 &sctp_max_chunks_on_queue, 0, 511 "Default max chunks on queue per asoc"); 512 513SYSCTL_INT(_net_inet_sctp, OID_AUTO, tcbhashsize, CTLFLAG_RW, 514 &sctp_hashtblsize, 0, 515 "Tuneable for Hash table sizes"); 516 517SYSCTL_INT(_net_inet_sctp, OID_AUTO, min_split_point, CTLFLAG_RW, 518 &sctp_min_split_point, 0, 519 "Minimum size when splitting a chunk"); 520 521SYSCTL_INT(_net_inet_sctp, OID_AUTO, pcbhashsize, CTLFLAG_RW, 522 &sctp_pcbtblsize, 0, 523 "Tuneable for PCB Hash table sizes"); 524 525SYSCTL_INT(_net_inet_sctp, OID_AUTO, sys_resource, CTLFLAG_RW, 526 &sctp_system_free_resc_limit, 0, 527 "Max number of cached resources in the system"); 528 529SYSCTL_INT(_net_inet_sctp, OID_AUTO, asoc_resource, CTLFLAG_RW, 530 &sctp_asoc_free_resc_limit, 0, 531 "Max number of cached resources in an asoc"); 532 533SYSCTL_INT(_net_inet_sctp, OID_AUTO, chunkscale, CTLFLAG_RW, 534 &sctp_chunkscale, 0, 535 "Tuneable for Scaling of number of chunks and messages"); 536 537SYSCTL_UINT(_net_inet_sctp, OID_AUTO, delayed_sack_time, CTLFLAG_RW, 538 &sctp_delayed_sack_time_default, 0, 539 "Default delayed SACK timer in msec"); 540 541SYSCTL_UINT(_net_inet_sctp, OID_AUTO, sack_freq, CTLFLAG_RW, 542 &sctp_sack_freq_default, 0, 543 "Default SACK frequency"); 544 545SYSCTL_UINT(_net_inet_sctp, OID_AUTO, heartbeat_interval, CTLFLAG_RW, 546 &sctp_heartbeat_interval_default, 0, 547 "Default heartbeat interval in msec"); 548 549SYSCTL_UINT(_net_inet_sctp, OID_AUTO, pmtu_raise_time, CTLFLAG_RW, 550 &sctp_pmtu_raise_time_default, 0, 551 "Default PMTU raise timer in sec"); 552 553SYSCTL_UINT(_net_inet_sctp, OID_AUTO, shutdown_guard_time, CTLFLAG_RW, 554 &sctp_shutdown_guard_time_default, 0, 555 "Default shutdown guard timer in sec"); 556 557SYSCTL_UINT(_net_inet_sctp, OID_AUTO, secret_lifetime, CTLFLAG_RW, 558 &sctp_secret_lifetime_default, 0, 559 "Default secret lifetime in sec"); 560 561SYSCTL_UINT(_net_inet_sctp, OID_AUTO, rto_max, CTLFLAG_RW, 562 &sctp_rto_max_default, 0, 563 "Default maximum retransmission timeout in msec"); 564 565SYSCTL_UINT(_net_inet_sctp, OID_AUTO, rto_min, CTLFLAG_RW, 566 &sctp_rto_min_default, 0, 567 "Default minimum retransmission timeout in msec"); 568 569SYSCTL_UINT(_net_inet_sctp, OID_AUTO, rto_initial, CTLFLAG_RW, 570 &sctp_rto_initial_default, 0, 571 "Default initial retransmission timeout in msec"); 572 573SYSCTL_UINT(_net_inet_sctp, OID_AUTO, init_rto_max, CTLFLAG_RW, 574 &sctp_init_rto_max_default, 0, 575 "Default maximum retransmission timeout during association setup in msec"); 576 577SYSCTL_UINT(_net_inet_sctp, OID_AUTO, valid_cookie_life, CTLFLAG_RW, 578 &sctp_valid_cookie_life_default, 0, 579 "Default cookie lifetime in ticks"); 580 581SYSCTL_UINT(_net_inet_sctp, OID_AUTO, init_rtx_max, CTLFLAG_RW, 582 &sctp_init_rtx_max_default, 0, 583 "Default maximum number of retransmission for INIT chunks"); 584 585SYSCTL_UINT(_net_inet_sctp, OID_AUTO, assoc_rtx_max, CTLFLAG_RW, 586 &sctp_assoc_rtx_max_default, 0, 587 "Default maximum number of retransmissions per association"); 588 589SYSCTL_UINT(_net_inet_sctp, OID_AUTO, path_rtx_max, CTLFLAG_RW, 590 &sctp_path_rtx_max_default, 0, 591 "Default maximum of retransmissions per path"); 592 593SYSCTL_UINT(_net_inet_sctp, OID_AUTO, add_more_on_output, CTLFLAG_RW, 594 &sctp_add_more_threshold, 0, 595 "When space wise is it worthwhile to try to add more to a socket send buffer"); 596 597SYSCTL_UINT(_net_inet_sctp, OID_AUTO, outgoing_streams, CTLFLAG_RW, 598 &sctp_nr_outgoing_streams_default, 0, 599 "Default number of outgoing streams"); 600 601SYSCTL_UINT(_net_inet_sctp, OID_AUTO, cmt_on_off, CTLFLAG_RW, 602 &sctp_cmt_on_off, 0, 603 "CMT ON/OFF flag"); 604 605SYSCTL_UINT(_net_inet_sctp, OID_AUTO, cwnd_maxburst, CTLFLAG_RW, 606 &sctp_use_cwnd_based_maxburst, 0, 607 "Use a CWND adjusting maxburst"); 608 609SYSCTL_UINT(_net_inet_sctp, OID_AUTO, early_fast_retran, CTLFLAG_RW, 610 &sctp_early_fr, 0, 611 "Early Fast Retransmit with timer"); 612 613SYSCTL_UINT(_net_inet_sctp, OID_AUTO, deadlock_detect, CTLFLAG_RW, 614 &sctp_says_check_for_deadlock, 0, 615 "SMP Deadlock detection on/off"); 616 617SYSCTL_UINT(_net_inet_sctp, OID_AUTO, early_fast_retran_msec, CTLFLAG_RW, 618 &sctp_early_fr_msec, 0, 619 "Early Fast Retransmit minimum timer value"); 620 621SYSCTL_UINT(_net_inet_sctp, OID_AUTO, asconf_auth_nochk, CTLFLAG_RW, 622 &sctp_asconf_auth_nochk, 0, 623 "Disable SCTP ASCONF AUTH requirement"); 624 625SYSCTL_UINT(_net_inet_sctp, OID_AUTO, auth_disable, CTLFLAG_RW, 626 &sctp_auth_disable, 0, 627 "Disable SCTP AUTH function"); 628 629SYSCTL_UINT(_net_inet_sctp, OID_AUTO, nat_friendly, CTLFLAG_RW, 630 &sctp_nat_friendly, 0, 631 "SCTP NAT friendly operation"); 632 633SYSCTL_INT(_net_inet_sctp, OID_AUTO, abc_l_var, CTLFLAG_RW, 634 &sctp_L2_abc_variable, 0, 635 "SCTP ABC max increase per SACK (L)"); 636 637SYSCTL_INT(_net_inet_sctp, OID_AUTO, max_chained_mbufs, CTLFLAG_RW, 638 &sctp_mbuf_threshold_count, 0, 639 "Default max number of small mbufs on a chain"); 640 641SYSCTL_UINT(_net_inet_sctp, OID_AUTO, cmt_use_dac, CTLFLAG_RW, 642 &sctp_cmt_use_dac, 0, 643 "CMT DAC ON/OFF flag"); 644 645SYSCTL_INT(_net_inet_sctp, OID_AUTO, do_sctp_drain, CTLFLAG_RW, 646 &sctp_do_drain, 0, 647 "Should SCTP respond to the drain calls"); 648 649SYSCTL_INT(_net_inet_sctp, OID_AUTO, hb_max_burst, CTLFLAG_RW, 650 &sctp_hb_maxburst, 0, 651 "Confirmation Heartbeat max burst?"); 652 653SYSCTL_INT(_net_inet_sctp, OID_AUTO, abort_at_limit, CTLFLAG_RW, 654 &sctp_abort_if_one_2_one_hits_limit, 0, 655 "When one-2-one hits qlimit abort"); 656 657SYSCTL_INT(_net_inet_sctp, OID_AUTO, strict_data_order, CTLFLAG_RW, 658 &sctp_strict_data_order, 0, 659 "Enforce strict data ordering, abort if control inside data"); 660 661SYSCTL_STRUCT(_net_inet_sctp, OID_AUTO, stats, CTLFLAG_RW, 662 &sctpstat, sctpstat, 663 "SCTP statistics (struct sctps_stat, netinet/sctp.h"); 664 665SYSCTL_PROC(_net_inet_sctp, OID_AUTO, assoclist, CTLFLAG_RD, 666 0, 0, sctp_assoclist, 667 "S,xassoc", "List of active SCTP associations"); 668 669SYSCTL_INT(_net_inet_sctp, OID_AUTO, min_residual, CTLFLAG_RW, 670 &sctp_min_residual, 0, 671 SCTPCTL_MIN_RESIDUAL_DESC); 672 673SYSCTL_INT(_net_inet_sctp, OID_AUTO, max_retran_chunk, CTLFLAG_RW, 674 &sctp_max_retran_chunk, 0, 675 SCTPCTL_MAX_RETRAN_CHUNK_DESC); 676 677#ifdef SCTP_DEBUG 678SYSCTL_INT(_net_inet_sctp, OID_AUTO, debug, CTLFLAG_RW, 679 &sctp_debug_on, 0, "Configure debug output"); 680#endif /* SCTP_DEBUG */
|