diff options
Diffstat (limited to 'src/detection/host/host_obsd.c')
| -rw-r--r-- | src/detection/host/host_obsd.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/detection/host/host_obsd.c b/src/detection/host/host_obsd.c new file mode 100644 index 0000000..cb16ecf --- /dev/null +++ b/src/detection/host/host_obsd.c @@ -0,0 +1,22 @@ +#include "host.h" +#include "common/sysctl.h" +#include "common/smbios.h" + +const char* ffDetectHost(FFHostResult* host) { + const char* error = NULL; + if ((error = ffSysctlGetString(CTL_HW, HW_PRODUCT, &host->name))) { + return error; + } + ffCleanUpSmbiosValue(&host->name); + if (ffSysctlGetString(CTL_HW, HW_VENDOR, &host->vendor) == NULL) { + ffCleanUpSmbiosValue(&host->vendor); + } + if (ffSysctlGetString(CTL_HW, HW_VERSION, &host->version) == NULL) { + ffCleanUpSmbiosValue(&host->version); + } + if (ffSysctlGetString(CTL_HW, HW_SERIALNO, &host->serial) == NULL) { + ffCleanUpSmbiosValue(&host->serial); + } + + return NULL; +} |