sip-router
11 years agomakefiles: minor fix (use COREPATH in Makefile.targets)
Andrei Pelinescu-Onciul [Thu, 23 Apr 2009 07:56:42 +0000 (07:56 +0000)]
makefiles: minor fix (use COREPATH in Makefile.targets)

11 years agomakefile: config and modules.lst minor fixes
Andrei Pelinescu-Onciul [Wed, 22 Apr 2009 15:09:13 +0000 (15:09 +0000)]
makefile: config and modules.lst minor fixes

- don't build the config on clean (even if not present)
- don't build the modules.lst unless needed (don't build it on
  clean, core only make a.s.o)

11 years agomakefile.doc: support all targets and dep. fixes
Andrei Pelinescu-Onciul [Wed, 22 Apr 2009 13:48:36 +0000 (13:48 +0000)]
makefile.doc: support all targets and dep. fixes

- support all the *clean and *proper targets
- include dependencies only if needed

11 years agodoc (INSTALL): minor make update
Andrei Pelinescu-Onciul [Wed, 22 Apr 2009 13:46:56 +0000 (13:46 +0000)]
doc (INSTALL): minor make update

11 years agomakefiles: fixes and speed-ups
Andrei Pelinescu-Onciul [Wed, 22 Apr 2009 13:46:30 +0000 (13:46 +0000)]
makefiles: fixes and speed-ups

- make clean, proper, realclean, distclean and maintainer-clean
  will work on all the libs in the lib/ directory.
- clean, proper, realclean, distclean and maintainer-clean targets
  split into more specific targets: local-clean, clean-modules,
  clean-libs, clean-utils (and the same for the others) => make
  proper & friends depend now only on the really needed parts =>
  much faster.
