github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/avf/avf.ba.go (about)

     1  // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
     2  // versions:
     3  //  binapi-generator: v0.10.0-dev
     4  //  VPP:              23.10-rc0~170-g6f1548434
     5  // source: plugins/avf.api.json
     6  
     7  // Package avf contains generated bindings for API file avf.api.
     8  //
     9  // Contents:
    10  // -  4 messages
    11  package avf
    12  
    13  import (
    14  	interface_types "github.com/networkservicemesh/govpp/binapi/interface_types"
    15  	api "go.fd.io/govpp/api"
    16  	codec "go.fd.io/govpp/codec"
    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    = "avf"
    27  	APIVersion = "1.0.0"
    28  	VersionCrc = 0x9f5a6a20
    29  )
    30  
    31  // - client_index - opaque cookie to identify the sender
    32  //   - pci_addr - pci address as unsigned 32bit integer:
    33  //     0-15 domain, 16-23 bus, 24-28 slot, 29-31 function
    34  //     ddddddddddddddddbbbbbbbbsssssfff
    35  //   - rxq_num - number of receive queues
    36  //   - rxq_size - receive queue size
    37  //   - txq_size - transmit queue size
    38  //
    39  // AvfCreate defines message 'avf_create'.
    40  type AvfCreate struct {
    41  	PciAddr    uint32 `binapi:"u32,name=pci_addr" json:"pci_addr,omitempty"`
    42  	EnableElog int32  `binapi:"i32,name=enable_elog" json:"enable_elog,omitempty"`
    43  	RxqNum     uint16 `binapi:"u16,name=rxq_num" json:"rxq_num,omitempty"`
    44  	RxqSize    uint16 `binapi:"u16,name=rxq_size" json:"rxq_size,omitempty"`
    45  	TxqSize    uint16 `binapi:"u16,name=txq_size" json:"txq_size,omitempty"`
    46  }
    47  
    48  func (m *AvfCreate) Reset()               { *m = AvfCreate{} }
    49  func (*AvfCreate) GetMessageName() string { return "avf_create" }
    50  func (*AvfCreate) GetCrcString() string   { return "daab8ae2" }
    51  func (*AvfCreate) GetMessageType() api.MessageType {
    52  	return api.RequestMessage
    53  }
    54  
    55  func (m *AvfCreate) Size() (size int) {
    56  	if m == nil {
    57  		return 0
    58  	}
    59  	size += 4 // m.PciAddr
    60  	size += 4 // m.EnableElog
    61  	size += 2 // m.RxqNum
    62  	size += 2 // m.RxqSize
    63  	size += 2 // m.TxqSize
    64  	return size
    65  }
    66  func (m *AvfCreate) Marshal(b []byte) ([]byte, error) {
    67  	if b == nil {
    68  		b = make([]byte, m.Size())
    69  	}
    70  	buf := codec.NewBuffer(b)
    71  	buf.EncodeUint32(m.PciAddr)
    72  	buf.EncodeInt32(m.EnableElog)
    73  	buf.EncodeUint16(m.RxqNum)
    74  	buf.EncodeUint16(m.RxqSize)
    75  	buf.EncodeUint16(m.TxqSize)
    76  	return buf.Bytes(), nil
    77  }
    78  func (m *AvfCreate) Unmarshal(b []byte) error {
    79  	buf := codec.NewBuffer(b)
    80  	m.PciAddr = buf.DecodeUint32()
    81  	m.EnableElog = buf.DecodeInt32()
    82  	m.RxqNum = buf.DecodeUint16()
    83  	m.RxqSize = buf.DecodeUint16()
    84  	m.TxqSize = buf.DecodeUint16()
    85  	return nil
    86  }
    87  
    88  // - context - sender context, to match reply w/ request
    89  //   - retval - return value for request
    90  //   - sw_if_index - software index for the new avf interface
    91  //
    92  // AvfCreateReply defines message 'avf_create_reply'.
    93  type AvfCreateReply struct {
    94  	Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
    95  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
    96  }
    97  
    98  func (m *AvfCreateReply) Reset()               { *m = AvfCreateReply{} }
    99  func (*AvfCreateReply) GetMessageName() string { return "avf_create_reply" }
   100  func (*AvfCreateReply) GetCrcString() string   { return "5383d31f" }
   101  func (*AvfCreateReply) GetMessageType() api.MessageType {
   102  	return api.ReplyMessage
   103  }
   104  
   105  func (m *AvfCreateReply) Size() (size int) {
   106  	if m == nil {
   107  		return 0
   108  	}
   109  	size += 4 // m.Retval
   110  	size += 4 // m.SwIfIndex
   111  	return size
   112  }
   113  func (m *AvfCreateReply) Marshal(b []byte) ([]byte, error) {
   114  	if b == nil {
   115  		b = make([]byte, m.Size())
   116  	}
   117  	buf := codec.NewBuffer(b)
   118  	buf.EncodeInt32(m.Retval)
   119  	buf.EncodeUint32(uint32(m.SwIfIndex))
   120  	return buf.Bytes(), nil
   121  }
   122  func (m *AvfCreateReply) Unmarshal(b []byte) error {
   123  	buf := codec.NewBuffer(b)
   124  	m.Retval = buf.DecodeInt32()
   125  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   126  	return nil
   127  }
   128  
   129  // - client_index - opaque cookie to identify the sender
   130  //   - sw_if_index - interface index
   131  //
   132  // AvfDelete defines message 'avf_delete'.
   133  type AvfDelete struct {
   134  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   135  }
   136  
   137  func (m *AvfDelete) Reset()               { *m = AvfDelete{} }
   138  func (*AvfDelete) GetMessageName() string { return "avf_delete" }
   139  func (*AvfDelete) GetCrcString() string   { return "f9e6675e" }
   140  func (*AvfDelete) GetMessageType() api.MessageType {
   141  	return api.RequestMessage
   142  }
   143  
   144  func (m *AvfDelete) Size() (size int) {
   145  	if m == nil {
   146  		return 0
   147  	}
   148  	size += 4 // m.SwIfIndex
   149  	return size
   150  }
   151  func (m *AvfDelete) Marshal(b []byte) ([]byte, error) {
   152  	if b == nil {
   153  		b = make([]byte, m.Size())
   154  	}
   155  	buf := codec.NewBuffer(b)
   156  	buf.EncodeUint32(uint32(m.SwIfIndex))
   157  	return buf.Bytes(), nil
   158  }
   159  func (m *AvfDelete) Unmarshal(b []byte) error {
   160  	buf := codec.NewBuffer(b)
   161  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   162  	return nil
   163  }
   164  
   165  // AvfDeleteReply defines message 'avf_delete_reply'.
   166  type AvfDeleteReply struct {
   167  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   168  }
   169  
   170  func (m *AvfDeleteReply) Reset()               { *m = AvfDeleteReply{} }
   171  func (*AvfDeleteReply) GetMessageName() string { return "avf_delete_reply" }
   172  func (*AvfDeleteReply) GetCrcString() string   { return "e8d4e804" }
   173  func (*AvfDeleteReply) GetMessageType() api.MessageType {
   174  	return api.ReplyMessage
   175  }
   176  
   177  func (m *AvfDeleteReply) Size() (size int) {
   178  	if m == nil {
   179  		return 0
   180  	}
   181  	size += 4 // m.Retval
   182  	return size
   183  }
   184  func (m *AvfDeleteReply) Marshal(b []byte) ([]byte, error) {
   185  	if b == nil {
   186  		b = make([]byte, m.Size())
   187  	}
   188  	buf := codec.NewBuffer(b)
   189  	buf.EncodeInt32(m.Retval)
   190  	return buf.Bytes(), nil
   191  }
   192  func (m *AvfDeleteReply) Unmarshal(b []byte) error {
   193  	buf := codec.NewBuffer(b)
   194  	m.Retval = buf.DecodeInt32()
   195  	return nil
   196  }
   197  
   198  func init() { file_avf_binapi_init() }
   199  func file_avf_binapi_init() {
   200  	api.RegisterMessage((*AvfCreate)(nil), "avf_create_daab8ae2")
   201  	api.RegisterMessage((*AvfCreateReply)(nil), "avf_create_reply_5383d31f")
   202  	api.RegisterMessage((*AvfDelete)(nil), "avf_delete_f9e6675e")
   203  	api.RegisterMessage((*AvfDeleteReply)(nil), "avf_delete_reply_e8d4e804")
   204  }
   205  
   206  // Messages returns list of all messages in this module.
   207  func AllMessages() []api.Message {
   208  	return []api.Message{
   209  		(*AvfCreate)(nil),
   210  		(*AvfCreateReply)(nil),
   211  		(*AvfDelete)(nil),
   212  		(*AvfDeleteReply)(nil),
   213  	}
   214  }