1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: /usr/share/vpp/api/core/ethernet_types.api.json
7 // Package ethernet_types contains generated bindings for API file ethernet_types.api.
12 package ethernet_types
15 api "git.fd.io/govpp.git/api"
19 // This is a compile-time assertion to ensure that this generated file
20 // is compatible with the GoVPP api package it is being compiled against.
21 // A compilation error at this line likely means your copy of the
22 // GoVPP api package needs to be updated.
23 const _ = api.GoVppAPIPackageIsVersion2
25 // MacAddress defines alias 'mac_address'.
26 type MacAddress [6]uint8
28 func ParseMacAddress(s string) (MacAddress, error) {
29 var macaddr MacAddress
30 mac, err := net.ParseMAC(s)
34 copy(macaddr[:], mac[:])
37 func (x MacAddress) ToMAC() net.HardwareAddr {
38 return net.HardwareAddr(x[:])
40 func (x MacAddress) String() string {
41 return x.ToMAC().String()
43 func (x *MacAddress) MarshalText() ([]byte, error) {
44 return []byte(x.String()), nil
46 func (x *MacAddress) UnmarshalText(text []byte) error {
47 mac, err := ParseMacAddress(string(text))