- doc directories are entered only if a Makefile is present.
- make maintainer-clean properly deletes the config and the
  modules list at the end (it doesn't recreate it).

11 years agomakefiles: typo fixed
Andrei Pelinescu-Onciul [Wed, 22 Apr 2009 09:00:37 +0000 (09:00 +0000)]
makefiles: typo fixed

s/mantainer/maintainer/

11 years agomake: use C_INCLUDES for includes
Andrei Pelinescu-Onciul [Fri, 10 Apr 2009 12:28:00 +0000 (12:28 +0000)]
make: use C_INCLUDES for includes

11 years agotcp: stun fixes
Andrei Pelinescu-Onciul [Fri, 10 Apr 2009 11:26:11 +0000 (11:26 +0000)]
tcp: stun fixes

11 years agotcp: tcp_blocking_connect timeout fix
Andrei Pelinescu-Onciul [Fri, 10 Apr 2009 10:26:01 +0000 (10:26 +0000)]
tcp: tcp_blocking_connect timeout fix

- tcp_blocking_connect timeout might have elapsed sooner then
  configured due to a bug in the way it was checked in the code.
  (affects tcp only in the old non-async mode)

Author: Libor Chocholaty <libor@iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei@iptel.org>

11 years agotcp: stats: added init & destroy macros
Andrei Pelinescu-Onciul [Fri, 10 Apr 2009 10:24:40 +0000 (10:24 +0000)]
tcp: stats: added init & destroy macros

11 years agotcp: minor stats fixes
Andrei Pelinescu-Onciul [Fri, 10 Apr 2009 10:23:14 +0000 (10:23 +0000)]
tcp: minor stats fixes

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

11 years agotcp: internal macro-hooks for stats & events
Andrei Pelinescu-Onciul [Thu, 9 Apr 2009 19:10:56 +0000 (19:10 +0000)]
tcp: internal macro-hooks for stats & events

- added macros for tcp statistics (for now empty, keeping
  more statistics will only involve redefining them):

  TCP_STATS_ESTABLISHED(state) - new connection established
  TCP_STATS_CONNECT_FAILED() - new outgoing connection failed
  TCP_STATS_LOCAL_REJECT() - new incoming connection rejected
                            (max. no exceeded)
  TCP_STATS_CON_TIMEOUT() - connection closed for being idle too
                            long
  TCP_STATS_SEND_TIMEOUT() - send fails due to a timeout
  TCP_STATS_SENDQ_FULL()   - send fails because of the buffering
                             capacity being exceed (async mode
                             only)

- added macros for various tcp events (for now some of them are
  used for logging):

  TCP_EV_CONNECT_RST(...) - connect attempt received RST
  TCP_EV_CONNECT_UNREACHABLE(...)
  TCP_EV_CONNECT_TIMEOUT(...)
  TCP_EV_CONNECT_NO_MORE_PORTS(...)
  TCP_EV_CONNECT_ERR(...)  - other connect error
  TCP_EV_SEND_TIMEOUT(...)
  TCP_EV_SENDQ_FULL(...)
  TCP_EV_IDLE_CONN_CLOSED(...)

11 years agotcp: helper internal macros
Andrei Pelinescu-Onciul [Thu, 9 Apr 2009 19:10:31 +0000 (19:10 +0000)]
tcp: helper internal macros

- helper macros for getting the local address & port, the peer
  address & port, the protocol and the compression from a tcp
  connection structure pointer.

11 years agoDo not try to backlist and do not try DNS failover for blind UACs as
Miklos Tirpak [Wed, 8 Apr 2009 11:44:23 +0000 (11:44 +0000)]
Do not try to backlist and do not try DNS failover for blind UACs as
they do not have a destination address.

11 years agoSafety check added to verify whether the static buffers have
Miklos Tirpak [Tue, 7 Apr 2009 09:07:48 +0000 (09:07 +0000)]
Safety check added to verify whether the static buffers have
been initialized.

11 years agoWrapper functions for regcomp, regexec, regfree, and regerror using shared
Miklos Tirpak [Fri, 3 Apr 2009 13:03:46 +0000 (13:03 +0000)]
Wrapper functions for regcomp, regexec, regfree, and regerror using shared
memory allocators instead of libc malloc/realloc/free.
Check the README file for more details.

11 years agomake: minor optimizations
Andrei Pelinescu-Onciul [Fri, 3 Apr 2009 11:38:34 +0000 (11:38 +0000)]
make: minor optimizations

- make cfg should be a little faster

11 years agomake: fail if make version < 3.80
Andrei Pelinescu-Onciul [Fri, 3 Apr 2009 11:06:57 +0000 (11:06 +0000)]
make: fail if make version < 3.80

11 years agomake: workaround for make 3.80
Andrei Pelinescu-Onciul [Fri, 3 Apr 2009 10:50:13 +0000 (10:50 +0000)]
make: workaround for make 3.80

- if make version is 3.80* replace $(realpath ...) with our own
  function (realpath is not supported in 3.80)

11 years agomake: workaround for backwards compat. with make 3.80
Andrei Pelinescu-Onciul [Thu, 2 Apr 2009 18:42:58 +0000 (18:42 +0000)]
make: workaround for backwards compat. with make 3.80

- workaround for export not supported in gnu make 3.80 target
  specific variables: use $(mk_params) for each $(MAKE) invocation

11 years agodns: fix selecting neg. cname entry
Andrei Pelinescu-Onciul [Tue, 31 Mar 2009 18:11:25 +0000 (18:11 +0000)]
dns: fix selecting neg. cname entry

- do not select a neg. cache cname entry as a response, unless
  the request is for a cname.
  This fixes an unlikely bug: someone makes a specific cname
  request (from ser) for a name that doesn't resolve and then later when
  a normal non-cname request is made (e.g. A) the empty negative cname
  entry is selected, leading to a coredump. So far there is no
  code in ser that could trigger this bug. Only dns.lookup cname
  ... from sip-router could trigger it.

11 years agodns: minor fixes
Andrei Pelinescu-Onciul [Tue, 31 Mar 2009 17:06:00 +0000 (17:06 +0000)]
dns: minor fixes

- some dns record parsers need only the record end for their
  internal overflow checks, while others need also the message end
  (anything that expands compressed strings).

11 years agoStatic buffer is resetted before calling the route block -- Thanks to Jan.
Miklos Tirpak [Tue, 31 Mar 2009 12:33:38 +0000 (12:33 +0000)]
Static buffer is resetted before calling the route block -- Thanks to Jan.

11 years agoMissing include is added.
Miklos Tirpak [Tue, 31 Mar 2009 12:32:31 +0000 (12:32 +0000)]
Missing include is added.

11 years agodns: more strict record end checking
Andrei Pelinescu-Onciul [Mon, 30 Mar 2009 13:59:42 +0000 (13:59 +0000)]
dns: more strict record end checking

- be more strict and check always if a record doesn't exceed it's
  declared length (before we checked only if the end is inside the
  message).

11 years agodns: minor fixes: long lines, unlikely(), end of msg checks
Andrei Pelinescu-Onciul [Mon, 30 Mar 2009 13:50:36 +0000 (13:50 +0000)]
dns: minor fixes: long lines, unlikely(), end of msg checks

- check if the rdlength is valid (points inside the answer),
  before skipping over a record
- added unlikely() for error checks
- cosmetic: broken some long lines

11 years agoAdding missing reset_static_buffer()
Jan Janak [Sun, 29 Mar 2009 15:39:27 +0000 (15:39 +0000)]
Adding missing reset_static_buffer()

11 years agotcp: minor optimization
Andrei Pelinescu-Onciul [Fri, 20 Mar 2009 19:59:14 +0000 (19:59 +0000)]
tcp: minor optimization

- tcp_req complete & has_content_len transformed into flags
  (4 bytes saved per connection)

11 years agosercmd: minor makefile fix
Andrei Pelinescu-Onciul [Fri, 20 Mar 2009 17:27:15 +0000 (17:27 +0000)]
sercmd: minor makefile fix

- clear C_DEFS, since we don't need ser common DEFS for building sercmd
 (minor compile warning that appeared after the recend DEFS->C_DEFS changes
 in the main Makefiles)

11 years agotcp internal: send timeout is now kept only in ticks
Andrei Pelinescu-Onciul [Fri, 20 Mar 2009 17:26:51 +0000 (17:26 +0000)]
tcp internal: send timeout is now kept only in ticks

- removed send_timeout_s and wq_timeout and replaced them with send_timeout,
 which is now kept only in ticks. This fixes the cfg.set_delayed_int problem
 reported by Miklos.

11 years agocore: typo fix
Andrei Pelinescu-Onciul [Fri, 20 Mar 2009 16:10:37 +0000 (16:10 +0000)]
core: typo fix

- ';' after if() (again). Fortunately it didn't have any impact
  since right now nobody returns NONSIP_MSG_ACCEPT from a
  nonsip_msg callback.

11 years agotcp: typo & minor optimization
Andrei Pelinescu-Onciul [Thu, 19 Mar 2009 17:59:14 +0000 (17:59 +0000)]
tcp: typo & minor optimization

- fixed ';' after if() on tcp connection free (luckily that code path was
 not very common and it was even more improbable to have a ref'ed connection
 at that point).

- changed unlikely() into likely() when checking connect() return in async
mode (it's much more probable to get an EINPROGRESS).

Reported-by: Libor Chocholaty <libor@iptel.org>
11 years agoRename Contact parameter select 'method' to 'methods'
Jan Janak [Thu, 19 Mar 2009 15:15:51 +0000 (15:15 +0000)]
Rename Contact parameter select 'method' to 'methods'

According RFC3840 the correct name of the parameter is 'methods',
not 'method'.

Reported by Daniel-Constantin Mierla

11 years agoRename Contact parameter 'method' to 'methods'
Jan Janak [Thu, 19 Mar 2009 15:15:04 +0000 (15:15 +0000)]
Rename Contact parameter 'method' to 'methods'

According RFC3840 the correct name of the parameter is 'methods',
not 'method'.

Reported by Daniel-Constantin Mierla

11 years agomake install: avoid re-linking lib dependent modules
Andrei Pelinescu-Onciul [Thu, 19 Mar 2009 14:32:36 +0000 (14:32 +0000)]
make install: avoid re-linking lib dependent modules

- install doesn't try first to build everything, it will build as
  it installs. This will avoid re-linking ser-lib dependent
  modules (the normal "make all" would use a local rpath, while "make
  install" would change rpath to the install destination dir => the
  module needs to be relinked with a different rpath or on Darwin
  the lib has to be rebuilt)
- avoid an extra make call on lib install

11 years agobuild system: avoid libraries re-compiling
Andrei Pelinescu-Onciul [Thu, 19 Mar 2009 13:42:09 +0000 (13:42 +0000)]
build system: avoid libraries re-compiling

- ignore module DEFS when deciding whether or not to recompile a
  library: DEFS split into C_DEFS (for common DEFS which are taken
  into account when deciding whether or not to recompile a lib)
  and DEFS, which are now visible only inside the module or lib
  that uses them. Same for INCLUDES and C_INCLUDES.

11 years agofixing missing $ in ser_mysql.sh script
Pavel Kasparek [Mon, 16 Mar 2009 10:35:10 +0000 (10:35 +0000)]
fixing missing $ in ser_mysql.sh script

11 years agoDebian packaging - fixing path to mysql sql files in my_create.sh script
Pavel Kasparek [Mon, 16 Mar 2009 10:08:44 +0000 (10:08 +0000)]
Debian packaging - fixing path to mysql sql files in my_create.sh script

11 years agoThe fixup function prototypes of the config variables have been
Miklos Tirpak [Fri, 13 Mar 2009 13:59:28 +0000 (13:59 +0000)]
The fixup function prototypes of the config variables have been
extended with the group name.
All the fixup functions have been updated.

11 years agoStrip, prefix, rewriteuser, ... all the SET_* actions preserve the
Miklos Tirpak [Tue, 10 Mar 2009 16:26:35 +0000 (16:26 +0000)]
Strip, prefix, rewriteuser, ... all the SET_* actions preserve the
original URI scheme unless the host name is rewritten. If the host name
is set, then tel: and tels: URIs are converted to sip: or sips:, and the
user=phone parameter is added.

A script function, userphone(), is introduced: It adds the "user=phone"
parameter to a sip: or sips: RURI if the param is not yet present.
(Does not change tel: and tels: URIs).

(Patch has been created with cooperation with Michal Matyska.)
Fixes SER-435.

11 years agocore: check & fix Content-Length when sending on tcp
Andrei Pelinescu-Onciul [Mon, 9 Mar 2009 13:47:48 +0000 (13:47 +0000)]
core: check & fix Content-Length when sending on tcp

- automatically check & fix wrong Content-Length before forwarding
  on tcp or tls

11 years agotcp: config option for the async write block size
Andrei Pelinescu-Onciul [Mon, 9 Mar 2009 13:45:49 +0000 (13:45 +0000)]
tcp: config option for the async write block size

 - the block size used for the async writes can now be configured
   both from ser.cfg (tcp_wq_blk_size) and at runtime. This value
   has only a little performance impact and only when writes are
   delayed.  Small values are safer (big values on proxies that
   open thousands of connections over slow links would eat up a
   lot of memory). For now it's main use is debugging.

11 years agotcp: config option for the read buffer size
Andrei Pelinescu-Onciul [Mon, 9 Mar 2009 13:45:28 +0000 (13:45 +0000)]
tcp: config option for the read buffer size

- the read buffer size can now be configured both at runtime and
  from ser.cfg (tcp_rd_buf_size). A high value will help
  performance for tcp connections with lots of traffic, however it
  will increase the memory consumption. As a rule of thumb use
  high values(e.g. 32768, 65536) on servers which open only a few
  tcp connections and have very heavy traffic on them and a low
  value (e.g. 4096, 2048) on servers that are expected to have
  lots of open connections (50k - 100k+). Note also that this
  value will also limit the maximum sip datagram size that can be
  received on tcp. The default value is 4096.

11 years agotcp: dyn. config fix for tcp_con_lifetime
Andrei Pelinescu-Onciul [Mon, 9 Mar 2009 13:39:10 +0000 (13:39 +0000)]
tcp: dyn. config fix for tcp_con_lifetime

- cfg.set_delayed_int didn't work (fixup tried to modify another
  config variable which doesn't work with cfg.set_delayed*)

11 years agotcp: diff. connect timeout for async & states cleanup
Andrei Pelinescu-Onciul [Fri, 6 Mar 2009 16:54:10 +0000 (16:54 +0000)]
tcp: diff. connect timeout for async & states cleanup

- async mode will now honour tcp_connect_timeout (up to now it
  used tcp_send_timeout also for connects)
- internal states cleanup (dropped S_CONN_PENDING, fixed
  S_CONN_ACCEPT->S_CONN_OK transition a.s.o)

11 years agotcp: config option to disable active connects
Andrei Pelinescu-Onciul [Thu, 5 Mar 2009 17:21:30 +0000 (17:21 +0000)]
tcp: config option to disable active connects

- added new config option to disable active connects. If set ser
  will only accept new connection, it will not actively open new
  ones.
  The option can be set both in ser.cfg (tcp_no_connect=yes) or
  at runtime (sercmd cfg.set_now_int tcp no_connect 1).

11 years agotcp: async mode on by default
Andrei Pelinescu-Onciul [Thu, 5 Mar 2009 17:21:11 +0000 (17:21 +0000)]
tcp: async mode on by default

- async mode is now on by default (use tcp_async=no in the config
  to disable it)
- renamed tcp_buf_write/TCP_BUF_WRITE into tcp_async/TCP_ASYNC in
  the code

11 years agotcp: enable runtime changing for most of the cfg vars
Andrei Pelinescu-Onciul [Thu, 5 Mar 2009 17:20:53 +0000 (17:20 +0000)]
tcp: enable runtime changing for most of the cfg vars

- following tcp config variables can now be changes at runtime:
  connect_timeout, send_timeout, connection_lifetime,
  max_connections (can be decreased, it cannot be increased more
  then the startup value), conn_wq_max, wq_max, crlf_ping,
  accept_aliases, alias_flags, new_conn_alias_flags.
- the following variables can be changes but they will affect only
  new connections opened by ser: delayed_ack, syncnt, linger2,
  keepalive, keepidle, keepintvl, keepcnt
  (for the ser.cfg equivalent, just add tcp_ in front of the
  variable name; for help and grep NEWS)

- updated core.tcp_options to dump all the tcp config options

11 years agotcp: use dynamic config framework, part 2
Andrei Pelinescu-Onciul [Thu, 5 Mar 2009 17:20:42 +0000 (17:20 +0000)]
tcp: use dynamic config framework, part 2

- added tcp_connect_timeout, tcp_send_timeout,
  tcp_connection_lifetime, tcp_max_connections, tcp_accept_aliases
  to the config framework.

- added 2 new tcp related variables: tcp alias_flags and tcp
  new_conn_alias_flags

11 years agotcp: use dynamic config framework, part 1
Andrei Pelinescu-Onciul [Thu, 5 Mar 2009 17:20:22 +0000 (17:20 +0000)]
tcp: use dynamic config framework, part 1

- all tcp config variables from tcp_options.h migrated to the
  dynamic configuration framework. For now all are read only, but
  write support will come soon where it makes sense.
  E.g.: (with the cfg_rpc module loaded)
  $ sercmd cfg.help tcp async
  async mode for writes and connects
  (parameter type is integer)

  $ sercmd cfg.get tcp async
  0

11 years agotest: updated parse uri test program
Andrei Pelinescu-Onciul [Wed, 4 Mar 2009 20:56:21 +0000 (20:56 +0000)]
test: updated parse uri test program

11 years agosctp: rpc info command
Andrei Pelinescu-Onciul [Wed, 4 Mar 2009 20:56:11 +0000 (20:56 +0000)]
sctp: rpc info command

- added core.sctp_info which returns some very general sctp
  information (opened associations, tracked ones, total
  associations opened from startup).
  E.g.:
  $ sercmd core.sctp_info
{
opened_connections: 0
tracked_connections: 0
total_connections: 50007
}

11 years agosctp: connection reuse & connection tracking
Andrei Pelinescu-Onciul [Wed, 4 Mar 2009 20:56:00 +0000 (20:56 +0000)]
sctp: connection reuse & connection tracking

- support for sctp connection tracking and true sctp connection
  reuse for replies.
  We need this to support reply connection reuse with asymmetric
  sctp peers (while there is no reason not to use the same port on
  sctp for sending and receiving messages and it should be
  strongly discouraged to do so, we never now with what
  implementation we'll have to deal).
  What  makes this particularly complex is the not-yet-complete
  sctp API, the slight but important behaviour
  differences between its linux, freebsd and solaris
  implementations and the fact that is more geared towards serial
  single threaded application rather then parallel-processing
  multi-process or multi-threaded ones.

- keep track of the number of active and tracked sctp connections

- blacklist moved into sctp_handles_assoc_change()

11 years agosctp: empty sctp_handle_assoc_change added
Andrei Pelinescu-Onciul [Wed, 4 Mar 2009 20:55:44 +0000 (20:55 +0000)]
sctp: empty  sctp_handle_assoc_change added

11 years agoregfree() function call is added to free the memory allocated by regcomp().
Miklos Tirpak [Tue, 3 Mar 2009 12:46:40 +0000 (12:46 +0000)]
regfree() function call is added to free the memory allocated by regcomp().

11 years agoReplace explicit flag values with bit shifts for better readability
Jan Janak [Mon, 2 Mar 2009 21:42:09 +0000 (21:42 +0000)]
Replace explicit flag values with bit shifts for better readability

11 years agosctp: direct blacklist support
Andrei Pelinescu-Onciul [Fri, 27 Feb 2009 21:15:27 +0000 (21:15 +0000)]
sctp: direct blacklist support

- blacklist support at the sctp level. If sctp_send_retries are
  used, the blacklist will work only for send (using
  SCTP_SEND_FAILED notifications). If sctp_send_retries is not
  used (default), there are 2 possible blacklist reasons: SEND or
  CONNECT (assoc. failed to be opened).

11 years agoSupport for MESSAGE and OPTIONS method types are added to the parser.
Miklos Tirpak [Fri, 27 Feb 2009 09:01:42 +0000 (09:01 +0000)]
Support for MESSAGE and OPTIONS method types are added to the parser.

11 years agolog/dbg: level is not limited anymore
Andrei Pelinescu-Onciul [Thu, 26 Feb 2009 23:14:12 +0000 (23:14 +0000)]
log/dbg: level is not limited anymore

The recent changes to LOG() added a new limitation: the log level
was restricted to one of the L_ macros. Using another level (e.g.
L_DBG+1) would trigger an assert(). Now any level is allowed. If
the level is not among the defined range (L_ALERT - L_DBG), the
prefix will be skipped (e.g. "DBG") and the syslog level will be
set to either the L_ALERT or the L_DBG one. This fixes problems
with log() from the script, or when using a very high debug level
and something like memdbg=7.

11 years agoconfig: tcp_async alias for tcp_buf_write
Andrei Pelinescu-Onciul [Thu, 26 Feb 2009 23:13:59 +0000 (23:13 +0000)]
config: tcp_async alias for tcp_buf_write

- tcp_buf_write was not the best choosen name, so tcp_async was added as an
  alias for it

11 years agotcp: async write timeout fixes
Andrei Pelinescu-Onciul [Thu, 26 Feb 2009 23:13:44 +0000 (23:13 +0000)]
tcp: async write timeout fixes

- fixed a wrong write timeout test on connection-read-release
 (TICKS_LE instead of TICKS_GE)

- fixed initial write timeout after connection creation (the
  timeout was ended up set to tcp_con_lifetime instead of
  tcp_wq_timeout)

11 years agotcp: blacklist at tcp level if possible
Andrei Pelinescu-Onciul [Thu, 26 Feb 2009 23:13:22 +0000 (23:13 +0000)]
tcp: blacklist at tcp level if possible

- automatically blacklist destinations if connecting to them fails
  (BLST_ERR_CONNECT) or send fails (BLST_ERR_SEND), either due to a
  protocol error (RST, protocol level timeout a.s.o), or because
  of a ser level send/connect timeout.
 Note: in this cases the sip_msg parameter of the blacklist will
 be null (since in general the message triggering the error is not
 known), so if you register a blacklist callback you should make
 sure it works with null sip_msgs too.

- if a connection is in a connect pending state (S_CONN_CONNECT)
  and something is read on it, move it into established state
  (S_CONN_OK). This can happen only in tcp async mode.

- fix transition directly to S_CONN_OK from S_CONN_PENDING (should go
  through S_CONN_CONNECT first)

11 years agoblst: another blacklist dest. function version
Andrei Pelinescu-Onciul [Thu, 26 Feb 2009 23:09:22 +0000 (23:09 +0000)]
blst: another blacklist dest. function version

- added dst_blacklist_su(), which is a variant of dst_blacklist_add()
 (different way of passing the blacklist target)

11 years agocfg_size macro renamed to cfg_sizeof to avoid a conflict with one of the
Jan Janak [Thu, 26 Feb 2009 11:39:37 +0000 (11:39 +0000)]
cfg_size macro renamed to cfg_sizeof to avoid a conflict with one of the
functions in libconfuse, this library is used by one of the kamailio modules.

Acked by Miklos Tirpak.

11 years agotcp: fix compilation problem on solaris (FIONREAD)
Andrei Pelinescu-Onciul [Mon, 16 Feb 2009 17:20:17 +0000 (17:20 +0000)]
tcp: fix compilation problem on solaris (FIONREAD)

- on solaris include <sys/filio.h> if present, else define BSD_COMP before
 including ioctl.h.

Reported-by: Vance Shipley vances at motivity ca.
11 years agocore: fix bad level name in new LOG()
Andrei Pelinescu-Onciul [Mon, 16 Feb 2009 15:35:56 +0000 (15:35 +0000)]
core: fix bad level name in new LOG()

- the syslog LOG_() used log_level_info[(level)].name (which
  produced a wrong log level) instead of LOG_LEVEL2NAME(level)
- coding style fixes ( lines < 80 chars)

11 years agot_check_status() checks also the blind UACs if t_pick_branch()
Miklos Tirpak [Wed, 28 Jan 2009 14:49:55 +0000 (14:49 +0000)]
t_check_status() checks also the blind UACs if t_pick_branch()
fails to determine the picked branch in failure_route.
Closes SER-434.

11 years agoDocumenting t_lookup_cancel() script function.
Miklos Tirpak [Tue, 20 Jan 2009 12:45:20 +0000 (12:45 +0000)]
Documenting t_lookup_cancel() script function.

11 years agoRemoving set_t() from t_lookup_cancel() function, and introducing
Miklos Tirpak [Tue, 20 Jan 2009 10:38:50 +0000 (10:38 +0000)]
Removing set_t() from t_lookup_cancel() function, and introducing
an optional parameter. See the bug report SER-432.

11 years agoupdated udp_mtu handling code - fixes SER-433
Michal Matyska [Mon, 19 Jan 2009 15:47:25 +0000 (15:47 +0000)]
updated udp_mtu handling code - fixes SER-433

- call apply lumps with the original send_info, so the lumps are generated the same way their length was calculated, so there is no buffer overflow.
- this has also the expected and wanted side-effect that the record route is done as the outgoing path would be UDP (do not insert double record-route header)

11 years agodocumenting t_is_expired() function
Miklos Tirpak [Fri, 16 Jan 2009 09:47:58 +0000 (09:47 +0000)]
documenting t_is_expired() function

11 years agot_is_expired() script function is introduced.
Miklos Tirpak [Fri, 16 Jan 2009 09:24:49 +0000 (09:24 +0000)]
t_is_expired() script function is introduced.
It returns true if the transaction lifetime timer has already been
expired.

11 years ago* logging API updated (see doc/logging-api.txt for details)
Ondrej Martinek [Tue, 6 Jan 2009 17:14:12 +0000 (17:14 +0000)]
* logging API updated (see doc/logging-api.txt for details)

  - LOG(LEVEL, FMT, ARGS...) and the short macro corresponding to
    LEVEL level made eqvivalent (eg. LOG(L_DBG, FMT, ARGS...) and
    DBG(FMT, ARGS...) prints always the same message)

  - changed the format of log messages produced by the macros
    to include the log level, module name, filename, line (if applicable)

  - added new, internal LOG_(LEVEL, PREFIX, FORMAT, ARGS...) macro

  - removed DPrint() and DEBUG() macros, L_DEFAULT log level and dprint()
    function

!!!
!!! IMPORTANT! READ ME!
!!!

These changes (mainly the first two) require reformating of the most log
messages in SER core and module source files.  This step can be done
automatically by running "scripts/logging/fix-logs-all" script BUT it
was NOT originally performed because it would have generated too many
changes in CVS which was discouraged by Andrei.  Instead, the developers
are expected to run it when ready.

11 years ago- AS support disabled by default.
Bogdan Pintea [Mon, 5 Jan 2009 21:32:26 +0000 (21:32 +0000)]
- AS support disabled by default.
- added forgotten define guards for a mem free specific to AS support code
  only.

11 years agoWhen building the route set of ACKs for local UACs, only the reply is now
Bogdan Pintea [Mon, 5 Jan 2009 21:26:44 +0000 (21:26 +0000)]
When building the route set of ACKs for local UACs, only the reply is now
evaluated; this is insufficient, since replies to in-dialog requests normally
miss the route set. The patch fixes that: evals INVITE, if this was in-dialog;
otherwise, the reply (since the req. doesn't have yet complete route set).

Add support for the SASI if'ace, adding the implemenation for two more TM API
functions:
- t_get_canceled_ident(): returns the hash coordinates (bucket/index) of the
  transaction the currently processed CANCEL is targeting
- ack_local_uac(): allow generating the ACKs for 2xx'ed locally originated
  INVITEs - new headers and body can now also be appended to it.

Fully closes #SER-346.

11 years agoIn case the AVP is a regexp, an allocation is required to build an AVP
Bogdan Pintea [Sun, 4 Jan 2009 15:34:54 +0000 (15:34 +0000)]
In case the AVP is a regexp, an allocation is required to build an AVP
"ident". The patch adds the functionality to free it.

Closes #SER-344.

11 years agoCurrently, SER matches E2E ACKs only if there is an equality between From HF
Bogdan Pintea [Sun, 4 Jan 2009 15:27:39 +0000 (15:27 +0000)]
Currently, SER matches E2E ACKs only if there is an equality between From HF
in INVITE and ACK. While this is pretty safe, there are UAs that do mess small
things, like display name, or some bigger ones, like URI, in generated ACK.
However, matching over the full URI (or worse, HF) is not needed and was even
intended for deprecation (see 1st comment of 3261#Sec. 12.2.1.1).
The applied patch should boost a bit the matching flexibility - only compare
the tag.

Closes #SER-419.

11 years agoThe calculate_routeset_length() produces an invalid result in the case
Bogdan Pintea [Sun, 4 Jan 2009 15:02:11 +0000 (15:02 +0000)]
The calculate_routeset_length() produces an invalid result in the case
dlg_t.hooks.last_route is set (and .first_route not).
Applied patch fixes that (and should hopefully be a bit cleaner).

Closes #SER-421.

11 years ago'memapp' and 'append_mem_block' are now both only used in source
Bogdan Pintea [Sun, 4 Jan 2009 14:58:36 +0000 (14:58 +0000)]
'memapp' and 'append_mem_block' are now both only used in source
t_msgbuilder.c. Applied patch removes the definition of both from .h.: memapp
moved to .c, append_mem_block only left in .c.
(Interestingly, gcc complained over different definitions, but accepted same
definition twice, for same identifier.)

Closes #SER-422.

11 years ago"Route :" prefix (and separator) is used some more time across the
Bogdan Pintea [Sun, 4 Jan 2009 14:52:42 +0000 (14:52 +0000)]
"Route :" prefix (and separator) is used some more time across the
source. It was defined 3 times (with a small variation). Applied patch
moves the definition to global config.h.

Closes #SER-420.

11 years agoscript: udp_mtu fallback script config & commands
Andrei Pelinescu-Onciul [Thu, 18 Dec 2008 16:09:16 +0000 (16:09 +0000)]
script: udp_mtu fallback script config & commands

new config variables:
 - udp_mtu = number  - size in bytes after which fallback to
   another protocol will be attempted. Default 0 (off),
   recommended 1300.
 - udp_mtu_try_proto = TCP|TLS|SCTP|UDP - protocol to fallback to.
   Default: UDP (off).
 - force_rport = yes|no - global force_rport().

new script commands:
 - udp_mtu_try_proto(TCP|TLS|SCTP|UDP) - like udp_mtu_try_proto
   above but works on a per packet basis and not globally.

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

11 years agocore: forward: tcp fallback for big udp packets
Andrei Pelinescu-Onciul [Thu, 18 Dec 2008 16:06:03 +0000 (16:06 +0000)]
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>

11 years agodns: fix build warnings when compiling without ipv6
Andrei Pelinescu-Onciul [Tue, 16 Dec 2008 14:35:55 +0000 (14:35 +0000)]
dns: fix build warnings when compiling without ipv6

Author: Vance Shipley <vances@motivity.ca>
Committer: Andrei Pelinescu-Onciul <andrei@iptel.org>

11 years agocore: fix build on Darwin
Andrei Pelinescu-Onciul [Tue, 16 Dec 2008 14:34:04 +0000 (14:34 +0000)]
core: fix build on Darwin

Author: Alfred Heggestad <aeh@db.org>
Committer: Andrei Pelinescu-Onciul <andrei@iptel.org>

11 years agodoc: tcp tunning update
Andrei Pelinescu-Onciul [Tue, 16 Dec 2008 14:30:48 +0000 (14:30 +0000)]
doc: tcp tunning update

- update with epoll tunning for kernels >= 2.6.27.8

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

11 years agosctp: SO_REUSEADDR on the sctp sockets
Andrei Pelinescu-Onciul [Fri, 12 Dec 2008 23:25:39 +0000 (23:25 +0000)]
sctp: SO_REUSEADDR on the sctp sockets

Reported-by: Michal Matyska, michal.matyska at iptel org
11 years agotcp: fix for async write
Andrei Pelinescu-Onciul [Fri, 12 Dec 2008 23:02:45 +0000 (23:02 +0000)]
tcp: fix for async write

- fixed bug in _wbufq_add() which caused packet corruption when
  multiple packets with size < default buffer size where queued.

Reported-by: Vaclav Kubart, vaclav.kubart at iptel org
Tested-by: Vaclav Kubart, vaclav.kubart at iptel org
11 years agoanother switch where PROTO_SCTP was missing - added case
Michal Matyska [Thu, 11 Dec 2008 19:12:41 +0000 (19:12 +0000)]
another switch where PROTO_SCTP was missing - added case

11 years agosctp protocol decoded in RPC dst_blacklist.view
Michal Matyska [Tue, 9 Dec 2008 14:09:22 +0000 (14:09 +0000)]
sctp protocol decoded in RPC dst_blacklist.view

so it does not show unknown protocol anymore

11 years agoclean up whitespace in makefile
Alfred E. Heggestad [Mon, 8 Dec 2008 12:26:39 +0000 (12:26 +0000)]
clean up whitespace in makefile

11 years agoadded README.prefix_route
Alfred E. Heggestad [Mon, 8 Dec 2008 10:36:46 +0000 (10:36 +0000)]
added README.prefix_route

11 years agoUse explicit comparison with NULL, it's more clear and shuts off gcc,
Maxim Sobolev [Mon, 8 Dec 2008 06:16:52 +0000 (06:16 +0000)]
Use explicit comparison with NULL, it's more clear and shuts off gcc,
which otherwise compain that condition is always true when argument is
pointer to the struct allocated on stack.

11 years agoFix warnings on LP64 plarforms out there (all 64-bit amd64/emt64 unixes
Maxim Sobolev [Mon, 8 Dec 2008 06:11:39 +0000 (06:11 +0000)]
Fix warnings on LP64 plarforms out there (all 64-bit amd64/emt64 unixes
and linuxes) where sizeof(*void) != sizeof(int).

11 years agoadded new module prefix_route
Alfred E. Heggestad [Sat, 6 Dec 2008 22:09:13 +0000 (22:09 +0000)]
added new module prefix_route

11 years agoupdate RPM spec file
Alfred E. Heggestad [Sat, 6 Dec 2008 21:49:27 +0000 (21:49 +0000)]
update RPM spec file

11 years agot_suspend() and t_continue() functions have been documented.
Miklos Tirpak [Fri, 5 Dec 2008 13:59:35 +0000 (13:59 +0000)]
t_suspend() and t_continue() functions have been documented.

11 years agodns: naptr local preferences fix
Andrei Pelinescu-Onciul [Wed, 3 Dec 2008 23:41:13 +0000 (23:41 +0000)]
dns: naptr local preferences fix

- in some cases the local preference for a protocol
  (dns_{udp,tcp,sctp,tls}_pref) was ignored (depending on the
  order of the records).

Reported-by: Vladimir Broz, vbroz at iptel org
Tested-by: Vladimir Broz, vbroz at iptel org
11 years agomore type punning warnings fixed
Andrei Pelinescu-Onciul [Fri, 28 Nov 2008 15:24:15 +0000 (15:24 +0000)]
more type punning warnings fixed

11 years agoavp: warning fixes & more sane usr_avp struct
Andrei Pelinescu-Onciul [Fri, 28 Nov 2008 15:24:01 +0000 (15:24 +0000)]
avp: warning fixes & more sane usr_avp struct

- type punning warning fixed (both for =-Wstrict-aliasing and
   -Wstrict-aliasing=2)
- replaced usr_avp->data with a union (more sane, looks better)

11 years agodns cache: fixed missing sctp SRV queries
Andrei Pelinescu-Onciul [Fri, 28 Nov 2008 10:41:40 +0000 (10:41 +0000)]
dns cache: fixed missing sctp SRV queries

- added missing support for sctp SRV queries