From de8e6592e23a3819266cea5e9999c7c21fdd826f Mon Sep 17 00:00:00 2001 From: Ondrej Fabry Date: Mon, 4 Dec 2017 09:54:13 +0100 Subject: Fix events for mock adapter Change-Id: Iee5fa6282e845ed2aef76c9246a9068f3765139c Signed-off-by: Ondrej Fabry --- adapter/mock/mock_adapter.go | 33 +- api/api_test.go | 47 +- core/core_test.go | 19 +- core/msg_codec.go | 32 +- examples/bin_api/acl/acl.go | 59 +-- examples/bin_api/af_packet/af_packet.go | 11 +- examples/bin_api/interface.api.json | 177 ++++++- examples/bin_api/interfaces/interfaces.go | 710 ++++++++++++++++++++++++++-- examples/bin_api/ip/ip.go | 77 +-- examples/bin_api/memif/memif.go | 15 +- examples/bin_api/tap/tap.go | 19 +- examples/cmd/simple-client/simple_client.go | 2 +- examples/cmd/stats-client/stats_client.go | 2 +- 13 files changed, 1024 insertions(+), 179 deletions(-) diff --git a/adapter/mock/mock_adapter.go b/adapter/mock/mock_adapter.go index 5407696..8768725 100644 --- a/adapter/mock/mock_adapter.go +++ b/adapter/mock/mock_adapter.go @@ -22,6 +22,7 @@ import ( "reflect" "sync" + "git.fd.io/govpp.git/core" "github.com/lunixbochs/struc" "git.fd.io/govpp.git/adapter" @@ -40,24 +41,6 @@ type VppAdapter struct { access sync.RWMutex } -// replyHeader represents a common header of each VPP request message. -type requestHeader struct { - VlMsgID uint16 - ClientIndex uint32 - Context uint32 -} - -// replyHeader represents a common header of each VPP reply message. -type replyHeader struct { - VlMsgID uint16 - Context uint32 -} - -// otherHeader represents a common header of each VPP reply message. -type otherHeader struct { - VlMsgID uint16 -} - // defaultReply is a default reply message that mock adapter returns for a request. type defaultReply struct { Retval int32 @@ -175,7 +158,7 @@ func (a *VppAdapter) ReplyBytes(request MessageDTO, reply api.Message) ([]byte, log.Println("ReplyBytes ", replyMsgID, " ", reply.GetMessageName(), " clientId: ", request.ClientID) buf := new(bytes.Buffer) - struc.Pack(buf, &replyHeader{VlMsgID: replyMsgID, Context: request.ClientID}) + struc.Pack(buf, &core.VppReplyHeader{VlMsgID: replyMsgID, Context: request.ClientID}) struc.Pack(buf, reply) return buf.Bytes(), nil @@ -235,7 +218,7 @@ func (a *VppAdapter) SendMsg(clientID uint32, data []byte) error { replyHandler := replyHandlers[i] buf := bytes.NewReader(data) - reqHeader := requestHeader{} + reqHeader := core.VppRequestHeader{} struc.Unpack(buf, &reqHeader) a.access.Lock() @@ -265,9 +248,13 @@ func (a *VppAdapter) SendMsg(clientID uint32, data []byte) error { msgID, _ := a.GetMsgID(reply.GetMessageName(), reply.GetCrcString()) buf := new(bytes.Buffer) if reply.GetMessageType() == api.ReplyMessage { - struc.Pack(buf, &replyHeader{VlMsgID: msgID, Context: clientID}) + struc.Pack(buf, &core.VppReplyHeader{VlMsgID: msgID, Context: clientID}) + } else if reply.GetMessageType() == api.EventMessage { + struc.Pack(buf, &core.VppEventHeader{VlMsgID: msgID, Context: clientID}) + } else if reply.GetMessageType() == api.RequestMessage { + struc.Pack(buf, &core.VppRequestHeader{VlMsgID: msgID, Context: clientID}) } else { - struc.Pack(buf, &requestHeader{VlMsgID: msgID, Context: clientID}) + struc.Pack(buf, &core.VppOtherHeader{VlMsgID: msgID}) } struc.Pack(buf, reply) a.callback(clientID, msgID, buf.Bytes()) @@ -282,7 +269,7 @@ func (a *VppAdapter) SendMsg(clientID uint32, data []byte) error { // return default reply buf := new(bytes.Buffer) msgID := uint16(defaultReplyMsgID) - struc.Pack(buf, &replyHeader{VlMsgID: msgID, Context: clientID}) + struc.Pack(buf, &core.VppReplyHeader{VlMsgID: msgID, Context: clientID}) struc.Pack(buf, &defaultReply{}) a.callback(clientID, msgID, buf.Bytes()) } diff --git a/api/api_test.go b/api/api_test.go index 2a342f6..64c513c 100644 --- a/api/api_test.go +++ b/api/api_test.go @@ -263,16 +263,59 @@ func TestNotifications(t *testing.T) { ctx.mockVpp.SendMsg(0, []byte("")) // receive the notification - notif := (<-notifChan).(*interfaces.SwInterfaceSetFlags) + var notif *interfaces.SwInterfaceSetFlags + Eventually(func() *interfaces.SwInterfaceSetFlags { + select { + case n := <-notifChan: + notif = n.(*interfaces.SwInterfaceSetFlags) + return notif + default: + return nil + } + }).ShouldNot(BeNil()) // verify the received notifications - Expect(notif).ShouldNot(BeNil()) Expect(notif.SwIfIndex).To(BeEquivalentTo(3), "Incorrect SwIfIndex value for SwInterfaceSetFlags") Expect(notif.AdminUpDown).To(BeEquivalentTo(1), "Incorrect AdminUpDown value for SwInterfaceSetFlags") ctx.ch.UnsubscribeNotification(subs) } +func TestNotificationEvent(t *testing.T) { + ctx := setupTest(t) + defer ctx.teardownTest() + + // subscribe for notification + notifChan := make(chan api.Message, 1) + subs, err := ctx.ch.SubscribeNotification(notifChan, interfaces.NewSwInterfaceEvent) + Expect(err).ShouldNot(HaveOccurred()) + + // mock the notification and force its delivery + ctx.mockVpp.MockReply(&interfaces.SwInterfaceEvent{ + SwIfIndex: 2, + LinkUpDown: 1, + }) + ctx.mockVpp.SendMsg(0, []byte("")) + + // receive the notification + var notif *interfaces.SwInterfaceEvent + Eventually(func() *interfaces.SwInterfaceEvent { + select { + case n := <-notifChan: + notif = n.(*interfaces.SwInterfaceEvent) + return notif + default: + return nil + } + }).ShouldNot(BeNil()) + + // verify the received notifications + Expect(notif.SwIfIndex).To(BeEquivalentTo(2), "Incorrect SwIfIndex value for SwInterfaceSetFlags") + Expect(notif.LinkUpDown).To(BeEquivalentTo(1), "Incorrect LinkUpDown value for SwInterfaceSetFlags") + + ctx.ch.UnsubscribeNotification(subs) +} + func TestCheckMessageCompatibility(t *testing.T) { ctx := setupTest(t) defer ctx.teardownTest() diff --git a/core/core_test.go b/core/core_test.go index 3184ef5..37c0b9c 100644 --- a/core/core_test.go +++ b/core/core_test.go @@ -12,13 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -package core +package core_test import ( "testing" "git.fd.io/govpp.git/adapter/mock" "git.fd.io/govpp.git/api" + "git.fd.io/govpp.git/core" "git.fd.io/govpp.git/core/bin_api/vpe" "git.fd.io/govpp.git/examples/bin_api/interfaces" @@ -27,7 +28,7 @@ import ( type testCtx struct { mockVpp *mock.VppAdapter - conn *Connection + conn *core.Connection ch *api.Channel } @@ -38,7 +39,7 @@ func setupTest(t *testing.T) *testCtx { ctx.mockVpp = &mock.VppAdapter{} var err error - ctx.conn, err = Connect(ctx.mockVpp) + ctx.conn, err = core.Connect(ctx.mockVpp) Expect(err).ShouldNot(HaveOccurred()) ctx.ch, err = ctx.conn.NewAPIChannel() @@ -146,7 +147,7 @@ func TestNotifications(t *testing.T) { func TestNilConnection(t *testing.T) { RegisterTestingT(t) - var conn *Connection + var conn *core.Connection ch, err := conn.NewAPIChannel() Expect(ch).Should(BeNil()) @@ -163,7 +164,7 @@ func TestDoubleConnection(t *testing.T) { ctx := setupTest(t) defer ctx.teardownTest() - conn, err := Connect(ctx.mockVpp) + conn, err := core.Connect(ctx.mockVpp) Expect(err).Should(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("only one connection per process")) Expect(conn).Should(BeNil()) @@ -174,14 +175,14 @@ func TestAsyncConnection(t *testing.T) { defer ctx.teardownTest() ctx.conn.Disconnect() - conn, ch, err := AsyncConnect(ctx.mockVpp) + conn, ch, err := core.AsyncConnect(ctx.mockVpp) ctx.conn = conn Expect(err).ShouldNot(HaveOccurred()) Expect(conn).ShouldNot(BeNil()) ev := <-ch - Expect(ev.State).Should(BeEquivalentTo(Connected)) + Expect(ev.State).Should(BeEquivalentTo(core.Connected)) } func TestFullBuffer(t *testing.T) { @@ -218,7 +219,7 @@ func TestFullBuffer(t *testing.T) { func TestCodec(t *testing.T) { RegisterTestingT(t) - codec := &MsgCodec{} + codec := &core.MsgCodec{} // request data, err := codec.EncodeMsg(&vpe.CreateLoopback{MacAddress: []byte{1, 2, 3, 4, 5, 6}}, 11) @@ -254,7 +255,7 @@ func TestCodec(t *testing.T) { func TestCodecNegative(t *testing.T) { RegisterTestingT(t) - codec := &MsgCodec{} + codec := &core.MsgCodec{} // nil message for encoding data, err := codec.EncodeMsg(nil, 15) diff --git a/core/msg_codec.go b/core/msg_codec.go index c72b7f3..3887e3f 100644 --- a/core/msg_codec.go +++ b/core/msg_codec.go @@ -30,27 +30,27 @@ import ( // binary format as accepted by VPP. type MsgCodec struct{} -// vppRequestHeader struct contains header fields implemented by all VPP requests. -type vppRequestHeader struct { +// VppRequestHeader struct contains header fields implemented by all VPP requests. +type VppRequestHeader struct { VlMsgID uint16 ClientIndex uint32 Context uint32 } -// vppReplyHeader struct contains header fields implemented by all VPP replies. -type vppReplyHeader struct { +// VppReplyHeader struct contains header fields implemented by all VPP replies. +type VppReplyHeader struct { VlMsgID uint16 Context uint32 } -// vppEventHeader struct contains header fields implemented by all VPP events. -type vppEventHeader struct { +// VppEventHeader struct contains header fields implemented by all VPP events. +type VppEventHeader struct { VlMsgID uint16 Context uint32 } -// vppOtherHeader struct contains header fields implemented by other VPP messages (not requests nor replies). -type vppOtherHeader struct { +// VppOtherHeader struct contains header fields implemented by other VPP messages (not requests nor replies). +type VppOtherHeader struct { VlMsgID uint16 } @@ -72,13 +72,13 @@ func (*MsgCodec) EncodeMsg(msg api.Message, msgID uint16) ([]byte, error) { // encode message header var header interface{} if msg.GetMessageType() == api.RequestMessage { - header = &vppRequestHeader{VlMsgID: msgID} + header = &VppRequestHeader{VlMsgID: msgID} } else if msg.GetMessageType() == api.ReplyMessage { - header = &vppReplyHeader{VlMsgID: msgID} + header = &VppReplyHeader{VlMsgID: msgID} } else if msg.GetMessageType() == api.EventMessage { - header = &vppEventHeader{VlMsgID: msgID} + header = &VppEventHeader{VlMsgID: msgID} } else { - header = &vppOtherHeader{VlMsgID: msgID} + header = &VppOtherHeader{VlMsgID: msgID} } err := struc.Pack(buf, header) if err != nil { @@ -115,13 +115,13 @@ func (*MsgCodec) DecodeMsg(data []byte, msg api.Message) error { // check which header is expected var header interface{} if msg.GetMessageType() == api.RequestMessage { - header = &vppRequestHeader{} + header = &VppRequestHeader{} } else if msg.GetMessageType() == api.ReplyMessage { - header = &vppReplyHeader{} + header = &VppReplyHeader{} } else if msg.GetMessageType() == api.EventMessage { - header = &vppEventHeader{} + header = &VppEventHeader{} } else { - header = &vppOtherHeader{} + header = &VppOtherHeader{} } // decode message header diff --git a/examples/bin_api/acl/acl.go b/examples/bin_api/acl/acl.go index accdd3f..488f9b5 100644 --- a/examples/bin_api/acl/acl.go +++ b/examples/bin_api/acl/acl.go @@ -1,5 +1,6 @@ +// Code generated by govpp binapi-generator DO NOT EDIT. // Package acl represents the VPP binary API of the 'acl' VPP module. -// DO NOT EDIT. Generated from 'bin_api/acl.api.json' +// Generated from '../../bin_api/acl.api.json' package acl import "git.fd.io/govpp.git/api" @@ -8,7 +9,7 @@ import "git.fd.io/govpp.git/api" const VlAPIVersion = 0x1fd77287 // ACLRule represents the VPP binary API data type 'acl_rule'. -// Generated from 'bin_api/acl.api.json', line 3: +// Generated from '../../bin_api/acl.api.json', line 3: // // ["acl_rule", // ["u8", "is_permit"], @@ -51,7 +52,7 @@ func (*ACLRule) GetCrcString() string { } // MacipACLRule represents the VPP binary API data type 'macip_acl_rule'. -// Generated from 'bin_api/acl.api.json', line 19: +// Generated from '../../bin_api/acl.api.json', line 19: // // ["macip_acl_rule", // ["u8", "is_permit"], @@ -80,7 +81,7 @@ func (*MacipACLRule) GetCrcString() string { } // ACLPluginGetVersion represents the VPP binary API message 'acl_plugin_get_version'. -// Generated from 'bin_api/acl.api.json', line 30: +// Generated from '../../bin_api/acl.api.json', line 30: // // ["acl_plugin_get_version", // ["u16", "_vl_msg_id"], @@ -106,7 +107,7 @@ func NewACLPluginGetVersion() api.Message { } // ACLPluginGetVersionReply represents the VPP binary API message 'acl_plugin_get_version_reply'. -// Generated from 'bin_api/acl.api.json', line 36: +// Generated from '../../bin_api/acl.api.json', line 36: // // ["acl_plugin_get_version_reply", // ["u16", "_vl_msg_id"], @@ -135,7 +136,7 @@ func NewACLPluginGetVersionReply() api.Message { } // ACLPluginControlPing represents the VPP binary API message 'acl_plugin_control_ping'. -// Generated from 'bin_api/acl.api.json', line 43: +// Generated from '../../bin_api/acl.api.json', line 43: // // ["acl_plugin_control_ping", // ["u16", "_vl_msg_id"], @@ -161,7 +162,7 @@ func NewACLPluginControlPing() api.Message { } // ACLPluginControlPingReply represents the VPP binary API message 'acl_plugin_control_ping_reply'. -// Generated from 'bin_api/acl.api.json', line 49: +// Generated from '../../bin_api/acl.api.json', line 49: // // ["acl_plugin_control_ping_reply", // ["u16", "_vl_msg_id"], @@ -192,7 +193,7 @@ func NewACLPluginControlPingReply() api.Message { } // ACLAddReplace represents the VPP binary API message 'acl_add_replace'. -// Generated from 'bin_api/acl.api.json', line 57: +// Generated from '../../bin_api/acl.api.json', line 57: // // ["acl_add_replace", // ["u16", "_vl_msg_id"], @@ -226,7 +227,7 @@ func NewACLAddReplace() api.Message { } // ACLAddReplaceReply represents the VPP binary API message 'acl_add_replace_reply'. -// Generated from 'bin_api/acl.api.json', line 67: +// Generated from '../../bin_api/acl.api.json', line 67: // // ["acl_add_replace_reply", // ["u16", "_vl_msg_id"], @@ -255,7 +256,7 @@ func NewACLAddReplaceReply() api.Message { } // ACLDel represents the VPP binary API message 'acl_del'. -// Generated from 'bin_api/acl.api.json', line 74: +// Generated from '../../bin_api/acl.api.json', line 74: // // ["acl_del", // ["u16", "_vl_msg_id"], @@ -283,7 +284,7 @@ func NewACLDel() api.Message { } // ACLDelReply represents the VPP binary API message 'acl_del_reply'. -// Generated from 'bin_api/acl.api.json', line 81: +// Generated from '../../bin_api/acl.api.json', line 81: // // ["acl_del_reply", // ["u16", "_vl_msg_id"], @@ -310,7 +311,7 @@ func NewACLDelReply() api.Message { } // ACLInterfaceAddDel represents the VPP binary API message 'acl_interface_add_del'. -// Generated from 'bin_api/acl.api.json', line 87: +// Generated from '../../bin_api/acl.api.json', line 87: // // ["acl_interface_add_del", // ["u16", "_vl_msg_id"], @@ -344,7 +345,7 @@ func NewACLInterfaceAddDel() api.Message { } // ACLInterfaceAddDelReply represents the VPP binary API message 'acl_interface_add_del_reply'. -// Generated from 'bin_api/acl.api.json', line 97: +// Generated from '../../bin_api/acl.api.json', line 97: // // ["acl_interface_add_del_reply", // ["u16", "_vl_msg_id"], @@ -371,7 +372,7 @@ func NewACLInterfaceAddDelReply() api.Message { } // ACLInterfaceSetACLList represents the VPP binary API message 'acl_interface_set_acl_list'. -// Generated from 'bin_api/acl.api.json', line 103: +// Generated from '../../bin_api/acl.api.json', line 103: // // ["acl_interface_set_acl_list", // ["u16", "_vl_msg_id"], @@ -405,7 +406,7 @@ func NewACLInterfaceSetACLList() api.Message { } // ACLInterfaceSetACLListReply represents the VPP binary API message 'acl_interface_set_acl_list_reply'. -// Generated from 'bin_api/acl.api.json', line 113: +// Generated from '../../bin_api/acl.api.json', line 113: // // ["acl_interface_set_acl_list_reply", // ["u16", "_vl_msg_id"], @@ -432,7 +433,7 @@ func NewACLInterfaceSetACLListReply() api.Message { } // ACLDump represents the VPP binary API message 'acl_dump'. -// Generated from 'bin_api/acl.api.json', line 119: +// Generated from '../../bin_api/acl.api.json', line 119: // // ["acl_dump", // ["u16", "_vl_msg_id"], @@ -460,7 +461,7 @@ func NewACLDump() api.Message { } // ACLDetails represents the VPP binary API message 'acl_details'. -// Generated from 'bin_api/acl.api.json', line 126: +// Generated from '../../bin_api/acl.api.json', line 126: // // ["acl_details", // ["u16", "_vl_msg_id"], @@ -493,7 +494,7 @@ func NewACLDetails() api.Message { } // ACLInterfaceListDump represents the VPP binary API message 'acl_interface_list_dump'. -// Generated from 'bin_api/acl.api.json', line 135: +// Generated from '../../bin_api/acl.api.json', line 135: // // ["acl_interface_list_dump", // ["u16", "_vl_msg_id"], @@ -521,7 +522,7 @@ func NewACLInterfaceListDump() api.Message { } // ACLInterfaceListDetails represents the VPP binary API message 'acl_interface_list_details'. -// Generated from 'bin_api/acl.api.json', line 142: +// Generated from '../../bin_api/acl.api.json', line 142: // // ["acl_interface_list_details", // ["u16", "_vl_msg_id"], @@ -554,7 +555,7 @@ func NewACLInterfaceListDetails() api.Message { } // MacipACLAdd represents the VPP binary API message 'macip_acl_add'. -// Generated from 'bin_api/acl.api.json', line 151: +// Generated from '../../bin_api/acl.api.json', line 151: // // ["macip_acl_add", // ["u16", "_vl_msg_id"], @@ -586,7 +587,7 @@ func NewMacipACLAdd() api.Message { } // MacipACLAddReply represents the VPP binary API message 'macip_acl_add_reply'. -// Generated from 'bin_api/acl.api.json', line 160: +// Generated from '../../bin_api/acl.api.json', line 160: // // ["macip_acl_add_reply", // ["u16", "_vl_msg_id"], @@ -615,7 +616,7 @@ func NewMacipACLAddReply() api.Message { } // MacipACLDel represents the VPP binary API message 'macip_acl_del'. -// Generated from 'bin_api/acl.api.json', line 167: +// Generated from '../../bin_api/acl.api.json', line 167: // // ["macip_acl_del", // ["u16", "_vl_msg_id"], @@ -643,7 +644,7 @@ func NewMacipACLDel() api.Message { } // MacipACLDelReply represents the VPP binary API message 'macip_acl_del_reply'. -// Generated from 'bin_api/acl.api.json', line 174: +// Generated from '../../bin_api/acl.api.json', line 174: // // ["macip_acl_del_reply", // ["u16", "_vl_msg_id"], @@ -670,7 +671,7 @@ func NewMacipACLDelReply() api.Message { } // MacipACLInterfaceAddDel represents the VPP binary API message 'macip_acl_interface_add_del'. -// Generated from 'bin_api/acl.api.json', line 180: +// Generated from '../../bin_api/acl.api.json', line 180: // // ["macip_acl_interface_add_del", // ["u16", "_vl_msg_id"], @@ -702,7 +703,7 @@ func NewMacipACLInterfaceAddDel() api.Message { } // MacipACLInterfaceAddDelReply represents the VPP binary API message 'macip_acl_interface_add_del_reply'. -// Generated from 'bin_api/acl.api.json', line 189: +// Generated from '../../bin_api/acl.api.json', line 189: // // ["macip_acl_interface_add_del_reply", // ["u16", "_vl_msg_id"], @@ -729,7 +730,7 @@ func NewMacipACLInterfaceAddDelReply() api.Message { } // MacipACLDump represents the VPP binary API message 'macip_acl_dump'. -// Generated from 'bin_api/acl.api.json', line 195: +// Generated from '../../bin_api/acl.api.json', line 195: // // ["macip_acl_dump", // ["u16", "_vl_msg_id"], @@ -757,7 +758,7 @@ func NewMacipACLDump() api.Message { } // MacipACLDetails represents the VPP binary API message 'macip_acl_details'. -// Generated from 'bin_api/acl.api.json', line 202: +// Generated from '../../bin_api/acl.api.json', line 202: // // ["macip_acl_details", // ["u16", "_vl_msg_id"], @@ -790,7 +791,7 @@ func NewMacipACLDetails() api.Message { } // MacipACLInterfaceGet represents the VPP binary API message 'macip_acl_interface_get'. -// Generated from 'bin_api/acl.api.json', line 211: +// Generated from '../../bin_api/acl.api.json', line 211: // // ["macip_acl_interface_get", // ["u16", "_vl_msg_id"], @@ -816,7 +817,7 @@ func NewMacipACLInterfaceGet() api.Message { } // MacipACLInterfaceGetReply represents the VPP binary API message 'macip_acl_interface_get_reply'. -// Generated from 'bin_api/acl.api.json', line 217: +// Generated from '../../bin_api/acl.api.json', line 217: // // ["macip_acl_interface_get_reply", // ["u16", "_vl_msg_id"], diff --git a/examples/bin_api/af_packet/af_packet.go b/examples/bin_api/af_packet/af_packet.go index 58db69d..04d783f 100644 --- a/examples/bin_api/af_packet/af_packet.go +++ b/examples/bin_api/af_packet/af_packet.go @@ -1,5 +1,6 @@ +// Code generated by govpp binapi-generator DO NOT EDIT. // Package af_packet represents the VPP binary API of the 'af_packet' VPP module. -// DO NOT EDIT. Generated from 'bin_api/af_packet.api.json' +// Generated from '../../bin_api/af_packet.api.json' package af_packet import "git.fd.io/govpp.git/api" @@ -8,7 +9,7 @@ import "git.fd.io/govpp.git/api" const VlAPIVersion = 0xd4ce9f85 // AfPacketCreate represents the VPP binary API message 'af_packet_create'. -// Generated from 'bin_api/af_packet.api.json', line 6: +// Generated from '../../bin_api/af_packet.api.json', line 6: // // ["af_packet_create", // ["u16", "_vl_msg_id"], @@ -40,7 +41,7 @@ func NewAfPacketCreate() api.Message { } // AfPacketCreateReply represents the VPP binary API message 'af_packet_create_reply'. -// Generated from 'bin_api/af_packet.api.json', line 15: +// Generated from '../../bin_api/af_packet.api.json', line 15: // // ["af_packet_create_reply", // ["u16", "_vl_msg_id"], @@ -69,7 +70,7 @@ func NewAfPacketCreateReply() api.Message { } // AfPacketDelete represents the VPP binary API message 'af_packet_delete'. -// Generated from 'bin_api/af_packet.api.json', line 22: +// Generated from '../../bin_api/af_packet.api.json', line 22: // // ["af_packet_delete", // ["u16", "_vl_msg_id"], @@ -97,7 +98,7 @@ func NewAfPacketDelete() api.Message { } // AfPacketDeleteReply represents the VPP binary API message 'af_packet_delete_reply'. -// Generated from 'bin_api/af_packet.api.json', line 29: +// Generated from '../../bin_api/af_packet.api.json', line 29: // // ["af_packet_delete_reply", // ["u16", "_vl_msg_id"], diff --git a/examples/bin_api/interface.api.json b/examples/bin_api/interface.api.json index 21511fa..7636e18 100644 --- a/examples/bin_api/interface.api.json +++ b/examples/bin_api/interface.api.json @@ -4,6 +4,27 @@ ["u64", "packets"], ["u64", "bytes"], {"crc" : "0x62db67f0"} + ], + ["vnet_combined_counter", + ["u32", "sw_if_index"], + ["u64", "rx_packets"], + ["u64", "rx_bytes"], + ["u64", "tx_packets"], + ["u64", "tx_bytes"], + {"crc" : "0x0f3c951b"} + ], + ["vnet_simple_counter", + ["u32", "sw_if_index"], + ["u64", "drop"], + ["u64", "punt"], + ["u64", "rx_ip4"], + ["u64", "rx_ip6"], + ["u64", "rx_no_buffer"], + ["u64", "rx_miss"], + ["u64", "rx_error"], + ["u64", "tx_error"], + ["u64", "rx_mpls"], + {"crc" : "0x84763938"} ] ], "messages" : [ @@ -13,9 +34,7 @@ ["u32", "context"], ["u32", "sw_if_index"], ["u8", "admin_up_down"], - ["u8", "link_up_down"], - ["u8", "deleted"], - {"crc" : "0xc230f9b1"} + {"crc" : "0xf890584a"} ], ["sw_interface_set_flags_reply", ["u16", "_vl_msg_id"], @@ -37,6 +56,16 @@ ["i32", "retval"], {"crc" : "0x0cc22552"} ], + ["sw_interface_event", + ["u16", "_vl_msg_id"], + ["u32", "client_index"], + ["u32", "pid"], + ["u32", "sw_if_index"], + ["u8", "admin_up_down"], + ["u8", "link_up_down"], + ["u8", "deleted"], + {"crc" : "0xbf7f46f2"} + ], ["want_interface_events", ["u16", "_vl_msg_id"], ["u32", "client_index"], @@ -158,6 +187,20 @@ ["vl_api_vlib_counter_t", "data", 0, "count"], {"crc" : "0xd82426e3"} ], + ["vnet_per_interface_simple_counters", + ["u16", "_vl_msg_id"], + ["u32", "count"], + ["u32", "timestamp"], + ["vl_api_vnet_simple_counter_t", "data", 0, "count"], + {"crc" : "0x7df05633"} + ], + ["vnet_per_interface_combined_counters", + ["u16", "_vl_msg_id"], + ["u32", "count"], + ["u32", "timestamp"], + ["vl_api_vnet_combined_counter_t", "data", 0, "count"], + {"crc" : "0xbf35dfbe"} + ], ["sw_interface_set_unnumbered", ["u16", "_vl_msg_id"], ["u32", "client_index"], @@ -214,7 +257,133 @@ ["u32", "context"], ["i32", "retval"], {"crc" : "0x9dc8a452"} + ], + ["sw_interface_set_rx_mode", + ["u16", "_vl_msg_id"], + ["u32", "client_index"], + ["u32", "context"], + ["u32", "sw_if_index"], + ["u8", "queue_id_valid"], + ["u32", "queue_id"], + ["u8", "mode"], + {"crc" : "0xc5aa8dda"} + ], + ["sw_interface_set_rx_mode_reply", + ["u16", "_vl_msg_id"], + ["u32", "context"], + ["i32", "retval"], + {"crc" : "0x5fc3e318"} + ], + ["interface_name_renumber", + ["u16", "_vl_msg_id"], + ["u32", "client_index"], + ["u32", "context"], + ["u32", "sw_if_index"], + ["u32", "new_show_dev_instance"], + {"crc" : "0x11b7bcec"} + ], + ["interface_name_renumber_reply", + ["u16", "_vl_msg_id"], + ["u32", "context"], + ["i32", "retval"], + {"crc" : "0x31594963"} + ], + ["create_subif", + ["u16", "_vl_msg_id"], + ["u32", "client_index"], + ["u32", "context"], + ["u32", "sw_if_index"], + ["u32", "sub_id"], + ["u8", "no_tags"], + ["u8", "one_tag"], + ["u8", "two_tags"], + ["u8", "dot1ad"], + ["u8", "exact_match"], + ["u8", "default_sub"], + ["u8", "outer_vlan_id_any"], + ["u8", "inner_vlan_id_any"], + ["u16", "outer_vlan_id"], + ["u16", "inner_vlan_id"], + {"crc" : "0x150e6757"} + ], + ["create_subif_reply", + ["u16", "_vl_msg_id"], + ["u32", "context"], + ["i32", "retval"], + ["u32", "sw_if_index"], + {"crc" : "0x92272bcb"} + ], + ["create_vlan_subif", + ["u16", "_vl_msg_id"], + ["u32", "client_index"], + ["u32", "context"], + ["u32", "sw_if_index"], + ["u32", "vlan_id"], + {"crc" : "0xaf9ae1e9"} + ], + ["create_vlan_subif_reply", + ["u16", "_vl_msg_id"], + ["u32", "context"], + ["i32", "retval"], + ["u32", "sw_if_index"], + {"crc" : "0x8f36b888"} + ], + ["delete_subif", + ["u16", "_vl_msg_id"], + ["u32", "client_index"], + ["u32", "context"], + ["u32", "sw_if_index"], + {"crc" : "0x6038f848"} + ], + ["delete_subif_reply", + ["u16", "_vl_msg_id"], + ["u32", "context"], + ["i32", "retval"], + {"crc" : "0x9d6015dc"} + ], + ["create_loopback", + ["u16", "_vl_msg_id"], + ["u32", "client_index"], + ["u32", "context"], + ["u8", "mac_address", 6], + {"crc" : "0xb2602de5"} + ], + ["create_loopback_reply", + ["u16", "_vl_msg_id"], + ["u32", "context"], + ["i32", "retval"], + ["u32", "sw_if_index"], + {"crc" : "0x9520f804"} + ], + ["create_loopback_instance", + ["u16", "_vl_msg_id"], + ["u32", "client_index"], + ["u32", "context"], + ["u8", "mac_address", 6], + ["u8", "is_specified"], + ["u32", "user_instance"], + {"crc" : "0x967694f1"} + ], + ["create_loopback_instance_reply", + ["u16", "_vl_msg_id"], + ["u32", "context"], + ["i32", "retval"], + ["u32", "sw_if_index"], + {"crc" : "0xd52c63b6"} + ], + ["delete_loopback", + ["u16", "_vl_msg_id"], + ["u32", "client_index"], + ["u32", "context"], + ["u32", "sw_if_index"], + {"crc" : "0xded428b0"} + ], + ["delete_loopback_reply", + ["u16", "_vl_msg_id"], + ["u32", "context"], + ["i32", "retval"], + {"crc" : "0xc91dafa5"} ] ], -"vl_api_version" :"0xcdfdf626" + "vl_api_version" :"0x2a74f256" } diff --git a/examples/bin_api/interfaces/interfaces.go b/examples/bin_api/interfaces/interfaces.go index 7d89f09..e5cf324 100644 --- a/examples/bin_api/interfaces/interfaces.go +++ b/examples/bin_api/interfaces/interfaces.go @@ -1,20 +1,21 @@ +// Code generated by govpp binapi-generator DO NOT EDIT. // Package interfaces represents the VPP binary API of the 'interfaces' VPP module. -// DO NOT EDIT. Generated from 'bin_api/interface.api.json' +// Generated from '../../bin_api/interface.api.json' package interfaces import "git.fd.io/govpp.git/api" // VlApiVersion contains version of the API. -const VlAPIVersion = 0xcdfdf626 +const VlAPIVersion = 0x2a74f256 // VlibCounter represents the VPP binary API data type 'vlib_counter'. -// Generated from 'bin_api/interface.api.json', line 3: +// Generated from '../../bin_api/interface.api.json', line 3: // // ["vlib_counter", // ["u64", "packets"], // ["u64", "bytes"], // {"crc" : "0x62db67f0"} -// ] +// ], // type VlibCounter struct { Packets uint64 @@ -28,8 +29,72 @@ func (*VlibCounter) GetCrcString() string { return "62db67f0" } +// VnetCombinedCounter represents the VPP binary API data type 'vnet_combined_counter'. +// Generated from '../../bin_api/interface.api.json', line 8: +// +// ["vnet_combined_counter", +// ["u32", "sw_if_index"], +// ["u64", "rx_packets"], +// ["u64", "rx_bytes"], +// ["u64", "tx_packets"], +// ["u64", "tx_bytes"], +// {"crc" : "0x0f3c951b"} +// ], +// +type VnetCombinedCounter struct { + SwIfIndex uint32 + RxPackets uint64 + RxBytes uint64 + TxPackets uint64 + TxBytes uint64 +} + +func (*VnetCombinedCounter) GetTypeName() string { + return "vnet_combined_counter" +} +func (*VnetCombinedCounter) GetCrcString() string { + return "0f3c951b" +} + +// VnetSimpleCounter represents the VPP binary API data type 'vnet_simple_counter'. +// Generated from '../../bin_api/interface.api.json', line 16: +// +// ["vnet_simple_counter", +// ["u32", "sw_if_index"], +// ["u64", "drop"], +// ["u64", "punt"], +// ["u64", "rx_ip4"], +// ["u64", "rx_ip6"], +// ["u64", "rx_no_buffer"], +// ["u64", "rx_miss"], +// ["u64", "rx_error"], +// ["u64", "tx_error"], +// ["u64", "rx_mpls"], +// {"crc" : "0x84763938"} +// ] +// +type VnetSimpleCounter struct { + SwIfIndex uint32 + Drop uint64 + Punt uint64 + RxIP4 uint64 + RxIP6 uint64 + RxNoBuffer uint64 + RxMiss uint64 + RxError uint64 + TxError uint64 + RxMpls uint64 +} + +func (*VnetSimpleCounter) GetTypeName() string { + return "vnet_simple_counter" +} +func (*VnetSimpleCounter) GetCrcString() string { + return "84763938" +} + // SwInterfaceSetFlags represents the VPP binary API message 'sw_interface_set_flags'. -// Generated from 'bin_api/interface.api.json', line 10: +// Generated from '../../bin_api/interface.api.json', line 31: // // ["sw_interface_set_flags", // ["u16", "_vl_msg_id"], @@ -37,16 +102,12 @@ func (*VlibCounter) GetCrcString() string { // ["u32", "context"], // ["u32", "sw_if_index"], // ["u8", "admin_up_down"], -// ["u8", "link_up_down"], -// ["u8", "deleted"], -// {"crc" : "0xc230f9b1"} +// {"crc" : "0xf890584a"} // ], // type SwInterfaceSetFlags struct { SwIfIndex uint32 AdminUpDown uint8 - LinkUpDown uint8 - Deleted uint8 } func (*SwInterfaceSetFlags) GetMessageName() string { @@ -56,14 +117,14 @@ func (*SwInterfaceSetFlags) GetMessageType() api.MessageType { return api.RequestMessage } func (*SwInterfaceSetFlags) GetCrcString() string { - return "c230f9b1" + return "f890584a" } func NewSwInterfaceSetFlags() api.Message { return &SwInterfaceSetFlags{} } // SwInterfaceSetFlagsReply represents the VPP binary API message 'sw_interface_set_flags_reply'. -// Generated from 'bin_api/interface.api.json', line 20: +// Generated from '../../bin_api/interface.api.json', line 39: // // ["sw_interface_set_flags_reply", // ["u16", "_vl_msg_id"], @@ -90,7 +151,7 @@ func NewSwInterfaceSetFlagsReply() api.Message { } // SwInterfaceSetMtu represents the VPP binary API message 'sw_interface_set_mtu'. -// Generated from 'bin_api/interface.api.json', line 26: +// Generated from '../../bin_api/interface.api.json', line 45: // // ["sw_interface_set_mtu", // ["u16", "_vl_msg_id"], @@ -120,7 +181,7 @@ func NewSwInterfaceSetMtu() api.Message { } // SwInterfaceSetMtuReply represents the VPP binary API message 'sw_interface_set_mtu_reply'. -// Generated from 'bin_api/interface.api.json', line 34: +// Generated from '../../bin_api/interface.api.json', line 53: // // ["sw_interface_set_mtu_reply", // ["u16", "_vl_msg_id"], @@ -146,8 +207,43 @@ func NewSwInterfaceSetMtuReply() api.Message { return &SwInterfaceSetMtuReply{} } +// SwInterfaceEvent represents the VPP binary API message 'sw_interface_event'. +// Generated from '../../bin_api/interface.api.json', line 59: +// +// ["sw_interface_event", +// ["u16", "_vl_msg_id"], +// ["u32", "client_index"], +// ["u32", "pid"], +// ["u32", "sw_if_index"], +// ["u8", "admin_up_down"], +// ["u8", "link_up_down"], +// ["u8", "deleted"], +// {"crc" : "0xbf7f46f2"} +// ], +// +type SwInterfaceEvent struct { + Pid uint32 + SwIfIndex uint32 + AdminUpDown uint8 + LinkUpDown uint8 + Deleted uint8 +} + +func (*SwInterfaceEvent) GetMessageName() string { + return "sw_interface_event" +} +func (*SwInterfaceEvent) GetMessageType() api.MessageType { + return api.EventMessage +} +func (*SwInterfaceEvent) GetCrcString() string { + return "bf7f46f2" +} +func NewSwInterfaceEvent() api.Message { + return &SwInterfaceEvent{} +} + // WantInterfaceEvents represents the VPP binary API message 'want_interface_events'. -// Generated from 'bin_api/interface.api.json', line 40: +// Generated from '../../bin_api/interface.api.json', line 69: // // ["want_interface_events", // ["u16", "_vl_msg_id"], @@ -177,7 +273,7 @@ func NewWantInterfaceEvents() api.Message { } // WantInterfaceEventsReply represents the VPP binary API message 'want_interface_events_reply'. -// Generated from 'bin_api/interface.api.json', line 48: +// Generated from '../../bin_api/interface.api.json', line 77: // // ["want_interface_events_reply", // ["u16", "_vl_msg_id"], @@ -204,7 +300,7 @@ func NewWantInterfaceEventsReply() api.Message { } // SwInterfaceDetails represents the VPP binary API message 'sw_interface_details'. -// Generated from 'bin_api/interface.api.json', line 54: +// Generated from '../../bin_api/interface.api.json', line 83: // // ["sw_interface_details", // ["u16", "_vl_msg_id"], @@ -289,7 +385,7 @@ func NewSwInterfaceDetails() api.Message { } // SwInterfaceDump represents the VPP binary API message 'sw_interface_dump'. -// Generated from 'bin_api/interface.api.json', line 89: +// Generated from '../../bin_api/interface.api.json', line 118: // // ["sw_interface_dump", // ["u16", "_vl_msg_id"], @@ -319,7 +415,7 @@ func NewSwInterfaceDump() api.Message { } // SwInterfaceAddDelAddress represents the VPP binary API message 'sw_interface_add_del_address'. -// Generated from 'bin_api/interface.api.json', line 97: +// Generated from '../../bin_api/interface.api.json', line 126: // // ["sw_interface_add_del_address", // ["u16", "_vl_msg_id"], @@ -357,7 +453,7 @@ func NewSwInterfaceAddDelAddress() api.Message { } // SwInterfaceAddDelAddressReply represents the VPP binary API message 'sw_interface_add_del_address_reply'. -// Generated from 'bin_api/interface.api.json', line 109: +// Generated from '../../bin_api/interface.api.json', line 138: // // ["sw_interface_add_del_address_reply", // ["u16", "_vl_msg_id"], @@ -384,7 +480,7 @@ func NewSwInterfaceAddDelAddressReply() api.Message { } // SwInterfaceSetTable represents the VPP binary API message 'sw_interface_set_table'. -// Generated from 'bin_api/interface.api.json', line 115: +// Generated from '../../bin_api/interface.api.json', line 144: // // ["sw_interface_set_table", // ["u16", "_vl_msg_id"], @@ -416,7 +512,7 @@ func NewSwInterfaceSetTable() api.Message { } // SwInterfaceSetTableReply represents the VPP binary API message 'sw_interface_set_table_reply'. -// Generated from 'bin_api/interface.api.json', line 124: +// Generated from '../../bin_api/interface.api.json', line 153: // // ["sw_interface_set_table_reply", // ["u16", "_vl_msg_id"], @@ -443,7 +539,7 @@ func NewSwInterfaceSetTableReply() api.Message { } // SwInterfaceGetTable represents the VPP binary API message 'sw_interface_get_table'. -// Generated from 'bin_api/interface.api.json', line 130: +// Generated from '../../bin_api/interface.api.json', line 159: // // ["sw_interface_get_table", // ["u16", "_vl_msg_id"], @@ -473,7 +569,7 @@ func NewSwInterfaceGetTable() api.Message { } // SwInterfaceGetTableReply represents the VPP binary API message 'sw_interface_get_table_reply'. -// Generated from 'bin_api/interface.api.json', line 138: +// Generated from '../../bin_api/interface.api.json', line 167: // // ["sw_interface_get_table_reply", // ["u16", "_vl_msg_id"], @@ -502,7 +598,7 @@ func NewSwInterfaceGetTableReply() api.Message { } // VnetInterfaceSimpleCounters represents the VPP binary API message 'vnet_interface_simple_counters'. -// Generated from 'bin_api/interface.api.json', line 145: +// Generated from '../../bin_api/interface.api.json', line 174: // // ["vnet_interface_simple_counters", // ["u16", "_vl_msg_id"], @@ -534,7 +630,7 @@ func NewVnetInterfaceSimpleCounters() api.Message { } // VnetInterfaceCombinedCounters represents the VPP binary API message 'vnet_interface_combined_counters'. -// Generated from 'bin_api/interface.api.json', line 153: +// Generated from '../../bin_api/interface.api.json', line 182: // // ["vnet_interface_combined_counters", // ["u16", "_vl_msg_id"], @@ -565,8 +661,68 @@ func NewVnetInterfaceCombinedCounters() api.Message { return &VnetInterfaceCombinedCounters{} } +// VnetPerInterfaceSimpleCounters represents the VPP binary API message 'vnet_per_interface_simple_counters'. +// Generated from '../../bin_api/interface.api.json', line 190: +// +// ["vnet_per_interface_simple_counters", +// ["u16", "_vl_msg_id"], +// ["u32", "count"], +// ["u32", "timestamp"], +// ["vl_api_vnet_simple_counter_t", "data", 0, "count"], +// {"crc" : "0x7df05633"} +// ], +// +type VnetPerInterfaceSimpleCounters struct { + Count uint32 `struc:"sizeof=Data"` + Timestamp uint32 + Data []VnetSimpleCounter +} + +func (*VnetPerInterfaceSimpleCounters) GetMessageName() string { + return "vnet_per_interface_simple_counters" +} +func (*VnetPerInterfaceSimpleCounters) GetMessageType() api.MessageType { + return api.OtherMessage +} +func (*VnetPerInterfaceSimpleCounters) GetCrcString() string { + return "7df05633" +} +func NewVnetPerInterfaceSimpleCounters() api.Message { + return &VnetPerInterfaceSimpleCounters{} +} + +// VnetPerInterfaceCombinedCounters represents the VPP binary API message 'vnet_per_interface_combined_counters'. +// Generated from '../../bin_api/interface.api.json', line 197: +// +// ["vnet_per_interface_combined_counters", +// ["u16", "_vl_msg_id"], +// ["u32", "count"], +// ["u32", "timestamp"], +// ["vl_api_vnet_combined_counter_t", "data", 0, "count"], +// {"crc" : "0xbf35dfbe"} +// ], +// +type VnetPerInterfaceCombinedCounters struct { + Count uint32 `struc:"sizeof=Data"` + Timestamp uint32 + Data []VnetCombinedCounter +} + +func (*VnetPerInterfaceCombinedCounters) GetMessageName() string { + return "vnet_per_interface_combined_counters" +} +func (*VnetPerInterfaceCombinedCounters) GetMessageType() api.MessageType { + return api.OtherMessage +} +func (*VnetPerInterfaceCombinedCounters) GetCrcString() string { + return "bf35dfbe" +} +func NewVnetPerInterfaceCombinedCounters() api.Message { + return &VnetPerInterfaceCombinedCounters{} +} + // SwInterfaceSetUnnumbered represents the VPP binary API message 'sw_interface_set_unnumbered'. -// Generated from 'bin_api/interface.api.json', line 161: +// Generated from '../../bin_api/interface.api.json', line 204: // // ["sw_interface_set_unnumbered", // ["u16", "_vl_msg_id"], @@ -598,7 +754,7 @@ func NewSwInterfaceSetUnnumbered() api.Message { } // SwInterfaceSetUnnumberedReply represents the VPP binary API message 'sw_interface_set_unnumbered_reply'. -// Generated from 'bin_api/interface.api.json', line 170: +// Generated from '../../bin_api/interface.api.json', line 213: // // ["sw_interface_set_unnumbered_reply", // ["u16", "_vl_msg_id"], @@ -625,7 +781,7 @@ func NewSwInterfaceSetUnnumberedReply() api.Message { } // SwInterfaceClearStats represents the VPP binary API message 'sw_interface_clear_stats'. -// Generated from 'bin_api/interface.api.json', line 176: +// Generated from '../../bin_api/interface.api.json', line 219: // // ["sw_interface_clear_stats", // ["u16", "_vl_msg_id"], @@ -653,7 +809,7 @@ func NewSwInterfaceClearStats() api.Message { } // SwInterfaceClearStatsReply represents the VPP binary API message 'sw_interface_clear_stats_reply'. -// Generated from 'bin_api/interface.api.json', line 183: +// Generated from '../../bin_api/interface.api.json', line 226: // // ["sw_interface_clear_stats_reply", // ["u16", "_vl_msg_id"], @@ -680,7 +836,7 @@ func NewSwInterfaceClearStatsReply() api.Message { } // SwInterfaceTagAddDel represents the VPP binary API message 'sw_interface_tag_add_del'. -// Generated from 'bin_api/interface.api.json', line 189: +// Generated from '../../bin_api/interface.api.json', line 232: // // ["sw_interface_tag_add_del", // ["u16", "_vl_msg_id"], @@ -712,7 +868,7 @@ func NewSwInterfaceTagAddDel() api.Message { } // SwInterfaceTagAddDelReply represents the VPP binary API message 'sw_interface_tag_add_del_reply'. -// Generated from 'bin_api/interface.api.json', line 198: +// Generated from '../../bin_api/interface.api.json', line 241: // // ["sw_interface_tag_add_del_reply", // ["u16", "_vl_msg_id"], @@ -739,7 +895,7 @@ func NewSwInterfaceTagAddDelReply() api.Message { } // SwInterfaceSetMacAddress represents the VPP binary API message 'sw_interface_set_mac_address'. -// Generated from 'bin_api/interface.api.json', line 204: +// Generated from '../../bin_api/interface.api.json', line 247: // // ["sw_interface_set_mac_address", // ["u16", "_vl_msg_id"], @@ -769,14 +925,14 @@ func NewSwInterfaceSetMacAddress() api.Message { } // SwInterfaceSetMacAddressReply represents the VPP binary API message 'sw_interface_set_mac_address_reply'. -// Generated from 'bin_api/interface.api.json', line 212: +// Generated from '../../bin_api/interface.api.json', line 255: // // ["sw_interface_set_mac_address_reply", // ["u16", "_vl_msg_id"], // ["u32", "context"], // ["i32", "retval"], // {"crc" : "0x9dc8a452"} -// ] +// ], // type SwInterfaceSetMacAddressReply struct { Retval int32 @@ -794,3 +950,487 @@ func (*SwInterfaceSetMacAddressReply) GetCrcString() string { func NewSwInterfaceSetMacAddressReply() api.Message { return &SwInterfaceSetMacAddressReply{} } + +// SwInterfaceSetRxMode represents the VPP binary API message 'sw_interface_set_rx_mode'. +// Generated from '../../bin_api/interface.api.json', line 261: +// +// ["sw_interface_set_rx_mode", +// ["u16", "_vl_msg_id"], +// ["u32", "client_index"], +// ["u32", "context"], +// ["u32", "sw_if_index"], +// ["u8", "queue_id_valid"], +// ["u32", "queue_id"], +// ["u8", "mode"], +// {"crc" : "0xc5aa8dda"} +// ], +// +type SwInterfaceSetRxMode struct { + SwIfIndex uint32 + QueueIDValid uint8 + QueueID uint32 + Mode uint8 +} + +func (*SwInterfaceSetRxMode) GetMessageName() string { + return "sw_interface_set_rx_mode" +} +func (*SwInterfaceSetRxMode) GetMessageType() api.MessageType { + return api.RequestMessage +} +func (*SwInterfaceSetRxMode) GetCrcString() string { + return "c5aa8dda" +} +func NewSwInterfaceSetRxMode() api.Message { + return &SwInterfaceSetRxMode{} +} + +// SwInterfaceSetRxModeReply represents the VPP binary API message 'sw_interface_set_rx_mode_reply'. +// Generated from '../../bin_api/interface.api.json', line 271: +// +// ["sw_interface_set_rx_mode_reply", +// ["u16", "_vl_msg_id"], +// ["u32", "context"], +// ["i32", "retval"], +// {"crc" : "0x5fc3e318"} +// ], +// +type SwInterfaceSetRxModeReply struct { + Retval int32 +} + +func (*SwInterfaceSetRxModeReply) GetMessageName() string { + return "sw_interface_set_rx_mode_reply" +} +func (*SwInterfaceSetRxModeReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} +func (*SwInterfaceSetRxModeReply) GetCrcString() string { + return "5fc3e318" +} +func NewSwInterfaceSetRxModeReply() api.Message { + return &SwInterfaceSetRxModeReply{} +} + +// InterfaceNameRenumber represents the VPP binary API message 'interface_name_renumber'. +// Generated from '../../bin_api/interface.api.json', line 277: +// +// ["interface_name_renumber", +// ["u16", "_vl_msg_id"], +// ["u32", "client_index"], +// ["u32", "context"], +// ["u32", "sw_if_index"], +// ["u32", "new_show_dev_instance"], +// {"crc" : "0x11b7bcec"} +// ], +// +type InterfaceNameRenumber struct { + SwIfIndex uint32 + NewShowDevInstance uint32 +} + +func (*InterfaceNameRenumber) GetMessageName() string { + return "interface_name_renumber" +} +func (*InterfaceNameRenumber) GetMessageType() api.MessageType { + return api.RequestMessage +} +func (*InterfaceNameRenumber) GetCrcString() string { + return "11b7bcec" +} +func NewInterfaceNameRenumber() api.Message { + return &InterfaceNameRenumber{} +} + +// InterfaceNameRenumberReply represents the VPP binary API message 'interface_name_renumber_reply'. +// Generated from '../../bin_api/interface.api.json', line 285: +// +// ["interface_name_renumber_reply", +// ["u16", "_vl_msg_id"], +// ["u32", "context"], +// ["i32", "retval"], +// {"crc" : "0x31594963"} +// ], +// +type InterfaceNameRenumberReply struct { + Retval int32 +} + +func (*InterfaceNameRenumberReply) GetMessageName() string { + return "interface_name_renumber_reply" +} +func (*InterfaceNameRenumberReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} +func (*InterfaceNameRenumberReply) GetCrcString() string { + return "31594963" +} +func NewInterfaceNameRenumberReply() api.Message { + return &InterfaceNameRenumberReply{} +} + +// CreateSubif represents the VPP binary API message 'create_subif'. +// Generated from '../../bin_api/interface.api.json', line 291: +// +// ["create_subif", +// ["u16", "_vl_msg_id"], +// ["u32", "client_index"], +// ["u32", "context"], +// ["u32", "sw_if_index"], +// ["u32", "sub_id"], +// ["u8", "no_tags"], +// ["u8", "one_tag"], +// ["u8", "two_tags"], +// ["u8", "dot1ad"], +// ["u8", "exact_match"], +// ["u8", "default_sub"], +// ["u8", "outer_vlan_id_any"], +// ["u8", "inner_vlan_id_any"], +// ["u16", "outer_vlan_id"], +// ["u16", "inner_vlan_id"], +// {"crc" : "0x150e6757"} +// ], +// +type CreateSubif struct { + SwIfIndex uint32 + SubID uint32 + NoTags uint8 + OneTag uint8 + TwoTags uint8 + Dot1ad uint8 + ExactMatch uint8 + DefaultSub uint8 + OuterVlanIDAny uint8 + InnerVlanIDAny uint8 + OuterVlanID uint16 + InnerVlanID uint16 +} + +func (*CreateSubif) GetMessageName() string { + return "create_subif" +} +func (*CreateSubif) GetMessageType() api.MessageType { + return api.RequestMessage +} +func (*CreateSubif) GetCrcString() string { + return "150e6757" +} +func NewCreateSubif() api.Message { + return &CreateSubif{} +} + +// CreateSubifReply represents the VPP binary API message 'create_subif_reply'. +// Generated from '../../bin_api/interface.api.json', line 309: +// +// ["create_subif_reply", +// ["u16", "_vl_msg_id"], +// ["u32", "context"], +// ["i32", "retval"], +// ["u32", "sw_if_index"], +// {"crc" : "0x92272bcb"} +// ], +// +type CreateSubifReply struct { + Retval int32 + SwIfIndex uint32 +} + +func (*CreateSubifReply) GetMessageName() string { + return "create_subif_reply" +} +func (*CreateSubifReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} +func (*CreateSubifReply) GetCrcString() string { + return "92272bcb" +} +func NewCreateSubifReply() api.Message { + return &CreateSubifReply{} +} + +// CreateVlanSubif represents the VPP binary API message 'create_vlan_subif'. +// Generated from '../../bin_api/interface.api.json', line 316: +// +// ["create_vlan_subif", +// ["u16", "_vl_msg_id"], +// ["u32", "client_index"], +// ["u32", "context"], +// ["u32", "sw_if_index"], +// ["u32", "vlan_id"], +// {"crc" : "0xaf9ae1e9"} +// ], +// +type CreateVlanSubif struct { + SwIfIndex uint32 + VlanID uint32 +} + +func (*CreateVlanSubif) GetMessageName() string { + return "create_vlan_subif" +} +func (*CreateVlanSubif) GetMessageType() api.MessageType { + return api.RequestMessage +} +func (*CreateVlanSubif) GetCrcString() string { + return "af9ae1e9" +} +func NewCreateVlanSubif() api.Message { + return &CreateVlanSubif{} +} + +// CreateVlanSubifReply represents the VPP binary API message 'create_vlan_subif_reply'. +// Generated from '../../bin_api/interface.api.json', line 324: +// +// ["create_vlan_subif_reply", +// ["u16", "_vl_msg_id"], +// ["u32", "context"], +// ["i32", "retval"], +// ["u32", "sw_if_index"], +// {"crc" : "0x8f36b888"} +// ], +// +type CreateVlanSubifReply struct { + Retval int32 + SwIfIndex uint32 +} + +func (*CreateVlanSubifReply) GetMessageName() string { + return "create_vlan_subif_reply" +} +func (*CreateVlanSubifReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} +func (*CreateVlanSubifReply) GetCrcString() string { + return "8f36b888" +} +func NewCreateVlanSubifReply() api.Message { + return &CreateVlanSubifReply{} +} + +// DeleteSubif represents the VPP binary API message 'delete_subif'. +// Generated from '../../bin_api/interface.api.json', line 331: +// +// ["delete_subif", +// ["u16", "_vl_msg_id"], +// ["u32", "client_index"], +// ["u32", "context"], +// ["u32", "sw_if_index"], +// {"crc" : "0x6038f848"} +// ], +// +type DeleteSubif struct { + SwIfIndex uint32 +} + +func (*DeleteSubif) GetMessageName() string { + return "delete_subif" +} +func (*DeleteSubif) GetMessageType() api.MessageType { + return api.RequestMessage +} +func (*DeleteSubif) GetCrcString() string { + return "6038f848" +} +func NewDeleteSubif() api.Message { + return &DeleteSubif{} +} + +// DeleteSubifReply represents the VPP binary API message 'delete_subif_reply'. +// Generated from '../../bin_api/interface.api.json', line 338: +// +// ["delete_subif_reply", +// ["u16", "_vl_msg_id"], +// ["u32", "context"], +// ["i32", "retval"], +// {"crc" : "0x9d6015dc"} +// ], +// +type DeleteSubifReply struct { + Retval int32 +} + +func (*DeleteSubifReply) GetMessageName() string { + return "delete_subif_reply" +} +func (*DeleteSubifReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} +func (*DeleteSubifReply) GetCrcString() string { + return "9d6015dc" +} +func NewDeleteSubifReply() api.Message { + return &DeleteSubifReply{} +} + +// CreateLoopback represents the VPP binary API message 'create_loopback'. +// Generated from '../../bin_api/interface.api.json', line 344: +// +// ["create_loopback", +// ["u16", "_vl_msg_id"], +// ["u32", "client_index"], +// ["u32", "context"], +// ["u8", "mac_address", 6], +// {"crc" : "0xb2602de5"} +// ], +// +type CreateLoopback struct { + MacAddress []byte `struc:"[6]byte"` +} + +func (*CreateLoopback) GetMessageName() string { + return "create_loopback" +} +func (*CreateLoopback) GetMessageType() api.MessageType { + return api.RequestMessage +} +func (*CreateLoopback) GetCrcString() string { + return "b2602de5" +} +func NewCreateLoopback() api.Message { + return &CreateLoopback{} +} + +// CreateLoopbackReply represents the VPP binary API message 'create_loopback_reply'. +// Generated from '../../bin_api/interface.api.json', line 351: +// +// ["create_loopback_reply", +// ["u16", "_vl_msg_id"], +// ["u32", "context"], +// ["i32", "retval"], +// ["u32", "sw_if_index"], +// {"crc" : "0x9520f804"} +// ], +// +type CreateLoopbackReply struct { + Retval int32 + SwIfIndex uint32 +} + +func (*CreateLoopbackReply) GetMessageName() string { + return "create_loopback_reply" +} +func (*CreateLoopbackReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} +func (*CreateLoopbackReply) GetCrcString() string { + return "9520f804" +} +func NewCreateLoopbackReply() api.Message { + return &CreateLoopbackReply{} +} + +// CreateLoopbackInstance represents the VPP binary API message 'create_loopback_instance'. +// Generated from '../../bin_api/interface.api.json', line 358: +// +// ["create_loopback_instance", +// ["u16", "_vl_msg_id"], +// ["u32", "client_index"], +// ["u32", "context"], +// ["u8", "mac_address", 6], +// ["u8", "is_specified"], +// ["u32", "user_instance"], +// {"crc" : "0x967694f1"} +// ], +// +type CreateLoopbackInstance struct { + MacAddress []byte `struc:"[6]byte"` + IsSpecified uint8 + UserInstance uint32 +} + +func (*CreateLoopbackInstance) GetMessageName() string { + return "create_loopback_instance" +} +func (*CreateLoopbackInstance) GetMessageType() api.MessageType { + return api.RequestMessage +} +func (*CreateLoopbackInstance) GetCrcString() string { + return "967694f1" +} +func NewCreateLoopbackInstance() api.Message { + return &CreateLoopbackInstance{} +} + +// CreateLoopbackInstanceReply represents the VPP binary API message 'create_loopback_instance_reply'. +// Generated from '../../bin_api/interface.api.json', line 367: +// +// ["create_loopback_instance_reply", +// ["u16", "_vl_msg_id"], +// ["u32", "context"], +// ["i32", "retval"], +// ["u32", "sw_if_index"], +// {"crc" : "0xd52c63b6"} +// ], +// +type CreateLoopbackInstanceReply struct { + Retval int32 + SwIfIndex uint32 +} + +func (*CreateLoopbackInstanceReply) GetMessageName() string { + return "create_loopback_instance_reply" +} +func (*CreateLoopbackInstanceReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} +func (*CreateLoopbackInstanceReply) GetCrcString() string { + return "d52c63b6" +} +func NewCreateLoopbackInstanceReply() api.Message { + return &CreateLoopbackInstanceReply{} +} + +// DeleteLoopback represents the VPP binary API message 'delete_loopback'. +// Generated from '../../bin_api/interface.api.json', line 374: +// +// ["delete_loopback", +// ["u16", "_vl_msg_id"], +// ["u32", "client_index"], +// ["u32", "context"], +// ["u32", "sw_if_index"], +// {"crc" : "0xded428b0"} +// ], +// +type DeleteLoopback struct { + SwIfIndex uint32 +} + +func (*DeleteLoopback) GetMessageName() string { + return "delete_loopback" +} +func (*DeleteLoopback) GetMessageType() api.MessageType { + return api.RequestMessage +} +func (*DeleteLoopback) GetCrcString() string { + return "ded428b0" +} +func NewDeleteLoopback() api.Message { + return &DeleteLoopback{} +} + +// DeleteLoopbackReply represents the VPP binary API message 'delete_loopback_reply'. +// Generated from '../../bin_api/interface.api.json', line 381: +// +// ["delete_loopback_reply", +// ["u16", "_vl_msg_id"], +// ["u32", "context"], +// ["i32", "retval"], +// {"crc" : "0xc91dafa5"} +// ] +// +type DeleteLoopbackReply struct { + Retval int32 +} + +func (*DeleteLoopbackReply) GetMessageName() string { + return "delete_loopback_reply" +} +func (*DeleteLoopbackReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} +func (*DeleteLoopbackReply) GetCrcString() string { + return "c91dafa5" +} +func NewDeleteLoopbackReply() api.Message { + return &DeleteLoopbackReply{} +} diff --git a/examples/bin_api/ip/ip.go b/examples/bin_api/ip/ip.go index 884e218..cea5053 100644 --- a/examples/bin_api/ip/ip.go +++ b/examples/bin_api/ip/ip.go @@ -1,5 +1,6 @@ +// Code generated by govpp binapi-generator DO NOT EDIT. // Package ip represents the VPP binary API of the 'ip' VPP module. -// DO NOT EDIT. Generated from 'bin_api/ip.api.json' +// Generated from '../../bin_api/ip.api.json' package ip import "git.fd.io/govpp.git/api" @@ -8,7 +9,7 @@ import "git.fd.io/govpp.git/api" const VlAPIVersion = 0x50fe2434 // FibPath represents the VPP binary API data type 'fib_path'. -// Generated from 'bin_api/ip.api.json', line 3: +// Generated from '../../bin_api/ip.api.json', line 3: // // ["fib_path", // ["u32", "sw_if_index"], @@ -41,7 +42,7 @@ func (*FibPath) GetCrcString() string { } // IPFibDump represents the VPP binary API message 'ip_fib_dump'. -// Generated from 'bin_api/ip.api.json', line 16: +// Generated from '../../bin_api/ip.api.json', line 16: // // ["ip_fib_dump", // ["u16", "_vl_msg_id"], @@ -67,7 +68,7 @@ func NewIPFibDump() api.Message { } // IPFibDetails represents the VPP binary API message 'ip_fib_details'. -// Generated from 'bin_api/ip.api.json', line 22: +// Generated from '../../bin_api/ip.api.json', line 22: // // ["ip_fib_details", // ["u16", "_vl_msg_id"], @@ -102,7 +103,7 @@ func NewIPFibDetails() api.Message { } // IP6FibDump represents the VPP binary API message 'ip6_fib_dump'. -// Generated from 'bin_api/ip.api.json', line 32: +// Generated from '../../bin_api/ip.api.json', line 32: // // ["ip6_fib_dump", // ["u16", "_vl_msg_id"], @@ -128,7 +129,7 @@ func NewIP6FibDump() api.Message { } // IP6FibDetails represents the VPP binary API message 'ip6_fib_details'. -// Generated from 'bin_api/ip.api.json', line 38: +// Generated from '../../bin_api/ip.api.json', line 38: // // ["ip6_fib_details", // ["u16", "_vl_msg_id"], @@ -163,7 +164,7 @@ func NewIP6FibDetails() api.Message { } // IPNeighborDump represents the VPP binary API message 'ip_neighbor_dump'. -// Generated from 'bin_api/ip.api.json', line 48: +// Generated from '../../bin_api/ip.api.json', line 48: // // ["ip_neighbor_dump", // ["u16", "_vl_msg_id"], @@ -193,7 +194,7 @@ func NewIPNeighborDump() api.Message { } // IPNeighborDetails represents the VPP binary API message 'ip_neighbor_details'. -// Generated from 'bin_api/ip.api.json', line 56: +// Generated from '../../bin_api/ip.api.json', line 56: // // ["ip_neighbor_details", // ["u16", "_vl_msg_id"], @@ -226,7 +227,7 @@ func NewIPNeighborDetails() api.Message { } // IPNeighborAddDel represents the VPP binary API message 'ip_neighbor_add_del'. -// Generated from 'bin_api/ip.api.json', line 65: +// Generated from '../../bin_api/ip.api.json', line 65: // // ["ip_neighbor_add_del", // ["u16", "_vl_msg_id"], @@ -266,7 +267,7 @@ func NewIPNeighborAddDel() api.Message { } // IPNeighborAddDelReply represents the VPP binary API message 'ip_neighbor_add_del_reply'. -// Generated from 'bin_api/ip.api.json', line 78: +// Generated from '../../bin_api/ip.api.json', line 78: // // ["ip_neighbor_add_del_reply", // ["u16", "_vl_msg_id"], @@ -293,7 +294,7 @@ func NewIPNeighborAddDelReply() api.Message { } // SetIPFlowHash represents the VPP binary API message 'set_ip_flow_hash'. -// Generated from 'bin_api/ip.api.json', line 84: +// Generated from '../../bin_api/ip.api.json', line 84: // // ["set_ip_flow_hash", // ["u16", "_vl_msg_id"], @@ -335,7 +336,7 @@ func NewSetIPFlowHash() api.Message { } // SetIPFlowHashReply represents the VPP binary API message 'set_ip_flow_hash_reply'. -// Generated from 'bin_api/ip.api.json', line 98: +// Generated from '../../bin_api/ip.api.json', line 98: // // ["set_ip_flow_hash_reply", // ["u16", "_vl_msg_id"], @@ -362,7 +363,7 @@ func NewSetIPFlowHashReply() api.Message { } // SwInterfaceIP6ndRaConfig represents the VPP binary API message 'sw_interface_ip6nd_ra_config'. -// Generated from 'bin_api/ip.api.json', line 104: +// Generated from '../../bin_api/ip.api.json', line 104: // // ["sw_interface_ip6nd_ra_config", // ["u16", "_vl_msg_id"], @@ -416,7 +417,7 @@ func NewSwInterfaceIP6ndRaConfig() api.Message { } // SwInterfaceIP6ndRaConfigReply represents the VPP binary API message 'sw_interface_ip6nd_ra_config_reply'. -// Generated from 'bin_api/ip.api.json', line 124: +// Generated from '../../bin_api/ip.api.json', line 124: // // ["sw_interface_ip6nd_ra_config_reply", // ["u16", "_vl_msg_id"], @@ -443,7 +444,7 @@ func NewSwInterfaceIP6ndRaConfigReply() api.Message { } // SwInterfaceIP6ndRaPrefix represents the VPP binary API message 'sw_interface_ip6nd_ra_prefix'. -// Generated from 'bin_api/ip.api.json', line 130: +// Generated from '../../bin_api/ip.api.json', line 130: // // ["sw_interface_ip6nd_ra_prefix", // ["u16", "_vl_msg_id"], @@ -491,7 +492,7 @@ func NewSwInterfaceIP6ndRaPrefix() api.Message { } // SwInterfaceIP6ndRaPrefixReply represents the VPP binary API message 'sw_interface_ip6nd_ra_prefix_reply'. -// Generated from 'bin_api/ip.api.json', line 147: +// Generated from '../../bin_api/ip.api.json', line 147: // // ["sw_interface_ip6nd_ra_prefix_reply", // ["u16", "_vl_msg_id"], @@ -518,7 +519,7 @@ func NewSwInterfaceIP6ndRaPrefixReply() api.Message { } // IP6ndProxyAddDel represents the VPP binary API message 'ip6nd_proxy_add_del'. -// Generated from 'bin_api/ip.api.json', line 153: +// Generated from '../../bin_api/ip.api.json', line 153: // // ["ip6nd_proxy_add_del", // ["u16", "_vl_msg_id"], @@ -550,7 +551,7 @@ func NewIP6ndProxyAddDel() api.Message { } // IP6ndProxyAddDelReply represents the VPP binary API message 'ip6nd_proxy_add_del_reply'. -// Generated from 'bin_api/ip.api.json', line 162: +// Generated from '../../bin_api/ip.api.json', line 162: // // ["ip6nd_proxy_add_del_reply", // ["u16", "_vl_msg_id"], @@ -577,7 +578,7 @@ func NewIP6ndProxyAddDelReply() api.Message { } // IP6ndProxyDetails represents the VPP binary API message 'ip6nd_proxy_details'. -// Generated from 'bin_api/ip.api.json', line 168: +// Generated from '../../bin_api/ip.api.json', line 168: // // ["ip6nd_proxy_details", // ["u16", "_vl_msg_id"], @@ -607,7 +608,7 @@ func NewIP6ndProxyDetails() api.Message { } // IP6ndProxyDump represents the VPP binary API message 'ip6nd_proxy_dump'. -// Generated from 'bin_api/ip.api.json', line 176: +// Generated from '../../bin_api/ip.api.json', line 176: // // ["ip6nd_proxy_dump", // ["u16", "_vl_msg_id"], @@ -633,7 +634,7 @@ func NewIP6ndProxyDump() api.Message { } // SwInterfaceIP6EnableDisable represents the VPP binary API message 'sw_interface_ip6_enable_disable'. -// Generated from 'bin_api/ip.api.json', line 182: +// Generated from '../../bin_api/ip.api.json', line 182: // // ["sw_interface_ip6_enable_disable", // ["u16", "_vl_msg_id"], @@ -663,7 +664,7 @@ func NewSwInterfaceIP6EnableDisable() api.Message { } // SwInterfaceIP6EnableDisableReply represents the VPP binary API message 'sw_interface_ip6_enable_disable_reply'. -// Generated from 'bin_api/ip.api.json', line 190: +// Generated from '../../bin_api/ip.api.json', line 190: // // ["sw_interface_ip6_enable_disable_reply", // ["u16", "_vl_msg_id"], @@ -690,7 +691,7 @@ func NewSwInterfaceIP6EnableDisableReply() api.Message { } // SwInterfaceIP6SetLinkLocalAddress represents the VPP binary API message 'sw_interface_ip6_set_link_local_address'. -// Generated from 'bin_api/ip.api.json', line 196: +// Generated from '../../bin_api/ip.api.json', line 196: // // ["sw_interface_ip6_set_link_local_address", // ["u16", "_vl_msg_id"], @@ -720,7 +721,7 @@ func NewSwInterfaceIP6SetLinkLocalAddress() api.Message { } // SwInterfaceIP6SetLinkLocalAddressReply represents the VPP binary API message 'sw_interface_ip6_set_link_local_address_reply'. -// Generated from 'bin_api/ip.api.json', line 204: +// Generated from '../../bin_api/ip.api.json', line 204: // // ["sw_interface_ip6_set_link_local_address_reply", // ["u16", "_vl_msg_id"], @@ -747,7 +748,7 @@ func NewSwInterfaceIP6SetLinkLocalAddressReply() api.Message { } // IPAddDelRoute represents the VPP binary API message 'ip_add_del_route'. -// Generated from 'bin_api/ip.api.json', line 210: +// Generated from '../../bin_api/ip.api.json', line 210: // // ["ip_add_del_route", // ["u16", "_vl_msg_id"], @@ -819,7 +820,7 @@ func NewIPAddDelRoute() api.Message { } // IPAddDelRouteReply represents the VPP binary API message 'ip_add_del_route_reply'. -// Generated from 'bin_api/ip.api.json', line 239: +// Generated from '../../bin_api/ip.api.json', line 239: // // ["ip_add_del_route_reply", // ["u16", "_vl_msg_id"], @@ -846,7 +847,7 @@ func NewIPAddDelRouteReply() api.Message { } // IPMrouteAddDel represents the VPP binary API message 'ip_mroute_add_del'. -// Generated from 'bin_api/ip.api.json', line 245: +// Generated from '../../bin_api/ip.api.json', line 245: // // ["ip_mroute_add_del", // ["u16", "_vl_msg_id"], @@ -896,7 +897,7 @@ func NewIPMrouteAddDel() api.Message { } // IPMrouteAddDelReply represents the VPP binary API message 'ip_mroute_add_del_reply'. -// Generated from 'bin_api/ip.api.json', line 263: +// Generated from '../../bin_api/ip.api.json', line 263: // // ["ip_mroute_add_del_reply", // ["u16", "_vl_msg_id"], @@ -923,7 +924,7 @@ func NewIPMrouteAddDelReply() api.Message { } // IPMfibDump represents the VPP binary API message 'ip_mfib_dump'. -// Generated from 'bin_api/ip.api.json', line 269: +// Generated from '../../bin_api/ip.api.json', line 269: // // ["ip_mfib_dump", // ["u16", "_vl_msg_id"], @@ -949,7 +950,7 @@ func NewIPMfibDump() api.Message { } // IPMfibDetails represents the VPP binary API message 'ip_mfib_details'. -// Generated from 'bin_api/ip.api.json', line 275: +// Generated from '../../bin_api/ip.api.json', line 275: // // ["ip_mfib_details", // ["u16", "_vl_msg_id"], @@ -990,7 +991,7 @@ func NewIPMfibDetails() api.Message { } // IP6MfibDump represents the VPP binary API message 'ip6_mfib_dump'. -// Generated from 'bin_api/ip.api.json', line 288: +// Generated from '../../bin_api/ip.api.json', line 288: // // ["ip6_mfib_dump", // ["u16", "_vl_msg_id"], @@ -1016,7 +1017,7 @@ func NewIP6MfibDump() api.Message { } // IP6MfibDetails represents the VPP binary API message 'ip6_mfib_details'. -// Generated from 'bin_api/ip.api.json', line 294: +// Generated from '../../bin_api/ip.api.json', line 294: // // ["ip6_mfib_details", // ["u16", "_vl_msg_id"], @@ -1053,7 +1054,7 @@ func NewIP6MfibDetails() api.Message { } // IPAddressDetails represents the VPP binary API message 'ip_address_details'. -// Generated from 'bin_api/ip.api.json', line 305: +// Generated from '../../bin_api/ip.api.json', line 305: // // ["ip_address_details", // ["u16", "_vl_msg_id"], @@ -1087,7 +1088,7 @@ func NewIPAddressDetails() api.Message { } // IPAddressDump represents the VPP binary API message 'ip_address_dump'. -// Generated from 'bin_api/ip.api.json', line 315: +// Generated from '../../bin_api/ip.api.json', line 315: // // ["ip_address_dump", // ["u16", "_vl_msg_id"], @@ -1117,7 +1118,7 @@ func NewIPAddressDump() api.Message { } // IPDetails represents the VPP binary API message 'ip_details'. -// Generated from 'bin_api/ip.api.json', line 323: +// Generated from '../../bin_api/ip.api.json', line 323: // // ["ip_details", // ["u16", "_vl_msg_id"], @@ -1147,7 +1148,7 @@ func NewIPDetails() api.Message { } // IPDump represents the VPP binary API message 'ip_dump'. -// Generated from 'bin_api/ip.api.json', line 330: +// Generated from '../../bin_api/ip.api.json', line 330: // // ["ip_dump", // ["u16", "_vl_msg_id"], @@ -1175,7 +1176,7 @@ func NewIPDump() api.Message { } // MfibSignalDump represents the VPP binary API message 'mfib_signal_dump'. -// Generated from 'bin_api/ip.api.json', line 337: +// Generated from '../../bin_api/ip.api.json', line 337: // // ["mfib_signal_dump", // ["u16", "_vl_msg_id"], @@ -1201,7 +1202,7 @@ func NewMfibSignalDump() api.Message { } // MfibSignalDetails represents the VPP binary API message 'mfib_signal_details'. -// Generated from 'bin_api/ip.api.json', line 343: +// Generated from '../../bin_api/ip.api.json', line 343: // // ["mfib_signal_details", // ["u16", "_vl_msg_id"], diff --git a/examples/bin_api/memif/memif.go b/examples/bin_api/memif/memif.go index aa847e4..6ff81de 100644 --- a/examples/bin_api/memif/memif.go +++ b/examples/bin_api/memif/memif.go @@ -1,5 +1,6 @@ +// Code generated by govpp binapi-generator DO NOT EDIT. // Package memif represents the VPP binary API of the 'memif' VPP module. -// DO NOT EDIT. Generated from 'bin_api/memif.api.json' +// Generated from '../../bin_api/memif.api.json' package memif import "git.fd.io/govpp.git/api" @@ -8,7 +9,7 @@ import "git.fd.io/govpp.git/api" const VlAPIVersion = 0xed3def5d // MemifCreate represents the VPP binary API message 'memif_create'. -// Generated from 'bin_api/memif.api.json', line 6: +// Generated from '../../bin_api/memif.api.json', line 6: // // ["memif_create", // ["u16", "_vl_msg_id"], @@ -54,7 +55,7 @@ func NewMemifCreate() api.Message { } // MemifCreateReply represents the VPP binary API message 'memif_create_reply'. -// Generated from 'bin_api/memif.api.json', line 22: +// Generated from '../../bin_api/memif.api.json', line 22: // // ["memif_create_reply", // ["u16", "_vl_msg_id"], @@ -83,7 +84,7 @@ func NewMemifCreateReply() api.Message { } // MemifDelete represents the VPP binary API message 'memif_delete'. -// Generated from 'bin_api/memif.api.json', line 29: +// Generated from '../../bin_api/memif.api.json', line 29: // // ["memif_delete", // ["u16", "_vl_msg_id"], @@ -111,7 +112,7 @@ func NewMemifDelete() api.Message { } // MemifDeleteReply represents the VPP binary API message 'memif_delete_reply'. -// Generated from 'bin_api/memif.api.json', line 36: +// Generated from '../../bin_api/memif.api.json', line 36: // // ["memif_delete_reply", // ["u16", "_vl_msg_id"], @@ -138,7 +139,7 @@ func NewMemifDeleteReply() api.Message { } // MemifDetails represents the VPP binary API message 'memif_details'. -// Generated from 'bin_api/memif.api.json', line 42: +// Generated from '../../bin_api/memif.api.json', line 42: // // ["memif_details", // ["u16", "_vl_msg_id"], @@ -185,7 +186,7 @@ func NewMemifDetails() api.Message { } // MemifDump represents the VPP binary API message 'memif_dump'. -// Generated from 'bin_api/memif.api.json', line 58: +// Generated from '../../bin_api/memif.api.json', line 58: // // ["memif_dump", // ["u16", "_vl_msg_id"], diff --git a/examples/bin_api/tap/tap.go b/examples/bin_api/tap/tap.go index 451bce2..3bb6d4c 100644 --- a/examples/bin_api/tap/tap.go +++ b/examples/bin_api/tap/tap.go @@ -1,5 +1,6 @@ +// Code generated by govpp binapi-generator DO NOT EDIT. // Package tap represents the VPP binary API of the 'tap' VPP module. -// DO NOT EDIT. Generated from 'bin_api/tap.api.json' +// Generated from '../../bin_api/tap.api.json' package tap import "git.fd.io/govpp.git/api" @@ -8,7 +9,7 @@ import "git.fd.io/govpp.git/api" const VlAPIVersion = 0x4eaa2b5a // TapConnect represents the VPP binary API message 'tap_connect'. -// Generated from 'bin_api/tap.api.json', line 6: +// Generated from '../../bin_api/tap.api.json', line 6: // // ["tap_connect", // ["u16", "_vl_msg_id"], @@ -58,7 +59,7 @@ func NewTapConnect() api.Message { } // TapConnectReply represents the VPP binary API message 'tap_connect_reply'. -// Generated from 'bin_api/tap.api.json', line 24: +// Generated from '../../bin_api/tap.api.json', line 24: // // ["tap_connect_reply", // ["u16", "_vl_msg_id"], @@ -87,7 +88,7 @@ func NewTapConnectReply() api.Message { } // TapModify represents the VPP binary API message 'tap_modify'. -// Generated from 'bin_api/tap.api.json', line 31: +// Generated from '../../bin_api/tap.api.json', line 31: // // ["tap_modify", // ["u16", "_vl_msg_id"], @@ -125,7 +126,7 @@ func NewTapModify() api.Message { } // TapModifyReply represents the VPP binary API message 'tap_modify_reply'. -// Generated from 'bin_api/tap.api.json', line 43: +// Generated from '../../bin_api/tap.api.json', line 43: // // ["tap_modify_reply", // ["u16", "_vl_msg_id"], @@ -154,7 +155,7 @@ func NewTapModifyReply() api.Message { } // TapDelete represents the VPP binary API message 'tap_delete'. -// Generated from 'bin_api/tap.api.json', line 50: +// Generated from '../../bin_api/tap.api.json', line 50: // // ["tap_delete", // ["u16", "_vl_msg_id"], @@ -182,7 +183,7 @@ func NewTapDelete() api.Message { } // TapDeleteReply represents the VPP binary API message 'tap_delete_reply'. -// Generated from 'bin_api/tap.api.json', line 57: +// Generated from '../../bin_api/tap.api.json', line 57: // // ["tap_delete_reply", // ["u16", "_vl_msg_id"], @@ -209,7 +210,7 @@ func NewTapDeleteReply() api.Message { } // SwInterfaceTapDump represents the VPP binary API message 'sw_interface_tap_dump'. -// Generated from 'bin_api/tap.api.json', line 63: +// Generated from '../../bin_api/tap.api.json', line 63: // // ["sw_interface_tap_dump", // ["u16", "_vl_msg_id"], @@ -235,7 +236,7 @@ func NewSwInterfaceTapDump() api.Message { } // SwInterfaceTapDetails represents the VPP binary API message 'sw_interface_tap_details'. -// Generated from 'bin_api/tap.api.json', line 69: +// Generated from '../../bin_api/tap.api.json', line 69: // // ["sw_interface_tap_details", // ["u16", "_vl_msg_id"], diff --git a/examples/cmd/simple-client/simple_client.go b/examples/cmd/simple-client/simple_client.go index 6e46d6b..8f10360 100644 --- a/examples/cmd/simple-client/simple_client.go +++ b/examples/cmd/simple-client/simple_client.go @@ -17,7 +17,7 @@ package main // Generates Go bindings for all VPP APIs located in the json directory. -//go:generate binapi-generator --input-dir=bin_api --output-dir=bin_api +//go:generate binapi-generator --input-dir=../../bin_api --output-dir=../../bin_api import ( "fmt" diff --git a/examples/cmd/stats-client/stats_client.go b/examples/cmd/stats-client/stats_client.go index ac2176d..e0c4463 100644 --- a/examples/cmd/stats-client/stats_client.go +++ b/examples/cmd/stats-client/stats_client.go @@ -17,7 +17,7 @@ package main // Generates Go bindings for all VPP APIs located in the json directory. -//go:generate binapi-generator --input-dir=bin_api --output-dir=bin_api +//go:generate binapi-generator --input-dir=../../bin_api --output-dir=../../bin_api import ( "fmt" -- cgit 1.2.3-korg