libdlstat.h revision 0dc2366f7b9f9f36e10909b1e95edbf2a261c2ac
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _LIBDLSTAT_H
#define _LIBDLSTAT_H
/*
* This file includes structures, macros and common routines shared by all
* data-link administration, and routines which are used to retrieve and
* display statistics.
*/
#include <kstat.h>
#ifdef __cplusplus
extern "C" {
#endif
#define LINK_REPORT 1
#define FLOW_REPORT 2
#define DLSTAT_INVALID_ENTRY -1
#define MAXSTATNAMELEN 256
/*
* Definitions common to all stats
*/
typedef struct dladm_stat_chain_s {
char dc_statheader[MAXSTATNAMELEN];
void *dc_statentry;
struct dladm_stat_chain_s *dc_next;
typedef enum {
DLADM_STAT_RX_LANE = 0, /* Per lane rx stats */
DLADM_STAT_TX_LANE, /* Per lane tx stats */
DLADM_STAT_RX_LANE_TOTAL, /* Stats summed across all rx lanes */
DLADM_STAT_TX_LANE_TOTAL, /* Stats summed across all tx lanes */
DLADM_STAT_RX_LANE_FOUT, /* Per fanout (rx lane) stats */
DLADM_STAT_RX_RING, /* Per ring rx stats */
DLADM_STAT_TX_RING, /* Per ring tx stats */
DLADM_STAT_RX_RING_TOTAL, /* Stats summed across all rx rings */
DLADM_STAT_TX_RING_TOTAL, /* Stats summed across all tx rings */
DLADM_STAT_TOTAL, /* Summary view */
DLADM_STAT_AGGR_PORT, /* Aggr port stats */
DLADM_STAT_MISC, /* Misc stats */
DLADM_STAT_NUM_STATS /* This must always be the last entry */
/*
* Definitions for rx lane stats
*/
typedef struct rx_lane_stat_s {
typedef enum {
} lane_type_t;
typedef struct rx_lane_stat_entry_s {
/*
* Definitions for tx lane stats
*/
typedef struct tx_lane_stat_s {
typedef struct tx_lane_stat_entry_s {
/*
*/
typedef struct misc_stat_s {
} misc_stat_t;
/*
* To be consistent with other stat entries, misc stat
* is wrapped in stat entry
*/
typedef struct misc_stat_entry_s {
/*
* Definitions for ring stats: used by rx as well as tx
*/
typedef struct ring_stat_s {
} ring_stat_t;
typedef struct ring_stat_entry_s {
/*
* Definitions for fanout stats
*/
typedef struct fanout_stat_s {
typedef struct fanout_stat_entry_s {
/*
* Definitions for total stats
*/
typedef struct total_stat_s {
} total_stat_t;
/*
* To be consistent with other stat entries, total stat
* is wrapped in stat entry
*/
typedef struct total_stat_entry_s {
/*
* Definitions for aggr stats
*/
typedef struct aggr_port_stat_s {
typedef struct aggr_port_stat_entry_s {
/*
* Definitions for query all stats
*/
typedef struct name_value_stat_s {
char nv_statname[MAXSTATNAMELEN];
struct name_value_stat_s *nv_nextstat;
typedef struct name_value_stat_entry_s {
char nve_header[MAXSTATNAMELEN];
/*
* Definitions for flow stats
*/
typedef struct flow_stat_s {
} flow_stat_t;
typedef struct pktsum_s {
} pktsum_t;
const char *, int, int);
const char *, const char *);
void *);
const char *, uint8_t, void *);
extern flow_stat_t *dladm_flow_stat_query(const char *);
flow_stat_t *);
extern name_value_stat_entry_t *dladm_flow_stat_query_all(const char *);
#ifdef __cplusplus
}
#endif
#endif /* _LIBDLSTAT_H */