github.com/edwarnicke/govpp@v0.0.0-20230130211138-14ef5d20b1d0/binapi/adl/adl.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:              23.02-rc0~189-g57127b32a
     5  // source: /usr/share/vpp/api/plugins/adl.api.json
     6  
     7  // Package adl contains generated bindings for API file adl.api.
     8  //
     9  // Contents:
    10  //   4 messages
    11  //
    12  package adl
    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    = "adl"
    28  	APIVersion = "0.0.1"
    29  	VersionCrc = 0xb752b7a2
    30  )
    31  
    32  // AdlAllowlistEnableDisable defines message 'adl_allowlist_enable_disable'.
    33  // InProgress: the message form may change in the future versions
    34  type AdlAllowlistEnableDisable struct {
    35  	SwIfIndex  interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
    36  	FibID      uint32                         `binapi:"u32,name=fib_id" json:"fib_id,omitempty"`
    37  	IP4        bool                           `binapi:"bool,name=ip4" json:"ip4,omitempty"`
    38  	IP6        bool                           `binapi:"bool,name=ip6" json:"ip6,omitempty"`
    39  	DefaultAdl bool                           `binapi:"bool,name=default_adl" json:"default_adl,omitempty"`
    40  }
    41  
    42  func (m *AdlAllowlistEnableDisable) Reset()               { *m = AdlAllowlistEnableDisable{} }
    43  func (*AdlAllowlistEnableDisable) GetMessageName() string { return "adl_allowlist_enable_disable" }
    44  func (*AdlAllowlistEnableDisable) GetCrcString() string   { return "ea88828d" }
    45  func (*AdlAllowlistEnableDisable) GetMessageType() api.MessageType {
    46  	return api.RequestMessage
    47  }
    48  
    49  func (m *AdlAllowlistEnableDisable) Size() (size int) {
    50  	if m == nil {
    51  		return 0
    52  	}
    53  	size += 4 // m.SwIfIndex
    54  	size += 4 // m.FibID
    55  	size += 1 // m.IP4
    56  	size += 1 // m.IP6
    57  	size += 1 // m.DefaultAdl
    58  	return size
    59  }
    60  func (m *AdlAllowlistEnableDisable) 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.EncodeUint32(m.FibID)
    67  	buf.EncodeBool(m.IP4)
    68  	buf.EncodeBool(m.IP6)
    69  	buf.EncodeBool(m.DefaultAdl)
    70  	return buf.Bytes(), nil
    71  }
    72  func (m *AdlAllowlistEnableDisable) Unmarshal(b []byte) error {
    73  	buf := codec.NewBuffer(b)
    74  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
    75  	m.FibID = buf.DecodeUint32()
    76  	m.IP4 = buf.DecodeBool()
    77  	m.IP6 = buf.DecodeBool()
    78  	m.DefaultAdl = buf.DecodeBool()
    79  	return nil
    80  }
    81  
    82  // AdlAllowlistEnableDisableReply defines message 'adl_allowlist_enable_disable_reply'.
    83  // InProgress: the message form may change in the future versions
    84  type AdlAllowlistEnableDisableReply struct {
    85  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
    86  }
    87  
    88  func (m *AdlAllowlistEnableDisableReply) Reset() { *m = AdlAllowlistEnableDisableReply{} }
    89  func (*AdlAllowlistEnableDisableReply) GetMessageName() string {
    90  	return "adl_allowlist_enable_disable_reply"
    91  }
    92  func (*AdlAllowlistEnableDisableReply) GetCrcString() string { return "e8d4e804" }
    93  func (*AdlAllowlistEnableDisableReply) GetMessageType() api.MessageType {
    94  	return api.ReplyMessage
    95  }
    96  
    97  func (m *AdlAllowlistEnableDisableReply) Size() (size int) {
    98  	if m == nil {
    99  		return 0
   100  	}
   101  	size += 4 // m.Retval
   102  	return size
   103  }
   104  func (m *AdlAllowlistEnableDisableReply) Marshal(b []byte) ([]byte, error) {
   105  	if b == nil {
   106  		b = make([]byte, m.Size())
   107  	}
   108  	buf := codec.NewBuffer(b)
   109  	buf.EncodeInt32(m.Retval)
   110  	return buf.Bytes(), nil
   111  }
   112  func (m *AdlAllowlistEnableDisableReply) Unmarshal(b []byte) error {
   113  	buf := codec.NewBuffer(b)
   114  	m.Retval = buf.DecodeInt32()
   115  	return nil
   116  }
   117  
   118  // AdlInterfaceEnableDisable defines message 'adl_interface_enable_disable'.
   119  // InProgress: the message form may change in the future versions
   120  type AdlInterfaceEnableDisable struct {
   121  	SwIfIndex     interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   122  	EnableDisable bool                           `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
   123  }
   124  
   125  func (m *AdlInterfaceEnableDisable) Reset()               { *m = AdlInterfaceEnableDisable{} }
   126  func (*AdlInterfaceEnableDisable) GetMessageName() string { return "adl_interface_enable_disable" }
   127  func (*AdlInterfaceEnableDisable) GetCrcString() string   { return "5501adee" }
   128  func (*AdlInterfaceEnableDisable) GetMessageType() api.MessageType {
   129  	return api.RequestMessage
   130  }
   131  
   132  func (m *AdlInterfaceEnableDisable) Size() (size int) {
   133  	if m == nil {
   134  		return 0
   135  	}
   136  	size += 4 // m.SwIfIndex
   137  	size += 1 // m.EnableDisable
   138  	return size
   139  }
   140  func (m *AdlInterfaceEnableDisable) Marshal(b []byte) ([]byte, error) {
   141  	if b == nil {
   142  		b = make([]byte, m.Size())
   143  	}
   144  	buf := codec.NewBuffer(b)
   145  	buf.EncodeUint32(uint32(m.SwIfIndex))
   146  	buf.EncodeBool(m.EnableDisable)
   147  	return buf.Bytes(), nil
   148  }
   149  func (m *AdlInterfaceEnableDisable) Unmarshal(b []byte) error {
   150  	buf := codec.NewBuffer(b)
   151  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   152  	m.EnableDisable = buf.DecodeBool()
   153  	return nil
   154  }
   155  
   156  // AdlInterfaceEnableDisableReply defines message 'adl_interface_enable_disable_reply'.
   157  // InProgress: the message form may change in the future versions
   158  type AdlInterfaceEnableDisableReply struct {
   159  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   160  }
   161  
   162  func (m *AdlInterfaceEnableDisableReply) Reset() { *m = AdlInterfaceEnableDisableReply{} }
   163  func (*AdlInterfaceEnableDisableReply) GetMessageName() string {
   164  	return "adl_interface_enable_disable_reply"
   165  }
   166  func (*AdlInterfaceEnableDisableReply) GetCrcString() string { return "e8d4e804" }
   167  func (*AdlInterfaceEnableDisableReply) GetMessageType() api.MessageType {
   168  	return api.ReplyMessage
   169  }
   170  
   171  func (m *AdlInterfaceEnableDisableReply) Size() (size int) {
   172  	if m == nil {
   173  		return 0
   174  	}
   175  	size += 4 // m.Retval
   176  	return size
   177  }
   178  func (m *AdlInterfaceEnableDisableReply) Marshal(b []byte) ([]byte, error) {
   179  	if b == nil {
   180  		b = make([]byte, m.Size())
   181  	}
   182  	buf := codec.NewBuffer(b)
   183  	buf.EncodeInt32(m.Retval)
   184  	return buf.Bytes(), nil
   185  }
   186  func (m *AdlInterfaceEnableDisableReply) Unmarshal(b []byte) error {
   187  	buf := codec.NewBuffer(b)
   188  	m.Retval = buf.DecodeInt32()
   189  	return nil
   190  }
   191  
   192  func init() { file_adl_binapi_init() }
   193  func file_adl_binapi_init() {
   194  	api.RegisterMessage((*AdlAllowlistEnableDisable)(nil), "adl_allowlist_enable_disable_ea88828d")
   195  	api.RegisterMessage((*AdlAllowlistEnableDisableReply)(nil), "adl_allowlist_enable_disable_reply_e8d4e804")
   196  	api.RegisterMessage((*AdlInterfaceEnableDisable)(nil), "adl_interface_enable_disable_5501adee")
   197  	api.RegisterMessage((*AdlInterfaceEnableDisableReply)(nil), "adl_interface_enable_disable_reply_e8d4e804")
   198  }
   199  
   200  // Messages returns list of all messages in this module.
   201  func AllMessages() []api.Message {
   202  	return []api.Message{
   203  		(*AdlAllowlistEnableDisable)(nil),
   204  		(*AdlAllowlistEnableDisableReply)(nil),
   205  		(*AdlInterfaceEnableDisable)(nil),
   206  		(*AdlInterfaceEnableDisableReply)(nil),
   207  	}
   208  }