dect
/
libdect
Archived
13
0
Fork 0

Import libdect

Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
Patrick McHardy 2009-05-06 18:41:57 +02:00
commit 0406a88b39
62 changed files with 12248 additions and 0 deletions

18
.gitignore vendored Normal file
View File

@ -0,0 +1,18 @@
# Dependency and object files
.*.d
*.o
# Generated by autoconf/configure
Makefile
Makefile.defs
Makefile.rules
config.h
config.h.in
config.h.in~
config.log
config.status
configure
autom4te.cache
# Debian package build temporary files
build-stamp

42
Makefile.defs.in Normal file
View File

@ -0,0 +1,42 @@
DEBUG = @CONFIG_DEBUG@
CC = @CC@
CPP = @CPP@
LEX = @LEX@
YACC = @YACC@
MKDIR_P = @MKDIR_P@
LN_S = @LN_S@
INSTALL = @INSTALL@
DOXYGEN = doxygen
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_VERSION = @PACKAGE_VERSION@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
prefix = @prefix@
exec_prefix = @exec_prefix@
sysconfdir = @sysconfdir@
datarootdir = @datarootdir@
mandir = @mandir@
docdir = @docdir@
pdfdir = @pdfdir@
confdir = @sysconfdir@/dect
LDFLAGS += @LDFLAGS@
LDFLAGS += @LIBS@
CPPFLAGS += @CPPFLAGS@
CFLAGS += @CFLAGS@ @DEFS@
CFLAGS += -include config.h -I include
CFLAGS += -fno-strict-aliasing
CFLAGS += -Wall -Werror
CFLAGS += -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
CFLAGS += -Wdeclaration-after-statement -Wsign-compare -Winit-self
CFLAGS += -Wformat-nonliteral -Wformat-security -Wmissing-format-attribute
CFLAGS += -Wcast-align -Wundef -Wbad-function-cast # -Wshadow
CFLAGS += -Waggregate-return -Wunused -Wwrite-strings
ifeq ($(DEBUG),y)
CFLAGS += -g -DDEBUG
endif

5
Makefile.in Normal file
View File

@ -0,0 +1,5 @@
SUBDIRS += include
SUBDIRS += src
SUBDIRS += example
include Makefile.rules

108
Makefile.rules.in Normal file
View File

@ -0,0 +1,108 @@
include Makefile.defs
makedeps += $(SUBDIR)Makefile
makedeps += Makefile
makedeps += Makefile.defs
makedeps += Makefile.rules
configure: configure.ac
sh autogen.sh
%: %.in configure
sh configure
%.o: %.c $(makedeps)
@echo -e " CC\t\t$<"
$(CC) $(CFLAGS) -c -o $@ $<
.%.d: %.c $(makedeps)
@echo -e " DEP\t\t$<"
$(RM) $@
$(CC) -M $(CFLAGS) $< | sed 's,$(*F)\.o[ :]*,$*.o $@ : ,g' > $@
%.c %.h: %.y $(makedeps)
@echo -e " YACC\t\t$<"
$(YACC) $(YACCFLAGS) -d -o $@ $<
%.c %.h: %.l $(makedeps)
@echo -e " LEX\t\t$<"
$(LEX) -t --header-file=$(<:.l=.h) $< > $@
%.8: %.xml $(makedeps)
@echo -e " MAN\t\t$<"
docbook2x-man $<
%.pdf: %.xml $(makedeps)
@echo -e " PDF\t\t$<"
db2pdf $<
define generic_template
$(1)-obj := $$(patsubst %,$(SUBDIR)%,$$($(1)-obj))
depfiles := $$(patsubst $(SUBDIR)%.o,$(SUBDIR).%.d,$$($(1)-obj))
.PHONY: $(1)-clean
$(1)-clean:
@echo -e " CLEAN\t\t$(1)"
$$(RM) $$($(1)-obj) $$(depfiles) $$($(1)-extra-clean-files) $(1)
clean_targets += $(1)-clean
.PHONY: $(1)-install
ifneq ($(MAKECMDGOALS),clean)
-include $$(depfiles)
endif
endef
define program_template
$(eval $(call generic_template,$(1)))
$(SUBDIR)$(1): $$($(1)-extra-targets) $$($(1)-obj)
@echo -e " LD\t\t$$@"
$$(CC) $$($(1)-obj) $$(LDFLAGS) -o $$@
all_targets += $(SUBDIR)$(1)
$(1)-install:
@echo -e " INSTALL\t$1"
$(MKDIR_P) $$(DESTDIR)/$$($(1)-destdir)
$(INSTALL) -m 755 -o root -g root $(SUBDIR)$(1) \
$$(DESTDIR)/$$($(1)-destdir)/$(1)
install_targets += $(1)-install
endef
define library_template
$(eval $(call generic_template,$(1)))
$(SUBDIR)lib$(1).so: $$($(1)-extra-targets) $$($(1)-obj)
@echo -e " LD\t\t$$@"
$$(CC) -shared -Wl,-soname,lib$(1).so.0 $$($(1)-obj) $$(LDFLAGS) -o $$@
all_targets += $(SUBDIR)lib$(1).so
$(1)-install:
@echo -e " INSTALL\t$1"
$(MKDIR_P) $$(DESTDIR)/$$($(1)-destdir)
$(INSTALL) -m 755 -o root -g root $(SUBDIR)lib$(1).so \
$$(DESTDIR)/$$($(1)-destdir)/lib$(1).so.$(PACKAGE_VERSION)
$(LN_S) -f lib$(1).so.$(PACKAGE_VERSION) \
$(DESTDIR)/$$($(1)-destdir)/lib$(1).so.0
$(LN_S) -f lib$(1).so.$(PACKAGE_VERSION) \
$(DESTDIR)/$$($(1)-destdir)/lib$(1).so
install_targets += $(1)-install
endef
ifneq ($(SUBDIR),)
include $(SUBDIR)/Makefile
$(foreach prog,$(PROGRAMS),$(eval $(call program_template,$(prog))))
$(foreach lib,$(LIBS),$(eval $(call library_template,$(lib))))
endif
.DEFAULT_GOAL := all
.PHONY: all clean install
all: $(SUBDIRS) $(all_targets)
clean: $(SUBDIRS) $(clean_targets)
install: all $(SUBDIRS) $(install_targets)
.PHONY: $(SUBDIRS)
$(SUBDIRS):
@echo -e " SUBDIR\t$@/"
@$(MAKE) -s -f Makefile.rules $(MAKECMDGOALS) SUBDIR="$@/"

4
autogen.sh Executable file
View File

