]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - rdma/rdma.h
Merge branch 'main' into next
[mirror_iproute2.git] / rdma / rdma.h
index 1022e9a29291d49896ebf9d103e9c0345792e23b..fc8bcf09274d09ce466d01027abc6b160fc2c2a1 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "list.h"
 #include "utils.h"
-#include "json_writer.h"
+#include "json_print.h"
 
 #define pr_err(args...) fprintf(stderr, ##args)
 #define pr_out(args...) fprintf(stdout, ##args)
@@ -39,7 +39,7 @@ struct filter_entry {
        char *key;
        char *value;
        /*
-        * This field menas that we can try to issue .doit calback
+        * This field means that we can try to issue .doit calback
         * on value above. This value can be converted to integer
         * with simple atoi(). Otherwise "is_doit" will be false.
         */
@@ -57,8 +57,9 @@ struct rd {
        int argc;
        char **argv;
        char *filename;
-       bool show_details;
-       bool show_driver_details;
+       uint8_t show_details:1;
+       uint8_t show_driver_details:1;
+       uint8_t show_raw:1;
        struct list_head dev_map_list;
        uint32_t dev_idx;
        uint32_t port_idx;
@@ -66,9 +67,12 @@ struct rd {
        struct nlmsghdr *nlh;
        char *buff;
        json_writer_t *jw;
-       bool json_output;
-       bool pretty_output;
+       int json_output;
+       int pretty_output;
+       bool suppress_errors;
        struct list_head filter_list;
+       char *link_name;
+       char *link_type;
 };
 
 struct rd_cmd {
@@ -90,6 +94,8 @@ char *rd_argv(struct rd *rd);
 int cmd_dev(struct rd *rd);
 int cmd_link(struct rd *rd);
 int cmd_res(struct rd *rd);
+int cmd_sys(struct rd *rd);
+int cmd_stat(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));
@@ -119,6 +125,7 @@ bool rd_is_string_filtered_attr(struct rd *rd, const char *key, const char *val,
  */
 int rd_send_msg(struct rd *rd);
 int rd_recv_msg(struct rd *rd, mnl_cb_t callback, void *data, uint32_t seq);
+int rd_sendrecv_msg(struct rd *rd, unsigned int 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);
@@ -128,8 +135,10 @@ int rd_attr_check(const struct nlattr *attr, int *typep);
  * Print helpers
  */
 void print_driver_table(struct rd *rd, struct nlattr *tb);
+void print_raw_data(struct rd *rd, struct nlattr **nla_line);
 void newline(struct rd *rd);
 void newline_indent(struct rd *rd);
+void print_raw_data(struct rd *rd, struct nlattr **nla_line);
 #define MAX_LINE_LENGTH 80
 
 #endif /* _RDMA_TOOL_H_ */