Whamcloud - gitweb
LU-10452 lnet: cleanup YAML output
[fs/lustre-release.git] / lnet / utils / lnetconfig / liblnetconfig.h
index 627399e..227a66e 100644 (file)
@@ -18,7 +18,7 @@
  *
  * LGPL HEADER END
  *
- * Copyright (c) 2014, 2016, Intel Corporation.
+ * Copyright (c) 2014, 2017, Intel Corporation.
  *
  * Author:
  *   Amir Shehata <amir.shehata@intel.com>
@@ -123,11 +123,13 @@ int lustre_lnet_del_route(char *nw, char *gw, int seq_no,
  *   seq_no - sequence number of the request
  *   show_rc - [OUT] The show output in YAML.  Must be freed by caller.
  *   err_rc - [OUT] struct cYAML tree describing the error. Freed by caller
+ *   backup - true to output only what's necessary for reconfiguring
+ *           a node.
  */
 int lustre_lnet_show_route(char *nw, char *gw,
                           int hops, int prio, int detail,
                           int seq_no, struct cYAML **show_rc,
-                          struct cYAML **err_rc);
+                          struct cYAML **err_rc, bool backup);
 
 /*
  * lustre_lnet_config_ni
@@ -172,9 +174,12 @@ int lustre_lnet_del_ni(struct lnet_dlc_network_descr *nw,
  *   seq_no - sequence number of the request
  *   show_rc - [OUT] The show output in YAML.  Must be freed by caller.
  *   err_rc - [OUT] struct cYAML tree describing the error. Freed by caller
+ *   backup - true to output only what's necessary for reconfiguring
+ *           a node.
  */
 int lustre_lnet_show_net(char *nw, int detail, int seq_no,
-                        struct cYAML **show_rc, struct cYAML **err_rc);
+                        struct cYAML **show_rc, struct cYAML **err_rc,
+                        bool backup);
 
 /*
  * lustre_lnet_enable_routing
@@ -286,9 +291,11 @@ int lustre_lnet_config_buffers(int tiny, int small, int large,
  *   seq_no - sequence number of the request
  *   show_rc - [OUT] The show output in YAML.  Must be freed by caller.
  *   err_rc - [OUT] struct cYAML tree describing the error. Freed by caller
+ *   backup - true to output only what's necessary for reconfiguring
+ *           a node.
  */
 int lustre_lnet_show_routing(int seq_no, struct cYAML **show_rc,
-                            struct cYAML **err_rc);
+                            struct cYAML **err_rc, bool backup);
 
 /*
  * lustre_lnet_show_stats
@@ -351,11 +358,52 @@ int lustre_lnet_del_peer_nid(char *pnid, char **nid, int num_nids,
  *     seq_no - sequence number of the command
  *     show_rc - YAML structure of the resultant show
  *     err_rc - YAML strucutre of the resultant return code.
+ *     backup - true to output only what's necessary for reconfiguring
+ *             a node.
  *
  */
 int lustre_lnet_show_peer(char *knid, int detail, int seq_no,
+                         struct cYAML **show_rc, struct cYAML **err_rc,
+                         bool backup);
+
+/*
+ * lustre_lnet_list_peer
+ *   List the known peers.
+ *
+ *     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_list_peer(int seq_no,
                          struct cYAML **show_rc, struct cYAML **err_rc);
 
+/* lustre_lnet_ping_nid
+ *   Ping the nid list, pnids.
+ *
+ *    pnids - NID list to ping.
+ *    timeout - timeout(seconds) for ping.
+ *    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_ping_nid(char *pnid, int timeout, int seq_no,
+                       struct cYAML **show_rc, struct cYAML **err_rc);
+
+/* lustre_lnet_discover_nid
+ *   Discover the nid list, pnids.
+ *
+ *    pnids - NID list to discover.
+ *    force - force discovery.
+ *    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_discover_nid(char *pnid, int force, int seq_no,
+                            struct cYAML **show_rc, struct cYAML **err_rc);
+
 /*
  * lustre_yaml_config
  *   Parses the provided YAML file and then calls the specific APIs
@@ -389,6 +437,18 @@ int lustre_yaml_show(char *f, struct cYAML **show_rc,
                     struct cYAML **err_rc);
 
 /*
+ * lustre_yaml_exec
+ *   Parses the provided YAML file and then calls the specific APIs
+ *   to execute the entities identified in the file
+ *
+ *   f - YAML file
+ *   show_rc - [OUT] The show output in YAML.  Must be freed by caller.
+ *   err_rc - [OUT] struct cYAML tree describing the error. Freed by caller
+ */
+int lustre_yaml_exec(char *f, struct cYAML **show_rc,
+                    struct cYAML **err_rc);
+
+/*
  * lustre_lnet_init_nw_descr
  *     initialize the network descriptor structure for use
  */