- * 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_parse_nids(char *nids, char **array, int size,
- char ***out_array);
+ * lustre_lnet_parse_nidstr
+ * This is a small wrapper around cfs_parse_nidlist.
+ * nidstr - A string parseable by cfs_parse_nidlist
+ * lnet_nidlist - An array of lnet_nid_t to hold the nids specified
+ * by the nidstring.
+ * max_nids - Size of the lnet_nidlist array, and the maximum number of
+ * nids that can be expressed by the nidstring. If the
+ * nidstring expands to a larger number of nids than max_nids
+ * then an error is returned.
+ * err_str - char pointer where we store an informative error
+ * message when an error is encountered
+ * Returns:
+ * The number (> 0) of lnet_nid_t stored in the supplied array, or
+ * LUSTRE_CFG_RC_BAD_PARAM if:
+ * - nidstr is NULL
+ * - nidstr contains an asterisk. This character is not allowed
+ * because it would cause the size of the expanded nidlist to exceed
+ * the maximum number of nids that is supported by expected callers
+ * of this function.
+ * - cfs_parse_nidlist fails to parse the nidstring
+ * - The nidlist populated by cfs_parse_nidlist is empty
+ * - The nidstring expands to a larger number of nids than max_nids
+ * - The nidstring expands to zero nids
+ * LUSTRE_CFG_RC_OUT_OF_MEM if:
+ * - cfs_expand_nidlist can return ENOMEM. We return out of mem in
+ * this case.
+ */
+int lustre_lnet_parse_nidstr(char *nidstr, lnet_nid_t *lnet_nidlist,
+ int max_nids, char *err_str);
+
+/* lustre_lnet_add_udsp
+ * Add a selection policy.
+ * src - source NID descriptor
+ * dst - destination NID descriptor
+ * rte - router NID descriptor
+ * type - action type
+ * action - union of the action
+ * idx - the index to delete
+ * seq_no - sequence number of the request
+ * err_rc - [OUT] struct cYAML tree describing the error. Freed by
+ * caller
+ */
+int lustre_lnet_add_udsp(char *src, char *dst, char *rte, char *type,
+ union lnet_udsp_action *action, int idx,
+ int seq_no, struct cYAML **err_rc);
+
+/* lustre_lnet_del_udsp
+ * Delete a net selection policy.
+ * idx - the index to delete
+ * seq_no - sequence number of the request
+ * err_rc - [OUT] struct cYAML tree describing the error. Freed by
+ * caller
+ */
+int lustre_lnet_del_udsp(unsigned int idx, int seq_no, struct cYAML **err_rc);
+
+/* lustre_lnet_show_udsp
+ * show selection policy.
+ * idx - the index to show. -1 to show all policies
+ * seq_no - sequence number of the request
+ * err_rc - [IN/OUT] struct cYAML tree containing udsp info
+ * err_rc - [OUT] struct cYAML tree describing the error. Freed by
+ * caller
+ */
+int lustre_lnet_show_udsp(int idx, int seq_no, struct cYAML **show_rc,
+ struct cYAML **err_rc);
+
+/* lustre_lnet_show_peer_debug_info
+ * dump peer debug info
+ * peer_nid - nid of the peer to show
+ * seq_no - sequence number of the request
+ * err_rc - [OUT] struct cYAML tree describing the error. Freed by
+ * caller
+ */
+int lustre_lnet_show_peer_debug_info(char *peer_nid, int seq_no,
+ struct cYAML **err_rc);