]> git.ipfire.org Git - people/ms/rstp.git/blobdiff - ctl_cli_wrap.c
Revised packet SOCK_RAW code
[people/ms/rstp.git] / ctl_cli_wrap.c
index 7b17964c05403dc33edf2a0e8b9ff5db095a48cc..72665a8d5428422a6e852cc7ff91a269720a5efc 100644 (file)
 #include "log.h"
 
 CLIENT_SIDE_FUNCTION(enable_bridge_rstp)
-CLIENT_SIDE_FUNCTION(get_bridge_state)
-CLIENT_SIDE_FUNCTION(set_bridge_config)
-CLIENT_SIDE_FUNCTION(get_port_state)
-CLIENT_SIDE_FUNCTION(set_port_config)
-CLIENT_SIDE_FUNCTION(set_debug_level)
-
+    CLIENT_SIDE_FUNCTION(get_bridge_state)
+    CLIENT_SIDE_FUNCTION(set_bridge_config)
+    CLIENT_SIDE_FUNCTION(get_port_state)
+    CLIENT_SIDE_FUNCTION(set_port_config)
+    CLIENT_SIDE_FUNCTION(set_debug_level)
 #include <base.h>
-
-const char *CTL_error_explanation (int err_no)
+const char *CTL_error_explanation(int err_no)
 {
 #define CHOOSE(a) #a
-  static const char* rstp_error_names[] = RSTP_ERRORS;
-  static const char *ctl_error_names[] = { CTL_ERRORS };
+       static const char *rstp_error_names[] = RSTP_ERRORS;
+       static const char *ctl_error_names[] = { CTL_ERRORS };
+
 #undef CHOOSE
-  if (err_no < 0)
-    return "Error doing ctl command";
-  else if (err_no >= STP_OK && err_no < STP_LAST_DUMMY)
-    return rstp_error_names[err_no];
-  else if (err_no > Err_Dummy_Start && err_no < Err_Dummy_End)
-    return ctl_error_names[err_no - Err_Dummy_Start - 1];
+       if (err_no < 0)
+               return "Error doing ctl command";
+       else if (err_no >= STP_OK && err_no < STP_LAST_DUMMY)
+               return rstp_error_names[err_no];
+       else if (err_no > Err_Dummy_Start && err_no < Err_Dummy_End)
+               return ctl_error_names[err_no - Err_Dummy_Start - 1];
 
-  static char buf[32];
-  sprintf(buf, "Unknown error code %d", err_no);
-  return buf;
+       static char buf[32];
+       sprintf(buf, "Unknown error code %d", err_no);
+       return buf;
 }
 
-void Dprintf(int level, const charfmt, ...)
+void Dprintf(int level, const char *fmt, ...)
 {
-  char logbuf[256];
-  logbuf[sizeof(logbuf) - 1] = 0;
-  va_list ap;
-  va_start(ap, fmt);
-  vsnprintf(logbuf, sizeof(logbuf) - 1, fmt, ap);
-  va_end(ap);
-  printf("%s\n", logbuf);
+       char logbuf[256];
+       logbuf[sizeof(logbuf) - 1] = 0;
+       va_list ap;
+       va_start(ap, fmt);
+       vsnprintf(logbuf, sizeof(logbuf) - 1, fmt, ap);
+       va_end(ap);
+       printf("%s\n", logbuf);
 }