go.ligato.io/vpp-agent/v3@v3.5.0/plugins/vpp/binapi/vpp2101/stn/stn.ba.go (about)

     1  // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
     2  
     3  // Package stn contains generated bindings for API file stn.api.
     4  //
     5  // Contents:
     6  // -  4 messages
     7  package stn
     8  
     9  import (
    10  	api "go.fd.io/govpp/api"
    11  	codec "go.fd.io/govpp/codec"
    12  	interface_types "go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2101/interface_types"
    13  	ip_types "go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2101/ip_types"
    14  )
    15  
    16  // This is a compile-time assertion to ensure that this generated file
    17  // is compatible with the GoVPP api package it is being compiled against.
    18  // A compilation error at this line likely means your copy of the
    19  // GoVPP api package needs to be updated.
    20  const _ = api.GoVppAPIPackageIsVersion2
    21  
    22  const (
    23  	APIFile    = "stn"
    24  	APIVersion = "2.0.0"
    25  	VersionCrc = 0x47566cc9
    26  )
    27  
    28  // StnAddDelRule defines message 'stn_add_del_rule'.
    29  type StnAddDelRule struct {
    30  	IPAddress ip_types.Address               `binapi:"address,name=ip_address" json:"ip_address,omitempty"`
    31  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
    32  	IsAdd     bool                           `binapi:"bool,name=is_add" json:"is_add,omitempty"`
    33  }
    34  
    35  func (m *StnAddDelRule) Reset()               { *m = StnAddDelRule{} }
    36  func (*StnAddDelRule) GetMessageName() string { return "stn_add_del_rule" }
    37  func (*StnAddDelRule) GetCrcString() string   { return "53f751e6" }
    38  func (*StnAddDelRule) GetMessageType() api.MessageType {
    39  	return api.RequestMessage
    40  }
    41  
    42  func (m *StnAddDelRule) Size() (size int) {
    43  	if m == nil {
    44  		return 0
    45  	}
    46  	size += 1      // m.IPAddress.Af
    47  	size += 1 * 16 // m.IPAddress.Un
    48  	size += 4      // m.SwIfIndex
    49  	size += 1      // m.IsAdd
    50  	return size
    51  }
    52  func (m *StnAddDelRule) Marshal(b []byte) ([]byte, error) {
    53  	if b == nil {
    54  		b = make([]byte, m.Size())
    55  	}
    56  	buf := codec.NewBuffer(b)
    57  	buf.EncodeUint8(uint8(m.IPAddress.Af))
    58  	buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16)
    59  	buf.EncodeUint32(uint32(m.SwIfIndex))
    60  	buf.EncodeBool(m.IsAdd)
    61  	return buf.Bytes(), nil
    62  }
    63  func (m *StnAddDelRule) Unmarshal(b []byte) error {
    64  	buf := codec.NewBuffer(b)
    65  	m.IPAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
    66  	copy(m.IPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
    67  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
    68  	m.IsAdd = buf.DecodeBool()
    69  	return nil
    70  }
    71  
    72  // StnAddDelRuleReply defines message 'stn_add_del_rule_reply'.
    73  type StnAddDelRuleReply struct {
    74  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
    75  }
    76  
    77  func (m *StnAddDelRuleReply) Reset()               { *m = StnAddDelRuleReply{} }
    78  func (*StnAddDelRuleReply) GetMessageName() string { return "stn_add_del_rule_reply" }
    79  func (*StnAddDelRuleReply) GetCrcString() string   { return "e8d4e804" }
    80  func (*StnAddDelRuleReply) GetMessageType() api.MessageType {
    81  	return api.ReplyMessage
    82  }
    83  
    84  func (m *StnAddDelRuleReply) Size() (size int) {
    85  	if m == nil {
    86  		return 0
    87  	}
    88  	size += 4 // m.Retval
    89  	return size
    90  }
    91  func (m *StnAddDelRuleReply) Marshal(b []byte) ([]byte, error) {
    92  	if b == nil {
    93  		b = make([]byte, m.Size())
    94  	}
    95  	buf := codec.NewBuffer(b)
    96  	buf.EncodeInt32(m.Retval)
    97  	return buf.Bytes(), nil
    98  }
    99  func (m *StnAddDelRuleReply) Unmarshal(b []byte) error {
   100  	buf := codec.NewBuffer(b)
   101  	m.Retval = buf.DecodeInt32()
   102  	return nil
   103  }
   104  
   105  // StnRulesDetails defines message 'stn_rules_details'.
   106  type StnRulesDetails struct {
   107  	IPAddress ip_types.Address               `binapi:"address,name=ip_address" json:"ip_address,omitempty"`
   108  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   109  }
   110  
   111  func (m *StnRulesDetails) Reset()               { *m = StnRulesDetails{} }
   112  func (*StnRulesDetails) GetMessageName() string { return "stn_rules_details" }
   113  func (*StnRulesDetails) GetCrcString() string   { return "b0f6606c" }
   114  func (*StnRulesDetails) GetMessageType() api.MessageType {
   115  	return api.ReplyMessage
   116  }
   117  
   118  func (m *StnRulesDetails) Size() (size int) {
   119  	if m == nil {
   120  		return 0
   121  	}
   122  	size += 1      // m.IPAddress.Af
   123  	size += 1 * 16 // m.IPAddress.Un
   124  	size += 4      // m.SwIfIndex
   125  	return size
   126  }
   127  func (m *StnRulesDetails) Marshal(b []byte) ([]byte, error) {
   128  	if b == nil {
   129  		b = make([]byte, m.Size())
   130  	}
   131  	buf := codec.NewBuffer(b)
   132  	buf.EncodeUint8(uint8(m.IPAddress.Af))
   133  	buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16)
   134  	buf.EncodeUint32(uint32(m.SwIfIndex))
   135  	return buf.Bytes(), nil
   136  }
   137  func (m *StnRulesDetails) Unmarshal(b []byte) error {
   138  	buf := codec.NewBuffer(b)
   139  	m.IPAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
   140  	copy(m.IPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
   141  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   142  	return nil
   143  }
   144  
   145  // StnRulesDump defines message 'stn_rules_dump'.
   146  type StnRulesDump struct{}
   147  
   148  func (m *StnRulesDump) Reset()               { *m = StnRulesDump{} }
   149  func (*StnRulesDump) GetMessageName() string { return "stn_rules_dump" }
   150  func (*StnRulesDump) GetCrcString() string   { return "51077d14" }
   151  func (*StnRulesDump) GetMessageType() api.MessageType {
   152  	return api.RequestMessage
   153  }
   154  
   155  func (m *StnRulesDump) Size() (size int) {
   156  	if m == nil {
   157  		return 0
   158  	}
   159  	return size
   160  }
   161  func (m *StnRulesDump) Marshal(b []byte) ([]byte, error) {
   162  	if b == nil {
   163  		b = make([]byte, m.Size())
   164  	}
   165  	buf := codec.NewBuffer(b)
   166  	return buf.Bytes(), nil
   167  }
   168  func (m *StnRulesDump) Unmarshal(b []byte) error {
   169  	return nil
   170  }
   171  
   172  func init() { file_stn_binapi_init() }
   173  func file_stn_binapi_init() {
   174  	api.RegisterMessage((*StnAddDelRule)(nil), "stn_add_del_rule_53f751e6")
   175  	api.RegisterMessage((*StnAddDelRuleReply)(nil), "stn_add_del_rule_reply_e8d4e804")
   176  	api.RegisterMessage((*StnRulesDetails)(nil), "stn_rules_details_b0f6606c")
   177  	api.RegisterMessage((*StnRulesDump)(nil), "stn_rules_dump_51077d14")
   178  }
   179  
   180  // Messages returns list of all messages in this module.
   181  func AllMessages() []api.Message {
   182  	return []api.Message{
   183  		(*StnAddDelRule)(nil),
   184  		(*StnAddDelRuleReply)(nil),
   185  		(*StnRulesDetails)(nil),
   186  		(*StnRulesDump)(nil),
   187  	}
   188  }