#### 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

#### Core Update of doxygen, removal of history, changing "ser" to "kamailio"

Olle E. Johansson authored on 03/01/2015 14:03:24
Showing 1 changed files
 ... ... @@ -1,22 +1,15 @@ 1 1 /* 2 - * $Id$ 3 - * 4 2 * 5 3 * Copyright (C) 2001-2003 FhG Fokus 6 4 * 7 - * This file is part of ser, a free SIP server. 5 + * This file is part of Kamailio, a free SIP server. 8 6 * 9 - * ser is free software; you can redistribute it and/or modify 7 + * Kamailio is free software; you can redistribute it and/or modify 10 8 * it under the terms of the GNU General Public License as published by 11 9 * the Free Software Foundation; either version 2 of the License, or 12 10 * (at your option) any later version 13 11 * 14 - * For a license to use the ser software under conditions 15 - * other than those described here, or to purchase support for this 16 - * software, please contact iptel.org by e-mail at the following addresses: 17 - * info@iptel.org 18 - * 19 - * ser is distributed in the hope that it will be useful, 12 + * Kamailio is distributed in the hope that it will be useful, 20 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 15 * GNU General Public License for more details. ... ... @@ -25,12 +18,13 @@ 25 18 * along with this program; if not, write to the Free Software 26 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 27 20 */ 28 -/* 29 - * History: 30 - * -------- 31 - * 2003-03-19 replaced all mallocs/frees w/ pkg_malloc/pkg_free (andrei) 32 - * 2003-10-21 support for proto added: proto:host:port (andrei) 33 - */ 21 +/*! 22 +* \file 23 +* \brief Kamailio core :: Name/alias handling 24 +* \author andrei 25 +* \ingroup core 26 +* Module: \ref core 27 +*/ 34 28 35 29 36 30 ... ... @@ -52,7 +46,7 @@ extern struct host_alias* aliases; 52 46 53 47 54 48 55 -/* returns 1 if name is in the alias list; if port=0, port no is ignored 49 +/** returns 1 if name is in the alias list; if port=0, port no is ignored 56 50 * if proto=0, proto is ignored*/ 57 51 static inline int grep_aliases(char* name, int len, unsigned short port, 58 52 unsigned short proto) ... ... @@ -74,7 +68,7 @@ static inline int grep_aliases(char* name, int len, unsigned short port, 74 68 75 69 76 70 77 -/* adds an alias to the list (only if it isn't already there) 71 +/** adds an alias to the list (only if it isn't already there) 78 72 * if port==0, the alias will match all the ports 79 73 * if proto==0, the alias will match all the protocols 80 74 * returns 1 if a new alias was added, 0 if a matching alias was already on

#### name_alias.h: logging: convert LOG to LM_*

Ovidiu Sas authored on 03/10/2014 18:51:32
Showing 1 changed files
 ... ... @@ -107,7 +107,7 @@ static inline int add_alias(char* name, int len, unsigned short port, 107 107 aliases=a; 108 108 return 1; 109 109 error: 110 - LOG(L_ERR, "ERROR: add_alias: memory allocation error\n"); 110 + LM_ERR("memory allocation error\n"); 111 111 if (a) pkg_free(a); 112 112 return -1; 113 113 }

#### 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
 ... ... @@ -23,7 +23,7 @@ 23 23 * 24 24 * You should have received a copy of the GNU General Public License 25 25 * along with this program; if not, write to the Free Software 26 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 26 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 27 27 */ 28 28 /* 29 29 * History:

#### core and modules: make IPv6 default, remove compile time flags

* Make IPv6 the default in the core and affected modules
* it has been default switched on since a long time, and was introduced in 2002
* even on embedded systems one probably want now proper IPv6 support
* there was an issue in cygwin in 2008, but IPv6 is there also available since v1.7
* remove over 160 #ifdefs, cleanup the code a lot and removes many of rarely
tested alternative code paths to ease support of the codebase
* note for gentoo maintainer: please review your packages, they will maybe not
work now correctly anymore if somebody specified -ipv6 in the use flags

Henning Westerholt authored on 18/05/2013 08:07:25
Showing 1 changed files
 ... ... @@ -59,13 +59,11 @@ static inline int grep_aliases(char* name, int len, unsigned short port, 59 59 { 60 60 struct host_alias* a; 61 61 62 -#ifdef USE_IPV6 63 62 if ((len>2)&&((*name)=='[')&&(name[len-1]==']')){ 64 63 /* ipv6 reference, skip [] */ 65 64 name++; 66 65 len-=2; 67 66 } 68 -#endif 69 67 for(a=aliases;a;a=a->next) 70 68 if ((a->alias.len==len) && ((a->port==0) || (port==0) || 71 69 (a->port==port)) && ((a->proto==0) || (proto==0) ||

#### - added grep_sock_info and updated check_self to use it

