1sip_enable_counterSse(s3sSiIoPn)Initiation Protocol Library Fsuinpc_teinoanbsle_counters(3SIP)
2
3
4
6 sip_enable_counters, sip_disable_counters, sip_get_counter_value -
7 counter operations
8
10 cc [ flag... ] file... -lsip [ library... ]
11 #include <sip.h>
12
13 int sip_enable_counters(int counter_group);
14
15
16 int sip_disable_counters(int counter_group);
17
18
19 int sip_get_counter_value(int group, int counter, void *counterval,
20 size_t counterlen);
21
22
24 The sip_enable_counters() function enables the measurement and counting
25 of the selected counter group. The only allowed value for the
26 counter_group is SIP_TRAFFIC_COUNTERS, which is defined in <sip.h>.
27 Once enabled, the SIP stack starts measuring end-to-end SIP traffic.
28 The SIP stack keeps track of:
29
30 o the number of SIP requests sent and received (broken down by
31 methods),
32
33 o the number of SIP responses sent and received (broken down
34 by response codes), and
35
36 o the number of bytes sent and received.
37
38
39 The following counters are defined in <sip.h> for the SIP_TRAFFIC_COUN‐
40 TERS group. These counter values are retrieved using the
41 sip_get_counter_value() function.
42
43 SIP_TOTAL_BYTES_RCVD
44 SIP_TOTAL_BYTES_SENT
45 SIP_TOTAL_REQ_RCVD
46 SIP_TOTAL_REQ_SENT
47 SIP_TOTAL_RESP_RCVD
48 SIP_TOTAL_RESP_SENT
49 SIP_ACK_REQ_RCVD
50 SIP_ACK_REQ_SENT
51 SIP_BYE_REQ_RCVD
52 SIP_BYE_REQ_SENT
53 SIP_CANCEL_REQ_RCVD
54 SIP_CANCEL_REQ_SENT
55 SIP_INFO_REQ_RCVD
56 SIP_INFO_REQ_SENT
57 SIP_INVITE_REQ_RCVD
58 SIP_INVITE_REQ_SENT
59 SIP_NOTIFY_REQ_RCVD
60 SIP_NOTIFY_REQ_SENT
61 SIP_OPTIONS_REQ_RCVD
62 SIP_OPTIONS_REQ_SENT
63 SIP_PRACK_REQ_RCVD
64 SIP_PRACK_REQ_SENT
65 SIP_REFER_REQ_RCVD
66 SIP_REFER_REQ_SENT
67 SIP_REGISTER_REQ_RCVD
68 SIP_REGISTER_REQ_SENT
69 SIP_SUBSCRIBE_REQ_RCVD
70 SIP_SUBSCRIBE_REQ_SENT
71 SIP_UPDATE_REQ_RCVD
72 SIP_UPDATE_REQ_SENT
73 SIP_1XX_RESP_RCVD
74 SIP_1XX_RESP_SENT
75 SIP_2XX_RESP_RCVD
76 SIP_2XX_RESP_SENT
77 SIP_3XX_RESP_RCVD
78 SIP_3XX_RESP_SENT
79 SIP_4XX_RESP_RCVD
80 SIP_4XX_RESP_SENT
81 SIP_5XX_RESP_RCVD
82 SIP_5XX_RESP_SENT
83 SIP_6XX_RESP_RCVD
84 SIP_6xx_RESP_SENT
85 SIP_COUNTER_START_TIME /* records time when counting was enabled */
86 SIP_COUNTER_STOP_TIME /* records time when counting was disabled */
87
88
89
90 All of the above counters are defined to be uint64_t, except for
91 SIP_COUNTER_START_TIME and SIP_COUNTER_STOP_TIME, which are defined to
92 be time_t.
93
94
95 The sip_disable_counters() function disables measurement and counting
96 for the specified counter_group. When disabled, the counter values are
97 not reset and are retained until the measurement is enabled again.
98 Calling sip_enable_counters() again would reset all counter values to
99 zero and counting would start afresh.
100
101
102 The sip_get_counter_value() function retrieves the value of the speci‐
103 fied counter within the specified counter group. The value is copied to
104 the user provided buffer, counterval, of length counterlen. For exam‐
105 ple, after the following call, invite_rcvd would have the correct
106 value.
107
108 uint64_t invite_rcvd;
109
110 sip_get_counter_value(SIP_TRAFFIC_COUNTERS, SIP_INVITE_REQ_RCVD,
111 &invite_rcvd, sizeof (uint64_t));
112
113
115 Upon successful completion, sip_enable_counters() and sip_disable_coun‐
116 ters() return 0. They will return EINVAL if an incorrect group is spec‐
117 ified.
118
119
120 Upon successful completion, sip_get_counter_value() returns 0. It
121 returns EINVAL if an incorrect counter name or counter size is speci‐
122 fied, or if counterval is NULL.
123
125 See attributes(5) for descriptions of the following attributes:
126
127
128
129
130 ┌─────────────────────────────┬─────────────────────────────┐
131 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
132 ├─────────────────────────────┼─────────────────────────────┤
133 │Interface Stability │Committed │
134 ├─────────────────────────────┼─────────────────────────────┤
135 │MT-Level │MT-Safe │
136 └─────────────────────────────┴─────────────────────────────┘
137
139 attributes(5)
140
141
142
143SunOS 5.11 11 Jan 2008 sip_enable_counters(3SIP)