@ -0,0 +1,4 @@
#! /bin/sh
autoreconf -fi;
rm -Rf autom4te*.cache config.h.in~

74
configure.ac Normal file
View File

@ -0,0 +1,74 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_COPYRIGHT([Copyright (c) 2008 Patrick McHardy <kaber@trash.net>])
AC_INIT([libdect], [0.0.1], [kaber@trash.net])
AC_DEFINE([RELEASE_NAME], ["libdect"], [Release name])
AC_CONFIG_SRCDIR([src/s_msg.c])
AC_CONFIG_HEADER([config.h])
AC_DEFINE([_GNU_SOURCE], [], [Enable various GNU extensions])
AC_DEFINE([_STDC_FORMAT_MACROS], [], [printf-style format macros])
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug], [Enable debugging]),
[CONFIG_DEBUG="$(echo $enableval | cut -b1)"],
[CONFIG_DEBUG="y"])
AC_SUBST([CONFIG_DEBUG])
# Checks for programs.
AC_PROG_CC
AC_PROG_MKDIR_P
AC_PROG_INSTALL
AC_PROG_LN_S
# Checks for libraries.
AC_CHECK_LIB([nl], [nl_socket_alloc], ,
AC_MSG_ERROR([No suitable version of libnl found]))
AC_CHECK_LIB([nl-dect], [nl_dect_cluster_alloc], ,
AC_MSG_ERROR([No suitable version of libnl-dect found]))
AC_CHECK_LIB([event], [event_init], ,
AC_MSG_ERROR([No suitable version of libevent found]))
AC_CHECK_LIB([SDL], [SDL_OpenAudio], ,
AC_MSG_ERROR([No suitable version of libsdl found]))
# Checks for header files.
AC_HEADER_STDC
AC_HEADER_ASSERT
AC_CHECK_HEADERS([fcntl.h inttypes.h libintl.h limits.h malloc.h \
stddef.h stdint.h stdlib.h string.h unistd.h], ,
AC_MSG_ERROR([Header file not found]))
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_TYPE_UID_T
AC_TYPE_INT8_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([memmove memset strchr strdup strerror strtoull])
AC_CONFIG_FILES([Makefile Makefile.defs Makefile.rules])
AC_CONFIG_FILES([include/Makefile])
AC_CONFIG_FILES([src/Makefile])
AC_CONFIG_FILES([example/Makefile])
AC_CONFIG_FILES([doc/Makefile doc/Doxyfile])
AC_OUTPUT

1417
doc/Doxyfile.in Normal file

File diff suppressed because it is too large Load Diff

4
doc/Makefile.in Normal file
View File

@ -0,0 +1,4 @@
all: doxygen
doxygen:
$(DOXYGEN) $(SUBDIR)Doxyfile

1
example/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
test

8
example/Makefile.in Normal file
View File

@ -0,0 +1,8 @@
LDFLAGS += -Lsrc -ldect
PROGRAMS += test
test-destdir := usr/bin
test-obj += event_ops.o
test-obj += audio.o
test-obj += test.o

95
example/audio.c Normal file
View File

@ -0,0 +1,95 @@
#include <SDL/SDL.h>
#include <SDL/SDL_audio.h>
#include "common.h"
void dect_audio_queue(struct dect_audio_handle *ah, struct dect_msg_buf *mb)
{
SDL_LockAudio();
list_add_tail(&mb->list, &ah->queue);
SDL_UnlockAudio();
}
static void dect_decode_g721(struct g72x_state *codec,
int16_t *dst, const uint8_t *src,
unsigned int len)
{
unsigned int i;
for (i = 0; i < len * 2; i += 2) {
dst[i + 0] = g721_decoder(src[i / 2] >> 4,
AUDIO_ENCODING_LINEAR, codec);
dst[i + 1] = g721_decoder(src[i / 2] & 0x0f,
AUDIO_ENCODING_LINEAR, codec);
}
}
static void dect_audio_dequeue(void *data, uint8_t *stream, int len)
{
struct dect_audio_handle *ah = data;
struct dect_msg_buf *mb;
int copy;
len /= 4;
while (1) {
if (list_empty(&ah->queue))
goto underrun;
mb = list_first_entry(&ah->queue, struct dect_msg_buf, list);
copy = mb->len;
if (copy > len)
copy = len;
dect_decode_g721(&ah->codec, (int16_t *)stream, mb->data, copy);
dect_mbuf_pull(mb, copy);
if (mb->len == 0) {
list_del(&mb->list);
free(mb);
}
len -= copy;
if (len == 0)
return;
stream += 4 * copy;
}
underrun:
printf("audio underrun, missing %u bytes\n", len * 4);
memset(stream, 0, len * 4);
}
struct dect_audio_handle *dect_audio_open(void)
{
struct dect_audio_handle *ah;
SDL_AudioSpec spec = {
.freq = 8000,
.format = AUDIO_S16SYS,
.channels = 1,
.samples = 512,
.callback = dect_audio_dequeue,
};
ah = malloc(sizeof(*ah));
if (ah == NULL)
goto err1;
init_list_head(&ah->queue);
g72x_init_state(&ah->codec);
spec.userdata = ah;
if (SDL_OpenAudio(&spec, NULL) < 0)
goto err2;
SDL_PauseAudio(0);
return ah;
err2:
free(ah);
err1:
return NULL;
}
static void __init dect_audio_init(void)
{
if (SDL_Init(SDL_INIT_AUDIO) < 0) {
fprintf(stderr, "Could not initialize SDL: %s\n", SDL_GetError());
exit(1);
}
}

23
example/common.h Normal file
View File

@ -0,0 +1,23 @@
#ifndef _DECT_TEST_COMMON_H
#define _DECT_TEST_COMMON_H
#include <libdect.h>
#include <utils.h>
#include <list.h>
extern struct dect_handle *dh;
extern int dect_event_ops_init(struct dect_ops *ops);
extern void dect_event_loop(void);
extern void dect_event_ops_cleanup(void);
#include "../src/ccitt-adpcm/g72x.h"
struct dect_audio_handle {
struct g72x_state codec;
struct list_head queue;
};
extern struct dect_audio_handle *dect_audio_open(void);
extern void dect_audio_queue(struct dect_audio_handle *ah, struct dect_msg_buf *mb);
#endif /* _DECT_TEST_COMMON_H */

115
example/event_ops.c Normal file
View File

