#include "commands.h"
-bool do_qos_mode (int argc, const char **argv, struct ngadmin *nga)
+int do_qos_mode (int argc, const char **argv, struct ngadmin *nga)
{
- int i, s, ret = true;
+ int i, s, ret = 0;
const struct swi_attr *sa;
sa = ngadmin_getCurrentSwitch(nga);
if (sa == NULL) {
printf("must be logged\n");
- ret = false;
+ ret = 1;
goto end;
}
s = QOS_DOT;
} else {
printf("Unknown QOS mode\n");
- ret = false;
+ ret = 1;
goto end;
}
}
-bool do_qos_set (int argc, const char **argv, struct ngadmin *nga)
+int do_qos_set (int argc, const char **argv, struct ngadmin *nga)
{
- int i, p;
+ int i, p, ret = 0;
const struct swi_attr *sa;
- bool ret = true;
char d = PRIO_UNSPEC, *ports = NULL;
if (argc < 2) {
printf("usage: qos set (all <prio0>)|(<port1> <prio1> [<port2> <prio2> ...])\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_qos_show (int argc, const char **argv UNUSED, struct ngadmin *nga)
+int do_qos_show (int argc, const char **argv UNUSED, struct ngadmin *nga)
{
- int i, s = 0, ret = true;
+ int i, s = 0, ret = 0;
const struct swi_attr *sa;
char *ports = NULL;
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_getQOSMode(nga, &s);
if (i != ERR_OK) {
printErrCode(i);
- ret = false;
+ ret = 1;
goto end;
}
i = ngadmin_getQOSValues(nga, ports);
if (i != ERR_OK) {
printErrCode(i);
- ret = false;
+ ret = 1;
goto end;
}