summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/bsdp/vendor_class_identifier_darwin.go
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv4/bsdp/vendor_class_identifier_darwin.go')
-rw-r--r--dhcpv4/bsdp/vendor_class_identifier_darwin.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/dhcpv4/bsdp/vendor_class_identifier_darwin.go b/dhcpv4/bsdp/vendor_class_identifier_darwin.go
new file mode 100644
index 0000000..530d843
--- /dev/null
+++ b/dhcpv4/bsdp/vendor_class_identifier_darwin.go
@@ -0,0 +1,17 @@
+package bsdp
+
+import (
+ "fmt"
+ "syscall"
+)
+
+// MakeVendorClassIdentifier calls the sysctl syscall on macOS to get the
+// platform model.
+func MakeVendorClassIdentifier() (string, error) {
+ // Fetch hardware model for class ID.
+ hwModel, err := syscall.Sysctl("hw.model")
+ if err != nil {
+ return "", err
+ }
+ return fmt.Sprintf("AAPLBSDPC/i386/%s", hwModel), nil
+}