@ -0,0 +1,115 @@
#include <stdlib.h>
#include <sys/types.h>
#include <sys/time.h>
#include <signal.h>
#include <event.h>
#include <libdect.h>
#include "common.h"
struct dect_handle *dh;
static void event_callback(int fd, short mask, void *data)
{
struct dect_fd *dfd = data;
uint32_t events;
events = 0;
if (mask & EV_READ)
events |= DECT_FD_READ;
if (mask & EV_WRITE)
events |= DECT_FD_WRITE;
dfd->callback(dh, dfd, events);
}
static int register_fd(const struct dect_handle *dh, struct dect_fd *dfd,
uint32_t events)
{
struct event *ev = (struct event *)dfd->priv;
unsigned short mask;
mask = EV_PERSIST;
if (events & DECT_FD_READ)
mask |= EV_READ;
if (events & DECT_FD_WRITE)
mask |= EV_WRITE;
event_set(ev, dfd->fd, mask, event_callback, dfd);
event_add(ev, NULL);
return 0;
}
static void unregister_fd(const struct dect_handle *dh, struct dect_fd *dfd)
{
struct event *ev = (struct event *)dfd->priv;
event_del(ev);
}
static void timer_expire(int fd, short mask, void *data)
{
struct dect_timer *timer = data;
timer->callback(dh, timer);
}
static void start_timer(const struct dect_handle *dh,
struct dect_timer *timer,
const struct timeval *tv)
{
struct event *ev = (struct event *)timer->priv;
evtimer_set(ev, timer_expire, timer);
evtimer_add(ev, (struct timeval *)tv);
}
static void stop_timer(const struct dect_handle *dh, struct dect_timer *timer)
{
struct event *ev = (struct event *)timer->priv;
evtimer_del(ev);
}
static const struct dect_event_ops dect_event_ops = {
.fd_priv_size = sizeof(struct event),
.register_fd = register_fd,
.unregister_fd = unregister_fd,
.timer_priv_size = sizeof(struct event),
.start_timer = start_timer,
.stop_timer = stop_timer
};
static struct event_base *ev_base;
static struct event sig_event;
static bool sigint;
static void sig_callback(int fd, short event, void *data)
{
sigint = true;
}
int dect_event_ops_init(struct dect_ops *ops)
{
ev_base = event_init();
if (ev_base == NULL)
return -1;
ops->event_ops = &dect_event_ops;
signal_set(&sig_event, SIGINT, sig_callback, NULL);
signal_add(&sig_event, NULL);
return 0;
}
void dect_event_loop(void)
{
while (!sigint)
event_loop(EVLOOP_ONCE);
signal_del(&sig_event);
}
void dect_event_ops_cleanup(void)
{
event_base_free(ev_base);
}

BIN
example/mm Executable file

Binary file not shown.

74
example/mm.c Normal file
View File

@ -0,0 +1,74 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dect/libdect.h>
#include "common.h"
enum phones { PHONE1, PHONE2, PHONE3, };
static const struct dect_ipui ipuis[] = {
[PHONE1] = {
.put = DECT_IPUI_N,
.pun.n.ipei = {
.emc = 0x08ae,
.psn = 0x83d1e,
},
},
[PHONE2] = {
.put = DECT_IPUI_N,
.pun.n.ipei = {
.emc = 0x08ae,
.psn = 0x8969f,
},
},
[PHONE3] = {
.put = DECT_IPUI_N,
.pun.n.ipei = {
.emc = 0x08ae,
.psn = 0x5b9a0,
},
},
};
static const struct dect_mm_ops mm_ops = {
.mm_access_rights_ind = 0,
.mm_access_rights_cfm = 0,
};
static int mm_access_rights_request(struct dect_handle *dh)
{
struct dect_ie_portable_identity portable_identity;
struct dect_mm_access_rights_param param = {
.portable_identity = &portable_identity,
};
dect_ie_init(&portable_identity);
portable_identity.type = ID_TYPE_IPUI;
portable_identity.ipui = ipuis[PHONE1];
return dect_mm_access_rights_req(dh, &param);
}
static struct dect_ops ops = {
.mm_ops = &mm_ops,
};
int main(int argc, char **argv)
{
if (dect_event_ops_init(&ops) < 0)
exit(1);
dh = dect_alloc_handle(&ops);
if (dh == NULL)
exit(1);
if (dect_init(dh) < 0)
exit(1);
if (mm_access_rights_request(dh) < 0)
exit(1);
dect_event_loop();
dect_close_handle(dh);
dect_event_ops_cleanup();
return 0;
}

294
example/test.c Normal file
View File

