aboutsummaryrefslogtreecommitdiffstats
path: root/test/config.py
AgeCommit message (Expand)AuthorFilesLines
2022-08-16tests: move "venv" to "build-root" directory from "test" directorySaima Yunus1-1/+1
2022-05-24tests: fix default failed dir settingKlement Sekera1-4/+5
2022-05-10tests: replace pycodestyle with blackKlement Sekera1-125/+238
2022-03-18tests: fix the RND_SEED parsingAndrew Yourtchenko1-1/+13
2022-02-17tests: make tests less make dependentKlement Sekera1-0/+290
168'>168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
//  binapi-generator: v0.4.0
//  VPP:              21.06-release
// source: /usr/share/vpp/api/plugins/wireguard.api.json

// Package wireguard contains generated bindings for API file wireguard.api.
//
// Contents:
//   1 enum
//   2 structs
//  12 messages
//
package wireguard

import (
	"strconv"

	api "git.fd.io/govpp.git/api"
	interface_types "git.fd.io/govpp.git/binapi/interface_types"
	ip_types "git.fd.io/govpp.git/binapi/ip_types"
	codec "git.fd.io/govpp.git/codec"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the GoVPP api package it is being compiled against.
// A compilation error at this line likely means your copy of the
// GoVPP api package needs to be updated.
const _ = api.GoVppAPIPackageIsVersion2

const (
	APIFile    = "wireguard"
	APIVersion = "0.1.0"
	VersionCrc = 0x1e1d4252
)

// WireguardPeerFlags defines enum 'wireguard_peer_flags'.
type WireguardPeerFlags uint8

const (
	WIREGUARD_PEER_STATUS_DEAD WireguardPeerFlags = 1
)

var (
	WireguardPeerFlags_name = map[uint8]string{
		1: "WIREGUARD_PEER_STATUS_DEAD",
	}
	WireguardPeerFlags_value = map[string]uint8{
		"WIREGUARD_PEER_STATUS_DEAD": 1,
	}
)

func (x WireguardPeerFlags) String() string {
	s, ok := WireguardPeerFlags_name[uint8(x)]
	if ok {
		return s
	}
	str := func(n uint8) string {
		s, ok := WireguardPeerFlags_name[uint8(n)]
		if ok {
			return s
		}
		return "WireguardPeerFlags(" + strconv.Itoa(int(n)) + ")"
	}
	for i := uint8(0); i <= 8; i++ {
		val := uint8(x)
		if val&(1<<i) != 0 {
			if s != "" {
				s += "|"
			}
			s += str(1 << i)
		}
	}
	if s == "" {
		return str(uint8(x))
	}
	return s
}

// WireguardInterface defines type 'wireguard_interface'.
type WireguardInterface struct {
	UserInstance uint32                         `binapi:"u32,name=user_instance,default=4294967295" json:"user_instance,omitempty"`
	SwIfIndex    interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
	PrivateKey   []byte                         `binapi:"u8[32],name=private_key" json:"private_key,omitempty"`
	PublicKey    []byte                         `binapi:"u8[32],name=public_key" json:"public_key,omitempty"`
	Port         uint16                         `binapi:"u16,name=port" json:"port,omitempty"`
	SrcIP        ip_types.Address               `binapi:"address,name=src_ip" json:"src_ip,omitempty"`
}

// WireguardPeer defines type 'wireguard_peer'.
type WireguardPeer struct {
	PublicKey           []byte                         `binapi:"u8[32],name=public_key" json:"public_key,omitempty"`
	Port                uint16                         `binapi:"u16,name=port" json:"port,omitempty"`
	PersistentKeepalive uint16                         `binapi:"u16,name=persistent_keepalive" json:"persistent_keepalive,omitempty"`
	TableID             uint32                         `binapi:"u32,name=table_id" json:"table_id,omitempty"`
	Endpoint            ip_types.Address               `binapi:"address,name=endpoint" json:"endpoint,omitempty"`
	SwIfIndex           interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
	Flags               WireguardPeerFlags             `binapi:"wireguard_peer_flags,name=flags" json:"flags,omitempty"`
	NAllowedIps         uint8                          `binapi:"u8,name=n_allowed_ips" json:"-"`
	AllowedIps          []ip_types.Prefix              `binapi:"prefix[n_allowed_ips],name=allowed_ips" json:"allowed_ips,omitempty"`
}

// WireguardInterfaceCreate defines message 'wireguard_interface_create'.
// InProgress: the message form may change in the future versions
type WireguardInterfaceCreate struct {
	Interface   WireguardInterface `binapi:"wireguard_interface,name=interface" json:"interface,omitempty"`
	GenerateKey bool               `binapi:"bool,name=generate_key" json:"generate_key,omitempty"`
}

func (m *WireguardInterfaceCreate) Reset()               { *m = WireguardInterfaceCreate{} }
func (*WireguardInterfaceCreate) GetMessageName() string { return "wireguard_interface_create" }
func (*WireguardInterfaceCreate) GetCrcString() string   { return "a530137e" }
func (*WireguardInterfaceCreate) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *WireguardInterfaceCreate) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4      // m.Interface.UserInstance
	size += 4      // m.Interface.SwIfIndex
	size += 1 * 32 // m.Interface.PrivateKey
	size += 1 * 32 // m.Interface.PublicKey
	size += 2      // m.Interface.Port
	size += 1      // m.Interface.SrcIP.Af
	size += 1 * 16 // m.Interface.SrcIP.Un
	size += 1      // m.GenerateKey
	return size
}
func (m *WireguardInterfaceCreate) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeUint32(m.Interface.UserInstance)
	buf.EncodeUint32(uint32(m.Interface.SwIfIndex))
	buf.EncodeBytes(m.Interface.PrivateKey, 32)
	buf.EncodeBytes(m.Interface.PublicKey, 32)
	buf.EncodeUint16(m.Interface.Port)
	buf.EncodeUint8(uint8(m.Interface.SrcIP.Af))
	buf.EncodeBytes(m.Interface.SrcIP.Un.XXX_UnionData[:], 16)
	buf.EncodeBool(m.GenerateKey)
	return buf.Bytes(), nil
}
func (m *WireguardInterfaceCreate) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Interface.UserInstance = buf.DecodeUint32()
	m.Interface.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	m.Interface.PrivateKey = make([]byte, 32)
	copy(m.Interface.PrivateKey, buf.DecodeBytes(len(m.Interface.PrivateKey)))
	m.Interface.PublicKey = make([]byte, 32)
	copy(m.Interface.PublicKey, buf.DecodeBytes(len(m.Interface.PublicKey)))
	m.Interface.Port = buf.DecodeUint16()
	m.Interface.SrcIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
	copy(m.Interface.SrcIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
	m.GenerateKey = buf.DecodeBool()
	return nil
}

