#### 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,83 +0,0 @@ 1 -/* 2 - * Copyright (C) 2007 iptelorg GmbH 3 - * 4 - * Permission to use, copy, modify, and distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 - */ 16 - 17 -/** 18 - * @file 19 - * @brief Kamailio TLS support :: TLS hooks for modules 20 - * @ingroup tls 21 - * Module: @ref tls 22 - */ 23 - 24 - 25 -#include "tls_hooks.h" 26 -#include "tls_hooks_init.h" 27 -#include "globals.h" 28 - 29 -#ifdef TLS_HOOKS 30 - 31 -struct tls_hooks tls_hook= {0}; 32 - 33 -static int tls_hooks_loaded=0; 34 - 35 -int register_tls_hooks(struct tls_hooks* h) 36 -{ 37 - if (!tls_disable) { 38 - tls_hook=*h; 39 - tls_hooks_loaded++; 40 - return 0; 41 - } 42 - return -1; 43 -} 44 - 45 - 46 -int tls_init(struct socket_info* si) 47 -{ 48 - if (tls_hook.init_si) 49 - return tls_hook.init_si(si); 50 - return -1; 51 -} 52 - 53 -int tls_has_init_si() 54 -{ 55 - return (tls_hook.init_si!=0); 56 -} 57 - 58 -int init_tls() 59 -{ 60 - if (tls_hook.init) 61 - return tls_hook.init(); 62 - return 0; 63 -} 64 - 65 -int pre_init_tls() 66 -{ 67 - if (tls_hook.pre_init) 68 - return tls_hook.pre_init(); 69 - return 0; 70 -} 71 - 72 -void destroy_tls() 73 -{ 74 - if (tls_hook.destroy) 75 - tls_hook.destroy(); 76 -} 77 - 78 -int tls_loaded() 79 -{ 80 - return tls_hooks_loaded; 81 -} 82 - 83 -#endif /* TLS_HOOKS */

#### core: fixed misleading indentation for return statement

Daniel-Constantin Mierla authored on 15/09/2016 13:19:37
Showing 1 changed files
 ... ... @@ -1,5 +1,5 @@ 1 1  /* 2 - * Copyright (C) 2007 iptelorg GmbH  2 + * Copyright (C) 2007 iptelorg GmbH 3 3  * 4 4  * Permission to use, copy, modify, and distribute this software for any 5 5  * purpose with or without fee is hereby granted, provided that the above ... ... @@ -34,7 +34,7 @@ static int tls_hooks_loaded=0; 34 34   35 35  int register_tls_hooks(struct tls_hooks* h) 36 36  { 37 - if (!tls_disable){ 37 + if (!tls_disable) { 38 38  tls_hook=*h; 39 39  tls_hooks_loaded++; 40 40  return 0; ... ... @@ -47,7 +47,7 @@ int tls_init(struct socket_info* si) 47 47  { 48 48  if (tls_hook.init_si) 49 49  return tls_hook.init_si(si); 50 - return -1; 50 + return -1; 51 51  } 52 52   53 53  int tls_has_init_si()

#### tls: init tls hooks to {0}, avoiding fields enumeration

- if a new field is added, then should be no longer needed to update
initialization

Daniel-Constantin Mierla authored on 20/10/2015 17:44:47
Showing 1 changed files
 ... ... @@ -28,7 +28,7 @@ 28 28   29 29  #ifdef TLS_HOOKS 30 30   31 -struct tls_hooks tls_hook= {0,0,0,0,0,0,0,0}; 31 +struct tls_hooks tls_hook= {0}; 32 32   33 33  static int tls_hooks_loaded=0; 34 34 

#### core: tls hooks can execute a callback before modules init function is executed

- useful to prepare tls environment before a module might access it
- executed after modparam but before mod_init

Daniel-Constantin Mierla authored on 25/01/2015 09:57:00
Showing 1 changed files
 ... ... @@ -28,7 +28,7 @@ 28 28   29 29  #ifdef TLS_HOOKS 30 30   31 -struct tls_hooks tls_hook= {0, 0, 0, 0, 0 ,0 ,0}; 31 +struct tls_hooks tls_hook= {0,0,0,0,0,0,0,0}; 32 32   33 33  static int tls_hooks_loaded=0; 34 34   ... ... @@ -62,6 +62,13 @@ int init_tls() 62 62  return 0; 63 63  } 64 64   65 +int pre_init_tls() 66 +{ 67 + if (tls_hook.pre_init) 68 + return tls_hook.pre_init(); 69 + return 0; 70 +} 71 + 65 72  void destroy_tls() 66 73  { 67 74  if (tls_hook.destroy)

#### core Update headers, change "SIP-router" to "Kamailio", update doxygen file headers

Olle E. Johansson authored on 03/01/2015 14:15:58
Showing 1 changed files
 ... ... @@ -16,7 +16,7 @@ 16 16   17 17  /** 18 18  * @file 19 - * @brief SIP-router TLS support :: TLS hooks for modules 19 + * @brief Kamailio TLS support :: TLS hooks for modules 20 20  * @ingroup tls 21 21  * Module: @ref tls 22 22  */

