1 import java.net.InetAddress;
2 import org.openvpp.vppjapi.*;
4 public class vppApi extends vppConn {
6 native int controlPing();
7 native void test (byte[] array, byte[] array2);
9 public static void main (String[] args) throws Exception {
10 vppApi api = new vppApi ();
11 String ipv6 = "db01::feed";
12 String ipv4 = "192.168.1.1";
13 InetAddress addr6 = InetAddress.getByName(ipv6);
14 InetAddress addr4 = InetAddress.getByName(ipv4);
15 byte[] ip4bytes = addr4.getAddress();
16 byte[] ip6bytes = addr6.getAddress();
19 api.test(ip4bytes,ip6bytes);
21 rv = api.clientConnect ("JavaTest");
23 System.out.printf ("Connected OK...");
26 System.out.printf ("clientConnect returned %d\n", rv);
29 rv = api.controlPing();
30 System.out.printf ("data plane pid is %d\n", rv);
34 api.clientDisconnect();
35 System.out.printf ("Done...\n");