// WireguardInterfaceCreateReply defines message 'wireguard_interface_create_reply'.
// InProgress: the message form may change in the future versions
type WireguardInterfaceCreateReply struct {
	Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}

func (m *WireguardInterfaceCreateReply) Reset() { *m = WireguardInterfaceCreateReply{} }
func (*WireguardInterfaceCreateReply) GetMessageName() string {
	return "wireguard_interface_create_reply"
}
func (*WireguardInterfaceCreateReply) GetCrcString() string { return "5383d31f" }
func (*WireguardInterfaceCreateReply) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *WireguardInterfaceCreateReply) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.Retval
	size += 4 // m.SwIfIndex
	return size
}
func (m *WireguardInterfaceCreateReply) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeInt32(m.Retval)
	buf.EncodeUint32(uint32(m.SwIfIndex))
	return buf.Bytes(), nil
}
func (m *WireguardInterfaceCreateReply) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Retval = buf.DecodeInt32()
	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	return nil
}

// WireguardInterfaceDelete defines message 'wireguard_interface_delete'.
// InProgress: the message form may change in the future versions
type WireguardInterfaceDelete struct {
	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}

func (m *WireguardInterfaceDelete) Reset()               { *m = WireguardInterfaceDelete{} }
func (*WireguardInterfaceDelete) GetMessageName() string { return "wireguard_interface_delete" }
func (*WireguardInterfaceDelete) GetCrcString() string   { return "f9e6675e" }
func (*WireguardInterfaceDelete) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *WireguardInterfaceDelete) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.SwIfIndex
	return size
}
func (m *WireguardInterfaceDelete) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeUint32(uint32(m.SwIfIndex))
	return buf.Bytes(), nil
}
func (m *WireguardInterfaceDelete) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	return nil
}

// WireguardInterfaceDeleteReply defines message 'wireguard_interface_delete_reply'.
// InProgress: the message form may change in the future versions
type WireguardInterfaceDeleteReply struct {
	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}

