1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: /usr/share/vpp/api/plugins/flowprobe.api.json
7 // Package flowprobe contains generated bindings for API file flowprobe.api.
16 api "git.fd.io/govpp.git/api"
17 interface_types "git.fd.io/govpp.git/binapi/interface_types"
18 codec "git.fd.io/govpp.git/codec"
22 // This is a compile-time assertion to ensure that this generated file
23 // is compatible with the GoVPP api package it is being compiled against.
24 // A compilation error at this line likely means your copy of the
25 // GoVPP api package needs to be updated.
26 const _ = api.GoVppAPIPackageIsVersion2
31 VersionCrc = 0xe904179b
34 // FlowprobeRecordFlags defines enum 'flowprobe_record_flags'.
35 type FlowprobeRecordFlags uint8
38 FLOWPROBE_RECORD_FLAG_L2 FlowprobeRecordFlags = 1
39 FLOWPROBE_RECORD_FLAG_L3 FlowprobeRecordFlags = 2
40 FLOWPROBE_RECORD_FLAG_L4 FlowprobeRecordFlags = 4
44 FlowprobeRecordFlags_name = map[uint8]string{
45 1: "FLOWPROBE_RECORD_FLAG_L2",
46 2: "FLOWPROBE_RECORD_FLAG_L3",
47 4: "FLOWPROBE_RECORD_FLAG_L4",
49 FlowprobeRecordFlags_value = map[string]uint8{
50 "FLOWPROBE_RECORD_FLAG_L2": 1,
51 "FLOWPROBE_RECORD_FLAG_L3": 2,
52 "FLOWPROBE_RECORD_FLAG_L4": 4,
56 func (x FlowprobeRecordFlags) String() string {
57 s, ok := FlowprobeRecordFlags_name[uint8(x)]
61 str := func(n uint8) string {
62 s, ok := FlowprobeRecordFlags_name[uint8(n)]
66 return "FlowprobeRecordFlags(" + strconv.Itoa(int(n)) + ")"
68 for i := uint8(0); i <= 8; i++ {
83 // FlowprobeWhichFlags defines enum 'flowprobe_which_flags'.
84 type FlowprobeWhichFlags uint8
87 FLOWPROBE_WHICH_FLAG_IP4 FlowprobeWhichFlags = 1
88 FLOWPROBE_WHICH_FLAG_L2 FlowprobeWhichFlags = 2
89 FLOWPROBE_WHICH_FLAG_IP6 FlowprobeWhichFlags = 4
93 FlowprobeWhichFlags_name = map[uint8]string{
94 1: "FLOWPROBE_WHICH_FLAG_IP4",
95 2: "FLOWPROBE_WHICH_FLAG_L2",
96 4: "FLOWPROBE_WHICH_FLAG_IP6",
98 FlowprobeWhichFlags_value = map[string]uint8{
99 "FLOWPROBE_WHICH_FLAG_IP4": 1,
100 "FLOWPROBE_WHICH_FLAG_L2": 2,
101 "FLOWPROBE_WHICH_FLAG_IP6": 4,
105 func (x FlowprobeWhichFlags) String() string {
106 s, ok := FlowprobeWhichFlags_name[uint8(x)]
110 str := func(n uint8) string {
111 s, ok := FlowprobeWhichFlags_name[uint8(n)]
115 return "FlowprobeWhichFlags(" + strconv.Itoa(int(n)) + ")"
117 for i := uint8(0); i <= 8; i++ {
132 // FlowprobeParams defines message 'flowprobe_params'.
133 type FlowprobeParams struct {
134 RecordFlags FlowprobeRecordFlags `binapi:"flowprobe_record_flags,name=record_flags" json:"record_flags,omitempty"`
135 ActiveTimer uint32 `binapi:"u32,name=active_timer" json:"active_timer,omitempty"`
136 PassiveTimer uint32 `binapi:"u32,name=passive_timer" json:"passive_timer,omitempty"`
139 func (m *FlowprobeParams) Reset() { *m = FlowprobeParams{} }
140 func (*FlowprobeParams) GetMessageName() string { return "flowprobe_params" }
141 func (*FlowprobeParams) GetCrcString() string { return "baa46c09" }
142 func (*FlowprobeParams) GetMessageType() api.MessageType {
143 return api.RequestMessage
146 func (m *FlowprobeParams) Size() int {
151 size += 1 // m.RecordFlags
152 size += 4 // m.ActiveTimer
153 size += 4 // m.PassiveTimer
156 func (m *FlowprobeParams) Marshal(b []byte) ([]byte, error) {
157 var buf *codec.Buffer
159 buf = codec.NewBuffer(make([]byte, m.Size()))
161 buf = codec.NewBuffer(b)
163 buf.EncodeUint8(uint8(m.RecordFlags))
164 buf.EncodeUint32(uint32(m.ActiveTimer))
165 buf.EncodeUint32(uint32(m.PassiveTimer))
166 return buf.Bytes(), nil
168 func (m *FlowprobeParams) Unmarshal(b []byte) error {
169 buf := codec.NewBuffer(b)
170 m.RecordFlags = FlowprobeRecordFlags(buf.DecodeUint8())
171 m.ActiveTimer = buf.DecodeUint32()
172 m.PassiveTimer = buf.DecodeUint32()
176 // FlowprobeParamsReply defines message 'flowprobe_params_reply'.
177 type FlowprobeParamsReply struct {
178 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
181 func (m *FlowprobeParamsReply) Reset() { *m = FlowprobeParamsReply{} }
182 func (*FlowprobeParamsReply) GetMessageName() string { return "flowprobe_params_reply" }
183 func (*FlowprobeParamsReply) GetCrcString() string { return "e8d4e804" }
184 func (*FlowprobeParamsReply) GetMessageType() api.MessageType {
185 return api.ReplyMessage
188 func (m *FlowprobeParamsReply) Size() int {
193 size += 4 // m.Retval
196 func (m *FlowprobeParamsReply) Marshal(b []byte) ([]byte, error) {
197 var buf *codec.Buffer
199 buf = codec.NewBuffer(make([]byte, m.Size()))
201 buf = codec.NewBuffer(b)
203 buf.EncodeUint32(uint32(m.Retval))
204 return buf.Bytes(), nil
206 func (m *FlowprobeParamsReply) Unmarshal(b []byte) error {
207 buf := codec.NewBuffer(b)
208 m.Retval = int32(buf.DecodeUint32())
212 // FlowprobeTxInterfaceAddDel defines message 'flowprobe_tx_interface_add_del'.
213 type FlowprobeTxInterfaceAddDel struct {
214 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
215 Which FlowprobeWhichFlags `binapi:"flowprobe_which_flags,name=which" json:"which,omitempty"`
216 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
219 func (m *FlowprobeTxInterfaceAddDel) Reset() { *m = FlowprobeTxInterfaceAddDel{} }
220 func (*FlowprobeTxInterfaceAddDel) GetMessageName() string { return "flowprobe_tx_interface_add_del" }
221 func (*FlowprobeTxInterfaceAddDel) GetCrcString() string { return "b782c976" }
222 func (*FlowprobeTxInterfaceAddDel) GetMessageType() api.MessageType {
223 return api.RequestMessage
226 func (m *FlowprobeTxInterfaceAddDel) Size() int {
233 size += 4 // m.SwIfIndex
236 func (m *FlowprobeTxInterfaceAddDel) Marshal(b []byte) ([]byte, error) {
237 var buf *codec.Buffer
239 buf = codec.NewBuffer(make([]byte, m.Size()))
241 buf = codec.NewBuffer(b)
243 buf.EncodeBool(m.IsAdd)
244 buf.EncodeUint8(uint8(m.Which))
245 buf.EncodeUint32(uint32(m.SwIfIndex))
246 return buf.Bytes(), nil
248 func (m *FlowprobeTxInterfaceAddDel) Unmarshal(b []byte) error {
249 buf := codec.NewBuffer(b)
250 m.IsAdd = buf.DecodeBool()
251 m.Which = FlowprobeWhichFlags(buf.DecodeUint8())
252 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
256 // FlowprobeTxInterfaceAddDelReply defines message 'flowprobe_tx_interface_add_del_reply'.
257 type FlowprobeTxInterfaceAddDelReply struct {
258 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
261 func (m *FlowprobeTxInterfaceAddDelReply) Reset() { *m = FlowprobeTxInterfaceAddDelReply{} }
262 func (*FlowprobeTxInterfaceAddDelReply) GetMessageName() string {
263 return "flowprobe_tx_interface_add_del_reply"
265 func (*FlowprobeTxInterfaceAddDelReply) GetCrcString() string { return "e8d4e804" }
266 func (*FlowprobeTxInterfaceAddDelReply) GetMessageType() api.MessageType {
267 return api.ReplyMessage
270 func (m *FlowprobeTxInterfaceAddDelReply) Size() int {
275 size += 4 // m.Retval
278 func (m *FlowprobeTxInterfaceAddDelReply) Marshal(b []byte) ([]byte, error) {
279 var buf *codec.Buffer
281 buf = codec.NewBuffer(make([]byte, m.Size()))
283 buf = codec.NewBuffer(b)
285 buf.EncodeUint32(uint32(m.Retval))
286 return buf.Bytes(), nil
288 func (m *FlowprobeTxInterfaceAddDelReply) Unmarshal(b []byte) error {
289 buf := codec.NewBuffer(b)
290 m.Retval = int32(buf.DecodeUint32())
294 func init() { file_flowprobe_binapi_init() }
295 func file_flowprobe_binapi_init() {
296 api.RegisterMessage((*FlowprobeParams)(nil), "flowprobe_params_baa46c09")
297 api.RegisterMessage((*FlowprobeParamsReply)(nil), "flowprobe_params_reply_e8d4e804")
298 api.RegisterMessage((*FlowprobeTxInterfaceAddDel)(nil), "flowprobe_tx_interface_add_del_b782c976")
299 api.RegisterMessage((*FlowprobeTxInterfaceAddDelReply)(nil), "flowprobe_tx_interface_add_del_reply_e8d4e804")
302 // Messages returns list of all messages in this module.
303 func AllMessages() []api.Message {
304 return []api.Message{
305 (*FlowprobeParams)(nil),
306 (*FlowprobeParamsReply)(nil),
307 (*FlowprobeTxInterfaceAddDel)(nil),
308 (*FlowprobeTxInterfaceAddDelReply)(nil),