Browse code

core, lib, modules: restructured source code tree

- new folder src/ to hold the source code for main project applications
- main.c is in src/
- all core files are subfolder are in src/core/
- modules are in src/modules/
- libs are in src/lib/
- application Makefiles are in src/
- application binary is built in src/ (src/kamailio)

Daniel-Constantin Mierla authored on 07/12/2016 11:03:51
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,117 +0,0 @@
1
-/*
2
- * Copyright (C) 2007 iptelorg GmbH
3
- *
4
- * This file is part of Kamailio, a free SIP server.
5
- *
6
- * Kamailio is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version
10
- *
11
- * Kamailio is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program; if not, write to the Free Software
18
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19
- *
20
- *
21
- */
22
-
23
-/** Kamailio core :: runtime configuration variables
24
- * @file cfg_core.h
25
- * @ingroup core
26
- *
27
- * Module: @ref core
28
- *
29
- * HOWTO:
30
- *	If you need a new configuration variable within the core, put it into
31
- *	struct cfg_goup_core, and define it in cfg_core.c:core_cfg_def array.
32
- *	The default value of the variable must be inserted into
33
- *	cfg_core.c:default_core_cfg
34
- *	Include this header file in your source code, and retrieve the
35
- *	value with cfg_get(core, core_cfg, variable_name).
36
- */
37
-
38
-
39
-#ifndef _CFG_CORE_H
40
-#define _CFG_CORE_H
41
-
42
-#include "cfg/cfg.h"
43
-
44
-extern void	*core_cfg;
45
-
46
-/*! \brief configuration default values */
47
-struct cfg_group_core {
48
-	int	debug;
49
-	int	log_facility;
50
-	int memdbg; /*!< log level for memory debugging messages */
51
-#ifdef USE_DST_BLACKLIST
52
-	/* blacklist */
53
-	int	use_dst_blacklist; /*!< 1 if blacklist is enabled */
54
-	unsigned int	blst_timeout; /*!< blacklist entry ttl */
55
-	unsigned int	blst_max_mem; /*!< maximum memory used for the
56
-					blacklist entries */
57
-	unsigned int	blst_udp_imask;  /* ignore mask for udp */
58
-	unsigned int	blst_tcp_imask;  /* ignore mask for tcp */
59
-	unsigned int	blst_tls_imask;  /* ignore mask for tls */
60
-	unsigned int	blst_sctp_imask; /* ignore mask for sctp */
61
-#endif
62
-	/* resolver */
63
-	int dns_try_ipv6;
64
-	int dns_try_naptr;
65
-	int dns_udp_pref;
66
-	int dns_tcp_pref;
67
-	int dns_tls_pref;
68
-	int dns_sctp_pref;
69
-	int dns_retr_time;
70
-	int dns_retr_no;
71
-	int dns_servers_no;
72
-	int dns_search_list;
73
-	int dns_search_fmatch;
74
-	int dns_reinit;
75
-	int dns_naptr_ignore_rfc;
76
-	/* DNS cache */
77
-#ifdef USE_DNS_CACHE
78
-	int use_dns_cache;
79
-	int dns_cache_flags;
80
-	int use_dns_failover;
81
-	int dns_srv_lb;
82
-	unsigned int dns_neg_cache_ttl;
83
-	unsigned int dns_cache_min_ttl;
84
-	unsigned int dns_cache_max_ttl;
85
-	unsigned int dns_cache_max_mem;
86
-	int dns_cache_del_nonexp;
87
-	int dns_cache_rec_pref;
88
-#endif
89
-#ifdef PKG_MALLOC
90
-	int mem_dump_pkg;
91
-#endif
92
-#ifdef SHM_MEM
93
-	int mem_dump_shm;
94
-#endif
95
-	int max_while_loops;
96
-	int udp_mtu; /*!< maximum send size for udp, if > try another protocol*/
97
-	int udp_mtu_try_proto; /*!< if packet> udp_mtu, try proto (e.g. TCP) */
98
-	int udp4_raw; /* use raw sockets for sending on udp ipv 4 */
99
-	int udp4_raw_mtu; /* mtu used when using udp raw socket */
100
-	int udp4_raw_ttl; /* ttl used when using udp raw sockets */
101
-	int force_rport; /*!< if set rport will always be forced*/
102
-	int memlog; /*!< log level for memory status/summary info */
103
-	int mem_summary; /*!< display memory status/summary info on exit */
104
-	int mem_safety; /*!< memory safety control option */
105
-	int mem_join; /*!< memory free fragments join option */
106
-	int mem_status_mode; /*!< memory status printed for free/all fragments */
107
-	int corelog; /*!< log level for non-critcal core error messages */
108
-	int latency_cfg_log; /*!< log level for printing latency of routing blocks */
109
-	int latency_log; /*!< log level for latency limits messages */
110
-	int latency_limit_db; /*!< alert limit of running db commands */
111
-	int latency_limit_action; /*!< alert limit of running cfg actions */
112
-};
113
-
114
-extern struct cfg_group_core default_core_cfg;
115
-extern cfg_def_t core_cfg_def[];
116
-
117
-#endif /* _CFG_CORE_H */
Browse code

