Whamcloud - gitweb
LU-9119 lnet: rename LNET_MAX_INTERFACES
[fs/lustre-release.git] / lnet / utils / lnetconfig / liblnetconfig.h
index 54bcc94..5b9e36b 100644 (file)
@@ -39,7 +39,7 @@
 #define LUSTRE_CFG_RC_MATCH                    -7
 
 #include <lnet/lnet.h>
-#include <libcfs/libcfs_string.h>
+#include <libcfs/util/string.h>
 
 struct lnet_dlc_network_descr {
        struct list_head network_on_rule;
@@ -258,54 +258,57 @@ int lustre_lnet_show_stats(int seq_no, struct cYAML **show_rc,
 
 /*
  * lustre_lnet_config_peer_nid
- *   Add a peer nid to an peer identified by knid. If no knid is given
+ *   Add a peer nid to a peer with primary nid pnid. If no pnid is given
  *   then the first nid in the nid list becomes the primary nid for
  *   a newly created peer.
- *   Otherwise if knid is provided an it's unique then a new peer is
- *   created with knid as the primary NID and the nids in the nid list as
+ *   Otherwise if pnid is provided and it's unique then a new peer is
+ *   created with pnid as the primary NID and the nids in the nid list as
  *   secondary nids.
- *   If any of the peers nids provided in with exception to the knid is
+ *   If any of the peers nids provided in with exception to the pnid is
  *   not unique the operation fails. Some peer nids might have already
  *   been added. It's the role of the caller of this API to remove the
  *   added NIDs if they wish.
  *
- *     knid - Key NID of the peer
+ *     pnid - Primary NID of the peer
  *     nid - list of nids to add
+ *     num_nids - number of nids in the nid array
  *     mr - true if this peer is MR capable.
  *     seq_no - sequence number of the command
  *     err_rc - YAML strucutre of the resultant return code.
  */
-int lustre_lnet_config_peer_nid(char *knid, char **nid, bool mr, int seq_no,
-                               struct cYAML **err_rc);
+int lustre_lnet_config_peer_nid(char *pnid, char **nid, int num_nids,
+                               bool mr, int seq_no, struct cYAML **err_rc);
 
 /*
  * lustre_lnet_del_peer_nid
- *  Delete the nids identified in the nid list from the peer identified by
- *  knid. If knid is NULL or it doesn't identify a peer the operation
+ *  Delete the nids given in the nid list from the peer with primary NID
+ *  pnid. If pnid is NULL or it doesn't identify a peer the operation
  *  fails and no change happens to the system.
  *  The operation is aborted on the first NID that fails to be deleted.
  *
- *     knid - Key NID of the peer
+ *     pnid - Primary NID of the peer
  *     nid - list of nids to add
+ *     num_nids - number of nids in the nid array
  *     seq_no - sequence number of the command
  *     err_rc - YAML strucutre of the resultant return code.
  */
-int lustre_lnet_del_peer_nid(char *knid, char **nid, int seq_no,
-                            struct cYAML **err_rc);
+int lustre_lnet_del_peer_nid(char *pnid, char **nid, int num_nids,
+                            int seq_no, struct cYAML **err_rc);
 
 /*
  * lustre_lnet_show_peer
- *   Show the peer identified by knid. If knid is NULL all peers in the
- *   system are shown.
+ *   Show the peer identified by nid, knid. If knid is NULL all
+ *   peers in the system are shown.
  *
- *     knid - Key NID of the peer
+ *     knid - A NID of the peer
+ *     detail - display detailed information
  *     seq_no - sequence number of the command
  *     show_rc - YAML structure of the resultant show
  *     err_rc - YAML strucutre of the resultant return code.
  *
  */
-int lustre_lnet_show_peer(char *knid, int seq_no, struct cYAML **show_rc,
-                         struct cYAML **err_rc);
+int lustre_lnet_show_peer(char *knid, int detail, int seq_no,
+                         struct cYAML **show_rc, struct cYAML **err_rc);
 
 /*
  * lustre_yaml_config
@@ -357,16 +360,21 @@ int lustre_lnet_parse_interfaces(char *intf_str,
                                 struct lnet_dlc_network_descr *nw_descr);
 
 /*
- * lustre_lnet_send_dbg_task
- *     send a debug task to be carried out in the kernel. This API will
- *     not be exposed to the user through lnetctl utility. It can only be
- *     executed by being called directly.
- *             dbg_task: The task to be carried out
- *             dbg_info: task specific information
+ * lustre_lnet_parse_nids
+ *     Parse a set of nids into a locally allocated array and return the
+ *     pointer of the array to the caller. The caller is responsible for
+ *     freeing the array. If an initial array is provided then copy over
+ *     the contents of that array into the new array and append to it the
+ *     new content.
+ *     The nids can be of the form "nid [,nid, nid, nid]"
+ *             nids: nids string to be parsed
+ *             array: initial array of content
+ *             size: num of elements in the array
+ *             out_array: [OUT] new allocated array.
+ *     Returns size of array
+ *             sets the out_array to NULL on failure.
  */
-int lustre_lnet_send_dbg_task(enum lnet_dbg_task dbg_task,
-                             struct lnet_dbg_task_info *dbg_info,
-                             struct cYAML **show_rc,
-                             struct cYAML **err_rc);
+int lustre_lnet_parse_nids(char *nids, char **array, int size,
+                          char ***out_array);
 
 #endif /* LIB_LNET_CONFIG_API_H */