summaryrefslogtreecommitdiff
path: root/include/net-snmp/data_access/swrun.h
blob: 3e15c416279966bc7cf535d69dd58a4291f5ddc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/* Portions of this file are subject to the following copyright(s).  See
 * the Net-SNMP's COPYING file for more details and other copyrights
 * that may apply:
 */
/*
 * Portions of this file are copyrighted by:
 * Copyright (C) 2007 Apple, Inc. All rights reserved.
 * Use is subject to license terms specified in the COPYING file
 * distributed with the Net-SNMP package.
 */
#ifndef NETSNMP_SWRUN_H
#define NETSNMP_SWRUN_H

#ifdef  __cplusplus
extern "C" {
#endif


    /*-*****************************************************************
     *
     * Data structure for a row entry 
     */
    typedef struct hrSWRunTable_entry {
        netsnmp_index   oid_index;
        
        /*
         * Index values 
         */
        oid             hrSWRunIndex;
        
        /*
         * Column values 
         */
        char            hrSWRunName[ 64+1];  /* size per MIB + 1 */
        char            hrSWRunPath[128+1];  /* size per MIB + 1 */
        char            hrSWRunParameters[128+1]; /* size per MIB + 1 */
#ifdef NETSNMP_SWRUN_HAVE_ID  /* if not defined, will always use nullOid */
        oid             hrSWRunID[SNMP_MAXOID];
        u_char          hrSWRunID_len;
#endif
        u_char          hrSWRunName_len;
        u_char          hrSWRunPath_len;
        u_char          hrSWRunParameters_len;

        u_char          hrSWRunType;
        u_char          hrSWRunStatus;
        u_char          old_hrSWRunStatus;

        /*
         * Perf values
         */
        int32_t         hrSWRunPerfCPU;
        int32_t         hrSWRunPerfMem;
        
    } netsnmp_swrun_entry;

    /*
     * enums for column hrSWRunType
     */
#define HRSWRUNTYPE_UNKNOWN             1
#define HRSWRUNTYPE_OPERATINGSYSTEM     2
#define HRSWRUNTYPE_DEVICEDRIVER        3
#define HRSWRUNTYPE_APPLICATION         4

    /*
     * enums for column hrSWRunStatus
     */
#define HRSWRUNSTATUS_RUNNING           1
#define HRSWRUNSTATUS_RUNNABLE          2
#define HRSWRUNSTATUS_NOTRUNNABLE       3
#define HRSWRUNSTATUS_INVALID           4

    /*-*****************************************************************
     *
     * Prototypes
     */
    netsnmp_container *
    netsnmp_swrun_container_load(netsnmp_container *container, u_int flags );

    void netsnmp_swrun_container_free(netsnmp_container *container, u_int flags);
    void netsnmp_swrun_container_free_items(netsnmp_container * container);

    netsnmp_swrun_entry *
    netsnmp_swrun_entry_create(int32_t swIndex);

    void netsnmp_swrun_entry_free(netsnmp_swrun_entry *entry);

    int  swrun_count_processes( void );
    int  swrun_max_processes(   void );
    int  swrun_count_processes_by_name( char *name );

#define NETSNMP_SWRUN_NOFLAGS            0x00000000
#define NETSNMP_SWRUN_ALL_OR_NONE        0x00000001
#define NETSNMP_SWRUN_DONT_FREE_ITEMS    0x00000002
/*#define NETSNMP_SWRUN_xx                0x00000004 */

#ifdef  __cplusplus
}
#endif


#endif /* NETSNMP_SWRUN_H */