1 // SPDX-License-Identifier: GPL-2.0
7 #include "ovs_datapath-user.h"
9 int main(int argc, char **argv)
14 ys = ynl_sock_create(&ynl_ovs_datapath_family, NULL);
19 struct ovs_datapath_new_req *req;
21 req = ovs_datapath_new_req_alloc();
25 ovs_datapath_new_req_set_upcall_pid(req, 1);
26 ovs_datapath_new_req_set_name(req, argv[1]);
28 err = ovs_datapath_new(ys, req);
29 ovs_datapath_new_req_free(req);
33 struct ovs_datapath_get_req_dump *req;
34 struct ovs_datapath_get_list *dps;
37 req = ovs_datapath_get_req_dump_alloc();
39 dps = ovs_datapath_get_dump(ys, req);
40 ovs_datapath_get_req_dump_free(req);
44 ynl_dump_foreach(dps, dp) {
45 printf(" %s(%d): pid:%u cache:%u\n",
46 dp->name, dp->_hdr.dp_ifindex,
47 dp->upcall_pid, dp->masks_cache_size);
49 ovs_datapath_get_list_free(dps);
57 fprintf(stderr, "YNL (%d): %s\n", ys->err.code, ys->err.msg);