Update generated binapi to v22.02 & makefile changes
[govpp.git] / internal / testbinapi / binapi2001 / sctp / sctp.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.5.0-dev
4 //  VPP:              20.01
5 // source: .vppapi/plugins/sctp.api.json
6
7 // Package sctp contains generated bindings for API file sctp.api.
8 //
9 // Contents:
10 //   6 messages
11 //
12 package sctp
13
14 import (
15         api "git.fd.io/govpp.git/api"
16         codec "git.fd.io/govpp.git/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    = "sctp"
27         APIVersion = "1.0.0"
28         VersionCrc = 0x35f411c4
29 )
30
31 // SctpAddSrcDstConnection defines message 'sctp_add_src_dst_connection'.
32 type SctpAddSrcDstConnection struct {
33         IsIPv6     uint8  `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
34         VrfID      uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
35         SrcAddress []byte `binapi:"u8[16],name=src_address" json:"src_address,omitempty"`
36         DstAddress []byte `binapi:"u8[16],name=dst_address" json:"dst_address,omitempty"`
37 }
38
39 func (m *SctpAddSrcDstConnection) Reset()               { *m = SctpAddSrcDstConnection{} }
40 func (*SctpAddSrcDstConnection) GetMessageName() string { return "sctp_add_src_dst_connection" }
41 func (*SctpAddSrcDstConnection) GetCrcString() string   { return "45c59b2f" }
42 func (*SctpAddSrcDstConnection) GetMessageType() api.MessageType {
43         return api.RequestMessage
44 }
45
46 func (m *SctpAddSrcDstConnection) Size() (size int) {
47         if m == nil {
48                 return 0
49         }
50         size += 1      // m.IsIPv6
51         size += 4      // m.VrfID
52         size += 1 * 16 // m.SrcAddress
53         size += 1 * 16 // m.DstAddress
54         return size
55 }
56 func (m *SctpAddSrcDstConnection) Marshal(b []byte) ([]byte, error) {
57         if b == nil {
58                 b = make([]byte, m.Size())
59         }
60         buf := codec.NewBuffer(b)
61         buf.EncodeUint8(m.IsIPv6)
62         buf.EncodeUint32(m.VrfID)
63         buf.EncodeBytes(m.SrcAddress, 16)
64         buf.EncodeBytes(m.DstAddress, 16)
65         return buf.Bytes(), nil
66 }
67 func (m *SctpAddSrcDstConnection) Unmarshal(b []byte) error {
68         buf := codec.NewBuffer(b)
69         m.IsIPv6 = buf.DecodeUint8()
70         m.VrfID = buf.DecodeUint32()
71         m.SrcAddress = make([]byte, 16)
72         copy(m.SrcAddress, buf.DecodeBytes(len(m.SrcAddress)))
73         m.DstAddress = make([]byte, 16)
74         copy(m.DstAddress, buf.DecodeBytes(len(m.DstAddress)))
75         return nil
76 }
77
78 // SctpAddSrcDstConnectionReply defines message 'sctp_add_src_dst_connection_reply'.
79 type SctpAddSrcDstConnectionReply struct {
80         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
81 }
82
83 func (m *SctpAddSrcDstConnectionReply) Reset() { *m = SctpAddSrcDstConnectionReply{} }
84 func (*SctpAddSrcDstConnectionReply) GetMessageName() string {
85         return "sctp_add_src_dst_connection_reply"
86 }
87 func (*SctpAddSrcDstConnectionReply) GetCrcString() string { return "e8d4e804" }
88 func (*SctpAddSrcDstConnectionReply) GetMessageType() api.MessageType {
89         return api.ReplyMessage
90 }
91
92 func (m *SctpAddSrcDstConnectionReply) Size() (size int) {
93         if m == nil {
94                 return 0
95         }
96         size += 4 // m.Retval
97         return size
98 }
99 func (m *SctpAddSrcDstConnectionReply) 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 *SctpAddSrcDstConnectionReply) Unmarshal(b []byte) error {
108         buf := codec.NewBuffer(b)
109         m.Retval = buf.DecodeInt32()
110         return nil
111 }
112
113 // SctpConfig defines message 'sctp_config'.
114 type SctpConfig struct {
115         NeverDelaySack uint8 `binapi:"u8,name=never_delay_sack" json:"never_delay_sack,omitempty"`
116         NeverBundle    uint8 `binapi:"u8,name=never_bundle" json:"never_bundle,omitempty"`
117 }
118
119 func (m *SctpConfig) Reset()               { *m = SctpConfig{} }
120 func (*SctpConfig) GetMessageName() string { return "sctp_config" }
121 func (*SctpConfig) GetCrcString() string   { return "7617eced" }
122 func (*SctpConfig) GetMessageType() api.MessageType {
123         return api.RequestMessage
124 }
125
126 func (m *SctpConfig) Size() (size int) {
127         if m == nil {
128                 return 0
129         }
130         size += 1 // m.NeverDelaySack
131         size += 1 // m.NeverBundle
132         return size
133 }
134 func (m *SctpConfig) Marshal(b []byte) ([]byte, error) {
135         if b == nil {
136                 b = make([]byte, m.Size())
137         }
138         buf := codec.NewBuffer(b)
139         buf.EncodeUint8(m.NeverDelaySack)
140         buf.EncodeUint8(m.NeverBundle)
141         return buf.Bytes(), nil
142 }
143 func (m *SctpConfig) Unmarshal(b []byte) error {
144         buf := codec.NewBuffer(b)
145         m.NeverDelaySack = buf.DecodeUint8()
146         m.NeverBundle = buf.DecodeUint8()
147         return nil
148 }
149
150 // SctpConfigReply defines message 'sctp_config_reply'.
151 type SctpConfigReply struct {
152         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
153 }
154
155 func (m *SctpConfigReply) Reset()               { *m = SctpConfigReply{} }
156 func (*SctpConfigReply) GetMessageName() string { return "sctp_config_reply" }
157 func (*SctpConfigReply) GetCrcString() string   { return "e8d4e804" }
158 func (*SctpConfigReply) GetMessageType() api.MessageType {
159         return api.ReplyMessage
160 }
161
162 func (m *SctpConfigReply) Size() (size int) {
163         if m == nil {
164                 return 0
165         }
166         size += 4 // m.Retval
167         return size
168 }
169 func (m *SctpConfigReply) Marshal(b []byte) ([]byte, error) {
170         if b == nil {
171                 b = make([]byte, m.Size())
172         }
173         buf := codec.NewBuffer(b)
174         buf.EncodeInt32(m.Retval)
175         return buf.Bytes(), nil
176 }
177 func (m *SctpConfigReply) Unmarshal(b []byte) error {
178         buf := codec.NewBuffer(b)
179         m.Retval = buf.DecodeInt32()
180         return nil
181 }
182
183 // SctpDelSrcDstConnection defines message 'sctp_del_src_dst_connection'.
184 type SctpDelSrcDstConnection struct {
185         IsIPv6     uint8  `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
186         VrfID      uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
187         SrcAddress []byte `binapi:"u8[16],name=src_address" json:"src_address,omitempty"`
188         DstAddress []byte `binapi:"u8[16],name=dst_address" json:"dst_address,omitempty"`
189 }
190
191 func (m *SctpDelSrcDstConnection) Reset()               { *m = SctpDelSrcDstConnection{} }
192 func (*SctpDelSrcDstConnection) GetMessageName() string { return "sctp_del_src_dst_connection" }
193 func (*SctpDelSrcDstConnection) GetCrcString() string   { return "45c59b2f" }
194 func (*SctpDelSrcDstConnection) GetMessageType() api.MessageType {
195         return api.RequestMessage
196 }
197
198 func (m *SctpDelSrcDstConnection) Size() (size int) {
199         if m == nil {
200                 return 0
201         }
202         size += 1      // m.IsIPv6
203         size += 4      // m.VrfID
204         size += 1 * 16 // m.SrcAddress
205         size += 1 * 16 // m.DstAddress
206         return size
207 }
208 func (m *SctpDelSrcDstConnection) Marshal(b []byte) ([]byte, error) {
209         if b == nil {
210                 b = make([]byte, m.Size())
211         }
212         buf := codec.NewBuffer(b)
213         buf.EncodeUint8(m.IsIPv6)
214         buf.EncodeUint32(m.VrfID)
215         buf.EncodeBytes(m.SrcAddress, 16)
216         buf.EncodeBytes(m.DstAddress, 16)
217         return buf.Bytes(), nil
218 }
219 func (m *SctpDelSrcDstConnection) Unmarshal(b []byte) error {
220         buf := codec.NewBuffer(b)
221         m.IsIPv6 = buf.DecodeUint8()
222         m.VrfID = buf.DecodeUint32()
223         m.SrcAddress = make([]byte, 16)
224         copy(m.SrcAddress, buf.DecodeBytes(len(m.SrcAddress)))
225         m.DstAddress = make([]byte, 16)
226         copy(m.DstAddress, buf.DecodeBytes(len(m.DstAddress)))
227         return nil
228 }
229
230 // SctpDelSrcDstConnectionReply defines message 'sctp_del_src_dst_connection_reply'.
231 type SctpDelSrcDstConnectionReply struct {
232         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
233 }
234
235 func (m *SctpDelSrcDstConnectionReply) Reset() { *m = SctpDelSrcDstConnectionReply{} }
236 func (*SctpDelSrcDstConnectionReply) GetMessageName() string {
237         return "sctp_del_src_dst_connection_reply"
238 }
239 func (*SctpDelSrcDstConnectionReply) GetCrcString() string { return "e8d4e804" }
240 func (*SctpDelSrcDstConnectionReply) GetMessageType() api.MessageType {
241         return api.ReplyMessage
242 }
243
244 func (m *SctpDelSrcDstConnectionReply) Size() (size int) {
245         if m == nil {
246                 return 0
247         }
248         size += 4 // m.Retval
249         return size
250 }
251 func (m *SctpDelSrcDstConnectionReply) Marshal(b []byte) ([]byte, error) {
252         if b == nil {
253                 b = make([]byte, m.Size())
254         }
255         buf := codec.NewBuffer(b)
256         buf.EncodeInt32(m.Retval)
257         return buf.Bytes(), nil
258 }
259 func (m *SctpDelSrcDstConnectionReply) Unmarshal(b []byte) error {
260         buf := codec.NewBuffer(b)
261         m.Retval = buf.DecodeInt32()
262         return nil
263 }
264
265 func init() { file_sctp_binapi_init() }
266 func file_sctp_binapi_init() {
267         api.RegisterMessage((*SctpAddSrcDstConnection)(nil), "sctp_add_src_dst_connection_45c59b2f")
268         api.RegisterMessage((*SctpAddSrcDstConnectionReply)(nil), "sctp_add_src_dst_connection_reply_e8d4e804")
269         api.RegisterMessage((*SctpConfig)(nil), "sctp_config_7617eced")
270         api.RegisterMessage((*SctpConfigReply)(nil), "sctp_config_reply_e8d4e804")
271         api.RegisterMessage((*SctpDelSrcDstConnection)(nil), "sctp_del_src_dst_connection_45c59b2f")
272         api.RegisterMessage((*SctpDelSrcDstConnectionReply)(nil), "sctp_del_src_dst_connection_reply_e8d4e804")
273 }
274
275 // Messages returns list of all messages in this module.
276 func AllMessages() []api.Message {
277         return []api.Message{
278                 (*SctpAddSrcDstConnection)(nil),
279                 (*SctpAddSrcDstConnectionReply)(nil),
280                 (*SctpConfig)(nil),
281                 (*SctpConfigReply)(nil),
282                 (*SctpDelSrcDstConnection)(nil),
283                 (*SctpDelSrcDstConnectionReply)(nil),
284         }
285 }