github.com/edwarnicke/govpp@v0.0.0-20230130211138-14ef5d20b1d0/binapi/l2e/l2e.ba.go (about)

     1  // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
     2  // versions:
     3  //  binapi-generator: v0.4.0-dev
     4  //  VPP:              22.02-rc0~165-g4b8b64f97
     5  // source: /usr/share/vpp/api/plugins/l2e.api.json
     6  
     7  // Package l2e contains generated bindings for API file l2e.api.
     8  //
     9  // Contents:
    10  //   2 messages
    11  //
    12  package l2e
    13  
    14  import (
    15  	api "git.fd.io/govpp.git/api"
    16  	codec "git.fd.io/govpp.git/codec"
    17  	interface_types "github.com/edwarnicke/govpp/binapi/interface_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    = "l2e"
    28  	APIVersion = "1.0.0"
    29  	VersionCrc = 0x6e8abdfb
    30  )
    31  
    32  // L2Emulation defines message 'l2_emulation'.
    33  // InProgress: the message form may change in the future versions
    34  type L2Emulation struct {
    35  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
    36  	Enable    bool                           `binapi:"bool,name=enable" json:"enable,omitempty"`
    37  }
    38  
    39  func (m *L2Emulation) Reset()               { *m = L2Emulation{} }
    40  func (*L2Emulation) GetMessageName() string { return "l2_emulation" }
    41  func (*L2Emulation) GetCrcString() string   { return "ae6cfcfb" }
    42  func (*L2Emulation) GetMessageType() api.MessageType {
    43  	return api.RequestMessage
    44  }
    45  
    46  func (m *L2Emulation) Size() (size int) {
    47  	if m == nil {
    48  		return 0
    49  	}
    50  	size += 4 // m.SwIfIndex
    51  	size += 1 // m.Enable
    52  	return size
    53  }
    54  func (m *L2Emulation) Marshal(b []byte) ([]byte, error) {
    55  	if b == nil {
    56  		b = make([]byte, m.Size())
    57  	}
    58  	buf := codec.NewBuffer(b)
    59  	buf.EncodeUint32(uint32(m.SwIfIndex))
    60  	buf.EncodeBool(m.Enable)
    61  	return buf.Bytes(), nil
    62  }
    63  func (m *L2Emulation) Unmarshal(b []byte) error {
    64  	buf := codec.NewBuffer(b)
    65  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
    66  	m.Enable = buf.DecodeBool()
    67  	return nil
    68  }
    69  
    70  // L2EmulationReply defines message 'l2_emulation_reply'.
    71  // InProgress: the message form may change in the future versions
    72  type L2EmulationReply struct {
    73  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
    74  }
    75  
    76  func (m *L2EmulationReply) Reset()               { *m = L2EmulationReply{} }
    77  func (*L2EmulationReply) GetMessageName() string { return "l2_emulation_reply" }
    78  func (*L2EmulationReply) GetCrcString() string   { return "e8d4e804" }
    79  func (*L2EmulationReply) GetMessageType() api.MessageType {
    80  	return api.ReplyMessage
    81  }
    82  
    83  func (m *L2EmulationReply) Size() (size int) {
    84  	if m == nil {
    85  		return 0
    86  	}
    87  	size += 4 // m.Retval
    88  	return size
    89  }
    90  func (m *L2EmulationReply) Marshal(b []byte) ([]byte, error) {
    91  	if b == nil {
    92  		b = make([]byte, m.Size())
    93  	}
    94  	buf := codec.NewBuffer(b)
    95  	buf.EncodeInt32(m.Retval)
    96  	return buf.Bytes(), nil
    97  }
    98  func (m *L2EmulationReply) Unmarshal(b []byte) error {
    99  	buf := codec.NewBuffer(b)
   100  	m.Retval = buf.DecodeInt32()
   101  	return nil
   102  }
   103  
   104  func init() { file_l2e_binapi_init() }
   105  func file_l2e_binapi_init() {
   106  	api.RegisterMessage((*L2Emulation)(nil), "l2_emulation_ae6cfcfb")
   107  	api.RegisterMessage((*L2EmulationReply)(nil), "l2_emulation_reply_e8d4e804")
   108  }
   109  
   110  // Messages returns list of all messages in this module.
   111  func AllMessages() []api.Message {
   112  	return []api.Message{
   113  		(*L2Emulation)(nil),
   114  		(*L2EmulationReply)(nil),
   115  	}
   116  }