diff options
Diffstat (limited to 'binapi/lacp')
-rw-r--r-- | binapi/lacp/lacp.ba.go | 183 | ||||
-rw-r--r-- | binapi/lacp/lacp_rest.ba.go | 12 | ||||
-rw-r--r-- | binapi/lacp/lacp_rpc.ba.go | 63 |
3 files changed, 258 insertions, 0 deletions
diff --git a/binapi/lacp/lacp.ba.go b/binapi/lacp/lacp.ba.go new file mode 100644 index 0000000..92fd933 --- /dev/null +++ b/binapi/lacp/lacp.ba.go @@ -0,0 +1,183 @@ +// 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/plugins/lacp.api.json + +// Package lacp contains generated bindings for API file lacp.api. +// +// Contents: +// 2 messages +// +package lacp + +import ( + api "git.fd.io/govpp.git/api" + ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types" + interface_types "git.fd.io/govpp.git/binapi/interface_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 = "lacp" + APIVersion = "2.0.0" + VersionCrc = 0x461bf09e +) + +// SwInterfaceLacpDetails defines message 'sw_interface_lacp_details'. +type SwInterfaceLacpDetails struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + InterfaceName string `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"` + RxState uint32 `binapi:"u32,name=rx_state" json:"rx_state,omitempty"` + TxState uint32 `binapi:"u32,name=tx_state" json:"tx_state,omitempty"` + MuxState uint32 `binapi:"u32,name=mux_state" json:"mux_state,omitempty"` + PtxState uint32 `binapi:"u32,name=ptx_state" json:"ptx_state,omitempty"` + BondInterfaceName string `binapi:"string[64],name=bond_interface_name" json:"bond_interface_name,omitempty"` + ActorSystemPriority uint16 `binapi:"u16,name=actor_system_priority" json:"actor_system_priority,omitempty"` + ActorSystem ethernet_types.MacAddress `binapi:"mac_address,name=actor_system" json:"actor_system,omitempty"` + ActorKey uint16 `binapi:"u16,name=actor_key" json:"actor_key,omitempty"` + ActorPortPriority uint16 `binapi:"u16,name=actor_port_priority" json:"actor_port_priority,omitempty"` + ActorPortNumber uint16 `binapi:"u16,name=actor_port_number" json:"actor_port_number,omitempty"` + ActorState uint8 `binapi:"u8,name=actor_state" json:"actor_state,omitempty"` + PartnerSystemPriority uint16 `binapi:"u16,name=partner_system_priority" json:"partner_system_priority,omitempty"` + PartnerSystem ethernet_types.MacAddress `binapi:"mac_address,name=partner_system" json:"partner_system,omitempty"` + PartnerKey uint16 `binapi:"u16,name=partner_key" json:"partner_key,omitempty"` + PartnerPortPriority uint16 `binapi:"u16,name=partner_port_priority" json:"partner_port_priority,omitempty"` + PartnerPortNumber uint16 `binapi:"u16,name=partner_port_number" json:"partner_port_number,omitempty"` + PartnerState uint8 `binapi:"u8,name=partner_state" json:"partner_state,omitempty"` +} + +func (m *SwInterfaceLacpDetails) Reset() { *m = SwInterfaceLacpDetails{} } +func (*SwInterfaceLacpDetails) GetMessageName() string { return "sw_interface_lacp_details" } +func (*SwInterfaceLacpDetails) GetCrcString() string { return "745ae0ba" } +func (*SwInterfaceLacpDetails) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *SwInterfaceLacpDetails) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.SwIfIndex + size += 64 // m.InterfaceName + size += 4 // m.RxState + size += 4 // m.TxState + size += 4 // m.MuxState + size += 4 // m.PtxState + size += 64 // m.BondInterfaceName + size += 2 // m.ActorSystemPriority + size += 1 * 6 // m.ActorSystem + size += 2 // m.ActorKey + size += 2 // m.ActorPortPriority + size += 2 // m.ActorPortNumber + size += 1 // m.ActorState + size += 2 // m.PartnerSystemPriority + size += 1 * 6 // m.PartnerSystem + size += 2 // m.PartnerKey + size += 2 // m.PartnerPortPriority + size += 2 // m.PartnerPortNumber + size += 1 // m.PartnerState + return size +} +func (m *SwInterfaceLacpDetails) 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.EncodeString(m.InterfaceName, 64) + buf.EncodeUint32(uint32(m.RxState)) + buf.EncodeUint32(uint32(m.TxState)) + buf.EncodeUint32(uint32(m.MuxState)) + buf.EncodeUint32(uint32(m.PtxState)) + buf.EncodeString(m.BondInterfaceName, 64) + buf.EncodeUint16(uint16(m.ActorSystemPriority)) + buf.EncodeBytes(m.ActorSystem[:], 6) + buf.EncodeUint16(uint16(m.ActorKey)) + buf.EncodeUint16(uint16(m.ActorPortPriority)) + buf.EncodeUint16(uint16(m.ActorPortNumber)) + buf.EncodeUint8(uint8(m.ActorState)) + buf.EncodeUint16(uint16(m.PartnerSystemPriority)) + buf.EncodeBytes(m.PartnerSystem[:], 6) + buf.EncodeUint16(uint16(m.PartnerKey)) + buf.EncodeUint16(uint16(m.PartnerPortPriority)) + buf.EncodeUint16(uint16(m.PartnerPortNumber)) + buf.EncodeUint8(uint8(m.PartnerState)) + return buf.Bytes(), nil +} +func (m *SwInterfaceLacpDetails) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.InterfaceName = buf.DecodeString(64) + m.RxState = buf.DecodeUint32() + m.TxState = buf.DecodeUint32() + m.MuxState = buf.DecodeUint32() + m.PtxState = buf.DecodeUint32() + m.BondInterfaceName = buf.DecodeString(64) + m.ActorSystemPriority = buf.DecodeUint16() + copy(m.ActorSystem[:], buf.DecodeBytes(6)) + m.ActorKey = buf.DecodeUint16() + m.ActorPortPriority = buf.DecodeUint16() + m.ActorPortNumber = buf.DecodeUint16() + m.ActorState = buf.DecodeUint8() + m.PartnerSystemPriority = buf.DecodeUint16() + copy(m.PartnerSystem[:], buf.DecodeBytes(6)) + m.PartnerKey = buf.DecodeUint16() + m.PartnerPortPriority = buf.DecodeUint16() + m.PartnerPortNumber = buf.DecodeUint16() + m.PartnerState = buf.DecodeUint8() + return nil +} + +// SwInterfaceLacpDump defines message 'sw_interface_lacp_dump'. +type SwInterfaceLacpDump struct{} + +func (m *SwInterfaceLacpDump) Reset() { *m = SwInterfaceLacpDump{} } +func (*SwInterfaceLacpDump) GetMessageName() string { return "sw_interface_lacp_dump" } +func (*SwInterfaceLacpDump) GetCrcString() string { return "51077d14" } +func (*SwInterfaceLacpDump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *SwInterfaceLacpDump) Size() int { + if m == nil { + return 0 + } + var size int + return size +} +func (m *SwInterfaceLacpDump) 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 *SwInterfaceLacpDump) Unmarshal(b []byte) error { + return nil +} + +func init() { file_lacp_binapi_init() } +func file_lacp_binapi_init() { + api.RegisterMessage((*SwInterfaceLacpDetails)(nil), "sw_interface_lacp_details_745ae0ba") + api.RegisterMessage((*SwInterfaceLacpDump)(nil), "sw_interface_lacp_dump_51077d14") +} + +// Messages returns list of all messages in this module. +func AllMessages() []api.Message { + return []api.Message{ + (*SwInterfaceLacpDetails)(nil), + (*SwInterfaceLacpDump)(nil), + } +} diff --git a/binapi/lacp/lacp_rest.ba.go b/binapi/lacp/lacp_rest.ba.go new file mode 100644 index 0000000..3512a0d --- /dev/null +++ b/binapi/lacp/lacp_rest.ba.go @@ -0,0 +1,12 @@ +// Code generated by GoVPP's binapi-generator. DO NOT EDIT. + +package lacp + +import ( + "net/http" +) + +func RESTHandler(rpc RPCService) http.Handler { + mux := http.NewServeMux() + return http.HandlerFunc(mux.ServeHTTP) +} diff --git a/binapi/lacp/lacp_rpc.ba.go b/binapi/lacp/lacp_rpc.ba.go new file mode 100644 index 0000000..00a00b5 --- /dev/null +++ b/binapi/lacp/lacp_rpc.ba.go @@ -0,0 +1,63 @@ +// Code generated by GoVPP's binapi-generator. DO NOT EDIT. + +package lacp + +import ( + "context" + "fmt" + api "git.fd.io/govpp.git/api" + vpe "git.fd.io/govpp.git/binapi/vpe" + "io" +) + +// RPCService defines RPC service lacp. +type RPCService interface { + SwInterfaceLacpDump(ctx context.Context, in *SwInterfaceLacpDump) (RPCService_SwInterfaceLacpDumpClient, error) +} + +type serviceClient struct { + conn api.Connection +} + +func NewServiceClient(conn api.Connection) RPCService { + return &serviceClient{conn} +} + +func (c *serviceClient) SwInterfaceLacpDump(ctx context.Context, in *SwInterfaceLacpDump) (RPCService_SwInterfaceLacpDumpClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_SwInterfaceLacpDumpClient{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_SwInterfaceLacpDumpClient interface { + Recv() (*SwInterfaceLacpDetails, error) + api.Stream +} + +type serviceClient_SwInterfaceLacpDumpClient struct { + api.Stream +} + +func (c *serviceClient_SwInterfaceLacpDumpClient) Recv() (*SwInterfaceLacpDetails, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *SwInterfaceLacpDetails: + return m, nil + case *vpe.ControlPingReply: + return nil, io.EOF + default: + return nil, fmt.Errorf("unexpected message: %T %v", m, m) + } +} |