diff options
Diffstat (limited to 'binapi/ethernet_types/ethernet_types.ba.go')
-rw-r--r-- | binapi/ethernet_types/ethernet_types.ba.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/binapi/ethernet_types/ethernet_types.ba.go b/binapi/ethernet_types/ethernet_types.ba.go index dd18d9e..cce8de4 100644 --- a/binapi/ethernet_types/ethernet_types.ba.go +++ b/binapi/ethernet_types/ethernet_types.ba.go @@ -35,15 +35,19 @@ func ParseMacAddress(s string) (MacAddress, error) { copy(macaddr[:], mac[:]) return macaddr, nil } + func (x MacAddress) ToMAC() net.HardwareAddr { return net.HardwareAddr(x[:]) } + func (x MacAddress) String() string { return x.ToMAC().String() } + func (x *MacAddress) MarshalText() ([]byte, error) { return []byte(x.String()), nil } + func (x *MacAddress) UnmarshalText(text []byte) error { mac, err := ParseMacAddress(string(text)) if err != nil { |