summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/bsdp/vendor_class_identifier_darwin.go
blob: 530d8437c3907943488614ce34c98fb653629950 (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("AAPLBSDPC/i386/%s", hwModel), nil
}