#### Core Removed history, svn $id$ and doxygen udpates on the .c files

Olle E. Johansson authored on 03/01/2015 09:53:17
Showing 1 changed files
 ... ... @@ -1,6 +1,4 @@ 1 1  /* 2 - * $Id$ 3 - * 4 2  * Copyright (C) 2007 iptelorg GmbH  5 3  * 6 4  * Permission to use, copy, modify, and distribute this software for any ... ... @@ -15,13 +13,6 @@ 15 13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 15  */ 18 -/* 19 - * tls hooks for modules 20 - * 21 - * History: 22 - * -------- 23 - * 2007-02-09 created by andrei 24 - */ 25 16   26 17  /** 27 18  * @file

#### tcp: change tls send callback interface

Instead of 2 different tls send callbacks (with a 3rd one needed),
switch to a different model: 1 tls callback that is supposed to
replace the passed buffer with a tls processed version of it.
This simplifies the tls code and more importantly doesn't require
that the tls send code has very detailed knowledge about the tcp
state machine. Some of the saved complexity moved from the tls
module to the tcp code, but at least this way on changes there's
only one place to update.
The tls callbacks for reading and sending are now very different:
while the send callback has become now more of an encoder
itself. While this is not very consistent it does saves unneeded
memory copies.

Andrei Pelinescu-Onciul authored on 23/06/2010 21:17:15
Showing 1 changed files
 ... ... @@ -37,7 +37,7 @@ 37 37   38 38  #ifdef TLS_HOOKS 39 39   40 -struct tls_hooks tls_hook= {0, 0, 0, 0, 0 ,0 ,0 ,0 ,0 }; 40 +struct tls_hooks tls_hook= {0, 0, 0, 0, 0 ,0 ,0}; 41 41   42 42  static int tls_hooks_loaded=0; 43 43 

oej authored on 22/10/2009 17:59:29
Showing 1 changed files
 ... ... @@ -23,11 +23,11 @@ 23 23  * 2007-02-09 created by andrei 24 24  */ 25 25   26 -/*! 27 - * \file 28 - * \brief SIP-router TLS support :: TLS hooks for modules 29 - * \ingroup tls 30 - * Module: \ref tls 26 +/** 27 + * @file 28 + * @brief SIP-router TLS support :: TLS hooks for modules 29 + * @ingroup tls 30 + * Module: @ref tls 31 31  */ 32 32   33 33 

 ... ... @@ -23,6 +23,14 @@ 23 23  * 2007-02-09 created by andrei 24 24  */ 25 25   26 +/*! 27 + * \file 28 + * \brief SIP-router TLS support :: TLS hooks for modules 29 + * \ingroup tls 30 + * Module: \ref tls 31 + */ 32 + 33 + 26 34  #include "tls_hooks.h" 27 35  #include "tls_hooks_init.h" 28 36  #include "globals.h"
 1 1 new file mode 100644 ... ... @@ -0,0 +1,77 @@ 1 +/* 2 + * $Id$ 3 + * 4 + * Copyright (C) 2007 iptelorg GmbH  5 + * 6 + * Permission to use, copy, modify, and distribute this software for any 7 + * purpose with or without fee is hereby granted, provided that the above 8 + * copyright notice and this permission notice appear in all copies. 9 + * 10 + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 + */ 18 +/* 19 + * tls hooks for modules 20 + * 21 + * History: 22 + * -------- 23 + * 2007-02-09 created by andrei 24 + */ 25 + 26 +#include "tls_hooks.h" 27 +#include "tls_hooks_init.h" 28 +#include "globals.h" 29 + 30 +#ifdef TLS_HOOKS 31 + 32 +struct tls_hooks tls_hook= {0, 0, 0, 0, 0 ,0 ,0 ,0 ,0 }; 33 + 34 +static int tls_hooks_loaded=0; 35 + 36 +int register_tls_hooks(struct tls_hooks* h) 37 +{ 38 + if (!tls_disable){ 39 + tls_hook=*h; 40 + tls_hooks_loaded++; 41 + return 0; 42 + } 43 + return -1; 44 +} 45 + 46 + 47 +int tls_init(struct socket_info* si) 48 +{ 49 + if (tls_hook.init_si) 50 + return tls_hook.init_si(si); 51 + return -1; 52 +} 53 + 54 +int tls_has_init_si() 55 +{ 56 + return (tls_hook.init_si!=0); 57 +} 58 + 59 +int init_tls() 60 +{ 61 + if (tls_hook.init) 62 + return tls_hook.init(); 63 + return 0; 64 +} 65 + 66 +void destroy_tls() 67 +{ 68 + if (tls_hook.destroy) 69 + tls_hook.destroy(); 70 +} 71 + 72 +int tls_loaded() 73 +{ 74 + return tls_hooks_loaded; 75 +} 76 + 77 +#endif /* TLS_HOOKS */