summaryrefslogtreecommitdiffstats
path: root/src/detection/host/host_nbsd.c
diff options
context:
space:
mode:
authorsumuel <samuel@yakubos.org>2026-08-17 20:44:55 +0000
committersumuel <samuel@yakubos.org>2026-08-17 20:44:55 +0000
commit76424950e373d3b04ac3dd13019151bfba3e8423 (patch)
tree4c3cfdbda039e592b9186be3e28f8d7cfd439e8a /src/detection/host/host_nbsd.c
Add the files
Diffstat (limited to 'src/detection/host/host_nbsd.c')
-rw-r--r--src/detection/host/host_nbsd.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/detection/host/host_nbsd.c b/src/detection/host/host_nbsd.c
new file mode 100644
index 0000000..a5a29d2
--- /dev/null
+++ b/src/detection/host/host_nbsd.c
@@ -0,0 +1,25 @@
+#include "host.h"
+#include "common/sysctl.h"
+#include "common/smbios.h"
+
+const char* ffDetectHost(FFHostResult* host) {
+ const char* error = NULL;
+ if ((error = ffSysctlGetString("machdep.dmi.system-product", &host->name))) {
+ return error;
+ }
+ ffCleanUpSmbiosValue(&host->name);
+ if (ffSysctlGetString("machdep.dmi.system-vendor", &host->vendor) == NULL) {
+ ffCleanUpSmbiosValue(&host->vendor);
+ }
+ if (ffSysctlGetString("machdep.dmi.system-version", &host->version) == NULL) {
+ ffCleanUpSmbiosValue(&host->version);
+ }
+ if (ffSysctlGetString("machdep.dmi.system-serial", &host->serial) == NULL) {
+ ffCleanUpSmbiosValue(&host->serial);
+ }
+ if (ffSysctlGetString("machdep.dmi.system-uuid", &host->uuid) == NULL) {
+ ffCleanUpSmbiosValue(&host->uuid);
+ }
+
+ return NULL;
+}