From c4522fe10317b1729a0820dc880afc78c663f64d Mon Sep 17 00:00:00 2001 From: Ondrej Fabry Date: Thu, 6 Jun 2019 14:08:48 +0200 Subject: Add various generator improvements - generate service implementation for modules - generate conversion maps and String() method for enums - generate module name and version as constants - rename Union_data field to XXX_UnionData for consistency - generate constant GoVppAPIPackageIsVersionN for checking compatibility with API - add example for using service clients - add some documentation to socketclient adapter - cleanup gen.go file used for generating binapi - regenerate binapi with latest VPP release (19.04.1) - change global variables Messages into a function AllMessages Change-Id: Id1ef97764570759eaa3e5a4dc14ecda7a168ee39 Signed-off-by: Ondrej Fabry --- examples/bin_api/tap/tap.ba.go | 189 ----------------------------------------- 1 file changed, 189 deletions(-) delete mode 100644 examples/bin_api/tap/tap.ba.go (limited to 'examples/bin_api/tap') diff --git a/examples/bin_api/tap/tap.ba.go b/examples/bin_api/tap/tap.ba.go deleted file mode 100644 index 04ae411..0000000 --- a/examples/bin_api/tap/tap.ba.go +++ /dev/null @@ -1,189 +0,0 @@ -// Code generated by GoVPP binapi-generator. DO NOT EDIT. -// source: tap.api.json - -/* - Package tap is a generated from VPP binary API module 'tap'. - - It contains following objects: - 4 services - 8 messages -*/ -package tap - -import api "git.fd.io/govpp.git/api" -import struc "github.com/lunixbochs/struc" -import bytes "bytes" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = api.RegisterMessage -var _ = struc.Pack -var _ = bytes.NewBuffer - -// Services represents VPP binary API services: -type Services interface { - DumpSwInterfaceTap(*SwInterfaceTapDump) ([]*SwInterfaceTapDetails, error) - TapConnect(*TapConnect) (*TapConnectReply, error) - TapDelete(*TapDelete) (*TapDeleteReply, error) - TapModify(*TapModify) (*TapModifyReply, error) -} - -/* Messages */ - -// SwInterfaceTapDetails represents VPP binary API message 'sw_interface_tap_details': -type SwInterfaceTapDetails struct { - SwIfIndex uint32 - DevName []byte `struc:"[64]byte"` -} - -func (*SwInterfaceTapDetails) GetMessageName() string { - return "sw_interface_tap_details" -} -func (*SwInterfaceTapDetails) GetCrcString() string { - return "76229a57" -} -func (*SwInterfaceTapDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceTapDump represents VPP binary API message 'sw_interface_tap_dump': -type SwInterfaceTapDump struct{} - -func (*SwInterfaceTapDump) GetMessageName() string { - return "sw_interface_tap_dump" -} -func (*SwInterfaceTapDump) GetCrcString() string { - return "51077d14" -} -func (*SwInterfaceTapDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// TapConnect represents VPP binary API message 'tap_connect': -type TapConnect struct { - UseRandomMac uint8 - TapName []byte `struc:"[64]byte"` - MacAddress []byte `struc:"[6]byte"` - Renumber uint8 - CustomDevInstance uint32 - IP4AddressSet uint8 - IP4Address []byte `struc:"[4]byte"` - IP4MaskWidth uint8 - IP6AddressSet uint8 - IP6Address []byte `struc:"[16]byte"` - IP6MaskWidth uint8 - Tag []byte `struc:"[64]byte"` -} - -func (*TapConnect) GetMessageName() string { - return "tap_connect" -} -func (*TapConnect) GetCrcString() string { - return "9b9c396f" -} -func (*TapConnect) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// TapConnectReply represents VPP binary API message 'tap_connect_reply': -type TapConnectReply struct { - Retval int32 - SwIfIndex uint32 -} - -func (*TapConnectReply) GetMessageName() string { - return "tap_connect_reply" -} -func (*TapConnectReply) GetCrcString() string { - return "fda5941f" -} -func (*TapConnectReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// TapDelete represents VPP binary API message 'tap_delete': -type TapDelete struct { - SwIfIndex uint32 -} - -func (*TapDelete) GetMessageName() string { - return "tap_delete" -} -func (*TapDelete) GetCrcString() string { - return "529cb13f" -} -func (*TapDelete) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// TapDeleteReply represents VPP binary API message 'tap_delete_reply': -type TapDeleteReply struct { - Retval int32 -} - -func (*TapDeleteReply) GetMessageName() string { - return "tap_delete_reply" -} -func (*TapDeleteReply) GetCrcString() string { - return "e8d4e804" -} -func (*TapDeleteReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// TapModify represents VPP binary API message 'tap_modify': -type TapModify struct { - SwIfIndex uint32 - UseRandomMac uint8 - TapName []byte `struc:"[64]byte"` - MacAddress []byte `struc:"[6]byte"` - Renumber uint8 - CustomDevInstance uint32 -} - -func (*TapModify) GetMessageName() string { - return "tap_modify" -} -func (*TapModify) GetCrcString() string { - return "8047ae5c" -} -func (*TapModify) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// TapModifyReply represents VPP binary API message 'tap_modify_reply': -type TapModifyReply struct { - Retval int32 - SwIfIndex uint32 -} - -func (*TapModifyReply) GetMessageName() string { - return "tap_modify_reply" -} -func (*TapModifyReply) GetCrcString() string { - return "fda5941f" -} -func (*TapModifyReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func init() { - api.RegisterMessage((*SwInterfaceTapDetails)(nil), "tap.SwInterfaceTapDetails") - api.RegisterMessage((*SwInterfaceTapDump)(nil), "tap.SwInterfaceTapDump") - api.RegisterMessage((*TapConnect)(nil), "tap.TapConnect") - api.RegisterMessage((*TapConnectReply)(nil), "tap.TapConnectReply") - api.RegisterMessage((*TapDelete)(nil), "tap.TapDelete") - api.RegisterMessage((*TapDeleteReply)(nil), "tap.TapDeleteReply") - api.RegisterMessage((*TapModify)(nil), "tap.TapModify") - api.RegisterMessage((*TapModifyReply)(nil), "tap.TapModifyReply") -} - -var Messages = []api.Message{ - (*SwInterfaceTapDetails)(nil), - (*SwInterfaceTapDump)(nil), - (*TapConnect)(nil), - (*TapConnectReply)(nil), - (*TapDelete)(nil), - (*TapDeleteReply)(nil), - (*TapModify)(nil), - (*TapModifyReply)(nil), -} -- cgit 1.2.3-korg