1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
6 // Package pg contains generated bindings for API file pg.api.
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"
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
28 VersionCrc = 0xb7fe86ae
31 // PgCapture defines message 'pg_capture'.
32 type PgCapture struct {
33 InterfaceID interface_types.InterfaceIndex `binapi:"interface_index,name=interface_id" json:"interface_id,omitempty"`
34 IsEnabled bool `binapi:"bool,name=is_enabled,default=true" json:"is_enabled,omitempty"`
35 Count uint32 `binapi:"u32,name=count" json:"count,omitempty"`
36 PcapFileName string `binapi:"string[],name=pcap_file_name" json:"pcap_file_name,omitempty"`
39 func (m *PgCapture) Reset() { *m = PgCapture{} }
40 func (*PgCapture) GetMessageName() string { return "pg_capture" }
41 func (*PgCapture) GetCrcString() string { return "3712fb6c" }
42 func (*PgCapture) GetMessageType() api.MessageType {
43 return api.RequestMessage
46 func (m *PgCapture) Size() (size int) {
50 size += 4 // m.InterfaceID
51 size += 1 // m.IsEnabled
53 size += 4 + len(m.PcapFileName) // m.PcapFileName
56 func (m *PgCapture) Marshal(b []byte) ([]byte, error) {
58 b = make([]byte, m.Size())
60 buf := codec.NewBuffer(b)
61 buf.EncodeUint32(uint32(m.InterfaceID))
62 buf.EncodeBool(m.IsEnabled)
63 buf.EncodeUint32(m.Count)
64 buf.EncodeString(m.PcapFileName, 0)
65 return buf.Bytes(), nil
67 func (m *PgCapture) Unmarshal(b []byte) error {
68 buf := codec.NewBuffer(b)
69 m.InterfaceID = interface_types.InterfaceIndex(buf.DecodeUint32())
70 m.IsEnabled = buf.DecodeBool()
71 m.Count = buf.DecodeUint32()
72 m.PcapFileName = buf.DecodeString(0)
76 // PgCaptureReply defines message 'pg_capture_reply'.
77 type PgCaptureReply struct {
78 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
81 func (m *PgCaptureReply) Reset() { *m = PgCaptureReply{} }
82 func (*PgCaptureReply) GetMessageName() string { return "pg_capture_reply" }
83 func (*PgCaptureReply) GetCrcString() string { return "e8d4e804" }
84 func (*PgCaptureReply) GetMessageType() api.MessageType {
85 return api.ReplyMessage
88 func (m *PgCaptureReply) Size() (size int) {
95 func (m *PgCaptureReply) Marshal(b []byte) ([]byte, error) {
97 b = make([]byte, m.Size())
99 buf := codec.NewBuffer(b)
100 buf.EncodeInt32(m.Retval)
101 return buf.Bytes(), nil
103 func (m *PgCaptureReply) Unmarshal(b []byte) error {
104 buf := codec.NewBuffer(b)
105 m.Retval = buf.DecodeInt32()
109 // PgCreateInterface defines message 'pg_create_interface'.
110 type PgCreateInterface struct {
111 InterfaceID interface_types.InterfaceIndex `binapi:"interface_index,name=interface_id" json:"interface_id,omitempty"`
112 GsoEnabled bool `binapi:"bool,name=gso_enabled" json:"gso_enabled,omitempty"`
113 GsoSize uint32 `binapi:"u32,name=gso_size" json:"gso_size,omitempty"`
116 func (m *PgCreateInterface) Reset() { *m = PgCreateInterface{} }
117 func (*PgCreateInterface) GetMessageName() string { return "pg_create_interface" }
118 func (*PgCreateInterface) GetCrcString() string { return "b7c893d7" }
119 func (*PgCreateInterface) GetMessageType() api.MessageType {
120 return api.RequestMessage
123 func (m *PgCreateInterface) Size() (size int) {
127 size += 4 // m.InterfaceID
128 size += 1 // m.GsoEnabled
129 size += 4 // m.GsoSize
132 func (m *PgCreateInterface) Marshal(b []byte) ([]byte, error) {
134 b = make([]byte, m.Size())
136 buf := codec.NewBuffer(b)
137 buf.EncodeUint32(uint32(m.InterfaceID))
138 buf.EncodeBool(m.GsoEnabled)
139 buf.EncodeUint32(m.GsoSize)
140 return buf.Bytes(), nil
142 func (m *PgCreateInterface) Unmarshal(b []byte) error {
143 buf := codec.NewBuffer(b)
144 m.InterfaceID = interface_types.InterfaceIndex(buf.DecodeUint32())
145 m.GsoEnabled = buf.DecodeBool()
146 m.GsoSize = buf.DecodeUint32()
150 // PgCreateInterfaceReply defines message 'pg_create_interface_reply'.
151 type PgCreateInterfaceReply struct {
152 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
153 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
156 func (m *PgCreateInterfaceReply) Reset() { *m = PgCreateInterfaceReply{} }
157 func (*PgCreateInterfaceReply) GetMessageName() string { return "pg_create_interface_reply" }
158 func (*PgCreateInterfaceReply) GetCrcString() string { return "5383d31f" }
159 func (*PgCreateInterfaceReply) GetMessageType() api.MessageType {
160 return api.ReplyMessage
163 func (m *PgCreateInterfaceReply) Size() (size int) {
167 size += 4 // m.Retval
168 size += 4 // m.SwIfIndex
171 func (m *PgCreateInterfaceReply) Marshal(b []byte) ([]byte, error) {
173 b = make([]byte, m.Size())
175 buf := codec.NewBuffer(b)
176 buf.EncodeInt32(m.Retval)
177 buf.EncodeUint32(uint32(m.SwIfIndex))
178 return buf.Bytes(), nil
180 func (m *PgCreateInterfaceReply) Unmarshal(b []byte) error {
181 buf := codec.NewBuffer(b)
182 m.Retval = buf.DecodeInt32()
183 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
187 // PgEnableDisable defines message 'pg_enable_disable'.
188 type PgEnableDisable struct {
189 IsEnabled bool `binapi:"bool,name=is_enabled,default=true" json:"is_enabled,omitempty"`
190 StreamName string `binapi:"string[],name=stream_name" json:"stream_name,omitempty"`
193 func (m *PgEnableDisable) Reset() { *m = PgEnableDisable{} }
194 func (*PgEnableDisable) GetMessageName() string { return "pg_enable_disable" }
195 func (*PgEnableDisable) GetCrcString() string { return "01f94f3a" }
196 func (*PgEnableDisable) GetMessageType() api.MessageType {
197 return api.RequestMessage
200 func (m *PgEnableDisable) Size() (size int) {
204 size += 1 // m.IsEnabled
205 size += 4 + len(m.StreamName) // m.StreamName
208 func (m *PgEnableDisable) Marshal(b []byte) ([]byte, error) {
210 b = make([]byte, m.Size())
212 buf := codec.NewBuffer(b)
213 buf.EncodeBool(m.IsEnabled)
214 buf.EncodeString(m.StreamName, 0)
215 return buf.Bytes(), nil
217 func (m *PgEnableDisable) Unmarshal(b []byte) error {
218 buf := codec.NewBuffer(b)
219 m.IsEnabled = buf.DecodeBool()
220 m.StreamName = buf.DecodeString(0)
224 // PgEnableDisableReply defines message 'pg_enable_disable_reply'.
225 type PgEnableDisableReply struct {
226 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
229 func (m *PgEnableDisableReply) Reset() { *m = PgEnableDisableReply{} }
230 func (*PgEnableDisableReply) GetMessageName() string { return "pg_enable_disable_reply" }
231 func (*PgEnableDisableReply) GetCrcString() string { return "e8d4e804" }
232 func (*PgEnableDisableReply) GetMessageType() api.MessageType {
233 return api.ReplyMessage
236 func (m *PgEnableDisableReply) Size() (size int) {
240 size += 4 // m.Retval
243 func (m *PgEnableDisableReply) Marshal(b []byte) ([]byte, error) {
245 b = make([]byte, m.Size())
247 buf := codec.NewBuffer(b)
248 buf.EncodeInt32(m.Retval)
249 return buf.Bytes(), nil
251 func (m *PgEnableDisableReply) Unmarshal(b []byte) error {
252 buf := codec.NewBuffer(b)
253 m.Retval = buf.DecodeInt32()
257 func init() { file_pg_binapi_init() }
258 func file_pg_binapi_init() {
259 api.RegisterMessage((*PgCapture)(nil), "pg_capture_3712fb6c")
260 api.RegisterMessage((*PgCaptureReply)(nil), "pg_capture_reply_e8d4e804")
261 api.RegisterMessage((*PgCreateInterface)(nil), "pg_create_interface_b7c893d7")
262 api.RegisterMessage((*PgCreateInterfaceReply)(nil), "pg_create_interface_reply_5383d31f")
263 api.RegisterMessage((*PgEnableDisable)(nil), "pg_enable_disable_01f94f3a")
264 api.RegisterMessage((*PgEnableDisableReply)(nil), "pg_enable_disable_reply_e8d4e804")
267 // Messages returns list of all messages in this module.
268 func AllMessages() []api.Message {
269 return []api.Message{
271 (*PgCaptureReply)(nil),
272 (*PgCreateInterface)(nil),
273 (*PgCreateInterfaceReply)(nil),
274 (*PgEnableDisable)(nil),
275 (*PgEnableDisableReply)(nil),