func (m *WireguardInterfaceDeleteReply) Reset() { *m = WireguardInterfaceDeleteReply{} }
func (*WireguardInterfaceDeleteReply) GetMessageName() string {
	return "wireguard_interface_delete_reply"
}
func (*WireguardInterfaceDeleteReply) GetCrcString() string { return "e8d4e804" }
func (*WireguardInterfaceDeleteReply) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *WireguardInterfaceDeleteReply) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.Retval
	return size
}
func (m *WireguardInterfaceDeleteReply) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeInt32(m.Retval)
	return buf.Bytes(), nil
}
func (m *WireguardInterfaceDeleteReply) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Retval = buf.DecodeInt32()
	return nil
}

// WireguardInterfaceDetails defines message 'wireguard_interface_details'.
// InProgress: the message form may change in the future versions
type WireguardInterfaceDetails struct {
	Interface WireguardInterface `binapi:"wireguard_interface,name=interface" json:"interface,omitempty"`
}

func (m *WireguardInterfaceDetails) Reset()               { *m = WireguardInterfaceDetails{} }
func (*WireguardInterfaceDetails) GetMessageName() string { return "wireguard_interface_details" }
func (*WireguardInterfaceDetails) GetCrcString() string   { return "0dd4865d" }
func (*WireguardInterfaceDetails) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *WireguardInterfaceDetails) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4      // m.Interface.UserInstance
	size += 4      // m.Interface.SwIfIndex
	size += 1 * 32 // m.Interface.PrivateKey
	size += 1 * 32 // m.Interface.PublicKey
	size += 2      // m.Interface.Port
	size += 1      // m.Interface.SrcIP.Af
	size += 1 * 16 // m.Interface.SrcIP.Un
	return size
}
func (m *WireguardInterfaceDetails) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeUint32(m.Interface.UserInstance)
	buf.EncodeUint32(uint32(m.Interface.SwIfIndex))
	buf.EncodeBytes(m.Interface.PrivateKey, 32)
	buf.EncodeBytes(m.Interface.PublicKey, 32)
	buf.EncodeUint16(m.Interface.Port)
	buf.EncodeUint8(uint8(m.Interface.SrcIP.Af))
	buf.EncodeBytes(m.Interface.SrcIP.Un.XXX_UnionData[:], 16)
	return buf.Bytes(), nil
}
func (m *WireguardInterfaceDetails) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Interface.UserInstance = buf.DecodeUint32()
	m.Interface.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	m.Interface.PrivateKey = make([]byte, 32)
	copy(m.Interface.PrivateKey, buf.DecodeBytes(len(m.Interface.PrivateKey)))
	m.Interface.PublicKey = make([]byte, 32)
	copy(m.Interface.PublicKey, buf.DecodeBytes(len(m.Interface.PublicKey)))
	m.Interface.Port = buf.DecodeUint16()
	m.Interface.SrcIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
	copy(m.Interface.SrcIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
	return nil
}

// WireguardInterfaceDump defines message 'wireguard_interface_dump'.
// InProgress: the message form may change in the future versions
type WireguardInterfaceDump struct {
	ShowPrivateKey bool                           `binapi:"bool,name=show_private_key" json:"show_private_key,omitempty"`
	SwIfIndex      interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}

func (m *WireguardInterfaceDump) Reset()               { *m = WireguardInterfaceDump{} }
func (*WireguardInterfaceDump) GetMessageName() string { return "wireguard_interface_dump" }
func (*WireguardInterfaceDump) GetCrcString() string   { return "2c954158" }
func (*WireguardInterfaceDump) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *WireguardInterfaceDump) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1 // m.ShowPrivateKey
	size += 4 // m.SwIfIndex
	return size
}
func (m *WireguardInterfaceDump) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeBool(m.ShowPrivateKey)
	buf.EncodeUint32(uint32(m.SwIfIndex))
	return buf.Bytes(), nil
}
func (m *WireguardInterfaceDump) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.ShowPrivateKey = buf.DecodeBool()
	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	return nil
}

// WireguardPeerAdd defines message 'wireguard_peer_add'.
// InProgress: the message form may change in the future versions
type WireguardPeerAdd struct {
	Peer WireguardPeer `binapi:"wireguard_peer,name=peer" json:"peer,omitempty"`
}

