aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/binapi/af_packet/af_packet.ba.go4
-rw-r--r--examples/binapi/gen.go2
-rw-r--r--examples/binapi/interfaces/interfaces.ba.go6
-rw-r--r--examples/binapi/ip/ip.ba.go6
-rw-r--r--examples/binapi/memif/memif.ba.go4
-rw-r--r--examples/binapi/vpe/vpe.ba.go2
-rw-r--r--examples/simple-client/simple_client.go23
-rw-r--r--examples/union-example/union_example.go10
8 files changed, 27 insertions, 30 deletions
diff --git a/examples/binapi/af_packet/af_packet.ba.go b/examples/binapi/af_packet/af_packet.ba.go
index d24966a..6f50f22 100644
--- a/examples/binapi/af_packet/af_packet.ba.go
+++ b/examples/binapi/af_packet/af_packet.ba.go
@@ -20,8 +20,8 @@ import (
io "io"
strconv "strconv"
- ethernet_types "git.fd.io/govpp.git/examples/ethernet_types"
- interface_types "git.fd.io/govpp.git/examples/interface_types"
+ ethernet_types "git.fd.io/govpp.git/examples/binapi/ethernet_types"
+ interface_types "git.fd.io/govpp.git/examples/binapi/interface_types"
)
const (
diff --git a/examples/binapi/gen.go b/examples/binapi/gen.go
index d066275..7c2030c 100644
--- a/examples/binapi/gen.go
+++ b/examples/binapi/gen.go
@@ -7,7 +7,7 @@ package binapi
//go:generate binapi-generator --output-dir=. --input-file=/usr/share/vpp/api/core/ip_types.api.json
//go:generate binapi-generator --output-dir=. --input-file=/usr/share/vpp/api/core/vpe_types.api.json
-//go:generate -command binapigen binapi-generator --output-dir=. --import-prefix=git.fd.io/govpp.git/examples --input-types=/usr/share/vpp/api/core/ethernet_types.api.json,/usr/share/vpp/api/core/ip_types.api.json,/usr/share/vpp/api/core/interface_types.api.json,/usr/share/vpp/api/core/vpe_types.api.json
+//go:generate -command binapigen binapi-generator --output-dir=. --import-prefix=git.fd.io/govpp.git/examples/binapi --input-types=/usr/share/vpp/api/core/ethernet_types.api.json,/usr/share/vpp/api/core/ip_types.api.json,/usr/share/vpp/api/core/interface_types.api.json,/usr/share/vpp/api/core/vpe_types.api.json
//go:generate binapigen --input-file=/usr/share/vpp/api/core/af_packet.api.json
//go:generate binapigen --input-file=/usr/share/vpp/api/core/interface.api.json
diff --git a/examples/binapi/interfaces/interfaces.ba.go b/examples/binapi/interfaces/interfaces.ba.go
index d77ca41..45fd4d2 100644
--- a/examples/binapi/interfaces/interfaces.ba.go
+++ b/examples/binapi/interfaces/interfaces.ba.go
@@ -22,9 +22,9 @@ import (
io "io"
strconv "strconv"
- ethernet_types "git.fd.io/govpp.git/examples/ethernet_types"
- interface_types "git.fd.io/govpp.git/examples/interface_types"
- ip_types "git.fd.io/govpp.git/examples/ip_types"
+ ethernet_types "git.fd.io/govpp.git/examples/binapi/ethernet_types"
+ interface_types "git.fd.io/govpp.git/examples/binapi/interface_types"
+ ip_types "git.fd.io/govpp.git/examples/binapi/ip_types"
)
const (
diff --git a/examples/binapi/ip/ip.ba.go b/examples/binapi/ip/ip.ba.go
index 06727c3..0661dc5 100644
--- a/examples/binapi/ip/ip.ba.go
+++ b/examples/binapi/ip/ip.ba.go
@@ -22,9 +22,9 @@ import (
io "io"
strconv "strconv"
- ethernet_types "git.fd.io/govpp.git/examples/ethernet_types"
- interface_types "git.fd.io/govpp.git/examples/interface_types"
- ip_types "git.fd.io/govpp.git/examples/ip_types"
+ ethernet_types "git.fd.io/govpp.git/examples/binapi/ethernet_types"
+ interface_types "git.fd.io/govpp.git/examples/binapi/interface_types"
+ ip_types "git.fd.io/govpp.git/examples/binapi/ip_types"
)
const (
diff --git a/examples/binapi/memif/memif.ba.go b/examples/binapi/memif/memif.ba.go
index 4bc35aa..c4434c4 100644
--- a/examples/binapi/memif/memif.ba.go
+++ b/examples/binapi/memif/memif.ba.go
@@ -20,8 +20,8 @@ import (
io "io"
strconv "strconv"
- ethernet_types "git.fd.io/govpp.git/examples/ethernet_types"
- interface_types "git.fd.io/govpp.git/examples/interface_types"
+ ethernet_types "git.fd.io/govpp.git/examples/binapi/ethernet_types"
+ interface_types "git.fd.io/govpp.git/examples/binapi/interface_types"
)
const (
diff --git a/examples/binapi/vpe/vpe.ba.go b/examples/binapi/vpe/vpe.ba.go
index 2738029..e95cf30 100644
--- a/examples/binapi/vpe/vpe.ba.go
+++ b/examples/binapi/vpe/vpe.ba.go
@@ -21,7 +21,7 @@ import (
io "io"
strconv "strconv"
- vpe_types "git.fd.io/govpp.git/examples/vpe_types"
+ vpe_types "git.fd.io/govpp.git/examples/binapi/vpe_types"
)
const (
diff --git a/examples/simple-client/simple_client.go b/examples/simple-client/simple_client.go
index 3ed811d..6d96ca8 100644
--- a/examples/simple-client/simple_client.go
+++ b/examples/simple-client/simple_client.go
@@ -27,8 +27,10 @@ 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"
)
@@ -153,19 +155,15 @@ func addIPAddress(ch api.Channel) {
fmt.Println("Adding IP address to interface")
req := &interfaces.SwInterfaceAddDelAddress{
- SwIfIndex: 1,
- IsAdd: 1,
- Address: []byte{10, 10, 0, 1},
- AddressLength: 24,
- /* below for 20.01-rc0
+ SwIfIndex: 1,
IsAdd: true,
- Prefix: interfaces.Prefix{
+ Prefix: ip_types.AddressWithPrefix{
Address: interfaces.Address{
- Af: interfaces.ADDRESS_IP4,
- Un: interfaces.AddressUnionIP4(interfaces.IP4Address{10, 10, 0, 1}),
+ Af: ip_types.ADDRESS_IP4,
+ Un: ip_types.AddressUnionIP4(interfaces.IP4Address{10, 10, 0, 1}),
},
Len: 24,
- },*/
+ },
}
reply := &interfaces.SwInterfaceAddDelAddressReply{}
@@ -236,11 +234,8 @@ func interfaceNotifications(ch api.Channel) {
return
}
err = ch.SendRequest(&interfaces.SwInterfaceSetFlags{
- SwIfIndex: 1,
- AdminUpDown: 1,
- /* below for 20.01-rc0
- AdminUpDown: true,
- Flags: interfaces.IF_STATUS_API_FLAG_ADMIN_UP,*/
+ SwIfIndex: 1,
+ Flags: interface_types.IF_STATUS_API_FLAG_ADMIN_UP,
}).ReceiveReply(&interfaces.SwInterfaceSetFlagsReply{})
if err != nil {
logError(err, "setting interface flags")
diff --git a/examples/union-example/union_example.go b/examples/union-example/union_example.go
index 22fb362..92c3ec2 100644
--- a/examples/union-example/union_example.go
+++ b/examples/union-example/union_example.go
@@ -22,6 +22,8 @@ import (
"net"
"git.fd.io/govpp.git/examples/binapi/ip"
+ "git.fd.io/govpp.git/examples/binapi/ip_types"
+
"github.com/lunixbochs/struc"
)
@@ -37,8 +39,8 @@ func encodingExample() {
// use it in the Address type
addr := &ip.Address{
- Af: ip.ADDRESS_IP4,
- Un: ip.AddressUnionIP4(ip.IP4Address{192, 168, 1, 10}),
+ Af: ip_types.ADDRESS_IP4,
+ Un: ip_types.AddressUnionIP4(ip.IP4Address{192, 168, 1, 10}),
}
log.Printf("encoding union IPv4: %v", addr.Un.GetIP4())
@@ -89,12 +91,12 @@ func ipToAddress(ipstr string) (addr ip.Address, err error) {
return ip.Address{}, fmt.Errorf("invalid IP: %q", ipstr)
}
if ip4 := netIP.To4(); ip4 == nil {
- addr.Af = ip.ADDRESS_IP6
+ addr.Af = ip_types.ADDRESS_IP6
var ip6addr ip.IP6Address
copy(ip6addr[:], netIP.To16())
addr.Un.SetIP6(ip6addr)
} else {
- addr.Af = ip.ADDRESS_IP4
+ addr.Af = ip_types.ADDRESS_IP4
var ip4addr ip.IP4Address
copy(ip4addr[:], ip4)
addr.Un.SetIP4(ip4addr)