8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright (c) 1990 Mentat Inc.
25 * Copyright (c) 2017 OmniTI Computer Consulting, Inc. All rights reserved.
26 * Copyright (c) 2016 by Delphix. All rights reserved.
27 * Copyright (c) 2019 Joyent, Inc. All rights reserved.
28 */
29
30 #include <sys/types.h>
31 #include <sys/stream.h>
32 #include <sys/dlpi.h>
33 #include <sys/stropts.h>
34 #include <sys/sysmacros.h>
35 #include <sys/strsubr.h>
36 #include <sys/strlog.h>
37 #include <sys/strsun.h>
38 #include <sys/zone.h>
39 #define _SUN_TPI_VERSION 2
40 #include <sys/tihdr.h>
41 #include <sys/xti_inet.h>
42 #include <sys/ddi.h>
43 #include <sys/suntpi.h>
44 #include <sys/cmn_err.h>
45 #include <sys/debug.h>
46 #include <sys/kobj.h>
47 #include <sys/modctl.h>
13958 { "ip_ire_reclaim_deleted", KSTAT_DATA_UINT64 },
13959 { "ip_nce_reclaim_calls", KSTAT_DATA_UINT64 },
13960 { "ip_nce_reclaim_deleted", KSTAT_DATA_UINT64 },
13961 { "ip_nce_mcast_reclaim_calls", KSTAT_DATA_UINT64 },
13962 { "ip_nce_mcast_reclaim_deleted", KSTAT_DATA_UINT64 },
13963 { "ip_nce_mcast_reclaim_tqfail", KSTAT_DATA_UINT64 },
13964 { "ip_dce_reclaim_calls", KSTAT_DATA_UINT64 },
13965 { "ip_dce_reclaim_deleted", KSTAT_DATA_UINT64 },
13966 { "ip_tcp_in_full_hw_cksum_err", KSTAT_DATA_UINT64 },
13967 { "ip_tcp_in_part_hw_cksum_err", KSTAT_DATA_UINT64 },
13968 { "ip_tcp_in_sw_cksum_err", KSTAT_DATA_UINT64 },
13969 { "ip_udp_in_full_hw_cksum_err", KSTAT_DATA_UINT64 },
13970 { "ip_udp_in_part_hw_cksum_err", KSTAT_DATA_UINT64 },
13971 { "ip_udp_in_sw_cksum_err", KSTAT_DATA_UINT64 },
13972 { "conn_in_recvdstaddr", KSTAT_DATA_UINT64 },
13973 { "conn_in_recvopts", KSTAT_DATA_UINT64 },
13974 { "conn_in_recvif", KSTAT_DATA_UINT64 },
13975 { "conn_in_recvslla", KSTAT_DATA_UINT64 },
13976 { "conn_in_recvucred", KSTAT_DATA_UINT64 },
13977 { "conn_in_recvttl", KSTAT_DATA_UINT64 },
13978 { "conn_in_recvhopopts", KSTAT_DATA_UINT64 },
13979 { "conn_in_recvhoplimit", KSTAT_DATA_UINT64 },
13980 { "conn_in_recvdstopts", KSTAT_DATA_UINT64 },
13981 { "conn_in_recvrthdrdstopts", KSTAT_DATA_UINT64 },
13982 { "conn_in_recvrthdr", KSTAT_DATA_UINT64 },
13983 { "conn_in_recvpktinfo", KSTAT_DATA_UINT64 },
13984 { "conn_in_recvtclass", KSTAT_DATA_UINT64 },
13985 { "conn_in_timestamp", KSTAT_DATA_UINT64 },
13986 };
13987
13988 ksp = kstat_create_netstack("ip", 0, "ipstat", "net",
13989 KSTAT_TYPE_NAMED, sizeof (template) / sizeof (kstat_named_t),
13990 KSTAT_FLAG_VIRTUAL, stackid);
13991
13992 if (ksp == NULL)
13993 return (NULL);
13994
13995 bcopy(&template, ip_statisticsp, sizeof (template));
13996 ksp->ks_data = (void *)ip_statisticsp;
13997 ksp->ks_private = (void *)(uintptr_t)stackid;
|
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright (c) 1990 Mentat Inc.
25 * Copyright (c) 2017 OmniTI Computer Consulting, Inc. All rights reserved.
26 * Copyright (c) 2016 by Delphix. All rights reserved.
27 * Copyright (c) 2019 Joyent, Inc. All rights reserved.
28 * Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
29 */
30
31 #include <sys/types.h>
32 #include <sys/stream.h>
33 #include <sys/dlpi.h>
34 #include <sys/stropts.h>
35 #include <sys/sysmacros.h>
36 #include <sys/strsubr.h>
37 #include <sys/strlog.h>
38 #include <sys/strsun.h>
39 #include <sys/zone.h>
40 #define _SUN_TPI_VERSION 2
41 #include <sys/tihdr.h>
42 #include <sys/xti_inet.h>
43 #include <sys/ddi.h>
44 #include <sys/suntpi.h>
45 #include <sys/cmn_err.h>
46 #include <sys/debug.h>
47 #include <sys/kobj.h>
48 #include <sys/modctl.h>
13959 { "ip_ire_reclaim_deleted", KSTAT_DATA_UINT64 },
13960 { "ip_nce_reclaim_calls", KSTAT_DATA_UINT64 },
13961 { "ip_nce_reclaim_deleted", KSTAT_DATA_UINT64 },
13962 { "ip_nce_mcast_reclaim_calls", KSTAT_DATA_UINT64 },
13963 { "ip_nce_mcast_reclaim_deleted", KSTAT_DATA_UINT64 },
13964 { "ip_nce_mcast_reclaim_tqfail", KSTAT_DATA_UINT64 },
13965 { "ip_dce_reclaim_calls", KSTAT_DATA_UINT64 },
13966 { "ip_dce_reclaim_deleted", KSTAT_DATA_UINT64 },
13967 { "ip_tcp_in_full_hw_cksum_err", KSTAT_DATA_UINT64 },
13968 { "ip_tcp_in_part_hw_cksum_err", KSTAT_DATA_UINT64 },
13969 { "ip_tcp_in_sw_cksum_err", KSTAT_DATA_UINT64 },
13970 { "ip_udp_in_full_hw_cksum_err", KSTAT_DATA_UINT64 },
13971 { "ip_udp_in_part_hw_cksum_err", KSTAT_DATA_UINT64 },
13972 { "ip_udp_in_sw_cksum_err", KSTAT_DATA_UINT64 },
13973 { "conn_in_recvdstaddr", KSTAT_DATA_UINT64 },
13974 { "conn_in_recvopts", KSTAT_DATA_UINT64 },
13975 { "conn_in_recvif", KSTAT_DATA_UINT64 },
13976 { "conn_in_recvslla", KSTAT_DATA_UINT64 },
13977 { "conn_in_recvucred", KSTAT_DATA_UINT64 },
13978 { "conn_in_recvttl", KSTAT_DATA_UINT64 },
13979 { "conn_in_recvtos", KSTAT_DATA_UINT64 },
13980 { "conn_in_recvhopopts", KSTAT_DATA_UINT64 },
13981 { "conn_in_recvhoplimit", KSTAT_DATA_UINT64 },
13982 { "conn_in_recvdstopts", KSTAT_DATA_UINT64 },
13983 { "conn_in_recvrthdrdstopts", KSTAT_DATA_UINT64 },
13984 { "conn_in_recvrthdr", KSTAT_DATA_UINT64 },
13985 { "conn_in_recvpktinfo", KSTAT_DATA_UINT64 },
13986 { "conn_in_recvtclass", KSTAT_DATA_UINT64 },
13987 { "conn_in_timestamp", KSTAT_DATA_UINT64 },
13988 };
13989
13990 ksp = kstat_create_netstack("ip", 0, "ipstat", "net",
13991 KSTAT_TYPE_NAMED, sizeof (template) / sizeof (kstat_named_t),
13992 KSTAT_FLAG_VIRTUAL, stackid);
13993
13994 if (ksp == NULL)
13995 return (NULL);
13996
13997 bcopy(&template, ip_statisticsp, sizeof (template));
13998 ksp->ks_data = (void *)ip_statisticsp;
13999 ksp->ks_private = (void *)(uintptr_t)stackid;
|