func (m *WireguardPeerAdd) Reset()               { *m = WireguardPeerAdd{} }
func (*WireguardPeerAdd) GetMessageName() string { return "wireguard_peer_add" }
func (*WireguardPeerAdd) GetCrcString() string   { return "ed792326" }
func (*WireguardPeerAdd) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *WireguardPeerAdd) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1 * 32 // m.Peer.PublicKey
	size += 2      // m.Peer.Port
	size += 2      // m.Peer.PersistentKeepalive
	size += 4      // m.Peer.TableID
	size += 1      // m.Peer.Endpoint.Af
	size += 1 * 16 // m.Peer.Endpoint.Un
	size += 4      // m.Peer.SwIfIndex
	size += 1      // m.Peer.Flags
	size += 1      // m.Peer.NAllowedIps
	for j2 := 0; j2 < len(m.Peer.AllowedIps); j2++ {
		var s2 ip_types.Prefix
		_ = s2
		if j2 < len(m.Peer.AllowedIps) {
			s2 = m.Peer.AllowedIps[j2]
		}
		size += 1      // s2.Address.Af
		size += 1 * 16 // s2.Address.Un
		size += 1      // s2.Len
	}
	return size
}
func (m *WireguardPeerAdd) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeBytes(m.Peer.PublicKey, 32)
	buf.EncodeUint16(m.Peer.Port)
	buf.EncodeUint16(m.Peer.PersistentKeepalive)
	buf.EncodeUint32(m.Peer.TableID)
	buf.EncodeUint8(uint8(m.Peer.Endpoint.Af))
	buf.EncodeBytes(m.Peer.Endpoint.Un.XXX_UnionData[:], 16)
	buf.EncodeUint32(uint32(m.Peer.SwIfIndex))
	buf.EncodeUint8(uint8(m.Peer.Flags))
	buf.EncodeUint8(uint8(len(m.Peer.AllowedIps)))
	for j1 := 0; j1 < len(m.Peer.AllowedIps); j1++ {
		var v1 ip_types.Prefix // AllowedIps
		if j1 < len(m.Peer.AllowedIps) {
			v1 = m.Peer.AllowedIps[j1]
		}
		buf.EncodeUint8(uint8(v1.Address.Af))
		buf.EncodeBytes(v1.Address.Un.XXX_UnionData[:], 16)
		buf.EncodeUint8(v1.Len)
	}
	return buf.Bytes(), nil
}
func (m *WireguardPeerAdd) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Peer.PublicKey = make([]byte, 32)
	copy(m.Peer.PublicKey, buf.DecodeBytes(len(m.Peer.PublicKey)))
	m.Peer.Port = buf.DecodeUint16()
	m.Peer.PersistentKeepalive = buf.DecodeUint16()
	m.Peer.TableID = buf.DecodeUint32()
	m.Peer.Endpoint.Af = ip_types.AddressFamily(buf.DecodeUint8())
	copy(m.Peer.Endpoint.Un.XXX_UnionData[:], buf.DecodeBytes(16))
	m.Peer.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	m.Peer.Flags = WireguardPeerFlags(buf.DecodeUint8())
	m.Peer.NAllowedIps = buf.DecodeUint8()
	m.Peer.AllowedIps = make([]ip_types.Prefix, m.Peer.NAllowedIps)
	for j1 := 0; j1 < len(m.Peer.AllowedIps); j1++ {
		m.Peer.AllowedIps[j1].Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
		copy(m.Peer.AllowedIps[j1].Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
		m.Peer.AllowedIps[j1].Len = buf.DecodeUint8()
	}
	return nil
}

// WireguardPeerAddReply defines message 'wireguard_peer_add_reply'.
// InProgress: the message form may change in the future versions
type WireguardPeerAddReply struct {
	Retval    int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
	PeerIndex uint32 `binapi:"u32,name=peer_index" json:"peer_index,omitempty"`
}

func (m *WireguardPeerAddReply) Reset()               { *m = WireguardPeerAddReply{} }
func (*WireguardPeerAddReply) GetMessageName() string { return "wireguard_peer_add_reply" }
func (*WireguardPeerAddReply) GetCrcString() string   { return "084a0cd3" }
func (*WireguardPeerAddReply) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *WireguardPeerAddReply) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.Retval
	size += 4 // m.PeerIndex
	return size
}
func (m *WireguardPeerAddReply) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeInt32(m.Retval)
	buf.EncodeUint32(m.PeerIndex)
	return buf.Bytes(), nil
}
func (m *WireguardPeerAddReply) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Retval = buf.DecodeInt32()
	m.PeerIndex = buf.DecodeUint32()
	return nil
}

