summaryrefslogtreecommitdiffstats
path: root/src/utils.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-02-18 20:37:04 +0100
committerHarald Welte <laforge@gnumonks.org>2011-02-18 20:37:04 +0100
commit2822296ddb22389c5b4e9b8fb6ef7c906ff99314 (patch)
tree5a05ad56e7ac5730bb98d12eef4aa527e4c7d0d9 /src/utils.c
parent46cfd77f7521ad53934e1e42057723b4cd52d241 (diff)
LOGGING: configure logging from the vty
We can now configure logging to (multiple) files, stderr and syslog from the vty command line in a persistent way (config file)
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c
index 49c210e0..354fce57 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -134,3 +134,25 @@ char *hexdump_nospc(const unsigned char *buf, int len)
{
return _hexdump(buf, len, "");
}
+
+#include "../config.h"
+#ifdef HAVE_CTYPE_H
+#include <ctype.h>
+void osmo_str2lower(char *out, const char *in)
+{
+ unsigned int i;
+
+ for (i = 0; i < strlen(in); i++)
+ out[i] = tolower(in[i]);
+ out[strlen(in)] = '\0';
+}
+
+void osmo_str2upper(char *out, const char *in)
+{
+ unsigned int i;
+
+ for (i = 0; i < strlen(in); i++)
+ out[i] = toupper(in[i]);
+ out[strlen(in)] = '\0';
+}
+#endif /* HAVE_CTYPE_H */