File
Blob: spec/protocol/waf_vtproto.pb.go
| 1 | // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. |
| 2 | // protoc-gen-go-vtproto version: v0.6.0 |
| 3 | // source: spec/proto/waf.proto |
| 4 | |
| 5 | package protocol |
| 6 | |
| 7 | import ( |
| 8 | fmt "fmt" |
| 9 | protohelpers "github.com/planetscale/vtprotobuf/protohelpers" |
| 10 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" |
| 11 | io "io" |
| 12 | ) |
| 13 | |
| 14 | const ( |
| 15 | // Verify that this generated code is sufficiently up-to-date. |
| 16 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) |
| 17 | // Verify that runtime/protoimpl is sufficiently up-to-date. |
| 18 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) |
| 19 | ) |
| 20 | |
| 21 | func (m *WAFExclusion) MarshalVT() (dAtA []byte, err error) { |
| 22 | if m == nil { |
| 23 | return nil, nil |
| 24 | } |
| 25 | size := m.SizeVT() |
| 26 | dAtA = make([]byte, size) |
| 27 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 28 | if err != nil { |
| 29 | return nil, err |
| 30 | } |
| 31 | return dAtA[:n], nil |
| 32 | } |
| 33 | |
| 34 | func (m *WAFExclusion) MarshalToVT(dAtA []byte) (int, error) { |
| 35 | size := m.SizeVT() |
| 36 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 37 | } |
| 38 | |
| 39 | func (m *WAFExclusion) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 40 | if m == nil { |
| 41 | return 0, nil |
| 42 | } |
| 43 | i := len(dAtA) |
| 44 | _ = i |
| 45 | var l int |
| 46 | _ = l |
| 47 | if m.unknownFields != nil { |
| 48 | i -= len(m.unknownFields) |
| 49 | copy(dAtA[i:], m.unknownFields) |
| 50 | } |
| 51 | if len(m.Path) > 0 { |
| 52 | i -= len(m.Path) |
| 53 | copy(dAtA[i:], m.Path) |
| 54 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Path))) |
| 55 | i-- |
| 56 | dAtA[i] = 0x12 |
| 57 | } |
| 58 | if m.RuleId != 0 { |
| 59 | i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RuleId)) |
| 60 | i-- |
| 61 | dAtA[i] = 0x8 |
| 62 | } |
| 63 | return len(dAtA) - i, nil |
| 64 | } |
| 65 | |
| 66 | func (m *WAFPolicy) MarshalVT() (dAtA []byte, err error) { |
| 67 | if m == nil { |
| 68 | return nil, nil |
| 69 | } |
| 70 | size := m.SizeVT() |
| 71 | dAtA = make([]byte, size) |
| 72 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 73 | if err != nil { |
| 74 | return nil, err |
| 75 | } |
| 76 | return dAtA[:n], nil |
| 77 | } |
| 78 | |
| 79 | func (m *WAFPolicy) MarshalToVT(dAtA []byte) (int, error) { |
| 80 | size := m.SizeVT() |
| 81 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 82 | } |
| 83 | |
| 84 | func (m *WAFPolicy) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 85 | if m == nil { |
| 86 | return 0, nil |
| 87 | } |
| 88 | i := len(dAtA) |
| 89 | _ = i |
| 90 | var l int |
| 91 | _ = l |
| 92 | if m.unknownFields != nil { |
| 93 | i -= len(m.unknownFields) |
| 94 | copy(dAtA[i:], m.unknownFields) |
| 95 | } |
| 96 | if len(m.Exclusions) > 0 { |
| 97 | for iNdEx := len(m.Exclusions) - 1; iNdEx >= 0; iNdEx-- { |
| 98 | size, err := m.Exclusions[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) |
| 99 | if err != nil { |
| 100 | return 0, err |
| 101 | } |
| 102 | i -= size |
| 103 | i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 104 | i-- |
| 105 | dAtA[i] = 0x12 |
| 106 | } |
| 107 | } |
| 108 | if m.Mode != 0 { |
| 109 | i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Mode)) |
| 110 | i-- |
| 111 | dAtA[i] = 0x8 |
| 112 | } |
| 113 | return len(dAtA) - i, nil |
| 114 | } |
| 115 | |
| 116 | func (m *WAFSettings) MarshalVT() (dAtA []byte, err error) { |
| 117 | if m == nil { |
| 118 | return nil, nil |
| 119 | } |
| 120 | size := m.SizeVT() |
| 121 | dAtA = make([]byte, size) |
| 122 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 123 | if err != nil { |
| 124 | return nil, err |
| 125 | } |
| 126 | return dAtA[:n], nil |
| 127 | } |
| 128 | |
| 129 | func (m *WAFSettings) MarshalToVT(dAtA []byte) (int, error) { |
| 130 | size := m.SizeVT() |
| 131 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 132 | } |
| 133 | |
| 134 | func (m *WAFSettings) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 135 | if m == nil { |
| 136 | return 0, nil |
| 137 | } |
| 138 | i := len(dAtA) |
| 139 | _ = i |
| 140 | var l int |
| 141 | _ = l |
| 142 | if m.unknownFields != nil { |
| 143 | i -= len(m.unknownFields) |
| 144 | copy(dAtA[i:], m.unknownFields) |
| 145 | } |
| 146 | if len(m.PinnedVersion) > 0 { |
| 147 | i -= len(m.PinnedVersion) |
| 148 | copy(dAtA[i:], m.PinnedVersion) |
| 149 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PinnedVersion))) |
| 150 | i-- |
| 151 | dAtA[i] = 0x22 |
| 152 | } |
| 153 | if m.Channel != 0 { |
| 154 | i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Channel)) |
| 155 | i-- |
| 156 | dAtA[i] = 0x18 |
| 157 | } |
| 158 | if m.DefaultMode != 0 { |
| 159 | i = protohelpers.EncodeVarint(dAtA, i, uint64(m.DefaultMode)) |
| 160 | i-- |
| 161 | dAtA[i] = 0x10 |
| 162 | } |
| 163 | if m.Enabled { |
| 164 | i-- |
| 165 | if m.Enabled { |
| 166 | dAtA[i] = 1 |
| 167 | } else { |
| 168 | dAtA[i] = 0 |
| 169 | } |
| 170 | i-- |
| 171 | dAtA[i] = 0x8 |
| 172 | } |
| 173 | return len(dAtA) - i, nil |
| 174 | } |
| 175 | |
| 176 | func (m *SetWAFSettingsRequest) MarshalVT() (dAtA []byte, err error) { |
| 177 | if m == nil { |
| 178 | return nil, nil |
| 179 | } |
| 180 | size := m.SizeVT() |
| 181 | dAtA = make([]byte, size) |
| 182 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 183 | if err != nil { |
| 184 | return nil, err |
| 185 | } |
| 186 | return dAtA[:n], nil |
| 187 | } |
| 188 | |
| 189 | func (m *SetWAFSettingsRequest) MarshalToVT(dAtA []byte) (int, error) { |
| 190 | size := m.SizeVT() |
| 191 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 192 | } |
| 193 | |
| 194 | func (m *SetWAFSettingsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 195 | if m == nil { |
| 196 | return 0, nil |
| 197 | } |
| 198 | i := len(dAtA) |
| 199 | _ = i |
| 200 | var l int |
| 201 | _ = l |
| 202 | if m.unknownFields != nil { |
| 203 | i -= len(m.unknownFields) |
| 204 | copy(dAtA[i:], m.unknownFields) |
| 205 | } |
| 206 | if m.Config != nil { |
| 207 | size, err := m.Config.MarshalToSizedBufferVT(dAtA[:i]) |
| 208 | if err != nil { |
| 209 | return 0, err |
| 210 | } |
| 211 | i -= size |
| 212 | i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 213 | i-- |
| 214 | dAtA[i] = 0x12 |
| 215 | } |
| 216 | if len(m.ExpectedVersion) > 0 { |
| 217 | i -= len(m.ExpectedVersion) |
| 218 | copy(dAtA[i:], m.ExpectedVersion) |
| 219 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ExpectedVersion))) |
| 220 | i-- |
| 221 | dAtA[i] = 0xa |
| 222 | } |
| 223 | return len(dAtA) - i, nil |
| 224 | } |
| 225 | |
| 226 | func (m *HostWAFRecord) MarshalVT() (dAtA []byte, err error) { |
| 227 | if m == nil { |
| 228 | return nil, nil |
| 229 | } |
| 230 | size := m.SizeVT() |
| 231 | dAtA = make([]byte, size) |
| 232 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 233 | if err != nil { |
| 234 | return nil, err |
| 235 | } |
| 236 | return dAtA[:n], nil |
| 237 | } |
| 238 | |
| 239 | func (m *HostWAFRecord) MarshalToVT(dAtA []byte) (int, error) { |
| 240 | size := m.SizeVT() |
| 241 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 242 | } |
| 243 | |
| 244 | func (m *HostWAFRecord) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 245 | if m == nil { |
| 246 | return 0, nil |
| 247 | } |
| 248 | i := len(dAtA) |
| 249 | _ = i |
| 250 | var l int |
| 251 | _ = l |
| 252 | if m.unknownFields != nil { |
| 253 | i -= len(m.unknownFields) |
| 254 | copy(dAtA[i:], m.unknownFields) |
| 255 | } |
| 256 | if m.Policy != nil { |
| 257 | size, err := m.Policy.MarshalToSizedBufferVT(dAtA[:i]) |
| 258 | if err != nil { |
| 259 | return 0, err |
| 260 | } |
| 261 | i -= size |
| 262 | i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 263 | i-- |
| 264 | dAtA[i] = 0x1a |
| 265 | } |
| 266 | if len(m.Owner) > 0 { |
| 267 | i -= len(m.Owner) |
| 268 | copy(dAtA[i:], m.Owner) |
| 269 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Owner))) |
| 270 | i-- |
| 271 | dAtA[i] = 0x12 |
| 272 | } |
| 273 | if m.Schema != 0 { |
| 274 | i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Schema)) |
| 275 | i-- |
| 276 | dAtA[i] = 0x8 |
| 277 | } |
| 278 | return len(dAtA) - i, nil |
| 279 | } |
| 280 | |
| 281 | func (m *GetHostWAFRequest) MarshalVT() (dAtA []byte, err error) { |
| 282 | if m == nil { |
| 283 | return nil, nil |
| 284 | } |
| 285 | size := m.SizeVT() |
| 286 | dAtA = make([]byte, size) |
| 287 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 288 | if err != nil { |
| 289 | return nil, err |
| 290 | } |
| 291 | return dAtA[:n], nil |
| 292 | } |
| 293 | |
| 294 | func (m *GetHostWAFRequest) MarshalToVT(dAtA []byte) (int, error) { |
| 295 | size := m.SizeVT() |
| 296 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 297 | } |
| 298 | |
| 299 | func (m *GetHostWAFRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 300 | if m == nil { |
| 301 | return 0, nil |
| 302 | } |
| 303 | i := len(dAtA) |
| 304 | _ = i |
| 305 | var l int |
| 306 | _ = l |
| 307 | if m.unknownFields != nil { |
| 308 | i -= len(m.unknownFields) |
| 309 | copy(dAtA[i:], m.unknownFields) |
| 310 | } |
| 311 | if len(m.Hostname) > 0 { |
| 312 | i -= len(m.Hostname) |
| 313 | copy(dAtA[i:], m.Hostname) |
| 314 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Hostname))) |
| 315 | i-- |
| 316 | dAtA[i] = 0xa |
| 317 | } |
| 318 | return len(dAtA) - i, nil |
| 319 | } |
| 320 | |
| 321 | func (m *SetHostWAFRequest) MarshalVT() (dAtA []byte, err error) { |
| 322 | if m == nil { |
| 323 | return nil, nil |
| 324 | } |
| 325 | size := m.SizeVT() |
| 326 | dAtA = make([]byte, size) |
| 327 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 328 | if err != nil { |
| 329 | return nil, err |
| 330 | } |
| 331 | return dAtA[:n], nil |
| 332 | } |
| 333 | |
| 334 | func (m *SetHostWAFRequest) MarshalToVT(dAtA []byte) (int, error) { |
| 335 | size := m.SizeVT() |
| 336 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 337 | } |
| 338 | |
| 339 | func (m *SetHostWAFRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 340 | if m == nil { |
| 341 | return 0, nil |
| 342 | } |
| 343 | i := len(dAtA) |
| 344 | _ = i |
| 345 | var l int |
| 346 | _ = l |
| 347 | if m.unknownFields != nil { |
| 348 | i -= len(m.unknownFields) |
| 349 | copy(dAtA[i:], m.unknownFields) |
| 350 | } |
| 351 | if m.Policy != nil { |
| 352 | size, err := m.Policy.MarshalToSizedBufferVT(dAtA[:i]) |
| 353 | if err != nil { |
| 354 | return 0, err |
| 355 | } |
| 356 | i -= size |
| 357 | i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 358 | i-- |
| 359 | dAtA[i] = 0x1a |
| 360 | } |
| 361 | if len(m.ExpectedVersion) > 0 { |
| 362 | i -= len(m.ExpectedVersion) |
| 363 | copy(dAtA[i:], m.ExpectedVersion) |
| 364 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ExpectedVersion))) |
| 365 | i-- |
| 366 | dAtA[i] = 0x12 |
| 367 | } |
| 368 | if len(m.Hostname) > 0 { |
| 369 | i -= len(m.Hostname) |
| 370 | copy(dAtA[i:], m.Hostname) |
| 371 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Hostname))) |
| 372 | i-- |
| 373 | dAtA[i] = 0xa |
| 374 | } |
| 375 | return len(dAtA) - i, nil |
| 376 | } |
| 377 | |
| 378 | func (m *HostWAFResponse) MarshalVT() (dAtA []byte, err error) { |
| 379 | if m == nil { |
| 380 | return nil, nil |
| 381 | } |
| 382 | size := m.SizeVT() |
| 383 | dAtA = make([]byte, size) |
| 384 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 385 | if err != nil { |
| 386 | return nil, err |
| 387 | } |
| 388 | return dAtA[:n], nil |
| 389 | } |
| 390 | |
| 391 | func (m *HostWAFResponse) MarshalToVT(dAtA []byte) (int, error) { |
| 392 | size := m.SizeVT() |
| 393 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 394 | } |
| 395 | |
| 396 | func (m *HostWAFResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 397 | if m == nil { |
| 398 | return 0, nil |
| 399 | } |
| 400 | i := len(dAtA) |
| 401 | _ = i |
| 402 | var l int |
| 403 | _ = l |
| 404 | if m.unknownFields != nil { |
| 405 | i -= len(m.unknownFields) |
| 406 | copy(dAtA[i:], m.unknownFields) |
| 407 | } |
| 408 | if m.Policy != nil { |
| 409 | size, err := m.Policy.MarshalToSizedBufferVT(dAtA[:i]) |
| 410 | if err != nil { |
| 411 | return 0, err |
| 412 | } |
| 413 | i -= size |
| 414 | i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 415 | i-- |
| 416 | dAtA[i] = 0x1a |
| 417 | } |
| 418 | if len(m.Version) > 0 { |
| 419 | i -= len(m.Version) |
| 420 | copy(dAtA[i:], m.Version) |
| 421 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Version))) |
| 422 | i-- |
| 423 | dAtA[i] = 0x12 |
| 424 | } |
| 425 | if len(m.Hostname) > 0 { |
| 426 | i -= len(m.Hostname) |
| 427 | copy(dAtA[i:], m.Hostname) |
| 428 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Hostname))) |
| 429 | i-- |
| 430 | dAtA[i] = 0xa |
| 431 | } |
| 432 | return len(dAtA) - i, nil |
| 433 | } |
| 434 | |
| 435 | func (m *WAFExclusion) SizeVT() (n int) { |
| 436 | if m == nil { |
| 437 | return 0 |
| 438 | } |
| 439 | var l int |
| 440 | _ = l |
| 441 | if m.RuleId != 0 { |
| 442 | n += 1 + protohelpers.SizeOfVarint(uint64(m.RuleId)) |
| 443 | } |
| 444 | l = len(m.Path) |
| 445 | if l > 0 { |
| 446 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 447 | } |
| 448 | n += len(m.unknownFields) |
| 449 | return n |
| 450 | } |
| 451 | |
| 452 | func (m *WAFPolicy) SizeVT() (n int) { |
| 453 | if m == nil { |
| 454 | return 0 |
| 455 | } |
| 456 | var l int |
| 457 | _ = l |
| 458 | if m.Mode != 0 { |
| 459 | n += 1 + protohelpers.SizeOfVarint(uint64(m.Mode)) |
| 460 | } |
| 461 | if len(m.Exclusions) > 0 { |
| 462 | for _, e := range m.Exclusions { |
| 463 | l = e.SizeVT() |
| 464 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 465 | } |
| 466 | } |
| 467 | n += len(m.unknownFields) |
| 468 | return n |
| 469 | } |
| 470 | |
| 471 | func (m *WAFSettings) SizeVT() (n int) { |
| 472 | if m == nil { |
| 473 | return 0 |
| 474 | } |
| 475 | var l int |
| 476 | _ = l |
| 477 | if m.Enabled { |
| 478 | n += 2 |
| 479 | } |
| 480 | if m.DefaultMode != 0 { |
| 481 | n += 1 + protohelpers.SizeOfVarint(uint64(m.DefaultMode)) |
| 482 | } |
| 483 | if m.Channel != 0 { |
| 484 | n += 1 + protohelpers.SizeOfVarint(uint64(m.Channel)) |
| 485 | } |
| 486 | l = len(m.PinnedVersion) |
| 487 | if l > 0 { |
| 488 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 489 | } |
| 490 | n += len(m.unknownFields) |
| 491 | return n |
| 492 | } |
| 493 | |
| 494 | func (m *SetWAFSettingsRequest) SizeVT() (n int) { |
| 495 | if m == nil { |
| 496 | return 0 |
| 497 | } |
| 498 | var l int |
| 499 | _ = l |
| 500 | l = len(m.ExpectedVersion) |
| 501 | if l > 0 { |
| 502 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 503 | } |
| 504 | if m.Config != nil { |
| 505 | l = m.Config.SizeVT() |
| 506 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 507 | } |
| 508 | n += len(m.unknownFields) |
| 509 | return n |
| 510 | } |
| 511 | |
| 512 | func (m *HostWAFRecord) SizeVT() (n int) { |
| 513 | if m == nil { |
| 514 | return 0 |
| 515 | } |
| 516 | var l int |
| 517 | _ = l |
| 518 | if m.Schema != 0 { |
| 519 | n += 1 + protohelpers.SizeOfVarint(uint64(m.Schema)) |
| 520 | } |
| 521 | l = len(m.Owner) |
| 522 | if l > 0 { |
| 523 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 524 | } |
| 525 | if m.Policy != nil { |
| 526 | l = m.Policy.SizeVT() |
| 527 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 528 | } |
| 529 | n += len(m.unknownFields) |
| 530 | return n |
| 531 | } |
| 532 | |
| 533 | func (m *GetHostWAFRequest) SizeVT() (n int) { |
| 534 | if m == nil { |
| 535 | return 0 |
| 536 | } |
| 537 | var l int |
| 538 | _ = l |
| 539 | l = len(m.Hostname) |
| 540 | if l > 0 { |
| 541 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 542 | } |
| 543 | n += len(m.unknownFields) |
| 544 | return n |
| 545 | } |
| 546 | |
| 547 | func (m *SetHostWAFRequest) SizeVT() (n int) { |
| 548 | if m == nil { |
| 549 | return 0 |
| 550 | } |
| 551 | var l int |
| 552 | _ = l |
| 553 | l = len(m.Hostname) |
| 554 | if l > 0 { |
| 555 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 556 | } |
| 557 | l = len(m.ExpectedVersion) |
| 558 | if l > 0 { |
| 559 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 560 | } |
| 561 | if m.Policy != nil { |
| 562 | l = m.Policy.SizeVT() |
| 563 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 564 | } |
| 565 | n += len(m.unknownFields) |
| 566 | return n |
| 567 | } |
| 568 | |
| 569 | func (m *HostWAFResponse) SizeVT() (n int) { |
| 570 | if m == nil { |
| 571 | return 0 |
| 572 | } |
| 573 | var l int |
| 574 | _ = l |
| 575 | l = len(m.Hostname) |
| 576 | if l > 0 { |
| 577 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 578 | } |
| 579 | l = len(m.Version) |
| 580 | if l > 0 { |
| 581 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 582 | } |
| 583 | if m.Policy != nil { |
| 584 | l = m.Policy.SizeVT() |
| 585 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 586 | } |
| 587 | n += len(m.unknownFields) |
| 588 | return n |
| 589 | } |
| 590 | |
| 591 | func (m *WAFExclusion) UnmarshalVT(dAtA []byte) error { |
| 592 | l := len(dAtA) |
| 593 | iNdEx := 0 |
| 594 | for iNdEx < l { |
| 595 | preIndex := iNdEx |
| 596 | var wire uint64 |
| 597 | for shift := uint(0); ; shift += 7 { |
| 598 | if shift >= 64 { |
| 599 | return protohelpers.ErrIntOverflow |
| 600 | } |
| 601 | if iNdEx >= l { |
| 602 | return io.ErrUnexpectedEOF |
| 603 | } |
| 604 | b := dAtA[iNdEx] |
| 605 | iNdEx++ |
| 606 | wire |= uint64(b&0x7F) << shift |
| 607 | if b < 0x80 { |
| 608 | break |
| 609 | } |
| 610 | } |
| 611 | fieldNum := int32(wire >> 3) |
| 612 | wireType := int(wire & 0x7) |
| 613 | if wireType == 4 { |
| 614 | return fmt.Errorf("proto: WAFExclusion: wiretype end group for non-group") |
| 615 | } |
| 616 | if fieldNum <= 0 { |
| 617 | return fmt.Errorf("proto: WAFExclusion: illegal tag %d (wire type %d)", fieldNum, wire) |
| 618 | } |
| 619 | switch fieldNum { |
| 620 | case 1: |
| 621 | if wireType != 0 { |
| 622 | return fmt.Errorf("proto: wrong wireType = %d for field RuleId", wireType) |
| 623 | } |
| 624 | m.RuleId = 0 |
| 625 | for shift := uint(0); ; shift += 7 { |
| 626 | if shift >= 64 { |
| 627 | return protohelpers.ErrIntOverflow |
| 628 | } |
| 629 | if iNdEx >= l { |
| 630 | return io.ErrUnexpectedEOF |
| 631 | } |
| 632 | b := dAtA[iNdEx] |
| 633 | iNdEx++ |
| 634 | m.RuleId |= uint32(b&0x7F) << shift |
| 635 | if b < 0x80 { |
| 636 | break |
| 637 | } |
| 638 | } |
| 639 | case 2: |
| 640 | if wireType != 2 { |
| 641 | return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) |
| 642 | } |
| 643 | var stringLen uint64 |
| 644 | for shift := uint(0); ; shift += 7 { |
| 645 | if shift >= 64 { |
| 646 | return protohelpers.ErrIntOverflow |
| 647 | } |
| 648 | if iNdEx >= l { |
| 649 | return io.ErrUnexpectedEOF |
| 650 | } |
| 651 | b := dAtA[iNdEx] |
| 652 | iNdEx++ |
| 653 | stringLen |= uint64(b&0x7F) << shift |
| 654 | if b < 0x80 { |
| 655 | break |
| 656 | } |
| 657 | } |
| 658 | intStringLen := int(stringLen) |
| 659 | if intStringLen < 0 { |
| 660 | return protohelpers.ErrInvalidLength |
| 661 | } |
| 662 | postIndex := iNdEx + intStringLen |
| 663 | if postIndex < 0 { |
| 664 | return protohelpers.ErrInvalidLength |
| 665 | } |
| 666 | if postIndex > l { |
| 667 | return io.ErrUnexpectedEOF |
| 668 | } |
| 669 | m.Path = string(dAtA[iNdEx:postIndex]) |
| 670 | iNdEx = postIndex |
| 671 | default: |
| 672 | iNdEx = preIndex |
| 673 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 674 | if err != nil { |
| 675 | return err |
| 676 | } |
| 677 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 678 | return protohelpers.ErrInvalidLength |
| 679 | } |
| 680 | if (iNdEx + skippy) > l { |
| 681 | return io.ErrUnexpectedEOF |
| 682 | } |
| 683 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 684 | iNdEx += skippy |
| 685 | } |
| 686 | } |
| 687 | |
| 688 | if iNdEx > l { |
| 689 | return io.ErrUnexpectedEOF |
| 690 | } |
| 691 | return nil |
| 692 | } |
| 693 | func (m *WAFPolicy) UnmarshalVT(dAtA []byte) error { |
| 694 | l := len(dAtA) |
| 695 | iNdEx := 0 |
| 696 | for iNdEx < l { |
| 697 | preIndex := iNdEx |
| 698 | var wire uint64 |
| 699 | for shift := uint(0); ; shift += 7 { |
| 700 | if shift >= 64 { |
| 701 | return protohelpers.ErrIntOverflow |
| 702 | } |
| 703 | if iNdEx >= l { |
| 704 | return io.ErrUnexpectedEOF |
| 705 | } |
| 706 | b := dAtA[iNdEx] |
| 707 | iNdEx++ |
| 708 | wire |= uint64(b&0x7F) << shift |
| 709 | if b < 0x80 { |
| 710 | break |
| 711 | } |
| 712 | } |
| 713 | fieldNum := int32(wire >> 3) |
| 714 | wireType := int(wire & 0x7) |
| 715 | if wireType == 4 { |
| 716 | return fmt.Errorf("proto: WAFPolicy: wiretype end group for non-group") |
| 717 | } |
| 718 | if fieldNum <= 0 { |
| 719 | return fmt.Errorf("proto: WAFPolicy: illegal tag %d (wire type %d)", fieldNum, wire) |
| 720 | } |
| 721 | switch fieldNum { |
| 722 | case 1: |
| 723 | if wireType != 0 { |
| 724 | return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) |
| 725 | } |
| 726 | m.Mode = 0 |
| 727 | for shift := uint(0); ; shift += 7 { |
| 728 | if shift >= 64 { |
| 729 | return protohelpers.ErrIntOverflow |
| 730 | } |
| 731 | if iNdEx >= l { |
| 732 | return io.ErrUnexpectedEOF |
| 733 | } |
| 734 | b := dAtA[iNdEx] |
| 735 | iNdEx++ |
| 736 | m.Mode |= WAFPolicy_Mode(b&0x7F) << shift |
| 737 | if b < 0x80 { |
| 738 | break |
| 739 | } |
| 740 | } |
| 741 | case 2: |
| 742 | if wireType != 2 { |
| 743 | return fmt.Errorf("proto: wrong wireType = %d for field Exclusions", wireType) |
| 744 | } |
| 745 | var msglen int |
| 746 | for shift := uint(0); ; shift += 7 { |
| 747 | if shift >= 64 { |
| 748 | return protohelpers.ErrIntOverflow |
| 749 | } |
| 750 | if iNdEx >= l { |
| 751 | return io.ErrUnexpectedEOF |
| 752 | } |
| 753 | b := dAtA[iNdEx] |
| 754 | iNdEx++ |
| 755 | msglen |= int(b&0x7F) << shift |
| 756 | if b < 0x80 { |
| 757 | break |
| 758 | } |
| 759 | } |
| 760 | if msglen < 0 { |
| 761 | return protohelpers.ErrInvalidLength |
| 762 | } |
| 763 | postIndex := iNdEx + msglen |
| 764 | if postIndex < 0 { |
| 765 | return protohelpers.ErrInvalidLength |
| 766 | } |
| 767 | if postIndex > l { |
| 768 | return io.ErrUnexpectedEOF |
| 769 | } |
| 770 | m.Exclusions = append(m.Exclusions, &WAFExclusion{}) |
| 771 | if err := m.Exclusions[len(m.Exclusions)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { |
| 772 | return err |
| 773 | } |
| 774 | iNdEx = postIndex |
| 775 | default: |
| 776 | iNdEx = preIndex |
| 777 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 778 | if err != nil { |
| 779 | return err |
| 780 | } |
| 781 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 782 | return protohelpers.ErrInvalidLength |
| 783 | } |
| 784 | if (iNdEx + skippy) > l { |
| 785 | return io.ErrUnexpectedEOF |
| 786 | } |
| 787 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 788 | iNdEx += skippy |
| 789 | } |
| 790 | } |
| 791 | |
| 792 | if iNdEx > l { |
| 793 | return io.ErrUnexpectedEOF |
| 794 | } |
| 795 | return nil |
| 796 | } |
| 797 | func (m *WAFSettings) UnmarshalVT(dAtA []byte) error { |
| 798 | l := len(dAtA) |
| 799 | iNdEx := 0 |
| 800 | for iNdEx < l { |
| 801 | preIndex := iNdEx |
| 802 | var wire uint64 |
| 803 | for shift := uint(0); ; shift += 7 { |
| 804 | if shift >= 64 { |
| 805 | return protohelpers.ErrIntOverflow |
| 806 | } |
| 807 | if iNdEx >= l { |
| 808 | return io.ErrUnexpectedEOF |
| 809 | } |
| 810 | b := dAtA[iNdEx] |
| 811 | iNdEx++ |
| 812 | wire |= uint64(b&0x7F) << shift |
| 813 | if b < 0x80 { |
| 814 | break |
| 815 | } |
| 816 | } |
| 817 | fieldNum := int32(wire >> 3) |
| 818 | wireType := int(wire & 0x7) |
| 819 | if wireType == 4 { |
| 820 | return fmt.Errorf("proto: WAFSettings: wiretype end group for non-group") |
| 821 | } |
| 822 | if fieldNum <= 0 { |
| 823 | return fmt.Errorf("proto: WAFSettings: illegal tag %d (wire type %d)", fieldNum, wire) |
| 824 | } |
| 825 | switch fieldNum { |
| 826 | case 1: |
| 827 | if wireType != 0 { |
| 828 | return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) |
| 829 | } |
| 830 | var v int |
| 831 | for shift := uint(0); ; shift += 7 { |
| 832 | if shift >= 64 { |
| 833 | return protohelpers.ErrIntOverflow |
| 834 | } |
| 835 | if iNdEx >= l { |
| 836 | return io.ErrUnexpectedEOF |
| 837 | } |
| 838 | b := dAtA[iNdEx] |
| 839 | iNdEx++ |
| 840 | v |= int(b&0x7F) << shift |
| 841 | if b < 0x80 { |
| 842 | break |
| 843 | } |
| 844 | } |
| 845 | m.Enabled = bool(v != 0) |
| 846 | case 2: |
| 847 | if wireType != 0 { |
| 848 | return fmt.Errorf("proto: wrong wireType = %d for field DefaultMode", wireType) |
| 849 | } |
| 850 | m.DefaultMode = 0 |
| 851 | for shift := uint(0); ; shift += 7 { |
| 852 | if shift >= 64 { |
| 853 | return protohelpers.ErrIntOverflow |
| 854 | } |
| 855 | if iNdEx >= l { |
| 856 | return io.ErrUnexpectedEOF |
| 857 | } |
| 858 | b := dAtA[iNdEx] |
| 859 | iNdEx++ |
| 860 | m.DefaultMode |= WAFPolicy_Mode(b&0x7F) << shift |
| 861 | if b < 0x80 { |
| 862 | break |
| 863 | } |
| 864 | } |
| 865 | case 3: |
| 866 | if wireType != 0 { |
| 867 | return fmt.Errorf("proto: wrong wireType = %d for field Channel", wireType) |
| 868 | } |
| 869 | m.Channel = 0 |
| 870 | for shift := uint(0); ; shift += 7 { |
| 871 | if shift >= 64 { |
| 872 | return protohelpers.ErrIntOverflow |
| 873 | } |
| 874 | if iNdEx >= l { |
| 875 | return io.ErrUnexpectedEOF |
| 876 | } |
| 877 | b := dAtA[iNdEx] |
| 878 | iNdEx++ |
| 879 | m.Channel |= WAFSettings_Channel(b&0x7F) << shift |
| 880 | if b < 0x80 { |
| 881 | break |
| 882 | } |
| 883 | } |
| 884 | case 4: |
| 885 | if wireType != 2 { |
| 886 | return fmt.Errorf("proto: wrong wireType = %d for field PinnedVersion", wireType) |
| 887 | } |
| 888 | var stringLen uint64 |
| 889 | for shift := uint(0); ; shift += 7 { |
| 890 | if shift >= 64 { |
| 891 | return protohelpers.ErrIntOverflow |
| 892 | } |
| 893 | if iNdEx >= l { |
| 894 | return io.ErrUnexpectedEOF |
| 895 | } |
| 896 | b := dAtA[iNdEx] |
| 897 | iNdEx++ |
| 898 | stringLen |= uint64(b&0x7F) << shift |
| 899 | if b < 0x80 { |
| 900 | break |
| 901 | } |
| 902 | } |
| 903 | intStringLen := int(stringLen) |
| 904 | if intStringLen < 0 { |
| 905 | return protohelpers.ErrInvalidLength |
| 906 | } |
| 907 | postIndex := iNdEx + intStringLen |
| 908 | if postIndex < 0 { |
| 909 | return protohelpers.ErrInvalidLength |
| 910 | } |
| 911 | if postIndex > l { |
| 912 | return io.ErrUnexpectedEOF |
| 913 | } |
| 914 | m.PinnedVersion = string(dAtA[iNdEx:postIndex]) |
| 915 | iNdEx = postIndex |
| 916 | default: |
| 917 | iNdEx = preIndex |
| 918 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 919 | if err != nil { |
| 920 | return err |
| 921 | } |
| 922 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 923 | return protohelpers.ErrInvalidLength |
| 924 | } |
| 925 | if (iNdEx + skippy) > l { |
| 926 | return io.ErrUnexpectedEOF |
| 927 | } |
| 928 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 929 | iNdEx += skippy |
| 930 | } |
| 931 | } |
| 932 | |
| 933 | if iNdEx > l { |
| 934 | return io.ErrUnexpectedEOF |
| 935 | } |
| 936 | return nil |
| 937 | } |
| 938 | func (m *SetWAFSettingsRequest) UnmarshalVT(dAtA []byte) error { |
| 939 | l := len(dAtA) |
| 940 | iNdEx := 0 |
| 941 | for iNdEx < l { |
| 942 | preIndex := iNdEx |
| 943 | var wire uint64 |
| 944 | for shift := uint(0); ; shift += 7 { |
| 945 | if shift >= 64 { |
| 946 | return protohelpers.ErrIntOverflow |
| 947 | } |
| 948 | if iNdEx >= l { |
| 949 | return io.ErrUnexpectedEOF |
| 950 | } |
| 951 | b := dAtA[iNdEx] |
| 952 | iNdEx++ |
| 953 | wire |= uint64(b&0x7F) << shift |
| 954 | if b < 0x80 { |
| 955 | break |
| 956 | } |
| 957 | } |
| 958 | fieldNum := int32(wire >> 3) |
| 959 | wireType := int(wire & 0x7) |
| 960 | if wireType == 4 { |
| 961 | return fmt.Errorf("proto: SetWAFSettingsRequest: wiretype end group for non-group") |
| 962 | } |
| 963 | if fieldNum <= 0 { |
| 964 | return fmt.Errorf("proto: SetWAFSettingsRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
| 965 | } |
| 966 | switch fieldNum { |
| 967 | case 1: |
| 968 | if wireType != 2 { |
| 969 | return fmt.Errorf("proto: wrong wireType = %d for field ExpectedVersion", wireType) |
| 970 | } |
| 971 | var stringLen uint64 |
| 972 | for shift := uint(0); ; shift += 7 { |
| 973 | if shift >= 64 { |
| 974 | return protohelpers.ErrIntOverflow |
| 975 | } |
| 976 | if iNdEx >= l { |
| 977 | return io.ErrUnexpectedEOF |
| 978 | } |
| 979 | b := dAtA[iNdEx] |
| 980 | iNdEx++ |
| 981 | stringLen |= uint64(b&0x7F) << shift |
| 982 | if b < 0x80 { |
| 983 | break |
| 984 | } |
| 985 | } |
| 986 | intStringLen := int(stringLen) |
| 987 | if intStringLen < 0 { |
| 988 | return protohelpers.ErrInvalidLength |
| 989 | } |
| 990 | postIndex := iNdEx + intStringLen |
| 991 | if postIndex < 0 { |
| 992 | return protohelpers.ErrInvalidLength |
| 993 | } |
| 994 | if postIndex > l { |
| 995 | return io.ErrUnexpectedEOF |
| 996 | } |
| 997 | m.ExpectedVersion = string(dAtA[iNdEx:postIndex]) |
| 998 | iNdEx = postIndex |
| 999 | case 2: |
| 1000 | if wireType != 2 { |
| 1001 | return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) |
| 1002 | } |
| 1003 | var msglen int |
| 1004 | for shift := uint(0); ; shift += 7 { |
| 1005 | if shift >= 64 { |
| 1006 | return protohelpers.ErrIntOverflow |
| 1007 | } |
| 1008 | if iNdEx >= l { |
| 1009 | return io.ErrUnexpectedEOF |
| 1010 | } |
| 1011 | b := dAtA[iNdEx] |
| 1012 | iNdEx++ |
| 1013 | msglen |= int(b&0x7F) << shift |
| 1014 | if b < 0x80 { |
| 1015 | break |
| 1016 | } |
| 1017 | } |
| 1018 | if msglen < 0 { |
| 1019 | return protohelpers.ErrInvalidLength |
| 1020 | } |
| 1021 | postIndex := iNdEx + msglen |
| 1022 | if postIndex < 0 { |
| 1023 | return protohelpers.ErrInvalidLength |
| 1024 | } |
| 1025 | if postIndex > l { |
| 1026 | return io.ErrUnexpectedEOF |
| 1027 | } |
| 1028 | if m.Config == nil { |
| 1029 | m.Config = &WAFSettings{} |
| 1030 | } |
| 1031 | if err := m.Config.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { |
| 1032 | return err |
| 1033 | } |
| 1034 | iNdEx = postIndex |
| 1035 | default: |
| 1036 | iNdEx = preIndex |
| 1037 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 1038 | if err != nil { |
| 1039 | return err |
| 1040 | } |
| 1041 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 1042 | return protohelpers.ErrInvalidLength |
| 1043 | } |
| 1044 | if (iNdEx + skippy) > l { |
| 1045 | return io.ErrUnexpectedEOF |
| 1046 | } |
| 1047 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 1048 | iNdEx += skippy |
| 1049 | } |
| 1050 | } |
| 1051 | |
| 1052 | if iNdEx > l { |
| 1053 | return io.ErrUnexpectedEOF |
| 1054 | } |
| 1055 | return nil |
| 1056 | } |
| 1057 | func (m *HostWAFRecord) UnmarshalVT(dAtA []byte) error { |
| 1058 | l := len(dAtA) |
| 1059 | iNdEx := 0 |
| 1060 | for iNdEx < l { |
| 1061 | preIndex := iNdEx |
| 1062 | var wire uint64 |
| 1063 | for shift := uint(0); ; shift += 7 { |
| 1064 | if shift >= 64 { |
| 1065 | return protohelpers.ErrIntOverflow |
| 1066 | } |
| 1067 | if iNdEx >= l { |
| 1068 | return io.ErrUnexpectedEOF |
| 1069 | } |
| 1070 | b := dAtA[iNdEx] |
| 1071 | iNdEx++ |
| 1072 | wire |= uint64(b&0x7F) << shift |
| 1073 | if b < 0x80 { |
| 1074 | break |
| 1075 | } |
| 1076 | } |
| 1077 | fieldNum := int32(wire >> 3) |
| 1078 | wireType := int(wire & 0x7) |
| 1079 | if wireType == 4 { |
| 1080 | return fmt.Errorf("proto: HostWAFRecord: wiretype end group for non-group") |
| 1081 | } |
| 1082 | if fieldNum <= 0 { |
| 1083 | return fmt.Errorf("proto: HostWAFRecord: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1084 | } |
| 1085 | switch fieldNum { |
| 1086 | case 1: |
| 1087 | if wireType != 0 { |
| 1088 | return fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) |
| 1089 | } |
| 1090 | m.Schema = 0 |
| 1091 | for shift := uint(0); ; shift += 7 { |
| 1092 | if shift >= 64 { |
| 1093 | return protohelpers.ErrIntOverflow |
| 1094 | } |
| 1095 | if iNdEx >= l { |
| 1096 | return io.ErrUnexpectedEOF |
| 1097 | } |
| 1098 | b := dAtA[iNdEx] |
| 1099 | iNdEx++ |
| 1100 | m.Schema |= uint32(b&0x7F) << shift |
| 1101 | if b < 0x80 { |
| 1102 | break |
| 1103 | } |
| 1104 | } |
| 1105 | case 2: |
| 1106 | if wireType != 2 { |
| 1107 | return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) |
| 1108 | } |
| 1109 | var byteLen int |
| 1110 | for shift := uint(0); ; shift += 7 { |
| 1111 | if shift >= 64 { |
| 1112 | return protohelpers.ErrIntOverflow |
| 1113 | } |
| 1114 | if iNdEx >= l { |
| 1115 | return io.ErrUnexpectedEOF |
| 1116 | } |
| 1117 | b := dAtA[iNdEx] |
| 1118 | iNdEx++ |
| 1119 | byteLen |= int(b&0x7F) << shift |
| 1120 | if b < 0x80 { |
| 1121 | break |
| 1122 | } |
| 1123 | } |
| 1124 | if byteLen < 0 { |
| 1125 | return protohelpers.ErrInvalidLength |
| 1126 | } |
| 1127 | postIndex := iNdEx + byteLen |
| 1128 | if postIndex < 0 { |
| 1129 | return protohelpers.ErrInvalidLength |
| 1130 | } |
| 1131 | if postIndex > l { |
| 1132 | return io.ErrUnexpectedEOF |
| 1133 | } |
| 1134 | m.Owner = append(m.Owner[:0], dAtA[iNdEx:postIndex]...) |
| 1135 | if m.Owner == nil { |
| 1136 | m.Owner = []byte{} |
| 1137 | } |
| 1138 | iNdEx = postIndex |
| 1139 | case 3: |
| 1140 | if wireType != 2 { |
| 1141 | return fmt.Errorf("proto: wrong wireType = %d for field Policy", wireType) |
| 1142 | } |
| 1143 | var msglen int |
| 1144 | for shift := uint(0); ; shift += 7 { |
| 1145 | if shift >= 64 { |
| 1146 | return protohelpers.ErrIntOverflow |
| 1147 | } |
| 1148 | if iNdEx >= l { |
| 1149 | return io.ErrUnexpectedEOF |
| 1150 | } |
| 1151 | b := dAtA[iNdEx] |
| 1152 | iNdEx++ |
| 1153 | msglen |= int(b&0x7F) << shift |
| 1154 | if b < 0x80 { |
| 1155 | break |
| 1156 | } |
| 1157 | } |
| 1158 | if msglen < 0 { |
| 1159 | return protohelpers.ErrInvalidLength |
| 1160 | } |
| 1161 | postIndex := iNdEx + msglen |
| 1162 | if postIndex < 0 { |
| 1163 | return protohelpers.ErrInvalidLength |
| 1164 | } |
| 1165 | if postIndex > l { |
| 1166 | return io.ErrUnexpectedEOF |
| 1167 | } |
| 1168 | if m.Policy == nil { |
| 1169 | m.Policy = &WAFPolicy{} |
| 1170 | } |
| 1171 | if err := m.Policy.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { |
| 1172 | return err |
| 1173 | } |
| 1174 | iNdEx = postIndex |
| 1175 | default: |
| 1176 | iNdEx = preIndex |
| 1177 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 1178 | if err != nil { |
| 1179 | return err |
| 1180 | } |
| 1181 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 1182 | return protohelpers.ErrInvalidLength |
| 1183 | } |
| 1184 | if (iNdEx + skippy) > l { |
| 1185 | return io.ErrUnexpectedEOF |
| 1186 | } |
| 1187 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 1188 | iNdEx += skippy |
| 1189 | } |
| 1190 | } |
| 1191 | |
| 1192 | if iNdEx > l { |
| 1193 | return io.ErrUnexpectedEOF |
| 1194 | } |
| 1195 | return nil |
| 1196 | } |
| 1197 | func (m *GetHostWAFRequest) UnmarshalVT(dAtA []byte) error { |
| 1198 | l := len(dAtA) |
| 1199 | iNdEx := 0 |
| 1200 | for iNdEx < l { |
| 1201 | preIndex := iNdEx |
| 1202 | var wire uint64 |
| 1203 | for shift := uint(0); ; shift += 7 { |
| 1204 | if shift >= 64 { |
| 1205 | return protohelpers.ErrIntOverflow |
| 1206 | } |
| 1207 | if iNdEx >= l { |
| 1208 | return io.ErrUnexpectedEOF |
| 1209 | } |
| 1210 | b := dAtA[iNdEx] |
| 1211 | iNdEx++ |
| 1212 | wire |= uint64(b&0x7F) << shift |
| 1213 | if b < 0x80 { |
| 1214 | break |
| 1215 | } |
| 1216 | } |
| 1217 | fieldNum := int32(wire >> 3) |
| 1218 | wireType := int(wire & 0x7) |
| 1219 | if wireType == 4 { |
| 1220 | return fmt.Errorf("proto: GetHostWAFRequest: wiretype end group for non-group") |
| 1221 | } |
| 1222 | if fieldNum <= 0 { |
| 1223 | return fmt.Errorf("proto: GetHostWAFRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1224 | } |
| 1225 | switch fieldNum { |
| 1226 | case 1: |
| 1227 | if wireType != 2 { |
| 1228 | return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) |
| 1229 | } |
| 1230 | var stringLen uint64 |
| 1231 | for shift := uint(0); ; shift += 7 { |
| 1232 | if shift >= 64 { |
| 1233 | return protohelpers.ErrIntOverflow |
| 1234 | } |
| 1235 | if iNdEx >= l { |
| 1236 | return io.ErrUnexpectedEOF |
| 1237 | } |
| 1238 | b := dAtA[iNdEx] |
| 1239 | iNdEx++ |
| 1240 | stringLen |= uint64(b&0x7F) << shift |
| 1241 | if b < 0x80 { |
| 1242 | break |
| 1243 | } |
| 1244 | } |
| 1245 | intStringLen := int(stringLen) |
| 1246 | if intStringLen < 0 { |
| 1247 | return protohelpers.ErrInvalidLength |
| 1248 | } |
| 1249 | postIndex := iNdEx + intStringLen |
| 1250 | if postIndex < 0 { |
| 1251 | return protohelpers.ErrInvalidLength |
| 1252 | } |
| 1253 | if postIndex > l { |
| 1254 | return io.ErrUnexpectedEOF |
| 1255 | } |
| 1256 | m.Hostname = string(dAtA[iNdEx:postIndex]) |
| 1257 | iNdEx = postIndex |
| 1258 | default: |
| 1259 | iNdEx = preIndex |
| 1260 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 1261 | if err != nil { |
| 1262 | return err |
| 1263 | } |
| 1264 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 1265 | return protohelpers.ErrInvalidLength |
| 1266 | } |
| 1267 | if (iNdEx + skippy) > l { |
| 1268 | return io.ErrUnexpectedEOF |
| 1269 | } |
| 1270 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 1271 | iNdEx += skippy |
| 1272 | } |
| 1273 | } |
| 1274 | |
| 1275 | if iNdEx > l { |
| 1276 | return io.ErrUnexpectedEOF |
| 1277 | } |
| 1278 | return nil |
| 1279 | } |
| 1280 | func (m *SetHostWAFRequest) UnmarshalVT(dAtA []byte) error { |
| 1281 | l := len(dAtA) |
| 1282 | iNdEx := 0 |
| 1283 | for iNdEx < l { |
| 1284 | preIndex := iNdEx |
| 1285 | var wire uint64 |
| 1286 | for shift := uint(0); ; shift += 7 { |
| 1287 | if shift >= 64 { |
| 1288 | return protohelpers.ErrIntOverflow |
| 1289 | } |
| 1290 | if iNdEx >= l { |
| 1291 | return io.ErrUnexpectedEOF |
| 1292 | } |
| 1293 | b := dAtA[iNdEx] |
| 1294 | iNdEx++ |
| 1295 | wire |= uint64(b&0x7F) << shift |
| 1296 | if b < 0x80 { |
| 1297 | break |
| 1298 | } |
| 1299 | } |
| 1300 | fieldNum := int32(wire >> 3) |
| 1301 | wireType := int(wire & 0x7) |
| 1302 | if wireType == 4 { |
| 1303 | return fmt.Errorf("proto: SetHostWAFRequest: wiretype end group for non-group") |
| 1304 | } |
| 1305 | if fieldNum <= 0 { |
| 1306 | return fmt.Errorf("proto: SetHostWAFRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1307 | } |
| 1308 | switch fieldNum { |
| 1309 | case 1: |
| 1310 | if wireType != 2 { |
| 1311 | return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) |
| 1312 | } |
| 1313 | var stringLen uint64 |
| 1314 | for shift := uint(0); ; shift += 7 { |
| 1315 | if shift >= 64 { |
| 1316 | return protohelpers.ErrIntOverflow |
| 1317 | } |
| 1318 | if iNdEx >= l { |
| 1319 | return io.ErrUnexpectedEOF |
| 1320 | } |
| 1321 | b := dAtA[iNdEx] |
| 1322 | iNdEx++ |
| 1323 | stringLen |= uint64(b&0x7F) << shift |
| 1324 | if b < 0x80 { |
| 1325 | break |
| 1326 | } |
| 1327 | } |
| 1328 | intStringLen := int(stringLen) |
| 1329 | if intStringLen < 0 { |
| 1330 | return protohelpers.ErrInvalidLength |
| 1331 | } |
| 1332 | postIndex := iNdEx + intStringLen |
| 1333 | if postIndex < 0 { |
| 1334 | return protohelpers.ErrInvalidLength |
| 1335 | } |
| 1336 | if postIndex > l { |
| 1337 | return io.ErrUnexpectedEOF |
| 1338 | } |
| 1339 | m.Hostname = string(dAtA[iNdEx:postIndex]) |
| 1340 | iNdEx = postIndex |
| 1341 | case 2: |
| 1342 | if wireType != 2 { |
| 1343 | return fmt.Errorf("proto: wrong wireType = %d for field ExpectedVersion", wireType) |
| 1344 | } |
| 1345 | var stringLen uint64 |
| 1346 | for shift := uint(0); ; shift += 7 { |
| 1347 | if shift >= 64 { |
| 1348 | return protohelpers.ErrIntOverflow |
| 1349 | } |
| 1350 | if iNdEx >= l { |
| 1351 | return io.ErrUnexpectedEOF |
| 1352 | } |
| 1353 | b := dAtA[iNdEx] |
| 1354 | iNdEx++ |
| 1355 | stringLen |= uint64(b&0x7F) << shift |
| 1356 | if b < 0x80 { |
| 1357 | break |
| 1358 | } |
| 1359 | } |
| 1360 | intStringLen := int(stringLen) |
| 1361 | if intStringLen < 0 { |
| 1362 | return protohelpers.ErrInvalidLength |
| 1363 | } |
| 1364 | postIndex := iNdEx + intStringLen |
| 1365 | if postIndex < 0 { |
| 1366 | return protohelpers.ErrInvalidLength |
| 1367 | } |
| 1368 | if postIndex > l { |
| 1369 | return io.ErrUnexpectedEOF |
| 1370 | } |
| 1371 | m.ExpectedVersion = string(dAtA[iNdEx:postIndex]) |
| 1372 | iNdEx = postIndex |
| 1373 | case 3: |
| 1374 | if wireType != 2 { |
| 1375 | return fmt.Errorf("proto: wrong wireType = %d for field Policy", wireType) |
| 1376 | } |
| 1377 | var msglen int |
| 1378 | for shift := uint(0); ; shift += 7 { |
| 1379 | if shift >= 64 { |
| 1380 | return protohelpers.ErrIntOverflow |
| 1381 | } |
| 1382 | if iNdEx >= l { |
| 1383 | return io.ErrUnexpectedEOF |
| 1384 | } |
| 1385 | b := dAtA[iNdEx] |
| 1386 | iNdEx++ |
| 1387 | msglen |= int(b&0x7F) << shift |
| 1388 | if b < 0x80 { |
| 1389 | break |
| 1390 | } |
| 1391 | } |
| 1392 | if msglen < 0 { |
| 1393 | return protohelpers.ErrInvalidLength |
| 1394 | } |
| 1395 | postIndex := iNdEx + msglen |
| 1396 | if postIndex < 0 { |
| 1397 | return protohelpers.ErrInvalidLength |
| 1398 | } |
| 1399 | if postIndex > l { |
| 1400 | return io.ErrUnexpectedEOF |
| 1401 | } |
| 1402 | if m.Policy == nil { |
| 1403 | m.Policy = &WAFPolicy{} |
| 1404 | } |
| 1405 | if err := m.Policy.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { |
| 1406 | return err |
| 1407 | } |
| 1408 | iNdEx = postIndex |
| 1409 | default: |
| 1410 | iNdEx = preIndex |
| 1411 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 1412 | if err != nil { |
| 1413 | return err |
| 1414 | } |
| 1415 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 1416 | return protohelpers.ErrInvalidLength |
| 1417 | } |
| 1418 | if (iNdEx + skippy) > l { |
| 1419 | return io.ErrUnexpectedEOF |
| 1420 | } |
| 1421 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 1422 | iNdEx += skippy |
| 1423 | } |
| 1424 | } |
| 1425 | |
| 1426 | if iNdEx > l { |
| 1427 | return io.ErrUnexpectedEOF |
| 1428 | } |
| 1429 | return nil |
| 1430 | } |
| 1431 | func (m *HostWAFResponse) UnmarshalVT(dAtA []byte) error { |
| 1432 | l := len(dAtA) |
| 1433 | iNdEx := 0 |
| 1434 | for iNdEx < l { |
| 1435 | preIndex := iNdEx |
| 1436 | var wire uint64 |
| 1437 | for shift := uint(0); ; shift += 7 { |
| 1438 | if shift >= 64 { |
| 1439 | return protohelpers.ErrIntOverflow |
| 1440 | } |
| 1441 | if iNdEx >= l { |
| 1442 | return io.ErrUnexpectedEOF |
| 1443 | } |
| 1444 | b := dAtA[iNdEx] |
| 1445 | iNdEx++ |
| 1446 | wire |= uint64(b&0x7F) << shift |
| 1447 | if b < 0x80 { |
| 1448 | break |
| 1449 | } |
| 1450 | } |
| 1451 | fieldNum := int32(wire >> 3) |
| 1452 | wireType := int(wire & 0x7) |
| 1453 | if wireType == 4 { |
| 1454 | return fmt.Errorf("proto: HostWAFResponse: wiretype end group for non-group") |
| 1455 | } |
| 1456 | if fieldNum <= 0 { |
| 1457 | return fmt.Errorf("proto: HostWAFResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1458 | } |
| 1459 | switch fieldNum { |
| 1460 | case 1: |
| 1461 | if wireType != 2 { |
| 1462 | return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) |
| 1463 | } |
| 1464 | var stringLen uint64 |
| 1465 | for shift := uint(0); ; shift += 7 { |
| 1466 | if shift >= 64 { |
| 1467 | return protohelpers.ErrIntOverflow |
| 1468 | } |
| 1469 | if iNdEx >= l { |
| 1470 | return io.ErrUnexpectedEOF |
| 1471 | } |
| 1472 | b := dAtA[iNdEx] |
| 1473 | iNdEx++ |
| 1474 | stringLen |= uint64(b&0x7F) << shift |
| 1475 | if b < 0x80 { |
| 1476 | break |
| 1477 | } |
| 1478 | } |
| 1479 | intStringLen := int(stringLen) |
| 1480 | if intStringLen < 0 { |
| 1481 | return protohelpers.ErrInvalidLength |
| 1482 | } |
| 1483 | postIndex := iNdEx + intStringLen |
| 1484 | if postIndex < 0 { |
| 1485 | return protohelpers.ErrInvalidLength |
| 1486 | } |
| 1487 | if postIndex > l { |
| 1488 | return io.ErrUnexpectedEOF |
| 1489 | } |
| 1490 | m.Hostname = string(dAtA[iNdEx:postIndex]) |
| 1491 | iNdEx = postIndex |
| 1492 | case 2: |
| 1493 | if wireType != 2 { |
| 1494 | return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) |
| 1495 | } |
| 1496 | var stringLen uint64 |
| 1497 | for shift := uint(0); ; shift += 7 { |
| 1498 | if shift >= 64 { |
| 1499 | return protohelpers.ErrIntOverflow |
| 1500 | } |
| 1501 | if iNdEx >= l { |
| 1502 | return io.ErrUnexpectedEOF |
| 1503 | } |
| 1504 | b := dAtA[iNdEx] |
| 1505 | iNdEx++ |
| 1506 | stringLen |= uint64(b&0x7F) << shift |
| 1507 | if b < 0x80 { |
| 1508 | break |
| 1509 | } |
| 1510 | } |
| 1511 | intStringLen := int(stringLen) |
| 1512 | if intStringLen < 0 { |
| 1513 | return protohelpers.ErrInvalidLength |
| 1514 | } |
| 1515 | postIndex := iNdEx + intStringLen |
| 1516 | if postIndex < 0 { |
| 1517 | return protohelpers.ErrInvalidLength |
| 1518 | } |
| 1519 | if postIndex > l { |
| 1520 | return io.ErrUnexpectedEOF |
| 1521 | } |
| 1522 | m.Version = string(dAtA[iNdEx:postIndex]) |
| 1523 | iNdEx = postIndex |
| 1524 | case 3: |
| 1525 | if wireType != 2 { |
| 1526 | return fmt.Errorf("proto: wrong wireType = %d for field Policy", wireType) |
| 1527 | } |
| 1528 | var msglen int |
| 1529 | for shift := uint(0); ; shift += 7 { |
| 1530 | if shift >= 64 { |
| 1531 | return protohelpers.ErrIntOverflow |
| 1532 | } |
| 1533 | if iNdEx >= l { |
| 1534 | return io.ErrUnexpectedEOF |
| 1535 | } |
| 1536 | b := dAtA[iNdEx] |
| 1537 | iNdEx++ |
| 1538 | msglen |= int(b&0x7F) << shift |
| 1539 | if b < 0x80 { |
| 1540 | break |
| 1541 | } |
| 1542 | } |
| 1543 | if msglen < 0 { |
| 1544 | return protohelpers.ErrInvalidLength |
| 1545 | } |
| 1546 | postIndex := iNdEx + msglen |
| 1547 | if postIndex < 0 { |
| 1548 | return protohelpers.ErrInvalidLength |
| 1549 | } |
| 1550 | if postIndex > l { |
| 1551 | return io.ErrUnexpectedEOF |
| 1552 | } |
| 1553 | if m.Policy == nil { |
| 1554 | m.Policy = &WAFPolicy{} |
| 1555 | } |
| 1556 | if err := m.Policy.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { |
| 1557 | return err |
| 1558 | } |
| 1559 | iNdEx = postIndex |
| 1560 | default: |
| 1561 | iNdEx = preIndex |
| 1562 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 1563 | if err != nil { |
| 1564 | return err |
| 1565 | } |
| 1566 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 1567 | return protohelpers.ErrInvalidLength |
| 1568 | } |
| 1569 | if (iNdEx + skippy) > l { |
| 1570 | return io.ErrUnexpectedEOF |
| 1571 | } |
| 1572 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 1573 | iNdEx += skippy |
| 1574 | } |
| 1575 | } |
| 1576 | |
| 1577 | if iNdEx > l { |
| 1578 | return io.ErrUnexpectedEOF |
| 1579 | } |
| 1580 | return nil |
| 1581 | } |