Restructure: Move mncc from common code to 'libmncc'

pull/1/head
Andreas Eversberg 5 years ago
parent 9776736cc4
commit 7b539d5dc7
  1. 1
      .gitignore
  2. 1
      configure.ac
  3. 2
      src/Makefile.am
  4. 1
      src/amps/Makefile.am
  5. 2
      src/amps/amps.c
  6. 1
      src/amps/amps_tacs_main.c
  7. 2
      src/amps/transaction.c
  8. 1
      src/anetz/Makefile.am
  9. 2
      src/anetz/anetz.c
  10. 1
      src/anetz/main.c
  11. 1
      src/bnetz/Makefile.am
  12. 2
      src/bnetz/bnetz.c
  13. 1
      src/bnetz/main.c
  14. 1
      src/cnetz/Makefile.am
  15. 2
      src/cnetz/cnetz.c
  16. 1
      src/cnetz/main.c
  17. 2
      src/cnetz/transaction.c
  18. 5
      src/common/Makefile.am
  19. 4
      src/common/call.c
  20. 2
      src/common/debug.c
  21. 6
      src/common/main_mobile.c
  22. 1
      src/jtacs/Makefile.am
  23. 10
      src/libmncc/Makefile.am
  24. 0
      src/libmncc/cause.c
  25. 0
      src/libmncc/cause.h
  26. 0
      src/libmncc/mncc.h
  27. 27
      src/libmncc/mncc_console.c
  28. 0
      src/libmncc/mncc_console.h
  29. 6
      src/libmncc/mncc_cross.c
  30. 0
      src/libmncc/mncc_cross.h
  31. 6
      src/libmncc/mncc_sock.c
  32. 0
      src/libmncc/mncc_sock.h
  33. 0
      src/libmncc/testton.c
  34. 0
      src/libmncc/testton.h
  35. 1
      src/nmt/Makefile.am
  36. 1
      src/nmt/main.c
  37. 2
      src/nmt/nmt.c
  38. 1
      src/r2000/Makefile.am
  39. 1
      src/r2000/main.c
  40. 2
      src/r2000/r2000.c
  41. 1
      src/tacs/Makefile.am
  42. 4
      src/test/Makefile.am

1
.gitignore vendored

@ -35,6 +35,7 @@ src/libfm/libfm.a
src/libfilter/libfilter.a
src/libwave/libwave.a
src/libfft/libfft.a
src/libmncc/libmncc.a
src/common/libcommon.a
src/common/libmobile.a
src/common/libimage.a

