Go to main content

man pages section 9: DDI and DKI Kernel Functions

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

net_kstat2_create (9F)

Name

net_kstat2_create - create and initialize a new kstat for a specific instance of IP

Synopsis

#include <sys/types.h>
#include <sys/kstat2.h>
#include <sys/neti.h>

kstat2_t *net_kstat2_create(netid_t netid, const char *pseg[],
    uchar_t npseg, kstat2_named_t *data,
    ulong_t ndata, uchar_t ks_flag, const kstat2_md_t *metadata,
    const char *desc, kstat2_metaflag_t mflags);

Interface Level

Solaris DDI specific (Solaris DDI)

Parameters

netid

IP instance identifier.

pseg

Array of character strings representing the kstat's path. Each segment of the kstat's path is one element of the array.

npseg

The number of elements in the pseg array.

data

Array of name-value pair data for this kstat or NULL. If NULL, the kstat's framework will allocate storage for this kstat's data which is initialized using kstat2_nv_init(9F) prior to the kstat being installed by a call to kstat2_install(9F). If an array is passed, it must contain ndata elements.

ndata

The number of records in the data array or the number of kstat2_named(9S) structures to allocate if data is NULL.

ks_flag

A bit-field of various flags for this kstat. This may be zero or:

KSTAT2_FLAG_PERSISTENT

Indicates that this kstat is persistent over time. For persistent kstats, kstat2_delete(9F) simply marks the kstat as dormant; a subsequent kstat2_create() function reactivates the kstat. This feature is provided so that statistics are not lost across driver close/open (such as raw disk I/O on a disk with no mounted partitions.)

metadata

Array of metadata for the values in the kstat's data.

desc

Brief description of the kstat's purpose.

mflags

Metadata flags. Either KSTAT2_MF_NONE or:

KSTAT2_MF_STABLE

Indicates that this kstat will not be removed in Oracle Solaris release without prior notification.

Description

The net_kstat2_create() function allocates and initializes a kstat2(9S) structure. See kstat2_create(9F) function for a complete discussion of kstat creation.

Return Values

If successful, the net_kstat2_create() function returns a pointer to the allocated kstat. NULL is returned upon failure.

Context

The net_kstat2_create() function can be called from user or kernel context.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/core-os
Interface Stability
Committed

See Also

kstat2_create(9F), kstat2_delete(9F), kstat2_install(9F), kstat2_nv_init(9F), net_kstat2_delete(9F), kstat2_md(9S), kstat2_named(9S)