diff options
author | mhalaj1 <matus.halaj@pantheon.tech> | 2021-08-26 13:10:48 +0200 |
---|---|---|
committer | mhalaj1 <matus.halaj@pantheon.tech> | 2021-08-26 13:10:48 +0200 |
commit | debc52dea8a81417bb08ca5bb934c7876b6d65e0 (patch) | |
tree | 23909430d78d6b77c2b414814e843708a6bab08e /binapi/fib | |
parent | c0da1f2999a6b08d003c0fed1a23e1ca60dd1571 (diff) |
regenerate binapi
Signed-off-by: mhalaj1 <matus.halaj@pantheon.tech>
Change-Id: I9bb6a5ca00aa542128bde0bfbbba7b57b9f16ed2
Diffstat (limited to 'binapi/fib')
-rw-r--r-- | binapi/fib/fib.ba.go | 199 | ||||
-rw-r--r-- | binapi/fib/fib_rpc.ba.go | 74 |
2 files changed, 273 insertions, 0 deletions
diff --git a/binapi/fib/fib.ba.go b/binapi/fib/fib.ba.go new file mode 100644 index 0000000..f805aa3 --- /dev/null +++ b/binapi/fib/fib.ba.go @@ -0,0 +1,199 @@ +// Code generated by GoVPP's binapi-generator. DO NOT EDIT. +// versions: +// binapi-generator: v0.3.5-56-gc0da1f2-dirty +// VPP: 21.06-release +// source: /usr/share/vpp/api/core/fib.api.json + +// Package fib contains generated bindings for API file fib.api. +// +// Contents: +// 1 struct +// 4 messages +// +package fib + +import ( + api "git.fd.io/govpp.git/api" + _ "git.fd.io/govpp.git/binapi/fib_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 = "fib" + APIVersion = "1.0.0" + VersionCrc = 0x4ef4abc1 +) + +// FibSource defines type 'fib_source'. +type FibSource struct { + Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"` + ID uint8 `binapi:"u8,name=id" json:"id,omitempty"` + Name string `binapi:"string[64],name=name" json:"name,omitempty"` +} + +// FibSourceAdd defines message 'fib_source_add'. +type FibSourceAdd struct { + Src FibSource `binapi:"fib_source,name=src" json:"src,omitempty"` +} + +func (m *FibSourceAdd) Reset() { *m = FibSourceAdd{} } +func (*FibSourceAdd) GetMessageName() string { return "fib_source_add" } +func (*FibSourceAdd) GetCrcString() string { return "b3ac2aec" } +func (*FibSourceAdd) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *FibSourceAdd) Size() (size int) { + if m == nil { + return 0 + } + size += 1 // m.Src.Priority + size += 1 // m.Src.ID + size += 64 // m.Src.Name + return size +} +func (m *FibSourceAdd) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.Src.Priority) + buf.EncodeUint8(m.Src.ID) + buf.EncodeString(m.Src.Name, 64) + return buf.Bytes(), nil +} +func (m *FibSourceAdd) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Src.Priority = buf.DecodeUint8() + m.Src.ID = buf.DecodeUint8() + m.Src.Name = buf.DecodeString(64) + return nil +} + +// FibSourceAddReply defines message 'fib_source_add_reply'. +type FibSourceAddReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + ID uint8 `binapi:"u8,name=id" json:"id,omitempty"` +} + +func (m *FibSourceAddReply) Reset() { *m = FibSourceAddReply{} } +func (*FibSourceAddReply) GetMessageName() string { return "fib_source_add_reply" } +func (*FibSourceAddReply) GetCrcString() string { return "604fd6f1" } +func (*FibSourceAddReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *FibSourceAddReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 1 // m.ID + return size +} +func (m *FibSourceAddReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint8(m.ID) + return buf.Bytes(), nil +} +func (m *FibSourceAddReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.ID = buf.DecodeUint8() + return nil +} + +// FibSourceDetails defines message 'fib_source_details'. +type FibSourceDetails struct { + Src FibSource `binapi:"fib_source,name=src" json:"src,omitempty"` +} + +func (m *FibSourceDetails) Reset() { *m = FibSourceDetails{} } +func (*FibSourceDetails) GetMessageName() string { return "fib_source_details" } +func (*FibSourceDetails) GetCrcString() string { return "8668acdb" } +func (*FibSourceDetails) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *FibSourceDetails) Size() (size int) { + if m == nil { + return 0 + } + size += 1 // m.Src.Priority + size += 1 // m.Src.ID + size += 64 // m.Src.Name + return size +} +func (m *FibSourceDetails) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.Src.Priority) + buf.EncodeUint8(m.Src.ID) + buf.EncodeString(m.Src.Name, 64) + return buf.Bytes(), nil +} +func (m *FibSourceDetails) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Src.Priority = buf.DecodeUint8() + m.Src.ID = buf.DecodeUint8() + m.Src.Name = buf.DecodeString(64) + return nil +} + +// FibSourceDump defines message 'fib_source_dump'. +type FibSourceDump struct{} + +func (m *FibSourceDump) Reset() { *m = FibSourceDump{} } +func (*FibSourceDump) GetMessageName() string { return "fib_source_dump" } +func (*FibSourceDump) GetCrcString() string { return "51077d14" } +func (*FibSourceDump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *FibSourceDump) Size() (size int) { + if m == nil { + return 0 + } + return size +} +func (m *FibSourceDump) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + return buf.Bytes(), nil +} +func (m *FibSourceDump) Unmarshal(b []byte) error { + return nil +} + +func init() { file_fib_binapi_init() } +func file_fib_binapi_init() { + api.RegisterMessage((*FibSourceAdd)(nil), "fib_source_add_b3ac2aec") + api.RegisterMessage((*FibSourceAddReply)(nil), "fib_source_add_reply_604fd6f1") + api.RegisterMessage((*FibSourceDetails)(nil), "fib_source_details_8668acdb") + api.RegisterMessage((*FibSourceDump)(nil), "fib_source_dump_51077d14") +} + +// Messages returns list of all messages in this module. +func AllMessages() []api.Message { + return []api.Message{ + (*FibSourceAdd)(nil), + (*FibSourceAddReply)(nil), + (*FibSourceDetails)(nil), + (*FibSourceDump)(nil), + } +} diff --git a/binapi/fib/fib_rpc.ba.go b/binapi/fib/fib_rpc.ba.go new file mode 100644 index 0000000..245663b --- /dev/null +++ b/binapi/fib/fib_rpc.ba.go @@ -0,0 +1,74 @@ +// Code generated by GoVPP's binapi-generator. DO NOT EDIT. + +package fib + +import ( + "context" + "fmt" + "io" + + api "git.fd.io/govpp.git/api" + vpe "git.fd.io/govpp.git/binapi/vpe" +) + +// RPCService defines RPC service fib. +type RPCService interface { + FibSourceAdd(ctx context.Context, in *FibSourceAdd) (*FibSourceAddReply, error) + FibSourceDump(ctx context.Context, in *FibSourceDump) (RPCService_FibSourceDumpClient, error) +} + +type serviceClient struct { + conn api.Connection +} + +func NewServiceClient(conn api.Connection) RPCService { + return &serviceClient{conn} +} + +func (c *serviceClient) FibSourceAdd(ctx context.Context, in *FibSourceAdd) (*FibSourceAddReply, error) { + out := new(FibSourceAddReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) FibSourceDump(ctx context.Context, in *FibSourceDump) (RPCService_FibSourceDumpClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_FibSourceDumpClient{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_FibSourceDumpClient interface { + Recv() (*FibSourceDetails, error) + api.Stream +} + +type serviceClient_FibSourceDumpClient struct { + api.Stream +} + +func (c *serviceClient_FibSourceDumpClient) Recv() (*FibSourceDetails, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *FibSourceDetails: + return m, nil + case *vpe.ControlPingReply: + return nil, io.EOF + default: + return nil, fmt.Errorf("unexpected message: %T %v", m, m) + } +} |