diff options
author | Ondrej Fabry <ofabry@cisco.com> | 2020-06-18 08:22:13 +0200 |
---|---|---|
committer | Ondrej Fabry <ofabry@cisco.com> | 2020-06-22 14:37:14 +0200 |
commit | 94620e85f0bdbb054af07ce3670fadc1f76cfdf0 (patch) | |
tree | 7784ddf381c4e08a6a1ece5b55911b47ea8395f3 /examples/simple-client | |
parent | 280b1c6c83b676ef4e592f4ecf60cb5b54b6a753 (diff) |
Refactored binapi generator with message encoding
Change-Id: I5a6abb68b9d058866f94818169300e5c2fc43895
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Diffstat (limited to 'examples/simple-client')
-rw-r--r-- | examples/simple-client/simple_client.go | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/examples/simple-client/simple_client.go b/examples/simple-client/simple_client.go index fe7c109..0017eac 100644 --- a/examples/simple-client/simple_client.go +++ b/examples/simple-client/simple_client.go @@ -27,10 +27,8 @@ import ( "git.fd.io/govpp.git/adapter/socketclient" "git.fd.io/govpp.git/api" "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" ) @@ -166,10 +164,10 @@ func addIPAddress(ch api.Channel, index interfaces.InterfaceIndex) { req := &interfaces.SwInterfaceAddDelAddress{ SwIfIndex: index, IsAdd: true, - Prefix: ip_types.AddressWithPrefix{ + Prefix: interfaces.AddressWithPrefix{ Address: interfaces.Address{ - Af: ip_types.ADDRESS_IP4, - Un: ip_types.AddressUnionIP4(interfaces.IP4Address{10, 10, 0, uint8(index)}), + Af: interfaces.ADDRESS_IP4, + Un: interfaces.AddressUnionIP4(interfaces.IP4Address{10, 10, 0, uint8(index)}), }, Len: 32, }, @@ -190,7 +188,7 @@ func ipAddressDump(ch api.Channel, index interfaces.InterfaceIndex) { fmt.Printf("Dumping IP addresses for interface index %d\n", index) req := &ip.IPAddressDump{ - SwIfIndex: index, + SwIfIndex: ip.InterfaceIndex(index), } reqCtx := ch.SendMultiRequest(req) @@ -246,7 +244,7 @@ func interfaceNotifications(ch api.Channel, index interfaces.InterfaceIndex) { // generate some events in VPP err = ch.SendRequest(&interfaces.SwInterfaceSetFlags{ SwIfIndex: index, - Flags: interface_types.IF_STATUS_API_FLAG_ADMIN_UP, + Flags: interfaces.IF_STATUS_API_FLAG_ADMIN_UP, }).ReceiveReply(&interfaces.SwInterfaceSetFlagsReply{}) if err != nil { logError(err, "setting interface flags") |