summaryrefslogtreecommitdiffstats
path: root/binapi/bfd
diff options
context:
space:
mode:
authorOndrej Fabry <ofabry@cisco.com>2020-07-17 10:36:28 +0200
committerOndrej Fabry <ofabry@cisco.com>2020-07-17 11:43:41 +0200
commitd1f24d37bd447b64e402298bb8eb2479681facf9 (patch)
treea3fc21ba730a91d8a402c7a5bf9c614e3677c4fc /binapi/bfd
parent1548c7e12531e3d055567d761c580a1c7ff0ac40 (diff)
Improve binapi generator
- simplified Size/Marshal/Unmarshal methods - replace struc in unions with custom marshal/unmarshal - fix imports in generated files - fix mock adapter - generate rpc service using low-level stream API (dumps generate control ping or stream msg..) - move examples/binapi to binapi and generate all API for latest release - add binapigen.Plugin for developing custom generator plugins - optionally generate HTTP handlers (REST API) for RPC services - add govpp program for browsing VPP API Change-Id: I092e9ed2b0c17972b3476463c3d4b14dd76ed42b Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Diffstat (limited to 'binapi/bfd')
-rw-r--r--binapi/bfd/bfd.ba.go1346
-rw-r--r--binapi/bfd/bfd_rest.ba.go272
-rw-r--r--binapi/bfd/bfd_rpc.ba.go223
3 files changed, 1841 insertions, 0 deletions
diff --git a/binapi/bfd/bfd.ba.go b/binapi/bfd/bfd.ba.go
new file mode 100644
index 0000000..2b4f5f0
--- /dev/null
+++ b/binapi/bfd/bfd.ba.go
@@ -0,0 +1,1346 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-dev
+// VPP: 20.05-release
+// source: /usr/share/vpp/api/core/bfd.api.json
+
+// Package bfd contains generated bindings for API file bfd.api.
+//
+// Contents:
+// 1 enum
+// 28 messages
+//
+package bfd
+
+import (
+ 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"
+ "strconv"
+)
+
+// 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 = "bfd"
+ APIVersion = "2.0.0"
+ VersionCrc = 0xc92fd028
+)
+
+// BfdState defines enum 'bfd_state'.
+type BfdState uint32
+
+const (
+ BFD_STATE_API_ADMIN_DOWN BfdState = 0
+ BFD_STATE_API_DOWN BfdState = 1
+ BFD_STATE_API_INIT BfdState = 2
+ BFD_STATE_API_UP BfdState = 3
+)
+
+var (
+ BfdState_name = map[uint32]string{
+ 0: "BFD_STATE_API_ADMIN_DOWN",
+ 1: "BFD_STATE_API_DOWN",
+ 2: "BFD_STATE_API_INIT",
+ 3: "BFD_STATE_API_UP",
+ }
+ BfdState_value = map[string]uint32{
+ "BFD_STATE_API_ADMIN_DOWN": 0,
+ "BFD_STATE_API_DOWN": 1,
+ "BFD_STATE_API_INIT": 2,
+ "BFD_STATE_API_UP": 3,
+ }
+)
+
+func (x BfdState) String() string {
+ s, ok := BfdState_name[uint32(x)]
+ if ok {
+ return s
+ }
+ return "BfdState(" + strconv.Itoa(int(x)) + ")"
+}
+
+// BfdAuthDelKey defines message 'bfd_auth_del_key'.
+type BfdAuthDelKey struct {
+ ConfKeyID uint32 `binapi:"u32,name=conf_key_id" json:"conf_key_id,omitempty"`
+}
+
+func (m *BfdAuthDelKey) Reset() { *m = BfdAuthDelKey{} }
+func (*BfdAuthDelKey) GetMessageName() string { return "bfd_auth_del_key" }
+func (*BfdAuthDelKey) GetCrcString() string { return "65310b22" }
+func (*BfdAuthDelKey) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdAuthDelKey) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ size += 4 // m.ConfKeyID
+ return size
+}
+func (m *BfdAuthDelKey) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ buf.EncodeUint32(uint32(m.ConfKeyID))
+ return buf.Bytes(), nil
+}
+func (m *BfdAuthDelKey) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ConfKeyID = buf.DecodeUint32()
+ return nil
+}
+
+// BfdAuthDelKeyReply defines message 'bfd_auth_del_key_reply'.
+type BfdAuthDelKeyReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BfdAuthDelKeyReply) Reset() { *m = BfdAuthDelKeyReply{} }
+func (*BfdAuthDelKeyReply) GetMessageName() string { return "bfd_auth_del_key_reply" }
+func (*BfdAuthDelKeyReply) GetCrcString() string { return "e8d4e804" }
+func (*BfdAuthDelKeyReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdAuthDelKeyReply) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ size += 4 // m.Retval
+ return size
+}
+func (m *BfdAuthDelKeyReply) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ buf.EncodeUint32(uint32(m.Retval))
+ return buf.Bytes(), nil
+}
+func (m *BfdAuthDelKeyReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = int32(buf.DecodeUint32())
+ return nil
+}
+
+// BfdAuthKeysDetails defines message 'bfd_auth_keys_details'.
+type BfdAuthKeysDetails struct {
+ ConfKeyID uint32 `binapi:"u32,name=conf_key_id" json:"conf_key_id,omitempty"`
+ UseCount uint32 `binapi:"u32,name=use_count" json:"use_count,omitempty"`
+ AuthType uint8 `binapi:"u8,name=auth_type" json:"auth_type,omitempty"`
+}
+
+func (m *BfdAuthKeysDetails) Reset() { *m = BfdAuthKeysDetails{} }
+func (*BfdAuthKeysDetails) GetMessageName() string { return "bfd_auth_keys_details" }
+func (*BfdAuthKeysDetails) GetCrcString() string { return "84130e9f" }
+func (*BfdAuthKeysDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdAuthKeysDetails) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ size += 4 // m.ConfKeyID
+ size += 4 // m.UseCount
+ size += 1 // m.AuthType
+ return size
+}
+func (m *BfdAuthKeysDetails) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ buf.EncodeUint32(uint32(m.ConfKeyID))
+ buf.EncodeUint32(uint32(m.UseCount))
+ buf.EncodeUint8(uint8(m.AuthType))
+ return buf.Bytes(), nil
+}
+func (m *BfdAuthKeysDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ConfKeyID = buf.DecodeUint32()
+ m.UseCount = buf.DecodeUint32()
+ m.AuthType = buf.DecodeUint8()
+ return nil
+}
+
+// BfdAuthKeysDump defines message 'bfd_auth_keys_dump'.
+type BfdAuthKeysDump struct{}
+
+func (m *BfdAuthKeysDump) Reset() { *m = BfdAuthKeysDump{} }
+func (*BfdAuthKeysDump) GetMessageName() string { return "bfd_auth_keys_dump" }
+func (*BfdAuthKeysDump) GetCrcString() string { return "51077d14" }
+func (*BfdAuthKeysDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdAuthKeysDump) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ return size
+}
+func (m *BfdAuthKeysDump) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ return buf.Bytes(), nil
+}
+func (m *BfdAuthKeysDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// BfdAuthSetKey defines message 'bfd_auth_set_key'.
+type BfdAuthSetKey struct {
+ ConfKeyID uint32 `binapi:"u32,name=conf_key_id" json:"conf_key_id,omitempty"`
+ KeyLen uint8 `binapi:"u8,name=key_len" json:"key_len,omitempty"`
+ AuthType uint8 `binapi:"u8,name=auth_type" json:"auth_type,omitempty"`
+ Key []byte `binapi:"u8[20],name=key" json:"key,omitempty"`
+}
+
+func (m *BfdAuthSetKey) Reset() { *m = BfdAuthSetKey{} }
+func (*BfdAuthSetKey) GetMessageName() string { return "bfd_auth_set_key" }
+func (*BfdAuthSetKey) GetCrcString() string { return "690b8877" }
+func (*BfdAuthSetKey) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdAuthSetKey) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ size += 4 // m.ConfKeyID
+ size += 1 // m.KeyLen
+ size += 1 // m.AuthType
+ size += 1 * 20 // m.Key
+ return size
+}
+func (m *BfdAuthSetKey) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ buf.EncodeUint32(uint32(m.ConfKeyID))
+ buf.EncodeUint8(uint8(m.KeyLen))
+ buf.EncodeUint8(uint8(m.AuthType))
+ buf.EncodeBytes(m.Key[:], 20)
+ return buf.Bytes(), nil
+}
+func (m *BfdAuthSetKey) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ConfKeyID = buf.DecodeUint32()
+ m.KeyLen = buf.DecodeUint8()
+ m.AuthType = buf.DecodeUint8()
+ copy(m.Key[:], buf.DecodeBytes(20))
+ return nil
+}
+
+// BfdAuthSetKeyReply defines message 'bfd_auth_set_key_reply'.
+type BfdAuthSetKeyReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BfdAuthSetKeyReply) Reset() { *m = BfdAuthSetKeyReply{} }
+func (*BfdAuthSetKeyReply) GetMessageName() string { return "bfd_auth_set_key_reply" }
+func (*BfdAuthSetKeyReply) GetCrcString() string { return "e8d4e804" }
+func (*BfdAuthSetKeyReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdAuthSetKeyReply) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ size += 4 // m.Retval
+ return size
+}
+func (m *BfdAuthSetKeyReply) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ buf.EncodeUint32(uint32(m.Retval))
+ return buf.Bytes(), nil
+}
+func (m *BfdAuthSetKeyReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = int32(buf.DecodeUint32())
+ return nil
+}
+
+// BfdUDPAdd defines message 'bfd_udp_add'.
+type BfdUDPAdd struct {
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ DesiredMinTx uint32 `binapi:"u32,name=desired_min_tx" json:"desired_min_tx,omitempty"`
+ RequiredMinRx uint32 `binapi:"u32,name=required_min_rx" json:"required_min_rx,omitempty"`
+ LocalAddr ip_types.Address `binapi:"address,name=local_addr" json:"local_addr,omitempty"`
+ PeerAddr ip_types.Address `binapi:"address,name=peer_addr" json:"peer_addr,omitempty"`
+ DetectMult uint8 `binapi:"u8,name=detect_mult" json:"detect_mult,omitempty"`
+ IsAuthenticated bool `binapi:"bool,name=is_authenticated" json:"is_authenticated,omitempty"`
+ BfdKeyID uint8 `binapi:"u8,name=bfd_key_id" json:"bfd_key_id,omitempty"`
+ ConfKeyID uint32 `binapi:"u32,name=conf_key_id" json:"conf_key_id,omitempty"`
+}
+
+func (m *BfdUDPAdd) Reset() { *m = BfdUDPAdd{} }
+func (*BfdUDPAdd) GetMessageName() string { return "bfd_udp_add" }
+func (*BfdUDPAdd) GetCrcString() string { return "7a6d1185" }
+func (*BfdUDPAdd) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdUDPAdd) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ size += 4 // m.SwIfIndex
+ size += 4 // m.DesiredMinTx
+ size += 4 // m.RequiredMinRx
+ size += 1 // m.LocalAddr.Af
+ size += 1 * 16 // m.LocalAddr.Un
+ size += 1 // m.PeerAddr.Af
+ size += 1 * 16 // m.PeerAddr.Un
+ size += 1 // m.DetectMult
+ size += 1 // m.IsAuthenticated
+ size += 1 // m.BfdKeyID
+ size += 4 // m.ConfKeyID
+ return size
+}
+func (m *BfdUDPAdd) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(uint32(m.DesiredMinTx))
+ buf.EncodeUint32(uint32(m.RequiredMinRx))
+ buf.EncodeUint8(uint8(m.LocalAddr.Af))
+ buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeUint8(uint8(m.PeerAddr.Af))
+ buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeUint8(uint8(m.DetectMult))
+ buf.EncodeBool(m.IsAuthenticated)
+ buf.EncodeUint8(uint8(m.BfdKeyID))
+ buf.EncodeUint32(uint32(m.ConfKeyID))
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPAdd) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
+ m.DesiredMinTx = buf.DecodeUint32()
+ m.RequiredMinRx = buf.DecodeUint32()
+ m.LocalAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
+ copy(m.LocalAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.PeerAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
+ copy(m.PeerAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.DetectMult = buf.DecodeUint8()
+ m.IsAuthenticated = buf.DecodeBool()
+ m.BfdKeyID = buf.DecodeUint8()
+ m.ConfKeyID = buf.DecodeUint32()
+ return nil
+}
+
+// BfdUDPAddReply defines message 'bfd_udp_add_reply'.
+type BfdUDPAddReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BfdUDPAddReply) Reset() { *m = BfdUDPAddReply{} }
+func (*BfdUDPAddReply) GetMessageName() string { return "bfd_udp_add_reply" }
+func (*BfdUDPAddReply) GetCrcString() string { return "e8d4e804" }
+func (*BfdUDPAddReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdUDPAddReply) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ size += 4 // m.Retval
+ return size
+}
+func (m *BfdUDPAddReply) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ buf.EncodeUint32(uint32(m.Retval))
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPAddReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = int32(buf.DecodeUint32())
+ return nil
+}
+
+// BfdUDPAuthActivate defines message 'bfd_udp_auth_activate'.
+type BfdUDPAuthActivate struct {
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ LocalAddr ip_types.Address `binapi:"address,name=local_addr" json:"local_addr,omitempty"`
+ PeerAddr ip_types.Address `binapi:"address,name=peer_addr" json:"peer_addr,omitempty"`
+ IsDelayed bool `binapi:"bool,name=is_delayed" json:"is_delayed,omitempty"`
+ BfdKeyID uint8 `binapi:"u8,name=bfd_key_id" json:"bfd_key_id,omitempty"`
+ ConfKeyID uint32 `binapi:"u32,name=conf_key_id" json:"conf_key_id,omitempty"`
+}
+
+func (m *BfdUDPAuthActivate) Reset() { *m = BfdUDPAuthActivate{} }
+func (*BfdUDPAuthActivate) GetMessageName() string { return "bfd_udp_auth_activate" }
+func (*BfdUDPAuthActivate) GetCrcString() string { return "493ee0ec" }
+func (*BfdUDPAuthActivate) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdUDPAuthActivate) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ size += 4 // m.SwIfIndex
+ size += 1 // m.LocalAddr.Af
+ size += 1 * 16 // m.LocalAddr.Un
+ size += 1 // m.PeerAddr.Af
+ size += 1 * 16 // m.PeerAddr.Un
+ size += 1 // m.IsDelayed
+ size += 1 // m.BfdKeyID
+ size += 4 // m.ConfKeyID
+ return size
+}
+func (m *BfdUDPAuthActivate) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint8(uint8(m.LocalAddr.Af))
+ buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeUint8(uint8(m.PeerAddr.Af))
+ buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeBool(m.IsDelayed)
+ buf.EncodeUint8(uint8(m.BfdKeyID))
+ buf.EncodeUint32(uint32(m.ConfKeyID))
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPAuthActivate) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
+ m.LocalAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
+ copy(m.LocalAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.PeerAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
+ copy(m.PeerAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.IsDelayed = buf.DecodeBool()
+ m.BfdKeyID = buf.DecodeUint8()
+ m.ConfKeyID = buf.DecodeUint32()
+ return nil
+}
+
+// BfdUDPAuthActivateReply defines message 'bfd_udp_auth_activate_reply'.
+type BfdUDPAuthActivateReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BfdUDPAuthActivateReply) Reset() { *m = BfdUDPAuthActivateReply{} }
+func (*BfdUDPAuthActivateReply) GetMessageName() string { return "bfd_udp_auth_activate_reply" }
+func (*BfdUDPAuthActivateReply) GetCrcString() string { return "e8d4e804" }
+func (*BfdUDPAuthActivateReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdUDPAuthActivateReply) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ size += 4 // m.Retval
+ return size
+}
+func (m *BfdUDPAuthActivateReply) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ buf.EncodeUint32(uint32(m.Retval))
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPAuthActivateReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = int32(buf.DecodeUint32())
+ return nil
+}
+
+// BfdUDPAuthDeactivate defines message 'bfd_udp_auth_deactivate'.
+type BfdUDPAuthDeactivate struct {
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ LocalAddr ip_types.Address `binapi:"address,name=local_addr" json:"local_addr,omitempty"`
+ PeerAddr ip_types.Address `binapi:"address,name=peer_addr" json:"peer_addr,omitempty"`
+ IsDelayed bool `binapi:"bool,name=is_delayed" json:"is_delayed,omitempty"`
+}
+
+func (m *BfdUDPAuthDeactivate) Reset() { *m = BfdUDPAuthDeactivate{} }
+func (*BfdUDPAuthDeactivate) GetMessageName() string { return "bfd_udp_auth_deactivate" }
+func (*BfdUDPAuthDeactivate) GetCrcString() string { return "99978c32" }
+func (*BfdUDPAuthDeactivate) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdUDPAuthDeactivate) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ size += 4 // m.SwIfIndex
+ size += 1 // m.LocalAddr.Af
+ size += 1 * 16 // m.LocalAddr.Un
+ size += 1 // m.PeerAddr.Af
+ size += 1 * 16 // m.PeerAddr.Un
+ size += 1 // m.IsDelayed
+ return size
+}
+func (m *BfdUDPAuthDeactivate) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint8(uint8(m.LocalAddr.Af))
+ buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeUint8(uint8(m.PeerAddr.Af))
+ buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeBool(m.IsDelayed)
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPAuthDeactivate) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
+ m.LocalAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
+ copy(m.LocalAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.PeerAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
+ copy(m.PeerAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.IsDelayed = buf.DecodeBool()
+ return nil
+}
+
+// BfdUDPAuthDeactivateReply defines message 'bfd_udp_auth_deactivate_reply'.
+type BfdUDPAuthDeactivateReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BfdUDPAuthDeactivateReply) Reset() { *m = BfdUDPAuthDeactivateReply{} }
+func (*BfdUDPAuthDeactivateReply) GetMessageName() string { return "bfd_udp_auth_deactivate_reply" }
+func (*BfdUDPAuthDeactivateReply) GetCrcString() string { return "e8d4e804" }
+func (*BfdUDPAuthDeactivateReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdUDPAuthDeactivateReply) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ size += 4 // m.Retval
+ return size
+}
+func (m *BfdUDPAuthDeactivateReply) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ buf.EncodeUint32(uint32(m.Retval))
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPAuthDeactivateReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = int32(buf.DecodeUint32())
+ return nil
+}
+
+// BfdUDPDel defines message 'bfd_udp_del'.
+type BfdUDPDel struct {
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ LocalAddr ip_types.Address `binapi:"address,name=local_addr" json:"local_addr,omitempty"`
+ PeerAddr ip_types.Address `binapi:"address,name=peer_addr" json:"peer_addr,omitempty"`
+}
+
+func (m *BfdUDPDel) Reset() { *m = BfdUDPDel{} }
+func (*BfdUDPDel) GetMessageName() string { return "bfd_udp_del" }
+func (*BfdUDPDel) GetCrcString() string { return "8096514d" }
+func (*BfdUDPDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdUDPDel) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ size += 4 // m.SwIfIndex
+ size += 1 // m.LocalAddr.Af
+ size += 1 * 16 // m.LocalAddr.Un
+ size += 1 // m.PeerAddr.Af
+ size += 1 * 16 // m.PeerAddr.Un
+ return size
+}
+func (m *BfdUDPDel) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint8(uint8(m.LocalAddr.Af))
+ buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeUint8(uint8(m.PeerAddr.Af))
+ buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 0)
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
+ m.LocalAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
+ copy(m.LocalAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.PeerAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
+ copy(m.PeerAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ return nil
+}
+
+// BfdUDPDelEchoSource defines message 'bfd_udp_del_echo_source'.
+type BfdUDPDelEchoSource struct{}
+
+func (m *BfdUDPDelEchoSource) Reset() { *m = BfdUDPDelEchoSource{} }
+func (*BfdUDPDelEchoSource) GetMessageName() string { return "bfd_udp_del_echo_source" }
+func (*BfdUDPDelEchoSource) GetCrcString() string { return "51077d14" }
+func (*BfdUDPDelEchoSource) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdUDPDelEchoSource) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ return size
+}
+func (m *BfdUDPDelEchoSource) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPDelEchoSource) Unmarshal(b []byte) error {
+ return nil
+}
+
+// BfdUDPDelEchoSourceReply defines message 'bfd_udp_del_echo_source_reply'.
+type BfdUDPDelEchoSourceReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BfdUDPDelEchoSourceReply) Reset() { *m = BfdUDPDelEchoSourceReply{} }
+func (*BfdUDPDelEchoSourceReply) GetMessageName() string { return "bfd_udp_del_echo_source_reply" }
+func (*BfdUDPDelEchoSourceReply) GetCrcString() string { return "e8d4e804" }
+func (*BfdUDPDelEchoSourceReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdUDPDelEchoSourceReply) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ size += 4 // m.Retval
+ return size
+}
+func (m *BfdUDPDelEchoSourceReply) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ buf.EncodeUint32(uint32(m.Retval))
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPDelEchoSourceReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = int32(buf.DecodeUint32())
+ return nil
+}
+
+// BfdUDPDelReply defines message 'bfd_udp_del_reply'.
+type BfdUDPDelReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BfdUDPDelReply) Reset() { *m = BfdUDPDelReply{} }
+func (*BfdUDPDelReply) GetMessageName() string { return "bfd_udp_del_reply" }
+func (*BfdUDPDelReply) GetCrcString() string { return "e8d4e804" }
+func (*BfdUDPDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdUDPDelReply) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ size += 4 // m.Retval
+ return size
+}
+func (m *BfdUDPDelReply) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ buf.EncodeUint32(uint32(m.Retval))
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPDelReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = int32(buf.DecodeUint32())
+ return nil
+}
+
+// BfdUDPGetEchoSource defines message 'bfd_udp_get_echo_source'.
+type BfdUDPGetEchoSource struct{}
+
+func (m *BfdUDPGetEchoSource) Reset() { *m = BfdUDPGetEchoSource{} }
+func (*BfdUDPGetEchoSource) GetMessageName() string { return "bfd_udp_get_echo_source" }
+func (*BfdUDPGetEchoSource) GetCrcString() string { return "51077d14" }
+func (*BfdUDPGetEchoSource) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdUDPGetEchoSource) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ return size
+}
+func (m *BfdUDPGetEchoSource) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPGetEchoSource) Unmarshal(b []byte) error {
+ return nil
+}
+
+// BfdUDPGetEchoSourceReply defines message 'bfd_udp_get_echo_source_reply'.
+type BfdUDPGetEchoSourceReply 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"`
+ IsSet bool `binapi:"bool,name=is_set" json:"is_set,omitempty"`
+ HaveUsableIP4 bool `binapi:"bool,name=have_usable_ip4" json:"have_usable_ip4,omitempty"`
+ IP4Addr ip_types.IP4Address `binapi:"ip4_address,name=ip4_addr" json:"ip4_addr,omitempty"`
+ HaveUsableIP6 bool `binapi:"bool,name=have_usable_ip6" json:"have_usable_ip6,omitempty"`
+ IP6Addr ip_types.IP6Address `binapi:"ip6_address,name=ip6_addr" json:"ip6_addr,omitempty"`
+}
+
+func (m *BfdUDPGetEchoSourceReply) Reset() { *m = BfdUDPGetEchoSourceReply{} }
+func (*BfdUDPGetEchoSourceReply) GetMessageName() string { return "bfd_udp_get_echo_source_reply" }
+func (*BfdUDPGetEchoSourceReply) GetCrcString() string { return "1e00cfce" }
+func (*BfdUDPGetEchoSourceReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdUDPGetEchoSourceReply) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsSet
+ size += 1 // m.HaveUsableIP4
+ size += 1 * 4 // m.IP4Addr
+ size += 1 // m.HaveUsableIP6
+ size += 1 * 16 // m.IP6Addr
+ return size
+}
+func (m *BfdUDPGetEchoSourceReply) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ buf.EncodeUint32(uint32(m.Retval))
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.IsSet)
+ buf.EncodeBool(m.HaveUsableIP4)
+ buf.EncodeBytes(m.IP4Addr[:], 4)
+ buf.EncodeBool(m.HaveUsableIP6)
+ buf.EncodeBytes(m.IP6Addr[:], 16)
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPGetEchoSourceReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = int32(buf.DecodeUint32())
+ m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
+ m.IsSet = buf.DecodeBool()
+ m.HaveUsableIP4 = buf.DecodeBool()
+ copy(m.IP4Addr[:], buf.DecodeBytes(4))
+ m.HaveUsableIP6 = buf.DecodeBool()
+ copy(m.IP6Addr[:], buf.DecodeBytes(16))
+ return nil
+}
+
+// BfdUDPMod defines message 'bfd_udp_mod'.
+type BfdUDPMod struct {
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ DesiredMinTx uint32 `binapi:"u32,name=desired_min_tx" json:"desired_min_tx,omitempty"`
+ RequiredMinRx uint32 `binapi:"u32,name=required_min_rx" json:"required_min_rx,omitempty"`
+ LocalAddr ip_types.Address `binapi:"address,name=local_addr" json:"local_addr,omitempty"`
+ PeerAddr ip_types.Address `binapi:"address,name=peer_addr" json:"peer_addr,omitempty"`
+ DetectMult uint8 `binapi:"u8,name=detect_mult" json:"detect_mult,omitempty"`
+}
+
+func (m *BfdUDPMod) Reset() { *m = BfdUDPMod{} }
+func (*BfdUDPMod) GetMessageName() string { return "bfd_udp_mod" }
+func (*BfdUDPMod) GetCrcString() string { return "783a3ff6" }
+func (*BfdUDPMod) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdUDPMod) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ size += 4 // m.SwIfIndex
+ size += 4 // m.DesiredMinTx
+ size += 4 // m.RequiredMinRx
+ size += 1 // m.LocalAddr.Af
+ size += 1 * 16 // m.LocalAddr.Un
+ size += 1 // m.PeerAddr.Af
+ size += 1 * 16 // m.PeerAddr.Un
+ size += 1 // m.DetectMult
+ return size
+}
+func (m *BfdUDPMod) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(uint32(m.DesiredMinTx))
+ buf.EncodeUint32(uint32(m.RequiredMinRx))
+ buf.EncodeUint8(uint8(m.LocalAddr.Af))
+ buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeUint8(uint8(m.PeerAddr.Af))
+ buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeUint8(uint8(m.DetectMult))
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPMod) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
+ m.DesiredMinTx = buf.DecodeUint32()
+ m.RequiredMinRx = buf.DecodeUint32()
+ m.LocalAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
+ copy(m.LocalAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.PeerAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
+ copy(m.PeerAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.DetectMult = buf.DecodeUint8()
+ return nil
+}
+
+// BfdUDPModReply defines message 'bfd_udp_mod_reply'.
+type BfdUDPModReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BfdUDPModReply) Reset() { *m = BfdUDPModReply{} }
+func (*BfdUDPModReply) GetMessageName() string { return "bfd_udp_mod_reply" }
+func (*BfdUDPModReply) GetCrcString() string { return "e8d4e804" }
+func (*BfdUDPModReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdUDPModReply) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ size += 4 // m.Retval
+ return size
+}
+func (m *BfdUDPModReply) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ buf.EncodeUint32(uint32(m.Retval))
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPModReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = int32(buf.DecodeUint32())
+ return nil
+}
+
+// BfdUDPSessionDetails defines message 'bfd_udp_session_details'.
+type BfdUDPSessionDetails struct {
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ LocalAddr ip_types.Address `binapi:"address,name=local_addr" json:"local_addr,omitempty"`
+ PeerAddr ip_types.Address `binapi:"address,name=peer_addr" json:"peer_addr,omitempty"`
+ State BfdState `binapi:"bfd_state,name=state" json:"state,omitempty"`
+ IsAuthenticated bool `binapi:"bool,name=is_authenticated" json:"is_authenticated,omitempty"`
+ BfdKeyID uint8 `binapi:"u8,name=bfd_key_id" json:"bfd_key_id,omitempty"`
+ ConfKeyID uint32 `binapi:"u32,name=conf_key_id" json:"conf_key_id,omitempty"`
+ RequiredMinRx uint32 `binapi:"u32,name=required_min_rx" json:"required_min_rx,omitempty"`
+ DesiredMinTx uint32 `binapi:"u32,name=desired_min_tx" json:"desired_min_tx,omitempty"`
+ DetectMult uint8 `binapi:"u8,name=detect_mult" json:"detect_mult,omitempty"`
+}
+
+func (m *BfdUDPSessionDetails) Reset() { *m = BfdUDPSessionDetails{} }
+func (*BfdUDPSessionDetails) GetMessageName() string { return "bfd_udp_session_details" }
+func (*BfdUDPSessionDetails) GetCrcString() string { return "60653c02" }
+func (*BfdUDPSessionDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdUDPSessionDetails) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ size += 4 // m.SwIfIndex
+ size += 1 // m.LocalAddr.Af
+ size += 1 * 16 // m.LocalAddr.Un
+ size += 1 // m.PeerAddr.Af
+ size += 1 * 16 // m.PeerAddr.Un
+ size += 4 // m.State
+ size += 1 // m.IsAuthenticated
+ size += 1 // m.BfdKeyID
+ size += 4 // m.ConfKeyID
+ size += 4 // m.RequiredMinRx
+ size += 4 // m.DesiredMinTx
+ size += 1 // m.DetectMult
+ return size
+}
+func (m *BfdUDPSessionDetails) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint8(uint8(m.LocalAddr.Af))
+ buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeUint8(uint8(m.PeerAddr.Af))
+ buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeUint32(uint32(m.State))
+ buf.EncodeBool(m.IsAuthenticated)
+ buf.EncodeUint8(uint8(m.BfdKeyID))
+ buf.EncodeUint32(uint32(m.ConfKeyID))
+ buf.EncodeUint32(uint32(m.RequiredMinRx))
+ buf.EncodeUint32(uint32(m.DesiredMinTx))
+ buf.EncodeUint8(uint8(m.DetectMult))
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPSessionDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
+ m.LocalAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
+ copy(m.LocalAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.PeerAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
+ copy(m.PeerAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.State = BfdState(buf.DecodeUint32())
+ m.IsAuthenticated = buf.DecodeBool()
+ m.BfdKeyID = buf.DecodeUint8()
+ m.ConfKeyID = buf.DecodeUint32()
+ m.RequiredMinRx = buf.DecodeUint32()
+ m.DesiredMinTx = buf.DecodeUint32()
+ m.DetectMult = buf.DecodeUint8()
+ return nil
+}
+
+// BfdUDPSessionDump defines message 'bfd_udp_session_dump'.
+type BfdUDPSessionDump struct{}
+
+func (m *BfdUDPSessionDump) Reset() { *m = BfdUDPSessionDump{} }
+func (*BfdUDPSessionDump) GetMessageName() string { return "bfd_udp_session_dump" }
+func (*BfdUDPSessionDump) GetCrcString() string { return "51077d14" }
+func (*BfdUDPSessionDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdUDPSessionDump) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ return size
+}
+func (m *BfdUDPSessionDump) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPSessionDump) Unmarshal(b []byte) error {
+ return nil
+}
+
+// BfdUDPSessionSetFlags defines message 'bfd_udp_session_set_flags'.
+type BfdUDPSessionSetFlags struct {
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ LocalAddr ip_types.Address `binapi:"address,name=local_addr" json:"local_addr,omitempty"`
+ PeerAddr ip_types.Address `binapi:"address,name=peer_addr" json:"peer_addr,omitempty"`
+ Flags interface_types.IfStatusFlags `binapi:"if_status_flags,name=flags" json:"flags,omitempty"`
+}
+
+func (m *BfdUDPSessionSetFlags) Reset() { *m = BfdUDPSessionSetFlags{} }
+func (*BfdUDPSessionSetFlags) GetMessageName() string { return "bfd_udp_session_set_flags" }
+func (*BfdUDPSessionSetFlags) GetCrcString() string { return "cf313851" }
+func (*BfdUDPSessionSetFlags) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdUDPSessionSetFlags) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ size += 4 // m.SwIfIndex
+ size += 1 // m.LocalAddr.Af
+ size += 1 * 16 // m.LocalAddr.Un
+ size += 1 // m.PeerAddr.Af
+ size += 1 * 16 // m.PeerAddr.Un
+ size += 4 // m.Flags
+ return size
+}
+func (m *BfdUDPSessionSetFlags) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint8(uint8(m.LocalAddr.Af))
+ buf.EncodeBytes(m.LocalAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeUint8(uint8(m.PeerAddr.Af))
+ buf.EncodeBytes(m.PeerAddr.Un.XXX_UnionData[:], 0)
+ buf.EncodeUint32(uint32(m.Flags))
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPSessionSetFlags) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
+ m.LocalAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
+ copy(m.LocalAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.PeerAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
+ copy(m.PeerAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Flags = interface_types.IfStatusFlags(buf.DecodeUint32())
+ return nil
+}
+
+// BfdUDPSessionSetFlagsReply defines message 'bfd_udp_session_set_flags_reply'.
+type BfdUDPSessionSetFlagsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BfdUDPSessionSetFlagsReply) Reset() { *m = BfdUDPSessionSetFlagsReply{} }
+func (*BfdUDPSessionSetFlagsReply) GetMessageName() string { return "bfd_udp_session_set_flags_reply" }
+func (*BfdUDPSessionSetFlagsReply) GetCrcString() string { return "e8d4e804" }
+func (*BfdUDPSessionSetFlagsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdUDPSessionSetFlagsReply) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ size += 4 // m.Retval
+ return size
+}
+func (m *BfdUDPSessionSetFlagsReply) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ buf.EncodeUint32(uint32(m.Retval))
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPSessionSetFlagsReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = int32(buf.DecodeUint32())
+ return nil
+}
+
+// BfdUDPSetEchoSource defines message 'bfd_udp_set_echo_source'.
+type BfdUDPSetEchoSource struct {
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *BfdUDPSetEchoSource) Reset() { *m = BfdUDPSetEchoSource{} }
+func (*BfdUDPSetEchoSource) GetMessageName() string { return "bfd_udp_set_echo_source" }
+func (*BfdUDPSetEchoSource) GetCrcString() string { return "f9e6675e" }
+func (*BfdUDPSetEchoSource) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *BfdUDPSetEchoSource) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *BfdUDPSetEchoSource) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPSetEchoSource) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
+// BfdUDPSetEchoSourceReply defines message 'bfd_udp_set_echo_source_reply'.
+type BfdUDPSetEchoSourceReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *BfdUDPSetEchoSourceReply) Reset() { *m = BfdUDPSetEchoSourceReply{} }
+func (*BfdUDPSetEchoSourceReply) GetMessageName() string { return "bfd_udp_set_echo_source_reply" }
+func (*BfdUDPSetEchoSourceReply) GetCrcString() string { return "e8d4e804" }
+func (*BfdUDPSetEchoSourceReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *BfdUDPSetEchoSourceReply) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ size += 4 // m.Retval
+ return size
+}
+func (m *BfdUDPSetEchoSourceReply) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ buf.EncodeUint32(uint32(m.Retval))
+ return buf.Bytes(), nil
+}
+func (m *BfdUDPSetEchoSourceReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = int32(buf.DecodeUint32())
+ return nil
+}
+
+// WantBfdEvents defines message 'want_bfd_events'.
+type WantBfdEvents struct {
+ EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
+ PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
+}
+
+func (m *WantBfdEvents) Reset() { *m = WantBfdEvents{} }
+func (*WantBfdEvents) GetMessageName() string { return "want_bfd_events" }
+func (*WantBfdEvents) GetCrcString() string { return "c5e2af94" }
+func (*WantBfdEvents) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *WantBfdEvents) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ size += 1 // m.EnableDisable
+ size += 4 // m.PID
+ return size
+}
+func (m *WantBfdEvents) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ buf.EncodeBool(m.EnableDisable)
+ buf.EncodeUint32(uint32(m.PID))
+ return buf.Bytes(), nil
+}
+func (m *WantBfdEvents) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.EnableDisable = buf.DecodeBool()
+ m.PID = buf.DecodeUint32()
+ return nil
+}
+
+// WantBfdEventsReply defines message 'want_bfd_events_reply'.
+type WantBfdEventsReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *WantBfdEventsReply) Reset() { *m = WantBfdEventsReply{} }
+func (*WantBfdEventsReply) GetMessageName() string { return "want_bfd_events_reply" }
+func (*WantBfdEventsReply) GetCrcString() string { return "e8d4e804" }
+func (*WantBfdEventsReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *WantBfdEventsReply) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ size += 4 // m.Retval
+ return size
+}
+func (m *WantBfdEventsReply) Marshal(b []byte) ([]byte, error) {
+ var buf *codec.Buffer
+ if b == nil {
+ buf = codec.NewBuffer(make([]byte, m.Size()))
+ } else {
+ buf = codec.NewBuffer(b)
+ }
+ buf.EncodeUint32(uint32(m.Retval))
+ return buf.Bytes(), nil
+}
+func (m *WantBfdEventsReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = int32(buf.DecodeUint32())
+ return nil
+}
+
+func init() { file_bfd_binapi_init() }
+func file_bfd_binapi_init() {
+ api.RegisterMessage((*BfdAuthDelKey)(nil), "bfd_auth_del_key_65310b22")
+ api.RegisterMessage((*BfdAuthDelKeyReply)(nil), "bfd_auth_del_key_reply_e8d4e804")
+ api.RegisterMessage((*BfdAuthKeysDetails)(nil), "bfd_auth_keys_details_84130e9f")
+ api.RegisterMessage((*BfdAuthKeysDump)(nil), "bfd_auth_keys_dump_51077d14")
+ api.RegisterMessage((*BfdAuthSetKey)(nil), "bfd_auth_set_key_690b8877")
+ api.RegisterMessage((*BfdAuthSetKeyReply)(nil), "bfd_auth_set_key_reply_e8d4e804")
+ api.RegisterMessage((*BfdUDPAdd)(nil), "bfd_udp_add_7a6d1185")
+ api.RegisterMessage((*BfdUDPAddReply)(nil), "bfd_udp_add_reply_e8d4e804")
+ api.RegisterMessage((*BfdUDPAuthActivate)(nil), "bfd_udp_auth_activate_493ee0ec")
+ api.RegisterMessage((*BfdUDPAuthActivateReply)(nil), "bfd_udp_auth_activate_reply_e8d4e804")
+ api.RegisterMessage((*BfdUDPAuthDeactivate)(nil), "bfd_udp_auth_deactivate_99978c32")
+ api.RegisterMessage((*BfdUDPAuthDeactivateReply)(nil), "bfd_udp_auth_deactivate_reply_e8d4e804")
+ api.RegisterMessage((*BfdUDPDel)(nil), "bfd_udp_del_8096514d")
+ api.RegisterMessage((*BfdUDPDelEchoSource)(nil), "bfd_udp_del_echo_source_51077d14")
+ api.RegisterMessage((*BfdUDPDelEchoSourceReply)(nil), "bfd_udp_del_echo_source_reply_e8d4e804")
+ api.RegisterMessage((*BfdUDPDelReply)(nil), "bfd_udp_del_reply_e8d4e804")
+ api.RegisterMessage((*BfdUDPGetEchoSource)(nil), "bfd_udp_get_echo_source_51077d14")
+ api.RegisterMessage((*BfdUDPGetEchoSourceReply)(nil), "bfd_udp_get_echo_source_reply_1e00cfce")
+ api.RegisterMessage((*BfdUDPMod)(nil), "bfd_udp_mod_783a3ff6")
+ api.RegisterMessage((*BfdUDPModReply)(nil), "bfd_udp_mod_reply_e8d4e804")
+ api.RegisterMessage((*BfdUDPSessionDetails)(nil), "bfd_udp_session_details_60653c02")
+ api.RegisterMessage((*BfdUDPSessionDump)(nil), "bfd_udp_session_dump_51077d14")
+ api.RegisterMessage((*BfdUDPSessionSetFlags)(nil), "bfd_udp_session_set_flags_cf313851")
+ api.RegisterMessage((*BfdUDPSessionSetFlagsReply)(nil), "bfd_udp_session_set_flags_reply_e8d4e804")
+ api.RegisterMessage((*BfdUDPSetEchoSource)(nil), "bfd_udp_set_echo_source_f9e6675e")
+ api.RegisterMessage((*BfdUDPSetEchoSourceReply)(nil), "bfd_udp_set_echo_source_reply_e8d4e804")
+ api.RegisterMessage((*WantBfdEvents)(nil), "want_bfd_events_c5e2af94")
+ api.RegisterMessage((*WantBfdEventsReply)(nil), "want_bfd_events_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+ return []api.Message{
+ (*BfdAuthDelKey)(nil),
+ (*BfdAuthDelKeyReply)(nil),
+ (*BfdAuthKeysDetails)(nil),
+ (*BfdAuthKeysDump)(nil),
+ (*BfdAuthSetKey)(nil),
+ (*BfdAuthSetKeyReply)(nil),
+ (*BfdUDPAdd)(nil),
+ (*BfdUDPAddReply)(nil),
+ (*BfdUDPAuthActivate)(nil),
+ (*BfdUDPAuthActivateReply)(nil),
+ (*BfdUDPAuthDeactivate)(nil),
+ (*BfdUDPAuthDeactivateReply)(nil),
+ (*BfdUDPDel)(nil),
+ (*BfdUDPDelEchoSource)(nil),
+ (*BfdUDPDelEchoSourceReply)(nil),
+ (*BfdUDPDelReply)(nil),
+ (*BfdUDPGetEchoSource)(nil),
+ (*BfdUDPGetEchoSourceReply)(nil),
+ (*BfdUDPMod)(nil),
+ (*BfdUDPModReply)(nil),
+ (*BfdUDPSessionDetails)(nil),
+ (*BfdUDPSessionDump)(nil),
+ (*BfdUDPSessionSetFlags)(nil),
+ (*BfdUDPSessionSetFlagsReply)(nil),
+ (*BfdUDPSetEchoSource)(nil),
+ (*BfdUDPSetEchoSourceReply)(nil),
+ (*WantBfdEvents)(nil),
+ (*WantBfdEventsReply)(nil),
+ }
+}
diff --git a/binapi/bfd/bfd_rest.ba.go b/binapi/bfd/bfd_rest.ba.go
new file mode 100644
index 0000000..2f25f8b
--- /dev/null
+++ b/binapi/bfd/bfd_rest.ba.go
@@ -0,0 +1,272 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package bfd
+
+import (
+ "encoding/json"
+ "io/ioutil"
+ "net/http"
+)
+
+func RESTHandler(rpc RPCService) http.Handler {
+ mux := http.NewServeMux()
+ mux.HandleFunc("/bfd_auth_del_key", func(w http.ResponseWriter, req *http.Request) {
+ var request = new(BfdAuthDelKey)
+ b, err := ioutil.ReadAll(req.Body)
+ if err != nil {
+ http.Error(w, "read body failed", http.StatusBadRequest)
+ return
+ }
+ if err := json.Unmarshal(b, request); err != nil {
+ http.Error(w, "unmarshal data failed", http.StatusBadRequest)
+ return
+ }
+ reply, err := rpc.BfdAuthDelKey(req.Context(), request)
+ if err != nil {
+ http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+ rep, err := json.MarshalIndent(reply, "", " ")
+ if err != nil {
+ http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+ w.Write(rep)
+ })
+ mux.HandleFunc("/bfd_auth_set_key", func(w http.ResponseWriter, req *http.Request) {
+ var request = new(BfdAuthSetKey)
+ b, err := ioutil.ReadAll(req.Body)
+ if err != nil {
+ http.Error(w, "read body failed", http.StatusBadRequest)
+ return
+ }
+ if err := json.Unmarshal(b, request); err != nil {
+ http.Error(w, "unmarshal data failed", http.StatusBadRequest)
+ return
+ }
+ reply, err := rpc.BfdAuthSetKey(req.Context(), request)
+ if err != nil {
+ http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+ rep, err := json.MarshalIndent(reply, "", " ")
+ if err != nil {
+ http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+ w.Write(rep)
+ })
+ mux.HandleFunc("/bfd_udp_add", func(w http.ResponseWriter, req *http.Request) {
+ var request = new(BfdUDPAdd)
+ b, err := ioutil.ReadAll(req.Body)
+ if err != nil {
+ http.Error(w, "read body failed", http.StatusBadRequest)
+ return
+ }
+ if err := json.Unmarshal(b, request); err != nil {
+ http.Error(w, "unmarshal data failed", http.StatusBadRequest)
+ return
+ }
+ reply, err := rpc.BfdUDPAdd(req.Context(), request)
+ if err != nil {
+ http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+ rep, err := json.MarshalIndent(reply, "", " ")
+ if err != nil {
+ http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+ w.Write(rep)
+ })
+ mux.HandleFunc("/bfd_udp_auth_activate", func(w http.ResponseWriter, req *http.Request) {
+ var request = new(BfdUDPAuthActivate)
+ b, err := ioutil.ReadAll(req.Body)
+ if err != nil {
+ http.Error(w, "read body failed", http.StatusBadRequest)
+ return
+ }
+ if err := json.Unmarshal(b, request); err != nil {
+ http.Error(w, "unmarshal data failed", http.StatusBadRequest)
+ return
+ }
+ reply, err := rpc.BfdUDPAuthActivate(req.Context(), request)
+ if err != nil {
+ http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+ rep, err := json.MarshalIndent(reply, "", " ")
+ if err != nil {
+ http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+ w.Write(rep)
+ })
+ mux.HandleFunc("/bfd_udp_auth_deactivate", func(w http.ResponseWriter, req *http.Request) {
+ var request = new(BfdUDPAuthDeactivate)
+ b, err := ioutil.ReadAll(req.Body)
+ if err != nil {
+ http.Error(w, "read body failed", http.StatusBadRequest)
+ return
+ }
+ if err := json.Unmarshal(b, request); err != nil {
+ http.Error(w, "unmarshal data failed", http.StatusBadRequest)
+ return
+ }
+ reply, err := rpc.BfdUDPAuthDeactivate(req.Context(), request)
+ if err != nil {
+ http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+ rep, err := json.MarshalIndent(reply, "", " ")
+ if err != nil {
+ http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+ w.Write(rep)
+ })
+ mux.HandleFunc("/bfd_udp_del", func(w http.ResponseWriter, req *http.Request) {
+ var request = new(BfdUDPDel)
+ b, err := ioutil.ReadAll(req.Body)
+ if err != nil {
+ http.Error(w, "read body failed", http.StatusBadRequest)
+ return
+ }
+ if err := json.Unmarshal(b, request); err != nil {
+ http.Error(w, "unmarshal data failed", http.StatusBadRequest)
+ return
+ }
+ reply, err := rpc.BfdUDPDel(req.Context(), request)
+ if err != nil {
+ http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+ rep, err := json.MarshalIndent(reply, "", " ")
+ if err != nil {
+ http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+ w.Write(rep)
+ })
+ mux.HandleFunc("/bfd_udp_del_echo_source", func(w http.ResponseWriter, req *http.Request) {
+ var request = new(BfdUDPDelEchoSource)
+ reply, err := rpc.BfdUDPDelEchoSource(req.Context(), request)
+ if err != nil {
+ http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+ rep, err := json.MarshalIndent(reply, "", " ")
+ if err != nil {
+ http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+ w.Write(rep)
+ })
+ mux.HandleFunc("/bfd_udp_get_echo_source", func(w http.ResponseWriter, req *http.Request) {
+ var request = new(BfdUDPGetEchoSource)
+ reply, err := rpc.BfdUDPGetEchoSource(req.Context(), request)
+ if err != nil {
+ http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+ rep, err := json.MarshalIndent(reply, "", " ")
+ if err != nil {
+ http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+ w.Write(rep)
+ })
+ mux.HandleFunc("/bfd_udp_mod", func(w http.ResponseWriter, req *http.Request) {
+ var request = new(BfdUDPMod)
+ b, err := ioutil.ReadAll(req.Body)
+ if err != nil {
+ http.Error(w, "read body failed", http.StatusBadRequest)
+ return
+ }
+ if err := json.Unmarshal(b, request); err != nil {
+ http.Error(w, "unmarshal data failed", http.StatusBadRequest)
+ return
+ }
+ reply, err := rpc.BfdUDPMod(req.Context(), request)
+ if err != nil {
+ http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+ rep, err := json.MarshalIndent(reply, "", " ")
+ if err != nil {
+ http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+ w.Write(rep)
+ })
+ mux.HandleFunc("/bfd_udp_session_set_flags", func(w http.ResponseWriter, req *http.Request) {
+ var request = new(BfdUDPSessionSetFlags)
+ b, err := ioutil.ReadAll(req.Body)
+ if err != nil {
+ http.Error(w, "read body failed", http.StatusBadRequest)
+ return
+ }
+ if err := json.Unmarshal(b, request); err != nil {
+ http.Error(w, "unmarshal data failed", http.StatusBadRequest)
+ return
+ }
+ reply, err := rpc.BfdUDPSessionSetFlags(req.Context(), request)
+ if err != nil {
+ http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+ rep, err := json.MarshalIndent(reply, "", " ")
+ if err != nil {
+ http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+ w.Write(rep)
+ })
+ mux.HandleFunc("/bfd_udp_set_echo_source", func(w http.ResponseWriter, req *http.Request) {
+ var request = new(BfdUDPSetEchoSource)
+ b, err := ioutil.ReadAll(req.Body)
+ if err != nil {
+ http.Error(w, "read body failed", http.StatusBadRequest)
+ return
+ }
+ if err := json.Unmarshal(b, request); err != nil {
+ http.Error(w, "unmarshal data failed", http.StatusBadRequest)
+ return
+ }
+ reply, err := rpc.BfdUDPSetEchoSource(req.Context(), request)
+ if err != nil {
+ http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+ rep, err := json.MarshalIndent(reply, "", " ")
+ if err != nil {
+ http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+ w.Write(rep)
+ })
+ mux.HandleFunc("/want_bfd_events", func(w http.ResponseWriter, req *http.Request) {
+ var request = new(WantBfdEvents)
+ b, err := ioutil.ReadAll(req.Body)
+ if err != nil {
+ http.Error(w, "read body failed", http.StatusBadRequest)
+ return
+ }
+ if err := json.Unmarshal(b, request); err != nil {
+ http.Error(w, "unmarshal data failed", http.StatusBadRequest)
+ return
+ }
+ reply, err := rpc.WantBfdEvents(req.Context(), request)
+ if err != nil {
+ http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+ rep, err := json.MarshalIndent(reply, "", " ")
+ if err != nil {
+ http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+ w.Write(rep)
+ })
+ return http.HandlerFunc(mux.ServeHTTP)
+}
diff --git a/binapi/bfd/bfd_rpc.ba.go b/binapi/bfd/bfd_rpc.ba.go
new file mode 100644
index 0000000..78cbd3a
--- /dev/null
+++ b/binapi/bfd/bfd_rpc.ba.go
@@ -0,0 +1,223 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package bfd
+
+import (
+ "context"
+ "fmt"
+ api "git.fd.io/govpp.git/api"
+ vpe "git.fd.io/govpp.git/binapi/vpe"
+ "io"
+)
+
+// RPCService defines RPC service bfd.
+type RPCService interface {
+ BfdAuthDelKey(ctx context.Context, in *BfdAuthDelKey) (*BfdAuthDelKeyReply, error)
+ BfdAuthKeysDump(ctx context.Context, in *BfdAuthKeysDump) (RPCService_BfdAuthKeysDumpClient, error)
+ BfdAuthSetKey(ctx context.Context, in *BfdAuthSetKey) (*BfdAuthSetKeyReply, error)
+ BfdUDPAdd(ctx context.Context, in *BfdUDPAdd) (*BfdUDPAddReply, error)
+ BfdUDPAuthActivate(ctx context.Context, in *BfdUDPAuthActivate) (*BfdUDPAuthActivateReply, error)
+ BfdUDPAuthDeactivate(ctx context.Context, in *BfdUDPAuthDeactivate) (*BfdUDPAuthDeactivateReply, error)
+ BfdUDPDel(ctx context.Context, in *BfdUDPDel) (*BfdUDPDelReply, error)
+ BfdUDPDelEchoSource(ctx context.Context, in *BfdUDPDelEchoSource) (*BfdUDPDelEchoSourceReply, error)
+ BfdUDPGetEchoSource(ctx context.Context, in *BfdUDPGetEchoSource) (*BfdUDPGetEchoSourceReply, error)
+ BfdUDPMod(ctx context.Context, in *BfdUDPMod) (*BfdUDPModReply, error)
+ BfdUDPSessionDump(ctx context.Context, in *BfdUDPSessionDump) (RPCService_BfdUDPSessionDumpClient, error)
+ BfdUDPSessionSetFlags(ctx context.Context, in *BfdUDPSessionSetFlags) (*BfdUDPSessionSetFlagsReply, error)
+ BfdUDPSetEchoSource(ctx context.Context, in *BfdUDPSetEchoSource) (*BfdUDPSetEchoSourceReply, error)
+ WantBfdEvents(ctx context.Context, in *WantBfdEvents) (*WantBfdEventsReply, error)
+}
+
+type serviceClient struct {
+ conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+ return &serviceClient{conn}
+}
+
+func (c *serviceClient) BfdAuthDelKey(ctx context.Context, in *BfdAuthDelKey) (*BfdAuthDelKeyReply, error) {
+ out := new(BfdAuthDelKeyReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BfdAuthKeysDump(ctx context.Context, in *BfdAuthKeysDump) (RPCService_BfdAuthKeysDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_BfdAuthKeysDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_BfdAuthKeysDumpClient interface {
+ Recv() (*BfdAuthKeysDetails, error)
+ api.Stream
+}
+
+type serviceClient_BfdAuthKeysDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_BfdAuthKeysDumpClient) Recv() (*BfdAuthKeysDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *BfdAuthKeysDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) BfdAuthSetKey(ctx context.Context, in *BfdAuthSetKey) (*BfdAuthSetKeyReply, error) {
+ out := new(BfdAuthSetKeyReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BfdUDPAdd(ctx context.Context, in *BfdUDPAdd) (*BfdUDPAddReply, error) {
+ out := new(BfdUDPAddReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BfdUDPAuthActivate(ctx context.Context, in *BfdUDPAuthActivate) (*BfdUDPAuthActivateReply, error) {
+ out := new(BfdUDPAuthActivateReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BfdUDPAuthDeactivate(ctx context.Context, in *BfdUDPAuthDeactivate) (*BfdUDPAuthDeactivateReply, error) {
+ out := new(BfdUDPAuthDeactivateReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BfdUDPDel(ctx context.Context, in *BfdUDPDel) (*BfdUDPDelReply, error) {
+ out := new(BfdUDPDelReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BfdUDPDelEchoSource(ctx context.Context, in *BfdUDPDelEchoSource) (*BfdUDPDelEchoSourceReply, error) {
+ out := new(BfdUDPDelEchoSourceReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BfdUDPGetEchoSource(ctx context.Context, in *BfdUDPGetEchoSource) (*BfdUDPGetEchoSourceReply, error) {
+ out := new(BfdUDPGetEchoSourceReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BfdUDPMod(ctx context.Context, in *BfdUDPMod) (*BfdUDPModReply, error) {
+ out := new(BfdUDPModReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BfdUDPSessionDump(ctx context.Context, in *BfdUDPSessionDump) (RPCService_BfdUDPSessionDumpClient, error) {
+ stream, err := c.conn.NewStream(ctx)
+ if err != nil {
+ return nil, err
+ }
+ x := &serviceClient_BfdUDPSessionDumpClient{stream}
+ if err := x.Stream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type RPCService_BfdUDPSessionDumpClient interface {
+ Recv() (*BfdUDPSessionDetails, error)
+ api.Stream
+}
+
+type serviceClient_BfdUDPSessionDumpClient struct {
+ api.Stream
+}
+
+func (c *serviceClient_BfdUDPSessionDumpClient) Recv() (*BfdUDPSessionDetails, error) {
+ msg, err := c.Stream.RecvMsg()
+ if err != nil {
+ return nil, err
+ }
+ switch m := msg.(type) {
+ case *BfdUDPSessionDetails:
+ return m, nil
+ case *vpe.ControlPingReply:
+ return nil, io.EOF
+ default:
+ return nil, fmt.Errorf("unexpected message: %T %v", m, m)
+ }
+}
+
+func (c *serviceClient) BfdUDPSessionSetFlags(ctx context.Context, in *BfdUDPSessionSetFlags) (*BfdUDPSessionSetFlagsReply, error) {
+ out := new(BfdUDPSessionSetFlagsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) BfdUDPSetEchoSource(ctx context.Context, in *BfdUDPSetEchoSource) (*BfdUDPSetEchoSourceReply, error) {
+ out := new(BfdUDPSetEchoSourceReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *serviceClient) WantBfdEvents(ctx context.Context, in *WantBfdEvents) (*WantBfdEventsReply, error) {
+ out := new(WantBfdEventsReply)
+ err := c.conn.Invoke(ctx, in, out)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}