#include <getopt.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"
#define RDMA_BITMAP_ENUM(name, bit_no) RDMA_BITMAP_##name = BIT(bit_no),
#define RDMA_BITMAP_NAMES(name, bit_no) [bit_no] = #name,
+#define MAX_NUMBER_OF_FILTERS 64
+struct filters {
+ char name[32];
+ bool is_number;
+};
+
+struct filter_entry {
+ struct list_head list;
+ char *key;
+ char *value;
+};
+
struct dev_map {
struct list_head list;
char *dev_name;
json_writer_t *jw;
bool json_output;
bool pretty_output;
+ struct list_head filter_list;
};
struct rd_cmd {
*/
int cmd_dev(struct rd *rd);
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_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);
int rd_argc(struct rd *rd);
+int strcmpx(const char *str1, const char *str2);
+
/*
* Device manipulation
*/
struct dev_map *dev_map_lookup(struct rd *rd, bool allow_port_index);
+/*
+ * Filter manipulation
+ */
+int rd_build_filter(struct rd *rd, const struct filters valid_filters[]);
+bool rd_check_is_filtered(struct rd *rd, const char *key, uint32_t val);
+bool rd_check_is_string_filtered(struct rd *rd, const char *key, const char *val);
+bool rd_check_is_key_exist(struct rd *rd, const char *key);
/*
* Netlink
*/