aboutsummaryrefslogtreecommitdiffstats
path: root/examples/multi-vpp/multi_vpp.go
diff options
context:
space:
mode:
authorOndrej Fabry <ofabry@cisco.com>2020-07-17 10:36:28 +0200
committerOndrej Fabry <ofabry@cisco.com>2020-07-17 11:43:41 +0200
commitd1f24d37bd447b64e402298bb8eb2479681facf9 (patch)
treea3fc21ba730a91d8a402c7a5bf9c614e3677c4fc /examples/multi-vpp/multi_vpp.go
parent1548c7e12531e3d055567d761c580a1c7ff0ac40 (diff)
Improve binapi generator
- simplified Size/Marshal/Unmarshal methods - replace struc in unions with custom marshal/unmarshal - fix imports in generated files - fix mock adapter - generate rpc service using low-level stream API (dumps generate control ping or stream msg..) - move examples/binapi to binapi and generate all API for latest release - add binapigen.Plugin for developing custom generator plugins - optionally generate HTTP handlers (REST API) for RPC services - add govpp program for browsing VPP API Change-Id: I092e9ed2b0c17972b3476463c3d4b14dd76ed42b Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Diffstat (limited to 'examples/multi-vpp/multi_vpp.go')
-rw-r--r--examples/multi-vpp/multi_vpp.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/multi-vpp/multi_vpp.go b/examples/multi-vpp/multi_vpp.go
index 244dd03..8714c9a 100644
--- a/examples/multi-vpp/multi_vpp.go
+++ b/examples/multi-vpp/multi_vpp.go
@@ -18,17 +18,18 @@ package main
import (
"flag"
"fmt"
+ "log"
+ "os"
+
"git.fd.io/govpp.git"
"git.fd.io/govpp.git/adapter/socketclient"
"git.fd.io/govpp.git/api"
+ interfaces "git.fd.io/govpp.git/binapi/interface"
+ "git.fd.io/govpp.git/binapi/interface_types"
+ "git.fd.io/govpp.git/binapi/ip"
+ "git.fd.io/govpp.git/binapi/ip_types"
+ "git.fd.io/govpp.git/binapi/vpe"
"git.fd.io/govpp.git/core"
- "git.fd.io/govpp.git/examples/binapi/interface_types"
- "git.fd.io/govpp.git/examples/binapi/interfaces"
- "git.fd.io/govpp.git/examples/binapi/ip"
- "git.fd.io/govpp.git/examples/binapi/ip_types"
- "git.fd.io/govpp.git/examples/binapi/vpe"
- "log"
- "os"
)
var (
@@ -175,7 +176,6 @@ func addIPToInterface(ch api.Channel, index interface_types.InterfaceIndex, ip s
return
}
-
req := &interfaces.SwInterfaceAddDelAddress{
SwIfIndex: index,
IsAdd: true,
@@ -212,7 +212,7 @@ func retrieveIPAddresses(ch api.Channel, index interface_types.InterfaceIndex) {
break
}
prefix := ip_types.Prefix(msg.Prefix)
- fmt.Printf(" - ip address: %+v\n", prefix.ToString())
+ fmt.Printf(" - ip address: %v\n", prefix)
}
fmt.Println("OK")