summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/bsdp/vendor_class_identifier_darwin.go
blob: d1b4c2bfc8c4f53a2ad0d43d717a90a259c1a7ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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("%s/i386/%s", AppleVendorID, hwModel), nil
}