Lines Matching full:sh
14 static int get_idx(const struct shell *sh, char *index_str) in get_idx() argument
21 shell_warn(sh, "Invalid index %s\n", index_str); in get_idx()
28 static int cmd_bridge_addif(const struct shell *sh, size_t argc, char *argv[]) in cmd_bridge_addif() argument
34 br_idx = get_idx(sh, argv[1]); in cmd_bridge_addif()
41 shell_warn(sh, "Bridge %d not found\n", br_idx); in cmd_bridge_addif()
46 if_idx = get_idx(sh, argv[i]); in cmd_bridge_addif()
53 shell_warn(sh, "Interface %d not found\n", if_idx); in cmd_bridge_addif()
58 shell_warn(sh, "Interface %d is not Ethernet\n", if_idx); in cmd_bridge_addif()
63 shell_warn(sh, "Interface %d cannot do promiscuous mode\n", if_idx); in cmd_bridge_addif()
69 shell_error(sh, "error: bridge iface add (%d)\n", ret); in cmd_bridge_addif()
76 static int cmd_bridge_delif(const struct shell *sh, size_t argc, char *argv[]) in cmd_bridge_delif() argument
82 br_idx = get_idx(sh, argv[1]); in cmd_bridge_delif()
89 shell_warn(sh, "Bridge %d not found\n", br_idx); in cmd_bridge_delif()
94 if_idx = get_idx(sh, argv[i]); in cmd_bridge_delif()
101 shell_warn(sh, "Interface %d not found\n", if_idx); in cmd_bridge_delif()
107 shell_error(sh, "error: bridge iface remove (%d)\n", ret); in cmd_bridge_delif()
117 const struct shell *sh = data; in bridge_show() local
119 shell_fprintf(sh, SHELL_NORMAL, "%-7d", br_idx); in bridge_show()
122 shell_fprintf(sh, SHELL_NORMAL, "%-9s", "up"); in bridge_show()
124 shell_fprintf(sh, SHELL_NORMAL, "%-9s", "down"); in bridge_show()
128 shell_fprintf(sh, SHELL_NORMAL, "%-9s", "ok"); in bridge_show()
130 shell_fprintf(sh, SHELL_NORMAL, "%-9s", "no"); in bridge_show()
144 shell_fprintf(sh, SHELL_NORMAL, "%-2d", if_idx); in bridge_show()
147 shell_fprintf(sh, SHELL_NORMAL, "\n"); in bridge_show()
152 static int cmd_bridge_show(const struct shell *sh, size_t argc, char *argv[]) in cmd_bridge_show() argument
158 br_idx = get_idx(sh, argv[1]); in cmd_bridge_show()
165 shell_warn(sh, "Bridge %d not found\n", br_idx); in cmd_bridge_show()
170 shell_fprintf(sh, SHELL_NORMAL, "Bridge %-9s%-9sInterfaces\n", in cmd_bridge_show()
174 bridge_show(net_if_get_device(br)->data, (void *)sh); in cmd_bridge_show()
176 net_eth_bridge_foreach(bridge_show, (void *)sh); in cmd_bridge_show()