]>
git.proxmox.com Git - mirror_iproute2.git/blob - rdma/rdma.h
c07493c91242370d37fe1c08322581ac6c1370ba
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
9 * Authors: Leon Romanovsky <leonro@mellanox.com>
18 #include <libmnl/libmnl.h>
19 #include <rdma/rdma_netlink.h>
24 #include "json_writer.h"
26 #define pr_err(args...) fprintf(stderr, ##args)
27 #define pr_out(args...) fprintf(stdout, ##args)
29 #define RDMA_BITMAP_ENUM(name, bit_no) RDMA_BITMAP_##name = BIT(bit_no),
30 #define RDMA_BITMAP_NAMES(name, bit_no) [bit_no] = #name,
33 struct list_head list
;
44 struct list_head dev_map_list
;
47 struct mnl_socket
*nl
;
57 int (*func
)(struct rd
*rd
);
63 bool rd_no_arg(struct rd
*rd
);
64 void rd_arg_inc(struct rd
*rd
);
66 char *rd_argv(struct rd
*rd
);
67 uint32_t get_port_from_argv(struct rd
*rd
);
72 int cmd_dev(struct rd
*rd
);
73 int cmd_link(struct rd
*rd
);
74 int rd_exec_cmd(struct rd
*rd
, const struct rd_cmd
*c
, const char *str
);
79 void rd_free_devmap(struct rd
*rd
);
80 struct dev_map
*dev_map_lookup(struct rd
*rd
, bool allow_port_index
);
85 int rd_send_msg(struct rd
*rd
);
86 int rd_recv_msg(struct rd
*rd
, mnl_cb_t callback
, void *data
, uint32_t seq
);
87 void rd_prepare_msg(struct rd
*rd
, uint32_t cmd
, uint32_t *seq
, uint16_t flags
);
88 int rd_dev_init_cb(const struct nlmsghdr
*nlh
, void *data
);
89 int rd_attr_cb(const struct nlattr
*attr
, void *data
);
90 #endif /* _RDMA_TOOL_H_ */