@ -0,0 +1,294 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/time.h>
#include <event.h>
#include <dect/libdect.h>
#include <dect/terminal.h>
#include <dect/keypad.h>
#include "common.h"
struct call {
struct dect_keypad_buffer *keybuf;
struct dect_audio_handle *audio;
struct event event;
enum {
BLINK0,
RING,
BLINK1,
SCROLLING,
} state;
uint8_t scroll_off;
uint8_t ring_pattern;
};
enum phones { PHONE1, PHONE2, PHONE3, };
static const struct dect_ipui ipuis[] = {
[PHONE1] = {
.put = DECT_IPUI_N,
.pun.n.ipei = {
.emc = 0x08ae,
.psn = 0x83d1e,
},
},
[PHONE2] = {
.put = DECT_IPUI_N,
.pun.n.ipei = {
.emc = 0x08ae,
.psn = 0x8969f,
},
},
[PHONE3] = {
.put = DECT_IPUI_N,
.pun.n.ipei = {
.emc = 0x08ae,
.psn = 0x5b9a0,
},
},
};
static void dect_mncc_timer(int fd, short even, void *data);
static void dect_mncc_timer_schedule(struct dect_call *call)
{
struct call *priv = dect_call_priv(call);
struct timeval tv = { .tv_sec = 1 };
evtimer_set(&priv->event, dect_mncc_timer, call);
evtimer_add(&priv->event, &tv);
}
static void dect_mncc_timer(int fd, short even, void *data)
{
struct dect_call *call = data;
struct dect_ie_display display;
struct dect_ie_signal signal;
struct dect_mncc_info_param info = {
//.signal = &signal,
.display = &display,
};
static int code;
init_list_head(&info.progress_indicator.list);
dect_ie_init(&signal);
signal.code = DECT_SIGNAL_ALERTING_BASE | (code % 10);
dect_display_init(&display);
dect_display_append_char(&display, code++);
dect_mncc_info_req(dh, call, &info);
dect_mncc_timer_schedule(call);
}
static void dect_keypad_complete(struct dect_handle *dh, void *call,
struct dect_ie_keypad *keypad)
{
printf("keypad complete: '%.*s'\n", keypad->len, keypad->info);
}
static void dect_mncc_connect_ind(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_connect_param *param)
{
printf("MNCC_CONNECT-ind\n");
}
static void dect_mncc_setup_ind(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_setup_param *setup)
{
struct call *priv = dect_call_priv(call);
struct dect_ie_signal signal;
struct dect_mncc_connect_param connect = {
//.signal = &signal,
};
printf("MNCC_SETUP-ind\n");
dect_ie_init(&signal);
signal.code = DECT_SIGNAL_DIAL_TONE_ON;
priv->keybuf = dect_keypad_buffer_init(dh, 3, dect_keypad_complete, call);
priv->audio = dect_audio_open();
dect_mncc_connect_req(dh, call, &connect);
}
static void dect_mncc_setup_ack_ind(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_setup_ack_param *param)
{
printf("MNCC_SETUP_ACK-ind\n");
}
static void dect_mncc_info_ind(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_info_param *param)
{
struct call *priv = dect_call_priv(call);
struct dect_ie_progress_indicator progress_indicator;
struct dect_ie_signal signal;
struct dect_mncc_info_param info = {
.signal = &signal,
};
printf("MNCC_INFO-ind\n");
return;
dect_keypad_append(dh, priv->keybuf, param->keypad,
param->sending_complete);
dect_ie_init(&signal);
signal.code = DECT_SIGNAL_DIAL_TONE_ON;
dect_ie_init(&progress_indicator);
progress_indicator.location = DECT_LOCATION_PRIVATE_NETWORK_SERVING_LOCAL_USER;
progress_indicator.progress = DECT_PROGRESS_INBAND_INFORMATION_NOW_AVAILABLE;
init_list_head(&info.progress_indicator.list);
list_add_tail(&progress_indicator.common.list, &info.progress_indicator.list);
dect_mncc_info_req(dh, call, &info);
}
static void dect_mncc_send_call_info(struct dect_call *call)
{
struct call *priv = dect_call_priv(call);
struct dect_ie_display display;
struct dect_ie_signal signal;
struct dect_mncc_info_param info = {
.display = &display,
.signal = &signal,
};
static const char *text = " kaber ";
dect_display_init(&display);
dect_display_append_char(&display, DECT_C_CLEAR_DISPLAY);
dect_display_append_char(&display, '*');
dect_display_append(&display, text + priv->scroll_off,
strlen(text) - priv->scroll_off);
dect_display_append(&display, text, priv->scroll_off);
dect_display_append_char(&display, '*');
dect_ie_init(&signal);
if (priv->state == RING) {
signal.code = DECT_SIGNAL_ALERTING_BASE | priv->ring_pattern;
priv->ring_pattern = (priv->ring_pattern + 1) % 8;
} else
signal.code = DECT_SIGNAL_ALERTING_BASE | DECT_RING_OFF;
if (priv->state != SCROLLING)
priv->state++;
else {
priv->scroll_off = (priv->scroll_off + 1) % (strlen(text) + 1);
if (priv->scroll_off == 0)
priv->state = 0;
}
dect_mncc_info_req(dh, call, &info);
}
static void dect_mncc_info_timer(int fd, short even, void *data);
static void dect_mncc_info_timer_schedule(struct dect_call *call)
{
struct call *priv = dect_call_priv(call);
struct timeval tv = { .tv_usec = 500000 };
evtimer_set(&priv->event, dect_mncc_info_timer, call);
evtimer_add(&priv->event, &tv);
}
static void dect_mncc_info_timer(int fd, short even, void *data)
{
struct dect_call *call = data;
dect_mncc_send_call_info(call);
dect_mncc_info_timer_schedule(call);
}
static void dect_mncc_alert_ind(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_alert_param *param)
{
printf("MNCC_ALERT-ind\n");
dect_mncc_info_timer(0, 0, call);
}
static void dect_mncc_reject_ind(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_release_param *param)
{
struct call *priv = dect_call_priv(call);
printf("MNCC_REJECT-ind\n");
event_del(&priv->event);
}
static void dect_open_call(struct dect_handle *dh, const struct dect_ipui *ipui)
{
struct dect_ie_basic_service basic_service;
struct dect_mncc_setup_param param = {
.basic_service = &basic_service,
};
struct dect_call *call;
struct call *priv;
call = dect_call_alloc(dh);
if (call == NULL)
return;
priv = dect_call_priv(call);
dect_ie_init(&basic_service);
basic_service.class = DECT_CALL_CLASS_NORMAL;
basic_service.service = DECT_SERVICE_BASIC_SPEECH_DEFAULT;
dect_mncc_setup_req(dh, call, ipui, &param);
}
static void dect_dl_u_data_ind(struct dect_handle *dh, struct dect_call *call,
struct dect_msg_buf *mb)
{
struct call *priv = dect_call_priv(call);
dect_dl_u_data_req(dh, call, mb);
dect_audio_queue(priv->audio, mb);
}
static const struct dect_cc_ops cc_ops = {
.priv_size = sizeof(struct call),
.mncc_connect_ind = dect_mncc_connect_ind,
.mncc_setup_ind = dect_mncc_setup_ind,
.mncc_setup_ack_ind = dect_mncc_setup_ack_ind,
.mncc_info_ind = dect_mncc_info_ind,
.mncc_alert_ind = dect_mncc_alert_ind,
.mncc_reject_ind = dect_mncc_reject_ind,
.dl_u_data_ind = dect_dl_u_data_ind,
};
static const struct dect_mm_ops mm_ops = {
.mm_access_rights_ind = 0,
.mm_access_rights_cfm = 0,
};
static struct dect_ops ops = {
.cc_ops = &cc_ops,
.mm_ops = &mm_ops,
};
int main(int argc, char **argv)
{
if (dect_event_ops_init(&ops) < 0)
exit(1);
dh = dect_alloc_handle(&ops);
if (dh == NULL)
exit(1);
if (dect_init(dh) < 0)
exit(1);
#if 0
//dect_lce_group_ring(dh, 0xf);
dect_open_call(dh, &ipuis[PHONE1]);
dect_open_call(dh, &ipuis[PHONE3]);
#else
dect_open_call(dh, &ipuis[PHONE2]);
#endif
dect_event_loop();
dect_close_handle(dh);
dect_event_ops_cleanup();
return 0;
}

3
include/Makefile.in Normal file
View File

