Home | History | Annotate | Download | only in iw

Lines Matching refs:cmd

86 extern struct cmd __start___cmd;
87 extern struct cmd __stop___cmd;
91 _cmd = (const struct cmd *)((char *)_cmd + cmd_size))
94 static void __usage_cmd(const struct cmd *cmd, char *indent, bool full)
100 switch (cmd->idby) {
113 if (cmd->parent && cmd->parent->name)
114 printf("%s ", cmd->parent->name);
115 printf("%s", cmd->name);
117 if (cmd->args) {
119 start = cmd->args;
126 if (start != cmd->args) {
128 switch (cmd->idby) {
141 if (cmd->parent && cmd->parent->name)
142 printf("%s ", cmd->parent->name);
143 printf("%s ", cmd->name);
151 if (!full || !cmd->help)
161 start = cmd->help;
185 const struct cmd *section, *cmd;
210 for_each_cmd(cmd) {
211 if (section != cmd->parent)
213 if (!cmd->handler || cmd->hidden)
215 if (cmd_filt && strcmp(cmd->name, cmd_filt))
217 __usage_cmd(cmd, "\t", full);
242 static void usage_cmd(const struct cmd *cmd)
245 __usage_cmd(cmd, "", true);
297 int argc, char **argv, const struct cmd **cmdout)
299 const struct cmd *cmd, *match = NULL, *sectcmd;
374 for_each_cmd(cmd) {
375 if (!cmd->handler)
377 if (cmd->parent != sectcmd)
383 if (cmd->idby != command_idby &&
384 !(cmd->idby == CIB_NETDEV &&
387 if (strcmp(cmd->name, command))
389 if (argc > 1 && !cmd->args)
391 match = cmd;
402 cmd = match;
405 cmd = sectcmd;
406 if (argc && !cmd->args)
408 if (cmd->idby != command_idby &&
409 !(cmd->idby == CIB_NETDEV && command_idby == CIB_WDEV))
411 if (!cmd->handler)
415 if (cmd->selector) {
416 cmd = cmd->selector(argc, argv);
417 if (!cmd)
422 *cmdout = cmd;
424 if (!cmd->cmd) {
427 return cmd->handler(state, NULL, NULL, argc, argv, idby);
445 cmd->nl_msg_flags, cmd->cmd, 0);
461 err = cmd->handler(state, cb, msg, argc, argv, idby);
499 const struct cmd *cmd = NULL;
531 err = __handle_cmd(&nlstate, II_NETDEV, argc, argv, &cmd);
536 err = __handle_cmd(&nlstate, II_PHY_NAME, argc, argv, &cmd);
538 err = __handle_cmd(&nlstate, II_PHY_IDX, argc, argv, &cmd);
544 err = __handle_cmd(&nlstate, II_WDEV, argc, argv, &cmd);
553 err = __handle_cmd(&nlstate, idby, argc, argv, &cmd);
557 if (cmd)
558 usage_cmd(cmd);