Module: sip-router
Branch: daniel/pv
Commit: d74b7829c6f0c23d786e6e3c3f0cba8b61b438b1
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d74b782…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Thu Nov 20 13:39:29 2008 +0200
pseudo-variable engine api
- imported pvar.h and unified PV and transformations interface in
pvapi.c
- PV engine does not use anymore static array plus a linked list for PV
implementations, PVs will be in module and indexed in a hash table
(small performance enhancement)
- transformations are registered via same model as PV, they will be
implemented in modules, the core will held a hash table to index them
- the core gets a smaller footprint now and better flexibility in
hadling PVs and transformations. pv and transformations will be moved
in pv module
- compiles but no testing so far
---
pvapi.c | 952 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 952 insertions(+), 0 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=d74…
Hello,
working to port PV engine to srouter, but also needed for kamailio's
migration of pseudo-variables (PVs) from core to modules, I need to
extend the module interface. The srouter has already support to work in
dual mode committed by Andrei few days ago, so it should affect only
kamailio's module interface if ser side does not need.
Here is the issue. In kamailio/openser we have so called transformations
that are bound to PV. They are now implemented directly in core. To move
them in a module, the interface needs to be extended, like we did in the
past to export PVs from modules. The important aspect is that they must
become visible immediately after the module is loaded -- this happens
also with PVs (so cannot use mod_init, etc...). This is required because
they may occur during script parsing, therefore the core/parser should
get knowledge of them in very early stage.
PVs are exported via a specific structure in module interface. We can do
same for transformations. There is another option, which can be used for
other purposes in the future - introducing in module interface a
callback to be run immediately after a module is loaded. The
transformations can be exported inside the callback.
Extending this way, in the future, the modules can make other attributes
visible to core/other modules immediately after loading without changing
the module interface.
Therefore I would go for second option. Other opinions?
Cheers,
Daniel
--
Daniel-Constantin Mierla
http://www.asipto.com
Include one line summaries of the merged commits in commit merge messages
(a MUST):
git config --global merge.log true
Use auto-tracking (behave as if -track is added to every git-pull):
git config --global branch.autosetupmerge always
Note: --global changes the global configuration ( ~/.gitconfig). Without
--global the local per repository configuration will be changed
(.git/config). You can either use the commands above or edit by hand
the config files.
Example ~/.gitconfig:
[user]
name = Andrei Pelinescu-Onciul
email = andrei(a)iptel.org
signinkey = 2CF56A2D
[color]
branch = auto
status = auto
[merge]
log = true
[branch]
autosetupmerge = always
[remote "ser"]
url= ssh://git.sip-router.org/ser
push=cvshead:andrei/cvshead
push=sctp:andrei/sctp
[url "ssh://git.sip-router.org/"]
insteadOf = sip-router:
insteadOf = sip_router:
[alias]
intercommit = !sh -c 'git show "$0" > /tmp/commit1 && git show "$1" > /tmp/commit2 && interdiff /tmp/commit[12] | less -FRS'
funcdiff = !sh -c \"git show \\\"\\$0:\\$2\\\" | sed -n \\\"/^[^ \\t].*\\$3(/,/^}/p\\\" > /tmp/.tmp1 &&\n git show \\\"\\$1:\\$2\\\" | sed -n \\\"/^[^ \\t].*\\$3(/,/^}/p\\\" > /tmp/.tmp2 &&\ngit diff /tmp/.tmp1 /tmp/.tmp2\"
The insteadOf lines create aliases for the url (so that I can use
git pull sip-router:ser_core cvs-head instead of
git pull ssh://git.sip-router.org/ser_core cvs-head
The aliases create a new git "commands", for more details see
http://git.or.cz/gitwiki/Aliases.
The funcdiff alias tries to display the differences in _one_ function
between 2 different commits, e.g.:
git funcdiff <oldrev> <newrev> <path> <function>
The intecommit alias is for seeing differences between a submited patch
(local commit into your repository) and the possibly modified version
applied: git intercommit <orig_commit> <applied_commit>.
Andrei
Hi,
I've attached a very brief version of the Karlsruhe meeting minutes.
It contains input mostly from me and Daniel (so that you know who to
blame :-)).
Sorry for the long delay.
Hope we haven't missed anything and if we did feel free to reply to this
thread.
Thanks a lot to 1&1 for hosting the meeting and to everyone who was
able to come on such a short notice.
Andrei
>
> Here is some more information on the git repository:
>
>
> Synchronization with SER CVS
> ============================
> The repository git.sip-router.org/ser is pulls commits from the SER CVS
> repository automatically. The synchronization works one-way only, changes
> commited to the SER CVS are automatically imported into the Git repository,
> but not vice versa. In other words if you want to commit something in the
> SER CVS repository then you have to do it manually, git won't help you here.
To push changes I've done in the git ser repo to ser cvs I use:
git log --pretty=oneline # to get the commit id I want to "export"
git cvsexportcommit -c -p -w ~/ser.cvs/ -v <commitid>
e.g.: git cvsexportcommit -c -p -w ~/ser.cvs/ -v <commitid> a9d929f558a6a620034fac8aa06c503b72c30fd8
in ~/ser.cvs I have an up-to-date checkout of ser from berlios cvs with
the following small change:
cd ~/ser.cvs; rm ser;
ln -s . ser
I need this because in the git repo ser is under the ser subdir, while
in cvs it's in the "root" dir (or at least this is the way I checkout
it).
Another way to do it is to generate patches in git (e.g.
git format-patch <comitid>) and the apply it manually on cvs, but this
requires also a copy-paste for the commit message.
>
> Clone the repository:
> $ git clone git://git.sip-router.org/ser
>
> and display the list of branches in the cloned repository:
> $ git branch -a
>
> origin/HEAD
> origin/MAIN
> origin/Maintainer
> origin/andrei_cvs-head
> origin/cancel_fix
> origin/cvs-head
> origin/janakj
> origin/jj/cvshead
> origin/jj/doxygen
> origin/master
> origin/rel_0_8_11
> origin/rel_0_8_12
> origin/rel_0_8_14
> origin/rel_0_9_0
> origin/rel_2_0_0
> origin/rel_janakj
> origin/start
> origin/testing_0_8_12
> origin/vendor
>
> Several of the branches above are automatically updated from CVS, namely
> origin/cvs-head receives cvs commits to HEAD and origin/rel_2_0_0
> receives commits to the branch rel_2_0_0 in CVS, and so on.
>
> These branches will be updated with latest commits from the CVS repository
> every time you do:
>
> $ git pull
>
> Note that after the steps described above you have the whole CVS commit history
> of SER on your local machine, starting with day 1 until today, and including
> all branches from the CVS repository. This is convenient because you can
> work with the history offline and pretty much all common operations are
> blazingly fast because they only work with local files.
>
Note also that you can push changes only to branches starting with tmp/
, with your <your_username>/ or master (which is unused).
The cvs sync branches are read-only,
Andrei
[...]
Module: sip-router
Branch: andrei/mod_f_params
Commit: 1dd086b90c043db12f70974d7de46691feb0aa0b
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1dd086b…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Mon Nov 17 18:21:53 2008 +0100
module interface: minor changes from kamailio
- changed callback with no params prototypes from f() into f(void), original
commit message:
- sync function definitions with declarations for functions w/o parameters
- this functions were declared as 'f()', that means they can have a
arbitrary number of arguments (because of compatibility to the old style
definitions in the C standard), even if they are defined as f(void)
- there is no warning reported if somebody call a function like this with
some parameters
- another potential problem is, when somebody change the definition to
accept some parameter, but forgot to change also the declaration. Then
the compiler will not report wrong usage of this functions too.
- sometimes ago the '-Wold-style-definition' warning was introduced, the
definitions get then fixed subsequently, but not all declarations
- added free_fixup_function type definition
- added some doxygen comments
Credits go to: Henning Westerholt <henning.westerholt(a)1und1.de>
---
sr_module.h | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/sr_module.h b/sr_module.h
index 15aed59..f099f37 100644
--- a/sr_module.h
+++ b/sr_module.h
@@ -41,6 +41,13 @@
* 2007-06-07 added PROC_INIT, called in the main process context
* (same as PROC_MAIN), buf guaranteed to be called before
* any other process is forked (andrei)
+ * 2008-11-17 sip-router version: includes some of the openser/kamailio
+ * changes: f(void) instead of f(), free_fixup_function()
+ */
+
+/*!
+ * \file
+ * \brief modules/plug-in structures declarations
*/
@@ -53,12 +60,14 @@
#include "route_struct.h"
#include "str.h"
-typedef struct module_exports* (*module_register)();
+typedef struct module_exports* (*module_register)(void);
typedef int (*cmd_function)(struct sip_msg*, char*, char*);
typedef int (*fixup_function)(void** param, int param_no);
+typedef int (*free_fixup_function)(void** param, int param_no);
typedef int (*response_function)(struct sip_msg*);
typedef void (*onbreak_function)(struct sip_msg*);
-typedef void (*destroy_function)();
+typedef void (*destroy_function)(void);
+
typedef int (*init_function)(void);
typedef int (*child_init_function)(int rank);
@@ -193,19 +202,19 @@ extern struct sr_module* modules; /* global module list*/
extern response_function* mod_response_cbks;/* response callback array */
extern int mod_response_cbk_no; /* size of reponse callbacks array */
-int register_builtin_modules();
+int register_builtin_modules(void);
int register_module(struct module_exports*, char*, void*);
int load_module(char* path);
cmd_export_t* find_export_record(char* name, int param_no, int flags);
cmd_function find_export(char* name, int param_no, int flags);
cmd_function find_mod_export(char* mod, char* name, int param_no, int flags);
rpc_export_t* find_rpc_export(char* name, int flags);
-void destroy_modules();
+void destroy_modules(void);
int init_child(int rank);
int init_modules(void);
struct sr_module* find_module_by_name(char* mod);
-/*
+/*! \brief
* Find a parameter with given type and return it's
* address in memory
* If there is no such parameter, NULL is returned
Module: sip-router
Branch: andrei/mod_f_params
Commit: 3c72005540cbe07ccc1f6f7c30407e65b933e9f5
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3c72005…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Tue Nov 18 00:21:51 2008 +0100
kamailio compatibility header files
- mi, pvar & statistics basic include files. For now they contain only
basic type declarations and defines to allow compilation (so you cannot
use them, but the code will compile).
- pvar needs more work or replacement
---
mi/mi.h | 99 +++++++++++++++++++++++++++++++++++++++
pvar.h | 145 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
statistics.h | 72 +++++++++++++++++++++++++++++
3 files changed, 316 insertions(+), 0 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=3c7…