@ -0,0 +1,3 @@
install:
install -d $(DESTDIR)/usr/include/dect
install -m 644 -t $(DESTDIR)/usr/include/dect/ include/dect/*

48
include/b_fmt.h Normal file
View File

@ -0,0 +1,48 @@
#ifndef _DECT_B_FMT_H
#define _DECT_B_FMT_H
struct dect_short_page_msg {
uint8_t hdr;
__be16 information;
} __packed;
/*
* LCE request paging messages
*/
#define DECT_LCE_PAGE_W_FLAG 0x08
#define DECT_LCE_PAGE_HDR_MASK 0x07
/**
* @DECT_LCE_PAGE_U_PLANE_NONE: no U-plane
* @DECT_LCE_PAGE_UNKNOWN_RINGING: Unknown MAC service type and Ringing
* @DECT_LCE_PAGE_ESCAPE: Escape
* @DECT_LCE_PAGE_GENERAL_PURPOSE: General purpose code
* @DECT_LCE_PAGE_GENERAL_VOICE: General purpose code for voice service
* @DECT_LCE_PAGE_AUXILIARY: Auxiliary code
* @DECT_LCE_PAGE_DPRS_INITIAL_SETUP: DPRS initial set-up code
* @DECT_LCE_PAGE_DPRS_INITIAL_SETUP: DPRS resume code
*/
enum lce_request_page_hdr_codes {
DECT_LCE_PAGE_U_PLANE_NONE,
DECT_LCE_PAGE_UNKNOWN_RINGING,
DECT_LCE_PAGE_ESCAPE,
DECT_LCE_PAGE_GENERAL_PURPOSE,
DECT_LCE_PAGE_GENERAL_VOICE,
DECT_LCE_PAGE_AUXILIARY,
DECT_LCE_PAGE_DPRS_INITIAL_SETUP,
DECT_LCE_PAGE_DPRS_RESUME,
};
/* Short format message: group ringing request */
#define DECT_LCE_SHORT_PAGE_RING_PATTERN_MASK 0xf000
#define DECT_LCE_SHORT_PAGE_RING_PATTERN_SHIFT 12
#define DECT_LCE_SHORT_PAGE_GROUP_MASK 0x0fff
/* Short format message: other cases */
#define DECT_LCE_SHORT_PAGE_TPUI_MASK 0xffff
#endif /* _DECT_B_FMT_H */

333
include/cc.h Normal file
View File