@ -90,6 +90,7 @@ AC_OUTPUT(
src/libfilter/Makefile
src/libwave/Makefile
src/libfft/Makefile
src/libmncc/Makefile
src/common/Makefile
src/anetz/Makefile
src/bnetz/Makefile

@ -1,3 +1,3 @@
AUTOMAKE_OPTIONS = foreign
SUBDIRS = libcompandor libgoertzel libjitter libsquelch libhagelbarger libdtmf libtimer libsamplerate libscrambler libemphasis libfsk libfm libfilter libwave libfft common anetz bnetz cnetz nmt amps tacs jtacs r2000 tv test
SUBDIRS = libcompandor libgoertzel libjitter libsquelch libhagelbarger libdtmf libtimer libsamplerate libscrambler libemphasis libfsk libfm libfilter libwave libfft libmncc common anetz bnetz cnetz nmt amps tacs jtacs r2000 tv test

@ -38,6 +38,7 @@ amps_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libfft/libfft.a \
$(top_builddir)/src/libmncc/libmncc.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \

@ -45,7 +45,7 @@
#include "../common/sample.h"
#include "../common/debug.h"
#include "../common/call.h"
#include "../common/cause.h"
#include "../libmncc/cause.h"
#include "amps.h"
#include "dsp.h"
#include "frame.h"

@ -26,7 +26,6 @@
#include "../common/main_mobile.h"
#include "../common/debug.h"
#include "../common/call.h"
#include "../common/mncc_sock.h"
#include "amps.h"
#include "dsp.h"
#include "frame.h"

@ -23,7 +23,7 @@
#include "../common/sample.h"
#include "../common/debug.h"
#include "../common/call.h"
#include "../common/cause.h"
#include "../libmncc/cause.h"
#include "amps.h"
//#include "database.h"

@ -30,6 +30,7 @@ anetz_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libfft/libfft.a \
$(top_builddir)/src/libmncc/libmncc.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \

@ -28,7 +28,7 @@
#include "../common/debug.h"
#include "../libtimer/timer.h"
#include "../common/call.h"
#include "../common/cause.h"
#include "../libmncc/cause.h"
#include "anetz.h"
#include "dsp.h"

@ -28,7 +28,6 @@
#include "../common/debug.h"
#include "../libtimer/timer.h"
#include "../common/call.h"
#include "../common/mncc_sock.h"
#include "freiton.h"
#include "besetztton.h"
#include "anetz.h"

@ -26,6 +26,7 @@ bnetz_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libfft/libfft.a \
$(top_builddir)/src/libmncc/libmncc.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \

@ -27,7 +27,7 @@
#include "../common/sample.h"
#include "../common/debug.h"
#include "../common/call.h"
#include "../common/cause.h"
#include "../libmncc/cause.h"
#include "bnetz.h"
#include "telegramm.h"
#include "dsp.h"

@ -26,7 +26,6 @@
#include "../common/sample.h"
#include "../common/debug.h"
#include "../common/call.h"
#include "../common/mncc_sock.h"
#include "../common/main_mobile.h"
#include "../anetz/freiton.h"
#include "../anetz/besetztton.h"

@ -29,6 +29,7 @@ cnetz_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libfft/libfft.a \
$(top_builddir)/src/libmncc/libmncc.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \

@ -145,7 +145,7 @@
#include "../common/sample.h"
#include "../common/debug.h"
#include "../common/call.h"
#include "../common/cause.h"
#include "../libmncc/cause.h"
#include "cnetz.h"
#include "database.h"
#include "sysinfo.h"

@ -26,7 +26,6 @@
#include "../common/main_mobile.h"
#include "../common/debug.h"
#include "../common/call.h"
#include "../common/mncc_sock.h"
#include "../anetz/freiton.h"
#include "../anetz/besetztton.h"
#include "cnetz.h"

@ -23,7 +23,7 @@
#include "../common/sample.h"
#include "../common/debug.h"
#include "../common/call.h"
#include "../common/cause.h"
#include "../libmncc/cause.h"
#include "cnetz.h"
#include "telegramm.h"
#include "database.h"

@ -11,12 +11,7 @@ libcommon_a_SOURCES = \
libmobile_a_SOURCES = \
sender.c \
cause.c \
call.c \
testton.c \
mncc_console.c \
mncc_cross.c \
mncc_sock.c \
display_status.c \
main_mobile.c

@ -27,10 +27,10 @@
#include "sample.h"
#include "debug.h"
#include "sender.h"
#include "cause.h"
#include "call.h"
#include "../libtimer/timer.h"
#include "mncc.h"
#include "../libmncc/mncc.h"
#include "../libmncc/cause.h"
#define DISC_TIMEOUT 30

@ -27,7 +27,7 @@
#include "sample.h"
#include "debug.h"
#include "display.h"
#include "mncc_console.h"
#include "../libmncc/mncc_console.h"
const char *debug_level[] = {
"debug ",

@ -35,9 +35,9 @@
#include "sender.h"
#include "../libtimer/timer.h"
#include "call.h"
#include "mncc_console.h"
#include "mncc_sock.h"
#include "mncc_cross.h"
#include "../libmncc/mncc_console.h"
#include "../libmncc/mncc_sock.h"
#include "../libmncc/mncc_cross.h"
#ifdef HAVE_SDR
#include "sdr.h"
#include "sdr_config.h"

@ -24,6 +24,7 @@ jtacs_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libfft/libfft.a \
$(top_builddir)/src/libmncc/libmncc.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \

@ -0,0 +1,10 @@
AM_CPPFLAGS = -Wall -Wextra -g $(all_includes)
noinst_LIBRARIES = libmncc.a
libmncc_a_SOURCES = \
mncc_console.c \
mncc_cross.c \
mncc_sock.c \
testton.c \
cause.c

@ -24,16 +24,16 @@
#include <stdlib.h>
#include <errno.h>
#include <sys/time.h>
#include "sample.h"
#include "../common/sample.h"
#include "../libsamplerate/samplerate.h"
#include "../libjitter/jitter.h"
#include "debug.h"
#include "../common/debug.h"
#include "testton.h"
#include "mncc.h"
#include "call.h"
#include "cause.h"
#include "mncc_console.h"
#include "sound.h"
#include "cause.h"
#include "../common/call.h"
#include "../common/sound.h"
static int new_callref = 0; /* toward mobile */
@ -162,8 +162,23 @@ static int console_mncc_up(uint8_t *buf, int length)
case MNCC_SETUP_IND:
PDEBUG(DMNCC, DEBUG_INFO, "Incoming call from '%s'\n", mncc->calling.number);
/* setup is also allowed on disconnected call */
if (console.state == CONSOLE_DISCONNECT)
if (console.state == CONSOLE_DISCONNECT) {
PDEBUG(DMNCC, DEBUG_INFO, "Releasing pending disconnected call\n");
if (console.callref) {
uint8_t buf[sizeof(struct gsm_mncc)];
struct gsm_mncc *mncc = (struct gsm_mncc *)buf;
memset(buf, 0, sizeof(buf));
mncc->msg_type = MNCC_REL_REQ;
mncc->callref = console.callref;
mncc->fields |= MNCC_F_CAUSE;
mncc->cause.location = LOCATION_USER;
mncc->cause.value = CAUSE_NORMAL;
mncc_down(buf, sizeof(struct gsm_mncc));
console.callref = 0;
}
console_new_state(CONSOLE_IDLE);
}
if (console.state != CONSOLE_IDLE) {
PDEBUG(DMNCC, DEBUG_NOTICE, "We are busy, rejecting.\n");
return -CAUSE_BUSY;

@ -22,9 +22,9 @@
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include "sample.h"
#include "debug.h"
#include "call.h"
#include "../common/sample.h"
#include "../common/debug.h"
#include "../common/call.h"
#include "cause.h"
#include "mncc.h"
#include "mncc_cross.h"

@ -26,9 +26,9 @@
#include <sys/un.h>
#include <stddef.h>
#include <unistd.h>
#include "sample.h"
#include "debug.h"
#include "call.h"
#include "../common/sample.h"
#include "../common/debug.h"
#include "../common/call.h"
#include "cause.h"
#include "mncc_sock.h"

@ -37,6 +37,7 @@ nmt_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libfft/libfft.a \
$(top_builddir)/src/libmncc/libmncc.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \

@ -29,7 +29,6 @@
#include "../common/sample.h"
#include "../common/main_mobile.h"
#include "../common/debug.h"
#include "../common/mncc_sock.h"
#include "nmt.h"
#include "frame.h"
#include "dsp.h"

@ -27,7 +27,7 @@
#include <time.h>
#include "../common/sample.h"
#include "../common/debug.h"
#include "../common/cause.h"
#include "../libmncc/cause.h"
#include "nmt.h"
#include "transaction.h"
#include "dsp.h"

@ -25,6 +25,7 @@ radiocom2000_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libfft/libfft.a \
$(top_builddir)/src/libmncc/libmncc.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \

@ -29,7 +29,6 @@
#include "../common/sample.h"
#include "../common/main_mobile.h"
#include "../common/debug.h"
#include "../common/mncc_sock.h"
#include "r2000.h"
#include "dsp.h"
#include "frame.h"

@ -27,7 +27,7 @@
#include <time.h>
#include "../common/sample.h"
#include "../common/debug.h"
#include "../common/cause.h"
#include "../libmncc/cause.h"
#include "r2000.h"
//#include "transaction.h"
#include "frame.h"

@ -25,6 +25,7 @@ tacs_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libfft/libfft.a \
$(top_builddir)/src/libmncc/libmncc.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \

@ -23,6 +23,7 @@ test_filter_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libfft/libfft.a \
$(top_builddir)/src/libmncc/libmncc.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \
@ -54,6 +55,7 @@ test_emphasis_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libfft/libfft.a \
$(top_builddir)/src/libmncc/libmncc.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \
@ -74,6 +76,7 @@ test_dms_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libfft/libfft.a \
$(top_builddir)/src/libmncc/libmncc.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \
@ -94,6 +97,7 @@ test_sms_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libfft/libfft.a \
$(top_builddir)/src/libmncc/libmncc.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \

Loading…
Cancel
Save