From db6b4dd54a80c8062b85d299fac68e8850f4358f Mon Sep 17 00:00:00 2001 From: Vladimir Lavor Date: Mon, 8 Oct 2018 14:33:47 +0200 Subject: [PATCH 1/9] VPP updated to v18.10-rc0~597-g2fd4b56a Signed-off-by: Vladimir Lavor --- plugins/vpp/binapi/bfd/bfd.ba.go | 103 ++++++++++++++++++++++++- plugins/vpp/binapi/ip/ip.ba.go | 40 +++++++--- plugins/vpp/binapi/ipsec/ipsec.ba.go | 76 ++++++++++++++++++- plugins/vpp/binapi/vpe/vpe.ba.go | 109 ++++++++++++++++++++++++++- vpp.env | 2 +- 5 files changed, 313 insertions(+), 17 deletions(-) diff --git a/plugins/vpp/binapi/bfd/bfd.ba.go b/plugins/vpp/binapi/bfd/bfd.ba.go index 620d2c364e..b330b0fca9 100644 --- a/plugins/vpp/binapi/bfd/bfd.ba.go +++ b/plugins/vpp/binapi/bfd/bfd.ba.go @@ -5,8 +5,8 @@ Package bfd is a generated from VPP binary API module 'bfd'. It contains following objects: - 26 messages - 13 services + 28 messages + 14 services */ package bfd @@ -156,6 +156,102 @@ func (*BfdUDPDelEchoSourceReply) GetMessageType() api.MessageType { return api.ReplyMessage } +// BfdUDPGetEchoSource represents the VPP binary API message 'bfd_udp_get_echo_source'. +// +// "bfd_udp_get_echo_source", +// [ +// "u16", +// "_vl_msg_id" +// ], +// [ +// "u32", +// "client_index" +// ], +// [ +// "u32", +// "context" +// ], +// { +// "crc": "0x51077d14" +// } +// +type BfdUDPGetEchoSource struct{} + +func (*BfdUDPGetEchoSource) GetMessageName() string { + return "bfd_udp_get_echo_source" +} +func (*BfdUDPGetEchoSource) GetCrcString() string { + return "51077d14" +} +func (*BfdUDPGetEchoSource) GetMessageType() api.MessageType { + return api.RequestMessage +} + +// BfdUDPGetEchoSourceReply represents the VPP binary API message 'bfd_udp_get_echo_source_reply'. +// +// "bfd_udp_get_echo_source_reply", +// [ +// "u16", +// "_vl_msg_id" +// ], +// [ +// "u32", +// "context" +// ], +// [ +// "i32", +// "retval" +// ], +// [ +// "u32", +// "sw_if_index" +// ], +// [ +// "u8", +// "is_set" +// ], +// [ +// "u8", +// "have_usable_ip4" +// ], +// [ +// "u8", +// "ip4_addr", +// 4 +// ], +// [ +// "u8", +// "have_usable_ip6" +// ], +// [ +// "u8", +// "ip6_addr", +// 16 +// ], +// { +// "crc": "0x6924ca6b" +// } +// +type BfdUDPGetEchoSourceReply struct { + Retval int32 + SwIfIndex uint32 + IsSet uint8 + HaveUsableIP4 uint8 + IP4Addr []byte `struc:"[4]byte"` + HaveUsableIP6 uint8 + IP6Addr []byte `struc:"[16]byte"` +} + +func (*BfdUDPGetEchoSourceReply) GetMessageName() string { + return "bfd_udp_get_echo_source_reply" +} +func (*BfdUDPGetEchoSourceReply) GetCrcString() string { + return "6924ca6b" +} +func (*BfdUDPGetEchoSourceReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + // BfdUDPAdd represents the VPP binary API message 'bfd_udp_add'. // // "bfd_udp_add", @@ -1181,6 +1277,7 @@ type Services interface { BfdUDPAuthDeactivate(*BfdUDPAuthDeactivate) (*BfdUDPAuthDeactivateReply, error) BfdUDPDel(*BfdUDPDel) (*BfdUDPDelReply, error) BfdUDPDelEchoSource(*BfdUDPDelEchoSource) (*BfdUDPDelEchoSourceReply, error) + BfdUDPGetEchoSource(*BfdUDPGetEchoSource) (*BfdUDPGetEchoSourceReply, error) BfdUDPMod(*BfdUDPMod) (*BfdUDPModReply, error) BfdUDPSessionSetFlags(*BfdUDPSessionSetFlags) (*BfdUDPSessionSetFlagsReply, error) BfdUDPSetEchoSource(*BfdUDPSetEchoSource) (*BfdUDPSetEchoSourceReply, error) @@ -1192,6 +1289,8 @@ func init() { api.RegisterMessage((*BfdUDPSetEchoSourceReply)(nil), "bfd.BfdUDPSetEchoSourceReply") api.RegisterMessage((*BfdUDPDelEchoSource)(nil), "bfd.BfdUDPDelEchoSource") api.RegisterMessage((*BfdUDPDelEchoSourceReply)(nil), "bfd.BfdUDPDelEchoSourceReply") + api.RegisterMessage((*BfdUDPGetEchoSource)(nil), "bfd.BfdUDPGetEchoSource") + api.RegisterMessage((*BfdUDPGetEchoSourceReply)(nil), "bfd.BfdUDPGetEchoSourceReply") api.RegisterMessage((*BfdUDPAdd)(nil), "bfd.BfdUDPAdd") api.RegisterMessage((*BfdUDPAddReply)(nil), "bfd.BfdUDPAddReply") api.RegisterMessage((*BfdUDPMod)(nil), "bfd.BfdUDPMod") diff --git a/plugins/vpp/binapi/ip/ip.ba.go b/plugins/vpp/binapi/ip/ip.ba.go index 24744bfe21..6b7b9486cc 100644 --- a/plugins/vpp/binapi/ip/ip.ba.go +++ b/plugins/vpp/binapi/ip/ip.ba.go @@ -838,6 +838,10 @@ func (*IPNeighborDump) GetMessageType() api.MessageType { // "sw_if_index" // ], // [ +// "u32", +// "stats_index" +// ], +// [ // "u8", // "is_static" // ], @@ -856,11 +860,12 @@ func (*IPNeighborDump) GetMessageType() api.MessageType { // 16 // ], // { -// "crc": "0x85e32a72" +// "crc": "0xc7001770" // } // type IPNeighborDetails struct { SwIfIndex uint32 + StatsIndex uint32 IsStatic uint8 IsIPv6 uint8 MacAddress []byte `struc:"[6]byte"` @@ -871,7 +876,7 @@ func (*IPNeighborDetails) GetMessageName() string { return "ip_neighbor_details" } func (*IPNeighborDetails) GetCrcString() string { - return "85e32a72" + return "c7001770" } func (*IPNeighborDetails) GetMessageType() api.MessageType { return api.ReplyMessage @@ -961,19 +966,24 @@ func (*IPNeighborAddDel) GetMessageType() api.MessageType { // "i32", // "retval" // ], +// [ +// "u32", +// "stats_index" +// ], // { -// "crc": "0xe8d4e804" +// "crc": "0x1992deab" // } // type IPNeighborAddDelReply struct { - Retval int32 + Retval int32 + StatsIndex uint32 } func (*IPNeighborAddDelReply) GetMessageName() string { return "ip_neighbor_add_del_reply" } func (*IPNeighborAddDelReply) GetCrcString() string { - return "e8d4e804" + return "1992deab" } func (*IPNeighborAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage @@ -2066,19 +2076,24 @@ func (*IPMrouteAddDel) GetMessageType() api.MessageType { // "i32", // "retval" // ], +// [ +// "u32", +// "stats_index" +// ], // { -// "crc": "0xe8d4e804" +// "crc": "0x1992deab" // } // type IPMrouteAddDelReply struct { - Retval int32 + Retval int32 + StatsIndex uint32 } func (*IPMrouteAddDelReply) GetMessageName() string { return "ip_mroute_add_del_reply" } func (*IPMrouteAddDelReply) GetCrcString() string { - return "e8d4e804" + return "1992deab" } func (*IPMrouteAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage @@ -2157,13 +2172,17 @@ func (*IPMfibDump) GetMessageType() api.MessageType { // "count" // ], // [ +// "u32", +// "stats_index" +// ], +// [ // "vl_api_fib_path_t", // "path", // 0, // "count" // ], // { -// "crc": "0x5e530d5e" +// "crc": "0x21329a12" // } // type IPMfibDetails struct { @@ -2174,6 +2193,7 @@ type IPMfibDetails struct { GrpAddress []byte `struc:"[4]byte"` SrcAddress []byte `struc:"[4]byte"` Count uint32 `struc:"sizeof=Path"` + StatsIndex uint32 Path []FibPath } @@ -2181,7 +2201,7 @@ func (*IPMfibDetails) GetMessageName() string { return "ip_mfib_details" } func (*IPMfibDetails) GetCrcString() string { - return "5e530d5e" + return "21329a12" } func (*IPMfibDetails) GetMessageType() api.MessageType { return api.ReplyMessage diff --git a/plugins/vpp/binapi/ipsec/ipsec.ba.go b/plugins/vpp/binapi/ipsec/ipsec.ba.go index 6ffd2ad7f0..ad9b683567 100644 --- a/plugins/vpp/binapi/ipsec/ipsec.ba.go +++ b/plugins/vpp/binapi/ipsec/ipsec.ba.go @@ -5,8 +5,8 @@ Package ipsec is a generated from VPP binary API module 'ipsec'. It contains following objects: - 46 messages - 23 services + 48 messages + 24 services */ package ipsec @@ -1647,6 +1647,75 @@ func (*Ikev2InitiateRekeyChildSaReply) GetMessageType() api.MessageType { return api.ReplyMessage } +// IpsecSpdsDump represents the VPP binary API message 'ipsec_spds_dump'. +// +// "ipsec_spds_dump", +// [ +// "u16", +// "_vl_msg_id" +// ], +// [ +// "u32", +// "client_index" +// ], +// [ +// "u32", +// "context" +// ], +// { +// "crc": "0x51077d14" +// } +// +type IpsecSpdsDump struct{} + +func (*IpsecSpdsDump) GetMessageName() string { + return "ipsec_spds_dump" +} +func (*IpsecSpdsDump) GetCrcString() string { + return "51077d14" +} +func (*IpsecSpdsDump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +// IpsecSpdsDetails represents the VPP binary API message 'ipsec_spds_details'. +// +// "ipsec_spds_details", +// [ +// "u16", +// "_vl_msg_id" +// ], +// [ +// "u32", +// "context" +// ], +// [ +// "u32", +// "spd_id" +// ], +// [ +// "u32", +// "npolicies" +// ], +// { +// "crc": "0xa04bb254" +// } +// +type IpsecSpdsDetails struct { + SpdID uint32 + Npolicies uint32 +} + +func (*IpsecSpdsDetails) GetMessageName() string { + return "ipsec_spds_details" +} +func (*IpsecSpdsDetails) GetCrcString() string { + return "a04bb254" +} +func (*IpsecSpdsDetails) GetMessageType() api.MessageType { + return api.ReplyMessage +} + // IpsecSpdDump represents the VPP binary API message 'ipsec_spd_dump'. // // "ipsec_spd_dump", @@ -2332,6 +2401,7 @@ func (*IpsecTunnelIfSetSaReply) GetMessageType() api.MessageType { type Services interface { DumpIpsecSa(*IpsecSaDump) (*IpsecSaDetails, error) DumpIpsecSpd(*IpsecSpdDump) (*IpsecSpdDetails, error) + DumpIpsecSpds(*IpsecSpdsDump) (*IpsecSpdsDetails, error) Ikev2InitiateDelChildSa(*Ikev2InitiateDelChildSa) (*Ikev2InitiateDelChildSaReply, error) Ikev2InitiateDelIkeSa(*Ikev2InitiateDelIkeSa) (*Ikev2InitiateDelIkeSaReply, error) Ikev2InitiateRekeyChildSa(*Ikev2InitiateRekeyChildSa) (*Ikev2InitiateRekeyChildSaReply, error) @@ -2392,6 +2462,8 @@ func init() { api.RegisterMessage((*Ikev2InitiateDelChildSaReply)(nil), "ipsec.Ikev2InitiateDelChildSaReply") api.RegisterMessage((*Ikev2InitiateRekeyChildSa)(nil), "ipsec.Ikev2InitiateRekeyChildSa") api.RegisterMessage((*Ikev2InitiateRekeyChildSaReply)(nil), "ipsec.Ikev2InitiateRekeyChildSaReply") + api.RegisterMessage((*IpsecSpdsDump)(nil), "ipsec.IpsecSpdsDump") + api.RegisterMessage((*IpsecSpdsDetails)(nil), "ipsec.IpsecSpdsDetails") api.RegisterMessage((*IpsecSpdDump)(nil), "ipsec.IpsecSpdDump") api.RegisterMessage((*IpsecSpdDetails)(nil), "ipsec.IpsecSpdDetails") api.RegisterMessage((*IpsecTunnelIfAddDel)(nil), "ipsec.IpsecTunnelIfAddDel") diff --git a/plugins/vpp/binapi/vpe/vpe.ba.go b/plugins/vpp/binapi/vpe/vpe.ba.go index 739a8bccaf..4076c768fd 100644 --- a/plugins/vpp/binapi/vpe/vpe.ba.go +++ b/plugins/vpp/binapi/vpe/vpe.ba.go @@ -5,8 +5,9 @@ Package vpe is a generated from VPP binary API module 'vpe'. It contains following objects: - 16 messages - 8 services + 18 messages + 1 type + 9 services */ package vpe @@ -20,6 +21,31 @@ var _ = api.RegisterMessage var _ = struc.Pack var _ = bytes.NewBuffer +/* Types */ + +// ThreadData represents the VPP binary API type 'thread_data'. +// +// "thread_data", +// 0, +// "count" +// +type ThreadData struct { + ID uint32 + Name []byte `struc:"[64]byte"` + Type []byte `struc:"[64]byte"` + PID uint32 + CPUID uint32 + Core uint32 + CPUSocket uint32 +} + +func (*ThreadData) GetTypeName() string { + return "thread_data" +} +func (*ThreadData) GetCrcString() string { + return "0f57094e" +} + /* Messages */ // ControlPing represents the VPP binary API message 'control_ping'. @@ -506,6 +532,82 @@ func (*ShowVersionReply) GetMessageType() api.MessageType { return api.ReplyMessage } +// ShowThreads represents the VPP binary API message 'show_threads'. +// +// "show_threads", +// [ +// "u16", +// "_vl_msg_id" +// ], +// [ +// "u32", +// "client_index" +// ], +// [ +// "u32", +// "context" +// ], +// { +// "crc": "0x51077d14" +// } +// +type ShowThreads struct{} + +func (*ShowThreads) GetMessageName() string { + return "show_threads" +} +func (*ShowThreads) GetCrcString() string { + return "51077d14" +} +func (*ShowThreads) GetMessageType() api.MessageType { + return api.RequestMessage +} + +// ShowThreadsReply represents the VPP binary API message 'show_threads_reply'. +// +// "show_threads_reply", +// [ +// "u16", +// "_vl_msg_id" +// ], +// [ +// "u32", +// "context" +// ], +// [ +// "i32", +// "retval" +// ], +// [ +// "u32", +// "count" +// ], +// [ +// "vl_api_thread_data_t", +// "thread_data", +// 0, +// "count" +// ], +// { +// "crc": "0x6942fb35" +// } +// +type ShowThreadsReply struct { + Retval int32 + Count uint32 `struc:"sizeof=ThreadData"` + ThreadData []ThreadData +} + +func (*ShowThreadsReply) GetMessageName() string { + return "show_threads_reply" +} +func (*ShowThreadsReply) GetCrcString() string { + return "6942fb35" +} +func (*ShowThreadsReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + // GetNodeGraph represents the VPP binary API message 'get_node_graph'. // // "get_node_graph", @@ -667,6 +769,7 @@ type Services interface { GetNextIndex(*GetNextIndex) (*GetNextIndexReply, error) GetNodeGraph(*GetNodeGraph) (*GetNodeGraphReply, error) GetNodeIndex(*GetNodeIndex) (*GetNodeIndexReply, error) + ShowThreads(*ShowThreads) (*ShowThreadsReply, error) ShowVersion(*ShowVersion) (*ShowVersionReply, error) } @@ -683,6 +786,8 @@ func init() { api.RegisterMessage((*AddNodeNextReply)(nil), "vpe.AddNodeNextReply") api.RegisterMessage((*ShowVersion)(nil), "vpe.ShowVersion") api.RegisterMessage((*ShowVersionReply)(nil), "vpe.ShowVersionReply") + api.RegisterMessage((*ShowThreads)(nil), "vpe.ShowThreads") + api.RegisterMessage((*ShowThreadsReply)(nil), "vpe.ShowThreadsReply") api.RegisterMessage((*GetNodeGraph)(nil), "vpe.GetNodeGraph") api.RegisterMessage((*GetNodeGraphReply)(nil), "vpe.GetNodeGraphReply") api.RegisterMessage((*GetNextIndex)(nil), "vpe.GetNextIndex") diff --git a/vpp.env b/vpp.env index 56c89bfab9..6d1b198e8d 100644 --- a/vpp.env +++ b/vpp.env @@ -1,2 +1,2 @@ VPP_REPO_URL=https://github.com/FDio/vpp.git -VPP_COMMIT=e23edac38ec239115689fe252b4b41a3556f6280 # v18.10-rc0-505-ge23edac3 +VPP_COMMIT=2fd4b56aea5833a4752525d58cac335909190e9c # v18.10-rc0~597-g2fd4b56a From aa029bc7e71c05208da8feb6abef444ce5b3a9cd Mon Sep 17 00:00:00 2001 From: olympus <416671790@qq.com> Date: Wed, 10 Oct 2018 09:19:35 +0800 Subject: [PATCH 2/9] debug the tool of agentctl PutLookback API --- cmd/agentctl/impl/interfaces.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/agentctl/impl/interfaces.go b/cmd/agentctl/impl/interfaces.go index f940a8986d..fe4ba30df6 100644 --- a/cmd/agentctl/impl/interfaces.go +++ b/cmd/agentctl/impl/interfaces.go @@ -65,7 +65,7 @@ func PutEthernet(endpoints []string, label string) { // PutLoopback creates a loopback type interface. func PutLoopback(endpoints []string, label string) { found, key, ifc, db := utils.GetInterfaceKeyAndValue(endpoints, label, ifCommonFields.Name) - processCommonIfFlags(found, interfaces.InterfaceType_TAP_INTERFACE, ifc) + processCommonIfFlags(found, interfaces.InterfaceType_SOFTWARE_LOOPBACK, ifc) utils.WriteInterfaceToDb(db, key, ifc) } From 640e76aa06903e24f6822ad7269a560095c3322e Mon Sep 17 00:00:00 2001 From: olympus <416671790@qq.com> Date: Thu, 11 Oct 2018 16:52:56 +0800 Subject: [PATCH 3/9] change the logs.conf's defaultLevel to default-level in order to match the tag in config.go's Config --- docker/dev/logs.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/dev/logs.conf b/docker/dev/logs.conf index 2c19e10a4d..2852605185 100644 --- a/docker/dev/logs.conf +++ b/docker/dev/logs.conf @@ -1 +1 @@ -defaultLevel: debug \ No newline at end of file +default-level: debug \ No newline at end of file From 6411cc13423ad86b92a609d31793304d5b61549e Mon Sep 17 00:00:00 2001 From: Vladimir Lavor Date: Fri, 19 Oct 2018 15:34:57 +0200 Subject: [PATCH 4/9] (master) fix linux interface dump for default namespace Signed-off-by: Vladimir Lavor --- .../linuxcalls/dump_link_linuxcalls.go | 103 ++++++++++++------ 1 file changed, 71 insertions(+), 32 deletions(-) diff --git a/plugins/linux/ifplugin/linuxcalls/dump_link_linuxcalls.go b/plugins/linux/ifplugin/linuxcalls/dump_link_linuxcalls.go index c3bf5a367f..7476baadc8 100644 --- a/plugins/linux/ifplugin/linuxcalls/dump_link_linuxcalls.go +++ b/plugins/linux/ifplugin/linuxcalls/dump_link_linuxcalls.go @@ -49,11 +49,37 @@ func (h *NetLinkHandler) DumpInterfaces() ([]*LinuxInterfaceDetails, error) { ctx := nsplugin.NewNamespaceMgmtCtx() - // Vpp-agent should know all the configured interfaces, and all the interfaces from default namespace. Use index - // map to iterate over them - for _, ifName := range h.ifIndexes.GetMapping().ListNames() { + // Dump all interfaces from the default namespace + dNsLinks, err := h.GetLinkList() + if err != nil { + return nil, errors.Errorf("failed to dump linux interfaces from default namespace: %v", err) + } + for _, dNsLink := range dNsLinks { ifDetails := &LinuxInterfaceDetails{} + if dNsLink == nil || dNsLink.Attrs() == nil { + h.log.Warnf("Unable to get link data for interface %s", dNsLink) + continue + } + ifName := dNsLink.Attrs().Name + link, linkAddresses, err := h.dumpInterfaceData(ifName, &nsplugin.Namespace{}, ctx) + if err != nil { + // Do not return error + h.log.Errorf("failed to get interface %s data: %v", ifName, err) + continue + } + // If the interface exists in mapping, copy the modelled data + if _, meta, found := h.ifIndexes.LookupIdx(ifName); found { + ifDetails.Interface = meta.Data + } + + h.transformAndStore(link, linkAddresses, ifDetails) + ifs = append(ifs, ifDetails) + } + + // Add all known interfaces in non-default namespace + for _, ifName := range h.ifIndexes.GetMapping().ListNames() { + ifDetails := &LinuxInterfaceDetails{} _, meta, found := h.ifIndexes.LookupIdx(ifName) if !found { h.log.Warnf("Expected interface %s not found in the mapping", ifName) @@ -63,12 +89,16 @@ func (h *NetLinkHandler) DumpInterfaces() ([]*LinuxInterfaceDetails, error) { h.log.Warnf("Expected interface %s metadata are missing", ifName) continue } + // Skip interfaces in default NS (already processed) + if meta.Data.Namespace == nil { + continue + } // Copy base configuration from mapping metadata. Linux specific fields are stored in LinuxInterfaceMeta. ifDetails.Interface = meta.Data // Check the interface namespace - link, linkAddrs, err := h.dumpInterfaceData(ifName, h.nsHandler.IfNsToGeneric(meta.Data.Namespace), ctx) + link, linkAddresses, err := h.dumpInterfaceData(ifName, h.nsHandler.IfNsToGeneric(meta.Data.Namespace), ctx) if err != nil { // Do not return error, read what is possible h.log.Errorf("failed to get interface %s data: %v", ifName, err) @@ -80,34 +110,7 @@ func (h *NetLinkHandler) DumpInterfaces() ([]*LinuxInterfaceDetails, error) { continue } - linkAttrs := link.Attrs() - // Base fields - linuxMeta := &LinuxInterfaceMeta{ - Index: linkAttrs.Index, - Name: linkAttrs.Name, - Alias: linkAttrs.Alias, - OperState: linkAttrs.OperState.String(), - Flags: linkAttrs.Flags.String(), - Mtu: linkAttrs.MTU, - Type: linkAttrs.EncapType, - NetNsID: linkAttrs.NetNsID, - NumTxQueues: linkAttrs.NumTxQueues, - TxQueueLen: linkAttrs.TxQLen, - NumRxQueues: linkAttrs.NumRxQueues, - } - - // IP addresses - var ipAddrs []string - for _, linkAddr := range linkAddrs { - ipAddrs = append(ipAddrs, linkAddr.String()) - } - - // MAC address - if linkAttrs.HardwareAddr != nil { - linuxMeta.MacAddr = linkAttrs.HardwareAddr.String() - } - - ifDetails.Meta = linuxMeta + h.transformAndStore(link, linkAddresses, ifDetails) ifs = append(ifs, ifDetails) } @@ -186,3 +189,39 @@ func (h *NetLinkHandler) dumpInterfaceData(ifName string, ns *nsplugin.Namespace return link, linkAddrs, nil } + +// Transform link type interface to the interface details and store IP addresses to the proto modelled data +func (h *NetLinkHandler) transformAndStore(link netlink.Link, addr []netlink.Addr, ifDetails *LinuxInterfaceDetails) { + // Set IP addresses to model-based data + var ipAddrs []string + for _, linkAddr := range addr { + ipAddrs = append(ipAddrs, linkAddr.String()) + } + if ifDetails.Interface == nil { + ifDetails.Interface = &interfaces.LinuxInterfaces_Interface{ + IpAddresses: ipAddrs, + } + } else { + ifDetails.Interface.IpAddresses = ipAddrs + } + + // Metadata fields + linkAttrs := link.Attrs() + linuxMeta := &LinuxInterfaceMeta{ + Index: linkAttrs.Index, + Name: linkAttrs.Name, + Alias: linkAttrs.Alias, + OperState: linkAttrs.OperState.String(), + Flags: linkAttrs.Flags.String(), + Mtu: linkAttrs.MTU, + Type: linkAttrs.EncapType, + NetNsID: linkAttrs.NetNsID, + NumTxQueues: linkAttrs.NumTxQueues, + TxQueueLen: linkAttrs.TxQLen, + NumRxQueues: linkAttrs.NumRxQueues, + } + if linkAttrs.HardwareAddr != nil { + linuxMeta.MacAddr = linkAttrs.HardwareAddr.String() + } + ifDetails.Meta = linuxMeta +} From 5d16267b8493e9d65026815f7f12ce83be6f5c00 Mon Sep 17 00:00:00 2001 From: Ondrej Fabry Date: Tue, 23 Oct 2018 10:39:03 +0200 Subject: [PATCH 5/9] Update VPP to v19.01-rc0-29-g02a95ce8 (CSIT checkpoint) Signed-off-by: Ondrej Fabry --- plugins/vpp/binapi/ip/ip.ba.go | 76 +++++++++++++++++++++++++++++++++- vpp.env | 2 +- 2 files changed, 75 insertions(+), 3 deletions(-) diff --git a/plugins/vpp/binapi/ip/ip.ba.go b/plugins/vpp/binapi/ip/ip.ba.go index 6b7b9486cc..e0eb787ff9 100644 --- a/plugins/vpp/binapi/ip/ip.ba.go +++ b/plugins/vpp/binapi/ip/ip.ba.go @@ -5,11 +5,11 @@ Package ip is a generated from VPP binary API module 'ip'. It contains following objects: - 87 messages + 89 messages 10 types 1 enum 1 union - 42 services + 43 services */ package ip @@ -2900,6 +2900,75 @@ func (*IPContainerProxyAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +// IPContainerProxyDump represents the VPP binary API message 'ip_container_proxy_dump'. +// +// "ip_container_proxy_dump", +// [ +// "u16", +// "_vl_msg_id" +// ], +// [ +// "u32", +// "client_index" +// ], +// [ +// "u32", +// "context" +// ], +// { +// "crc": "0x51077d14" +// } +// +type IPContainerProxyDump struct{} + +func (*IPContainerProxyDump) GetMessageName() string { + return "ip_container_proxy_dump" +} +func (*IPContainerProxyDump) GetCrcString() string { + return "51077d14" +} +func (*IPContainerProxyDump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +// IPContainerProxyDetails represents the VPP binary API message 'ip_container_proxy_details'. +// +// "ip_container_proxy_details", +// [ +// "u16", +// "_vl_msg_id" +// ], +// [ +// "u32", +// "context" +// ], +// [ +// "u32", +// "sw_if_index" +// ], +// [ +// "vl_api_prefix_t", +// "prefix" +// ], +// { +// "crc": "0xd528df63" +// } +// +type IPContainerProxyDetails struct { + SwIfIndex uint32 + Prefix Prefix +} + +func (*IPContainerProxyDetails) GetMessageName() string { + return "ip_container_proxy_details" +} +func (*IPContainerProxyDetails) GetCrcString() string { + return "d528df63" +} +func (*IPContainerProxyDetails) GetMessageType() api.MessageType { + return api.ReplyMessage +} + // IPSourceAndPortRangeCheckAddDel represents the VPP binary API message 'ip_source_and_port_range_check_add_del'. // // "ip_source_and_port_range_check_add_del", @@ -4560,6 +4629,7 @@ type Services interface { DumpIP6Mfib(*IP6MfibDump) (*IP6MfibDetails, error) DumpIP6ndProxy(*IP6ndProxyDump) (*IP6ndProxyDetails, error) DumpIPAddress(*IPAddressDump) (*IPAddressDetails, error) + DumpIPContainerProxy(*IPContainerProxyDump) (*IPContainerProxyDetails, error) DumpIP(*IPDump) (*IPDetails, error) DumpIPFib(*IPFibDump) (*IPFibDetails, error) DumpIPMfib(*IPMfibDump) (*IPMfibDetails, error) @@ -4649,6 +4719,8 @@ func init() { api.RegisterMessage((*IPPuntRedirectReply)(nil), "ip.IPPuntRedirectReply") api.RegisterMessage((*IPContainerProxyAddDel)(nil), "ip.IPContainerProxyAddDel") api.RegisterMessage((*IPContainerProxyAddDelReply)(nil), "ip.IPContainerProxyAddDelReply") + api.RegisterMessage((*IPContainerProxyDump)(nil), "ip.IPContainerProxyDump") + api.RegisterMessage((*IPContainerProxyDetails)(nil), "ip.IPContainerProxyDetails") api.RegisterMessage((*IPSourceAndPortRangeCheckAddDel)(nil), "ip.IPSourceAndPortRangeCheckAddDel") api.RegisterMessage((*IPSourceAndPortRangeCheckAddDelReply)(nil), "ip.IPSourceAndPortRangeCheckAddDelReply") api.RegisterMessage((*IPSourceAndPortRangeCheckInterfaceAddDel)(nil), "ip.IPSourceAndPortRangeCheckInterfaceAddDel") diff --git a/vpp.env b/vpp.env index 6d1b198e8d..34ff36aa07 100644 --- a/vpp.env +++ b/vpp.env @@ -1,2 +1,2 @@ VPP_REPO_URL=https://github.com/FDio/vpp.git -VPP_COMMIT=2fd4b56aea5833a4752525d58cac335909190e9c # v18.10-rc0~597-g2fd4b56a +VPP_COMMIT=02a95ce8d53caeba07a3c027b12339f44f3093b8 # v19.01-rc0-29-g02a95ce8 From f040f4c31035f856bb46543a990de5d2e3799218 Mon Sep 17 00:00:00 2001 From: Vladimir Lavor Date: Tue, 20 Nov 2018 09:59:12 +0100 Subject: [PATCH 6/9] update VPP to v19.01-rc0~234-gb11175d7 Signed-off-by: Vladimir Lavor --- .../vpp/binapi/interfaces/interfaces.ba.go | 8 +- plugins/vpp/binapi/ip/ip.ba.go | 83 +----- plugins/vpp/binapi/ipsec/ipsec.ba.go | 87 +++++- plugins/vpp/binapi/l2/l2.ba.go | 268 ++++++++++++++++-- .../l2plugin/vppcalls/arp_term_vppcalls.go | 19 +- .../vppcalls/arp_term_vppcalls_test.go | 36 ++- vpp.env | 2 +- 7 files changed, 375 insertions(+), 128 deletions(-) diff --git a/plugins/vpp/binapi/interfaces/interfaces.ba.go b/plugins/vpp/binapi/interfaces/interfaces.ba.go index e00fc55f31..73a4a52575 100644 --- a/plugins/vpp/binapi/interfaces/interfaces.ba.go +++ b/plugins/vpp/binapi/interfaces/interfaces.ba.go @@ -696,7 +696,7 @@ func (*WantInterfaceEventsReply) GetMessageType() api.MessageType { // "link_duplex" // ], // [ -// "u8", +// "u32", // "link_speed" // ], // [ @@ -792,7 +792,7 @@ func (*WantInterfaceEventsReply) GetMessageType() api.MessageType { // "i_sid" // ], // { -// "crc": "0x09b4b510" +// "crc": "0xe4ee7eb6" // } // type SwInterfaceDetails struct { @@ -804,7 +804,7 @@ type SwInterfaceDetails struct { AdminUpDown uint8 LinkUpDown uint8 LinkDuplex uint8 - LinkSpeed uint8 + LinkSpeed uint32 LinkMtu uint16 Mtu []uint32 `struc:"[4]uint32"` SubID uint32 @@ -833,7 +833,7 @@ func (*SwInterfaceDetails) GetMessageName() string { return "sw_interface_details" } func (*SwInterfaceDetails) GetCrcString() string { - return "09b4b510" + return "e4ee7eb6" } func (*SwInterfaceDetails) GetMessageType() api.MessageType { return api.ReplyMessage diff --git a/plugins/vpp/binapi/ip/ip.ba.go b/plugins/vpp/binapi/ip/ip.ba.go index e0eb787ff9..7a85a9d0bf 100644 --- a/plugins/vpp/binapi/ip/ip.ba.go +++ b/plugins/vpp/binapi/ip/ip.ba.go @@ -5,11 +5,11 @@ Package ip is a generated from VPP binary API module 'ip'. It contains following objects: - 89 messages + 87 messages 10 types 1 enum 1 union - 43 services + 42 services */ package ip @@ -1671,82 +1671,6 @@ func (*SwInterfaceIP6EnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -// SwInterfaceIP6SetLinkLocalAddress represents the VPP binary API message 'sw_interface_ip6_set_link_local_address'. -// -// "sw_interface_ip6_set_link_local_address", -// [ -// "u16", -// "_vl_msg_id" -// ], -// [ -// "u32", -// "client_index" -// ], -// [ -// "u32", -// "context" -// ], -// [ -// "u32", -// "sw_if_index" -// ], -// [ -// "u8", -// "address", -// 16 -// ], -// { -// "crc": "0xd73bf1ab" -// } -// -type SwInterfaceIP6SetLinkLocalAddress struct { - SwIfIndex uint32 - Address []byte `struc:"[16]byte"` -} - -func (*SwInterfaceIP6SetLinkLocalAddress) GetMessageName() string { - return "sw_interface_ip6_set_link_local_address" -} -func (*SwInterfaceIP6SetLinkLocalAddress) GetCrcString() string { - return "d73bf1ab" -} -func (*SwInterfaceIP6SetLinkLocalAddress) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceIP6SetLinkLocalAddressReply represents the VPP binary API message 'sw_interface_ip6_set_link_local_address_reply'. -// -// "sw_interface_ip6_set_link_local_address_reply", -// [ -// "u16", -// "_vl_msg_id" -// ], -// [ -// "u32", -// "context" -// ], -// [ -// "i32", -// "retval" -// ], -// { -// "crc": "0xe8d4e804" -// } -// -type SwInterfaceIP6SetLinkLocalAddressReply struct { - Retval int32 -} - -func (*SwInterfaceIP6SetLinkLocalAddressReply) GetMessageName() string { - return "sw_interface_ip6_set_link_local_address_reply" -} -func (*SwInterfaceIP6SetLinkLocalAddressReply) GetCrcString() string { - return "e8d4e804" -} -func (*SwInterfaceIP6SetLinkLocalAddressReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - // IPAddDelRoute represents the VPP binary API message 'ip_add_del_route'. // // "ip_add_del_route", @@ -4662,7 +4586,6 @@ type Services interface { SetArpNeighborLimit(*SetArpNeighborLimit) (*SetArpNeighborLimitReply, error) SetIPFlowHash(*SetIPFlowHash) (*SetIPFlowHashReply, error) SwInterfaceIP6EnableDisable(*SwInterfaceIP6EnableDisable) (*SwInterfaceIP6EnableDisableReply, error) - SwInterfaceIP6SetLinkLocalAddress(*SwInterfaceIP6SetLinkLocalAddress) (*SwInterfaceIP6SetLinkLocalAddressReply, error) SwInterfaceIP6ndRaConfig(*SwInterfaceIP6ndRaConfig) (*SwInterfaceIP6ndRaConfigReply, error) SwInterfaceIP6ndRaPrefix(*SwInterfaceIP6ndRaPrefix) (*SwInterfaceIP6ndRaPrefixReply, error) WantIP4ArpEvents(*WantIP4ArpEvents) (*WantIP4ArpEventsReply, error) @@ -4695,8 +4618,6 @@ func init() { api.RegisterMessage((*IP6ndSendRouterSolicitationReply)(nil), "ip.IP6ndSendRouterSolicitationReply") api.RegisterMessage((*SwInterfaceIP6EnableDisable)(nil), "ip.SwInterfaceIP6EnableDisable") api.RegisterMessage((*SwInterfaceIP6EnableDisableReply)(nil), "ip.SwInterfaceIP6EnableDisableReply") - api.RegisterMessage((*SwInterfaceIP6SetLinkLocalAddress)(nil), "ip.SwInterfaceIP6SetLinkLocalAddress") - api.RegisterMessage((*SwInterfaceIP6SetLinkLocalAddressReply)(nil), "ip.SwInterfaceIP6SetLinkLocalAddressReply") api.RegisterMessage((*IPAddDelRoute)(nil), "ip.IPAddDelRoute") api.RegisterMessage((*IPAddDelRouteReply)(nil), "ip.IPAddDelRouteReply") api.RegisterMessage((*IPMrouteAddDel)(nil), "ip.IPMrouteAddDel") diff --git a/plugins/vpp/binapi/ipsec/ipsec.ba.go b/plugins/vpp/binapi/ipsec/ipsec.ba.go index ad9b683567..1c64d8195c 100644 --- a/plugins/vpp/binapi/ipsec/ipsec.ba.go +++ b/plugins/vpp/binapi/ipsec/ipsec.ba.go @@ -5,8 +5,8 @@ Package ipsec is a generated from VPP binary API module 'ipsec'. It contains following objects: - 48 messages - 24 services + 50 messages + 25 services */ package ipsec @@ -1875,6 +1875,86 @@ func (*IpsecSpdDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +// IpsecSpdInterfaceDump represents the VPP binary API message 'ipsec_spd_interface_dump'. +// +// "ipsec_spd_interface_dump", +// [ +// "u16", +// "_vl_msg_id" +// ], +// [ +// "u32", +// "client_index" +// ], +// [ +// "u32", +// "context" +// ], +// [ +// "u32", +// "spd_index" +// ], +// [ +// "u8", +// "spd_index_valid" +// ], +// { +// "crc": "0x8971de19" +// } +// +type IpsecSpdInterfaceDump struct { + SpdIndex uint32 + SpdIndexValid uint8 +} + +func (*IpsecSpdInterfaceDump) GetMessageName() string { + return "ipsec_spd_interface_dump" +} +func (*IpsecSpdInterfaceDump) GetCrcString() string { + return "8971de19" +} +func (*IpsecSpdInterfaceDump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +// IpsecSpdInterfaceDetails represents the VPP binary API message 'ipsec_spd_interface_details'. +// +// "ipsec_spd_interface_details", +// [ +// "u16", +// "_vl_msg_id" +// ], +// [ +// "u32", +// "context" +// ], +// [ +// "u32", +// "spd_index" +// ], +// [ +// "u32", +// "sw_if_index" +// ], +// { +// "crc": "0x2c54296d" +// } +// +type IpsecSpdInterfaceDetails struct { + SpdIndex uint32 + SwIfIndex uint32 +} + +func (*IpsecSpdInterfaceDetails) GetMessageName() string { + return "ipsec_spd_interface_details" +} +func (*IpsecSpdInterfaceDetails) GetCrcString() string { + return "2c54296d" +} +func (*IpsecSpdInterfaceDetails) GetMessageType() api.MessageType { + return api.ReplyMessage +} + // IpsecTunnelIfAddDel represents the VPP binary API message 'ipsec_tunnel_if_add_del'. // // "ipsec_tunnel_if_add_del", @@ -2401,6 +2481,7 @@ func (*IpsecTunnelIfSetSaReply) GetMessageType() api.MessageType { type Services interface { DumpIpsecSa(*IpsecSaDump) (*IpsecSaDetails, error) DumpIpsecSpd(*IpsecSpdDump) (*IpsecSpdDetails, error) + DumpIpsecSpdInterface(*IpsecSpdInterfaceDump) (*IpsecSpdInterfaceDetails, error) DumpIpsecSpds(*IpsecSpdsDump) (*IpsecSpdsDetails, error) Ikev2InitiateDelChildSa(*Ikev2InitiateDelChildSa) (*Ikev2InitiateDelChildSaReply, error) Ikev2InitiateDelIkeSa(*Ikev2InitiateDelIkeSa) (*Ikev2InitiateDelIkeSaReply, error) @@ -2466,6 +2547,8 @@ func init() { api.RegisterMessage((*IpsecSpdsDetails)(nil), "ipsec.IpsecSpdsDetails") api.RegisterMessage((*IpsecSpdDump)(nil), "ipsec.IpsecSpdDump") api.RegisterMessage((*IpsecSpdDetails)(nil), "ipsec.IpsecSpdDetails") + api.RegisterMessage((*IpsecSpdInterfaceDump)(nil), "ipsec.IpsecSpdInterfaceDump") + api.RegisterMessage((*IpsecSpdInterfaceDetails)(nil), "ipsec.IpsecSpdInterfaceDetails") api.RegisterMessage((*IpsecTunnelIfAddDel)(nil), "ipsec.IpsecTunnelIfAddDel") api.RegisterMessage((*IpsecTunnelIfAddDelReply)(nil), "ipsec.IpsecTunnelIfAddDelReply") api.RegisterMessage((*IpsecSaDump)(nil), "ipsec.IpsecSaDump") diff --git a/plugins/vpp/binapi/l2/l2.ba.go b/plugins/vpp/binapi/l2/l2.ba.go index 7d1aef8575..eb0e160720 100644 --- a/plugins/vpp/binapi/l2/l2.ba.go +++ b/plugins/vpp/binapi/l2/l2.ba.go @@ -6,8 +6,9 @@ It contains following objects: 45 messages - 2 types - 2 enums + 8 types + 3 enums + 1 union 22 services */ @@ -24,6 +25,28 @@ var _ = bytes.NewBuffer /* Enums */ +// AddressFamily represents the VPP binary API enum 'address_family'. +// +// "address_family", +// [ +// "ADDRESS_IP4", +// 0 +// ], +// [ +// "ADDRESS_IP6", +// 1 +// ], +// { +// "enumtype": "u32" +// } +// +type AddressFamily uint32 + +const ( + ADDRESS_IP4 AddressFamily = 0 + ADDRESS_IP6 AddressFamily = 1 +) + // BdFlags represents the VPP binary API enum 'bd_flags'. // // "bd_flags", @@ -90,6 +113,166 @@ const ( /* Types */ +// IP4Address represents the VPP binary API type 'ip4_address'. +// +// "ip4_address", +// [ +// "u8", +// "address", +// 4 +// ], +// { +// "crc": "0xfc4baa28" +// } +// +type IP4Address struct { + Address []byte `struc:"[4]byte"` +} + +func (*IP4Address) GetTypeName() string { + return "ip4_address" +} +func (*IP4Address) GetCrcString() string { + return "fc4baa28" +} + +// IP6Address represents the VPP binary API type 'ip6_address'. +// +// "ip6_address", +// [ +// "u8", +// "address", +// 16 +// ], +// { +// "crc": "0xad99ccc2" +// } +// +type IP6Address struct { + Address []byte `struc:"[16]byte"` +} + +func (*IP6Address) GetTypeName() string { + return "ip6_address" +} +func (*IP6Address) GetCrcString() string { + return "ad99ccc2" +} + +// Address represents the VPP binary API type 'address'. +// +// "address", +// [ +// "vl_api_address_family_t", +// "af" +// ], +// [ +// "vl_api_address_union_t", +// "un" +// ], +// { +// "crc": "0x09f11671" +// } +// +type Address struct { + Af AddressFamily + Un AddressUnion +} + +func (*Address) GetTypeName() string { + return "address" +} +func (*Address) GetCrcString() string { + return "09f11671" +} + +// Prefix represents the VPP binary API type 'prefix'. +// +// "prefix", +// [ +// "vl_api_address_t", +// "address" +// ], +// [ +// "u8", +// "address_length" +// ], +// { +// "crc": "0x0403aebc" +// } +// +type Prefix struct { + Address Address + AddressLength uint8 +} + +func (*Prefix) GetTypeName() string { + return "prefix" +} +func (*Prefix) GetCrcString() string { + return "0403aebc" +} + +// Mprefix represents the VPP binary API type 'mprefix'. +// +// "mprefix", +// [ +// "vl_api_address_family_t", +// "af" +// ], +// [ +// "u16", +// "grp_address_length" +// ], +// [ +// "vl_api_address_union_t", +// "grp_address" +// ], +// [ +// "vl_api_address_union_t", +// "src_address" +// ], +// { +// "crc": "0x1c4cba05" +// } +// +type Mprefix struct { + Af AddressFamily + GrpAddressLength uint16 + GrpAddress AddressUnion + SrcAddress AddressUnion +} + +func (*Mprefix) GetTypeName() string { + return "mprefix" +} +func (*Mprefix) GetCrcString() string { + return "1c4cba05" +} + +// MacAddress represents the VPP binary API type 'mac_address'. +// +// "mac_address", +// [ +// "u8", +// "bytes", +// 6 +// ], +// { +// "crc": "0xefdbdddc" +// } +// +type MacAddress struct { + Bytes []byte `struc:"[6]byte"` +} + +func (*MacAddress) GetTypeName() string { + return "mac_address" +} +func (*MacAddress) GetCrcString() string { + return "efdbdddc" +} + // MacEntry represents the VPP binary API type 'mac_entry'. // // "mac_entry", @@ -160,6 +343,60 @@ func (*BridgeDomainSwIf) GetCrcString() string { return "a06dd426" } +/* Unions */ + +// AddressUnion represents the VPP binary API union 'address_union'. +// +// "address_union", +// [ +// "vl_api_ip4_address_t", +// "ip4" +// ], +// [ +// "vl_api_ip6_address_t", +// "ip6" +// ], +// { +// "crc": "0xd68a2fb4" +// } +// +type AddressUnion struct { + Union_data [16]byte +} + +func (*AddressUnion) GetTypeName() string { + return "address_union" +} +func (*AddressUnion) GetCrcString() string { + return "d68a2fb4" +} + +func (u *AddressUnion) SetIP4(a IP4Address) { + var b = new(bytes.Buffer) + if err := struc.Pack(b, &a); err != nil { + return + } + copy(u.Union_data[:], b.Bytes()) +} +func (u *AddressUnion) GetIP4() (a IP4Address) { + var b = bytes.NewReader(u.Union_data[:]) + struc.Unpack(b, &a) + return +} + +func (u *AddressUnion) SetIP6(a IP6Address) { + var b = new(bytes.Buffer) + if err := struc.Pack(b, &a); err != nil { + return + } + copy(u.Union_data[:], b.Bytes()) +} +func (u *AddressUnion) GetIP6() (a IP6Address) { + var b = bytes.NewReader(u.Union_data[:]) + struc.Unpack(b, &a) + return +} + /* Messages */ // L2XconnectDetails represents the VPP binary API message 'l2_xconnect_details'. @@ -1781,36 +2018,29 @@ func (*SwInterfaceSetL2BridgeReply) GetMessageType() api.MessageType { // "is_add" // ], // [ -// "u8", -// "is_ipv6" -// ], -// [ -// "u8", -// "ip_address", -// 16 +// "vl_api_address_t", +// "ip" // ], // [ -// "u8", -// "mac_address", -// 6 +// "vl_api_mac_address_t", +// "mac" // ], // { -// "crc": "0x79f42817" +// "crc": "0xfb873902" // } // type BdIPMacAddDel struct { - BdID uint32 - IsAdd uint8 - IsIPv6 uint8 - IPAddress []byte `struc:"[16]byte"` - MacAddress []byte `struc:"[6]byte"` + BdID uint32 + IsAdd uint8 + IP Address + Mac MacAddress } func (*BdIPMacAddDel) GetMessageName() string { return "bd_ip_mac_add_del" } func (*BdIPMacAddDel) GetCrcString() string { - return "79f42817" + return "fb873902" } func (*BdIPMacAddDel) GetMessageType() api.MessageType { return api.RequestMessage diff --git a/plugins/vpp/l2plugin/vppcalls/arp_term_vppcalls.go b/plugins/vpp/l2plugin/vppcalls/arp_term_vppcalls.go index cf35a687a6..79a31de129 100644 --- a/plugins/vpp/l2plugin/vppcalls/arp_term_vppcalls.go +++ b/plugins/vpp/l2plugin/vppcalls/arp_term_vppcalls.go @@ -33,19 +33,26 @@ func (h *BridgeDomainVppHandler) callBdIPMacAddDel(isAdd bool, bdID uint32, mac if err != nil { return err } - req.MacAddress = macAddr + req.Mac = l2ba.MacAddress{Bytes: macAddr} isIpv6, err := addrs.IsIPv6(ip) if err != nil { return err } - ipAddr := net.ParseIP(ip) + parsedIP := net.ParseIP(ip) + var ipAddress [16]byte if isIpv6 { - req.IsIPv6 = 1 - req.IPAddress = []byte(ipAddr.To16()) + copy(ipAddress[:], []byte(parsedIP.To16())) + req.IP = l2ba.Address{ + Af: l2ba.ADDRESS_IP6, + Un: l2ba.AddressUnion{Union_data: ipAddress}, + } } else { - req.IsIPv6 = 0 - req.IPAddress = []byte(ipAddr.To4()) + copy(ipAddress[:], []byte(parsedIP.To4())) + req.IP = l2ba.Address{ + Af: l2ba.ADDRESS_IP4, + Un: l2ba.AddressUnion{Union_data: ipAddress}, + } } reply := &l2ba.BdIPMacAddDelReply{} diff --git a/plugins/vpp/l2plugin/vppcalls/arp_term_vppcalls_test.go b/plugins/vpp/l2plugin/vppcalls/arp_term_vppcalls_test.go index 5024e353c5..a9c2f5868f 100644 --- a/plugins/vpp/l2plugin/vppcalls/arp_term_vppcalls_test.go +++ b/plugins/vpp/l2plugin/vppcalls/arp_term_vppcalls_test.go @@ -32,11 +32,13 @@ func TestVppAddArpTerminationTableEntry(t *testing.T) { Expect(err).ShouldNot(HaveOccurred()) Expect(ctx.MockChannel.Msg).To(Equal(&l2ba.BdIPMacAddDel{ - BdID: 4, - IsAdd: 1, - IsIPv6: 0, - IPAddress: []byte{192, 168, 4, 4}, - MacAddress: []byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, + BdID: 4, + IsAdd: 1, + IP: l2ba.Address{ + Af: l2ba.ADDRESS_IP4, + Un: l2ba.AddressUnion{Union_data: [16]byte{192, 168, 4, 4}}, + }, + Mac: l2ba.MacAddress{Bytes: []byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}}, })) } @@ -50,11 +52,13 @@ func TestVppAddArpTerminationTableEntryIPv6(t *testing.T) { Expect(err).ShouldNot(HaveOccurred()) Expect(ctx.MockChannel.Msg).To(Equal(&l2ba.BdIPMacAddDel{ - BdID: 4, - IsAdd: 1, - IsIPv6: 1, - IPAddress: []byte{32, 1, 13, 185, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84}, - MacAddress: []byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, + BdID: 4, + IsAdd: 1, + IP: l2ba.Address{ + Af: l2ba.ADDRESS_IP6, + Un: l2ba.AddressUnion{Union_data: [16]byte{32, 1, 13, 185, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84}}, + }, + Mac: l2ba.MacAddress{Bytes: []byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}}, })) } @@ -68,11 +72,13 @@ func TestVppRemoveArpTerminationTableEntry(t *testing.T) { Expect(err).ShouldNot(HaveOccurred()) Expect(ctx.MockChannel.Msg).To(Equal(&l2ba.BdIPMacAddDel{ - BdID: 4, - IsAdd: 0, - IsIPv6: 0, - IPAddress: []byte{192, 168, 4, 4}, - MacAddress: []byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, + BdID: 4, + IsAdd: 0, + IP: l2ba.Address{ + Af: l2ba.ADDRESS_IP4, + Un: l2ba.AddressUnion{Union_data: [16]byte{192, 168, 4, 4}}, + }, + Mac: l2ba.MacAddress{Bytes: []byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}}, })) } diff --git a/vpp.env b/vpp.env index 34ff36aa07..51148fe544 100644 --- a/vpp.env +++ b/vpp.env @@ -1,2 +1,2 @@ VPP_REPO_URL=https://github.com/FDio/vpp.git -VPP_COMMIT=02a95ce8d53caeba07a3c027b12339f44f3093b8 # v19.01-rc0-29-g02a95ce8 +VPP_COMMIT=b11175d797c11880d19442f178db5df526ca1256 # v19.01-rc0~234-gb11175d7 From 46fcf3322d47169f0c75af2316c82b2fdc47e5e8 Mon Sep 17 00:00:00 2001 From: Vladimir Lavor Date: Tue, 27 Nov 2018 11:00:48 +0100 Subject: [PATCH 7/9] update VPP to v19.01-rc0~234-gb11175d7 (vpp checkpoint) Signed-off-by: Vladimir Lavor --- plugins/vpp/binapi/ipsec/ipsec.ba.go | 165 ++++++++++++++++++++++++++- vpp.env | 2 +- 2 files changed, 164 insertions(+), 3 deletions(-) diff --git a/plugins/vpp/binapi/ipsec/ipsec.ba.go b/plugins/vpp/binapi/ipsec/ipsec.ba.go index 1c64d8195c..28480bd9fd 100644 --- a/plugins/vpp/binapi/ipsec/ipsec.ba.go +++ b/plugins/vpp/binapi/ipsec/ipsec.ba.go @@ -5,8 +5,8 @@ Package ipsec is a generated from VPP binary API module 'ipsec'. It contains following objects: - 50 messages - 25 services + 54 messages + 27 services */ package ipsec @@ -2476,9 +2476,165 @@ func (*IpsecTunnelIfSetSaReply) GetMessageType() api.MessageType { return api.ReplyMessage } +// IpsecBackendDump represents the VPP binary API message 'ipsec_backend_dump'. +// +// "ipsec_backend_dump", +// [ +// "u16", +// "_vl_msg_id" +// ], +// [ +// "u32", +// "client_index" +// ], +// [ +// "u32", +// "context" +// ], +// { +// "crc": "0x51077d14" +// } +// +type IpsecBackendDump struct{} + +func (*IpsecBackendDump) GetMessageName() string { + return "ipsec_backend_dump" +} +func (*IpsecBackendDump) GetCrcString() string { + return "51077d14" +} +func (*IpsecBackendDump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +// IpsecBackendDetails represents the VPP binary API message 'ipsec_backend_details'. +// +// "ipsec_backend_details", +// [ +// "u16", +// "_vl_msg_id" +// ], +// [ +// "u32", +// "context" +// ], +// [ +// "u8", +// "name", +// 128 +// ], +// [ +// "u8", +// "protocol" +// ], +// [ +// "u8", +// "index" +// ], +// [ +// "u8", +// "active" +// ], +// { +// "crc": "0x3ba4d642" +// } +// +type IpsecBackendDetails struct { + Name []byte `struc:"[128]byte"` + Protocol uint8 + Index uint8 + Active uint8 +} + +func (*IpsecBackendDetails) GetMessageName() string { + return "ipsec_backend_details" +} +func (*IpsecBackendDetails) GetCrcString() string { + return "3ba4d642" +} +func (*IpsecBackendDetails) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +// IpsecSelectBackend represents the VPP binary API message 'ipsec_select_backend'. +// +// "ipsec_select_backend", +// [ +// "u16", +// "_vl_msg_id" +// ], +// [ +// "u32", +// "client_index" +// ], +// [ +// "u32", +// "context" +// ], +// [ +// "u8", +// "protocol" +// ], +// [ +// "u8", +// "index" +// ], +// { +// "crc": "0xf2cc2b47" +// } +// +type IpsecSelectBackend struct { + Protocol uint8 + Index uint8 +} + +func (*IpsecSelectBackend) GetMessageName() string { + return "ipsec_select_backend" +} +func (*IpsecSelectBackend) GetCrcString() string { + return "f2cc2b47" +} +func (*IpsecSelectBackend) GetMessageType() api.MessageType { + return api.RequestMessage +} + +// IpsecSelectBackendReply represents the VPP binary API message 'ipsec_select_backend_reply'. +// +// "ipsec_select_backend_reply", +// [ +// "u16", +// "_vl_msg_id" +// ], +// [ +// "u32", +// "context" +// ], +// [ +// "i32", +// "retval" +// ], +// { +// "crc": "0xe8d4e804" +// } +// +type IpsecSelectBackendReply struct { + Retval int32 +} + +func (*IpsecSelectBackendReply) GetMessageName() string { + return "ipsec_select_backend_reply" +} +func (*IpsecSelectBackendReply) GetCrcString() string { + return "e8d4e804" +} +func (*IpsecSelectBackendReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + /* Services */ type Services interface { + DumpIpsecBackend(*IpsecBackendDump) (*IpsecBackendDetails, error) DumpIpsecSa(*IpsecSaDump) (*IpsecSaDetails, error) DumpIpsecSpd(*IpsecSpdDump) (*IpsecSpdDetails, error) DumpIpsecSpdInterface(*IpsecSpdInterfaceDump) (*IpsecSpdInterfaceDetails, error) @@ -2499,6 +2655,7 @@ type Services interface { IpsecInterfaceAddDelSpd(*IpsecInterfaceAddDelSpd) (*IpsecInterfaceAddDelSpdReply, error) IpsecSaSetKey(*IpsecSaSetKey) (*IpsecSaSetKeyReply, error) IpsecSadAddDelEntry(*IpsecSadAddDelEntry) (*IpsecSadAddDelEntryReply, error) + IpsecSelectBackend(*IpsecSelectBackend) (*IpsecSelectBackendReply, error) IpsecSpdAddDel(*IpsecSpdAddDel) (*IpsecSpdAddDelReply, error) IpsecSpdAddDelEntry(*IpsecSpdAddDelEntry) (*IpsecSpdAddDelEntryReply, error) IpsecTunnelIfAddDel(*IpsecTunnelIfAddDel) (*IpsecTunnelIfAddDelReply, error) @@ -2557,4 +2714,8 @@ func init() { api.RegisterMessage((*IpsecTunnelIfSetKeyReply)(nil), "ipsec.IpsecTunnelIfSetKeyReply") api.RegisterMessage((*IpsecTunnelIfSetSa)(nil), "ipsec.IpsecTunnelIfSetSa") api.RegisterMessage((*IpsecTunnelIfSetSaReply)(nil), "ipsec.IpsecTunnelIfSetSaReply") + api.RegisterMessage((*IpsecBackendDump)(nil), "ipsec.IpsecBackendDump") + api.RegisterMessage((*IpsecBackendDetails)(nil), "ipsec.IpsecBackendDetails") + api.RegisterMessage((*IpsecSelectBackend)(nil), "ipsec.IpsecSelectBackend") + api.RegisterMessage((*IpsecSelectBackendReply)(nil), "ipsec.IpsecSelectBackendReply") } diff --git a/vpp.env b/vpp.env index 51148fe544..f6930911ab 100644 --- a/vpp.env +++ b/vpp.env @@ -1,2 +1,2 @@ VPP_REPO_URL=https://github.com/FDio/vpp.git -VPP_COMMIT=b11175d797c11880d19442f178db5df526ca1256 # v19.01-rc0~234-gb11175d7 +VPP_COMMIT=a7dcae72cf4520df64dd75427541ca3c11cd8475 # v19.01-rc0~256-ga7dcae72 From 1b8c6b9fb7629d94c8306d4f9893db1f59c6d887 Mon Sep 17 00:00:00 2001 From: Vladimir Lavor Date: Tue, 11 Dec 2018 09:55:52 +0100 Subject: [PATCH 8/9] update VPP to v19.01-rc0~394-g6b4a32de (vpp checkpoint) Signed-off-by: Vladimir Lavor --- plugins/vpp/binapi/ip/ip.ba.go | 306 ++++++++++++++++++++--- plugins/vpp/binapi/l2/l2.ba.go | 56 ++++- plugins/vpp/binapi/session/session.ba.go | 61 +++-- 3 files changed, 366 insertions(+), 57 deletions(-) diff --git a/plugins/vpp/binapi/ip/ip.ba.go b/plugins/vpp/binapi/ip/ip.ba.go index 7a85a9d0bf..0aaca8084e 100644 --- a/plugins/vpp/binapi/ip/ip.ba.go +++ b/plugins/vpp/binapi/ip/ip.ba.go @@ -5,11 +5,11 @@ Package ip is a generated from VPP binary API module 'ip'. It contains following objects: - 87 messages - 10 types + 91 messages + 13 types 1 enum 1 union - 42 services + 44 services */ package ip @@ -186,6 +186,60 @@ func (*Mprefix) GetCrcString() string { return "1c4cba05" } +// IP6Prefix represents the VPP binary API type 'ip6_prefix'. +// +// "ip6_prefix", +// [ +// "vl_api_ip6_address_t", +// "prefix" +// ], +// [ +// "u8", +// "len" +// ], +// { +// "crc": "0x779fd64f" +// } +// +type IP6Prefix struct { + Prefix IP6Address + Len uint8 +} + +func (*IP6Prefix) GetTypeName() string { + return "ip6_prefix" +} +func (*IP6Prefix) GetCrcString() string { + return "779fd64f" +} + +// IP4Prefix represents the VPP binary API type 'ip4_prefix'. +// +// "ip4_prefix", +// [ +// "vl_api_ip4_address_t", +// "prefix" +// ], +// [ +// "u8", +// "len" +// ], +// { +// "crc": "0xea8dc11d" +// } +// +type IP4Prefix struct { + Prefix IP4Address + Len uint8 +} + +func (*IP4Prefix) GetTypeName() string { + return "ip4_prefix" +} +func (*IP4Prefix) GetCrcString() string { + return "ea8dc11d" +} + // FibMplsLabel represents the VPP binary API type 'fib_mpls_label'. // // "fib_mpls_label", @@ -365,6 +419,38 @@ func (*MacAddress) GetCrcString() string { return "efdbdddc" } +// PuntRedirect represents the VPP binary API type 'punt_redirect'. +// +// "punt_redirect", +// [ +// "u32", +// "rx_sw_if_index" +// ], +// [ +// "u32", +// "tx_sw_if_index" +// ], +// [ +// "vl_api_address_t", +// "nh" +// ], +// { +// "crc": "0x3e7a801f" +// } +// +type PuntRedirect struct { + RxSwIfIndex uint32 + TxSwIfIndex uint32 + Nh Address +} + +func (*PuntRedirect) GetTypeName() string { + return "punt_redirect" +} +func (*PuntRedirect) GetCrcString() string { + return "3e7a801f" +} + // IP6RaPrefixInfo represents the VPP binary API type 'ip6_ra_prefix_info'. // // "ip6_ra_prefix_info", @@ -1036,26 +1122,31 @@ func (*IPNeighborAddDelReply) GetMessageType() api.MessageType { // "u8", // "reverse" // ], +// [ +// "u8", +// "symmetric" +// ], // { -// "crc": "0x32ebf737" +// "crc": "0xa9084bfb" // } // type SetIPFlowHash struct { - VrfID uint32 - IsIPv6 uint8 - Src uint8 - Dst uint8 - Sport uint8 - Dport uint8 - Proto uint8 - Reverse uint8 + VrfID uint32 + IsIPv6 uint8 + Src uint8 + Dst uint8 + Sport uint8 + Dport uint8 + Proto uint8 + Reverse uint8 + Symmetric uint8 } func (*SetIPFlowHash) GetMessageName() string { return "set_ip_flow_hash" } func (*SetIPFlowHash) GetCrcString() string { - return "32ebf737" + return "a9084bfb" } func (*SetIPFlowHash) GetMessageType() api.MessageType { return api.RequestMessage @@ -2658,43 +2749,27 @@ func (*IPPuntPoliceReply) GetMessageType() api.MessageType { // "context" // ], // [ -// "u32", -// "rx_sw_if_index" -// ], -// [ -// "u32", -// "tx_sw_if_index" +// "vl_api_punt_redirect_t", +// "punt" // ], // [ // "u8", // "is_add" // ], -// [ -// "u8", -// "is_ip6" -// ], -// [ -// "u8", -// "nh", -// 16 -// ], // { -// "crc": "0x996b6603" +// "crc": "0xa953495b" // } // type IPPuntRedirect struct { - RxSwIfIndex uint32 - TxSwIfIndex uint32 - IsAdd uint8 - IsIP6 uint8 - Nh []byte `struc:"[16]byte"` + Punt PuntRedirect + IsAdd uint8 } func (*IPPuntRedirect) GetMessageName() string { return "ip_punt_redirect" } func (*IPPuntRedirect) GetCrcString() string { - return "996b6603" + return "a953495b" } func (*IPPuntRedirect) GetMessageType() api.MessageType { return api.RequestMessage @@ -2733,6 +2808,81 @@ func (*IPPuntRedirectReply) GetMessageType() api.MessageType { return api.ReplyMessage } +// IPPuntRedirectDump represents the VPP binary API message 'ip_punt_redirect_dump'. +// +// "ip_punt_redirect_dump", +// [ +// "u16", +// "_vl_msg_id" +// ], +// [ +// "u32", +// "client_index" +// ], +// [ +// "u32", +// "context" +// ], +// [ +// "u32", +// "sw_if_index" +// ], +// [ +// "u8", +// "is_ipv6" +// ], +// { +// "crc": "0x6b7bcd0a" +// } +// +type IPPuntRedirectDump struct { + SwIfIndex uint32 + IsIPv6 uint8 +} + +func (*IPPuntRedirectDump) GetMessageName() string { + return "ip_punt_redirect_dump" +} +func (*IPPuntRedirectDump) GetCrcString() string { + return "6b7bcd0a" +} +func (*IPPuntRedirectDump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +// IPPuntRedirectDetails represents the VPP binary API message 'ip_punt_redirect_details'. +// +// "ip_punt_redirect_details", +// [ +// "u16", +// "_vl_msg_id" +// ], +// [ +// "u32", +// "context" +// ], +// [ +// "vl_api_punt_redirect_t", +// "punt" +// ], +// { +// "crc": "0xa47f70da" +// } +// +type IPPuntRedirectDetails struct { + Punt PuntRedirect +} + +func (*IPPuntRedirectDetails) GetMessageName() string { + return "ip_punt_redirect_details" +} +func (*IPPuntRedirectDetails) GetCrcString() string { + return "a47f70da" +} +func (*IPPuntRedirectDetails) GetMessageType() api.MessageType { + return api.ReplyMessage +} + // IPContainerProxyAddDel represents the VPP binary API message 'ip_container_proxy_add_del'. // // "ip_container_proxy_add_del", @@ -3096,6 +3246,86 @@ func (*IPSourceAndPortRangeCheckInterfaceAddDelReply) GetMessageType() api.Messa return api.ReplyMessage } +// IPSourceCheckInterfaceAddDel represents the VPP binary API message 'ip_source_check_interface_add_del'. +// +// "ip_source_check_interface_add_del", +// [ +// "u16", +// "_vl_msg_id" +// ], +// [ +// "u32", +// "client_index" +// ], +// [ +// "u32", +// "context" +// ], +// [ +// "u8", +// "is_add" +// ], +// [ +// "u8", +// "loose" +// ], +// [ +// "u32", +// "sw_if_index" +// ], +// { +// "crc": "0x0a60152a" +// } +// +type IPSourceCheckInterfaceAddDel struct { + IsAdd uint8 + Loose uint8 + SwIfIndex uint32 +} + +func (*IPSourceCheckInterfaceAddDel) GetMessageName() string { + return "ip_source_check_interface_add_del" +} +func (*IPSourceCheckInterfaceAddDel) GetCrcString() string { + return "0a60152a" +} +func (*IPSourceCheckInterfaceAddDel) GetMessageType() api.MessageType { + return api.RequestMessage +} + +// IPSourceCheckInterfaceAddDelReply represents the VPP binary API message 'ip_source_check_interface_add_del_reply'. +// +// "ip_source_check_interface_add_del_reply", +// [ +// "u16", +// "_vl_msg_id" +// ], +// [ +// "u32", +// "context" +// ], +// [ +// "i32", +// "retval" +// ], +// { +// "crc": "0xe8d4e804" +// } +// +type IPSourceCheckInterfaceAddDelReply struct { + Retval int32 +} + +func (*IPSourceCheckInterfaceAddDelReply) GetMessageName() string { + return "ip_source_check_interface_add_del_reply" +} +func (*IPSourceCheckInterfaceAddDelReply) GetCrcString() string { + return "e8d4e804" +} +func (*IPSourceCheckInterfaceAddDelReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + // IPScanNeighborEnableDisable represents the VPP binary API message 'ip_scan_neighbor_enable_disable'. // // "ip_scan_neighbor_enable_disable", @@ -4558,6 +4788,7 @@ type Services interface { DumpIPFib(*IPFibDump) (*IPFibDetails, error) DumpIPMfib(*IPMfibDump) (*IPMfibDetails, error) DumpIPNeighbor(*IPNeighborDump) (*IPNeighborDetails, error) + DumpIPPuntRedirect(*IPPuntRedirectDump) (*IPPuntRedirectDetails, error) DumpIPUnnumbered(*IPUnnumberedDump) (*IPUnnumberedDetails, error) DumpMfibSignal(*MfibSignalDump) (*MfibSignalDetails, error) DumpProxyArp(*ProxyArpDump) (*ProxyArpDetails, error) @@ -4579,6 +4810,7 @@ type Services interface { IPScanNeighborEnableDisable(*IPScanNeighborEnableDisable) (*IPScanNeighborEnableDisableReply, error) IPSourceAndPortRangeCheckAddDel(*IPSourceAndPortRangeCheckAddDel) (*IPSourceAndPortRangeCheckAddDelReply, error) IPSourceAndPortRangeCheckInterfaceAddDel(*IPSourceAndPortRangeCheckInterfaceAddDel) (*IPSourceAndPortRangeCheckInterfaceAddDelReply, error) + IPSourceCheckInterfaceAddDel(*IPSourceCheckInterfaceAddDel) (*IPSourceCheckInterfaceAddDelReply, error) IPTableAddDel(*IPTableAddDel) (*IPTableAddDelReply, error) ProxyArpAddDel(*ProxyArpAddDel) (*ProxyArpAddDelReply, error) ProxyArpIntfcEnableDisable(*ProxyArpIntfcEnableDisable) (*ProxyArpIntfcEnableDisableReply, error) @@ -4638,6 +4870,8 @@ func init() { api.RegisterMessage((*IPPuntPoliceReply)(nil), "ip.IPPuntPoliceReply") api.RegisterMessage((*IPPuntRedirect)(nil), "ip.IPPuntRedirect") api.RegisterMessage((*IPPuntRedirectReply)(nil), "ip.IPPuntRedirectReply") + api.RegisterMessage((*IPPuntRedirectDump)(nil), "ip.IPPuntRedirectDump") + api.RegisterMessage((*IPPuntRedirectDetails)(nil), "ip.IPPuntRedirectDetails") api.RegisterMessage((*IPContainerProxyAddDel)(nil), "ip.IPContainerProxyAddDel") api.RegisterMessage((*IPContainerProxyAddDelReply)(nil), "ip.IPContainerProxyAddDelReply") api.RegisterMessage((*IPContainerProxyDump)(nil), "ip.IPContainerProxyDump") @@ -4646,6 +4880,8 @@ func init() { api.RegisterMessage((*IPSourceAndPortRangeCheckAddDelReply)(nil), "ip.IPSourceAndPortRangeCheckAddDelReply") api.RegisterMessage((*IPSourceAndPortRangeCheckInterfaceAddDel)(nil), "ip.IPSourceAndPortRangeCheckInterfaceAddDel") api.RegisterMessage((*IPSourceAndPortRangeCheckInterfaceAddDelReply)(nil), "ip.IPSourceAndPortRangeCheckInterfaceAddDelReply") + api.RegisterMessage((*IPSourceCheckInterfaceAddDel)(nil), "ip.IPSourceCheckInterfaceAddDel") + api.RegisterMessage((*IPSourceCheckInterfaceAddDelReply)(nil), "ip.IPSourceCheckInterfaceAddDelReply") api.RegisterMessage((*IPScanNeighborEnableDisable)(nil), "ip.IPScanNeighborEnableDisable") api.RegisterMessage((*IPScanNeighborEnableDisableReply)(nil), "ip.IPScanNeighborEnableDisableReply") api.RegisterMessage((*IPProbeNeighbor)(nil), "ip.IPProbeNeighbor") diff --git a/plugins/vpp/binapi/l2/l2.ba.go b/plugins/vpp/binapi/l2/l2.ba.go index eb0e160720..08f7757838 100644 --- a/plugins/vpp/binapi/l2/l2.ba.go +++ b/plugins/vpp/binapi/l2/l2.ba.go @@ -6,7 +6,7 @@ It contains following objects: 45 messages - 8 types + 10 types 3 enums 1 union 22 services @@ -250,6 +250,60 @@ func (*Mprefix) GetCrcString() string { return "1c4cba05" } +// IP6Prefix represents the VPP binary API type 'ip6_prefix'. +// +// "ip6_prefix", +// [ +// "vl_api_ip6_address_t", +// "prefix" +// ], +// [ +// "u8", +// "len" +// ], +// { +// "crc": "0x779fd64f" +// } +// +type IP6Prefix struct { + Prefix IP6Address + Len uint8 +} + +func (*IP6Prefix) GetTypeName() string { + return "ip6_prefix" +} +func (*IP6Prefix) GetCrcString() string { + return "779fd64f" +} + +// IP4Prefix represents the VPP binary API type 'ip4_prefix'. +// +// "ip4_prefix", +// [ +// "vl_api_ip4_address_t", +// "prefix" +// ], +// [ +// "u8", +// "len" +// ], +// { +// "crc": "0xea8dc11d" +// } +// +type IP4Prefix struct { + Prefix IP4Address + Len uint8 +} + +func (*IP4Prefix) GetTypeName() string { + return "ip4_prefix" +} +func (*IP4Prefix) GetCrcString() string { + return "ea8dc11d" +} + // MacAddress represents the VPP binary API type 'mac_address'. // // "mac_address", diff --git a/plugins/vpp/binapi/session/session.ba.go b/plugins/vpp/binapi/session/session.ba.go index d5f268c9e7..9292d8551c 100644 --- a/plugins/vpp/binapi/session/session.ba.go +++ b/plugins/vpp/binapi/session/session.ba.go @@ -116,8 +116,16 @@ func (*ApplicationAttach) GetMessageType() api.MessageType { // "segment_name", // 128 // ], +// [ +// "u32", +// "app_index" +// ], +// [ +// "u64", +// "segment_handle" +// ], // { -// "crc": "0x8d501943" +// "crc": "0x581866e8" // } // type ApplicationAttachReply struct { @@ -128,13 +136,15 @@ type ApplicationAttachReply struct { SegmentSize uint32 SegmentNameLength uint8 SegmentName []byte `struc:"[128]byte"` + AppIndex uint32 + SegmentHandle uint64 } func (*ApplicationAttachReply) GetMessageName() string { return "application_attach_reply" } func (*ApplicationAttachReply) GetCrcString() string { - return "8d501943" + return "581866e8" } func (*ApplicationAttachReply) GetMessageType() api.MessageType { return api.ReplyMessage @@ -396,21 +406,26 @@ func (*ApplicationDetachReply) GetMessageType() api.MessageType { // "segment_name", // 128 // ], +// [ +// "u64", +// "segment_handle" +// ], // { -// "crc": "0x2b743078" +// "crc": "0xdc2d630b" // } // type MapAnotherSegment struct { - FdFlags uint8 - SegmentSize uint32 - SegmentName []byte `struc:"[128]byte"` + FdFlags uint8 + SegmentSize uint32 + SegmentName []byte `struc:"[128]byte"` + SegmentHandle uint64 } func (*MapAnotherSegment) GetMessageName() string { return "map_another_segment" } func (*MapAnotherSegment) GetCrcString() string { - return "2b743078" + return "dc2d630b" } func (*MapAnotherSegment) GetMessageType() api.MessageType { return api.RequestMessage @@ -465,23 +480,22 @@ func (*MapAnotherSegmentReply) GetMessageType() api.MessageType { // "context" // ], // [ -// "u8", -// "segment_name", -// 128 +// "u64", +// "segment_handle" // ], // { -// "crc": "0x15ffd8c6" +// "crc": "0xf77096f6" // } // type UnmapSegment struct { - SegmentName []byte `struc:"[128]byte"` + SegmentHandle uint64 } func (*UnmapSegment) GetMessageName() string { return "unmap_segment" } func (*UnmapSegment) GetCrcString() string { - return "15ffd8c6" + return "f77096f6" } func (*UnmapSegment) GetMessageType() api.MessageType { return api.RequestMessage @@ -1627,7 +1641,7 @@ func (*AppCutThroughRegistrationAddReply) GetMessageType() api.MessageType { // ], // [ // "u32", -// "app_api_index" +// "app_index" // ], // [ // "u32", @@ -1638,20 +1652,20 @@ func (*AppCutThroughRegistrationAddReply) GetMessageType() api.MessageType { // "is_add" // ], // { -// "crc": "0x8cd304f4" +// "crc": "0x6d2b2279" // } // type AppWorkerAddDel struct { - AppAPIIndex uint32 - WrkIndex uint32 - IsAdd uint8 + AppIndex uint32 + WrkIndex uint32 + IsAdd uint8 } func (*AppWorkerAddDel) GetMessageName() string { return "app_worker_add_del" } func (*AppWorkerAddDel) GetCrcString() string { - return "8cd304f4" + return "6d2b2279" } func (*AppWorkerAddDel) GetMessageType() api.MessageType { return api.RequestMessage @@ -1698,11 +1712,15 @@ func (*AppWorkerAddDel) GetMessageType() api.MessageType { // 128 // ], // [ +// "u64", +// "segment_handle" +// ], +// [ // "u8", // "is_add" // ], // { -// "crc": "0xd5297212" +// "crc": "0x56b21abc" // } // type AppWorkerAddDelReply struct { @@ -1713,6 +1731,7 @@ type AppWorkerAddDelReply struct { FdFlags uint8 SegmentNameLength uint8 SegmentName []byte `struc:"[128]byte"` + SegmentHandle uint64 IsAdd uint8 } @@ -1720,7 +1739,7 @@ func (*AppWorkerAddDelReply) GetMessageName() string { return "app_worker_add_del_reply" } func (*AppWorkerAddDelReply) GetCrcString() string { - return "d5297212" + return "56b21abc" } func (*AppWorkerAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage From 56a7f01ed6ee1e2426574b87addf00e39503e80e Mon Sep 17 00:00:00 2001 From: Vladimir Lavor Date: Tue, 11 Dec 2018 10:11:27 +0100 Subject: [PATCH 9/9] updated vpp.env Signed-off-by: Vladimir Lavor --- vpp.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vpp.env b/vpp.env index f6930911ab..f9f4389e38 100644 --- a/vpp.env +++ b/vpp.env @@ -1,2 +1,2 @@ VPP_REPO_URL=https://github.com/FDio/vpp.git -VPP_COMMIT=a7dcae72cf4520df64dd75427541ca3c11cd8475 # v19.01-rc0~256-ga7dcae72 +VPP_COMMIT=6b4a32ded6d3db56d886e79154e8329bdfc0ed2a # v19.01-rc0~394-g6b4a32de