*
* LGPL HEADER END
*
- * Copyright (c) 2013, Intel Corporation.
+ * Copyright (c) 2014, Intel Corporation.
*
* Author:
* Amir Shehata <amir.shehata@intel.com>
*/
-
+#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
-#include <getopt.h>
+#include <string.h>
+#include <libcfs/util/ioctl.h>
+#include <libcfs/util/parser.h>
#include <lnet/lnetctl.h>
-#include <libcfs/libcfsutil.h>
#include "cyaml/cyaml.h"
#include "lnetconfig/liblnetconfig.h"
"\t--gateway: gateway nid (e.g. 10.1.1.2@tcp) to filter on\n"
"\t--hop: number to final destination (1 < hops < 255) to filter on\n"
"\t--priority: priority of route (0 - highest prio to filter on\n"
- "\t--vebose: display detailed output per route\n"},
+ "\t--verbose: display detailed output per route\n"},
{ 0, 0, 0, NULL }
};
struct cYAML *err_rc = NULL;
bool load_mod_params = false;
int rc, opt;
- optind = 0;
const char *const short_options = "ah";
const struct option long_options[] = {
{
struct cYAML *err_rc = NULL;
int rc;
- optind = 0;
if (handle_help(lnet_cmds, "lnet", "unconfigure", argc, argv) == 0)
return 0;
long int hop = -1, prio = -1;
struct cYAML *err_rc = NULL;
int rc, opt;
- optind = 0;
const char *const short_options = "n:g:c:p:h";
const struct option long_options[] = {
long int pto = -1, pc = -1, pbc = -1, cre = -1;
struct cYAML *err_rc = NULL;
int rc, opt;
- optind = 0;
const char *const short_options = "n:i:p:t:c:b:r:s:h";
const struct option long_options[] = {
char *network = NULL, *gateway = NULL;
struct cYAML *err_rc = NULL;
int rc, opt;
- optind = 0;
const char *const short_options = "n:g:h";
const struct option long_options[] = {
char *network = NULL;
struct cYAML *err_rc = NULL;
int rc, opt;
- optind = 0;
const char *const short_options = "n:h";
const struct option long_options[] = {
long int hop = -1, prio = -1;
int detail = 0, rc, opt;
struct cYAML *err_rc = NULL, *show_rc = NULL;
- optind = 0;
const char *const short_options = "n:g:h:p:vh";
const struct option long_options[] = {
char *network = NULL;
int detail = 0, rc, opt;
struct cYAML *err_rc = NULL, *show_rc = NULL;
- optind = 0;
const char *const short_options = "n:vh";
const struct option long_options[] = {
{
int rc;
struct cYAML *show_rc = NULL, *err_rc = NULL;
- optind = 0;
if (handle_help(credits_cmds, "peer_credits", "show", argc, argv) == 0)
return 0;
struct cYAML *err_rc = NULL;
struct cYAML *show_rc = NULL;
int rc = 0, opt, opt_found = 0;
- optind = 0;
char cmd = 'a';
const char *const short_options = "adsh";
struct cYAML *err_rc = NULL;
int rc, opt;
FILE *f = NULL;
- optind = 0;
const char *const short_options = "h";
const struct option long_options[] = {
"--help} FILE.yaml"},
{"export", jt_export, 0, "export {--help} FILE.yaml"},
{"stats", jt_stats, 0, "stats {show | help}"},
- {"peer_credits", jt_peer_credits, 0, "stats {show | help}"},
+ {"peer_credits", jt_peer_credits, 0, "peer_credits {show | help}"},
{"help", Parser_help, 0, "help"},
{"exit", Parser_quit, 0, "quit"},
{"quit", Parser_quit, 0, "quit"},
return rc;
}
- rc = libcfs_arch_init();
- if (rc < 0) {
- cYAML_build_error(-1, -1, "lnetctl", "startup",
- "cannot initialize libcfs", &err_rc);
- cYAML_print_tree2file(stderr, err_rc);
- return rc;
- }
-
Parser_init("lnetctl > ", list);
if (argc > 1) {
rc = Parser_execarg(argc - 1, &argv[1], list);
Parser_commands();
errorout:
- libcfs_arch_cleanup();
return rc;
}