]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - rdma/rdma.h
rdma: Move resource PD logic to separate file
[mirror_iproute2.git] / rdma / rdma.h
index 5809f7068ad293980bdc53a62eac0ded9376be29..547bb5749a39f68e7237f976ee57518f3e7aa21d 100644 (file)
 #include <string.h>
 #include <errno.h>
 #include <getopt.h>
+#include <netinet/in.h>
 #include <libmnl/libmnl.h>
 #include <rdma/rdma_netlink.h>
+#include <rdma/rdma_user_cm.h>
 #include <time.h>
+#include <net/if_arp.h>
 
 #include "list.h"
 #include "utils.h"
@@ -31,7 +34,7 @@
 
 #define MAX_NUMBER_OF_FILTERS 64
 struct filters {
-       char name[32];
+       const char *name;
        bool is_number;
 };
 
@@ -53,6 +56,7 @@ struct rd {
        char **argv;
        char *filename;
        bool show_details;
+       bool show_driver_details;
        struct list_head dev_map_list;
        uint32_t dev_idx;
        uint32_t port_idx;
@@ -86,6 +90,7 @@ int cmd_link(struct rd *rd);
 int cmd_res(struct rd *rd);
 int rd_exec_cmd(struct rd *rd, const struct rd_cmd *c, const char *str);
 int rd_exec_dev(struct rd *rd, int (*cb)(struct rd *rd));
+int rd_exec_require_dev(struct rd *rd, int (*cb)(struct rd *rd));
 int rd_exec_link(struct rd *rd, int (*cb)(struct rd *rd), bool strict_port);
 void rd_free(struct rd *rd);
 int rd_set_arg_to_devname(struct rd *rd);
@@ -113,4 +118,14 @@ int rd_recv_msg(struct rd *rd, mnl_cb_t callback, void *data, uint32_t seq);
 void rd_prepare_msg(struct rd *rd, uint32_t cmd, uint32_t *seq, uint16_t flags);
 int rd_dev_init_cb(const struct nlmsghdr *nlh, void *data);
 int rd_attr_cb(const struct nlattr *attr, void *data);
+int rd_attr_check(const struct nlattr *attr, int *typep);
+
+/*
+ * Print helpers
+ */
+void print_driver_table(struct rd *rd, struct nlattr *tb);
+void newline(struct rd *rd);
+void newline_indent(struct rd *rd);
+#define MAX_LINE_LENGTH 80
+
 #endif /* _RDMA_TOOL_H_ */