Andrei Pelinescu-Onciul authored on 10/10/2004 16:19:00
Showing 1 changed files
 ... ... @@ -59,6 +59,13 @@ static inline int grep_aliases(char* name, int len, unsigned short port, 59 59 { 60 60 struct host_alias* a; 61 61 62 +#ifdef USE_IPV6 63 + if ((len>2)&&((*name)=='[')&&(name[len-1]==']')){ 64 + /* ipv6 reference, skip [] */ 65 + name++; 66 + len-=2; 67 + } 68 +#endif 62 69 for(a=aliases;a;a=a->next) 63 70 if ((a->alias.len==len) && ((a->port==0) || (port==0) || 64 71 (a->port==port)) && ((a->proto==0) || (proto==0) ||

#### - Spelling checked - READMEs updated

Jan Janak authored on 24/08/2004 08:45:09
Showing 1 changed files
 ... ... @@ -2,7 +2,7 @@ 2 2 * $Id$ 3 3 * 4 4 * 5 - * Copyright (C) 2001-2003 Fhg Fokus 5 + * Copyright (C) 2001-2003 FhG Fokus 6 6 * 7 7 * This file is part of ser, a free SIP server. 8 8 *

#### - aliases proto support

Andrei Pelinescu-Onciul authored on 21/10/2003 23:28:46
Showing 1 changed files

#### - checkself ipv6 and case insensitiveness fixes

Andrei Pelinescu-Onciul authored on 21/08/2003 15:34:27
Showing 1 changed files
 ... ... @@ -57,7 +57,8 @@ static inline int grep_aliases(char* name, int len, unsigned short port) 57 57 58 58 for(a=aliases;a;a=a->next) 59 59 #ifdef USE_TLS 60 - if ((a->alias.len==len) && ((a->port==0) || (port==0) || (port==tls_port_no) || 60 + if ((a->alias.len==len) && ((a->port==0) || (port==0) || 61 + (port==tls_port_no) || 61 62 #else 62 63 if ((a->alias.len==len) && ((a->port==0) || (port==0) || 63 64 #endif

#### - check_self matches TLS connections.

Jan Janak authored on 20/08/2003 12:58:06
Showing 1 changed files
 ... ... @@ -56,7 +56,11 @@ static inline int grep_aliases(char* name, int len, unsigned short port) 56 56 struct host_alias* a; 57 57 58 58 for(a=aliases;a;a=a->next) 59 +#ifdef USE_TLS 60 + if ((a->alias.len==len) && ((a->port==0) || (port==0) || (port==tls_port_no) || 61 +#else 59 62 if ((a->alias.len==len) && ((a->port==0) || (port==0) || 63 +#endif 60 64 (a->port==port)) && (strncasecmp(a->alias.s, name, len)==0)) 61 65 return 1; 62 66 return 0;

#### - replaced all mallocs/frees w/ pkg_malloc/pkg_free - minor lock_dealloc warning fixes

Andrei Pelinescu-Onciul authored on 19/03/2003 18:41:58
Showing 1 changed files
 ... ... @@ -25,11 +25,17 @@ 25 25 * along with this program; if not, write to the Free Software 26 26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 27 27 */ 28 +/* 29 + * History: 30 + * -------- 31 + * 2003-03-19 replaced all mallocs/frees w/ pkg_malloc/pkg_free (andrei) 32 + */ 28 33 29 34 30 35 31 36 #include "str.h" 32 37 #include "dprint.h" 38 +#include "mem/mem.h" 33 39 34 40 35 41 ... ... @@ -68,9 +74,9 @@ static inline int add_alias(char* name, int len, unsigned short port) 68 74 69 75 if ((port) && grep_aliases(name,len, port)) return 0; 70 76 a=0; 71 - a=(struct host_alias*)malloc(sizeof(struct host_alias)); 77 + a=(struct host_alias*)pkg_malloc(sizeof(struct host_alias)); 72 78 if(a==0) goto error; 73 - a->alias.s=(char*)malloc(len+1); 79 + a->alias.s=(char*)pkg_malloc(len+1); 74 80 if (a->alias.s==0) goto error; 75 81 a->alias.len=len; 76 82 memcpy(a->alias.s, name, len); ... ... @@ -81,7 +87,7 @@ static inline int add_alias(char* name, int len, unsigned short port) 81 87 return 1; 82 88 error: 83 89 LOG(L_ERR, "ERROR: add_alias: memory allocation error\n"); 84 - if (a) free(a); 90 + if (a) pkg_free(a); 85 91 return -1; 86 92 } 87 93

#### - myself matches now also the uri port - modified check_self, add_alias & grep_alias to accept port numbers - added loopback check - modified get_send_socket to return the first non loopback ipv4 interface if bind_address==0

Andrei Pelinescu-Onciul authored on 23/10/2002 15:12:20
Showing 1 changed files
 ... ... @@ -35,6 +35,7 @@ 35 35 36 36 struct host_alias{ 37 37 str alias; 38 + unsigned short port; 38 39 struct host_alias* next; 39 40 }; 40 41 ... ... @@ -43,13 +44,14 @@ extern struct host_alias* aliases; 43 44 44 45 45 46 46 -/* returns 1 if name is in the alias list*/ 47 -static inline int grep_aliases(char* name, int len) 47 +/* returns 1 if name is in the alias list; if port=0, port no is ignored*/ 48 +static inline int grep_aliases(char* name, int len, unsigned short port) 48 49 { 49 50 struct host_alias* a; 50 51 51 52 for(a=aliases;a;a=a->next) 52 - if ((a->alias.len==len) && (strncasecmp(a->alias.s, name, len)==0)) 53 + if ((a->alias.len==len) && ((a->port==0) || (port==0) || 54 + (a->port==port)) && (strncasecmp(a->alias.s, name, len)==0)) 53 55 return 1; 54 56 return 0; 55 57 } ... ... @@ -57,13 +59,14 @@ static inline int grep_aliases(char* name, int len) 57 59 58 60 59 61 /* adds an alias to the list (only if it isn't already there) 62 + * if port==0, the alias will match all the ports 60 63 * returns 1 if a new alias was added, 0 if the alias was already on the list 61 64 * and -1 on error */ 62 -static inline int add_alias(char* name, int len) 65 +static inline int add_alias(char* name, int len, unsigned short port) 63 66 { 64 67 struct host_alias* a; 65 68 66 - if (grep_aliases(name,len)) return 0; 69 + if ((port) && grep_aliases(name,len, port)) return 0; 67 70 a=0; 68 71 a=(struct host_alias*)malloc(sizeof(struct host_alias)); 69 72 if(a==0) goto error; ... ... @@ -72,6 +75,7 @@ static inline int add_alias(char* name, int len) 72 75 a->alias.len=len; 73 76 memcpy(a->alias.s, name, len); 74 77 a->alias.s[len]=0; /* null terminate for easier printing*/ 78 + a->port=port; 75 79 a->next=aliases; 76 80 aliases=a; 77 81 return 1;

#### GPLization banner introduced to *.[hc] files

Jiri Kuthan authored on 19/09/2002 12:23:52
Showing 1 changed files
 ... ... @@ -1,9 +1,33 @@ 1 1 /* 2 2 * $Id$ 3 3 * 4 + * 5 + * Copyright (C) 2001-2003 Fhg Fokus 6 + * 7 + * This file is part of ser, a free SIP server. 8 + * 9 + * ser is free software; you can redistribute it and/or modify 10 + * it under the terms of the GNU General Public License as published by 11 + * the Free Software Foundation; either version 2 of the License, or 12 + * (at your option) any later version 13 + * 14 + * For a license to use the ser software under conditions 15 + * other than those described here, or to purchase support for this 16 + * software, please contact iptel.org by e-mail at the following addresses: 17 + * info@iptel.org 18 + * 19 + * ser is distributed in the hope that it will be useful, 20 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 + * GNU General Public License for more details. 23 + * 24 + * You should have received a copy of the GNU General Public License 25 + * along with this program; if not, write to the Free Software 26 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 4 27 */ 5 28 6 29 30 + 7 31 #include "str.h" 8 32 #include "dprint.h" 9 33

#### - added aliases (names that ser will think are his own) - now the offical name will be put in sock_info[r] and the aliases in the. host_alias list. - added new script config. parameter: alias=

Andrei Pelinescu-Onciul authored on 20/08/2002 09:34:12
Showing 1 changed files
 1 1 new file mode 100644 ... ... @@ -0,0 +1,61 @@ 1 +/* 2 + * $Id$ 3 + * 4 + */ 5 + 6 + 7 +#include "str.h" 8 +#include "dprint.h" 9 + 10 + 11 + 12 +struct host_alias{ 13 + str alias; 14 + struct host_alias* next; 15 +}; 16 + 17 + 18 +extern struct host_alias* aliases; 19 + 20 + 21 + 22 +/* returns 1 if name is in the alias list*/ 23 +static inline int grep_aliases(char* name, int len) 24 +{ 25 + struct host_alias* a; 26 + 27 + for(a=aliases;a;a=a->next) 28 + if ((a->alias.len==len) && (strncasecmp(a->alias.s, name, len)==0)) 29 + return 1; 30 + return 0; 31 +} 32 + 33 + 34 + 35 +/* adds an alias to the list (only if it isn't already there) 36 + * returns 1 if a new alias was added, 0 if the alias was already on the list 37 + * and -1 on error */ 38 +static inline int add_alias(char* name, int len) 39 +{ 40 + struct host_alias* a; 41 + 42 + if (grep_aliases(name,len)) return 0; 43 + a=0; 44 + a=(struct host_alias*)malloc(sizeof(struct host_alias)); 45 + if(a==0) goto error; 46 + a->alias.s=(char*)malloc(len+1); 47 + if (a->alias.s==0) goto error; 48 + a->alias.len=len; 49 + memcpy(a->alias.s, name, len); 50 + a->alias.s[len]=0; /* null terminate for easier printing*/ 51 + a->next=aliases; 52 + aliases=a; 53 + return 1; 54 +error: 55 + LOG(L_ERR, "ERROR: add_alias: memory allocation error\n"); 56 + if (a) free(a); 57 + return -1; 58 +} 59 + 60 + 61 +