go.ligato.io/vpp-agent/v3@v3.5.0/plugins/vpp/binapi/vpp2106/flowprobe/flowprobe.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 3 // Package flowprobe contains generated bindings for API file flowprobe.api. 4 // 5 // Contents: 6 // - 2 enums 7 // - 4 messages 8 package flowprobe 9 10 import ( 11 "strconv" 12 13 api "go.fd.io/govpp/api" 14 codec "go.fd.io/govpp/codec" 15 interface_types "go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/interface_types" 16 ) 17 18 // This is a compile-time assertion to ensure that this generated file 19 // is compatible with the GoVPP api package it is being compiled against. 20 // A compilation error at this line likely means your copy of the 21 // GoVPP api package needs to be updated. 22 const _ = api.GoVppAPIPackageIsVersion2 23 24 const ( 25 APIFile = "flowprobe" 26 APIVersion = "1.0.0" 27 VersionCrc = 0x8da9f1c 28 ) 29 30 // FlowprobeRecordFlags defines enum 'flowprobe_record_flags'. 31 type FlowprobeRecordFlags uint8 32 33 const ( 34 FLOWPROBE_RECORD_FLAG_L2 FlowprobeRecordFlags = 1 35 FLOWPROBE_RECORD_FLAG_L3 FlowprobeRecordFlags = 2 36 FLOWPROBE_RECORD_FLAG_L4 FlowprobeRecordFlags = 4 37 ) 38 39 var ( 40 FlowprobeRecordFlags_name = map[uint8]string{ 41 1: "FLOWPROBE_RECORD_FLAG_L2", 42 2: "FLOWPROBE_RECORD_FLAG_L3", 43 4: "FLOWPROBE_RECORD_FLAG_L4", 44 } 45 FlowprobeRecordFlags_value = map[string]uint8{ 46 "FLOWPROBE_RECORD_FLAG_L2": 1, 47 "FLOWPROBE_RECORD_FLAG_L3": 2, 48 "FLOWPROBE_RECORD_FLAG_L4": 4, 49 } 50 ) 51 52 func (x FlowprobeRecordFlags) String() string { 53 s, ok := FlowprobeRecordFlags_name[uint8(x)] 54 if ok { 55 return s 56 } 57 str := func(n uint8) string { 58 s, ok := FlowprobeRecordFlags_name[uint8(n)] 59 if ok { 60 return s 61 } 62 return "FlowprobeRecordFlags(" + strconv.Itoa(int(n)) + ")" 63 } 64 for i := uint8(0); i <= 8; i++ { 65 val := uint8(x) 66 if val&(1<<i) != 0 { 67 if s != "" { 68 s += "|" 69 } 70 s += str(1 << i) 71 } 72 } 73 if s == "" { 74 return str(uint8(x)) 75 } 76 return s 77 } 78 79 // FlowprobeWhichFlags defines enum 'flowprobe_which_flags'. 80 type FlowprobeWhichFlags uint8 81 82 const ( 83 FLOWPROBE_WHICH_FLAG_IP4 FlowprobeWhichFlags = 1 84 FLOWPROBE_WHICH_FLAG_L2 FlowprobeWhichFlags = 2 85 FLOWPROBE_WHICH_FLAG_IP6 FlowprobeWhichFlags = 4 86 ) 87 88 var ( 89 FlowprobeWhichFlags_name = map[uint8]string{ 90 1: "FLOWPROBE_WHICH_FLAG_IP4", 91 2: "FLOWPROBE_WHICH_FLAG_L2", 92 4: "FLOWPROBE_WHICH_FLAG_IP6", 93 } 94 FlowprobeWhichFlags_value = map[string]uint8{ 95 "FLOWPROBE_WHICH_FLAG_IP4": 1, 96 "FLOWPROBE_WHICH_FLAG_L2": 2, 97 "FLOWPROBE_WHICH_FLAG_IP6": 4, 98 } 99 ) 100 101 func (x FlowprobeWhichFlags) String() string { 102 s, ok := FlowprobeWhichFlags_name[uint8(x)] 103 if ok { 104 return s 105 } 106 str := func(n uint8) string { 107 s, ok := FlowprobeWhichFlags_name[uint8(n)] 108 if ok { 109 return s 110 } 111 return "FlowprobeWhichFlags(" + strconv.Itoa(int(n)) + ")" 112 } 113 for i := uint8(0); i <= 8; i++ { 114 val := uint8(x) 115 if val&(1<<i) != 0 { 116 if s != "" { 117 s += "|" 118 } 119 s += str(1 << i) 120 } 121 } 122 if s == "" { 123 return str(uint8(x)) 124 } 125 return s 126 } 127 128 // FlowprobeParams defines message 'flowprobe_params'. 129 type FlowprobeParams struct { 130 RecordFlags FlowprobeRecordFlags `binapi:"flowprobe_record_flags,name=record_flags" json:"record_flags,omitempty"` 131 ActiveTimer uint32 `binapi:"u32,name=active_timer" json:"active_timer,omitempty"` 132 PassiveTimer uint32 `binapi:"u32,name=passive_timer" json:"passive_timer,omitempty"` 133 } 134 135 func (m *FlowprobeParams) Reset() { *m = FlowprobeParams{} } 136 func (*FlowprobeParams) GetMessageName() string { return "flowprobe_params" } 137 func (*FlowprobeParams) GetCrcString() string { return "baa46c09" } 138 func (*FlowprobeParams) GetMessageType() api.MessageType { 139 return api.RequestMessage 140 } 141 142 func (m *FlowprobeParams) Size() (size int) { 143 if m == nil { 144 return 0 145 } 146 size += 1 // m.RecordFlags 147 size += 4 // m.ActiveTimer 148 size += 4 // m.PassiveTimer 149 return size 150 } 151 func (m *FlowprobeParams) Marshal(b []byte) ([]byte, error) { 152 if b == nil { 153 b = make([]byte, m.Size()) 154 } 155 buf := codec.NewBuffer(b) 156 buf.EncodeUint8(uint8(m.RecordFlags)) 157 buf.EncodeUint32(m.ActiveTimer) 158 buf.EncodeUint32(m.PassiveTimer) 159 return buf.Bytes(), nil 160 } 161 func (m *FlowprobeParams) Unmarshal(b []byte) error { 162 buf := codec.NewBuffer(b) 163 m.RecordFlags = FlowprobeRecordFlags(buf.DecodeUint8()) 164 m.ActiveTimer = buf.DecodeUint32() 165 m.PassiveTimer = buf.DecodeUint32() 166 return nil 167 } 168 169 // FlowprobeParamsReply defines message 'flowprobe_params_reply'. 170 type FlowprobeParamsReply struct { 171 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 172 } 173 174 func (m *FlowprobeParamsReply) Reset() { *m = FlowprobeParamsReply{} } 175 func (*FlowprobeParamsReply) GetMessageName() string { return "flowprobe_params_reply" } 176 func (*FlowprobeParamsReply) GetCrcString() string { return "e8d4e804" } 177 func (*FlowprobeParamsReply) GetMessageType() api.MessageType { 178 return api.ReplyMessage 179 } 180 181 func (m *FlowprobeParamsReply) Size() (size int) { 182 if m == nil { 183 return 0 184 } 185 size += 4 // m.Retval 186 return size 187 } 188 func (m *FlowprobeParamsReply) Marshal(b []byte) ([]byte, error) { 189 if b == nil { 190 b = make([]byte, m.Size()) 191 } 192 buf := codec.NewBuffer(b) 193 buf.EncodeInt32(m.Retval) 194 return buf.Bytes(), nil 195 } 196 func (m *FlowprobeParamsReply) Unmarshal(b []byte) error { 197 buf := codec.NewBuffer(b) 198 m.Retval = buf.DecodeInt32() 199 return nil 200 } 201 202 // FlowprobeTxInterfaceAddDel defines message 'flowprobe_tx_interface_add_del'. 203 type FlowprobeTxInterfaceAddDel struct { 204 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` 205 Which FlowprobeWhichFlags `binapi:"flowprobe_which_flags,name=which" json:"which,omitempty"` 206 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 207 } 208 209 func (m *FlowprobeTxInterfaceAddDel) Reset() { *m = FlowprobeTxInterfaceAddDel{} } 210 func (*FlowprobeTxInterfaceAddDel) GetMessageName() string { return "flowprobe_tx_interface_add_del" } 211 func (*FlowprobeTxInterfaceAddDel) GetCrcString() string { return "b782c976" } 212 func (*FlowprobeTxInterfaceAddDel) GetMessageType() api.MessageType { 213 return api.RequestMessage 214 } 215 216 func (m *FlowprobeTxInterfaceAddDel) Size() (size int) { 217 if m == nil { 218 return 0 219 } 220 size += 1 // m.IsAdd 221 size += 1 // m.Which 222 size += 4 // m.SwIfIndex 223 return size 224 } 225 func (m *FlowprobeTxInterfaceAddDel) Marshal(b []byte) ([]byte, error) { 226 if b == nil { 227 b = make([]byte, m.Size()) 228 } 229 buf := codec.NewBuffer(b) 230 buf.EncodeBool(m.IsAdd) 231 buf.EncodeUint8(uint8(m.Which)) 232 buf.EncodeUint32(uint32(m.SwIfIndex)) 233 return buf.Bytes(), nil 234 } 235 func (m *FlowprobeTxInterfaceAddDel) Unmarshal(b []byte) error { 236 buf := codec.NewBuffer(b) 237 m.IsAdd = buf.DecodeBool() 238 m.Which = FlowprobeWhichFlags(buf.DecodeUint8()) 239 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 240 return nil 241 } 242 243 // FlowprobeTxInterfaceAddDelReply defines message 'flowprobe_tx_interface_add_del_reply'. 244 type FlowprobeTxInterfaceAddDelReply struct { 245 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 246 } 247 248 func (m *FlowprobeTxInterfaceAddDelReply) Reset() { *m = FlowprobeTxInterfaceAddDelReply{} } 249 func (*FlowprobeTxInterfaceAddDelReply) GetMessageName() string { 250 return "flowprobe_tx_interface_add_del_reply" 251 } 252 func (*FlowprobeTxInterfaceAddDelReply) GetCrcString() string { return "e8d4e804" } 253 func (*FlowprobeTxInterfaceAddDelReply) GetMessageType() api.MessageType { 254 return api.ReplyMessage 255 } 256 257 func (m *FlowprobeTxInterfaceAddDelReply) Size() (size int) { 258 if m == nil { 259 return 0 260 } 261 size += 4 // m.Retval 262 return size 263 } 264 func (m *FlowprobeTxInterfaceAddDelReply) Marshal(b []byte) ([]byte, error) { 265 if b == nil { 266 b = make([]byte, m.Size()) 267 } 268 buf := codec.NewBuffer(b) 269 buf.EncodeInt32(m.Retval) 270 return buf.Bytes(), nil 271 } 272 func (m *FlowprobeTxInterfaceAddDelReply) Unmarshal(b []byte) error { 273 buf := codec.NewBuffer(b) 274 m.Retval = buf.DecodeInt32() 275 return nil 276 } 277 278 func init() { file_flowprobe_binapi_init() } 279 func file_flowprobe_binapi_init() { 280 api.RegisterMessage((*FlowprobeParams)(nil), "flowprobe_params_baa46c09") 281 api.RegisterMessage((*FlowprobeParamsReply)(nil), "flowprobe_params_reply_e8d4e804") 282 api.RegisterMessage((*FlowprobeTxInterfaceAddDel)(nil), "flowprobe_tx_interface_add_del_b782c976") 283 api.RegisterMessage((*FlowprobeTxInterfaceAddDelReply)(nil), "flowprobe_tx_interface_add_del_reply_e8d4e804") 284 } 285 286 // Messages returns list of all messages in this module. 287 func AllMessages() []api.Message { 288 return []api.Message{ 289 (*FlowprobeParams)(nil), 290 (*FlowprobeParamsReply)(nil), 291 (*FlowprobeTxInterfaceAddDel)(nil), 292 (*FlowprobeTxInterfaceAddDelReply)(nil), 293 } 294 }