// WireguardPeerRemove defines message 'wireguard_peer_remove'.
// InProgress: the message form may change in the future versions
type WireguardPeerRemove struct {
	PeerIndex uint32 `binapi:"u32,name=peer_index" json:"peer_index,omitempty"`
}

func (m *WireguardPeerRemove) Reset()               { *m = WireguardPeerRemove{} }
func (*WireguardPeerRemove) GetMessageName() string { return "wireguard_peer_remove" }
func (*WireguardPeerRemove) GetCrcString() string   { return "3b74607a" }
func (*WireguardPeerRemove) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *WireguardPeerRemove) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.PeerIndex
	return size
}
func (m *WireguardPeerRemove) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeUint32(m.PeerIndex)
	return buf.Bytes(), nil
}
func (m *WireguardPeerRemove) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.PeerIndex = buf.DecodeUint32()
	return nil
}

// WireguardPeerRemoveReply defines message 'wireguard_peer_remove_reply'.
// InProgress: the message form may change in the future versions
type WireguardPeerRemoveReply struct {
	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}

func (m *WireguardPeerRemoveReply) Reset()               { *m = WireguardPeerRemoveReply{} }
func (*WireguardPeerRemoveReply) GetMessageName() string { return "wireguard_peer_remove_reply" }
func (*WireguardPeerRemoveReply) GetCrcString() string   { return "e8d4e804" }
func (*WireguardPeerRemoveReply) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *WireguardPeerRemoveReply) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.Retval
	return size
}
func (m *WireguardPeerRemoveReply) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeInt32(m.Retval)
	return buf.Bytes(), nil
}
func (m *WireguardPeerRemoveReply) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Retval = buf.DecodeInt32()
	return nil
}

// WireguardPeersDetails defines message 'wireguard_peers_details'.
// InProgress: the message form may change in the future versions
type WireguardPeersDetails struct {
	Peer WireguardPeer `binapi:"wireguard_peer,name=peer" json:"peer,omitempty"`
}

func (m *WireguardPeersDetails) Reset()               { *m = WireguardPeersDetails{} }
func (*WireguardPeersDetails) GetMessageName() string { return "wireguard_peers_details" }
func (*WireguardPeersDetails) GetCrcString() string   { return "2097f740" }
func (*WireguardPeersDetails) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *WireguardPeersDetails) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1 * 32 // m.Peer.PublicKey
	size += 2      // m.Peer.Port
	size += 2      // m.Peer.PersistentKeepalive
	size += 4      // m.Peer.TableID
	size += 1      // m.Peer.Endpoint.Af
	size += 1 * 16 // m.Peer.Endpoint.Un
	size += 4      // m.Peer.SwIfIndex
	size += 1      // m.Peer.Flags
	size += 1      // m.Peer.NAllowedIps
	for j2 := 0; j2 < len(m.Peer.AllowedIps); j2++ {
		var s2 ip_types.Prefix
		_ = s2
		if j2 < len(m.Peer.AllowedIps) {
			s2 = m.Peer.AllowedIps[j2]
		}
		size += 1      // s2.Address.Af
		size += 1 * 16 // s2.Address.Un
		size += 1      // s2.Len
	}
	return size
}
func (m *WireguardPeersDetails) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeBytes(m.Peer.PublicKey, 32)
	buf.EncodeUint16(m.Peer.Port)
	buf.EncodeUint16(m.Peer.PersistentKeepalive)
	buf.EncodeUint32(m.Peer.TableID)
	buf.EncodeUint8(uint8(m.Peer.Endpoint.Af))
	buf.EncodeBytes(m.Peer.Endpoint.Un.XXX_UnionData[:], 16)
	buf.EncodeUint32(uint32(m.Peer.SwIfIndex))
	buf.EncodeUint8(uint8(m.Peer.Flags))
	buf.EncodeUint8(uint8(len(m.Peer.AllowedIps)))
	for j1 := 0; j1 < len(m.Peer.AllowedIps); j1++ {
		var v1 ip_types.Prefix // AllowedIps
		if j1 < len(m.Peer.AllowedIps) {
			v1 = m.Peer.AllowedIps[j1]
		}
		buf.EncodeUint8(uint8(v1.Address.Af))
		buf.EncodeBytes(v1.Address.Un.XXX_UnionData[:], 16)
		buf.EncodeUint8(v1.Len)
	}
	return buf.Bytes(), nil
}
func (m *WireguardPeersDetails) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Peer.PublicKey = make([]byte, 32)
	copy(m.Peer.PublicKey, buf.DecodeBytes(len(m.Peer.PublicKey)))
	m.Peer.Port = buf.DecodeUint16()
	m.Peer.PersistentKeepalive = buf.DecodeUint16()
	m.Peer.TableID = buf.DecodeUint32()
	m.Peer.Endpoint.Af = ip_types.AddressFamily(buf.DecodeUint8())
	copy(m.Peer.Endpoint.Un.XXX_UnionData[:], buf.DecodeBytes(16))
	m.Peer.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	m.Peer.Flags = WireguardPeerFlags(buf.DecodeUint8())
	m.Peer.NAllowedIps = buf.DecodeUint8()
	m.Peer.AllowedIps = make([]ip_types.Prefix, m.Peer.NAllowedIps)
	for j1 := 0; j1 < len(m.Peer.AllowedIps); j1++ {
		m.Peer.AllowedIps[j1].Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
		copy(m.Peer.AllowedIps[j1].Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
		m.Peer.AllowedIps[j1].Len = buf.DecodeUint8()
	}
	return nil
}