@ -0,0 +1,333 @@
/*
* DECT Call Control
*
* Copyright (c) 2009 Patrick McHardy <kaber@trash.net>
*/
#ifndef _DECT_CC_H
#define _DECT_CC_H
/**
* Call Control message types
*/
enum dect_cc_msg_types {
CC_RESERVED = 0x0,
CC_ALERTING = 0x1,
CC_CALL_PROC = 0x2,
CC_SETUP = 0x5,
CC_CONNECT = 0x7,
CC_SETUP_ACK = 0xd,
CC_CONNECT_ACK = 0xf,
CC_SERVICE_CHANGE = 0x20,
CC_SERVICE_ACCEPT = 0x21,
CC_SERVICE_REJECT = 0x22,
CC_RELEASE = 0x4d,
CC_RELEASE_COM = 0x5a,
CC_IWU_INFO = 0x60,
CC_NOTIFY = 0x6e,
CC_INFO = 0x7b,
};
struct dect_cc_setup_msg {
struct dect_msg_common common;
struct dect_ie_portable_identity *portable_identity;
struct dect_ie_fixed_identity *fixed_identity;
struct dect_ie_nwk_assigned_identity *nwk_assigned_identity;
struct dect_ie_basic_service *basic_service;
struct dect_ie_repeat_indicator iwu_attributes;
struct dect_ie_repeat_indicator call_attributes;
struct dect_ie_repeat_indicator connection_attributes;
struct dect_ie_cipher_info *cipher_info;
struct dect_ie_connection_identity *connection_identity;
struct dect_ie_repeat_indicator facility;
struct dect_ie_repeat_indicator progress_indicator;
struct dect_ie_display *display;
struct dect_ie_keypad *keypad;
struct dect_ie_signal *signal;
struct dect_ie_feature_activate *feature_activate;
struct dect_ie_feature_indicate *feature_indicate;
struct dect_ie_network_parameter *network_parameter;
struct dect_ie_ext_ho_indicator *ext_ho_indicator;
struct dect_ie_terminal_capability *terminal_capability;
struct dect_ie_end_to_end_compatibility *end_to_end_compatibility;
struct dect_ie_rate_parameters *rate_parameters;
struct dect_ie_transit_delay *transit_delay;
struct dect_ie_window_size *window_size;
struct dect_ie_calling_party_number *calling_party_number;
struct dect_ie_called_party_number *called_party_number;
struct dect_ie_called_party_subaddress *called_party_subaddress;
struct dect_ie_sending_complete *sending_complete;
struct dect_ie_repeat_indicator segmented_info;
struct dect_ie_iwu_to_iwu *iwu_to_iwu;
struct dect_ie_iwu_packet *iwu_packet;
struct dect_ie_calling_party_name *calling_party_name;
struct dect_ie_codec_list *codec_list;
struct dect_ie_call_information *call_information;
struct dect_ie_escape_to_proprietary *escape_to_proprietary;
};
struct dect_cc_info_msg {
struct dect_msg_common common;
struct dect_ie_location_area *location_area;
struct dect_ie_nwk_assigned_identity *nwk_assigned_identity;
struct dect_ie_repeat_indicator facility;
struct dect_ie_repeat_indicator progress_indicator;
struct dect_ie_display *display;
struct dect_ie_keypad *keypad;
struct dect_ie_signal *signal;
struct dect_ie_feature_activate *feature_activate;
struct dect_ie_feature_indicate *feature_indicate;
struct dect_ie_network_parameter *network_parameter;
struct dect_ie_ext_ho_indicator *ext_ho_indicator;
struct dect_ie_calling_party_number *calling_party_number;
struct dect_ie_called_party_number *called_party_number;
struct dect_ie_called_party_subaddress *called_party_subaddress;
struct dect_ie_sending_complete *sending_complete;
struct dect_ie_test_hook_control *test_hook_control;
struct dect_ie_repeat_indicator iwu_to_iwu;
struct dect_ie_iwu_packet *iwu_packet;
struct dect_ie_calling_party_name *calling_party_name;
struct dect_ie_codec_list *codec_list;
struct dect_ie_call_information *call_information;
struct dect_ie_escape_to_proprietary *escape_to_proprietary;
};
struct dect_cc_setup_ack_msg {
struct dect_msg_common common;
struct dect_ie_info_type *info_type;
struct dect_ie_portable_identity *portable_identity;
struct dect_ie_fixed_identity *fixed_identity;
struct dect_ie_location_area *location_area;
struct dect_ie_iwu_attributes *iwu_attributes;
struct dect_ie_call_attributes *call_attributes;
struct dect_ie_connection_attributes *connection_attributes;
struct dect_ie_connection_identity *connection_identity;
struct dect_ie_repeat_indicator facility;
struct dect_ie_repeat_indicator progress_indicator;
struct dect_ie_display *display;
struct dect_ie_signal *signal;
struct dect_ie_feature_indicate *feature_indicate;
struct dect_ie_network_parameter *network_parameter;
struct dect_ie_ext_ho_indicator *ext_ho_indicator;
struct dect_ie_transit_delay *transit_delay;
struct dect_ie_window_size *window_size;
struct dect_ie_delimiter_request *delimiter_request;
struct dect_ie_repeat_indicator iwu_to_iwu;
struct dect_ie_iwu_packet *iwu_packet;
struct dect_ie_codec_list *codec_list;
struct dect_ie_escape_to_proprietary *escape_to_proprietary;
};
struct dect_cc_call_proc_msg {
struct dect_msg_common common;
struct dect_ie_iwu_attributes *iwu_attributes;
struct dect_ie_call_attributes *call_attributes;
struct dect_ie_connection_attributes *connection_attributes;
struct dect_ie_connection_identity *connection_identity;
struct dect_ie_repeat_indicator facility;
struct dect_ie_repeat_indicator progress_indicator;
struct dect_ie_display *display;
struct dect_ie_signal *signal;
struct dect_ie_feature_indicate *feature_indicate;
struct dect_ie_transit_delay *transit_delay;
struct dect_ie_window_size *window_size;
struct dect_ie_repeat_indicator iwu_to_iwu;
struct dect_ie_iwu_packet *iwu_packet;
struct dect_ie_codec_list *codec_list;
struct dect_ie_escape_to_proprietary *escape_to_proprietary;
};
struct dect_cc_alerting_msg {
struct dect_msg_common common;
struct dect_ie_iwu_attributes *iwu_attributes;
struct dect_ie_call_attributes *call_attributes;
struct dect_ie_connection_attributes *connection_attributes;
struct dect_ie_connection_identity *connection_identity;
struct dect_ie_repeat_indicator facility;
struct dect_ie_repeat_indicator progress_indicator;
struct dect_ie_display *display;
struct dect_ie_signal *signal;
struct dect_ie_feature_indicate *feature_indicate;
struct dect_ie_terminal_capability *terminal_capability;
struct dect_ie_transit_delay *transit_delay;
struct dect_ie_window_size *window_size;
struct dect_ie_repeat_indicator iwu_to_iwu;
struct dect_ie_iwu_packet *iwu_packet;
struct dect_ie_codec_list *codec_list;
struct dect_ie_escape_to_proprietary *escape_to_proprietary;
};
struct dect_cc_connect_msg {
struct dect_msg_common common;
struct dect_ie_iwu_attributes *iwu_attributes;
struct dect_ie_call_attributes *call_attributes;
struct dect_ie_connection_attributes *connection_attributes;
struct dect_ie_connection_identity *connection_identity;
struct dect_ie_repeat_indicator facility;
struct dect_ie_repeat_indicator progress_indicator;
struct dect_ie_display *display;
struct dect_ie_signal *signal;
struct dect_ie_feature_indicate *feature_indicate;
struct dect_ie_network_parameter *network_parameter;
struct dect_ie_ext_ho_indicator *ext_ho_indicator;
struct dect_ie_terminal_capability *terminal_capability;
struct dect_ie_transit_delay *transit_delay;
struct dect_ie_window_size *window_size;
struct dect_ie_repeat_indicator segmented_info;
struct dect_ie_iwu_to_iwu *iwu_to_iwu;
struct dect_ie_iwu_packet *iwu_packet;
struct dect_ie_codec_list *codec_list;
struct dect_ie_escape_to_proprietary *escape_to_proprietary;
};
struct dect_cc_connect_ack_msg {
struct dect_msg_common common;
struct dect_ie_display *display;
struct dect_ie_feature_indicate *feature_indicate;
struct dect_ie_repeat_indicator iwu_to_iwu;
struct dect_ie_iwu_packet *iwu_packet;
struct dect_ie_escape_to_proprietary *escape_to_proprietary;
};
struct dect_cc_release_msg {
struct dect_msg_common common;
struct dect_ie_release_reason *release_reason;
struct dect_ie_repeat_indicator facility;
struct dect_ie_repeat_indicator progress_indicator;
struct dect_ie_display *display;
struct dect_ie_feature_indicate *feature_indicate;
struct dect_ie_repeat_indicator segmented_info;
struct dect_ie_iwu_to_iwu *iwu_to_iwu;
struct dect_ie_iwu_packet *iwu_packet;
struct dect_ie_escape_to_proprietary *escape_to_proprietary;
};
struct dect_cc_release_com_msg {
struct dect_msg_common common;
struct dect_ie_release_reason *release_reason;
struct dect_ie_identity_type *identity_type;
struct dect_ie_location_area *location_area;
struct dect_ie_iwu_attributes *iwu_attributes;
struct dect_ie_connection_attributes *connection_attributes;
struct dect_ie_repeat_indicator facility;
struct dect_ie_display *display;
struct dect_ie_feature_indicate *feature_indicate;
struct dect_ie_network_parameter *network_parameter;
struct dect_ie_repeat_indicator segmented_info;
struct dect_ie_iwu_to_iwu *iwu_to_iwu;
struct dect_ie_iwu_packet *iwu_packet;
struct dect_ie_escape_to_proprietary *escape_to_proprietary;
};
struct dect_cc_service_change_msg {
struct dect_msg_common common;
struct dect_ie_portable_identity *portable_identity;
struct dect_ie_iwu_attributes *iwu_attributes;
struct dect_ie_service_change_info *service_change_info;
struct dect_ie_call_attributes *call_attributes;
struct dect_ie_repeat_indicator connection_attributes;
struct dect_ie_connection_identity *connection_identity;
struct dect_ie_repeat_indicator segmented_info;
struct dect_ie_iwu_to_iwu *iwu_to_iwu;
struct dect_ie_codec_list *codec_list;
struct dect_ie_escape_to_proprietary *escape_to_proprietary;
};
struct dect_cc_service_accept_msg {
struct dect_msg_common common;
struct dect_ie_iwu_attributes *iwu_attributes;
struct dect_ie_connection_identity *connection_identity;
struct dect_ie_repeat_indicator segmented_info;
struct dect_ie_iwu_to_iwu *iwu_to_iwu;
struct dect_ie_escape_to_proprietary *escape_to_proprietary;
};
struct dect_cc_service_reject_msg {
struct dect_msg_common common;
struct dect_ie_release_reason *release_reason;
struct dect_ie_iwu_attributes *iwu_attributes;
struct dect_ie_connection_attributes *connection_attributes;
struct dect_ie_repeat_indicator segmented_info;
struct dect_ie_iwu_to_iwu *iwu_to_iwu;
struct dect_ie_escape_to_proprietary *escape_to_proprietary;
};
struct dect_cc_notify_msg {
struct dect_msg_common common;
struct dect_ie_timer_restart *timer_restart;
struct dect_ie_escape_to_proprietary *escape_to_proprietary;
};
struct dect_cc_iwu_info_msg {
struct dect_msg_common common;
struct dect_ie_portable_identity *portable_identity;
struct dect_ie_mms_generic_header *mms_generic_header;
struct dect_ie_mms_object_header *mms_object_header;
struct dect_ie_repeat_indicator mms_extended_header;
struct dect_ie_repeat_indicator time_date;
struct dect_ie_repeat_indicator calling_party_number;
struct dect_ie_repeat_indicator called_party_number;
struct dect_ie_called_party_subaddress *called_party_subaddress;
struct dect_ie_segmented_info *segmented_info;
struct dect_ie_alphanumeric *alphanumeric;
struct dect_ie_repeat_indicator segmented_info2;
struct dect_ie_iwu_to_iwu *iwu_to_iwu;
struct dect_ie_segmented_info *segmented_info3;
struct dect_ie_iwu_packet *iwu_packet;
struct dect_ie_codec_list *codec_list;
struct dect_ie_escape_to_proprietary *escape_to_proprietary;
};
/**
* enum dect_cc_states - CC call states
*
* @DECT_CC_NULL: T-00/F-00
* @DECT_CC_CALL_INITIATED: T-01/F-01
* @DECT_CC_OVERLAP_SENDING: T-02/F-02
* @DECT_CC_CALL_PROCEEDING: T-03/F-03
* @DECT_CC_CALL_DELIVERED: T-04/F-04
* @DECT_CC_CALL_PRESENT: T-06/F-06
* @DECT_CC_CALL_RECEIVED: T-07/F-07
* @DECT_CC_CONNECT_PENDING: T-08
* @DECT_CC_ACTIVE: T-10/F-10
* @DECT_CC_RELEASE_PENDING: T-19/F-19
* @DECT_CC_OVERLAP_RECEIVING: T-22/F-22
* @DECT_CC_INCOMING_CALL_PROCEEDING: T-23/F-23
*/
enum dect_cc_states {
DECT_CC_NULL,
DECT_CC_CALL_INITIATED,
DECT_CC_OVERLAP_SENDING,
DECT_CC_CALL_PROCEEDING,
DECT_CC_CALL_DELIVERED,
DECT_CC_CALL_PRESENT,
DECT_CC_CALL_RECEIVED,
DECT_CC_CONNECT_PENDING,
DECT_CC_ACTIVE,
DECT_CC_RELEASE_PENDING,
DECT_CC_OVERLAP_RECEIVING,
DECT_CC_INCOMING_CALL_PROCEEDING,
__DECT_CC_STATE_MAX
};
#define DECT_CC_STATE_MAX (__DECT_CC_STATE_MAX - 1)
/**
* @transaction: LCE link transaction
* @state: call state
* @setup_timer: call setup watchdog timer
* @lu_sap: U-Plane file descriptor
* @priv: libdect user private storage
*/
struct dect_call {
struct dect_transaction transaction;
struct dect_ie_fixed_identity *ft_id;
struct dect_ie_portable_identity *pt_id;
enum dect_cc_states state;
struct dect_timer *setup_timer;
struct dect_fd *lu_sap;
uint8_t priv[];
};
#define DECT_CC_SETUP_TIMEOUT 20 /* seconds */
#endif /* _DECT_CC_H */

