github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/mdata/mdata.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/mdata.api.json
     6  
     7  // Package mdata contains generated bindings for API file mdata.api.
     8  //
     9  // Contents:
    10  // -  2 messages
    11  package mdata
    12  
    13  import (
    14  	_ "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    = "mdata"
    27  	APIVersion = "0.1.0"
    28  	VersionCrc = 0x5bd69477
    29  )
    30  
    31  // @brief API to enable / disable mdata on an interface
    32  //   - enable_disable - 1 to enable, 0 to disable the feature
    33  //
    34  // MdataEnableDisable defines message 'mdata_enable_disable'.
    35  type MdataEnableDisable struct {
    36  	EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
    37  }
    38  
    39  func (m *MdataEnableDisable) Reset()               { *m = MdataEnableDisable{} }
    40  func (*MdataEnableDisable) GetMessageName() string { return "mdata_enable_disable" }
    41  func (*MdataEnableDisable) GetCrcString() string   { return "2e7b47df" }
    42  func (*MdataEnableDisable) GetMessageType() api.MessageType {
    43  	return api.RequestMessage
    44  }
    45  
    46  func (m *MdataEnableDisable) Size() (size int) {
    47  	if m == nil {
    48  		return 0
    49  	}
    50  	size += 1 // m.EnableDisable
    51  	return size
    52  }
    53  func (m *MdataEnableDisable) Marshal(b []byte) ([]byte, error) {
    54  	if b == nil {
    55  		b = make([]byte, m.Size())
    56  	}
    57  	buf := codec.NewBuffer(b)
    58  	buf.EncodeBool(m.EnableDisable)
    59  	return buf.Bytes(), nil
    60  }
    61  func (m *MdataEnableDisable) Unmarshal(b []byte) error {
    62  	buf := codec.NewBuffer(b)
    63  	m.EnableDisable = buf.DecodeBool()
    64  	return nil
    65  }
    66  
    67  // MdataEnableDisableReply defines message 'mdata_enable_disable_reply'.
    68  type MdataEnableDisableReply struct {
    69  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
    70  }
    71  
    72  func (m *MdataEnableDisableReply) Reset()               { *m = MdataEnableDisableReply{} }
    73  func (*MdataEnableDisableReply) GetMessageName() string { return "mdata_enable_disable_reply" }
    74  func (*MdataEnableDisableReply) GetCrcString() string   { return "e8d4e804" }
    75  func (*MdataEnableDisableReply) GetMessageType() api.MessageType {
    76  	return api.ReplyMessage
    77  }
    78  
    79  func (m *MdataEnableDisableReply) Size() (size int) {
    80  	if m == nil {
    81  		return 0
    82  	}
    83  	size += 4 // m.Retval
    84  	return size
    85  }
    86  func (m *MdataEnableDisableReply) Marshal(b []byte) ([]byte, error) {
    87  	if b == nil {
    88  		b = make([]byte, m.Size())
    89  	}
    90  	buf := codec.NewBuffer(b)
    91  	buf.EncodeInt32(m.Retval)
    92  	return buf.Bytes(), nil
    93  }
    94  func (m *MdataEnableDisableReply) Unmarshal(b []byte) error {
    95  	buf := codec.NewBuffer(b)
    96  	m.Retval = buf.DecodeInt32()
    97  	return nil
    98  }
    99  
   100  func init() { file_mdata_binapi_init() }
   101  func file_mdata_binapi_init() {
   102  	api.RegisterMessage((*MdataEnableDisable)(nil), "mdata_enable_disable_2e7b47df")
   103  	api.RegisterMessage((*MdataEnableDisableReply)(nil), "mdata_enable_disable_reply_e8d4e804")
   104  }
   105  
   106  // Messages returns list of all messages in this module.
   107  func AllMessages() []api.Message {
   108  	return []api.Message{
   109  		(*MdataEnableDisable)(nil),
   110  		(*MdataEnableDisableReply)(nil),
   111  	}
   112  }