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() (size int) {
150 size += 1 // m.RecordFlags
151 size += 4 // m.ActiveTimer
152 size += 4 // m.PassiveTimer
155 func (m *FlowprobeParams) Marshal(b []byte) ([]byte, error) {
157 b = make([]byte, m.Size())
159 buf := codec.NewBuffer(b)
160 buf.EncodeUint8(uint8(m.RecordFlags))
161 buf.EncodeUint32(m.ActiveTimer)
162 buf.EncodeUint32(m.PassiveTimer)
163 return buf.Bytes(), nil
165 func (m *FlowprobeParams) Unmarshal(b []byte) error {
166 buf := codec.NewBuffer(b)
167 m.RecordFlags = FlowprobeRecordFlags(buf.DecodeUint8())
168 m.ActiveTimer = buf.DecodeUint32()
169 m.PassiveTimer = buf.DecodeUint32()
173 // FlowprobeParamsReply defines message 'flowprobe_params_reply'.
174 type FlowprobeParamsReply struct {
175 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
178 func (m *FlowprobeParamsReply) Reset() { *m = FlowprobeParamsReply{} }
179 func (*FlowprobeParamsReply) GetMessageName() string { return "flowprobe_params_reply" }
180 func (*FlowprobeParamsReply) GetCrcString() string { return "e8d4e804" }
181 func (*FlowprobeParamsReply) GetMessageType() api.MessageType {
182 return api.ReplyMessage
185 func (m *FlowprobeParamsReply) Size() (size int) {
189 size += 4 // m.Retval
192 func (m *FlowprobeParamsReply) Marshal(b []byte) ([]byte, error) {
194 b = make([]byte, m.Size())
196 buf := codec.NewBuffer(b)
197 buf.EncodeInt32(m.Retval)
198 return buf.Bytes(), nil
200 func (m *FlowprobeParamsReply) Unmarshal(b []byte) error {
201 buf := codec.NewBuffer(b)
202 m.Retval = buf.DecodeInt32()
206 // FlowprobeTxInterfaceAddDel defines message 'flowprobe_tx_interface_add_del'.
207 type FlowprobeTxInterfaceAddDel struct {
208 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
209 Which FlowprobeWhichFlags `binapi:"flowprobe_which_flags,name=which" json:"which,omitempty"`
210 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
213 func (m *FlowprobeTxInterfaceAddDel) Reset() { *m = FlowprobeTxInterfaceAddDel{} }
214 func (*FlowprobeTxInterfaceAddDel) GetMessageName() string { return "flowprobe_tx_interface_add_del" }
215 func (*FlowprobeTxInterfaceAddDel) GetCrcString() string { return "b782c976" }
216 func (*FlowprobeTxInterfaceAddDel) GetMessageType() api.MessageType {
217 return api.RequestMessage
220 func (m *FlowprobeTxInterfaceAddDel) Size() (size int) {
226 size += 4 // m.SwIfIndex
229 func (m *FlowprobeTxInterfaceAddDel) Marshal(b []byte) ([]byte, error) {
231 b = make([]byte, m.Size())
233 buf := codec.NewBuffer(b)
234 buf.EncodeBool(m.IsAdd)
235 buf.EncodeUint8(uint8(m.Which))
236 buf.EncodeUint32(uint32(m.SwIfIndex))
237 return buf.Bytes(), nil
239 func (m *FlowprobeTxInterfaceAddDel) Unmarshal(b []byte) error {
240 buf := codec.NewBuffer(b)
241 m.IsAdd = buf.DecodeBool()
242 m.Which = FlowprobeWhichFlags(buf.DecodeUint8())
243 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
247 // FlowprobeTxInterfaceAddDelReply defines message 'flowprobe_tx_interface_add_del_reply'.
248 type FlowprobeTxInterfaceAddDelReply struct {
249 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
252 func (m *FlowprobeTxInterfaceAddDelReply) Reset() { *m = FlowprobeTxInterfaceAddDelReply{} }
253 func (*FlowprobeTxInterfaceAddDelReply) GetMessageName() string {
254 return "flowprobe_tx_interface_add_del_reply"
256 func (*FlowprobeTxInterfaceAddDelReply) GetCrcString() string { return "e8d4e804" }
257 func (*FlowprobeTxInterfaceAddDelReply) GetMessageType() api.MessageType {
258 return api.ReplyMessage
261 func (m *FlowprobeTxInterfaceAddDelReply) Size() (size int) {
265 size += 4 // m.Retval
268 func (m *FlowprobeTxInterfaceAddDelReply) Marshal(b []byte) ([]byte, error) {
270 b = make([]byte, m.Size())
272 buf := codec.NewBuffer(b)
273 buf.EncodeInt32(m.Retval)
274 return buf.Bytes(), nil
276 func (m *FlowprobeTxInterfaceAddDelReply) Unmarshal(b []byte) error {
277 buf := codec.NewBuffer(b)
278 m.Retval = buf.DecodeInt32()
282 func init() { file_flowprobe_binapi_init() }
283 func file_flowprobe_binapi_init() {
284 api.RegisterMessage((*FlowprobeParams)(nil), "flowprobe_params_baa46c09")
285 api.RegisterMessage((*FlowprobeParamsReply)(nil), "flowprobe_params_reply_e8d4e804")
286 api.RegisterMessage((*FlowprobeTxInterfaceAddDel)(nil), "flowprobe_tx_interface_add_del_b782c976")
287 api.RegisterMessage((*FlowprobeTxInterfaceAddDelReply)(nil), "flowprobe_tx_interface_add_del_reply_e8d4e804")
290 // Messages returns list of all messages in this module.
291 func AllMessages() []api.Message {
292 return []api.Message{
293 (*FlowprobeParams)(nil),
294 (*FlowprobeParamsReply)(nil),
295 (*FlowprobeTxInterfaceAddDel)(nil),
296 (*FlowprobeTxInterfaceAddDelReply)(nil),