oui

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2025 License: MIT Imports: 3 Imported by: 0

README

OUI - Hardware Vendor Prefix For MAC Address

Usage

package main

import (
	"fmt"
	"net"

	"github.com/shadowy-pycoder/mshark/oui"
)

func main() {
    addr := net.HardwareAddr{0x00, 0x00, 0x0c, 0x01, 0x02, 0x03}
	fmt.Println(oui.VendorWithMAC(addr)) // Cisco_01:02:03
}

Update OUI Data

go install github.com/magefile/mage@latest
mage build

Documentation

Overview

Package oui provides functions to generate hardware vendor names from hardware addresses

Index

Constants

This section is empty.

Variables

View Source
var (
	BroadcastMAC = net.HardwareAddr{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}
	LocalhostMAC = net.HardwareAddr{0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
)

Functions

func Vendor

func Vendor(s string) string

func VendorFromMAC

func VendorFromMAC(hw net.HardwareAddr) string

VendorFromMAC returns the hardware vendor of a net.HardwareAddr.

func VendorWithMAC

func VendorWithMAC(hw net.HardwareAddr) string

VendorWithMAC concatenates vendor with MAC address (e.g. Next_01:02:03)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL