go.ligato.io/vpp-agent/v3@v3.5.0/plugins/vpp/binapi/vpp2210/tapv2/tapv2.ba.go (about)

     1  // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
     2  
     3  // Package tapv2 contains generated bindings for API file tapv2.api.
     4  //
     5  // Contents:
     6  // -  1 enum
     7  // -  8 messages
     8  package tapv2
     9  
    10  import (
    11  	"strconv"
    12  
    13  	api "go.fd.io/govpp/api"
    14  	codec "go.fd.io/govpp/codec"
    15  	ethernet_types "go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2210/ethernet_types"
    16  	interface_types "go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2210/interface_types"
    17  	ip_types "go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2210/ip_types"
    18  )
    19  
    20  // This is a compile-time assertion to ensure that this generated file
    21  // is compatible with the GoVPP api package it is being compiled against.
    22  // A compilation error at this line likely means your copy of the
    23  // GoVPP api package needs to be updated.
    24  const _ = api.GoVppAPIPackageIsVersion2
    25  
    26  const (
    27  	APIFile    = "tapv2"
    28  	APIVersion = "4.0.0"
    29  	VersionCrc = 0xc2f80dc7
    30  )
    31  
    32  // TapFlags defines enum 'tap_flags'.
    33  type TapFlags uint32
    34  
    35  const (
    36  	TAP_API_FLAG_GSO          TapFlags = 1
    37  	TAP_API_FLAG_CSUM_OFFLOAD TapFlags = 2
    38  	TAP_API_FLAG_PERSIST      TapFlags = 4
    39  	TAP_API_FLAG_ATTACH       TapFlags = 8
    40  	TAP_API_FLAG_TUN          TapFlags = 16
    41  	TAP_API_FLAG_GRO_COALESCE TapFlags = 32
    42  	TAP_API_FLAG_PACKED       TapFlags = 64
    43  	TAP_API_FLAG_IN_ORDER     TapFlags = 128
    44  )
    45  
    46  var (
    47  	TapFlags_name = map[uint32]string{
    48  		1:   "TAP_API_FLAG_GSO",
    49  		2:   "TAP_API_FLAG_CSUM_OFFLOAD",
    50  		4:   "TAP_API_FLAG_PERSIST",
    51  		8:   "TAP_API_FLAG_ATTACH",
    52  		16:  "TAP_API_FLAG_TUN",
    53  		32:  "TAP_API_FLAG_GRO_COALESCE",
    54  		64:  "TAP_API_FLAG_PACKED",
    55  		128: "TAP_API_FLAG_IN_ORDER",
    56  	}
    57  	TapFlags_value = map[string]uint32{
    58  		"TAP_API_FLAG_GSO":          1,
    59  		"TAP_API_FLAG_CSUM_OFFLOAD": 2,
    60  		"TAP_API_FLAG_PERSIST":      4,
    61  		"TAP_API_FLAG_ATTACH":       8,
    62  		"TAP_API_FLAG_TUN":          16,
    63  		"TAP_API_FLAG_GRO_COALESCE": 32,
    64  		"TAP_API_FLAG_PACKED":       64,
    65  		"TAP_API_FLAG_IN_ORDER":     128,
    66  	}
    67  )
    68  
    69  func (x TapFlags) String() string {
    70  	s, ok := TapFlags_name[uint32(x)]
    71  	if ok {
    72  		return s
    73  	}
    74  	str := func(n uint32) string {
    75  		s, ok := TapFlags_name[uint32(n)]
    76  		if ok {
    77  			return s
    78  		}
    79  		return "TapFlags(" + strconv.Itoa(int(n)) + ")"
    80  	}
    81  	for i := uint32(0); i <= 32; i++ {
    82  		val := uint32(x)
    83  		if val&(1<<i) != 0 {
    84  			if s != "" {
    85  				s += "|"
    86  			}
    87  			s += str(1 << i)
    88  		}
    89  	}
    90  	if s == "" {
    91  		return str(uint32(x))
    92  	}
    93  	return s
    94  }
    95  
    96  // SwInterfaceTapV2Details defines message 'sw_interface_tap_v2_details'.
    97  type SwInterfaceTapV2Details struct {
    98  	SwIfIndex     uint32                        `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
    99  	ID            uint32                        `binapi:"u32,name=id" json:"id,omitempty"`
   100  	TxRingSz      uint16                        `binapi:"u16,name=tx_ring_sz" json:"tx_ring_sz,omitempty"`
   101  	RxRingSz      uint16                        `binapi:"u16,name=rx_ring_sz" json:"rx_ring_sz,omitempty"`
   102  	HostMtuSize   uint32                        `binapi:"u32,name=host_mtu_size" json:"host_mtu_size,omitempty"`
   103  	HostMacAddr   ethernet_types.MacAddress     `binapi:"mac_address,name=host_mac_addr" json:"host_mac_addr,omitempty"`
   104  	HostIP4Prefix ip_types.IP4AddressWithPrefix `binapi:"ip4_address_with_prefix,name=host_ip4_prefix" json:"host_ip4_prefix,omitempty"`
   105  	HostIP6Prefix ip_types.IP6AddressWithPrefix `binapi:"ip6_address_with_prefix,name=host_ip6_prefix" json:"host_ip6_prefix,omitempty"`
   106  	TapFlags      TapFlags                      `binapi:"tap_flags,name=tap_flags" json:"tap_flags,omitempty"`
   107  	DevName       string                        `binapi:"string[64],name=dev_name" json:"dev_name,omitempty"`
   108  	HostIfName    string                        `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"`
   109  	HostNamespace string                        `binapi:"string[64],name=host_namespace" json:"host_namespace,omitempty"`
   110  	HostBridge    string                        `binapi:"string[64],name=host_bridge" json:"host_bridge,omitempty"`
   111  }
   112  
   113  func (m *SwInterfaceTapV2Details) Reset()               { *m = SwInterfaceTapV2Details{} }
   114  func (*SwInterfaceTapV2Details) GetMessageName() string { return "sw_interface_tap_v2_details" }
   115  func (*SwInterfaceTapV2Details) GetCrcString() string   { return "1e2b2a47" }
   116  func (*SwInterfaceTapV2Details) GetMessageType() api.MessageType {
   117  	return api.ReplyMessage
   118  }
   119  
   120  func (m *SwInterfaceTapV2Details) Size() (size int) {
   121  	if m == nil {
   122  		return 0
   123  	}
   124  	size += 4      // m.SwIfIndex
   125  	size += 4      // m.ID
   126  	size += 2      // m.TxRingSz
   127  	size += 2      // m.RxRingSz
   128  	size += 4      // m.HostMtuSize
   129  	size += 1 * 6  // m.HostMacAddr
   130  	size += 1 * 4  // m.HostIP4Prefix.Address
   131  	size += 1      // m.HostIP4Prefix.Len
   132  	size += 1 * 16 // m.HostIP6Prefix.Address
   133  	size += 1      // m.HostIP6Prefix.Len
   134  	size += 4      // m.TapFlags
   135  	size += 64     // m.DevName
   136  	size += 64     // m.HostIfName
   137  	size += 64     // m.HostNamespace
   138  	size += 64     // m.HostBridge
   139  	return size
   140  }
   141  func (m *SwInterfaceTapV2Details) Marshal(b []byte) ([]byte, error) {
   142  	if b == nil {
   143  		b = make([]byte, m.Size())
   144  	}
   145  	buf := codec.NewBuffer(b)
   146  	buf.EncodeUint32(m.SwIfIndex)
   147  	buf.EncodeUint32(m.ID)
   148  	buf.EncodeUint16(m.TxRingSz)
   149  	buf.EncodeUint16(m.RxRingSz)
   150  	buf.EncodeUint32(m.HostMtuSize)
   151  	buf.EncodeBytes(m.HostMacAddr[:], 6)
   152  	buf.EncodeBytes(m.HostIP4Prefix.Address[:], 4)
   153  	buf.EncodeUint8(m.HostIP4Prefix.Len)
   154  	buf.EncodeBytes(m.HostIP6Prefix.Address[:], 16)
   155  	buf.EncodeUint8(m.HostIP6Prefix.Len)
   156  	buf.EncodeUint32(uint32(m.TapFlags))
   157  	buf.EncodeString(m.DevName, 64)
   158  	buf.EncodeString(m.HostIfName, 64)
   159  	buf.EncodeString(m.HostNamespace, 64)
   160  	buf.EncodeString(m.HostBridge, 64)
   161  	return buf.Bytes(), nil
   162  }
   163  func (m *SwInterfaceTapV2Details) Unmarshal(b []byte) error {
   164  	buf := codec.NewBuffer(b)
   165  	m.SwIfIndex = buf.DecodeUint32()
   166  	m.ID = buf.DecodeUint32()
   167  	m.TxRingSz = buf.DecodeUint16()
   168  	m.RxRingSz = buf.DecodeUint16()
   169  	m.HostMtuSize = buf.DecodeUint32()
   170  	copy(m.HostMacAddr[:], buf.DecodeBytes(6))
   171  	copy(m.HostIP4Prefix.Address[:], buf.DecodeBytes(4))
   172  	m.HostIP4Prefix.Len = buf.DecodeUint8()
   173  	copy(m.HostIP6Prefix.Address[:], buf.DecodeBytes(16))
   174  	m.HostIP6Prefix.Len = buf.DecodeUint8()
   175  	m.TapFlags = TapFlags(buf.DecodeUint32())
   176  	m.DevName = buf.DecodeString(64)
   177  	m.HostIfName = buf.DecodeString(64)
   178  	m.HostNamespace = buf.DecodeString(64)
   179  	m.HostBridge = buf.DecodeString(64)
   180  	return nil
   181  }
   182  
   183  // SwInterfaceTapV2Dump defines message 'sw_interface_tap_v2_dump'.
   184  type SwInterfaceTapV2Dump struct {
   185  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
   186  }
   187  
   188  func (m *SwInterfaceTapV2Dump) Reset()               { *m = SwInterfaceTapV2Dump{} }
   189  func (*SwInterfaceTapV2Dump) GetMessageName() string { return "sw_interface_tap_v2_dump" }
   190  func (*SwInterfaceTapV2Dump) GetCrcString() string   { return "f9e6675e" }
   191  func (*SwInterfaceTapV2Dump) GetMessageType() api.MessageType {
   192  	return api.RequestMessage
   193  }
   194  
   195  func (m *SwInterfaceTapV2Dump) Size() (size int) {
   196  	if m == nil {
   197  		return 0
   198  	}
   199  	size += 4 // m.SwIfIndex
   200  	return size
   201  }
   202  func (m *SwInterfaceTapV2Dump) Marshal(b []byte) ([]byte, error) {
   203  	if b == nil {
   204  		b = make([]byte, m.Size())
   205  	}
   206  	buf := codec.NewBuffer(b)
   207  	buf.EncodeUint32(uint32(m.SwIfIndex))
   208  	return buf.Bytes(), nil
   209  }
   210  func (m *SwInterfaceTapV2Dump) Unmarshal(b []byte) error {
   211  	buf := codec.NewBuffer(b)
   212  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   213  	return nil
   214  }
   215  
   216  // TapCreateV2 defines message 'tap_create_v2'.
   217  type TapCreateV2 struct {
   218  	ID               uint32                        `binapi:"u32,name=id,default=4294967295" json:"id,omitempty"`
   219  	UseRandomMac     bool                          `binapi:"bool,name=use_random_mac,default=true" json:"use_random_mac,omitempty"`
   220  	MacAddress       ethernet_types.MacAddress     `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
   221  	NumRxQueues      uint8                         `binapi:"u8,name=num_rx_queues,default=1" json:"num_rx_queues,omitempty"`
   222  	TxRingSz         uint16                        `binapi:"u16,name=tx_ring_sz,default=256" json:"tx_ring_sz,omitempty"`
   223  	RxRingSz         uint16                        `binapi:"u16,name=rx_ring_sz,default=256" json:"rx_ring_sz,omitempty"`
   224  	HostMtuSet       bool                          `binapi:"bool,name=host_mtu_set" json:"host_mtu_set,omitempty"`
   225  	HostMtuSize      uint32                        `binapi:"u32,name=host_mtu_size" json:"host_mtu_size,omitempty"`
   226  	HostMacAddrSet   bool                          `binapi:"bool,name=host_mac_addr_set" json:"host_mac_addr_set,omitempty"`
   227  	HostMacAddr      ethernet_types.MacAddress     `binapi:"mac_address,name=host_mac_addr" json:"host_mac_addr,omitempty"`
   228  	HostIP4PrefixSet bool                          `binapi:"bool,name=host_ip4_prefix_set" json:"host_ip4_prefix_set,omitempty"`
   229  	HostIP4Prefix    ip_types.IP4AddressWithPrefix `binapi:"ip4_address_with_prefix,name=host_ip4_prefix" json:"host_ip4_prefix,omitempty"`
   230  	HostIP6PrefixSet bool                          `binapi:"bool,name=host_ip6_prefix_set" json:"host_ip6_prefix_set,omitempty"`
   231  	HostIP6Prefix    ip_types.IP6AddressWithPrefix `binapi:"ip6_address_with_prefix,name=host_ip6_prefix" json:"host_ip6_prefix,omitempty"`
   232  	HostIP4GwSet     bool                          `binapi:"bool,name=host_ip4_gw_set" json:"host_ip4_gw_set,omitempty"`
   233  	HostIP4Gw        ip_types.IP4Address           `binapi:"ip4_address,name=host_ip4_gw" json:"host_ip4_gw,omitempty"`
   234  	HostIP6GwSet     bool                          `binapi:"bool,name=host_ip6_gw_set" json:"host_ip6_gw_set,omitempty"`
   235  	HostIP6Gw        ip_types.IP6Address           `binapi:"ip6_address,name=host_ip6_gw" json:"host_ip6_gw,omitempty"`
   236  	TapFlags         TapFlags                      `binapi:"tap_flags,name=tap_flags" json:"tap_flags,omitempty"`
   237  	HostNamespaceSet bool                          `binapi:"bool,name=host_namespace_set" json:"host_namespace_set,omitempty"`
   238  	HostNamespace    string                        `binapi:"string[64],name=host_namespace" json:"host_namespace,omitempty"`
   239  	HostIfNameSet    bool                          `binapi:"bool,name=host_if_name_set" json:"host_if_name_set,omitempty"`
   240  	HostIfName       string                        `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"`
   241  	HostBridgeSet    bool                          `binapi:"bool,name=host_bridge_set" json:"host_bridge_set,omitempty"`
   242  	HostBridge       string                        `binapi:"string[64],name=host_bridge" json:"host_bridge,omitempty"`
   243  	Tag              string                        `binapi:"string[],name=tag" json:"tag,omitempty"`
   244  }
   245  
   246  func (m *TapCreateV2) Reset()               { *m = TapCreateV2{} }
   247  func (*TapCreateV2) GetMessageName() string { return "tap_create_v2" }
   248  func (*TapCreateV2) GetCrcString() string   { return "2d0d6570" }
   249  func (*TapCreateV2) GetMessageType() api.MessageType {
   250  	return api.RequestMessage
   251  }
   252  
   253  func (m *TapCreateV2) Size() (size int) {
   254  	if m == nil {
   255  		return 0
   256  	}
   257  	size += 4              // m.ID
   258  	size += 1              // m.UseRandomMac
   259  	size += 1 * 6          // m.MacAddress
   260  	size += 1              // m.NumRxQueues
   261  	size += 2              // m.TxRingSz
   262  	size += 2              // m.RxRingSz
   263  	size += 1              // m.HostMtuSet
   264  	size += 4              // m.HostMtuSize
   265  	size += 1              // m.HostMacAddrSet
   266  	size += 1 * 6          // m.HostMacAddr
   267  	size += 1              // m.HostIP4PrefixSet
   268  	size += 1 * 4          // m.HostIP4Prefix.Address
   269  	size += 1              // m.HostIP4Prefix.Len
   270  	size += 1              // m.HostIP6PrefixSet
   271  	size += 1 * 16         // m.HostIP6Prefix.Address
   272  	size += 1              // m.HostIP6Prefix.Len
   273  	size += 1              // m.HostIP4GwSet
   274  	size += 1 * 4          // m.HostIP4Gw
   275  	size += 1              // m.HostIP6GwSet
   276  	size += 1 * 16         // m.HostIP6Gw
   277  	size += 4              // m.TapFlags
   278  	size += 1              // m.HostNamespaceSet
   279  	size += 64             // m.HostNamespace
   280  	size += 1              // m.HostIfNameSet
   281  	size += 64             // m.HostIfName
   282  	size += 1              // m.HostBridgeSet
   283  	size += 64             // m.HostBridge
   284  	size += 4 + len(m.Tag) // m.Tag
   285  	return size
   286  }
   287  func (m *TapCreateV2) Marshal(b []byte) ([]byte, error) {
   288  	if b == nil {
   289  		b = make([]byte, m.Size())
   290  	}
   291  	buf := codec.NewBuffer(b)
   292  	buf.EncodeUint32(m.ID)
   293  	buf.EncodeBool(m.UseRandomMac)
   294  	buf.EncodeBytes(m.MacAddress[:], 6)
   295  	buf.EncodeUint8(m.NumRxQueues)
   296  	buf.EncodeUint16(m.TxRingSz)
   297  	buf.EncodeUint16(m.RxRingSz)
   298  	buf.EncodeBool(m.HostMtuSet)
   299  	buf.EncodeUint32(m.HostMtuSize)
   300  	buf.EncodeBool(m.HostMacAddrSet)
   301  	buf.EncodeBytes(m.HostMacAddr[:], 6)
   302  	buf.EncodeBool(m.HostIP4PrefixSet)
   303  	buf.EncodeBytes(m.HostIP4Prefix.Address[:], 4)
   304  	buf.EncodeUint8(m.HostIP4Prefix.Len)
   305  	buf.EncodeBool(m.HostIP6PrefixSet)
   306  	buf.EncodeBytes(m.HostIP6Prefix.Address[:], 16)
   307  	buf.EncodeUint8(m.HostIP6Prefix.Len)
   308  	buf.EncodeBool(m.HostIP4GwSet)
   309  	buf.EncodeBytes(m.HostIP4Gw[:], 4)
   310  	buf.EncodeBool(m.HostIP6GwSet)
   311  	buf.EncodeBytes(m.HostIP6Gw[:], 16)
   312  	buf.EncodeUint32(uint32(m.TapFlags))
   313  	buf.EncodeBool(m.HostNamespaceSet)
   314  	buf.EncodeString(m.HostNamespace, 64)
   315  	buf.EncodeBool(m.HostIfNameSet)
   316  	buf.EncodeString(m.HostIfName, 64)
   317  	buf.EncodeBool(m.HostBridgeSet)
   318  	buf.EncodeString(m.HostBridge, 64)
   319  	buf.EncodeString(m.Tag, 0)
   320  	return buf.Bytes(), nil
   321  }
   322  func (m *TapCreateV2) Unmarshal(b []byte) error {
   323  	buf := codec.NewBuffer(b)
   324  	m.ID = buf.DecodeUint32()
   325  	m.UseRandomMac = buf.DecodeBool()
   326  	copy(m.MacAddress[:], buf.DecodeBytes(6))
   327  	m.NumRxQueues = buf.DecodeUint8()
   328  	m.TxRingSz = buf.DecodeUint16()
   329  	m.RxRingSz = buf.DecodeUint16()
   330  	m.HostMtuSet = buf.DecodeBool()
   331  	m.HostMtuSize = buf.DecodeUint32()
   332  	m.HostMacAddrSet = buf.DecodeBool()
   333  	copy(m.HostMacAddr[:], buf.DecodeBytes(6))
   334  	m.HostIP4PrefixSet = buf.DecodeBool()
   335  	copy(m.HostIP4Prefix.Address[:], buf.DecodeBytes(4))
   336  	m.HostIP4Prefix.Len = buf.DecodeUint8()
   337  	m.HostIP6PrefixSet = buf.DecodeBool()
   338  	copy(m.HostIP6Prefix.Address[:], buf.DecodeBytes(16))
   339  	m.HostIP6Prefix.Len = buf.DecodeUint8()
   340  	m.HostIP4GwSet = buf.DecodeBool()
   341  	copy(m.HostIP4Gw[:], buf.DecodeBytes(4))
   342  	m.HostIP6GwSet = buf.DecodeBool()
   343  	copy(m.HostIP6Gw[:], buf.DecodeBytes(16))
   344  	m.TapFlags = TapFlags(buf.DecodeUint32())
   345  	m.HostNamespaceSet = buf.DecodeBool()
   346  	m.HostNamespace = buf.DecodeString(64)
   347  	m.HostIfNameSet = buf.DecodeBool()
   348  	m.HostIfName = buf.DecodeString(64)
   349  	m.HostBridgeSet = buf.DecodeBool()
   350  	m.HostBridge = buf.DecodeString(64)
   351  	m.Tag = buf.DecodeString(0)
   352  	return nil
   353  }
   354  
   355  // TapCreateV2Reply defines message 'tap_create_v2_reply'.
   356  type TapCreateV2Reply struct {
   357  	Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
   358  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   359  }
   360  
   361  func (m *TapCreateV2Reply) Reset()               { *m = TapCreateV2Reply{} }
   362  func (*TapCreateV2Reply) GetMessageName() string { return "tap_create_v2_reply" }
   363  func (*TapCreateV2Reply) GetCrcString() string   { return "5383d31f" }
   364  func (*TapCreateV2Reply) GetMessageType() api.MessageType {
   365  	return api.ReplyMessage
   366  }
   367  
   368  func (m *TapCreateV2Reply) Size() (size int) {
   369  	if m == nil {
   370  		return 0
   371  	}
   372  	size += 4 // m.Retval
   373  	size += 4 // m.SwIfIndex
   374  	return size
   375  }
   376  func (m *TapCreateV2Reply) Marshal(b []byte) ([]byte, error) {
   377  	if b == nil {
   378  		b = make([]byte, m.Size())
   379  	}
   380  	buf := codec.NewBuffer(b)
   381  	buf.EncodeInt32(m.Retval)
   382  	buf.EncodeUint32(uint32(m.SwIfIndex))
   383  	return buf.Bytes(), nil
   384  }
   385  func (m *TapCreateV2Reply) Unmarshal(b []byte) error {
   386  	buf := codec.NewBuffer(b)
   387  	m.Retval = buf.DecodeInt32()
   388  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   389  	return nil
   390  }
   391  
   392  // TapCreateV3 defines message 'tap_create_v3'.
   393  type TapCreateV3 struct {
   394  	ID               uint32                        `binapi:"u32,name=id,default=4294967295" json:"id,omitempty"`
   395  	UseRandomMac     bool                          `binapi:"bool,name=use_random_mac,default=true" json:"use_random_mac,omitempty"`
   396  	MacAddress       ethernet_types.MacAddress     `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
   397  	NumRxQueues      uint16                        `binapi:"u16,name=num_rx_queues,default=1" json:"num_rx_queues,omitempty"`
   398  	NumTxQueues      uint16                        `binapi:"u16,name=num_tx_queues,default=1" json:"num_tx_queues,omitempty"`
   399  	TxRingSz         uint16                        `binapi:"u16,name=tx_ring_sz,default=256" json:"tx_ring_sz,omitempty"`
   400  	RxRingSz         uint16                        `binapi:"u16,name=rx_ring_sz,default=256" json:"rx_ring_sz,omitempty"`
   401  	HostMtuSet       bool                          `binapi:"bool,name=host_mtu_set" json:"host_mtu_set,omitempty"`
   402  	HostMtuSize      uint32                        `binapi:"u32,name=host_mtu_size" json:"host_mtu_size,omitempty"`
   403  	HostMacAddrSet   bool                          `binapi:"bool,name=host_mac_addr_set" json:"host_mac_addr_set,omitempty"`
   404  	HostMacAddr      ethernet_types.MacAddress     `binapi:"mac_address,name=host_mac_addr" json:"host_mac_addr,omitempty"`
   405  	HostIP4PrefixSet bool                          `binapi:"bool,name=host_ip4_prefix_set" json:"host_ip4_prefix_set,omitempty"`
   406  	HostIP4Prefix    ip_types.IP4AddressWithPrefix `binapi:"ip4_address_with_prefix,name=host_ip4_prefix" json:"host_ip4_prefix,omitempty"`
   407  	HostIP6PrefixSet bool                          `binapi:"bool,name=host_ip6_prefix_set" json:"host_ip6_prefix_set,omitempty"`
   408  	HostIP6Prefix    ip_types.IP6AddressWithPrefix `binapi:"ip6_address_with_prefix,name=host_ip6_prefix" json:"host_ip6_prefix,omitempty"`
   409  	HostIP4GwSet     bool                          `binapi:"bool,name=host_ip4_gw_set" json:"host_ip4_gw_set,omitempty"`
   410  	HostIP4Gw        ip_types.IP4Address           `binapi:"ip4_address,name=host_ip4_gw" json:"host_ip4_gw,omitempty"`
   411  	HostIP6GwSet     bool                          `binapi:"bool,name=host_ip6_gw_set" json:"host_ip6_gw_set,omitempty"`
   412  	HostIP6Gw        ip_types.IP6Address           `binapi:"ip6_address,name=host_ip6_gw" json:"host_ip6_gw,omitempty"`
   413  	TapFlags         TapFlags                      `binapi:"tap_flags,name=tap_flags" json:"tap_flags,omitempty"`
   414  	HostNamespaceSet bool                          `binapi:"bool,name=host_namespace_set" json:"host_namespace_set,omitempty"`
   415  	HostNamespace    string                        `binapi:"string[64],name=host_namespace" json:"host_namespace,omitempty"`
   416  	HostIfNameSet    bool                          `binapi:"bool,name=host_if_name_set" json:"host_if_name_set,omitempty"`
   417  	HostIfName       string                        `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"`
   418  	HostBridgeSet    bool                          `binapi:"bool,name=host_bridge_set" json:"host_bridge_set,omitempty"`
   419  	HostBridge       string                        `binapi:"string[64],name=host_bridge" json:"host_bridge,omitempty"`
   420  	Tag              string                        `binapi:"string[],name=tag" json:"tag,omitempty"`
   421  }
   422  
   423  func (m *TapCreateV3) Reset()               { *m = TapCreateV3{} }
   424  func (*TapCreateV3) GetMessageName() string { return "tap_create_v3" }
   425  func (*TapCreateV3) GetCrcString() string   { return "3f3fd1df" }
   426  func (*TapCreateV3) GetMessageType() api.MessageType {
   427  	return api.RequestMessage
   428  }
   429  
   430  func (m *TapCreateV3) Size() (size int) {
   431  	if m == nil {
   432  		return 0
   433  	}
   434  	size += 4              // m.ID
   435  	size += 1              // m.UseRandomMac
   436  	size += 1 * 6          // m.MacAddress
   437  	size += 2              // m.NumRxQueues
   438  	size += 2              // m.NumTxQueues
   439  	size += 2              // m.TxRingSz
   440  	size += 2              // m.RxRingSz
   441  	size += 1              // m.HostMtuSet
   442  	size += 4              // m.HostMtuSize
   443  	size += 1              // m.HostMacAddrSet
   444  	size += 1 * 6          // m.HostMacAddr
   445  	size += 1              // m.HostIP4PrefixSet
   446  	size += 1 * 4          // m.HostIP4Prefix.Address
   447  	size += 1              // m.HostIP4Prefix.Len
   448  	size += 1              // m.HostIP6PrefixSet
   449  	size += 1 * 16         // m.HostIP6Prefix.Address
   450  	size += 1              // m.HostIP6Prefix.Len
   451  	size += 1              // m.HostIP4GwSet
   452  	size += 1 * 4          // m.HostIP4Gw
   453  	size += 1              // m.HostIP6GwSet
   454  	size += 1 * 16         // m.HostIP6Gw
   455  	size += 4              // m.TapFlags
   456  	size += 1              // m.HostNamespaceSet
   457  	size += 64             // m.HostNamespace
   458  	size += 1              // m.HostIfNameSet
   459  	size += 64             // m.HostIfName
   460  	size += 1              // m.HostBridgeSet
   461  	size += 64             // m.HostBridge
   462  	size += 4 + len(m.Tag) // m.Tag
   463  	return size
   464  }
   465  func (m *TapCreateV3) Marshal(b []byte) ([]byte, error) {
   466  	if b == nil {
   467  		b = make([]byte, m.Size())
   468  	}
   469  	buf := codec.NewBuffer(b)
   470  	buf.EncodeUint32(m.ID)
   471  	buf.EncodeBool(m.UseRandomMac)
   472  	buf.EncodeBytes(m.MacAddress[:], 6)
   473  	buf.EncodeUint16(m.NumRxQueues)
   474  	buf.EncodeUint16(m.NumTxQueues)
   475  	buf.EncodeUint16(m.TxRingSz)
   476  	buf.EncodeUint16(m.RxRingSz)
   477  	buf.EncodeBool(m.HostMtuSet)
   478  	buf.EncodeUint32(m.HostMtuSize)
   479  	buf.EncodeBool(m.HostMacAddrSet)
   480  	buf.EncodeBytes(m.HostMacAddr[:], 6)
   481  	buf.EncodeBool(m.HostIP4PrefixSet)
   482  	buf.EncodeBytes(m.HostIP4Prefix.Address[:], 4)
   483  	buf.EncodeUint8(m.HostIP4Prefix.Len)
   484  	buf.EncodeBool(m.HostIP6PrefixSet)
   485  	buf.EncodeBytes(m.HostIP6Prefix.Address[:], 16)
   486  	buf.EncodeUint8(m.HostIP6Prefix.Len)
   487  	buf.EncodeBool(m.HostIP4GwSet)
   488  	buf.EncodeBytes(m.HostIP4Gw[:], 4)
   489  	buf.EncodeBool(m.HostIP6GwSet)
   490  	buf.EncodeBytes(m.HostIP6Gw[:], 16)
   491  	buf.EncodeUint32(uint32(m.TapFlags))
   492  	buf.EncodeBool(m.HostNamespaceSet)
   493  	buf.EncodeString(m.HostNamespace, 64)
   494  	buf.EncodeBool(m.HostIfNameSet)
   495  	buf.EncodeString(m.HostIfName, 64)
   496  	buf.EncodeBool(m.HostBridgeSet)
   497  	buf.EncodeString(m.HostBridge, 64)
   498  	buf.EncodeString(m.Tag, 0)
   499  	return buf.Bytes(), nil
   500  }
   501  func (m *TapCreateV3) Unmarshal(b []byte) error {
   502  	buf := codec.NewBuffer(b)
   503  	m.ID = buf.DecodeUint32()
   504  	m.UseRandomMac = buf.DecodeBool()
   505  	copy(m.MacAddress[:], buf.DecodeBytes(6))
   506  	m.NumRxQueues = buf.DecodeUint16()
   507  	m.NumTxQueues = buf.DecodeUint16()
   508  	m.TxRingSz = buf.DecodeUint16()
   509  	m.RxRingSz = buf.DecodeUint16()
   510  	m.HostMtuSet = buf.DecodeBool()
   511  	m.HostMtuSize = buf.DecodeUint32()
   512  	m.HostMacAddrSet = buf.DecodeBool()
   513  	copy(m.HostMacAddr[:], buf.DecodeBytes(6))
   514  	m.HostIP4PrefixSet = buf.DecodeBool()
   515  	copy(m.HostIP4Prefix.Address[:], buf.DecodeBytes(4))
   516  	m.HostIP4Prefix.Len = buf.DecodeUint8()
   517  	m.HostIP6PrefixSet = buf.DecodeBool()
   518  	copy(m.HostIP6Prefix.Address[:], buf.DecodeBytes(16))
   519  	m.HostIP6Prefix.Len = buf.DecodeUint8()
   520  	m.HostIP4GwSet = buf.DecodeBool()
   521  	copy(m.HostIP4Gw[:], buf.DecodeBytes(4))
   522  	m.HostIP6GwSet = buf.DecodeBool()
   523  	copy(m.HostIP6Gw[:], buf.DecodeBytes(16))
   524  	m.TapFlags = TapFlags(buf.DecodeUint32())
   525  	m.HostNamespaceSet = buf.DecodeBool()
   526  	m.HostNamespace = buf.DecodeString(64)
   527  	m.HostIfNameSet = buf.DecodeBool()
   528  	m.HostIfName = buf.DecodeString(64)
   529  	m.HostBridgeSet = buf.DecodeBool()
   530  	m.HostBridge = buf.DecodeString(64)
   531  	m.Tag = buf.DecodeString(0)
   532  	return nil
   533  }
   534  
   535  // TapCreateV3Reply defines message 'tap_create_v3_reply'.
   536  type TapCreateV3Reply struct {
   537  	Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
   538  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   539  }
   540  
   541  func (m *TapCreateV3Reply) Reset()               { *m = TapCreateV3Reply{} }
   542  func (*TapCreateV3Reply) GetMessageName() string { return "tap_create_v3_reply" }
   543  func (*TapCreateV3Reply) GetCrcString() string   { return "5383d31f" }
   544  func (*TapCreateV3Reply) GetMessageType() api.MessageType {
   545  	return api.ReplyMessage
   546  }
   547  
   548  func (m *TapCreateV3Reply) Size() (size int) {
   549  	if m == nil {
   550  		return 0
   551  	}
   552  	size += 4 // m.Retval
   553  	size += 4 // m.SwIfIndex
   554  	return size
   555  }
   556  func (m *TapCreateV3Reply) Marshal(b []byte) ([]byte, error) {
   557  	if b == nil {
   558  		b = make([]byte, m.Size())
   559  	}
   560  	buf := codec.NewBuffer(b)
   561  	buf.EncodeInt32(m.Retval)
   562  	buf.EncodeUint32(uint32(m.SwIfIndex))
   563  	return buf.Bytes(), nil
   564  }
   565  func (m *TapCreateV3Reply) Unmarshal(b []byte) error {
   566  	buf := codec.NewBuffer(b)
   567  	m.Retval = buf.DecodeInt32()
   568  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   569  	return nil
   570  }
   571  
   572  // TapDeleteV2 defines message 'tap_delete_v2'.
   573  type TapDeleteV2 struct {
   574  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   575  }
   576  
   577  func (m *TapDeleteV2) Reset()               { *m = TapDeleteV2{} }
   578  func (*TapDeleteV2) GetMessageName() string { return "tap_delete_v2" }
   579  func (*TapDeleteV2) GetCrcString() string   { return "f9e6675e" }
   580  func (*TapDeleteV2) GetMessageType() api.MessageType {
   581  	return api.RequestMessage
   582  }
   583  
   584  func (m *TapDeleteV2) Size() (size int) {
   585  	if m == nil {
   586  		return 0
   587  	}
   588  	size += 4 // m.SwIfIndex
   589  	return size
   590  }
   591  func (m *TapDeleteV2) Marshal(b []byte) ([]byte, error) {
   592  	if b == nil {
   593  		b = make([]byte, m.Size())
   594  	}
   595  	buf := codec.NewBuffer(b)
   596  	buf.EncodeUint32(uint32(m.SwIfIndex))
   597  	return buf.Bytes(), nil
   598  }
   599  func (m *TapDeleteV2) Unmarshal(b []byte) error {
   600  	buf := codec.NewBuffer(b)
   601  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   602  	return nil
   603  }
   604  
   605  // TapDeleteV2Reply defines message 'tap_delete_v2_reply'.
   606  type TapDeleteV2Reply struct {
   607  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   608  }
   609  
   610  func (m *TapDeleteV2Reply) Reset()               { *m = TapDeleteV2Reply{} }
   611  func (*TapDeleteV2Reply) GetMessageName() string { return "tap_delete_v2_reply" }
   612  func (*TapDeleteV2Reply) GetCrcString() string   { return "e8d4e804" }
   613  func (*TapDeleteV2Reply) GetMessageType() api.MessageType {
   614  	return api.ReplyMessage
   615  }
   616  
   617  func (m *TapDeleteV2Reply) Size() (size int) {
   618  	if m == nil {
   619  		return 0
   620  	}
   621  	size += 4 // m.Retval
   622  	return size
   623  }
   624  func (m *TapDeleteV2Reply) Marshal(b []byte) ([]byte, error) {
   625  	if b == nil {
   626  		b = make([]byte, m.Size())
   627  	}
   628  	buf := codec.NewBuffer(b)
   629  	buf.EncodeInt32(m.Retval)
   630  	return buf.Bytes(), nil
   631  }
   632  func (m *TapDeleteV2Reply) Unmarshal(b []byte) error {
   633  	buf := codec.NewBuffer(b)
   634  	m.Retval = buf.DecodeInt32()
   635  	return nil
   636  }
   637  
   638  func init() { file_tapv2_binapi_init() }
   639  func file_tapv2_binapi_init() {
   640  	api.RegisterMessage((*SwInterfaceTapV2Details)(nil), "sw_interface_tap_v2_details_1e2b2a47")
   641  	api.RegisterMessage((*SwInterfaceTapV2Dump)(nil), "sw_interface_tap_v2_dump_f9e6675e")
   642  	api.RegisterMessage((*TapCreateV2)(nil), "tap_create_v2_2d0d6570")
   643  	api.RegisterMessage((*TapCreateV2Reply)(nil), "tap_create_v2_reply_5383d31f")
   644  	api.RegisterMessage((*TapCreateV3)(nil), "tap_create_v3_3f3fd1df")
   645  	api.RegisterMessage((*TapCreateV3Reply)(nil), "tap_create_v3_reply_5383d31f")
   646  	api.RegisterMessage((*TapDeleteV2)(nil), "tap_delete_v2_f9e6675e")
   647  	api.RegisterMessage((*TapDeleteV2Reply)(nil), "tap_delete_v2_reply_e8d4e804")
   648  }
   649  
   650  // Messages returns list of all messages in this module.
   651  func AllMessages() []api.Message {
   652  	return []api.Message{
   653  		(*SwInterfaceTapV2Details)(nil),
   654  		(*SwInterfaceTapV2Dump)(nil),
   655  		(*TapCreateV2)(nil),
   656  		(*TapCreateV2Reply)(nil),
   657  		(*TapCreateV3)(nil),
   658  		(*TapCreateV3Reply)(nil),
   659  		(*TapDeleteV2)(nil),
   660  		(*TapDeleteV2Reply)(nil),
   661  	}
   662  }