]> git.sur5r.net Git - ngadmin/blobdiff - cli/common.c
Added support for clearing the switch settings to the defaults.
[ngadmin] / cli / common.c
index f621d0bb8bf91a92883ae90a2298938fbc821018..ab8bdbbb968cb141669a69830146fbede53d8374 100644 (file)
@@ -44,6 +44,15 @@ const char* bitrates[]={
 };
 
 
+const char* prio[]={
+ NULL, 
+ "high", 
+ "medium", 
+ "normal", 
+ "low", 
+ NULL
+};
+
 
 int parseBitrate (const char *s) {
  
@@ -59,6 +68,20 @@ int parseBitrate (const char *s) {
 
 
 
+char parsePrio (const char *s) {
+ int i;
+ for (i=1; prio[i]!=NULL && strcasecmp(prio[i], s)!=0; ++i);
+ return (char)i;
+}
+
+
+
 void displaySwitchTab (const struct swi_attr *sa, int nb) {
  
  int i=0;