X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=binapi%2Fethernet_types%2Fethernet_types.ba.go;fp=binapi%2Fethernet_types%2Fethernet_types.ba.go;h=cce8de4d522ebca1ba187bbbf480c71ea17e2dc3;hb=0a0c03d459547aa9004cbbc1ed9a358d831adf03;hp=dd18d9e88a9e7db2eee50769d6fe043bba79d556;hpb=4cc53fc9a836df099dde983d506eb892dc2fdef1;p=govpp.git 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 {