Lines Matching full:target

106 	PR("Valid target specifiers are 'ifi [index]', 'if [name]', or '[index]'.\n");  in cm_target_help()
113 struct cm_target *target) in parse_ifi_target() argument
119 /* At least one remaining argument is required to specify a target index */ in parse_ifi_target()
121 PR_ERROR("Please specify the target iface index.\n"); in parse_ifi_target()
134 target->iface = net_if_get_by_index(iface_index); in parse_ifi_target()
136 if (target->iface == NULL) { in parse_ifi_target()
142 target->type = CM_TARG_IFACE; in parse_ifi_target()
146 target->type = CM_TARG_INVALID; in parse_ifi_target()
151 struct cm_target *target) in parse_if_target() argument
155 /* At least one remaining argument is required to specify a target name */ in parse_if_target()
157 PR_ERROR("Please specify the target iface name.\n"); in parse_if_target()
163 target->iface = net_if_get_by_index(net_if_get_by_name(arg)); in parse_if_target()
165 if (target->iface == NULL) { in parse_if_target()
171 target->type = CM_TARG_IFACE; in parse_if_target()
179 target->type = CM_TARG_INVALID; in parse_if_target()
185 struct cm_target *target) in parse_target() argument
189 /* At least one argument is required to specify a target */ in parse_target()
191 target->type = CM_TARG_NONE; in parse_target()
200 target->type = CM_TARG_ALL; in parse_target()
206 target->type = CM_TARG_NONE; in parse_target()
212 return parse_ifi_target(sh, argc, argv, argidx, target); in parse_target()
215 /* Otherwise, arg must be a target type specifier */ in parse_target()
218 return parse_if_target(sh, argc, argv, argidx, target); in parse_target()
223 return parse_ifi_target(sh, argc, argv, argidx, target); in parse_target()
226 PR_ERROR("%s is not a valid target type or target specifier.\n", arg); in parse_target()
228 target->type = CM_TARG_INVALID; in parse_target()
465 struct cm_target target = { in cmd_net_cm_status() local
469 if (parse_target(sh, argc, argv, &argidx, &target)) { in cmd_net_cm_status()
479 if (target.type == CM_TARG_NONE || target.type == CM_TARG_ALL) { in cmd_net_cm_status()
484 if (target.type == CM_TARG_IFACE) { in cmd_net_cm_status()
485 cm_iface_status(target.iface, (void *)sh); in cmd_net_cm_status()
489 PR_ERROR("Invalid target selected.\n"); in cmd_net_cm_status()
500 struct cm_target target = { in cmd_net_cm_ignore() local
504 if (parse_target(sh, argc, argv, &argidx, &target)) { in cmd_net_cm_ignore()
514 if (target.type == CM_TARG_NONE) { in cmd_net_cm_ignore()
515 PR_ERROR("Please specify a target.\n"); in cmd_net_cm_ignore()
520 if (target.type == CM_TARG_ALL) { in cmd_net_cm_ignore()
526 if (target.type == CM_TARG_IFACE) { in cmd_net_cm_ignore()
527 cm_iface_ignore(target.iface, (void *)sh); in cmd_net_cm_ignore()
531 PR_ERROR("Invalid target selected.\n"); in cmd_net_cm_ignore()
542 struct cm_target target = { in cmd_net_cm_watch() local
546 if (parse_target(sh, argc, argv, &argidx, &target)) { in cmd_net_cm_watch()
556 if (target.type == CM_TARG_NONE) { in cmd_net_cm_watch()
557 PR_ERROR("Please specify a target.\n"); in cmd_net_cm_watch()
562 if (target.type == CM_TARG_ALL) { in cmd_net_cm_watch()
568 if (target.type == CM_TARG_IFACE) { in cmd_net_cm_watch()
569 cm_iface_watch(target.iface, (void *)sh); in cmd_net_cm_watch()
573 PR_ERROR("Invalid target selected.\n"); in cmd_net_cm_watch()
584 struct cm_target target = { in cmd_net_cm_connect() local
589 if (parse_target(sh, argc, argv, &argidx, &target)) { in cmd_net_cm_connect()
599 if (target.type == CM_TARG_NONE) { in cmd_net_cm_connect()
600 PR_ERROR("Please specify a target.\n"); in cmd_net_cm_connect()
605 if (target.type == CM_TARG_ALL) { in cmd_net_cm_connect()
611 if (target.type == CM_TARG_IFACE) { in cmd_net_cm_connect()
612 cm_get_iface_info(target.iface, iface_info, sizeof(iface_info)); in cmd_net_cm_connect()
614 if (!conn_mgr_if_is_bound(target.iface)) { in cmd_net_cm_connect()
621 conn_mgr_if_connect(target.iface); in cmd_net_cm_connect()
625 PR_ERROR("Invalid target selected.\n"); in cmd_net_cm_connect()
636 struct cm_target target = { in cmd_net_cm_disconnect() local
641 if (parse_target(sh, argc, argv, &argidx, &target)) { in cmd_net_cm_disconnect()
651 if (target.type == CM_TARG_NONE) { in cmd_net_cm_disconnect()
652 PR_ERROR("Please specify a target.\n"); in cmd_net_cm_disconnect()
657 if (target.type == CM_TARG_ALL) { in cmd_net_cm_disconnect()
663 if (target.type == CM_TARG_IFACE) { in cmd_net_cm_disconnect()
664 cm_get_iface_info(target.iface, iface_info, sizeof(iface_info)); in cmd_net_cm_disconnect()
666 if (!conn_mgr_if_is_bound(target.iface)) { in cmd_net_cm_disconnect()
673 conn_mgr_if_disconnect(target.iface); in cmd_net_cm_disconnect()
677 PR_ERROR("Invalid target selected.\n"); in cmd_net_cm_disconnect()
688 struct cm_target target = { in cmd_net_cm_up() local
693 if (parse_target(sh, argc, argv, &argidx, &target)) { in cmd_net_cm_up()
703 if (target.type == CM_TARG_NONE) { in cmd_net_cm_up()
704 PR_ERROR("Please specify a target.\n"); in cmd_net_cm_up()
708 if (target.type == CM_TARG_ALL) { in cmd_net_cm_up()
714 if (target.type == CM_TARG_IFACE) { in cmd_net_cm_up()
715 cm_get_iface_info(target.iface, iface_info, sizeof(iface_info)); in cmd_net_cm_up()
717 PR_WARNING("This command duplicates 'net iface up' if [target] != all.\n"); in cmd_net_cm_up()
719 net_if_up(target.iface); in cmd_net_cm_up()
723 PR_ERROR("Invalid target selected.\n"); in cmd_net_cm_up()
734 struct cm_target target = { in cmd_net_cm_down() local
739 if (parse_target(sh, argc, argv, &argidx, &target)) { in cmd_net_cm_down()
749 if (target.type == CM_TARG_NONE) { in cmd_net_cm_down()
750 PR_ERROR("Please specify a target.\n"); in cmd_net_cm_down()
755 if (target.type == CM_TARG_ALL) { in cmd_net_cm_down()
761 if (target.type == CM_TARG_IFACE) { in cmd_net_cm_down()
762 cm_get_iface_info(target.iface, iface_info, sizeof(iface_info)); in cmd_net_cm_down()
764 PR_WARNING("This command duplicates 'net iface down' if [target] != all.\n"); in cmd_net_cm_down()
766 net_if_down(target.iface); in cmd_net_cm_down()
770 PR_ERROR("Invalid target selected.\n"); in cmd_net_cm_down()
784 struct cm_target target = { in cmd_net_cm_flag() local
789 if (parse_target(sh, argc, argv, &argidx, &target)) { in cmd_net_cm_flag()
793 if (target.type == CM_TARG_NONE) { in cmd_net_cm_flag()
794 PR_ERROR("Please specify a target.\n"); in cmd_net_cm_flag()
799 if (target.type == CM_TARG_ALL) { in cmd_net_cm_flag()
804 if (target.type != CM_TARG_IFACE) { in cmd_net_cm_flag()
805 PR_ERROR("Invalid target selected.\n"); in cmd_net_cm_flag()
827 cm_get_iface_info(target.iface, iface_info, sizeof(iface_info)); in cmd_net_cm_flag()
829 if (!conn_mgr_if_is_bound(target.iface)) { in cmd_net_cm_flag()
836 (void)conn_mgr_if_set_flag(target.iface, flag, value); in cmd_net_cm_flag()
840 value = conn_mgr_if_get_flag(target.iface, flag); in cmd_net_cm_flag()
856 struct cm_target target = { in cmd_net_cm_timeout() local
861 if (parse_target(sh, argc, argv, &argidx, &target)) { in cmd_net_cm_timeout()
865 if (target.type == CM_TARG_NONE) { in cmd_net_cm_timeout()
866 PR_ERROR("Please specify a target.\n"); in cmd_net_cm_timeout()
871 if (target.type == CM_TARG_ALL) { in cmd_net_cm_timeout()
876 if (target.type != CM_TARG_IFACE) { in cmd_net_cm_timeout()
877 PR_ERROR("Invalid target selected.\n"); in cmd_net_cm_timeout()
895 cm_get_iface_info(target.iface, iface_info, sizeof(iface_info)); in cmd_net_cm_timeout()
897 if (!conn_mgr_if_is_bound(target.iface)) { in cmd_net_cm_timeout()
904 (void)conn_mgr_if_set_timeout(target.iface, value); in cmd_net_cm_timeout()
908 value = conn_mgr_if_get_timeout(target.iface); in cmd_net_cm_timeout()
920 "'net cm status [target]' shows the connectivity status of the specified "
924 "'net cm ignore [target]' ignores the specified iface(s).",
927 "'net cm watch [target]' watches the specified iface(s).",
930 "'net cm connect [target]' connects the specified iface(s).",
933 "'net cm disconnect [target]' disconnects the specified iface(s).",
936 "'net cm up [target]' takes the specified iface(s) admin-up.",
939 "'net cm down [target]' takes the specified iface(s) admin-down.",
942 "'net cm flag [target] [get/set] [flag] [value]' gets or sets a flag "
946 "'net cm timeout [target] [get/set] [value]' gets or sets the timeout "