Use FTDM_SIZE_FMT where needed, don't treat ftdm_event_t as an int
(even if the e_type enum is the first member), datalen vs. *datalen fix
and other warnings.
All reported by __check_printf() (GCC + __attribute__((format(printf,x,y))) ).
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
... that could cause segmentation faults.
Caught while working on __check_printf() support for ftdm_log().
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
For compilers that seem to do the wrong thing(tm).
Speculative fix for:
segfault at 1 ip b72145d3 sp b58f8bfc error 4 in libc-2.11.3.so
#0 0xb7a5d5d3 in vfprintf () from /lib/i686/cmov/libc.so.6
#1 0xb7a7cec7 in vasprintf () from /lib/i686/cmov/libc.so.6
#2 0xb7dd7c5b in switch_vasprintf (...)
#3 0xb6296de2 in ftdm_logger (...)
#4 0xb621625d in misdn_handle_mph_information_ind (...) at ftmod_misdn.c:658
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Only two mISDN hardware drivers emit MPH_INFORMATION_IND messages and both use a different payload:
- hfcsusb (HFC-based USB dongle) sends a set of ph_info + ph_info_ch structures
which contain the complete state information of the port
(including internal hw-specific state and flags).
- hfcmulti which sends a single integer, a single L1_SIGNAL_* event.
We now try to guess the type of message from the payload length.
The hfcmulti signals are converted to FreeTDM alarm flags; the hfcsusb
state/flags are defined in kernel internal hw-specific headers and are ignored ATM (todo).
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Add MISDN_MSG_DATA() helper macro for easy access to mISDN message
payload.
Add forward declaration of misdn_handle_mph_information_ind() and use
it in misdn_activate_channel().
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Add missing mISDN event/message types (e.g. MPH_INFORMATION_IND)
and use a helper macro (MISDN_EVENT_TYPE) to define the entries,
like we already do for misdn_control_types[].
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
FS-3815 --resolve
This is a workaround for the fact that libedit counts terminal control
characters when calculating the length of the prompt. By not using
absolute positioning, we avoid the issue.
Thanks to Ivan Isaev for the workaround and testing.