github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/feature/feature.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: core/feature.api.json
     6  
     7  // Package feature contains generated bindings for API file feature.api.
     8  //
     9  // Contents:
    10  // -  2 messages
    11  package feature
    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    = "feature"
    27  	APIVersion = "1.0.2"
    28  	VersionCrc = 0x8a6e6da1
    29  )
    30  
    31  // Feature path enable/disable request
    32  //   - sw_if_index - the interface
    33  //   - enable - 1 = on, 0 = off
    34  //
    35  // FeatureEnableDisable defines message 'feature_enable_disable'.
    36  type FeatureEnableDisable struct {
    37  	SwIfIndex   interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
    38  	Enable      bool                           `binapi:"bool,name=enable" json:"enable,omitempty"`
    39  	ArcName     string                         `binapi:"string[64],name=arc_name" json:"arc_name,omitempty"`
    40  	FeatureName string                         `binapi:"string[64],name=feature_name" json:"feature_name,omitempty"`
    41  }
    42  
    43  func (m *FeatureEnableDisable) Reset()               { *m = FeatureEnableDisable{} }
    44  func (*FeatureEnableDisable) GetMessageName() string { return "feature_enable_disable" }
    45  func (*FeatureEnableDisable) GetCrcString() string   { return "7531c862" }
    46  func (*FeatureEnableDisable) GetMessageType() api.MessageType {
    47  	return api.RequestMessage
    48  }
    49  
    50  func (m *FeatureEnableDisable) Size() (size int) {
    51  	if m == nil {
    52  		return 0
    53  	}
    54  	size += 4  // m.SwIfIndex
    55  	size += 1  // m.Enable
    56  	size += 64 // m.ArcName
    57  	size += 64 // m.FeatureName
    58  	return size
    59  }
    60  func (m *FeatureEnableDisable) Marshal(b []byte) ([]byte, error) {
    61  	if b == nil {
    62  		b = make([]byte, m.Size())
    63  	}
    64  	buf := codec.NewBuffer(b)
    65  	buf.EncodeUint32(uint32(m.SwIfIndex))
    66  	buf.EncodeBool(m.Enable)
    67  	buf.EncodeString(m.ArcName, 64)
    68  	buf.EncodeString(m.FeatureName, 64)
    69  	return buf.Bytes(), nil
    70  }
    71  func (m *FeatureEnableDisable) Unmarshal(b []byte) error {
    72  	buf := codec.NewBuffer(b)
    73  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
    74  	m.Enable = buf.DecodeBool()
    75  	m.ArcName = buf.DecodeString(64)
    76  	m.FeatureName = buf.DecodeString(64)
    77  	return nil
    78  }
    79  
    80  // FeatureEnableDisableReply defines message 'feature_enable_disable_reply'.
    81  type FeatureEnableDisableReply struct {
    82  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
    83  }
    84  
    85  func (m *FeatureEnableDisableReply) Reset()               { *m = FeatureEnableDisableReply{} }
    86  func (*FeatureEnableDisableReply) GetMessageName() string { return "feature_enable_disable_reply" }
    87  func (*FeatureEnableDisableReply) GetCrcString() string   { return "e8d4e804" }
    88  func (*FeatureEnableDisableReply) GetMessageType() api.MessageType {
    89  	return api.ReplyMessage
    90  }
    91  
    92  func (m *FeatureEnableDisableReply) Size() (size int) {
    93  	if m == nil {
    94  		return 0
    95  	}
    96  	size += 4 // m.Retval
    97  	return size
    98  }
    99  func (m *FeatureEnableDisableReply) Marshal(b []byte) ([]byte, error) {
   100  	if b == nil {
   101  		b = make([]byte, m.Size())
   102  	}
   103  	buf := codec.NewBuffer(b)
   104  	buf.EncodeInt32(m.Retval)
   105  	return buf.Bytes(), nil
   106  }
   107  func (m *FeatureEnableDisableReply) Unmarshal(b []byte) error {
   108  	buf := codec.NewBuffer(b)
   109  	m.Retval = buf.DecodeInt32()
   110  	return nil
   111  }
   112  
   113  func init() { file_feature_binapi_init() }
   114  func file_feature_binapi_init() {
   115  	api.RegisterMessage((*FeatureEnableDisable)(nil), "feature_enable_disable_7531c862")
   116  	api.RegisterMessage((*FeatureEnableDisableReply)(nil), "feature_enable_disable_reply_e8d4e804")
   117  }
   118  
   119  // Messages returns list of all messages in this module.
   120  func AllMessages() []api.Message {
   121  	return []api.Message{
   122  		(*FeatureEnableDisable)(nil),
   123  		(*FeatureEnableDisableReply)(nil),
   124  	}
   125  }