i'm returning to the old issue on how to compile core and given list of
modules.
andrei wrote:
> > If what you want is to compile only enum and dialplan:
> > make modules-cfg modules="modules/enum modules/dialplan" modules_s="" modules_k=""
if i try that, nothing happens:
$ make modules-cfg modules="modules/enum modules/dialplan" modules_s="" modules_k=""
config.mak loaded
Makefile.defs defs skipped
rm -f modules.lst
make modules.lst
config.mak loaded
Makefile.defs defs skipped
make[1]: Entering directory `/usr/src/orig/sip-router/trunk'
saving modules list...
make[1]: Leaving directory `/usr/src/orig/sip-router/trunk'
i also tried to edit modules.lst and set
modules= modules/enum modules/dialplan
modules_s=
modules_k=
but no luck.
i don't want to use exclude_modules, because that is a moving target.
-- juha
Hello,
when I try to start SER with the ser-basic.cfg it fails with the
following error message:
0(13147) ERROR: <core> [cfg/cfg.c:135]: ERROR: register_cfg_def(): the
specified size (152) of the config structure does not equal with the
calculated size (148), check whether the variable types are correctly
defined!
Note: I added the size informations to this error message just a minute
ago so that the error message is hopefully more meaningful.
Does anybody know what is wrong here?
I'm using Gentoo Linux with 64bit, maybe that is the reason for this
failure?!
Thanks
Nils
Hello,
what would be the drawback of having sip_msg being all the time in
shared memory? Would pkg vs shm operations have relevant impact?
From personal observations, most of the requests (over 95%) end in TM
module (to absorb retransmission or to forward) where the sip_msg s
moved to shm. It would make things simpler for tm callbacks and related
routes (no need to move back/forward from/to pkg/shm). Parsing will
happen always once, as now cloning to shm in tm discards some parsed
headers, which may be needed in failure route or callbacks.
Cheers,
Daniel
--
Daniel-Constantin Mierla
http://www.asipto.com/
Module: sip-router
Branch: master
Commit: 241112547835aef3f95f0bfeefcbaa6f22ddd3bc
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2411125…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Fri May 22 13:51:34 2009 +0200
makefile: fix new libs compilation on Mac OS X
Some of the new libraries (e.g. srdb*) use symbols from ser and on
Mac OS X / Darwin some special linker options are needed for this
to work.
Reported-by: Nils Ohlmeier <nils(a)iptel.org>
---
Makefile.defs | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/Makefile.defs b/Makefile.defs
index 1bead07..2c2f057 100644
--- a/Makefile.defs
+++ b/Makefile.defs
@@ -1614,7 +1614,9 @@ ifeq ($(OS), darwin)
# the modules uses symbols from ser => either
# -flat_namespace -undefined_suppress or -bundle_loader ../../$(MAIN_NAME)
MOD_LDFLAGS:= -bundle -flat_namespace -undefined suppress
- LIB_LDFLAGS:= -dynamiclib
+ # for libs using symbols from ser (e.g srdb2, kcore a.s.o) we
+ # need -flat_namespace -undefined suppress
+ LIB_LDFLAGS:= -dynamiclib -flat_namespace -undefined suppress
LIB_SUFFIX:=.dylib
# on darwin soname should include the full path
# (it kind of combines rpath & soname)
Module: sip-router
Branch: master
Commit: 97ce716082af99f49ba68bbfc97a8d8c17fbef56
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=97ce716…
Author: Andrei <andrei(a)eagain.office.iptelorg.de>
Committer: Andrei <andrei(a)eagain.office.iptelorg.de>
Date: Fri May 22 12:50:40 2009 +0200
runtime cfg: fix sanity check on 64 bits
The sanity check for registered cfg_group_* structures and
cfg_defs was wrong on 64 bits systems when the structures
contained pointers (the possible structure padding was not taken
into account).
Fix: if the structure contains strings (CFG_VAR_STR or
CFG_VAR_STRING) or pointers (CFG_VAR_POINTER), round-up the
computed size to sizeof(pointer), before performing the sanity
check.
---
cfg/cfg.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/cfg/cfg.c b/cfg/cfg.c
index d6b803b..acc0ea3 100644
--- a/cfg/cfg.c
+++ b/cfg/cfg.c
@@ -47,6 +47,7 @@ int cfg_declare(char *group_name, cfg_def_t *def, void *values, int def_size,
{
int i, num, size, group_name_len;
cfg_mapping_t *mapping = NULL;
+ int types;
/* check the number of the variables */
for (num=0; def[num].name; num++);
@@ -57,13 +58,15 @@ int cfg_declare(char *group_name, cfg_def_t *def, void *values, int def_size,
goto error;
}
memset(mapping, 0, sizeof(cfg_mapping_t)*num);
-
+ types=0;
/* calculate the size of the memory block that has to
be allocated for the cfg variables, and set the content of the
cfg_mapping array the same time */
for (i=0, size=0; i<num; i++) {
mapping[i].def = &(def[i]);
mapping[i].name_len = strlen(def[i].name);
+ /* record all the types for sanity checks */
+ types|=CFG_VAR_MASK(def[i].type);
/* padding depends on the type of the next variable */
switch (CFG_VAR_MASK(def[i].type)) {
@@ -128,6 +131,10 @@ int cfg_declare(char *group_name, cfg_def_t *def, void *values, int def_size,
}
}
+ /* fix the computed size (char*, str or pointer members will force
+ structure padding to multiple of sizeof(pointer)) */
+ if (types & (CFG_VAR_STRING|CFG_VAR_STR|CFG_VAR_POINTER))
+ size=ROUND_POINTER(size);
/* minor validation */
if (size != def_size) {
LOG(L_ERR, "ERROR: register_cfg_def(): the specified size (%i) of the config "
Module: sip-router
Branch: ser_core_cvs
Commit: e5064a814654a71dc2aa28c5fe2bd6fbba76e62c
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e5064a8…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Thu May 21 15:41:16 2009 +0000
sctp: compatibility with older linux kernels
- try hard to workaround compatibility problems between lksctp
userspace (sctp.h) and kernel side: older kernelsi (<2.6.26)
expect a certain size for the sctp_event_subscribe structure
(SCTP_EVENTS sock. opt), leading to problems when using newer
lksctp userspace (>=1.0.9) which adds an additional member to
the structure => if the SCTP_EVENTS setsockopt() fails, try with
different sizes (since we don't care about authentication events
anyway).
- failure to enable SCTP_EVENTS upgraded to critical: ser will not
start.
---
sctp_server.c | 62 +++++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 49 insertions(+), 13 deletions(-)
diff --git a/sctp_server.c b/sctp_server.c
index 424def8..d559ce3 100644
--- a/sctp_server.c
+++ b/sctp_server.c
@@ -193,14 +193,27 @@ error:
WARNING: please keep it sync'ed w/ sctp_check_compiled_sockopts() */
static int sctp_init_sock_opt_common(int s)
{
- struct sctp_event_subscribe es;
int optval;
int pd_point;
int saved_errno;
socklen_t optlen;
int sctp_err;
+#ifdef __OS_linux
+ union {
+ struct sctp_event_subscribe s;
+ char padding[sizeof(struct sctp_event_subscribe)+sizeof(__u8)];
+ } es;
+#else
+ struct sctp_event_subscribe es;
+#endif
+ struct sctp_event_subscribe* ev_s;
sctp_err=0;
+#ifdef __OS_linux
+ ev_s=&es.s;
+#else
+ ev_s=&es;
+#endif
/* set tos */
optval = tos;
if (setsockopt(s, IPPROTO_IP, IP_TOS, (void*)&optval,sizeof(optval)) ==-1){
@@ -349,27 +362,50 @@ static int sctp_init_sock_opt_common(int s)
memset(&es, 0, sizeof(es));
/* SCTP_EVENTS for SCTP_SNDRCV (sctp_data_io_event) -> per message
* information in sctp_sndrcvinfo */
- es.sctp_data_io_event=1;
+ ev_s->sctp_data_io_event=1;
/* enable association event notifications */
- es.sctp_association_event=1; /* SCTP_ASSOC_CHANGE */
- es.sctp_address_event=1; /* enable address events notifications */
- es.sctp_send_failure_event=1; /* SCTP_SEND_FAILED */
- es.sctp_peer_error_event=1; /* SCTP_REMOTE_ERROR */
- es.sctp_shutdown_event=1; /* SCTP_SHUTDOWN_EVENT */
- es.sctp_partial_delivery_event=1; /* SCTP_PARTIAL_DELIVERY_EVENT */
- /* es.sctp_adaptation_layer_event=1; - not supported by lksctp<=1.0.6*/
- /* es.sctp_authentication_event=1; -- not supported on linux 2.6.25 */
+ ev_s->sctp_association_event=1; /* SCTP_ASSOC_CHANGE */
+ ev_s->sctp_address_event=1; /* enable address events notifications */
+ ev_s->sctp_send_failure_event=1; /* SCTP_SEND_FAILED */
+ ev_s->sctp_peer_error_event=1; /* SCTP_REMOTE_ERROR */
+ ev_s->sctp_shutdown_event=1; /* SCTP_SHUTDOWN_EVENT */
+ ev_s->sctp_partial_delivery_event=1; /* SCTP_PARTIAL_DELIVERY_EVENT */
+ /* ev_s->sctp_adaptation_layer_event=1; - not supported by lksctp<=1.0.6*/
+ /* ev_s->sctp_authentication_event=1; -- not supported on linux 2.6.25 */
/* enable the SCTP_EVENTS */
#ifdef SCTP_EVENTS
- if (setsockopt(s, IPPROTO_SCTP, SCTP_EVENTS, &es, sizeof(es))==-1){
+ if (setsockopt(s, IPPROTO_SCTP, SCTP_EVENTS, ev_s, sizeof(*ev_s))==-1){
+ /* on linux the checks for the struct sctp_event_subscribe size
+ are too strict, making certain lksctp/kernel combination
+ unworkable => since we don't use the extra information
+ (sctp_authentication_event) added in newer version, we can
+ try with different sizes) */
+#ifdef __OS_linux
+ /* 1. lksctp 1.0.9 with kernel < 2.6.26 -> kernel expects
+ the structure without the authentication event member */
+ if (setsockopt(s, IPPROTO_SCTP, SCTP_EVENTS, ev_s, sizeof(*ev_s)-1)==0)
+ goto ev_success;
+ /* 2. lksctp < 1.0.9? with kernel >= 2.6.26: the sctp.h structure
+ does not have the authentication member, but the newer kernels
+ check only for optlen > sizeof(...) => we should never reach
+ this point. */
+ /* 3. just to be foolproof if we reached this point, try
+ with a bigger size before giving up (out of desperation) */
+ if (setsockopt(s, IPPROTO_SCTP, SCTP_EVENTS, ev_s, sizeof(es))==0)
+ goto ev_success;
+
+#endif
LOG(L_ERR, "ERROR: sctp_init_sock_opt_common: setsockopt: "
"SCTP_EVENTS: %s\n", strerror(errno));
sctp_err++;
- /* non critical, try to continue */
+ goto error; /* critical */
}
+#ifdef __OS_linux
+ev_success:
+#endif
#else
-#warning no sctp lib support for SCTP_EVENTS, consider upgrading
+#error no sctp lib support for SCTP_EVENTS, consider upgrading
#endif /* SCTP_EVENTS */
if (sctp_err){