1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: /usr/share/vpp/api/core/pg.api.json
7 // Package pg contains generated bindings for API file pg.api.
15 api "git.fd.io/govpp.git/api"
16 interface_types "git.fd.io/govpp.git/binapi/interface_types"
17 codec "git.fd.io/govpp.git/codec"
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
29 VersionCrc = 0xb7fe86ae
32 // PgCapture defines message 'pg_capture'.
33 type PgCapture struct {
34 InterfaceID interface_types.InterfaceIndex `binapi:"interface_index,name=interface_id" json:"interface_id,omitempty"`
35 IsEnabled bool `binapi:"bool,name=is_enabled,default=true" json:"is_enabled,omitempty"`
36 Count uint32 `binapi:"u32,name=count" json:"count,omitempty"`
37 PcapFileName string `binapi:"string[],name=pcap_file_name" json:"pcap_file_name,omitempty"`
40 func (m *PgCapture) Reset() { *m = PgCapture{} }
41 func (*PgCapture) GetMessageName() string { return "pg_capture" }
42 func (*PgCapture) GetCrcString() string { return "3712fb6c" }
43 func (*PgCapture) GetMessageType() api.MessageType {
44 return api.RequestMessage
47 func (m *PgCapture) Size() int {
52 size += 4 // m.InterfaceID
53 size += 1 // m.IsEnabled
55 size += 4 + len(m.PcapFileName) // m.PcapFileName
58 func (m *PgCapture) Marshal(b []byte) ([]byte, error) {
61 buf = codec.NewBuffer(make([]byte, m.Size()))
63 buf = codec.NewBuffer(b)
65 buf.EncodeUint32(uint32(m.InterfaceID))
66 buf.EncodeBool(m.IsEnabled)
67 buf.EncodeUint32(uint32(m.Count))
68 buf.EncodeString(m.PcapFileName, 0)
69 return buf.Bytes(), nil
71 func (m *PgCapture) Unmarshal(b []byte) error {
72 buf := codec.NewBuffer(b)
73 m.InterfaceID = interface_types.InterfaceIndex(buf.DecodeUint32())
74 m.IsEnabled = buf.DecodeBool()
75 m.Count = buf.DecodeUint32()
76 m.PcapFileName = buf.DecodeString(0)
80 // PgCaptureReply defines message 'pg_capture_reply'.
81 type PgCaptureReply struct {
82 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
85 func (m *PgCaptureReply) Reset() { *m = PgCaptureReply{} }
86 func (*PgCaptureReply) GetMessageName() string { return "pg_capture_reply" }
87 func (*PgCaptureReply) GetCrcString() string { return "e8d4e804" }
88 func (*PgCaptureReply) GetMessageType() api.MessageType {
89 return api.ReplyMessage
92 func (m *PgCaptureReply) Size() int {
100 func (m *PgCaptureReply) Marshal(b []byte) ([]byte, error) {
101 var buf *codec.Buffer
103 buf = codec.NewBuffer(make([]byte, m.Size()))
105 buf = codec.NewBuffer(b)
107 buf.EncodeUint32(uint32(m.Retval))
108 return buf.Bytes(), nil
110 func (m *PgCaptureReply) Unmarshal(b []byte) error {
111 buf := codec.NewBuffer(b)
112 m.Retval = int32(buf.DecodeUint32())
116 // PgCreateInterface defines message 'pg_create_interface'.
117 type PgCreateInterface struct {
118 InterfaceID interface_types.InterfaceIndex `binapi:"interface_index,name=interface_id" json:"interface_id,omitempty"`
119 GsoEnabled bool `binapi:"bool,name=gso_enabled" json:"gso_enabled,omitempty"`
120 GsoSize uint32 `binapi:"u32,name=gso_size" json:"gso_size,omitempty"`
123 func (m *PgCreateInterface) Reset() { *m = PgCreateInterface{} }
124 func (*PgCreateInterface) GetMessageName() string { return "pg_create_interface" }
125 func (*PgCreateInterface) GetCrcString() string { return "b7c893d7" }
126 func (*PgCreateInterface) GetMessageType() api.MessageType {
127 return api.RequestMessage
130 func (m *PgCreateInterface) Size() int {
135 size += 4 // m.InterfaceID
136 size += 1 // m.GsoEnabled
137 size += 4 // m.GsoSize
140 func (m *PgCreateInterface) Marshal(b []byte) ([]byte, error) {
141 var buf *codec.Buffer
143 buf = codec.NewBuffer(make([]byte, m.Size()))
145 buf = codec.NewBuffer(b)
147 buf.EncodeUint32(uint32(m.InterfaceID))
148 buf.EncodeBool(m.GsoEnabled)
149 buf.EncodeUint32(uint32(m.GsoSize))
150 return buf.Bytes(), nil
152 func (m *PgCreateInterface) Unmarshal(b []byte) error {
153 buf := codec.NewBuffer(b)
154 m.InterfaceID = interface_types.InterfaceIndex(buf.DecodeUint32())
155 m.GsoEnabled = buf.DecodeBool()
156 m.GsoSize = buf.DecodeUint32()
160 // PgCreateInterfaceReply defines message 'pg_create_interface_reply'.
161 type PgCreateInterfaceReply struct {
162 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
163 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
166 func (m *PgCreateInterfaceReply) Reset() { *m = PgCreateInterfaceReply{} }
167 func (*PgCreateInterfaceReply) GetMessageName() string { return "pg_create_interface_reply" }
168 func (*PgCreateInterfaceReply) GetCrcString() string { return "5383d31f" }
169 func (*PgCreateInterfaceReply) GetMessageType() api.MessageType {
170 return api.ReplyMessage
173 func (m *PgCreateInterfaceReply) Size() int {
178 size += 4 // m.Retval
179 size += 4 // m.SwIfIndex
182 func (m *PgCreateInterfaceReply) Marshal(b []byte) ([]byte, error) {
183 var buf *codec.Buffer
185 buf = codec.NewBuffer(make([]byte, m.Size()))
187 buf = codec.NewBuffer(b)
189 buf.EncodeUint32(uint32(m.Retval))
190 buf.EncodeUint32(uint32(m.SwIfIndex))
191 return buf.Bytes(), nil
193 func (m *PgCreateInterfaceReply) Unmarshal(b []byte) error {
194 buf := codec.NewBuffer(b)
195 m.Retval = int32(buf.DecodeUint32())
196 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
200 // PgEnableDisable defines message 'pg_enable_disable'.
201 type PgEnableDisable struct {
202 IsEnabled bool `binapi:"bool,name=is_enabled,default=true" json:"is_enabled,omitempty"`
203 StreamName string `binapi:"string[],name=stream_name" json:"stream_name,omitempty"`
206 func (m *PgEnableDisable) Reset() { *m = PgEnableDisable{} }
207 func (*PgEnableDisable) GetMessageName() string { return "pg_enable_disable" }
208 func (*PgEnableDisable) GetCrcString() string { return "01f94f3a" }
209 func (*PgEnableDisable) GetMessageType() api.MessageType {
210 return api.RequestMessage
213 func (m *PgEnableDisable) Size() int {
218 size += 1 // m.IsEnabled
219 size += 4 + len(m.StreamName) // m.StreamName
222 func (m *PgEnableDisable) Marshal(b []byte) ([]byte, error) {
223 var buf *codec.Buffer
225 buf = codec.NewBuffer(make([]byte, m.Size()))
227 buf = codec.NewBuffer(b)
229 buf.EncodeBool(m.IsEnabled)
230 buf.EncodeString(m.StreamName, 0)
231 return buf.Bytes(), nil
233 func (m *PgEnableDisable) Unmarshal(b []byte) error {
234 buf := codec.NewBuffer(b)
235 m.IsEnabled = buf.DecodeBool()
236 m.StreamName = buf.DecodeString(0)
240 // PgEnableDisableReply defines message 'pg_enable_disable_reply'.
241 type PgEnableDisableReply struct {
242 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
245 func (m *PgEnableDisableReply) Reset() { *m = PgEnableDisableReply{} }
246 func (*PgEnableDisableReply) GetMessageName() string { return "pg_enable_disable_reply" }
247 func (*PgEnableDisableReply) GetCrcString() string { return "e8d4e804" }
248 func (*PgEnableDisableReply) GetMessageType() api.MessageType {
249 return api.ReplyMessage
252 func (m *PgEnableDisableReply) Size() int {
257 size += 4 // m.Retval
260 func (m *PgEnableDisableReply) Marshal(b []byte) ([]byte, error) {
261 var buf *codec.Buffer
263 buf = codec.NewBuffer(make([]byte, m.Size()))
265 buf = codec.NewBuffer(b)
267 buf.EncodeUint32(uint32(m.Retval))
268 return buf.Bytes(), nil
270 func (m *PgEnableDisableReply) Unmarshal(b []byte) error {
271 buf := codec.NewBuffer(b)
272 m.Retval = int32(buf.DecodeUint32())
276 func init() { file_pg_binapi_init() }
277 func file_pg_binapi_init() {
278 api.RegisterMessage((*PgCapture)(nil), "pg_capture_3712fb6c")
279 api.RegisterMessage((*PgCaptureReply)(nil), "pg_capture_reply_e8d4e804")
280 api.RegisterMessage((*PgCreateInterface)(nil), "pg_create_interface_b7c893d7")
281 api.RegisterMessage((*PgCreateInterfaceReply)(nil), "pg_create_interface_reply_5383d31f")
282 api.RegisterMessage((*PgEnableDisable)(nil), "pg_enable_disable_01f94f3a")
283 api.RegisterMessage((*PgEnableDisableReply)(nil), "pg_enable_disable_reply_e8d4e804")
286 // Messages returns list of all messages in this module.
287 func AllMessages() []api.Message {
288 return []api.Message{
290 (*PgCaptureReply)(nil),
291 (*PgCreateInterface)(nil),
292 (*PgCreateInterfaceReply)(nil),
293 (*PgEnableDisable)(nil),
294 (*PgEnableDisableReply)(nil),