blob: 8d6d294cc1f059dd8cd65fda9cd26305691d7157 [file] [log] [blame]
define sctp_allasocs
set $_inp=system_base_info.sctppcbinfo.listhead.lh_first
while ( $_inp != 0 )
set $_asoc=$_inp->sctp_asoc_list.lh_first
while ( $_asoc != 0)
print $_asoc
set $_asoc=$_asoc->sctp_tcblist.le_next
end
set $_inp=$_inp->sctp_list.le_next
end
end
document sctp_allasocs
Show all SCTP associations
end
define sctp_allasocslock
set $_inp=system_base_info.sctppcbinfo.listhead.lh_first
while ( $_inp != 0 )
set $_asoc=$_inp->sctp_asoc_list.lh_first
while ( $_asoc != 0)
if ( $_asoc->tcb_mtx.mtx_lock != 4 )
print $_asoc
print $_asoc->tcb_mtx.mtx_lock
end
set $_asoc=$_asoc->sctp_tcblist.le_next
end
set $_inp=$_inp->sctp_list.le_next
end
end
document sctp_allasocslock
Show all SCTP associations with locks
end
define sctp_allcallouts
set $_c=system_base_info.sctppcbinfo.callqueue.tqh_first
while ( $_c != 0 )
print $_c
set $_c=$_c->tqe.tqe_next
end
end
document sctp_allcallouts
Show all SCTP callouts
end
define sctp_findep
set $_inp=system_base_info.sctppcbinfo.listhead.lh_first
while ( $_inp != 0 )
if ($_inp->ip_inp.inp.inp_inc.inc_ie.ie_lport == $arg0)
print $_inp
set $_inp=0
else
set $_inp=$_inp->sctp_list.le_next
end
end
end
document sctp_findep
find an SCTP endpoint and print it out as a variable for use
end
define sctp_allep_wrefcnt
set $_inp=system_base_info.sctppcbinfo.listhead.lh_first
while ( $_inp != 0 )
if ( $_inp->refcount > 0 )
print $_inp
end
set $_inp=$_inp->sctp_list.le_next
end
end
document sctp_allep_wrefcnt
Show all SCTP endpoints with refcount > 0
end
define sctp_findasoc
set $_inp=system_base_info.sctppcbinfo.listhead.lh_first
while ( $_inp != 0 )
if ($_inp->ip_inp.inp.inp_inc.inc_ie.ie_lport == $arg0)
print $_inp
set $_asoc=$_inp->sctp_asoc_list.lh_first
while ( $_asoc != 0)
if ($_asoc->rport == $arg1)
print $_asoc
set $_asoc=0
else
set $_asoc=$_asoc->sctp_tcblist.le_next
end
end
set $_inp=0
else
set $_inp=$_inp->sctp_list.le_next
end
end
end
document sctp_findasoc
Find an SCTP association srcport dstport
end
#
# Helper macro for allasoc macro
# change this to look at different things in the arg0 stcb.
#
define sctp_interesting
printf "asociation %X\n", $arg0
printf "output_q_size %d\n", $arg0->asoc.total_output_queue_size
printf "size on streams %d\n", $arg0->asoc.size_on_all_streams
printf "size on reasm %d\n", $arg0->asoc.size_on_reasm_queue
printf "send q cnt %d\n", $arg0->asoc.send_queue_cnt
printf "sent q cnt %d\n", $arg0->asoc.sent_queue_cnt
printf "ctrl q %x\n", $arg0->asoc.control_send_queue.tqh_first
end
document sctp_interesting
The interesting stuff I want to show on an sctp_allasoc command
end
define sctp_allasoc
set $_inp=system_base_info.sctppcbinfo.listhead.lh_first
while ( $_inp != 0 )
set $_asoc=$_inp->sctp_asoc_list.lh_first
while ( $_asoc != 0)
sctp_interesting $_asoc
set $_asoc=$_asoc->sctp_tcblist.le_next
end
set $_inp=$_inp->sctp_list.le_next
end
end
document sctp_allasoc
Show some things on all SCTP associations
end
define sctp_allep
set $_inp=system_base_info.sctppcbinfo.listhead.lh_first
while ( $_inp != 0 )
print $_inp
set $_inp=$_inp->sctp_list.le_next
end
end
document sctp_allep
Show all SCTP endpoints
end
define sctp_allepflags
set $_inp=system_base_info.sctppcbinfo.listhead.lh_first
while ( $_inp != 0 )
printf "%X ", $_inp
printf "State %X\n", $_inp->sctp_flags
set $_inp=$_inp->sctp_list.le_next
end
end
document sctp_allepflags
Show all SCTP endpoints sctp_flags
end
define sctp_allepports
set $_inp=system_base_info.sctppcbinfo.listhead.lh_first
while ( $_inp != 0 )
print $_inp->ip_inp.inp.inp_inc.inc_ie.ie_lport
set $_inp=$_inp->sctp_list.le_next
end
end
document sctp_allepports
Show all SCTP endpoint port numbers
end
define sctp_findepports
set $_inp=system_base_info.sctppcbinfo.listhead.lh_first
while ( $_inp != 0 )
if ( $arg0 == $_inp->ip_inp.inp.inp_inc.inc_ie.ie_lport )
print $_inp
set $_inp=0
else
set $_inp=$_inp->sctp_list.le_next
end
end
end
document sctp_findepports
find an SCTP endpoint by port number
end
define sctp_allreadq
set $_inp=system_base_info.sctppcbinfo.listhead.lh_first
while ( $_inp != 0 )
print $_inp->read_queue.tqh_first
set $_inp=$_inp->sctp_list.le_next
end
end
document sctp_allreadq
Show all SCTP endpoint read queues
end
define sctp_showfreechks
set $_stcb=$arg0
set $chk=$_stcb->asoc.free_chunks.tqh_first
while ( $chk != 0 )
printf "chk:%X strm:%d seq:%d fastre:%x TSN:%x\n", \
$chk, \
$chk->rec.data.stream_number, \
$chk->rec.data.stream_seq, \
$chk->rec.data.fast_retran_tsn, \
$chk->rec.data.TSN_seq
set $chk=$chk->sctp_next.tqe_next
end
end
document sctp_showfreechks
Show free chunks in an association
end
define sctp_showfreesnd
set $_stcb=$arg0
set $sndq=$_stcb->asoc.free_strmoq.tqh_first
while ( $sndq != 0 )
printf "stream:%d seq:%d complete:%d\n", $sndq->stream, $sndq->strseq, $sndq->msg_is_complete
set $sndq=$sndq->next.tqe_next
end
end
document sctp_showfreesnd
Show free strm send entries
end
define sctp_showpacketlog
set $_at=packet_log_start
set $_end=packet_log_end
set $_ipoint=(int *)(&packet_log_buffer[$_at])
while ( $_at < $_end )
set $_val=*$_ipoint
printf "at:%d size:%d\n", $_at, $_val
set $_newval=$_val + $_at
set $_at=$_newval
set $_ipoint=(int *)(&packet_log_buffer[$_at])
end
end
document sctp_showpacketlog
walk the packet log
end
define sctp_showsentq
set $_stcb=$arg0
set $chk=$_stcb->asoc.sent_queue.tqh_first
while ( $chk != 0 )
printf "chk:%X strm:%d seq:%d TSN:%x sent:%d size:%d\n", \
$chk, \
$chk->rec.data.stream_number, \
$chk->rec.data.stream_seq, \
$chk->rec.data.TSN_seq, \
$chk->sent, \
$chk->send_size
set $chk=$chk->sctp_next.tqe_next
end
end
document sctp_showsentq
Show sent values in sent_queue
end