1
/*- This is a -*- C -*- compatible header file
3
* Generic public interface for SUNOS5_INSTRUMENTATION
5
* This file contains manifest constants (#defines), macros, enumerations,
6
* public structure definitions, static const definitions, global variable
7
* declarations, and function prototypes.
9
* This file contains types and structures for SunOS 5.x instrumentation
13
#include <inet/mib2.h>
15
#define COPY_IPADDR(fp, from, tp, to) \
23
#ifndef ZZ_SUNOS5_INSTR /* duplicate include prevention */
24
#define ZZ_SUNOS5_INSTR
31
#define KSTAT_DATA_MAX 100 /* Maximum number of kstat entries. To be changed later */
32
#define MIBCACHE_SIZE 20 /* Number of MIB cache entries */
37
#define CACHE_MOREDATA 0x001 /* There are unread data outside cache */
43
typedef enum { GET_FIRST, GET_EXACT, GET_NEXT } req_e;
44
typedef enum { FOUND, NOT_FOUND, NEED_NEXT } found_e;
61
MIB_TRANSMISSION = 14,
66
* Structure definitions (use "typedef struct foo {} foo;" form)
70
* MIB-II cache. Simple buffering scheme - last read block is in the cache
73
typedef struct mibcache {
74
mibgroup_e cache_groupid; /* MIB-II group */
75
size_t cache_size; /* Size of this cache table in bytes */
76
void *cache_addr; /* Pointer to real cache memory */
77
size_t cache_length; /* Useful length in bytes */
78
size_t cache_ttl; /* Time this type of cache entry stays valid */
79
time_t cache_time; /* CURRENT time left for this cache entry */
80
int cache_flags; /* Cache state */
81
int cache_last_found; /* Index of last cache element that was found */
82
void *cache_comp; /* Compare routine used to set the cache */
83
void *cache_arg; /* Argument for compare routine used to set the cache */
87
* Mapping between mibgroup_t, mibtable_t and mib2.h defines
90
typedef struct mibmap {
91
int group; /* mib2.h group name */
92
int table; /* mib2.h table name */
96
* Structures, missing in <inet/mib2.h>
98
typedef unsigned long TimeTicks;
100
typedef struct mib2_ifEntry {
101
int ifIndex; /* ifEntry 1 */
102
DeviceName ifDescr; /* ifEntry 2 */
103
int ifType; /* ifEntry 3 */
104
int ifMtu; /* ifEntry 4 */
105
Gauge ifSpeed; /* ifEntry 5 */
106
PhysAddress ifPhysAddress; /* ifEntry 6 */
107
int ifAdminStatus; /* ifEntry 7 */
108
int ifOperStatus; /* ifEntry 8 */
109
TimeTicks ifLastChange; /* ifEntry 9 */
110
Counter ifInOctets; /* ifEntry 10 */
111
Counter ifInUcastPkts; /* ifEntry 11 */
112
Counter ifInNUcastPkts; /* ifEntry 12 */
113
Counter ifInDiscards; /* ifEntry 13 */
114
Counter ifInErrors; /* ifEntry 14 */
115
Counter ifInUnknownProtos; /* ifEntry 15 */
116
Counter ifOutOctets; /* ifEntry 16 */
117
Counter ifOutUcastPkts; /* ifEntry 17 */
118
Counter ifOutNUcastPkts; /* ifEntry 18 */
119
Counter ifOutDiscards; /* ifEntry 19 */
120
Counter ifOutErrors; /* ifEntry 20 */
121
Gauge ifOutQLen; /* ifEntry 21 */
122
int ifSpecific; /* ifEntry 22 */
126
* Static const definitions (must be declared static and initialized)
131
* Global variable declarations (using extern and without initialization)
135
* Function prototypes (use void as argument type if there are no arguments)
143
void init_kernel_sunos5(void);
145
int getKstat(const char *statname, const char *varname,
147
int getMibstat(mibgroup_e grid, void *resp,
148
size_t entrysize, req_e req_type,
149
int (*comp) (void *, void *), void *arg);
150
int Get_everything(void *, void *);
151
int getKstatInt(const char *classname,
152
const char *statname, const char *varname,
155
int getKstatString(const char *statname, const char *varname,
156
char *value, size_t value_len);
164
* These variables describe the formatting of this file. If you don't like the
165
* template defaults, feel free to change them here (not in your .emacs file).
170
* c-continued-statement-offset: 4
172
* c-argdecl-indent: 0