File: vendor_class_identifier_darwin.go

package info (click to toggle)
golang-github-insomniacslk-dhcp 0.0~git20200621.d74cd86-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,132 kB
  • sloc: makefile: 9
file content (18 lines) | stat: -rw-r--r-- 385 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package bsdp

import (
	"fmt"

	"golang.org/x/sys/unix"
)

// MakeVendorClassIdentifier calls the sysctl syscall on macOS to get the
// platform model.
func MakeVendorClassIdentifier() (string, error) {
	// Fetch hardware model for class ID.
	hwModel, err := unix.Sysctl("hw.model")
	if err != nil {
		return "", err
	}
	return fmt.Sprintf("%s/i386/%s", AppleVendorID, hwModel), nil
}