github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/cdp/cdp.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/cdp.api.json
     6  
     7  // Package cdp contains generated bindings for API file cdp.api.
     8  //
     9  // Contents:
    10  // -  2 messages
    11  package cdp
    12  
    13  import (
    14  	api "go.fd.io/govpp/api"
    15  	codec "go.fd.io/govpp/codec"
    16  )
    17  
    18  // This is a compile-time assertion to ensure that this generated file
    19  // is compatible with the GoVPP api package it is being compiled against.
    20  // A compilation error at this line likely means your copy of the
    21  // GoVPP api package needs to be updated.
    22  const _ = api.GoVppAPIPackageIsVersion2
    23  
    24  const (
    25  	APIFile    = "cdp"
    26  	APIVersion = "1.0.0"
    27  	VersionCrc = 0x8cfa825e
    28  )
    29  
    30  // /*
    31  //   - Simple enable/disable API for the cdp protocol
    32  //     *
    33  //   - Copyright (c) 2011-2018 by Cisco and/or its affiliates.
    34  //   - Licensed under the Apache License, Version 2.0 (the "License");
    35  //   - you may not use this file except in compliance with the License.
    36  //   - You may obtain a copy of the License at:
    37  //     *
    38  //   - http://www.apache.org/licenses/LICENSE-2.0
    39  //     *
    40  //   - Unless required by applicable law or agreed to in writing, software
    41  //   - distributed under the License is distributed on an "AS IS" BASIS,
    42  //   - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    43  //   - See the License for the specific language governing permissions and
    44  //   - limitations under the License.
    45  //
    46  // CdpEnableDisable defines message 'cdp_enable_disable'.
    47  type CdpEnableDisable struct {
    48  	EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
    49  }
    50  
    51  func (m *CdpEnableDisable) Reset()               { *m = CdpEnableDisable{} }
    52  func (*CdpEnableDisable) GetMessageName() string { return "cdp_enable_disable" }
    53  func (*CdpEnableDisable) GetCrcString() string   { return "2e7b47df" }
    54  func (*CdpEnableDisable) GetMessageType() api.MessageType {
    55  	return api.RequestMessage
    56  }
    57  
    58  func (m *CdpEnableDisable) Size() (size int) {
    59  	if m == nil {
    60  		return 0
    61  	}
    62  	size += 1 // m.EnableDisable
    63  	return size
    64  }
    65  func (m *CdpEnableDisable) Marshal(b []byte) ([]byte, error) {
    66  	if b == nil {
    67  		b = make([]byte, m.Size())
    68  	}
    69  	buf := codec.NewBuffer(b)
    70  	buf.EncodeBool(m.EnableDisable)
    71  	return buf.Bytes(), nil
    72  }
    73  func (m *CdpEnableDisable) Unmarshal(b []byte) error {
    74  	buf := codec.NewBuffer(b)
    75  	m.EnableDisable = buf.DecodeBool()
    76  	return nil
    77  }
    78  
    79  // CdpEnableDisableReply defines message 'cdp_enable_disable_reply'.
    80  type CdpEnableDisableReply struct {
    81  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
    82  }
    83  
    84  func (m *CdpEnableDisableReply) Reset()               { *m = CdpEnableDisableReply{} }
    85  func (*CdpEnableDisableReply) GetMessageName() string { return "cdp_enable_disable_reply" }
    86  func (*CdpEnableDisableReply) GetCrcString() string   { return "e8d4e804" }
    87  func (*CdpEnableDisableReply) GetMessageType() api.MessageType {
    88  	return api.ReplyMessage
    89  }
    90  
    91  func (m *CdpEnableDisableReply) Size() (size int) {
    92  	if m == nil {
    93  		return 0
    94  	}
    95  	size += 4 // m.Retval
    96  	return size
    97  }
    98  func (m *CdpEnableDisableReply) Marshal(b []byte) ([]byte, error) {
    99  	if b == nil {
   100  		b = make([]byte, m.Size())
   101  	}
   102  	buf := codec.NewBuffer(b)
   103  	buf.EncodeInt32(m.Retval)
   104  	return buf.Bytes(), nil
   105  }
   106  func (m *CdpEnableDisableReply) Unmarshal(b []byte) error {
   107  	buf := codec.NewBuffer(b)
   108  	m.Retval = buf.DecodeInt32()
   109  	return nil
   110  }
   111  
   112  func init() { file_cdp_binapi_init() }
   113  func file_cdp_binapi_init() {
   114  	api.RegisterMessage((*CdpEnableDisable)(nil), "cdp_enable_disable_2e7b47df")
   115  	api.RegisterMessage((*CdpEnableDisableReply)(nil), "cdp_enable_disable_reply_e8d4e804")
   116  }
   117  
   118  // Messages returns list of all messages in this module.
   119  func AllMessages() []api.Message {
   120  	return []api.Message{
   121  		(*CdpEnableDisable)(nil),
   122  		(*CdpEnableDisableReply)(nil),
   123  	}
   124  }