}
-bool do_bitrate_set (int argc, const char **argv, struct ngadmin *nga)
+int do_bitrate_set (int argc, const char **argv, struct ngadmin *nga)
{
- int i, k = 0, defs[] = {12, 12}, p, *ports = NULL;
+ int i, k = 0, defs[] = {12, 12}, p, *ports = NULL, ret = 0;
const struct swi_attr *sa;
- bool ret = true;
+
if (argc < 2) {
printf(
"usage: bitrate set [all SPEEDSPEC] <port1> SPEEDSPEC [<port2> SPEEDSPEC ...]\n"
"SPEEDSPEC: [inout <speed>] [in <ispeed>] [out <ospeed>]\n"
);
- ret = false;
+ ret = 1;
goto end;
}
sa = ngadmin_getCurrentSwitch(nga);
if (sa == NULL) {
printf("must be logged\n");
- ret = false;
+ ret = 1;
goto end;
}
}
-bool do_bitrate_show (int argc, const char **argv UNUSED, struct ngadmin *nga)
+int do_bitrate_show (int argc, const char **argv UNUSED, struct ngadmin *nga)
{
- int i, ret = true, *ports = NULL;
+ int i, ret = 0, *ports = NULL;
const struct swi_attr *sa;
if (argc > 0) {
printf("this command takes no argument\n");
- ret = false;
+ ret = 1;
goto end;
}
sa = ngadmin_getCurrentSwitch(nga);
if (sa == NULL) {
printf("must be logged\n");
- ret = false;
+ ret = 1;
goto end;
}
i = ngadmin_getBitrateLimits(nga, ports);
if (i != ERR_OK) {
printErrCode(i);
- ret = false;
+ ret = 1;
goto end;
}