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.
18 api "git.fd.io/govpp.git/api"
19 interface_types "git.fd.io/govpp.git/binapi/interface_types"
20 codec "git.fd.io/govpp.git/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 = 0x8da9f1c
35 // FlowprobeRecordFlags defines enum 'flowprobe_record_flags'.
36 type FlowprobeRecordFlags uint8
39 FLOWPROBE_RECORD_FLAG_L2 FlowprobeRecordFlags = 1
40 FLOWPROBE_RECORD_FLAG_L3 FlowprobeRecordFlags = 2
41 FLOWPROBE_RECORD_FLAG_L4 FlowprobeRecordFlags = 4
45 FlowprobeRecordFlags_name = map[uint8]string{
46 1: "FLOWPROBE_RECORD_FLAG_L2",
47 2: "FLOWPROBE_RECORD_FLAG_L3",
48 4: "FLOWPROBE_RECORD_FLAG_L4",
50 FlowprobeRecordFlags_value = map[string]uint8{
51 "FLOWPROBE_RECORD_FLAG_L2": 1,
52 "FLOWPROBE_RECORD_FLAG_L3": 2,
53 "FLOWPROBE_RECORD_FLAG_L4": 4,
57 func (x FlowprobeRecordFlags) String() string {
58 s, ok := FlowprobeRecordFlags_name[uint8(x)]
62 str := func(n uint8) string {
63 s, ok := FlowprobeRecordFlags_name[uint8(n)]
67 return "FlowprobeRecordFlags(" + strconv.Itoa(int(n)) + ")"
69 for i := uint8(0); i <= 8; i++ {
84 // FlowprobeWhichFlags defines enum 'flowprobe_which_flags'.
85 type FlowprobeWhichFlags uint8
88 FLOWPROBE_WHICH_FLAG_IP4 FlowprobeWhichFlags = 1
89 FLOWPROBE_WHICH_FLAG_L2 FlowprobeWhichFlags = 2
90 FLOWPROBE_WHICH_FLAG_IP6 FlowprobeWhichFlags = 4
94 FlowprobeWhichFlags_name = map[uint8]string{
95 1: "FLOWPROBE_WHICH_FLAG_IP4",
96 2: "FLOWPROBE_WHICH_FLAG_L2",
97 4: "FLOWPROBE_WHICH_FLAG_IP6",
99 FlowprobeWhichFlags_value = map[string]uint8{
100 "FLOWPROBE_WHICH_FLAG_IP4": 1,
101 "FLOWPROBE_WHICH_FLAG_L2": 2,
102 "FLOWPROBE_WHICH_FLAG_IP6": 4,
106 func (x FlowprobeWhichFlags) String() string {
107 s, ok := FlowprobeWhichFlags_name[uint8(x)]
111 str := func(n uint8) string {
112 s, ok := FlowprobeWhichFlags_name[uint8(n)]
116 return "FlowprobeWhichFlags(" + strconv.Itoa(int(n)) + ")"
118 for i := uint8(0); i <= 8; i++ {
133 // FlowprobeParams defines message 'flowprobe_params'.
134 type FlowprobeParams struct {
135 RecordFlags FlowprobeRecordFlags `binapi:"flowprobe_record_flags,name=record_flags" json:"record_flags,omitempty"`
136 ActiveTimer uint32 `binapi:"u32,name=active_timer" json:"active_timer,omitempty"`
137 PassiveTimer uint32 `binapi:"u32,name=passive_timer" json:"passive_timer,omitempty"`
140 func (m *FlowprobeParams) Reset() { *m = FlowprobeParams{} }
141 func (*FlowprobeParams) GetMessageName() string { return "flowprobe_params" }
142 func (*FlowprobeParams) GetCrcString() string { return "baa46c09" }
143 func (*FlowprobeParams) GetMessageType() api.MessageType {
144 return api.RequestMessage
147 func (m *FlowprobeParams) Size() (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) {
158 b = make([]byte, m.Size())
160 buf := codec.NewBuffer(b)
161 buf.EncodeUint8(uint8(m.RecordFlags))
162 buf.EncodeUint32(m.ActiveTimer)
163 buf.EncodeUint32(m.PassiveTimer)
164 return buf.Bytes(), nil
166 func (m *FlowprobeParams) Unmarshal(b []byte) error {
167 buf := codec.NewBuffer(b)
168 m.RecordFlags = FlowprobeRecordFlags(buf.DecodeUint8())
169 m.ActiveTimer = buf.DecodeUint32()
170 m.PassiveTimer = buf.DecodeUint32()
174 // FlowprobeParamsReply defines message 'flowprobe_params_reply'.
175 type FlowprobeParamsReply struct {
176 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
179 func (m *FlowprobeParamsReply) Reset() { *m = FlowprobeParamsReply{} }
180 func (*FlowprobeParamsReply) GetMessageName() string { return "flowprobe_params_reply" }
181 func (*FlowprobeParamsReply) GetCrcString() string { return "e8d4e804" }
182 func (*FlowprobeParamsReply) GetMessageType() api.MessageType {
183 return api.ReplyMessage
186 func (m *FlowprobeParamsReply) Size() (size int) {
190 size += 4 // m.Retval
193 func (m *FlowprobeParamsReply) Marshal(b []byte) ([]byte, error) {
195 b = make([]byte, m.Size())
197 buf := codec.NewBuffer(b)
198 buf.EncodeInt32(m.Retval)
199 return buf.Bytes(), nil
201 func (m *FlowprobeParamsReply) Unmarshal(b []byte) error {
202 buf := codec.NewBuffer(b)
203 m.Retval = buf.DecodeInt32()
207 // FlowprobeTxInterfaceAddDel defines message 'flowprobe_tx_interface_add_del'.
208 type FlowprobeTxInterfaceAddDel struct {
209 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
210 Which FlowprobeWhichFlags `binapi:"flowprobe_which_flags,name=which" json:"which,omitempty"`
211 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
214 func (m *FlowprobeTxInterfaceAddDel) Reset() { *m = FlowprobeTxInterfaceAddDel{} }
215 func (*FlowprobeTxInterfaceAddDel) GetMessageName() string { return "flowprobe_tx_interface_add_del" }
216 func (*FlowprobeTxInterfaceAddDel) GetCrcString() string { return "b782c976" }
217 func (*FlowprobeTxInterfaceAddDel) GetMessageType() api.MessageType {
218 return api.RequestMessage
221 func (m *FlowprobeTxInterfaceAddDel) Size() (size int) {
227 size += 4 // m.SwIfIndex
230 func (m *FlowprobeTxInterfaceAddDel) Marshal(b []byte) ([]byte, error) {
232 b = make([]byte, m.Size())
234 buf := codec.NewBuffer(b)
235 buf.EncodeBool(m.IsAdd)
236 buf.EncodeUint8(uint8(m.Which))
237 buf.EncodeUint32(uint32(m.SwIfIndex))
238 return buf.Bytes(), nil
240 func (m *FlowprobeTxInterfaceAddDel) Unmarshal(b []byte) error {
241 buf := codec.NewBuffer(b)
242 m.IsAdd = buf.DecodeBool()
243 m.Which = FlowprobeWhichFlags(buf.DecodeUint8())
244 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
248 // FlowprobeTxInterfaceAddDelReply defines message 'flowprobe_tx_interface_add_del_reply'.
249 type FlowprobeTxInterfaceAddDelReply struct {
250 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
253 func (m *FlowprobeTxInterfaceAddDelReply) Reset() { *m = FlowprobeTxInterfaceAddDelReply{} }
254 func (*FlowprobeTxInterfaceAddDelReply) GetMessageName() string {
255 return "flowprobe_tx_interface_add_del_reply"
257 func (*FlowprobeTxInterfaceAddDelReply) GetCrcString() string { return "e8d4e804" }
258 func (*FlowprobeTxInterfaceAddDelReply) GetMessageType() api.MessageType {
259 return api.ReplyMessage
262 func (m *FlowprobeTxInterfaceAddDelReply) Size() (size int) {
266 size += 4 // m.Retval
269 func (m *FlowprobeTxInterfaceAddDelReply) Marshal(b []byte) ([]byte, error) {
271 b = make([]byte, m.Size())
273 buf := codec.NewBuffer(b)
274 buf.EncodeInt32(m.Retval)
275 return buf.Bytes(), nil
277 func (m *FlowprobeTxInterfaceAddDelReply) Unmarshal(b []byte) error {
278 buf := codec.NewBuffer(b)
279 m.Retval = buf.DecodeInt32()
283 func init() { file_flowprobe_binapi_init() }
284 func file_flowprobe_binapi_init() {
285 api.RegisterMessage((*FlowprobeParams)(nil), "flowprobe_params_baa46c09")
286 api.RegisterMessage((*FlowprobeParamsReply)(nil), "flowprobe_params_reply_e8d4e804")
287 api.RegisterMessage((*FlowprobeTxInterfaceAddDel)(nil), "flowprobe_tx_interface_add_del_b782c976")
288 api.RegisterMessage((*FlowprobeTxInterfaceAddDelReply)(nil), "flowprobe_tx_interface_add_del_reply_e8d4e804")
291 // Messages returns list of all messages in this module.
292 func AllMessages() []api.Message {
293 return []api.Message{
294 (*FlowprobeParams)(nil),
295 (*FlowprobeParamsReply)(nil),
296 (*FlowprobeTxInterfaceAddDel)(nil),
297 (*FlowprobeTxInterfaceAddDelReply)(nil),