// WireguardPeersDump defines message 'wireguard_peers_dump'.
// InProgress: the message form may change in the future versions
type WireguardPeersDump struct{}

func (m *WireguardPeersDump) Reset()               { *m = WireguardPeersDump{} }
func (*WireguardPeersDump) GetMessageName() string { return "wireguard_peers_dump" }
func (*WireguardPeersDump) GetCrcString() string   { return "51077d14" }
func (*WireguardPeersDump) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *WireguardPeersDump) Size() (size int) {
	if m == nil {
		return 0
	}
	return size
}
func (m *WireguardPeersDump) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	return buf.Bytes(), nil
}
func (m *WireguardPeersDump) Unmarshal(b []byte) error {
	return nil
}

func init() { file_wireguard_binapi_init() }
func file_wireguard_binapi_init() {
	api.RegisterMessage((*WireguardInterfaceCreate)(nil), "wireguard_interface_create_a530137e")
	api.RegisterMessage((*WireguardInterfaceCreateReply)(nil), "wireguard_interface_create_reply_5383d31f")
	api.RegisterMessage((*WireguardInterfaceDelete)(nil), "wireguard_interface_delete_f9e6675e")
	api.RegisterMessage((*WireguardInterfaceDeleteReply)(nil), "wireguard_interface_delete_reply_e8d4e804")
	api.RegisterMessage((*WireguardInterfaceDetails)(nil), "wireguard_interface_details_0dd4865d")
	api.RegisterMessage((*WireguardInterfaceDump)(nil), "wireguard_interface_dump_2c954158")
	api.RegisterMessage((*WireguardPeerAdd)(nil), "wireguard_peer_add_ed792326")
	api.RegisterMessage((*WireguardPeerAddReply)(nil), "wireguard_peer_add_reply_084a0cd3")
	api.RegisterMessage((*WireguardPeerRemove)(nil), "wireguard_peer_remove_3b74607a")
	api.RegisterMessage((*WireguardPeerRemoveReply)(nil), "wireguard_peer_remove_reply_e8d4e804")
	api.RegisterMessage((*WireguardPeersDetails)(nil), "wireguard_peers_details_2097f740")
	api.RegisterMessage((*WireguardPeersDump)(nil), "wireguard_peers_dump_51077d14")
}

// Messages returns list of all messages in this module.
func AllMessages() []api.Message {
	return []api.Message{
		(*WireguardInterfaceCreate)(nil),
		(*WireguardInterfaceCreateReply)(nil),
		(*WireguardInterfaceDelete)(nil),
		(*WireguardInterfaceDeleteReply)(nil),
		(*WireguardInterfaceDetails)(nil),
		(*WireguardInterfaceDump)(nil),
		(*WireguardPeerAdd)(nil),
		(*WireguardPeerAddReply)(nil),
		(*WireguardPeerRemove)(nil),
		(*WireguardPeerRemoveReply)(nil),
		(*WireguardPeersDetails)(nil),
		(*WireguardPeersDump)(nil),
	}
}