]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - rdma/rdma.h
Merge branch 'iproute2-master' into next
[mirror_iproute2.git] / rdma / rdma.h
index d2559e7cd0a50a9b1429d90ad09dd835832ad3db..9ed9e045044583442141a8e7242c1028b83323ae 100644 (file)
 #define MAX_NUMBER_OF_FILTERS 64
 struct filters {
        const char *name;
-       bool is_number;
+       uint8_t is_number:1;
+       uint8_t is_doit:1;
 };
 
 struct filter_entry {
        struct list_head list;
        char *key;
        char *value;
+       /*
+        * This field menas 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.
+        */
+       uint8_t is_doit:1;
 };
 
 struct dev_map {
@@ -61,7 +68,10 @@ struct rd {
        json_writer_t *jw;
        bool json_output;
        bool pretty_output;
+       bool suppress_errors;
        struct list_head filter_list;
+       char *link_name;
+       char *link_type;
 };
 
 struct rd_cmd {
@@ -101,15 +111,18 @@ struct dev_map *dev_map_lookup(struct rd *rd, bool allow_port_index);
 /*
  * Filter manipulation
  */
+bool rd_doit_index(struct rd *rd, uint32_t *idx);
 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);
+bool rd_is_filtered_attr(struct rd *rd, const char *key, uint32_t val,
+                        struct nlattr *attr);
+bool rd_is_string_filtered_attr(struct rd *rd, const char *key, const char *val,
+                               struct nlattr *attr);
 /*
  * Netlink
  */
 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);