Debian Codegraph @

agent/mibgroup/hardware/cpu/cpu_null.c

raw
1 /*
2 * dummy HAL CPU module
3 * for systems not using any of the supported interfaces
4 */
5 #include <net-snmp/net-snmp-config.h>
6 #include <net-snmp/net-snmp-includes.h>
7 #include <net-snmp/agent/net-snmp-agent-includes.h>
8 #include <net-snmp/agent/hardware/cpu.h>
9
10 /*
11 * Initialise the HAL CPU system
12 * (including a basic description)
13 */
14 void init_cpu_null( void ) {
15
16 netsnmp_cpu_info *cpu = netsnmp_cpu_get_byIdx( -1, 1 );
17 strcpy(cpu->name, "Overall CPU statistics");
18 strcpy(cpu->descr, "An electronic chip that makes the computer work");
19 strcat(cpu->descr, " (but that's not important right now)");
20
21 cpu = netsnmp_cpu_get_byIdx( 0, 1 );
22 strcpy(cpu->name, "cpu0");
23 strcpy(cpu->descr, "An electronic chip that makes the computer work");
24 cpu->status = 2; /* running */
25
26 cpu_num = 1;
27 }
28
29
30
31 /*
32 * We can't load the CPU usage statistics
33 * because we don't know how to do this!
34 */
35 int netsnmp_cpu_arch_load( netsnmp_cache *cache, void *magic ) {
36
37 return 0; /* or -1 ? */
38 }