8cc2d62e39ea27f0d4b101007ee8c38f549a9bb9
[govpp.git] / binapi / pipe / pipe.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.4.0-dev
4 //  VPP:              20.05-release
5
6 // Package pipe contains generated bindings for API file pipe.api.
7 //
8 // Contents:
9 //   6 messages
10 //
11 package pipe
12
13 import (
14         api "git.fd.io/govpp.git/api"
15         interface_types "git.fd.io/govpp.git/binapi/interface_types"
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    = "pipe"
27         APIVersion = "1.0.1"
28         VersionCrc = 0xd22736c9
29 )
30
31 // PipeCreate defines message 'pipe_create'.
32 type PipeCreate struct {
33         IsSpecified  bool   `binapi:"bool,name=is_specified" json:"is_specified,omitempty"`
34         UserInstance uint32 `binapi:"u32,name=user_instance" json:"user_instance,omitempty"`
35 }
36
37 func (m *PipeCreate) Reset()               { *m = PipeCreate{} }
38 func (*PipeCreate) GetMessageName() string { return "pipe_create" }
39 func (*PipeCreate) GetCrcString() string   { return "bb263bd3" }
40 func (*PipeCreate) GetMessageType() api.MessageType {
41         return api.RequestMessage
42 }
43
44 func (m *PipeCreate) Size() (size int) {
45         if m == nil {
46                 return 0
47         }
48         size += 1 // m.IsSpecified
49         size += 4 // m.UserInstance
50         return size
51 }
52 func (m *PipeCreate) Marshal(b []byte) ([]byte, error) {
53         if b == nil {
54                 b = make([]byte, m.Size())
55         }
56         buf := codec.NewBuffer(b)
57         buf.EncodeBool(m.IsSpecified)
58         buf.EncodeUint32(m.UserInstance)
59         return buf.Bytes(), nil
60 }
61 func (m *PipeCreate) Unmarshal(b []byte) error {
62         buf := codec.NewBuffer(b)
63         m.IsSpecified = buf.DecodeBool()
64         m.UserInstance = buf.DecodeUint32()
65         return nil
66 }
67
68 // PipeCreateReply defines message 'pipe_create_reply'.
69 type PipeCreateReply struct {
70         Retval        int32                             `binapi:"i32,name=retval" json:"retval,omitempty"`
71         SwIfIndex     interface_types.InterfaceIndex    `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
72         PipeSwIfIndex [2]interface_types.InterfaceIndex `binapi:"interface_index[2],name=pipe_sw_if_index" json:"pipe_sw_if_index,omitempty"`
73 }
74
75 func (m *PipeCreateReply) Reset()               { *m = PipeCreateReply{} }
76 func (*PipeCreateReply) GetMessageName() string { return "pipe_create_reply" }
77 func (*PipeCreateReply) GetCrcString() string   { return "d4c2c2b3" }
78 func (*PipeCreateReply) GetMessageType() api.MessageType {
79         return api.ReplyMessage
80 }
81
82 func (m *PipeCreateReply) Size() (size int) {
83         if m == nil {
84                 return 0
85         }
86         size += 4 // m.Retval
87         size += 4 // m.SwIfIndex
88         for j1 := 0; j1 < 2; j1++ {
89                 size += 4 // m.PipeSwIfIndex[j1]
90         }
91         return size
92 }
93 func (m *PipeCreateReply) Marshal(b []byte) ([]byte, error) {
94         if b == nil {
95                 b = make([]byte, m.Size())
96         }
97         buf := codec.NewBuffer(b)
98         buf.EncodeInt32(m.Retval)
99         buf.EncodeUint32(uint32(m.SwIfIndex))
100         for j0 := 0; j0 < 2; j0++ {
101                 buf.EncodeUint32(uint32(m.PipeSwIfIndex[j0]))
102         }
103         return buf.Bytes(), nil
104 }
105 func (m *PipeCreateReply) Unmarshal(b []byte) error {
106         buf := codec.NewBuffer(b)
107         m.Retval = buf.DecodeInt32()
108         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
109         for j0 := 0; j0 < 2; j0++ {
110                 m.PipeSwIfIndex[j0] = interface_types.InterfaceIndex(buf.DecodeUint32())
111         }
112         return nil
113 }
114
115 // PipeDelete defines message 'pipe_delete'.
116 type PipeDelete struct {
117         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
118 }
119
120 func (m *PipeDelete) Reset()               { *m = PipeDelete{} }
121 func (*PipeDelete) GetMessageName() string { return "pipe_delete" }
122 func (*PipeDelete) GetCrcString() string   { return "f9e6675e" }
123 func (*PipeDelete) GetMessageType() api.MessageType {
124         return api.RequestMessage
125 }
126
127 func (m *PipeDelete) Size() (size int) {
128         if m == nil {
129                 return 0
130         }
131         size += 4 // m.SwIfIndex
132         return size
133 }
134 func (m *PipeDelete) Marshal(b []byte) ([]byte, error) {
135         if b == nil {
136                 b = make([]byte, m.Size())
137         }
138         buf := codec.NewBuffer(b)
139         buf.EncodeUint32(uint32(m.SwIfIndex))
140         return buf.Bytes(), nil
141 }
142 func (m *PipeDelete) Unmarshal(b []byte) error {
143         buf := codec.NewBuffer(b)
144         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
145         return nil
146 }
147
148 // PipeDeleteReply defines message 'pipe_delete_reply'.
149 type PipeDeleteReply struct {
150         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
151 }
152
153 func (m *PipeDeleteReply) Reset()               { *m = PipeDeleteReply{} }
154 func (*PipeDeleteReply) GetMessageName() string { return "pipe_delete_reply" }
155 func (*PipeDeleteReply) GetCrcString() string   { return "e8d4e804" }
156 func (*PipeDeleteReply) GetMessageType() api.MessageType {
157         return api.ReplyMessage
158 }
159
160 func (m *PipeDeleteReply) Size() (size int) {
161         if m == nil {
162                 return 0
163         }
164         size += 4 // m.Retval
165         return size
166 }
167 func (m *PipeDeleteReply) Marshal(b []byte) ([]byte, error) {
168         if b == nil {
169                 b = make([]byte, m.Size())
170         }
171         buf := codec.NewBuffer(b)
172         buf.EncodeInt32(m.Retval)
173         return buf.Bytes(), nil
174 }
175 func (m *PipeDeleteReply) Unmarshal(b []byte) error {
176         buf := codec.NewBuffer(b)
177         m.Retval = buf.DecodeInt32()
178         return nil
179 }
180
181 // PipeDetails defines message 'pipe_details'.
182 type PipeDetails struct {
183         SwIfIndex     interface_types.InterfaceIndex    `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
184         PipeSwIfIndex [2]interface_types.InterfaceIndex `binapi:"interface_index[2],name=pipe_sw_if_index" json:"pipe_sw_if_index,omitempty"`
185         Instance      uint32                            `binapi:"u32,name=instance" json:"instance,omitempty"`
186 }
187
188 func (m *PipeDetails) Reset()               { *m = PipeDetails{} }
189 func (*PipeDetails) GetMessageName() string { return "pipe_details" }
190 func (*PipeDetails) GetCrcString() string   { return "43ac107a" }
191 func (*PipeDetails) GetMessageType() api.MessageType {
192         return api.ReplyMessage
193 }
194
195 func (m *PipeDetails) Size() (size int) {
196         if m == nil {
197                 return 0
198         }
199         size += 4 // m.SwIfIndex
200         for j1 := 0; j1 < 2; j1++ {
201                 size += 4 // m.PipeSwIfIndex[j1]
202         }
203         size += 4 // m.Instance
204         return size
205 }
206 func (m *PipeDetails) Marshal(b []byte) ([]byte, error) {
207         if b == nil {
208                 b = make([]byte, m.Size())
209         }
210         buf := codec.NewBuffer(b)
211         buf.EncodeUint32(uint32(m.SwIfIndex))
212         for j0 := 0; j0 < 2; j0++ {
213                 buf.EncodeUint32(uint32(m.PipeSwIfIndex[j0]))
214         }
215         buf.EncodeUint32(m.Instance)
216         return buf.Bytes(), nil
217 }
218 func (m *PipeDetails) Unmarshal(b []byte) error {
219         buf := codec.NewBuffer(b)
220         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
221         for j0 := 0; j0 < 2; j0++ {
222                 m.PipeSwIfIndex[j0] = interface_types.InterfaceIndex(buf.DecodeUint32())
223         }
224         m.Instance = buf.DecodeUint32()
225         return nil
226 }
227
228 // PipeDump defines message 'pipe_dump'.
229 type PipeDump struct{}
230
231 func (m *PipeDump) Reset()               { *m = PipeDump{} }
232 func (*PipeDump) GetMessageName() string { return "pipe_dump" }
233 func (*PipeDump) GetCrcString() string   { return "51077d14" }
234 func (*PipeDump) GetMessageType() api.MessageType {
235         return api.RequestMessage
236 }
237
238 func (m *PipeDump) Size() (size int) {
239         if m == nil {
240                 return 0
241         }
242         return size
243 }
244 func (m *PipeDump) Marshal(b []byte) ([]byte, error) {
245         if b == nil {
246                 b = make([]byte, m.Size())
247         }
248         buf := codec.NewBuffer(b)
249         return buf.Bytes(), nil
250 }
251 func (m *PipeDump) Unmarshal(b []byte) error {
252         return nil
253 }
254
255 func init() { file_pipe_binapi_init() }
256 func file_pipe_binapi_init() {
257         api.RegisterMessage((*PipeCreate)(nil), "pipe_create_bb263bd3")
258         api.RegisterMessage((*PipeCreateReply)(nil), "pipe_create_reply_d4c2c2b3")
259         api.RegisterMessage((*PipeDelete)(nil), "pipe_delete_f9e6675e")
260         api.RegisterMessage((*PipeDeleteReply)(nil), "pipe_delete_reply_e8d4e804")
261         api.RegisterMessage((*PipeDetails)(nil), "pipe_details_43ac107a")
262         api.RegisterMessage((*PipeDump)(nil), "pipe_dump_51077d14")
263 }
264
265 // Messages returns list of all messages in this module.
266 func AllMessages() []api.Message {
267         return []api.Message{
268                 (*PipeCreate)(nil),
269                 (*PipeCreateReply)(nil),
270                 (*PipeDelete)(nil),
271                 (*PipeDeleteReply)(nil),
272                 (*PipeDetails)(nil),
273                 (*PipeDump)(nil),
274         }
275 }