github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/pot/pot.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 // versions: 3 // binapi-generator: v0.10.0-dev 4 // VPP: 23.10-rc0~170-g6f1548434 5 // source: plugins/pot.api.json 6 7 // Package pot contains generated bindings for API file pot.api. 8 // 9 // Contents: 10 // - 8 messages 11 package pot 12 13 import ( 14 api "go.fd.io/govpp/api" 15 codec "go.fd.io/govpp/codec" 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 = "pot" 26 APIVersion = "1.0.0" 27 VersionCrc = 0xa9d8e55c 28 ) 29 30 // Proof of Transit(POT): Activate POT profile in the list 31 // - id - id of the profile 32 // - list_name - name of this profile list 33 // 34 // PotProfileActivate defines message 'pot_profile_activate'. 35 type PotProfileActivate struct { 36 ID uint8 `binapi:"u8,name=id" json:"id,omitempty"` 37 ListName string `binapi:"string[],name=list_name" json:"list_name,omitempty"` 38 } 39 40 func (m *PotProfileActivate) Reset() { *m = PotProfileActivate{} } 41 func (*PotProfileActivate) GetMessageName() string { return "pot_profile_activate" } 42 func (*PotProfileActivate) GetCrcString() string { return "0770af98" } 43 func (*PotProfileActivate) GetMessageType() api.MessageType { 44 return api.RequestMessage 45 } 46 47 func (m *PotProfileActivate) Size() (size int) { 48 if m == nil { 49 return 0 50 } 51 size += 1 // m.ID 52 size += 4 + len(m.ListName) // m.ListName 53 return size 54 } 55 func (m *PotProfileActivate) Marshal(b []byte) ([]byte, error) { 56 if b == nil { 57 b = make([]byte, m.Size()) 58 } 59 buf := codec.NewBuffer(b) 60 buf.EncodeUint8(m.ID) 61 buf.EncodeString(m.ListName, 0) 62 return buf.Bytes(), nil 63 } 64 func (m *PotProfileActivate) Unmarshal(b []byte) error { 65 buf := codec.NewBuffer(b) 66 m.ID = buf.DecodeUint8() 67 m.ListName = buf.DecodeString(0) 68 return nil 69 } 70 71 // PotProfileActivateReply defines message 'pot_profile_activate_reply'. 72 type PotProfileActivateReply struct { 73 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 74 } 75 76 func (m *PotProfileActivateReply) Reset() { *m = PotProfileActivateReply{} } 77 func (*PotProfileActivateReply) GetMessageName() string { return "pot_profile_activate_reply" } 78 func (*PotProfileActivateReply) GetCrcString() string { return "e8d4e804" } 79 func (*PotProfileActivateReply) GetMessageType() api.MessageType { 80 return api.ReplyMessage 81 } 82 83 func (m *PotProfileActivateReply) Size() (size int) { 84 if m == nil { 85 return 0 86 } 87 size += 4 // m.Retval 88 return size 89 } 90 func (m *PotProfileActivateReply) Marshal(b []byte) ([]byte, error) { 91 if b == nil { 92 b = make([]byte, m.Size()) 93 } 94 buf := codec.NewBuffer(b) 95 buf.EncodeInt32(m.Retval) 96 return buf.Bytes(), nil 97 } 98 func (m *PotProfileActivateReply) Unmarshal(b []byte) error { 99 buf := codec.NewBuffer(b) 100 m.Retval = buf.DecodeInt32() 101 return nil 102 } 103 104 // Proof of Transit(POT): Set POT profile 105 // - id - id of the profile 106 // - validator - True/False to indicate if this is verifier 107 // - secret_key - Verification key 108 // - secret_share - Share of the 1st polynomial 109 // - prime - Prime number used for modulo operation 110 // - max_bits - Max bits to be used for Random number generation 111 // - lpc - Lagrange basis polynomial 112 // - polynomial_public - pre-evaluated public polynomial 113 // - list_name - name of this profile list 114 // 115 // PotProfileAdd defines message 'pot_profile_add'. 116 type PotProfileAdd struct { 117 ID uint8 `binapi:"u8,name=id" json:"id,omitempty"` 118 Validator uint8 `binapi:"u8,name=validator" json:"validator,omitempty"` 119 SecretKey uint64 `binapi:"u64,name=secret_key" json:"secret_key,omitempty"` 120 SecretShare uint64 `binapi:"u64,name=secret_share" json:"secret_share,omitempty"` 121 Prime uint64 `binapi:"u64,name=prime" json:"prime,omitempty"` 122 MaxBits uint8 `binapi:"u8,name=max_bits" json:"max_bits,omitempty"` 123 Lpc uint64 `binapi:"u64,name=lpc" json:"lpc,omitempty"` 124 PolynomialPublic uint64 `binapi:"u64,name=polynomial_public" json:"polynomial_public,omitempty"` 125 ListName string `binapi:"string[],name=list_name" json:"list_name,omitempty"` 126 } 127 128 func (m *PotProfileAdd) Reset() { *m = PotProfileAdd{} } 129 func (*PotProfileAdd) GetMessageName() string { return "pot_profile_add" } 130 func (*PotProfileAdd) GetCrcString() string { return "ad5da3a3" } 131 func (*PotProfileAdd) GetMessageType() api.MessageType { 132 return api.RequestMessage 133 } 134 135 func (m *PotProfileAdd) Size() (size int) { 136 if m == nil { 137 return 0 138 } 139 size += 1 // m.ID 140 size += 1 // m.Validator 141 size += 8 // m.SecretKey 142 size += 8 // m.SecretShare 143 size += 8 // m.Prime 144 size += 1 // m.MaxBits 145 size += 8 // m.Lpc 146 size += 8 // m.PolynomialPublic 147 size += 4 + len(m.ListName) // m.ListName 148 return size 149 } 150 func (m *PotProfileAdd) Marshal(b []byte) ([]byte, error) { 151 if b == nil { 152 b = make([]byte, m.Size()) 153 } 154 buf := codec.NewBuffer(b) 155 buf.EncodeUint8(m.ID) 156 buf.EncodeUint8(m.Validator) 157 buf.EncodeUint64(m.SecretKey) 158 buf.EncodeUint64(m.SecretShare) 159 buf.EncodeUint64(m.Prime) 160 buf.EncodeUint8(m.MaxBits) 161 buf.EncodeUint64(m.Lpc) 162 buf.EncodeUint64(m.PolynomialPublic) 163 buf.EncodeString(m.ListName, 0) 164 return buf.Bytes(), nil 165 } 166 func (m *PotProfileAdd) Unmarshal(b []byte) error { 167 buf := codec.NewBuffer(b) 168 m.ID = buf.DecodeUint8() 169 m.Validator = buf.DecodeUint8() 170 m.SecretKey = buf.DecodeUint64() 171 m.SecretShare = buf.DecodeUint64() 172 m.Prime = buf.DecodeUint64() 173 m.MaxBits = buf.DecodeUint8() 174 m.Lpc = buf.DecodeUint64() 175 m.PolynomialPublic = buf.DecodeUint64() 176 m.ListName = buf.DecodeString(0) 177 return nil 178 } 179 180 // PotProfileAddReply defines message 'pot_profile_add_reply'. 181 type PotProfileAddReply struct { 182 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 183 } 184 185 func (m *PotProfileAddReply) Reset() { *m = PotProfileAddReply{} } 186 func (*PotProfileAddReply) GetMessageName() string { return "pot_profile_add_reply" } 187 func (*PotProfileAddReply) GetCrcString() string { return "e8d4e804" } 188 func (*PotProfileAddReply) GetMessageType() api.MessageType { 189 return api.ReplyMessage 190 } 191 192 func (m *PotProfileAddReply) Size() (size int) { 193 if m == nil { 194 return 0 195 } 196 size += 4 // m.Retval 197 return size 198 } 199 func (m *PotProfileAddReply) Marshal(b []byte) ([]byte, error) { 200 if b == nil { 201 b = make([]byte, m.Size()) 202 } 203 buf := codec.NewBuffer(b) 204 buf.EncodeInt32(m.Retval) 205 return buf.Bytes(), nil 206 } 207 func (m *PotProfileAddReply) Unmarshal(b []byte) error { 208 buf := codec.NewBuffer(b) 209 m.Retval = buf.DecodeInt32() 210 return nil 211 } 212 213 // Delete POT Profile 214 // - list_name - name of profile list to delete 215 // 216 // PotProfileDel defines message 'pot_profile_del'. 217 type PotProfileDel struct { 218 ListName string `binapi:"string[],name=list_name" json:"list_name,omitempty"` 219 } 220 221 func (m *PotProfileDel) Reset() { *m = PotProfileDel{} } 222 func (*PotProfileDel) GetMessageName() string { return "pot_profile_del" } 223 func (*PotProfileDel) GetCrcString() string { return "cd63f53b" } 224 func (*PotProfileDel) GetMessageType() api.MessageType { 225 return api.RequestMessage 226 } 227 228 func (m *PotProfileDel) Size() (size int) { 229 if m == nil { 230 return 0 231 } 232 size += 4 + len(m.ListName) // m.ListName 233 return size 234 } 235 func (m *PotProfileDel) Marshal(b []byte) ([]byte, error) { 236 if b == nil { 237 b = make([]byte, m.Size()) 238 } 239 buf := codec.NewBuffer(b) 240 buf.EncodeString(m.ListName, 0) 241 return buf.Bytes(), nil 242 } 243 func (m *PotProfileDel) Unmarshal(b []byte) error { 244 buf := codec.NewBuffer(b) 245 m.ListName = buf.DecodeString(0) 246 return nil 247 } 248 249 // PotProfileDelReply defines message 'pot_profile_del_reply'. 250 type PotProfileDelReply struct { 251 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 252 } 253 254 func (m *PotProfileDelReply) Reset() { *m = PotProfileDelReply{} } 255 func (*PotProfileDelReply) GetMessageName() string { return "pot_profile_del_reply" } 256 func (*PotProfileDelReply) GetCrcString() string { return "e8d4e804" } 257 func (*PotProfileDelReply) GetMessageType() api.MessageType { 258 return api.ReplyMessage 259 } 260 261 func (m *PotProfileDelReply) Size() (size int) { 262 if m == nil { 263 return 0 264 } 265 size += 4 // m.Retval 266 return size 267 } 268 func (m *PotProfileDelReply) Marshal(b []byte) ([]byte, error) { 269 if b == nil { 270 b = make([]byte, m.Size()) 271 } 272 buf := codec.NewBuffer(b) 273 buf.EncodeInt32(m.Retval) 274 return buf.Bytes(), nil 275 } 276 func (m *PotProfileDelReply) Unmarshal(b []byte) error { 277 buf := codec.NewBuffer(b) 278 m.Retval = buf.DecodeInt32() 279 return nil 280 } 281 282 // Show POT profile reply 283 // - id - id of the profile 284 // - validator - True/False to indicate if this is verifier 285 // - secret_key - Verification key 286 // - secret_share - Share of the 1st polynomial 287 // - prime - Prime number used for modulo operation 288 // - max_bits - Max bits to be used for Random number generation 289 // - lpc - Lagrange basis polynomial 290 // - polynomial_public - pre-evaluated public polynomial 291 // - list_name_len - length of the name of this profile list 292 // - list_name - name of this profile list 293 // 294 // PotProfileShowConfigDetails defines message 'pot_profile_show_config_details'. 295 type PotProfileShowConfigDetails struct { 296 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 297 ID uint8 `binapi:"u8,name=id" json:"id,omitempty"` 298 Validator uint8 `binapi:"u8,name=validator" json:"validator,omitempty"` 299 SecretKey uint64 `binapi:"u64,name=secret_key" json:"secret_key,omitempty"` 300 SecretShare uint64 `binapi:"u64,name=secret_share" json:"secret_share,omitempty"` 301 Prime uint64 `binapi:"u64,name=prime" json:"prime,omitempty"` 302 BitMask uint64 `binapi:"u64,name=bit_mask" json:"bit_mask,omitempty"` 303 Lpc uint64 `binapi:"u64,name=lpc" json:"lpc,omitempty"` 304 PolynomialPublic uint64 `binapi:"u64,name=polynomial_public" json:"polynomial_public,omitempty"` 305 } 306 307 func (m *PotProfileShowConfigDetails) Reset() { *m = PotProfileShowConfigDetails{} } 308 func (*PotProfileShowConfigDetails) GetMessageName() string { return "pot_profile_show_config_details" } 309 func (*PotProfileShowConfigDetails) GetCrcString() string { return "b7ce0618" } 310 func (*PotProfileShowConfigDetails) GetMessageType() api.MessageType { 311 return api.ReplyMessage 312 } 313 314 func (m *PotProfileShowConfigDetails) Size() (size int) { 315 if m == nil { 316 return 0 317 } 318 size += 4 // m.Retval 319 size += 1 // m.ID 320 size += 1 // m.Validator 321 size += 8 // m.SecretKey 322 size += 8 // m.SecretShare 323 size += 8 // m.Prime 324 size += 8 // m.BitMask 325 size += 8 // m.Lpc 326 size += 8 // m.PolynomialPublic 327 return size 328 } 329 func (m *PotProfileShowConfigDetails) Marshal(b []byte) ([]byte, error) { 330 if b == nil { 331 b = make([]byte, m.Size()) 332 } 333 buf := codec.NewBuffer(b) 334 buf.EncodeInt32(m.Retval) 335 buf.EncodeUint8(m.ID) 336 buf.EncodeUint8(m.Validator) 337 buf.EncodeUint64(m.SecretKey) 338 buf.EncodeUint64(m.SecretShare) 339 buf.EncodeUint64(m.Prime) 340 buf.EncodeUint64(m.BitMask) 341 buf.EncodeUint64(m.Lpc) 342 buf.EncodeUint64(m.PolynomialPublic) 343 return buf.Bytes(), nil 344 } 345 func (m *PotProfileShowConfigDetails) Unmarshal(b []byte) error { 346 buf := codec.NewBuffer(b) 347 m.Retval = buf.DecodeInt32() 348 m.ID = buf.DecodeUint8() 349 m.Validator = buf.DecodeUint8() 350 m.SecretKey = buf.DecodeUint64() 351 m.SecretShare = buf.DecodeUint64() 352 m.Prime = buf.DecodeUint64() 353 m.BitMask = buf.DecodeUint64() 354 m.Lpc = buf.DecodeUint64() 355 m.PolynomialPublic = buf.DecodeUint64() 356 return nil 357 } 358 359 // Show POT Profiles 360 // - id - id of the profile 361 // 362 // PotProfileShowConfigDump defines message 'pot_profile_show_config_dump'. 363 type PotProfileShowConfigDump struct { 364 ID uint8 `binapi:"u8,name=id" json:"id,omitempty"` 365 } 366 367 func (m *PotProfileShowConfigDump) Reset() { *m = PotProfileShowConfigDump{} } 368 func (*PotProfileShowConfigDump) GetMessageName() string { return "pot_profile_show_config_dump" } 369 func (*PotProfileShowConfigDump) GetCrcString() string { return "005b7d59" } 370 func (*PotProfileShowConfigDump) GetMessageType() api.MessageType { 371 return api.RequestMessage 372 } 373 374 func (m *PotProfileShowConfigDump) Size() (size int) { 375 if m == nil { 376 return 0 377 } 378 size += 1 // m.ID 379 return size 380 } 381 func (m *PotProfileShowConfigDump) Marshal(b []byte) ([]byte, error) { 382 if b == nil { 383 b = make([]byte, m.Size()) 384 } 385 buf := codec.NewBuffer(b) 386 buf.EncodeUint8(m.ID) 387 return buf.Bytes(), nil 388 } 389 func (m *PotProfileShowConfigDump) Unmarshal(b []byte) error { 390 buf := codec.NewBuffer(b) 391 m.ID = buf.DecodeUint8() 392 return nil 393 } 394 395 func init() { file_pot_binapi_init() } 396 func file_pot_binapi_init() { 397 api.RegisterMessage((*PotProfileActivate)(nil), "pot_profile_activate_0770af98") 398 api.RegisterMessage((*PotProfileActivateReply)(nil), "pot_profile_activate_reply_e8d4e804") 399 api.RegisterMessage((*PotProfileAdd)(nil), "pot_profile_add_ad5da3a3") 400 api.RegisterMessage((*PotProfileAddReply)(nil), "pot_profile_add_reply_e8d4e804") 401 api.RegisterMessage((*PotProfileDel)(nil), "pot_profile_del_cd63f53b") 402 api.RegisterMessage((*PotProfileDelReply)(nil), "pot_profile_del_reply_e8d4e804") 403 api.RegisterMessage((*PotProfileShowConfigDetails)(nil), "pot_profile_show_config_details_b7ce0618") 404 api.RegisterMessage((*PotProfileShowConfigDump)(nil), "pot_profile_show_config_dump_005b7d59") 405 } 406 407 // Messages returns list of all messages in this module. 408 func AllMessages() []api.Message { 409 return []api.Message{ 410 (*PotProfileActivate)(nil), 411 (*PotProfileActivateReply)(nil), 412 (*PotProfileAdd)(nil), 413 (*PotProfileAddReply)(nil), 414 (*PotProfileDel)(nil), 415 (*PotProfileDelReply)(nil), 416 (*PotProfileShowConfigDetails)(nil), 417 (*PotProfileShowConfigDump)(nil), 418 } 419 }