15
include/coms.h Normal file
View File

@ -0,0 +1,15 @@
#ifndef _LIBDECT_COMS_H
#define _LIBDECT_COMS_H
/* COMS message types */
enum dect_coms_msg_types {
DECT_COMS_SETUP = 0x5,
DECT_COMS_CONNECT = 0x7,
DECT_COMS_NOTIFY = 0x8,
DECT_COMS_RELEASE = 0x4d,
DECT_COMS_RELEASE_COM = 0x5a,
DECT_COMS_INFO = 0x7b,
DECT_COMS_ACK = 0x78,
};
#endif /* _LIBDECT_COMS_H */

246
include/dect/cc.h Normal file
View File

@ -0,0 +1,246 @@
/*
* DECT Call-Control (CC) NWK <-> IWU interface
*
* Copyright (c) 2009 Patrick McHardy <kaber@trash.net>
*/
#ifndef _LIBDECT_DECT_CC_H
#define _LIBDECT_DECT_CC_H
#include <dect/ie.h>
/**
* struct dect_mncc_setup_param - MNCC_SETUP primitive parameters
*/
struct dect_mncc_setup_param {
struct dect_ie_basic_service *basic_service;
struct dect_ie_repeat_indicator iwu_attributes;
struct dect_ie_cipher_info *cipher_info;
struct dect_ie_repeat_indicator facility;
struct dect_ie_repeat_indicator progress_indicator;
struct dect_ie_display *display;
struct dect_ie_keypad *keypad;
struct dect_ie_signal *signal;
struct dect_ie_feature_activate *feature_activate;
struct dect_ie_feature_indicate *feature_indicate;
struct dect_ie_network_parameter *network_parameter;
struct dect_ie_terminal_capability *terminal_capability;
struct dect_ie_end_to_end_compatibility *end_to_end_compatibility;
struct dect_ie_rate_parameters *rate_parameters;
struct dect_ie_transit_delay *transit_delay;
struct dect_ie_window_size *window_size;
struct dect_ie_called_party_number *called_party_number;
struct dect_ie_called_party_subaddress *called_party_subaddress;
struct dect_ie_calling_party_number *calling_party_number;
struct dect_ie_calling_party_name *calling_party_name;
struct dect_ie_sending_complete *sending_complete;
struct dect_ie_iwu_to_iwu *iwu_to_iwu;
struct dect_ie_iwu_packet *iwu_packet;
};
struct dect_mncc_setup_ack_param {
struct dect_ie_info_type *info_type;
struct dect_ie_location_area *location_area;
struct dect_ie_repeat_indicator facility;
struct dect_ie_repeat_indicator progress_indicator;
struct dect_ie_display *display;
struct dect_ie_signal *signal;
struct dect_ie_feature_indicate *feature_indicate;
struct dect_ie_transit_delay *transit_delay;
struct dect_ie_window_size *window_size;
struct dect_ie_delimiter_request *delimiter_request;
struct dect_ie_repeat_indicator iwu_to_iwu;
struct dect_ie_iwu_packet *iwu_packet;
};
struct dect_mncc_release_param {
struct dect_ie_release_reason *release_reason;
struct dect_ie_identity_type *identity_type;
struct dect_ie_location_area *location_area;
struct dect_ie_iwu_attributes *iwu_attributes;
struct dect_ie_repeat_indicator facility;
struct dect_ie_display *display;
struct dect_ie_feature_indicate *feature_indicate;
struct dect_ie_network_parameter *network_parameter;
struct dect_ie_iwu_to_iwu *iwu_to_iwu;
struct dect_ie_iwu_packet *iwu_packet;
};
struct dect_mncc_call_proc_param {
struct dect_ie_repeat_indicator facility;
struct dect_ie_repeat_indicator progress_indicator;
struct dect_ie_display *display;
struct dect_ie_signal *signal;
struct dect_ie_feature_indicate *feature_indicate;
struct dect_ie_transit_delay *transit_delay;
struct dect_ie_window_size *window_size;
struct dect_ie_repeat_indicator iwu_to_iwu;
struct dect_ie_iwu_packet *iwu_packet;
};
struct dect_mncc_alert_param {
struct dect_ie_repeat_indicator facility;
struct dect_ie_repeat_indicator progress_indicator;
struct dect_ie_display *display;
struct dect_ie_signal *signal;
struct dect_ie_feature_indicate *feature_indicate;
struct dect_ie_terminal_capability *terminal_capability;
struct dect_ie_transit_delay *transit_delay;
struct dect_ie_window_size *window_size;
struct dect_ie_repeat_indicator iwu_to_iwu;
struct dect_ie_iwu_packet *iwu_packet;
};
struct dect_mncc_connect_param {
struct dect_ie_repeat_indicator facility;
struct dect_ie_repeat_indicator progress_indicator;
struct dect_ie_display *display;
struct dect_ie_signal *signal;
struct dect_ie_feature_indicate *feature_indicate;
struct dect_ie_terminal_capability *terminal_capability;
struct dect_ie_transit_delay *transit_delay;
struct dect_ie_window_size *window_size;
struct dect_ie_iwu_to_iwu *iwu_to_iwu;
struct dect_ie_iwu_packet *iwu_packet;
};
struct dect_mncc_facility_param {
struct dect_ie_repeat_indicator facility;
struct dect_ie_repeat_indicator progress_indicator;
struct dect_ie_display *display;
struct dect_ie_keypad *keypad;
struct dect_ie_feature_activate *feature_activate;
struct dect_ie_feature_indicate *feature_indicate;
};
struct dect_mncc_info_param {
struct dect_ie_location_area *location_area;
struct dect_ie_nwk_assigned_identity *nwk_assigned_identity;
struct dect_ie_repeat_indicator facility;
struct dect_ie_repeat_indicator progress_indicator;
struct dect_ie_display *display;
struct dect_ie_keypad *keypad;
struct dect_ie_signal *signal;
struct dect_ie_feature_activate *feature_activate;
struct dect_ie_feature_indicate *feature_indicate;
struct dect_ie_network_parameter *network_parameter;
struct dect_ie_called_party_number *called_party_number;
struct dect_ie_called_party_subaddress *called_party_subaddress;
struct dect_ie_calling_party_number *calling_party_number;
struct dect_ie_calling_party_name *calling_party_name;
struct dect_ie_sending_complete *sending_complete;
struct dect_ie_repeat_indicator iwu_to_iwu;
struct dect_ie_iwu_packet *iwu_packet;
};
struct dect_mncc_modify_param {
struct dect_ie_service_change_info *service_change_info;
struct dect_ie_repeat_indicator iwu_attributes;
struct dect_ie_repeat_indicator iwu_to_iwu;
};
struct dect_mncc_hold_param {
struct dect_ie_display *display;
struct dect_ie_release_reason *release_reason;
};
struct dect_mncc_iwu_info_param {
struct dect_ie_alphanumeric *alphanumeric;
struct dect_ie_iwu_to_iwu *iwu_to_iwu;
struct dect_ie_iwu_packet *iwu_packet;
};
struct dect_handle;
struct dect_call;
struct dect_msg_buf;
extern struct dect_call *dect_call_alloc(const struct dect_handle *dh);
extern void *dect_call_priv(struct dect_call *call);
extern const struct dect_ipui *dect_call_portable_identity(const struct dect_call *call);
struct dect_cc_ops {
size_t priv_size;
void (*mncc_setup_ind)(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_setup_param *param);
void (*mncc_setup_ack_ind)(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_setup_ack_param *param);
void (*mncc_reject_ind)(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_release_param *param);
void (*mncc_call_proc_ind)(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_call_proc_param *param);
void (*mncc_alert_ind)(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_alert_param *param);
void (*mncc_connect_ind)(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_connect_param *param);
void (*mncc_connect_cfm)(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_connect_param *param);
void (*mncc_release_ind)(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_release_param *param);
void (*mncc_release_cfm)(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_release_param *param);
void (*mncc_facility_ind)(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_facility_param *param);
void (*mncc_info_ind)(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_info_param *param);
void (*mncc_modify_ind)(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_modify_param *param);
void (*mncc_modify_cfm)(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_modify_param *param);
void (*mncc_hold_ind)(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_hold_param *param);
void (*mncc_hold_cfm)(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_hold_param *param);
void (*mncc_retrieve_ind)(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_hold_param *param);
void (*mncc_retrieve_cfm)(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_hold_param *param);
void (*mncc_iwu_info_ind)(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_iwu_info_param *param);
void (*dl_u_data_ind)(struct dect_handle *dh, struct dect_call *call,
struct dect_msg_buf *mb);
};
extern int dect_mncc_setup_req(struct dect_handle *dh, struct dect_call *call,
const struct dect_ipui *ipui,
const struct dect_mncc_setup_param *param);
extern int dect_mncc_setup_ack_req(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_setup_ack_param *param);
extern int dect_mncc_reject_req(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_release_param *param);
extern int dect_mncc_call_proc_req(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_call_proc_param *param);
extern int dect_mncc_alert_req(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_alert_param *param);
extern int dect_mncc_connect_req(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_connect_param *param);
extern int dect_mncc_connect_res(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_connect_param *param);
extern int dect_mncc_release_req(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_release_param *param);
extern int dect_mncc_release_res(struct dect_handle *dh, struct dect_call *call,
const struct dect_mncc_release_param *param)