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

     1  // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
     2  
     3  // Package af_packet contains generated bindings for API file af_packet.api.
     4  //
     5  // Contents:
     6  // -  2 enums
     7  // - 12 messages
     8  package af_packet
     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  )
    18  
    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
    24  
    25  const (
    26  	APIFile    = "af_packet"
    27  	APIVersion = "2.0.0"
    28  	VersionCrc = 0x5b12de21
    29  )
    30  
    31  // AfPacketFlags defines enum 'af_packet_flags'.
    32  type AfPacketFlags uint32
    33  
    34  const (
    35  	AF_PACKET_API_FLAG_QDISC_BYPASS AfPacketFlags = 1
    36  	AF_PACKET_API_FLAG_CKSUM_GSO    AfPacketFlags = 2
    37  )
    38  
    39  var (
    40  	AfPacketFlags_name = map[uint32]string{
    41  		1: "AF_PACKET_API_FLAG_QDISC_BYPASS",
    42  		2: "AF_PACKET_API_FLAG_CKSUM_GSO",
    43  	}
    44  	AfPacketFlags_value = map[string]uint32{
    45  		"AF_PACKET_API_FLAG_QDISC_BYPASS": 1,
    46  		"AF_PACKET_API_FLAG_CKSUM_GSO":    2,
    47  	}
    48  )
    49  
    50  func (x AfPacketFlags) String() string {
    51  	s, ok := AfPacketFlags_name[uint32(x)]
    52  	if ok {
    53  		return s
    54  	}
    55  	str := func(n uint32) string {
    56  		s, ok := AfPacketFlags_name[uint32(n)]
    57  		if ok {
    58  			return s
    59  		}
    60  		return "AfPacketFlags(" + strconv.Itoa(int(n)) + ")"
    61  	}
    62  	for i := uint32(0); i <= 32; i++ {
    63  		val := uint32(x)
    64  		if val&(1<<i) != 0 {
    65  			if s != "" {
    66  				s += "|"
    67  			}
    68  			s += str(1 << i)
    69  		}
    70  	}
    71  	if s == "" {
    72  		return str(uint32(x))
    73  	}
    74  	return s
    75  }
    76  
    77  // AfPacketMode defines enum 'af_packet_mode'.
    78  type AfPacketMode uint32
    79  
    80  const (
    81  	AF_PACKET_API_MODE_ETHERNET AfPacketMode = 1
    82  	AF_PACKET_API_MODE_IP       AfPacketMode = 2
    83  )
    84  
    85  var (
    86  	AfPacketMode_name = map[uint32]string{
    87  		1: "AF_PACKET_API_MODE_ETHERNET",
    88  		2: "AF_PACKET_API_MODE_IP",
    89  	}
    90  	AfPacketMode_value = map[string]uint32{
    91  		"AF_PACKET_API_MODE_ETHERNET": 1,
    92  		"AF_PACKET_API_MODE_IP":       2,
    93  	}
    94  )
    95  
    96  func (x AfPacketMode) String() string {
    97  	s, ok := AfPacketMode_name[uint32(x)]
    98  	if ok {
    99  		return s
   100  	}
   101  	return "AfPacketMode(" + strconv.Itoa(int(x)) + ")"
   102  }
   103  
   104  // AfPacketCreate defines message 'af_packet_create'.
   105  type AfPacketCreate struct {
   106  	HwAddr          ethernet_types.MacAddress `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"`
   107  	UseRandomHwAddr bool                      `binapi:"bool,name=use_random_hw_addr" json:"use_random_hw_addr,omitempty"`
   108  	HostIfName      string                    `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"`
   109  }
   110  
   111  func (m *AfPacketCreate) Reset()               { *m = AfPacketCreate{} }
   112  func (*AfPacketCreate) GetMessageName() string { return "af_packet_create" }
   113  func (*AfPacketCreate) GetCrcString() string   { return "a190415f" }
   114  func (*AfPacketCreate) GetMessageType() api.MessageType {
   115  	return api.RequestMessage
   116  }
   117  
   118  func (m *AfPacketCreate) Size() (size int) {
   119  	if m == nil {
   120  		return 0
   121  	}
   122  	size += 1 * 6 // m.HwAddr
   123  	size += 1     // m.UseRandomHwAddr
   124  	size += 64    // m.HostIfName
   125  	return size
   126  }
   127  func (m *AfPacketCreate) Marshal(b []byte) ([]byte, error) {
   128  	if b == nil {
   129  		b = make([]byte, m.Size())
   130  	}
   131  	buf := codec.NewBuffer(b)
   132  	buf.EncodeBytes(m.HwAddr[:], 6)
   133  	buf.EncodeBool(m.UseRandomHwAddr)
   134  	buf.EncodeString(m.HostIfName, 64)
   135  	return buf.Bytes(), nil
   136  }
   137  func (m *AfPacketCreate) Unmarshal(b []byte) error {
   138  	buf := codec.NewBuffer(b)
   139  	copy(m.HwAddr[:], buf.DecodeBytes(6))
   140  	m.UseRandomHwAddr = buf.DecodeBool()
   141  	m.HostIfName = buf.DecodeString(64)
   142  	return nil
   143  }
   144  
   145  // AfPacketCreateReply defines message 'af_packet_create_reply'.
   146  type AfPacketCreateReply struct {
   147  	Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
   148  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   149  }
   150  
   151  func (m *AfPacketCreateReply) Reset()               { *m = AfPacketCreateReply{} }
   152  func (*AfPacketCreateReply) GetMessageName() string { return "af_packet_create_reply" }
   153  func (*AfPacketCreateReply) GetCrcString() string   { return "5383d31f" }
   154  func (*AfPacketCreateReply) GetMessageType() api.MessageType {
   155  	return api.ReplyMessage
   156  }
   157  
   158  func (m *AfPacketCreateReply) Size() (size int) {
   159  	if m == nil {
   160  		return 0
   161  	}
   162  	size += 4 // m.Retval
   163  	size += 4 // m.SwIfIndex
   164  	return size
   165  }
   166  func (m *AfPacketCreateReply) Marshal(b []byte) ([]byte, error) {
   167  	if b == nil {
   168  		b = make([]byte, m.Size())
   169  	}
   170  	buf := codec.NewBuffer(b)
   171  	buf.EncodeInt32(m.Retval)
   172  	buf.EncodeUint32(uint32(m.SwIfIndex))
   173  	return buf.Bytes(), nil
   174  }
   175  func (m *AfPacketCreateReply) Unmarshal(b []byte) error {
   176  	buf := codec.NewBuffer(b)
   177  	m.Retval = buf.DecodeInt32()
   178  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   179  	return nil
   180  }
   181  
   182  // AfPacketCreateV2 defines message 'af_packet_create_v2'.
   183  type AfPacketCreateV2 struct {
   184  	HwAddr           ethernet_types.MacAddress `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"`
   185  	UseRandomHwAddr  bool                      `binapi:"bool,name=use_random_hw_addr" json:"use_random_hw_addr,omitempty"`
   186  	HostIfName       string                    `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"`
   187  	RxFrameSize      uint32                    `binapi:"u32,name=rx_frame_size" json:"rx_frame_size,omitempty"`
   188  	TxFrameSize      uint32                    `binapi:"u32,name=tx_frame_size" json:"tx_frame_size,omitempty"`
   189  	RxFramesPerBlock uint32                    `binapi:"u32,name=rx_frames_per_block" json:"rx_frames_per_block,omitempty"`
   190  	TxFramesPerBlock uint32                    `binapi:"u32,name=tx_frames_per_block" json:"tx_frames_per_block,omitempty"`
   191  	Flags            uint32                    `binapi:"u32,name=flags" json:"flags,omitempty"`
   192  	NumRxQueues      uint16                    `binapi:"u16,name=num_rx_queues,default=1" json:"num_rx_queues,omitempty"`
   193  }
   194  
   195  func (m *AfPacketCreateV2) Reset()               { *m = AfPacketCreateV2{} }
   196  func (*AfPacketCreateV2) GetMessageName() string { return "af_packet_create_v2" }
   197  func (*AfPacketCreateV2) GetCrcString() string   { return "4aff0436" }
   198  func (*AfPacketCreateV2) GetMessageType() api.MessageType {
   199  	return api.RequestMessage
   200  }
   201  
   202  func (m *AfPacketCreateV2) Size() (size int) {
   203  	if m == nil {
   204  		return 0
   205  	}
   206  	size += 1 * 6 // m.HwAddr
   207  	size += 1     // m.UseRandomHwAddr
   208  	size += 64    // m.HostIfName
   209  	size += 4     // m.RxFrameSize
   210  	size += 4     // m.TxFrameSize
   211  	size += 4     // m.RxFramesPerBlock
   212  	size += 4     // m.TxFramesPerBlock
   213  	size += 4     // m.Flags
   214  	size += 2     // m.NumRxQueues
   215  	return size
   216  }
   217  func (m *AfPacketCreateV2) Marshal(b []byte) ([]byte, error) {
   218  	if b == nil {
   219  		b = make([]byte, m.Size())
   220  	}
   221  	buf := codec.NewBuffer(b)
   222  	buf.EncodeBytes(m.HwAddr[:], 6)
   223  	buf.EncodeBool(m.UseRandomHwAddr)
   224  	buf.EncodeString(m.HostIfName, 64)
   225  	buf.EncodeUint32(m.RxFrameSize)
   226  	buf.EncodeUint32(m.TxFrameSize)
   227  	buf.EncodeUint32(m.RxFramesPerBlock)
   228  	buf.EncodeUint32(m.TxFramesPerBlock)
   229  	buf.EncodeUint32(m.Flags)
   230  	buf.EncodeUint16(m.NumRxQueues)
   231  	return buf.Bytes(), nil
   232  }
   233  func (m *AfPacketCreateV2) Unmarshal(b []byte) error {
   234  	buf := codec.NewBuffer(b)
   235  	copy(m.HwAddr[:], buf.DecodeBytes(6))
   236  	m.UseRandomHwAddr = buf.DecodeBool()
   237  	m.HostIfName = buf.DecodeString(64)
   238  	m.RxFrameSize = buf.DecodeUint32()
   239  	m.TxFrameSize = buf.DecodeUint32()
   240  	m.RxFramesPerBlock = buf.DecodeUint32()
   241  	m.TxFramesPerBlock = buf.DecodeUint32()
   242  	m.Flags = buf.DecodeUint32()
   243  	m.NumRxQueues = buf.DecodeUint16()
   244  	return nil
   245  }
   246  
   247  // AfPacketCreateV2Reply defines message 'af_packet_create_v2_reply'.
   248  type AfPacketCreateV2Reply struct {
   249  	Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
   250  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   251  }
   252  
   253  func (m *AfPacketCreateV2Reply) Reset()               { *m = AfPacketCreateV2Reply{} }
   254  func (*AfPacketCreateV2Reply) GetMessageName() string { return "af_packet_create_v2_reply" }
   255  func (*AfPacketCreateV2Reply) GetCrcString() string   { return "5383d31f" }
   256  func (*AfPacketCreateV2Reply) GetMessageType() api.MessageType {
   257  	return api.ReplyMessage
   258  }
   259  
   260  func (m *AfPacketCreateV2Reply) Size() (size int) {
   261  	if m == nil {
   262  		return 0
   263  	}
   264  	size += 4 // m.Retval
   265  	size += 4 // m.SwIfIndex
   266  	return size
   267  }
   268  func (m *AfPacketCreateV2Reply) Marshal(b []byte) ([]byte, error) {
   269  	if b == nil {
   270  		b = make([]byte, m.Size())
   271  	}
   272  	buf := codec.NewBuffer(b)
   273  	buf.EncodeInt32(m.Retval)
   274  	buf.EncodeUint32(uint32(m.SwIfIndex))
   275  	return buf.Bytes(), nil
   276  }
   277  func (m *AfPacketCreateV2Reply) Unmarshal(b []byte) error {
   278  	buf := codec.NewBuffer(b)
   279  	m.Retval = buf.DecodeInt32()
   280  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   281  	return nil
   282  }
   283  
   284  // AfPacketCreateV3 defines message 'af_packet_create_v3'.
   285  type AfPacketCreateV3 struct {
   286  	Mode             AfPacketMode              `binapi:"af_packet_mode,name=mode" json:"mode,omitempty"`
   287  	HwAddr           ethernet_types.MacAddress `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"`
   288  	UseRandomHwAddr  bool                      `binapi:"bool,name=use_random_hw_addr" json:"use_random_hw_addr,omitempty"`
   289  	HostIfName       string                    `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"`
   290  	RxFrameSize      uint32                    `binapi:"u32,name=rx_frame_size" json:"rx_frame_size,omitempty"`
   291  	TxFrameSize      uint32                    `binapi:"u32,name=tx_frame_size" json:"tx_frame_size,omitempty"`
   292  	RxFramesPerBlock uint32                    `binapi:"u32,name=rx_frames_per_block" json:"rx_frames_per_block,omitempty"`
   293  	TxFramesPerBlock uint32                    `binapi:"u32,name=tx_frames_per_block" json:"tx_frames_per_block,omitempty"`
   294  	Flags            AfPacketFlags             `binapi:"af_packet_flags,name=flags" json:"flags,omitempty"`
   295  	NumRxQueues      uint16                    `binapi:"u16,name=num_rx_queues,default=1" json:"num_rx_queues,omitempty"`
   296  	NumTxQueues      uint16                    `binapi:"u16,name=num_tx_queues,default=1" json:"num_tx_queues,omitempty"`
   297  }
   298  
   299  func (m *AfPacketCreateV3) Reset()               { *m = AfPacketCreateV3{} }
   300  func (*AfPacketCreateV3) GetMessageName() string { return "af_packet_create_v3" }
   301  func (*AfPacketCreateV3) GetCrcString() string   { return "b3a809d4" }
   302  func (*AfPacketCreateV3) GetMessageType() api.MessageType {
   303  	return api.RequestMessage
   304  }
   305  
   306  func (m *AfPacketCreateV3) Size() (size int) {
   307  	if m == nil {
   308  		return 0
   309  	}
   310  	size += 4     // m.Mode
   311  	size += 1 * 6 // m.HwAddr
   312  	size += 1     // m.UseRandomHwAddr
   313  	size += 64    // m.HostIfName
   314  	size += 4     // m.RxFrameSize
   315  	size += 4     // m.TxFrameSize
   316  	size += 4     // m.RxFramesPerBlock
   317  	size += 4     // m.TxFramesPerBlock
   318  	size += 4     // m.Flags
   319  	size += 2     // m.NumRxQueues
   320  	size += 2     // m.NumTxQueues
   321  	return size
   322  }
   323  func (m *AfPacketCreateV3) Marshal(b []byte) ([]byte, error) {
   324  	if b == nil {
   325  		b = make([]byte, m.Size())
   326  	}
   327  	buf := codec.NewBuffer(b)
   328  	buf.EncodeUint32(uint32(m.Mode))
   329  	buf.EncodeBytes(m.HwAddr[:], 6)
   330  	buf.EncodeBool(m.UseRandomHwAddr)
   331  	buf.EncodeString(m.HostIfName, 64)
   332  	buf.EncodeUint32(m.RxFrameSize)
   333  	buf.EncodeUint32(m.TxFrameSize)
   334  	buf.EncodeUint32(m.RxFramesPerBlock)
   335  	buf.EncodeUint32(m.TxFramesPerBlock)
   336  	buf.EncodeUint32(uint32(m.Flags))
   337  	buf.EncodeUint16(m.NumRxQueues)
   338  	buf.EncodeUint16(m.NumTxQueues)
   339  	return buf.Bytes(), nil
   340  }
   341  func (m *AfPacketCreateV3) Unmarshal(b []byte) error {
   342  	buf := codec.NewBuffer(b)
   343  	m.Mode = AfPacketMode(buf.DecodeUint32())
   344  	copy(m.HwAddr[:], buf.DecodeBytes(6))
   345  	m.UseRandomHwAddr = buf.DecodeBool()
   346  	m.HostIfName = buf.DecodeString(64)
   347  	m.RxFrameSize = buf.DecodeUint32()
   348  	m.TxFrameSize = buf.DecodeUint32()
   349  	m.RxFramesPerBlock = buf.DecodeUint32()
   350  	m.TxFramesPerBlock = buf.DecodeUint32()
   351  	m.Flags = AfPacketFlags(buf.DecodeUint32())
   352  	m.NumRxQueues = buf.DecodeUint16()
   353  	m.NumTxQueues = buf.DecodeUint16()
   354  	return nil
   355  }
   356  
   357  // AfPacketCreateV3Reply defines message 'af_packet_create_v3_reply'.
   358  type AfPacketCreateV3Reply struct {
   359  	Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
   360  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   361  }
   362  
   363  func (m *AfPacketCreateV3Reply) Reset()               { *m = AfPacketCreateV3Reply{} }
   364  func (*AfPacketCreateV3Reply) GetMessageName() string { return "af_packet_create_v3_reply" }
   365  func (*AfPacketCreateV3Reply) GetCrcString() string   { return "5383d31f" }
   366  func (*AfPacketCreateV3Reply) GetMessageType() api.MessageType {
   367  	return api.ReplyMessage
   368  }
   369  
   370  func (m *AfPacketCreateV3Reply) Size() (size int) {
   371  	if m == nil {
   372  		return 0
   373  	}
   374  	size += 4 // m.Retval
   375  	size += 4 // m.SwIfIndex
   376  	return size
   377  }
   378  func (m *AfPacketCreateV3Reply) Marshal(b []byte) ([]byte, error) {
   379  	if b == nil {
   380  		b = make([]byte, m.Size())
   381  	}
   382  	buf := codec.NewBuffer(b)
   383  	buf.EncodeInt32(m.Retval)
   384  	buf.EncodeUint32(uint32(m.SwIfIndex))
   385  	return buf.Bytes(), nil
   386  }
   387  func (m *AfPacketCreateV3Reply) Unmarshal(b []byte) error {
   388  	buf := codec.NewBuffer(b)
   389  	m.Retval = buf.DecodeInt32()
   390  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   391  	return nil
   392  }
   393  
   394  // AfPacketDelete defines message 'af_packet_delete'.
   395  type AfPacketDelete struct {
   396  	HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"`
   397  }
   398  
   399  func (m *AfPacketDelete) Reset()               { *m = AfPacketDelete{} }
   400  func (*AfPacketDelete) GetMessageName() string { return "af_packet_delete" }
   401  func (*AfPacketDelete) GetCrcString() string   { return "863fa648" }
   402  func (*AfPacketDelete) GetMessageType() api.MessageType {
   403  	return api.RequestMessage
   404  }
   405  
   406  func (m *AfPacketDelete) Size() (size int) {
   407  	if m == nil {
   408  		return 0
   409  	}
   410  	size += 64 // m.HostIfName
   411  	return size
   412  }
   413  func (m *AfPacketDelete) Marshal(b []byte) ([]byte, error) {
   414  	if b == nil {
   415  		b = make([]byte, m.Size())
   416  	}
   417  	buf := codec.NewBuffer(b)
   418  	buf.EncodeString(m.HostIfName, 64)
   419  	return buf.Bytes(), nil
   420  }
   421  func (m *AfPacketDelete) Unmarshal(b []byte) error {
   422  	buf := codec.NewBuffer(b)
   423  	m.HostIfName = buf.DecodeString(64)
   424  	return nil
   425  }
   426  
   427  // AfPacketDeleteReply defines message 'af_packet_delete_reply'.
   428  type AfPacketDeleteReply struct {
   429  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   430  }
   431  
   432  func (m *AfPacketDeleteReply) Reset()               { *m = AfPacketDeleteReply{} }
   433  func (*AfPacketDeleteReply) GetMessageName() string { return "af_packet_delete_reply" }
   434  func (*AfPacketDeleteReply) GetCrcString() string   { return "e8d4e804" }
   435  func (*AfPacketDeleteReply) GetMessageType() api.MessageType {
   436  	return api.ReplyMessage
   437  }
   438  
   439  func (m *AfPacketDeleteReply) Size() (size int) {
   440  	if m == nil {
   441  		return 0
   442  	}
   443  	size += 4 // m.Retval
   444  	return size
   445  }
   446  func (m *AfPacketDeleteReply) Marshal(b []byte) ([]byte, error) {
   447  	if b == nil {
   448  		b = make([]byte, m.Size())
   449  	}
   450  	buf := codec.NewBuffer(b)
   451  	buf.EncodeInt32(m.Retval)
   452  	return buf.Bytes(), nil
   453  }
   454  func (m *AfPacketDeleteReply) Unmarshal(b []byte) error {
   455  	buf := codec.NewBuffer(b)
   456  	m.Retval = buf.DecodeInt32()
   457  	return nil
   458  }
   459  
   460  // AfPacketDetails defines message 'af_packet_details'.
   461  type AfPacketDetails struct {
   462  	SwIfIndex  interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   463  	HostIfName string                         `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"`
   464  }
   465  
   466  func (m *AfPacketDetails) Reset()               { *m = AfPacketDetails{} }
   467  func (*AfPacketDetails) GetMessageName() string { return "af_packet_details" }
   468  func (*AfPacketDetails) GetCrcString() string   { return "58c7c042" }
   469  func (*AfPacketDetails) GetMessageType() api.MessageType {
   470  	return api.ReplyMessage
   471  }
   472  
   473  func (m *AfPacketDetails) Size() (size int) {
   474  	if m == nil {
   475  		return 0
   476  	}
   477  	size += 4  // m.SwIfIndex
   478  	size += 64 // m.HostIfName
   479  	return size
   480  }
   481  func (m *AfPacketDetails) Marshal(b []byte) ([]byte, error) {
   482  	if b == nil {
   483  		b = make([]byte, m.Size())
   484  	}
   485  	buf := codec.NewBuffer(b)
   486  	buf.EncodeUint32(uint32(m.SwIfIndex))
   487  	buf.EncodeString(m.HostIfName, 64)
   488  	return buf.Bytes(), nil
   489  }
   490  func (m *AfPacketDetails) Unmarshal(b []byte) error {
   491  	buf := codec.NewBuffer(b)
   492  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   493  	m.HostIfName = buf.DecodeString(64)
   494  	return nil
   495  }
   496  
   497  // AfPacketDump defines message 'af_packet_dump'.
   498  type AfPacketDump struct{}
   499  
   500  func (m *AfPacketDump) Reset()               { *m = AfPacketDump{} }
   501  func (*AfPacketDump) GetMessageName() string { return "af_packet_dump" }
   502  func (*AfPacketDump) GetCrcString() string   { return "51077d14" }
   503  func (*AfPacketDump) GetMessageType() api.MessageType {
   504  	return api.RequestMessage
   505  }
   506  
   507  func (m *AfPacketDump) Size() (size int) {
   508  	if m == nil {
   509  		return 0
   510  	}
   511  	return size
   512  }
   513  func (m *AfPacketDump) Marshal(b []byte) ([]byte, error) {
   514  	if b == nil {
   515  		b = make([]byte, m.Size())
   516  	}
   517  	buf := codec.NewBuffer(b)
   518  	return buf.Bytes(), nil
   519  }
   520  func (m *AfPacketDump) Unmarshal(b []byte) error {
   521  	return nil
   522  }
   523  
   524  // AfPacketSetL4CksumOffload defines message 'af_packet_set_l4_cksum_offload'.
   525  type AfPacketSetL4CksumOffload struct {
   526  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   527  	Set       bool                           `binapi:"bool,name=set" json:"set,omitempty"`
   528  }
   529  
   530  func (m *AfPacketSetL4CksumOffload) Reset()               { *m = AfPacketSetL4CksumOffload{} }
   531  func (*AfPacketSetL4CksumOffload) GetMessageName() string { return "af_packet_set_l4_cksum_offload" }
   532  func (*AfPacketSetL4CksumOffload) GetCrcString() string   { return "319cd5c8" }
   533  func (*AfPacketSetL4CksumOffload) GetMessageType() api.MessageType {
   534  	return api.RequestMessage
   535  }
   536  
   537  func (m *AfPacketSetL4CksumOffload) Size() (size int) {
   538  	if m == nil {
   539  		return 0
   540  	}
   541  	size += 4 // m.SwIfIndex
   542  	size += 1 // m.Set
   543  	return size
   544  }
   545  func (m *AfPacketSetL4CksumOffload) Marshal(b []byte) ([]byte, error) {
   546  	if b == nil {
   547  		b = make([]byte, m.Size())
   548  	}
   549  	buf := codec.NewBuffer(b)
   550  	buf.EncodeUint32(uint32(m.SwIfIndex))
   551  	buf.EncodeBool(m.Set)
   552  	return buf.Bytes(), nil
   553  }
   554  func (m *AfPacketSetL4CksumOffload) Unmarshal(b []byte) error {
   555  	buf := codec.NewBuffer(b)
   556  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   557  	m.Set = buf.DecodeBool()
   558  	return nil
   559  }
   560  
   561  // AfPacketSetL4CksumOffloadReply defines message 'af_packet_set_l4_cksum_offload_reply'.
   562  type AfPacketSetL4CksumOffloadReply struct {
   563  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   564  }
   565  
   566  func (m *AfPacketSetL4CksumOffloadReply) Reset() { *m = AfPacketSetL4CksumOffloadReply{} }
   567  func (*AfPacketSetL4CksumOffloadReply) GetMessageName() string {
   568  	return "af_packet_set_l4_cksum_offload_reply"
   569  }
   570  func (*AfPacketSetL4CksumOffloadReply) GetCrcString() string { return "e8d4e804" }
   571  func (*AfPacketSetL4CksumOffloadReply) GetMessageType() api.MessageType {
   572  	return api.ReplyMessage
   573  }
   574  
   575  func (m *AfPacketSetL4CksumOffloadReply) Size() (size int) {
   576  	if m == nil {
   577  		return 0
   578  	}
   579  	size += 4 // m.Retval
   580  	return size
   581  }
   582  func (m *AfPacketSetL4CksumOffloadReply) Marshal(b []byte) ([]byte, error) {
   583  	if b == nil {
   584  		b = make([]byte, m.Size())
   585  	}
   586  	buf := codec.NewBuffer(b)
   587  	buf.EncodeInt32(m.Retval)
   588  	return buf.Bytes(), nil
   589  }
   590  func (m *AfPacketSetL4CksumOffloadReply) Unmarshal(b []byte) error {
   591  	buf := codec.NewBuffer(b)
   592  	m.Retval = buf.DecodeInt32()
   593  	return nil
   594  }
   595  
   596  func init() { file_af_packet_binapi_init() }
   597  func file_af_packet_binapi_init() {
   598  	api.RegisterMessage((*AfPacketCreate)(nil), "af_packet_create_a190415f")
   599  	api.RegisterMessage((*AfPacketCreateReply)(nil), "af_packet_create_reply_5383d31f")
   600  	api.RegisterMessage((*AfPacketCreateV2)(nil), "af_packet_create_v2_4aff0436")
   601  	api.RegisterMessage((*AfPacketCreateV2Reply)(nil), "af_packet_create_v2_reply_5383d31f")
   602  	api.RegisterMessage((*AfPacketCreateV3)(nil), "af_packet_create_v3_b3a809d4")
   603  	api.RegisterMessage((*AfPacketCreateV3Reply)(nil), "af_packet_create_v3_reply_5383d31f")
   604  	api.RegisterMessage((*AfPacketDelete)(nil), "af_packet_delete_863fa648")
   605  	api.RegisterMessage((*AfPacketDeleteReply)(nil), "af_packet_delete_reply_e8d4e804")
   606  	api.RegisterMessage((*AfPacketDetails)(nil), "af_packet_details_58c7c042")
   607  	api.RegisterMessage((*AfPacketDump)(nil), "af_packet_dump_51077d14")
   608  	api.RegisterMessage((*AfPacketSetL4CksumOffload)(nil), "af_packet_set_l4_cksum_offload_319cd5c8")
   609  	api.RegisterMessage((*AfPacketSetL4CksumOffloadReply)(nil), "af_packet_set_l4_cksum_offload_reply_e8d4e804")
   610  }
   611  
   612  // Messages returns list of all messages in this module.
   613  func AllMessages() []api.Message {
   614  	return []api.Message{
   615  		(*AfPacketCreate)(nil),
   616  		(*AfPacketCreateReply)(nil),
   617  		(*AfPacketCreateV2)(nil),
   618  		(*AfPacketCreateV2Reply)(nil),
   619  		(*AfPacketCreateV3)(nil),
   620  		(*AfPacketCreateV3Reply)(nil),
   621  		(*AfPacketDelete)(nil),
   622  		(*AfPacketDeleteReply)(nil),
   623  		(*AfPacketDetails)(nil),
   624  		(*AfPacketDump)(nil),
   625  		(*AfPacketSetL4CksumOffload)(nil),
   626  		(*AfPacketSetL4CksumOffloadReply)(nil),
   627  	}
   628  }