core: added mem_status_mode parameter

- if set to 1, qm allocator dumps used fragments in memory status

Daniel-Constantin Mierla authored on 11/07/2016 14:03:07
Showing 1 changed files
... ...
@@ -103,7 +103,7 @@ struct cfg_group_core {
103 103
 	int mem_summary; /*!< display memory status/summary info on exit */
104 104
 	int mem_safety; /*!< memory safety control option */
105 105
 	int mem_join; /*!< memory free fragments join option */
106
-	int mem_status_all; /*!< memory status printed for free/all fragments */
106
+	int mem_status_mode; /*!< memory status printed for free/all fragments */
107 107
 	int corelog; /*!< log level for non-critcal core error messages */
108 108
 	int latency_cfg_log; /*!< log level for printing latency of routing blocks */
109 109
 	int latency_log; /*!< log level for latency limits messages */
Browse code

core: mem_status_all - added to cfg core structure

- allow selecting of dumping memory status also for used fragments

Daniel-Constantin Mierla authored on 11/07/2016 11:45:41
Showing 1 changed files
... ...
@@ -103,6 +103,7 @@ struct cfg_group_core {
103 103
 	int mem_summary; /*!< display memory status/summary info on exit */
104 104
 	int mem_safety; /*!< memory safety control option */
105 105
 	int mem_join; /*!< memory free fragments join option */
106
+	int mem_status_all; /*!< memory status printed for free/all fragments */
106 107
 	int corelog; /*!< log level for non-critcal core error messages */
107 108
 	int latency_cfg_log; /*!< log level for printing latency of routing blocks */
108 109
 	int latency_log; /*!< log level for latency limits messages */
Browse code

core: new core parameter latency_cfg_log

- if set to a log level less or equal than debug parameter, a log
message with the duration of executing request route or reply route is
printed to syslog
- default value is L_DBG

Daniel-Constantin Mierla authored on 25/04/2016 14:57:19
Showing 1 changed files
... ...
@@ -104,6 +104,7 @@ struct cfg_group_core {
104 104
 	int mem_safety; /*!< memory safety control option */
105 105
 	int mem_join; /*!< memory free fragments join option */
106 106
 	int corelog; /*!< log level for non-critcal core error messages */
107
+	int latency_cfg_log; /*!< log level for printing latency of routing blocks */
107 108
 	int latency_log; /*!< log level for latency limits messages */
108 109
 	int latency_limit_db; /*!< alert limit of running db commands */
109 110
 	int latency_limit_action; /*!< alert limit of running cfg actions */
Browse code

core : Update include files - delete IDs, update doxygen, delete history

Olle E. Johansson authored on 03/01/2015 10:55:48
Showing 1 changed files
... ...
@@ -1,21 +1,14 @@
1 1
 /*
2
- * $Id$
3
- *
4 2
  * Copyright (C) 2007 iptelorg GmbH
5 3
  *
6
- * This file is part of ser, a free SIP server.
4
+ * This file is part of Kamailio, a free SIP server.
7 5
  *
8
- * ser is free software; you can redistribute it and/or modify
6
+ * Kamailio is free software; you can redistribute it and/or modify
9 7
  * it under the terms of the GNU General Public License as published by
10 8
  * the Free Software Foundation; either version 2 of the License, or
11 9
  * (at your option) any later version
12 10
  *
13
- * For a license to use the ser software under conditions
14
- * other than those described here, or to purchase support for this
15
- * software, please contact iptel.org by e-mail at the following addresses:
16
- *    info@iptel.org
17
- *
18
- * ser is distributed in the hope that it will be useful,
11
+ * Kamailio is distributed in the hope that it will be useful,
19 12
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 13
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 14
  * GNU General Public License for more details.
... ...
@@ -24,6 +17,15 @@
24 17
  * along with this program; if not, write to the Free Software
25 18
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
26 19
  *
20
+ *
21
+ */
22
+
23
+/** Kamailio core :: runtime configuration variables
24
+ * @file cfg_core.h
25
+ * @ingroup core
26
+ *
27
+ * Module: @ref core
28
+ *
27 29
  * HOWTO:
28 30
  *	If you need a new configuration variable within the core, put it into
29 31
  *	struct cfg_goup_core, and define it in cfg_core.c:core_cfg_def array.
... ...
@@ -31,16 +33,6 @@
31 33
  *	cfg_core.c:default_core_cfg
32 34
  *	Include this header file in your source code, and retrieve the
33 35
  *	value with cfg_get(core, core_cfg, variable_name).
34
- *
35
- * History
36
- * -------
37
- *  2007-12-03	Initial version (Miklos)
38
- */
39
-/** core runtime config.
40
- * @file cfg_core.h
41
- * @ingroup core
42
- *
43
- * Module: @ref core
44 36
  */
45 37
 
46 38
 
Browse code

all: updated FSF address in GPL text

Anthony Messina authored on 04/07/2014 09:36:37 • Daniel-Constantin Mierla committed on 04/07/2014 09:37:36
Showing 1 changed files
... ...
@@ -22,7 +22,7 @@
22 22
  *
23 23
  * You should have received a copy of the GNU General Public License
24 24
  * along with this program; if not, write to the Free Software
25
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
25
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
26 26
  *
27 27
  * HOWTO:
28 28
  *	If you need a new configuration variable within the core, put it into
Browse code

core: respect order field in NAPTR, as required by RFC 2915

- the beaviour is controlled by core parameter dns_naptr_ignore_rfc
- default is 1, preserving current behaviouf to ignore rfc requirements
(for backward compatibility)

√ėyvind Kolbu authored on 12/11/2013 14:47:30 • Daniel-Constantin Mierla committed on 12/11/2013 14:49:37
Showing 1 changed files
... ...
@@ -80,6 +80,7 @@ struct cfg_group_core {
80 80
 	int dns_search_list;
81 81
 	int dns_search_fmatch;
82 82
 	int dns_reinit;
83
+	int dns_naptr_ignore_rfc;
83 84
 	/* DNS cache */
84 85
 #ifdef USE_DNS_CACHE
85 86
 	int use_dns_cache;
Browse code

core: mem - join free packets option can be set from config

- better control over existing code for joining free memory fragments
- existing QM_JOIN_FREE renamed to MEM_JOIN_FREE - to be used in other
memory managers than q_malloc
- new cfg parameter mem_join - if set to 1, q_malloc does join of free
memory fragments. default is 0. in use if MEM_JOIN_FREE is defined

Daniel-Constantin Mierla authored on 29/03/2012 11:57:22
Showing 1 changed files
... ...
@@ -109,6 +109,7 @@ struct cfg_group_core {
109 109
 	int memlog; /*!< log level for memory status/summary info */
110 110
 	int mem_summary; /*!< display memory status/summary info on exit */
111 111
 	int mem_safety; /*!< memory safety control option */
112
+	int mem_join; /*!< memory free fragments join option */
112 113
 	int corelog; /*!< log level for non-critcal core error messages */
113 114
 	int latency_log; /*!< log level for latency limits messages */
114 115
 	int latency_limit_db; /*!< alert limit of running db commands */
Browse code

core: new param mem_safety

- if set to 1, memory free operation does not call abort() for double
freeing a pointer or freeing an invalid address
- default is 0, can be set via config framework

Daniel-Constantin Mierla authored on 29/03/2012 10:55:04
Showing 1 changed files
... ...
@@ -108,6 +108,7 @@ struct cfg_group_core {
108 108
 	int force_rport; /*!< if set rport will always be forced*/
109 109
 	int memlog; /*!< log level for memory status/summary info */
110 110
 	int mem_summary; /*!< display memory status/summary info on exit */
111
+	int mem_safety; /*!< memory safety control option */
111 112
 	int corelog; /*!< log level for non-critcal core error messages */
112 113
 	int latency_log; /*!< log level for latency limits messages */
113 114
 	int latency_limit_db; /*!< alert limit of running db commands */
Browse code

core: new parameters to control and alert on time consuming ops

- latency_log - log level to print the messages related to latency
- latency_limit_db - limit of latency in ms for db operations. If a db
operation executed via DB API v1 takes longer that its value, a
message is printed in the logs, showing the first 50 characters of the
db query
- latency_limit_action - limit of latency in ms for config actions. If a
config action executed by cfg interpreter takes longer than its value,
a message is printed in the logs, showing config path, line and action
name when it is a module function, as well as intenal action id

Daniel-Constantin Mierla authored on 25/03/2012 11:39:20
Showing 1 changed files
... ...
@@ -109,6 +109,9 @@ struct cfg_group_core {
109 109
 	int memlog; /*!< log level for memory status/summary info */
110 110
 	int mem_summary; /*!< display memory status/summary info on exit */
111 111
 	int corelog; /*!< log level for non-critcal core error messages */
112
+	int latency_log; /*!< log level for latency limits messages */
113
+	int latency_limit_db; /*!< alert limit of running db commands */
114
+	int latency_limit_action; /*!< alert limit of running cfg actions */
112 115
 };
113 116
 
114 117
 extern struct cfg_group_core default_core_cfg;
Browse code

core: new global parameter corelog

- control the log level for non-critical core error messages
- e.g., useful to disable messages such as:
- tcp connection reset by peer
- error parsing received message for garbage (non-sip/html/...)

Daniel-Constantin Mierla authored on 07/03/2011 12:42:38
Showing 1 changed files
... ...
@@ -108,6 +108,7 @@ struct cfg_group_core {
108 108
 	int force_rport; /*!< if set rport will always be forced*/
109 109
 	int memlog; /*!< log level for memory status/summary info */
110 110
 	int mem_summary; /*!< display memory status/summary info on exit */
111
+	int corelog; /*!< log level for non-critcal core error messages */
111 112
 };
112 113
 
113 114
 extern struct cfg_group_core default_core_cfg;
Browse code

Merge remote branch 'origin/andrei/raw_sock'

Raw socket support for sending UDP IPv4 packets
(major performance increase on multi-cpu machines running linux:
40-50% faster at least in stateless mode).

* origin/andrei/raw_sock:
NEWS: notes about the new udp4_raw mode
raw sockets: added info rpc
core: compile raw socket support by default on freebsd
raw sockets: freebsd support
cfg: delay cfg_shmize to just before forking
core: always compile the raw sockets code on linux
raw sockets: ttl can be set from the config file
raw sockets: ttl can be set or auto-detected
core: include raw socket support in version info
raw sockets: use BSD ip & udp structure versions
raw sockets: config file support
raw sockets: udp send will use now raw sockets if enabled
raw sockets: runtime config support
raw sockets: build ip header & fragmentation support
raw socket: compilation fixes
raw sockets: get dst. ip from the ip header
core: basic support for receiving udp sip packets on raw sockets
core: basic raw socket support functions

Andrei Pelinescu-Onciul authored on 11/08/2010 20:49:04
Showing 0 changed files
Browse code

raw sockets: ttl can be set or auto-detected

The IP TTL used when sending on raw sockets can be set using the
core.udp4_raw_ttl config variable.
By default it is auto-detected on startup (the same IP TTL as the
one for the first udp4 socket is used).

Andrei Pelinescu-Onciul authored on 10/08/2010 09:09:19
Showing 1 changed files
... ...
@@ -103,6 +103,7 @@ struct cfg_group_core {
103 103
 	int udp_mtu_try_proto; /*!< if packet> udp_mtu, try proto (e.g. TCP) */
104 104
 	int udp4_raw; /* use raw sockets for sending on udp ipv 4 */
105 105
 	int udp4_raw_mtu; /* mtu used when using udp raw socket */
106
+	int udp4_raw_ttl; /* ttl used when using udp raw sockets */
106 107
 	int force_rport; /*!< if set rport will always be forced*/
107 108
 	int memlog; /*!< log level for memory status/summary info */
108 109
 	int mem_summary; /*!< display memory status/summary info on exit */
Browse code

dns cache: dns_cache_rec_pref config var added

The config variable, dns_cache_rec_pref, can be used
to set the DNS cache preference as follows:

0 - do not check duplicates (default)
1 - prefer old records
2 - prefer new records
3 - prefer records with longer lifetime

This variable is checked when a duplicated record is
tried to be inserted into the cache. For instance the
SRV query answer contains also an A record which is
already in the cache.
If the config var is not 0, then permanent entries
are always preferred.

Note: works only with #define CACHE_RELEVANT_RECS_ONLY
at the moment.

Miklos Tirpak authored on 23/06/2010 14:34:56
Showing 1 changed files
... ...
@@ -92,6 +92,7 @@ struct cfg_group_core {
92 92
 	unsigned int dns_cache_max_ttl;
93 93
 	unsigned int dns_cache_max_mem;
94 94
 	int dns_cache_del_nonexp;
95
+	int dns_cache_rec_pref;
95 96
 #endif
96 97
 #ifdef PKG_MALLOC
97 98
 	int mem_dump_pkg;
Browse code

raw sockets: runtime config support

Usage of raw sockets for send and the used mtu can now be set
at runtime via the 2 new added core config variables:
udp4_raw and udp4_raw_mtu.
udp4_raw can have 3 values: disabled (0), on (1) and auto (-1). If
set to auto raw sockets will be used if possible.

E.g.:
sercmd cfg.set_now_int core udp4_raw_mtu 576

Andrei Pelinescu-Onciul authored on 15/06/2010 14:31:16
Showing 1 changed files
... ...
@@ -36,12 +36,11 @@
36 36
  * -------
37 37
  *  2007-12-03	Initial version (Miklos)
38 38
  */
39
-/*!
40
- * \file
41
- * \brief SIP-router core :: Core configuration
42
- * \ingroup core
39
+/** core runtime config.
40
+ * @file cfg_core.h
41
+ * @ingroup core
43 42
  *
44
- * Module: \ref core
43
+ * Module: @ref core
45 44
  */
46 45
 
47 46
 
... ...
@@ -102,6 +101,8 @@ struct cfg_group_core {
102 101
 	int max_while_loops;
103 102
 	int udp_mtu; /*!< maximum send size for udp, if > try another protocol*/
104 103
 	int udp_mtu_try_proto; /*!< if packet> udp_mtu, try proto (e.g. TCP) */
104
+	int udp4_raw; /* use raw sockets for sending on udp ipv 4 */
105
+	int udp4_raw_mtu; /* mtu used when using udp raw socket */
105 106
 	int force_rport; /*!< if set rport will always be forced*/
106 107
 	int memlog; /*!< log level for memory status/summary info */
107 108
 	int mem_summary; /*!< display memory status/summary info on exit */
Browse code

Merge remote branch 'origin/andrei/blst_send_flags'

Support for blacklist ignore flags, both global and on a per
message basis.
E.g.:
per message:
if (method=~"MESSAGE")
blst_set_ignore(6);

global:
sercmd cfg.set_now_int core dst_blacklist_tcp_imask 16

* origin/andrei/blst_send_flags:
NEWS: minor blacklist flag number correction
tm: blacklist on 503 reply fixed for send flags
NEWS: mentioned blacklist ignore masks
core: cfg script support for blacklist ignore masks
blst: global config variables for ignoring blacklist events
blst: docs for blst_{set,clear}_ignore script functions
blst: functions for ignoring blacklist events
blst: use dst_blacklist_force_add
tm: simplified blacklist add code
blacklist: ignore mask support
tm: updated to the new snd_flags_t structure
core: send_flags preliminary blacklist support

Conflicts:
NEWS
cfg.lex
cfg.y
dst_blacklist.h

Andrei Pelinescu-Onciul authored on 19/02/2010 15:37:51
Showing 0 changed files
Browse code

blst: global config variables for ignoring blacklist events

Blacklist events can now be ignored on a per protocol basis, by
setting the corresponding new config variable:
dst_blacklist_udp_imask
dst_blacklist_tcp_imask
dst_blacklist_tls_imask
dst_blacklist_sctp_imask

E.g.: sercmd cfg.set_now_int core dst_blacklist_tcp_imask 6
(ignore send and connect errors on tcp when deciding whether or
not to blacklist)

Andrei Pelinescu-Onciul authored on 15/02/2010 20:37:28
Showing 1 changed files
... ...
@@ -54,6 +54,10 @@ struct cfg_group_core {
54 54
 	unsigned int	blst_timeout; /* blacklist entry ttl */
55 55
 	unsigned int	blst_max_mem; /* maximum memory used for the
56 56
 					blacklist entries */
57
+	unsigned int	blst_udp_imask;  /* ignore mask for udp */
58
+	unsigned int	blst_tcp_imask;  /* ignore mask for tcp */
59
+	unsigned int	blst_tls_imask;  /* ignore mask for tls */
60
+	unsigned int	blst_sctp_imask; /* ignore mask for sctp */
57 61
 #endif
58 62
 	/* resolver */
59 63
 	int dns_try_ipv6;
Browse code

- Doxygen updates on core files - Add project name to doxygen in Makefile

oej authored on 19/10/2009 20:35:43
Showing 1 changed files
... ...
@@ -36,6 +36,14 @@
36 36
  * -------
37 37
  *  2007-12-03	Initial version (Miklos)
38 38
  */
39
+/*!
40
+ * \file
41
+ * \brief SIP-router core :: Core configuration
42
+ * \ingroup core
43
+ *
44
+ * Module: \ref core
45
+ */
46
+
39 47
 
40 48
 #ifndef _CFG_CORE_H
41 49
 #define _CFG_CORE_H
... ...
@@ -44,15 +52,16 @@
44 52
 
45 53
 extern void	*core_cfg;
46 54
 
55
+/*! \brief configuration default values */
47 56
 struct cfg_group_core {
48 57
 	int	debug;
49 58
 	int	log_facility;
50
-	int memdbg; /** < log level for memory debugging messages */
59
+	int memdbg; /*!< log level for memory debugging messages */
51 60
 #ifdef USE_DST_BLACKLIST
52 61
 	/* blacklist */
53
-	int	use_dst_blacklist; /* 1 if blacklist is enabled */
54
-	unsigned int	blst_timeout; /* blacklist entry ttl */
55
-	unsigned int	blst_max_mem; /* maximum memory used for the
62
+	int	use_dst_blacklist; /*!< 1 if blacklist is enabled */
63
+	unsigned int	blst_timeout; /*!< blacklist entry ttl */
64
+	unsigned int	blst_max_mem; /*!< maximum memory used for the
56 65
 					blacklist entries */
57 66
 #endif
58 67
 	/* resolver */
... ...
@@ -87,11 +96,11 @@ struct cfg_group_core {
87 96
 	int mem_dump_shm;
88 97
 #endif
89 98
 	int max_while_loops;
90
-	int udp_mtu; /**< maximum send size for udp, if > try another protocol*/
91
-	int udp_mtu_try_proto; /**< if packet> udp_mtu, try proto (e.g. TCP) */
92
-	int force_rport; /**< if set rport will always be forced*/
93
-	int memlog; /** < log level for memory status/summary info */
94
-	int mem_summary; /**< display memory status/summary info on exit */
99
+	int udp_mtu; /*!< maximum send size for udp, if > try another protocol*/
100
+	int udp_mtu_try_proto; /*!< if packet> udp_mtu, try proto (e.g. TCP) */
101
+	int force_rport; /*!< if set rport will always be forced*/
102
+	int memlog; /*!< log level for memory status/summary info */
103
+	int mem_summary; /*!< display memory status/summary info on exit */
95 104
 };
96 105
 
97 106
 extern struct cfg_group_core default_core_cfg;
Browse code

core: mem dbg options updates + cleanups

- memlog and memdbg can now be changed at runtime
- double define warning fix for fm_malloc (when compiled with -DF_MALLOC)
- nicer qm_status() & qm_sums() output
- BSD licence for mem/*

Andrei Pelinescu-Onciul authored on 29/09/2009 13:25:50
Showing 1 changed files
... ...
@@ -47,6 +47,7 @@ extern void	*core_cfg;
47 47
 struct cfg_group_core {
48 48
 	int	debug;
49 49
 	int	log_facility;
50
+	int memdbg; /** < log level for memory debugging messages */
50 51
 #ifdef USE_DST_BLACKLIST
51 52
 	/* blacklist */
52 53
 	int	use_dst_blacklist; /* 1 if blacklist is enabled */
... ...
@@ -89,6 +90,7 @@ struct cfg_group_core {
89 90
 	int udp_mtu; /**< maximum send size for udp, if > try another protocol*/
90 91
 	int udp_mtu_try_proto; /**< if packet> udp_mtu, try proto (e.g. TCP) */
91 92
 	int force_rport; /**< if set rport will always be forced*/
93
+	int memlog; /** < log level for memory status/summary info */
92 94
 	int mem_summary; /**< display memory status/summary info on exit */
93 95
 };
94 96
 
Browse code

core: added mem_summary config option

- added mem_summary which controls the memory debugging info
logged on exit or on SIGUSR1. Its value is a combination of
flags: 0 - off, 1 - dump all used memory blocks and some
statistics (lots of output), 2 - dump a summary of the used
memory blocks (works only if compiled with DBG_QM_MALLOC or
DBG_F_MALLOC).
The default value is 1 (same behaviour as older versions).

- fix: don't call the memory status/summary functions if
memlog > debug level (since nothing will be logged anyway).

Andrei Pelinescu-Onciul authored on 29/09/2009 11:32:48
Showing 1 changed files
... ...
@@ -89,6 +89,7 @@ struct cfg_group_core {
89 89
 	int udp_mtu; /**< maximum send size for udp, if > try another protocol*/
90 90
 	int udp_mtu_try_proto; /**< if packet> udp_mtu, try proto (e.g. TCP) */
91 91
 	int force_rport; /**< if set rport will always be forced*/
92
+	int mem_summary; /**< display memory status/summary info on exit */
92 93
 };
93 94
 
94 95
 extern struct cfg_group_core default_core_cfg;
Browse code

Merge branch 'ser_core_cvs'

* ser_core_cvs:
tcp: fix compilation problem on solaris (FIONREAD)
core: fix bad level name in new LOG()
t_check_status() checks also the blind UACs if t_pick_branch()
Documenting t_lookup_cancel() script function.
Removing set_t() from t_lookup_cancel() function, and introducing
updated udp_mtu handling code - fixes SER-433
documenting t_is_expired() function
t_is_expired() script function is introduced.
* logging API updated (see doc/logging-api.txt for details)
- AS support disabled by default.
When building the route set of ACKs for local UACs, only the reply is now
In case the AVP is a regexp, an allocation is required to build an AVP
Currently, SER matches E2E ACKs only if there is an equality between From HF
The calculate_routeset_length() produces an invalid result in the case
'memapp' and 'append_mem_block' are now both only used in source
"Route :" prefix (and separator) is used some more time across the
script: udp_mtu fallback script config & commands
core: forward: tcp fallback for big udp packets

Conflicts:
action.c
cfg.y
cfg_core.c
cfg_core.h
dprint.h - updated to the new logging api from ser, while
keeping the kamailio compatibility macros and
CRIT().
usr_avp.h

Andrei Pelinescu-Onciul authored on 20/02/2009 16:22:16
Showing 0 changed files
Browse code

script engine: while() support

- support the same while() loops as kamailio (the only difference
being that max_while_loops can be changed at runtime):
while(<int expr>) { .... } with break exiting the while.

Andrei Pelinescu-Onciul authored on 10/02/2009 21:21:12
Showing 1 changed files
... ...
@@ -85,6 +85,7 @@ struct cfg_group_core {
85 85
 #ifdef SHM_MEM
86 86
 	int mem_dump_shm;
87 87
 #endif
88
+	int max_while_loops;
88 89
 };
89 90
 
90 91
 extern struct cfg_group_core default_core_cfg;
Browse code

core: forward: tcp fallback for big udp packets

- support for tcp, tls or sctp fallback for udp forwarded requests
that end up bigger then udp_mtu (configurable, disabled by
default). For such messages only the Via is changed (for example
the original built for udp Record-Route is kept untouched so
that subsequent messages in the dialog will use udp if smaller
then udp_mtu).
- udp_mtu and udp_mtu_try_proto (fallback proto) can be changed at
runtime via the cfg framework
(e.g. sercmd cfg.set_now_int core udp_mtu 1300;
cfg.set_now_int core udp_mtu_try_proto 2 )
- force_rport can now be set globally using the config framework
(e.g. sercmd cfg.set_now_int core force_rport 1 )


Author: Andrei Pelinescu-Onciul <andrei@iptel.org>

Andrei Pelinescu-Onciul authored on 18/12/2008 16:06:03
Showing 1 changed files
... ...
@@ -85,6 +85,9 @@ struct cfg_group_core {
85 85
 #ifdef SHM_MEM
86 86
 	int mem_dump_shm;
87 87
 #endif
88
+	int udp_mtu; /**< maximum send size for udp, if > try another protocol*/
89
+	int udp_mtu_try_proto; /**< if packet> udp_mtu, try proto (e.g. TCP) */
90
+	int force_rport; /**< if set rport will always be forced*/
88 91
 };
89 92
 
90 93
 extern struct cfg_group_core default_core_cfg;
Browse code

- sctp preference support in naptr queries (added a new ser.cfg option: dns_sctp_pref, see doc/dns.txt for more details)

Andrei Pelinescu-Onciul authored on 12/08/2008 09:51:32
Showing 1 changed files
... ...
@@ -60,6 +60,7 @@ struct cfg_group_core {
60 60
 	int dns_udp_pref;
61 61
 	int dns_tcp_pref;
62 62
 	int dns_tls_pref;
63
+	int dns_sctp_pref;
63 64
 	int dns_retr_time;
64 65
 	int dns_retr_no;
65 66
 	int dns_servers_no;
Browse code

Two configuration variables are introduced that can help troubleshooting memory leaks: mem_dump_pkg, and mem_dump_shm Useage:

sercmd cfg.set_now_int mem_dump_pkg <pid_number>
Dumps the pkg memory status of the given processs

sercmd cfg.set_now_int mem_dump_shm 1
Dumps the shm memory status

Miklos Tirpak authored on 04/04/2008 08:40:53
Showing 1 changed files
... ...
@@ -78,6 +78,12 @@ struct cfg_group_core {
78 78
 	unsigned int dns_cache_max_mem;
79 79
 	int dns_cache_del_nonexp;
80 80
 #endif
81
+#ifdef PKG_MALLOC
82
+	int mem_dump_pkg;
83
+#endif
84
+#ifdef SHM_MEM
85
+	int mem_dump_shm;
86
+#endif
81 87
 };
82 88
 
83 89
 extern struct cfg_group_core default_core_cfg;
Browse code

log_facility config parameter is declared in the cfg framework

Miklos Tirpak authored on 29/02/2008 10:04:49
Showing 1 changed files
... ...
@@ -46,6 +46,7 @@ extern void	*core_cfg;
46 46
 
47 47
 struct cfg_group_core {
48 48
 	int	debug;
49
+	int	log_facility;
49 50
 #ifdef USE_DST_BLACKLIST
50 51
 	/* blacklist */
51 52
 	int	use_dst_blacklist; /* 1 if blacklist is enabled */
Browse code

- use_dns_cache can be enabled/disabled runtime - dns_cache_init is introduced: if set to 0, the dns cache is not initialized, and cannot be enabled later (default is 1) - dst_blacklist_init is introduced: if set to 0, the dst blacklist is not initialized (similar to dns_cache_init) (default is 1)

Miklos Tirpak authored on 11/02/2008 17:11:59
Showing 1 changed files
... ...
@@ -67,6 +67,7 @@ struct cfg_group_core {
67 67
 	int dns_reinit;
68 68
 	/* DNS cache */
69 69
 #ifdef USE_DNS_CACHE
70
+	int use_dns_cache;
70 71
 	int dns_cache_flags;
71 72
 	int use_dns_failover;
72 73
 	int dns_srv_lb;
Browse code

DNS resolver and cache parameters use the configuration framework that makes the config variables changeable on-the-fly.

- The resolver is reinitialized by each child process separately
when dns_retr_time, dns_retr_no, dns_servers_no, or dns_use_search_list
is changed.

- dns_reinit is introduced: the resolver is reinitialized when the
variable is set to 1, and the variable is reseted to 0 again.
It can be set via RPC for example, when /etc/resolv.conf changes,
but none of the SER config parameters are affected.

- A callback function is called by each child process after the resolver
has been reinitialized, if DNS_WATCHDOG_SUPPORT is enabled.

- socket_types is changed to be a global variable, and set by
fix_all_socket_lists(), because we have to remember for
the socket types, and do not allow dns_try_ipv6 to be enabled if there
is no ipv6 interface.

- minor bug is corrected: the expiration check is removed from
dns_cache_clean() function, when non-expired entries are deleted.

Miklos Tirpak authored on 11/02/2008 09:58:29
Showing 1 changed files
... ...
@@ -47,10 +47,34 @@ extern void	*core_cfg;
47 47
 struct cfg_group_core {
48 48
 	int	debug;
49 49
 #ifdef USE_DST_BLACKLIST
50
+	/* blacklist */
50 51
 	int	use_dst_blacklist; /* 1 if blacklist is enabled */
51 52
 	unsigned int	blst_timeout; /* blacklist entry ttl */
52 53
 	unsigned int	blst_max_mem; /* maximum memory used for the
53 54
 					blacklist entries */
55
+#endif
56
+	/* resolver */
57
+	int dns_try_ipv6;
58
+	int dns_try_naptr;
59
+	int dns_udp_pref;
60
+	int dns_tcp_pref;
61
+	int dns_tls_pref;
62
+	int dns_retr_time;
63
+	int dns_retr_no;
64
+	int dns_servers_no;
65
+	int dns_search_list;
66
+	int dns_search_fmatch;
67
+	int dns_reinit;
68
+	/* DNS cache */
69
+#ifdef USE_DNS_CACHE
70
+	int dns_cache_flags;
71
+	int use_dns_failover;
72
+	int dns_srv_lb;
73
+	unsigned int dns_neg_cache_ttl;
74
+	unsigned int dns_cache_min_ttl;
75
+	unsigned int dns_cache_max_ttl;
76
+	unsigned int dns_cache_max_mem;
77
+	int dns_cache_del_nonexp;
54 78
 #endif
55 79
 };
56 80
 
Browse code

Destination blacklist parameters have been updated to the config framework, the following variables are changeable runtime:

- use_dst_blacklist
- dst_blacklist_expire
- dst_blacklist_mem

Miklos Tirpak authored on 13/12/2007 15:29:55
Showing 1 changed files
... ...
@@ -46,6 +46,12 @@ extern void	*core_cfg;
46 46
 
47 47
 struct cfg_group_core {
48 48
 	int	debug;
49
+#ifdef USE_DST_BLACKLIST
50
+	int	use_dst_blacklist; /* 1 if blacklist is enabled */
51
+	unsigned int	blst_timeout; /* blacklist entry ttl */
52
+	unsigned int	blst_max_mem; /* maximum memory used for the
53
+					blacklist entries */
54
+#endif
49 55
 };
50 56
 
51 57
 extern struct cfg_group_core default_core_cfg;
Browse code

- cfg_core.c and cfg_core.h are added to the repository as a placeholder of the core configuration.

- debug level is switched to the new config variable type. From now,
it is changeble runtime.

Miklos Tirpak authored on 05/12/2007 16:21:36
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,54 @@
1
+/*
2
+ * $Id$
3
+ *
4
+ * Copyright (C) 2007 iptelorg GmbH
5
+ *
6
+ * This file is part of ser, a free SIP server.
7
+ *
8
+ * ser is free software; you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation; either version 2 of the License, or
11
+ * (at your option) any later version
12
+ *
13
+ * For a license to use the ser software under conditions
14
+ * other than those described here, or to purchase support for this
15
+ * software, please contact iptel.org by e-mail at the following addresses:
16
+ *    info@iptel.org
17
+ *
18
+ * ser is distributed in the hope that it will be useful,
19
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
+ * GNU General Public License for more details.
22
+ *
23
+ * You should have received a copy of the GNU General Public License
24
+ * along with this program; if not, write to the Free Software
25
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26
+ *
27
+ * HOWTO:
28
+ *	If you need a new configuration variable within the core, put it into
29
+ *	struct cfg_goup_core, and define it in cfg_core.c:core_cfg_def array.
30
+ *	The default value of the variable must be inserted into
31
+ *	cfg_core.c:default_core_cfg
32
+ *	Include this header file in your source code, and retrieve the
33
+ *	value with cfg_get(core, core_cfg, variable_name).
34
+ *
35
+ * History
36
+ * -------
37
+ *  2007-12-03	Initial version (Miklos)
38
+ */
39
+
40
+#ifndef _CFG_CORE_H
41
+#define _CFG_CORE_H
42
+
43
+#include "cfg/cfg.h"
44
+
45
+extern void	*core_cfg;
46
+
47
+struct cfg_group_core {
48
+	int	debug;
49
+};
50
+
51
+extern struct cfg_group_core default_core_cfg;
52
+extern cfg_def_t core_cfg_def[];
53
+
54
+#endif /* _CFG_CORE_H */