2 .\" Copyright (c) 2008, Sun Microsystems Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH SIP_ENABLE_COUNTERS 3SIP "Jan 11, 2008"
8 sip_enable_counters, sip_disable_counters, sip_get_counter_value \- counter
13 \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... -\fBlsip\fR [ \fIlibrary\fR... ]
16 \fBint\fR \fBsip_enable_counters\fR(\fBint\fR \fIcounter_group\fR);
21 \fBint\fR \fBsip_disable_counters\fR(\fBint\fR \fIcounter_group\fR);
26 \fBint\fR \fBsip_get_counter_value\fR(\fBint\fR \fIgroup\fR, \fBint\fR \fIcounter\fR, \fBvoid *\fR\fIcounterval\fR,
27 \fBsize_t\fR \fIcounterlen\fR);
33 The \fBsip_enable_counters()\fR function enables the measurement and counting
34 of the selected counter group. The only allowed value for the
35 \fIcounter_group\fR is \fBSIP_TRAFFIC_COUNTERS\fR, which is defined in
36 \fB<sip.h>\fR. Once enabled, the SIP stack starts measuring end-to-end SIP
37 traffic. The SIP stack keeps track of:
42 the number of SIP requests sent and received (broken down by methods),
48 the number of SIP responses sent and received (broken down by response codes),
55 the number of bytes sent and received.
59 The following counters are defined in \fB<sip.h>\fR for the
60 \fBSIP_TRAFFIC_COUNTERS\fR group. These counter values are retrieved using the
61 \fBsip_get_counter_value()\fR function.
91 SIP_SUBSCRIBE_REQ_RCVD
92 SIP_SUBSCRIBE_REQ_SENT
107 SIP_COUNTER_START_TIME /* records time when counting was enabled */
108 SIP_COUNTER_STOP_TIME /* records time when counting was disabled */
114 All of the above counters are defined to be \fBuint64_t\fR, except for
115 \fBSIP_COUNTER_START_TIME\fR and \fBSIP_COUNTER_STOP_TIME\fR, which are defined
119 The \fBsip_disable_counters()\fR function disables measurement and counting for
120 the specified \fIcounter_group\fR. When disabled, the counter values are not
121 reset and are retained until the measurement is enabled again. Calling
122 \fBsip_enable_counters()\fR again would reset all counter values to zero and
123 counting would start afresh.
126 The \fBsip_get_counter_value()\fR function retrieves the value of the specified
127 counter within the specified counter group. The value is copied to the user
128 provided buffer, \fIcounterval\fR, of length \fIcounterlen\fR. For example,
129 after the following call, \fIinvite_rcvd\fR would have the correct value.
133 uint64_t invite_rcvd;
135 sip_get_counter_value(SIP_TRAFFIC_COUNTERS, SIP_INVITE_REQ_RCVD,
136 &invite_rcvd, sizeof (uint64_t));
143 Upon successful completion, \fBsip_enable_counters()\fR and
144 \fBsip_disable_counters()\fR return 0. They will return \fBEINVAL\fR if an
145 incorrect group is specified.
148 Upon successful completion, \fBsip_get_counter_value()\fR returns 0. It
149 returns \fBEINVAL\fR if an incorrect counter name or counter size is specified,
150 or if \fIcounterval\fR is \fINULL\fR.
154 See \fBattributes\fR(5) for descriptions of the following attributes:
162 ATTRIBUTE TYPE ATTRIBUTE VALUE
164 Interface Stability Committed