Print this page
10052 "dladm show-ether" should pick one kstat snapshot and stick with it
Reviewed by: Rob Johnston <rob.johnston@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Gergo Doma <domag02@gmail.com>
Reviewed by: Andy Fiddaman <andy@omniosce.org>


   6  * You may not use this file except in compliance with the License.
   7  *
   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  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 




  26 #ifndef _LIBDLSTAT_H
  27 #define _LIBDLSTAT_H
  28 
  29 /*
  30  * This file includes structures, macros and common routines shared by all
  31  * data-link administration, and routines which are used to retrieve and
  32  * display statistics.
  33  */
  34 
  35 #include <kstat.h>
  36 
  37 #ifdef  __cplusplus
  38 extern "C" {
  39 #endif
  40 
  41 #define LINK_REPORT     1
  42 #define FLOW_REPORT     2
  43 
  44 #define DLSTAT_INVALID_ENTRY    -1
  45 #define MAXSTATNAMELEN  256


 262 } pktsum_t;
 263 
 264 extern kstat_t          *dladm_kstat_lookup(kstat_ctl_t *, const char *, int,
 265                             const char *, const char *);
 266 extern void             dladm_get_stats(kstat_ctl_t *, kstat_t *, pktsum_t *);
 267 extern int              dladm_kstat_value(kstat_t *, const char *, uint8_t,
 268                             void *);
 269 extern dladm_status_t   dladm_get_single_mac_stat(dladm_handle_t, datalink_id_t,
 270                             const char *, uint8_t, void *);
 271 
 272 extern void             dladm_stats_total(pktsum_t *, pktsum_t *, pktsum_t *);
 273 extern void             dladm_stats_diff(pktsum_t *, pktsum_t *, pktsum_t *);
 274 
 275 extern dladm_stat_chain_t       *dladm_link_stat_query(dladm_handle_t,
 276                                     datalink_id_t, dladm_stat_type_t);
 277 extern dladm_stat_chain_t       *dladm_link_stat_diffchain(dladm_stat_chain_t *,
 278                                     dladm_stat_chain_t *, dladm_stat_type_t);
 279 extern dladm_stat_chain_t       *dladm_link_stat_query_all(dladm_handle_t,
 280                                     datalink_id_t, dladm_stat_type_t);
 281 
 282 extern flow_stat_t              *dladm_flow_stat_query(const char *);

 283 extern flow_stat_t              *dladm_flow_stat_diff(flow_stat_t *,
 284                                     flow_stat_t *);
 285 extern name_value_stat_entry_t  *dladm_flow_stat_query_all(const char *);

 286 
 287 #ifdef  __cplusplus
 288 }
 289 #endif
 290 
 291 #endif  /* _LIBDLSTAT_H */


   6  * You may not use this file except in compliance with the License.
   7  *
   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  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 /*
  27  * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
  28  */
  29 
  30 #ifndef _LIBDLSTAT_H
  31 #define _LIBDLSTAT_H
  32 
  33 /*
  34  * This file includes structures, macros and common routines shared by all
  35  * data-link administration, and routines which are used to retrieve and
  36  * display statistics.
  37  */
  38 
  39 #include <kstat.h>
  40 
  41 #ifdef  __cplusplus
  42 extern "C" {
  43 #endif
  44 
  45 #define LINK_REPORT     1
  46 #define FLOW_REPORT     2
  47 
  48 #define DLSTAT_INVALID_ENTRY    -1
  49 #define MAXSTATNAMELEN  256


 266 } pktsum_t;
 267 
 268 extern kstat_t          *dladm_kstat_lookup(kstat_ctl_t *, const char *, int,
 269                             const char *, const char *);
 270 extern void             dladm_get_stats(kstat_ctl_t *, kstat_t *, pktsum_t *);
 271 extern int              dladm_kstat_value(kstat_t *, const char *, uint8_t,
 272                             void *);
 273 extern dladm_status_t   dladm_get_single_mac_stat(dladm_handle_t, datalink_id_t,
 274                             const char *, uint8_t, void *);
 275 
 276 extern void             dladm_stats_total(pktsum_t *, pktsum_t *, pktsum_t *);
 277 extern void             dladm_stats_diff(pktsum_t *, pktsum_t *, pktsum_t *);
 278 
 279 extern dladm_stat_chain_t       *dladm_link_stat_query(dladm_handle_t,
 280                                     datalink_id_t, dladm_stat_type_t);
 281 extern dladm_stat_chain_t       *dladm_link_stat_diffchain(dladm_stat_chain_t *,
 282                                     dladm_stat_chain_t *, dladm_stat_type_t);
 283 extern dladm_stat_chain_t       *dladm_link_stat_query_all(dladm_handle_t,
 284                                     datalink_id_t, dladm_stat_type_t);
 285 
 286 extern flow_stat_t              *dladm_flow_stat_query(dladm_handle_t,
 287                                     const char *);
 288 extern flow_stat_t              *dladm_flow_stat_diff(flow_stat_t *,
 289                                     flow_stat_t *);
 290 extern name_value_stat_entry_t  *dladm_flow_stat_query_all(dladm_handle_t,
 291                                     const char *);
 292 
 293 #ifdef  __cplusplus
 294 }
 295 #endif
 296 
 297 #endif  /* _LIBDLSTAT_H */