1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.6.0-dev
5 // source: /usr/share/vpp/api/core/pg.api.json
7 // Package pg contains generated bindings for API file pg.api.
18 api "go.fd.io/govpp/api"
19 interface_types "go.fd.io/govpp/binapi/interface_types"
20 codec "go.fd.io/govpp/codec"
23 // This is a compile-time assertion to ensure that this generated file
24 // is compatible with the GoVPP api package it is being compiled against.
25 // A compilation error at this line likely means your copy of the
26 // GoVPP api package needs to be updated.
27 const _ = api.GoVppAPIPackageIsVersion2
32 VersionCrc = 0x32a1ad3b
35 // PgInterfaceMode defines enum 'pg_interface_mode'.
36 type PgInterfaceMode uint8
39 PG_API_MODE_ETHERNET PgInterfaceMode = 0
40 PG_API_MODE_IP4 PgInterfaceMode = 1
41 PG_API_MODE_IP6 PgInterfaceMode = 2
45 PgInterfaceMode_name = map[uint8]string{
46 0: "PG_API_MODE_ETHERNET",
50 PgInterfaceMode_value = map[string]uint8{
51 "PG_API_MODE_ETHERNET": 0,
57 func (x PgInterfaceMode) String() string {
58 s, ok := PgInterfaceMode_name[uint8(x)]
62 return "PgInterfaceMode(" + strconv.Itoa(int(x)) + ")"
65 // PgCapture defines message 'pg_capture'.
66 type PgCapture struct {
67 InterfaceID interface_types.InterfaceIndex `binapi:"interface_index,name=interface_id" json:"interface_id,omitempty"`
68 IsEnabled bool `binapi:"bool,name=is_enabled,default=true" json:"is_enabled,omitempty"`
69 Count uint32 `binapi:"u32,name=count" json:"count,omitempty"`
70 PcapFileName string `binapi:"string[],name=pcap_file_name" json:"pcap_file_name,omitempty"`
73 func (m *PgCapture) Reset() { *m = PgCapture{} }
74 func (*PgCapture) GetMessageName() string { return "pg_capture" }
75 func (*PgCapture) GetCrcString() string { return "3712fb6c" }
76 func (*PgCapture) GetMessageType() api.MessageType {
77 return api.RequestMessage
80 func (m *PgCapture) Size() (size int) {
84 size += 4 // m.InterfaceID
85 size += 1 // m.IsEnabled
87 size += 4 + len(m.PcapFileName) // m.PcapFileName
90 func (m *PgCapture) Marshal(b []byte) ([]byte, error) {
92 b = make([]byte, m.Size())
94 buf := codec.NewBuffer(b)
95 buf.EncodeUint32(uint32(m.InterfaceID))
96 buf.EncodeBool(m.IsEnabled)
97 buf.EncodeUint32(m.Count)
98 buf.EncodeString(m.PcapFileName, 0)
99 return buf.Bytes(), nil
101 func (m *PgCapture) Unmarshal(b []byte) error {
102 buf := codec.NewBuffer(b)
103 m.InterfaceID = interface_types.InterfaceIndex(buf.DecodeUint32())
104 m.IsEnabled = buf.DecodeBool()
105 m.Count = buf.DecodeUint32()
106 m.PcapFileName = buf.DecodeString(0)
110 // PgCaptureReply defines message 'pg_capture_reply'.
111 type PgCaptureReply struct {
112 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
115 func (m *PgCaptureReply) Reset() { *m = PgCaptureReply{} }
116 func (*PgCaptureReply) GetMessageName() string { return "pg_capture_reply" }
117 func (*PgCaptureReply) GetCrcString() string { return "e8d4e804" }
118 func (*PgCaptureReply) GetMessageType() api.MessageType {
119 return api.ReplyMessage
122 func (m *PgCaptureReply) Size() (size int) {
126 size += 4 // m.Retval
129 func (m *PgCaptureReply) Marshal(b []byte) ([]byte, error) {
131 b = make([]byte, m.Size())
133 buf := codec.NewBuffer(b)
134 buf.EncodeInt32(m.Retval)
135 return buf.Bytes(), nil
137 func (m *PgCaptureReply) Unmarshal(b []byte) error {
138 buf := codec.NewBuffer(b)
139 m.Retval = buf.DecodeInt32()
143 // PgCreateInterface defines message 'pg_create_interface'.
144 type PgCreateInterface struct {
145 InterfaceID interface_types.InterfaceIndex `binapi:"interface_index,name=interface_id" json:"interface_id,omitempty"`
146 GsoEnabled bool `binapi:"bool,name=gso_enabled" json:"gso_enabled,omitempty"`
147 GsoSize uint32 `binapi:"u32,name=gso_size" json:"gso_size,omitempty"`
150 func (m *PgCreateInterface) Reset() { *m = PgCreateInterface{} }
151 func (*PgCreateInterface) GetMessageName() string { return "pg_create_interface" }
152 func (*PgCreateInterface) GetCrcString() string { return "b7c893d7" }
153 func (*PgCreateInterface) GetMessageType() api.MessageType {
154 return api.RequestMessage
157 func (m *PgCreateInterface) Size() (size int) {
161 size += 4 // m.InterfaceID
162 size += 1 // m.GsoEnabled
163 size += 4 // m.GsoSize
166 func (m *PgCreateInterface) Marshal(b []byte) ([]byte, error) {
168 b = make([]byte, m.Size())
170 buf := codec.NewBuffer(b)
171 buf.EncodeUint32(uint32(m.InterfaceID))
172 buf.EncodeBool(m.GsoEnabled)
173 buf.EncodeUint32(m.GsoSize)
174 return buf.Bytes(), nil
176 func (m *PgCreateInterface) Unmarshal(b []byte) error {
177 buf := codec.NewBuffer(b)
178 m.InterfaceID = interface_types.InterfaceIndex(buf.DecodeUint32())
179 m.GsoEnabled = buf.DecodeBool()
180 m.GsoSize = buf.DecodeUint32()
184 // PgCreateInterfaceReply defines message 'pg_create_interface_reply'.
185 type PgCreateInterfaceReply struct {
186 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
187 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
190 func (m *PgCreateInterfaceReply) Reset() { *m = PgCreateInterfaceReply{} }
191 func (*PgCreateInterfaceReply) GetMessageName() string { return "pg_create_interface_reply" }
192 func (*PgCreateInterfaceReply) GetCrcString() string { return "5383d31f" }
193 func (*PgCreateInterfaceReply) GetMessageType() api.MessageType {
194 return api.ReplyMessage
197 func (m *PgCreateInterfaceReply) Size() (size int) {
201 size += 4 // m.Retval
202 size += 4 // m.SwIfIndex
205 func (m *PgCreateInterfaceReply) Marshal(b []byte) ([]byte, error) {
207 b = make([]byte, m.Size())
209 buf := codec.NewBuffer(b)
210 buf.EncodeInt32(m.Retval)
211 buf.EncodeUint32(uint32(m.SwIfIndex))
212 return buf.Bytes(), nil
214 func (m *PgCreateInterfaceReply) Unmarshal(b []byte) error {
215 buf := codec.NewBuffer(b)
216 m.Retval = buf.DecodeInt32()
217 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
221 // PgCreateInterfaceV2 defines message 'pg_create_interface_v2'.
222 type PgCreateInterfaceV2 struct {
223 InterfaceID interface_types.InterfaceIndex `binapi:"interface_index,name=interface_id" json:"interface_id,omitempty"`
224 GsoEnabled bool `binapi:"bool,name=gso_enabled" json:"gso_enabled,omitempty"`
225 GsoSize uint32 `binapi:"u32,name=gso_size" json:"gso_size,omitempty"`
226 Mode PgInterfaceMode `binapi:"pg_interface_mode,name=mode" json:"mode,omitempty"`
229 func (m *PgCreateInterfaceV2) Reset() { *m = PgCreateInterfaceV2{} }
230 func (*PgCreateInterfaceV2) GetMessageName() string { return "pg_create_interface_v2" }
231 func (*PgCreateInterfaceV2) GetCrcString() string { return "8657466a" }
232 func (*PgCreateInterfaceV2) GetMessageType() api.MessageType {
233 return api.RequestMessage
236 func (m *PgCreateInterfaceV2) Size() (size int) {
240 size += 4 // m.InterfaceID
241 size += 1 // m.GsoEnabled
242 size += 4 // m.GsoSize
246 func (m *PgCreateInterfaceV2) Marshal(b []byte) ([]byte, error) {
248 b = make([]byte, m.Size())
250 buf := codec.NewBuffer(b)
251 buf.EncodeUint32(uint32(m.InterfaceID))
252 buf.EncodeBool(m.GsoEnabled)
253 buf.EncodeUint32(m.GsoSize)
254 buf.EncodeUint8(uint8(m.Mode))
255 return buf.Bytes(), nil
257 func (m *PgCreateInterfaceV2) Unmarshal(b []byte) error {
258 buf := codec.NewBuffer(b)
259 m.InterfaceID = interface_types.InterfaceIndex(buf.DecodeUint32())
260 m.GsoEnabled = buf.DecodeBool()
261 m.GsoSize = buf.DecodeUint32()
262 m.Mode = PgInterfaceMode(buf.DecodeUint8())
266 // PgCreateInterfaceV2Reply defines message 'pg_create_interface_v2_reply'.
267 type PgCreateInterfaceV2Reply struct {
268 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
269 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
272 func (m *PgCreateInterfaceV2Reply) Reset() { *m = PgCreateInterfaceV2Reply{} }
273 func (*PgCreateInterfaceV2Reply) GetMessageName() string { return "pg_create_interface_v2_reply" }
274 func (*PgCreateInterfaceV2Reply) GetCrcString() string { return "5383d31f" }
275 func (*PgCreateInterfaceV2Reply) GetMessageType() api.MessageType {
276 return api.ReplyMessage
279 func (m *PgCreateInterfaceV2Reply) Size() (size int) {
283 size += 4 // m.Retval
284 size += 4 // m.SwIfIndex
287 func (m *PgCreateInterfaceV2Reply) Marshal(b []byte) ([]byte, error) {
289 b = make([]byte, m.Size())
291 buf := codec.NewBuffer(b)
292 buf.EncodeInt32(m.Retval)
293 buf.EncodeUint32(uint32(m.SwIfIndex))
294 return buf.Bytes(), nil
296 func (m *PgCreateInterfaceV2Reply) Unmarshal(b []byte) error {
297 buf := codec.NewBuffer(b)
298 m.Retval = buf.DecodeInt32()
299 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
303 // PgEnableDisable defines message 'pg_enable_disable'.
304 type PgEnableDisable struct {
305 IsEnabled bool `binapi:"bool,name=is_enabled,default=true" json:"is_enabled,omitempty"`
306 StreamName string `binapi:"string[],name=stream_name" json:"stream_name,omitempty"`
309 func (m *PgEnableDisable) Reset() { *m = PgEnableDisable{} }
310 func (*PgEnableDisable) GetMessageName() string { return "pg_enable_disable" }
311 func (*PgEnableDisable) GetCrcString() string { return "01f94f3a" }
312 func (*PgEnableDisable) GetMessageType() api.MessageType {
313 return api.RequestMessage
316 func (m *PgEnableDisable) Size() (size int) {
320 size += 1 // m.IsEnabled
321 size += 4 + len(m.StreamName) // m.StreamName
324 func (m *PgEnableDisable) Marshal(b []byte) ([]byte, error) {
326 b = make([]byte, m.Size())
328 buf := codec.NewBuffer(b)
329 buf.EncodeBool(m.IsEnabled)
330 buf.EncodeString(m.StreamName, 0)
331 return buf.Bytes(), nil
333 func (m *PgEnableDisable) Unmarshal(b []byte) error {
334 buf := codec.NewBuffer(b)
335 m.IsEnabled = buf.DecodeBool()
336 m.StreamName = buf.DecodeString(0)
340 // PgEnableDisableReply defines message 'pg_enable_disable_reply'.
341 type PgEnableDisableReply struct {
342 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
345 func (m *PgEnableDisableReply) Reset() { *m = PgEnableDisableReply{} }
346 func (*PgEnableDisableReply) GetMessageName() string { return "pg_enable_disable_reply" }
347 func (*PgEnableDisableReply) GetCrcString() string { return "e8d4e804" }
348 func (*PgEnableDisableReply) GetMessageType() api.MessageType {
349 return api.ReplyMessage
352 func (m *PgEnableDisableReply) Size() (size int) {
356 size += 4 // m.Retval
359 func (m *PgEnableDisableReply) Marshal(b []byte) ([]byte, error) {
361 b = make([]byte, m.Size())
363 buf := codec.NewBuffer(b)
364 buf.EncodeInt32(m.Retval)
365 return buf.Bytes(), nil
367 func (m *PgEnableDisableReply) Unmarshal(b []byte) error {
368 buf := codec.NewBuffer(b)
369 m.Retval = buf.DecodeInt32()
373 // PgInterfaceEnableDisableCoalesce defines message 'pg_interface_enable_disable_coalesce'.
374 // InProgress: the message form may change in the future versions
375 type PgInterfaceEnableDisableCoalesce struct {
376 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
377 CoalesceEnabled bool `binapi:"bool,name=coalesce_enabled" json:"coalesce_enabled,omitempty"`
380 func (m *PgInterfaceEnableDisableCoalesce) Reset() { *m = PgInterfaceEnableDisableCoalesce{} }
381 func (*PgInterfaceEnableDisableCoalesce) GetMessageName() string {
382 return "pg_interface_enable_disable_coalesce"
384 func (*PgInterfaceEnableDisableCoalesce) GetCrcString() string { return "a2ef99e7" }
385 func (*PgInterfaceEnableDisableCoalesce) GetMessageType() api.MessageType {
386 return api.RequestMessage
389 func (m *PgInterfaceEnableDisableCoalesce) Size() (size int) {
393 size += 4 // m.SwIfIndex
394 size += 1 // m.CoalesceEnabled
397 func (m *PgInterfaceEnableDisableCoalesce) Marshal(b []byte) ([]byte, error) {
399 b = make([]byte, m.Size())
401 buf := codec.NewBuffer(b)
402 buf.EncodeUint32(uint32(m.SwIfIndex))
403 buf.EncodeBool(m.CoalesceEnabled)
404 return buf.Bytes(), nil
406 func (m *PgInterfaceEnableDisableCoalesce) Unmarshal(b []byte) error {
407 buf := codec.NewBuffer(b)
408 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
409 m.CoalesceEnabled = buf.DecodeBool()
413 // PgInterfaceEnableDisableCoalesceReply defines message 'pg_interface_enable_disable_coalesce_reply'.
414 // InProgress: the message form may change in the future versions
415 type PgInterfaceEnableDisableCoalesceReply struct {
416 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
419 func (m *PgInterfaceEnableDisableCoalesceReply) Reset() { *m = PgInterfaceEnableDisableCoalesceReply{} }
420 func (*PgInterfaceEnableDisableCoalesceReply) GetMessageName() string {
421 return "pg_interface_enable_disable_coalesce_reply"
423 func (*PgInterfaceEnableDisableCoalesceReply) GetCrcString() string { return "e8d4e804" }
424 func (*PgInterfaceEnableDisableCoalesceReply) GetMessageType() api.MessageType {
425 return api.ReplyMessage
428 func (m *PgInterfaceEnableDisableCoalesceReply) Size() (size int) {
432 size += 4 // m.Retval
435 func (m *PgInterfaceEnableDisableCoalesceReply) Marshal(b []byte) ([]byte, error) {
437 b = make([]byte, m.Size())
439 buf := codec.NewBuffer(b)
440 buf.EncodeInt32(m.Retval)
441 return buf.Bytes(), nil
443 func (m *PgInterfaceEnableDisableCoalesceReply) Unmarshal(b []byte) error {
444 buf := codec.NewBuffer(b)
445 m.Retval = buf.DecodeInt32()
449 func init() { file_pg_binapi_init() }
450 func file_pg_binapi_init() {
451 api.RegisterMessage((*PgCapture)(nil), "pg_capture_3712fb6c")
452 api.RegisterMessage((*PgCaptureReply)(nil), "pg_capture_reply_e8d4e804")
453 api.RegisterMessage((*PgCreateInterface)(nil), "pg_create_interface_b7c893d7")
454 api.RegisterMessage((*PgCreateInterfaceReply)(nil), "pg_create_interface_reply_5383d31f")
455 api.RegisterMessage((*PgCreateInterfaceV2)(nil), "pg_create_interface_v2_8657466a")
456 api.RegisterMessage((*PgCreateInterfaceV2Reply)(nil), "pg_create_interface_v2_reply_5383d31f")
457 api.RegisterMessage((*PgEnableDisable)(nil), "pg_enable_disable_01f94f3a")
458 api.RegisterMessage((*PgEnableDisableReply)(nil), "pg_enable_disable_reply_e8d4e804")
459 api.RegisterMessage((*PgInterfaceEnableDisableCoalesce)(nil), "pg_interface_enable_disable_coalesce_a2ef99e7")
460 api.RegisterMessage((*PgInterfaceEnableDisableCoalesceReply)(nil), "pg_interface_enable_disable_coalesce_reply_e8d4e804")
463 // Messages returns list of all messages in this module.
464 func AllMessages() []api.Message {
465 return []api.Message{
467 (*PgCaptureReply)(nil),
468 (*PgCreateInterface)(nil),
469 (*PgCreateInterfaceReply)(nil),
470 (*PgCreateInterfaceV2)(nil),
471 (*PgCreateInterfaceV2Reply)(nil),
472 (*PgEnableDisable)(nil),
473 (*PgEnableDisableReply)(nil),
474 (*PgInterfaceEnableDisableCoalesce)(nil),
475 (*PgInterfaceEnableDisableCoalesceReply)(nil),