| 1 |
/* |
| 2 |
* Host Resources MIB - other device implementation - hr_other.c |
| 3 |
* |
| 4 |
*/ |
| 5 |
|
| 6 |
#include <net-snmp/net-snmp-config.h> |
| 7 |
|
| 8 |
#include "host_res.h" |
| 9 |
#include "hr_other.h" |
| 10 |
|
| 11 |
#ifdef HAVE_UNISTD_H |
| 12 |
#include <unistd.h> |
| 13 |
#endif |
| 14 |
|
| 15 |
|
| 16 |
void Init_HR_CoProc(void); |
| 17 |
int Get_Next_HR_CoProc(void); |
| 18 |
const char *describe_coproc(int); |
| 19 |
|
| 20 |
void |
| 21 |
init_hr_other(void) |
| 22 |
{ |
| 23 |
init_device[HRDEV_COPROC] = Init_HR_CoProc; |
| 24 |
next_device[HRDEV_COPROC] = Get_Next_HR_CoProc; |
| 25 |
device_descr[HRDEV_COPROC] = describe_coproc; |
| 26 |
} |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
static int done_coProc; |
| 31 |
|
| 32 |
void |
| 33 |
Init_HR_CoProc(void) |
| 34 |
{ |
| 35 |
#ifdef solaris2 |
| 36 |
/* |
| 37 |
* Sun didn't sell many Windows Co-processor boards |
| 38 |
* somebody who has one will have to figure out how to discover it |
| 39 |
* so assume there are none |
| 40 |
*/ |
| 41 |
done_coProc = 1; |
| 42 |
#else |
| 43 |
done_coProc = 0; |
| 44 |
#endif |
| 45 |
} |
| 46 |
|
| 47 |
int |
| 48 |
Get_Next_HR_CoProc(void) |
| 49 |
{ |
| 50 |
/* |
| 51 |
* How to identify the presence of a co-processor ? |
| 52 |
*/ |
| 53 |
|
| 54 |
if (done_coProc != 1) { |
| 55 |
done_coProc = 1; |
| 56 |
return (HRDEV_COPROC << HRDEV_TYPE_SHIFT); |
| 57 |
} else |
| 58 |
return -1; |
| 59 |
} |
| 60 |
|
| 61 |
|
| 62 |
const char * |
| 63 |
describe_coproc(int idx) |
| 64 |
{ |
| 65 |
return ("Guessing that there's a floating point co-processor"); |
| 66 |
} |