246 sctpkp->sctpInSCTPPkts.value.i64 = sctp_mib.sctpInSCTPPkts;
247 sctpkp->sctpInInvalidCookie.value.i32 = sctp_mib.sctpInInvalidCookie;
248 sctpkp->sctpTimRetrans.value.i32 = sctp_mib.sctpTimRetrans;
249 sctpkp->sctpTimRetransDrop.value.i32 = sctp_mib.sctpTimRetransDrop;
250 sctpkp->sctpTimHeartBeatProbe.value.i32 =
251 sctp_mib.sctpTimHeartBeatProbe;
252 sctpkp->sctpTimHeartBeatDrop.value.i32 = sctp_mib.sctpTimHeartBeatDrop;
253 sctpkp->sctpListenDrop.value.i32 = sctp_mib.sctpListenDrop;
254 sctpkp->sctpInClosed.value.i32 = sctp_mib.sctpInClosed;
255
256 netstack_rele(ns);
257 return (0);
258 }
259
260 void *
261 sctp_kstat_init(netstackid_t stackid)
262 {
263 kstat_t *ksp;
264
265 sctp_named_kstat_t template = {
266 { "sctpRtoAlgorithm", KSTAT_DATA_INT32, 0 },
267 { "sctpRtoMin", KSTAT_DATA_UINT32, 0 },
268 { "sctpRtoMax", KSTAT_DATA_UINT32, 0 },
269 { "sctpRtoInitial", KSTAT_DATA_UINT32, 0 },
270 { "sctpMaxAssocs", KSTAT_DATA_INT32, 0 },
271 { "sctpValCookieLife", KSTAT_DATA_UINT32, 0 },
272 { "sctpMaxInitRetr", KSTAT_DATA_UINT32, 0 },
273 { "sctpCurrEstab", KSTAT_DATA_INT32, 0 },
274 { "sctpActiveEstab", KSTAT_DATA_INT32, 0 },
275 { "sctpPassiveEstab", KSTAT_DATA_INT32, 0 },
276 { "sctpAborted", KSTAT_DATA_INT32, 0 },
277 { "sctpShutdowns", KSTAT_DATA_INT32, 0 },
278 { "sctpOutOfBlue", KSTAT_DATA_INT32, 0 },
279 { "sctpChecksumError", KSTAT_DATA_INT32, 0 },
280 { "sctpOutCtrlChunks", KSTAT_DATA_INT64, 0 },
281 { "sctpOutOrderChunks", KSTAT_DATA_INT64, 0 },
282 { "sctpOutUnorderChunks", KSTAT_DATA_INT64, 0 },
283 { "sctpRetransChunks", KSTAT_DATA_INT64, 0 },
284 { "sctpOutAck", KSTAT_DATA_INT32, 0 },
285 { "sctpOutAckDelayed", KSTAT_DATA_INT32, 0 },
286 { "sctpOutWinUpdate", KSTAT_DATA_INT32, 0 },
287 { "sctpOutFastRetrans", KSTAT_DATA_INT32, 0 },
288 { "sctpOutWinProbe", KSTAT_DATA_INT32, 0 },
289 { "sctpInCtrlChunks", KSTAT_DATA_INT64, 0 },
290 { "sctpInOrderChunks", KSTAT_DATA_INT64, 0 },
291 { "sctpInUnorderChunks", KSTAT_DATA_INT64, 0 },
292 { "sctpInAck", KSTAT_DATA_INT32, 0 },
293 { "sctpInDupAck", KSTAT_DATA_INT32, 0 },
294 { "sctpInAckUnsent", KSTAT_DATA_INT32, 0 },
295 { "sctpFragUsrMsgs", KSTAT_DATA_INT64, 0 },
296 { "sctpReasmUsrMsgs", KSTAT_DATA_INT64, 0 },
297 { "sctpOutSCTPPkts", KSTAT_DATA_INT64, 0 },
298 { "sctpInSCTPPkts", KSTAT_DATA_INT64, 0 },
299 { "sctpInInvalidCookie", KSTAT_DATA_INT32, 0 },
300 { "sctpTimRetrans", KSTAT_DATA_INT32, 0 },
301 { "sctpTimRetransDrop", KSTAT_DATA_INT32, 0 },
302 { "sctpTimHearBeatProbe", KSTAT_DATA_INT32, 0 },
303 { "sctpTimHearBeatDrop", KSTAT_DATA_INT32, 0 },
304 { "sctpListenDrop", KSTAT_DATA_INT32, 0 },
305 { "sctpInClosed", KSTAT_DATA_INT32, 0 }
306 };
307
308 ksp = kstat_create_netstack(SCTP_MOD_NAME, 0, "sctp", "mib2",
309 KSTAT_TYPE_NAMED, NUM_OF_FIELDS(sctp_named_kstat_t), 0, stackid);
310
311 if (ksp == NULL)
312 return (NULL);
313
314 /* These won't change. */
315 template.sctpRtoAlgorithm.value.i32 = MIB2_SCTP_RTOALGO_VANJ;
316 template.sctpMaxAssocs.value.i32 = -1;
317
318 bcopy(&template, ksp->ks_data, sizeof (template));
319 ksp->ks_update = sctp_kstat_update;
320 ksp->ks_private = (void *)(uintptr_t)stackid;
321
322 kstat_install(ksp);
323 return (ksp);
324 }
325
|
246 sctpkp->sctpInSCTPPkts.value.i64 = sctp_mib.sctpInSCTPPkts;
247 sctpkp->sctpInInvalidCookie.value.i32 = sctp_mib.sctpInInvalidCookie;
248 sctpkp->sctpTimRetrans.value.i32 = sctp_mib.sctpTimRetrans;
249 sctpkp->sctpTimRetransDrop.value.i32 = sctp_mib.sctpTimRetransDrop;
250 sctpkp->sctpTimHeartBeatProbe.value.i32 =
251 sctp_mib.sctpTimHeartBeatProbe;
252 sctpkp->sctpTimHeartBeatDrop.value.i32 = sctp_mib.sctpTimHeartBeatDrop;
253 sctpkp->sctpListenDrop.value.i32 = sctp_mib.sctpListenDrop;
254 sctpkp->sctpInClosed.value.i32 = sctp_mib.sctpInClosed;
255
256 netstack_rele(ns);
257 return (0);
258 }
259
260 void *
261 sctp_kstat_init(netstackid_t stackid)
262 {
263 kstat_t *ksp;
264
265 sctp_named_kstat_t template = {
266 { "sctpRtoAlgorithm", KSTAT_DATA_INT32, {{0}} },
267 { "sctpRtoMin", KSTAT_DATA_UINT32, {{0}} },
268 { "sctpRtoMax", KSTAT_DATA_UINT32, {{0}} },
269 { "sctpRtoInitial", KSTAT_DATA_UINT32, {{0}} },
270 { "sctpMaxAssocs", KSTAT_DATA_INT32, {{0}} },
271 { "sctpValCookieLife", KSTAT_DATA_UINT32, {{0}} },
272 { "sctpMaxInitRetr", KSTAT_DATA_UINT32, {{0}} },
273 { "sctpCurrEstab", KSTAT_DATA_INT32, {{0}} },
274 { "sctpActiveEstab", KSTAT_DATA_INT32, {{0}} },
275 { "sctpPassiveEstab", KSTAT_DATA_INT32, {{0}} },
276 { "sctpAborted", KSTAT_DATA_INT32, {{0}} },
277 { "sctpShutdowns", KSTAT_DATA_INT32, {{0}} },
278 { "sctpOutOfBlue", KSTAT_DATA_INT32, {{0}} },
279 { "sctpChecksumError", KSTAT_DATA_INT32, {{0}} },
280 { "sctpOutCtrlChunks", KSTAT_DATA_INT64, {{0}} },
281 { "sctpOutOrderChunks", KSTAT_DATA_INT64, {{0}} },
282 { "sctpOutUnorderChunks", KSTAT_DATA_INT64, {{0}} },
283 { "sctpRetransChunks", KSTAT_DATA_INT64, {{0}} },
284 { "sctpOutAck", KSTAT_DATA_INT32, {{0}} },
285 { "sctpOutAckDelayed", KSTAT_DATA_INT32, {{0}} },
286 { "sctpOutWinUpdate", KSTAT_DATA_INT32, {{0}} },
287 { "sctpOutFastRetrans", KSTAT_DATA_INT32, {{0}} },
288 { "sctpOutWinProbe", KSTAT_DATA_INT32, {{0}} },
289 { "sctpInCtrlChunks", KSTAT_DATA_INT64, {{0}} },
290 { "sctpInOrderChunks", KSTAT_DATA_INT64, {{0}} },
291 { "sctpInUnorderChunks", KSTAT_DATA_INT64, {{0}} },
292 { "sctpInAck", KSTAT_DATA_INT32, {{0}} },
293 { "sctpInDupAck", KSTAT_DATA_INT32, {{0}} },
294 { "sctpInAckUnsent", KSTAT_DATA_INT32, {{0}} },
295 { "sctpFragUsrMsgs", KSTAT_DATA_INT64, {{0}} },
296 { "sctpReasmUsrMsgs", KSTAT_DATA_INT64, {{0}} },
297 { "sctpOutSCTPPkts", KSTAT_DATA_INT64, {{0}} },
298 { "sctpInSCTPPkts", KSTAT_DATA_INT64, {{0}} },
299 { "sctpInInvalidCookie", KSTAT_DATA_INT32, {{0}} },
300 { "sctpTimRetrans", KSTAT_DATA_INT32, {{0}} },
301 { "sctpTimRetransDrop", KSTAT_DATA_INT32, {{0}} },
302 { "sctpTimHearBeatProbe", KSTAT_DATA_INT32, {{0}} },
303 { "sctpTimHearBeatDrop", KSTAT_DATA_INT32, {{0}} },
304 { "sctpListenDrop", KSTAT_DATA_INT32, {{0}} },
305 { "sctpInClosed", KSTAT_DATA_INT32, {{0}} }
306 };
307
308 ksp = kstat_create_netstack(SCTP_MOD_NAME, 0, "sctp", "mib2",
309 KSTAT_TYPE_NAMED, NUM_OF_FIELDS(sctp_named_kstat_t), 0, stackid);
310
311 if (ksp == NULL)
312 return (NULL);
313
314 /* These won't change. */
315 template.sctpRtoAlgorithm.value.i32 = MIB2_SCTP_RTOALGO_VANJ;
316 template.sctpMaxAssocs.value.i32 = -1;
317
318 bcopy(&template, ksp->ks_data, sizeof (template));
319 ksp->ks_update = sctp_kstat_update;
320 ksp->ks_private = (void *)(uintptr_t)stackid;
321
322 kstat_install(ksp);
323 return (ksp);
324 }
325
|