aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2021-01-26 15:01:17 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2021-03-07 10:38:52 +0100
commitdaae95ee05d5d78b7049cf9f2213478518c42de5 (patch)
tree2a0138f000d22546715c89ac05f2955f7ce06e92 /src
parent6650631b4fb4ca8deb0e99e0a08bb9085a9ae9db (diff)
Fix libdebug to be used with all osmo-cc projects
Diffstat (limited to 'src')
-rw-r--r--src/libdebug/Makefile.am4
-rwxr-xr-xsrc/libdebug/debug.c18
-rw-r--r--src/libdebug/debug.h60
3 files changed, 47 insertions, 35 deletions
diff --git a/src/libdebug/Makefile.am b/src/libdebug/Makefile.am
index 7cef904..210a097 100644
--- a/src/libdebug/Makefile.am
+++ b/src/libdebug/Makefile.am
@@ -5,7 +5,3 @@ noinst_LIBRARIES = libdebug.a
libdebug_a_SOURCES = \
debug.c
-if HAVE_SDR
-AM_CPPFLAGS += -DHAVE_SDR
-endif
-
diff --git a/src/libdebug/debug.c b/src/libdebug/debug.c
index 78f1c09..48eb612 100755
--- a/src/libdebug/debug.c
+++ b/src/libdebug/debug.c
@@ -25,10 +25,7 @@
#include <errno.h>
#include <math.h>
#include <sys/ioctl.h>
-#include "../libsample/sample.h"
#include "debug.h"
-#include "../libdisplay/display.h"
-#include "../liboptions/options.h"
const char *debug_level[] = {
"debug ",
@@ -79,6 +76,13 @@ struct debug_cat {
{ "mtp layer 2", "\033[1;33m" },
{ "mtp layer 3", "\033[1;36m" },
{ "MuP", "\033[1;37m" },
+ { "router", "\033[1;35m" },
+ { "stderr", "\033[1;37m" },
+ { "ss5", "\033[1;34m" },
+ { "isdn", "\033[1;35m" },
+ { "misdn", "\033[0;34m" },
+ { "dss1", "\033[1;34m" },
+ { "sip", "\033[1;35m" },
{ NULL, NULL }
};
@@ -202,22 +206,24 @@ void debug_list_cat(void)
int parse_debug_opt(const char *optarg)
{
int i, max_level = 0;
- char *dstring, *p;
+ char *dup, *dstring, *p;
for (i = 0; debug_level[i]; i++)
max_level = i;
- dstring = options_strdup(optarg);
+ dup = dstring = strdup(optarg);
p = strsep(&dstring, ",");
for (i = 0; i < p[i]; i++) {
if (p[i] < '0' || p[i] > '9') {
fprintf(stderr, "Only digits are allowed for debug level!\n");
+ free(dup);
return -EINVAL;
}
}
debuglevel = atoi(p);
if (debuglevel > max_level) {
fprintf(stderr, "Debug level too high, use 'list' to show available levels!\n");
+ free(dup);
return -EINVAL;
}
if (dstring)
@@ -229,11 +235,13 @@ int parse_debug_opt(const char *optarg)
}
if (!debug_cat[i].name) {
fprintf(stderr, "Given debug category '%s' unknown, use 'list' to show available categories!\n", p);
+ free(dup);
return -EINVAL;
}
debug_mask |= ((uint64_t)1 << i);
}
+ free(dup);
return 0;
}
diff --git a/src/libdebug/debug.h b/src/libdebug/debug.h
index 7a8ed93..c240b99 100644
--- a/src/libdebug/debug.h
+++ b/src/libdebug/debug.h
@@ -15,32 +15,40 @@
#define DAMPS 8
#define DR2000 9
#define DIMTS 10
-#define DJOLLY 11
-#define DEURO 12
-#define DFRAME 13
-#define DCALL 14
-#define DCC 15
-#define DDB 16
-#define DTRANS 17
-#define DDMS 18
-#define DSMS 19
-#define DSDR 20
-#define DUHD 21
-#define DSOAPY 22
-#define DWAVE 23
-#define DRADIO 24
-#define DAM791X 25
-#define DUART 26
-#define DDEVICE 27
-#define DDATENKLO 28
-#define DZEIT 29
-#define DSIM1 30
-#define DSIM2 31
-#define DSIMI 32
-#define DSIM7 33
-#define DMTP2 34
-#define DMTP3 35
-#define DMUP 36
+#define DMPT1327 11
+#define DJOLLY 12
+#define DEURO 13
+#define DFRAME 14
+#define DCALL 15
+#define DCC 16
+#define DDB 17
+#define DTRANS 18
+#define DDMS 19
+#define DSMS 20
+#define DSDR 21
+#define DUHD 22
+#define DSOAPY 23
+#define DWAVE 24
+#define DRADIO 25
+#define DAM791X 26
+#define DUART 27
+#define DDEVICE 28
+#define DDATENKLO 29
+#define DZEIT 30
+#define DSIM1 31
+#define DSIM2 32
+#define DSIMI 33
+#define DSIM7 34
+#define DMTP2 35
+#define DMTP3 36
+#define DMUP 37
+#define DROUTER 38
+#define DSTDERR 39
+#define DSS5 40
+#define DISDN 41
+#define DMISDN 42
+#define DDSS1 43
+#define DSIP 44
void get_win_size(int *w, int *h);