Bläddra i källkod

tsilo: prefixed module's functions with ts_

Federico Cabiddu 11 år sedan
förälder
incheckning
a135e7956f

+ 24 - 24
modules/tsilo/README

@@ -10,7 +10,7 @@ Federico Cabiddu
 
 
    <[email protected]>
    <[email protected]>
 
 
-   Copyright © 2014 Federico Cabiddu
+   Copyright © 2014 Federico Cabiddu
      __________________________________________________________________
      __________________________________________________________________
 
 
    Table of Contents
    Table of Contents
@@ -29,18 +29,18 @@ Federico Cabiddu
 
 
         4. Functions
         4. Functions
 
 
-              4.1. t_store()
-              4.2. t_append(domain, ruri)
-              4.3. t_append_to(tindex, tlabel, domain)
+              4.1. ts_store()
+              4.2. ts_append(domain, ruri)
+              4.3. ts_append_to(tindex, tlabel, domain)
 
 
         5. Statistics
         5. Statistics
 
 
    List of Examples
    List of Examples
 
 
    1.1. Set hash_size parameter
    1.1. Set hash_size parameter
-   1.2. t_store usage
-   1.3. t_append usage
-   1.4. t_append_to usage
+   1.2. ts_store usage
+   1.3. ts_append usage
+   1.4. ts_append_to usage
 
 
 Chapter 1. Admin Guide
 Chapter 1. Admin Guide
 
 
@@ -58,9 +58,9 @@ Chapter 1. Admin Guide
 
 
    4. Functions
    4. Functions
 
 
-        4.1. t_store()
-        4.2. t_append(domain, ruri)
-        4.3. t_append_to(tindex, tlabel, domain)
+        4.1. ts_store()
+        4.2. ts_append(domain, ruri)
+        4.3. ts_append_to(tindex, tlabel, domain)
 
 
    5. Statistics
    5. Statistics
 
 
@@ -70,7 +70,7 @@ Chapter 1. Admin Guide
    Platform. It stores in an internal table transactions for an user and
    Platform. It stores in an internal table transactions for an user and
    add branches to them if new contacts are added.
    add branches to them if new contacts are added.
 
 
-   For each message, the modules stores “Request-URI� (“R-URI�), URI and
+   For each message, the modules stores "Request-URI" ("R-URI"), URI and
    the internal transaction index and label.
    the internal transaction index and label.
 
 
    When the transaction is destroyed (by the TM module, the transaction is
    When the transaction is destroyed (by the TM module, the transaction is
@@ -105,7 +105,7 @@ Chapter 1. Admin Guide
    must be a power of two, otherwise it will be rounded down to the
    must be a power of two, otherwise it will be rounded down to the
    nearest power of two.
    nearest power of two.
 
 
-   Default value is “2048�.
+   Default value is "2048".
 
 
    Example 1.1. Set hash_size parameter
    Example 1.1. Set hash_size parameter
 ...
 ...
@@ -114,26 +114,26 @@ modparam("tsilo", "hash_size", 1024)
 
 
 4. Functions
 4. Functions
 
 
-   4.1. t_store()
-   4.2. t_append(domain, ruri)
-   4.3. t_append_to(tindex, tlabel, domain)
+   4.1. ts_store()
+   4.2. ts_append(domain, ruri)
+   4.3. ts_append_to(tindex, tlabel, domain)
 
 
-4.1. t_store()
+4.1. ts_store()
 
 
    The method stores r-uri, tindex and tlabel of the current transaction.
    The method stores r-uri, tindex and tlabel of the current transaction.
 
 
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
 
 
-   Example 1.2. t_store usage
+   Example 1.2. ts_store usage
 ...
 ...
 if (is_method("INVITE")) {
 if (is_method("INVITE")) {
         if (t_newtran()) {
         if (t_newtran()) {
-                t_store();
+                ts_store();
         }
         }
 }
 }
 ...
 ...
 
 
-4.2. t_append(domain, ruri)
+4.2. ts_append(domain, ruri)
 
 
    The method add branches to all the stored transactions for the SIP ruri
    The method add branches to all the stored transactions for the SIP ruri
    passed as parameter, performing a contact lookup on the table specified
    passed as parameter, performing a contact lookup on the table specified
@@ -149,14 +149,14 @@ if (is_method("INVITE")) {
 
 
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
 
 
-   Example 1.3. t_append usage
+   Example 1.3. ts_append usage
 ...
 ...
 if (is_method("REGISTER")) {
 if (is_method("REGISTER")) {
-        t_append("location", "$tu");
+        ts_append("location", "$tu");
 }
 }
 ...
 ...
 
 
-4.3. t_append_to(tindex, tlabel, domain)
+4.3. ts_append_to(tindex, tlabel, domain)
 
 
    The method add branches to the transaction identified by tindex and
    The method add branches to the transaction identified by tindex and
    tlabel, performing a contacts lookup on the table specified by the
    tlabel, performing a contacts lookup on the table specified by the
@@ -173,12 +173,12 @@ if (is_method("REGISTER")) {
 
 
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
 
 
-   Example 1.4. t_append_to usage
+   Example 1.4. ts_append_to usage
 ...
 ...
 if (is_method("REGISTER")) {
 if (is_method("REGISTER")) {
         $var(tindex) = ...
         $var(tindex) = ...
         $var(tlabel) = ...
         $var(tlabel) = ...
-        t_append_to("$var(tindex)", "$var(tlabel", "location");
+        ts_append_to("$var(tindex)", "$var(tlabel", "location");
 }
 }
 ...
 ...
 
 

+ 9 - 9
modules/tsilo/doc/tsilo_admin.xml

@@ -96,7 +96,7 @@ modparam("tsilo", "hash_size", 1024)
 	<section>
 	<section>
 	<title>Functions</title>
 	<title>Functions</title>
 	<section>
 	<section>
-		<title><function moreinfo="none">t_store()</function></title>
+		<title><function moreinfo="none">ts_store()</function></title>
 		<para>
 		<para>
 		The method stores r-uri, tindex and tlabel of the current transaction.
 		The method stores r-uri, tindex and tlabel of the current transaction.
 		</para>
 		</para>
@@ -104,12 +104,12 @@ modparam("tsilo", "hash_size", 1024)
 		This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
 		This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
 		</para>
 		</para>
 		<example>
 		<example>
-		<title><function>t_store</function> usage</title>
+		<title><function>ts_store</function> usage</title>
 		<programlisting format="linespecific">
 		<programlisting format="linespecific">
 ...
 ...
 if (is_method("INVITE")) {
 if (is_method("INVITE")) {
 	if (t_newtran()) {
 	if (t_newtran()) {
-		t_store();
+		ts_store();
 	}
 	}
 }
 }
 ...
 ...
@@ -117,7 +117,7 @@ if (is_method("INVITE")) {
 		</example>
 		</example>
 	</section>
 	</section>
 	<section>
 	<section>
-		<title><function moreinfo="none">t_append(domain, ruri)</function></title>
+		<title><function moreinfo="none">ts_append(domain, ruri)</function></title>
 		<para>
 		<para>
 		The method add branches to all the stored transactions for the &sip;
 		The method add branches to all the stored transactions for the &sip;
 		ruri passed as parameter, performing a contact lookup on the table specified by
 		ruri passed as parameter, performing a contact lookup on the table specified by
@@ -144,18 +144,18 @@ if (is_method("INVITE")) {
 		This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
 		This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
 		</para>
 		</para>
 		<example>
 		<example>
-		<title><function>t_append</function> usage</title>
+		<title><function>ts_append</function> usage</title>
 		<programlisting format="linespecific">
 		<programlisting format="linespecific">
 ...
 ...
 if (is_method("REGISTER")) {
 if (is_method("REGISTER")) {
-	t_append("location", "$tu");
+	ts_append("location", "$tu");
 }
 }
 ...
 ...
 </programlisting>
 </programlisting>
 		</example>
 		</example>
 	</section>
 	</section>
 	<section>
 	<section>
-		<title><function moreinfo="none">t_append_to(tindex, tlabel, domain)</function></title>
+		<title><function moreinfo="none">ts_append_to(tindex, tlabel, domain)</function></title>
 		<para>
 		<para>
 		The method add branches to the transaction identified by tindex and tlabel,
 		The method add branches to the transaction identified by tindex and tlabel,
 		performing a contacts lookup on the table specified by the domain parameter.
 		performing a contacts lookup on the table specified by the domain parameter.
@@ -186,13 +186,13 @@ if (is_method("REGISTER")) {
 		This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
 		This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
 		</para>
 		</para>
 		<example>
 		<example>
-		<title><function>t_append_to</function> usage</title>
+		<title><function>ts_append_to</function> usage</title>
 		<programlisting format="linespecific">
 		<programlisting format="linespecific">
 ...
 ...
 if (is_method("REGISTER")) {
 if (is_method("REGISTER")) {
 	$var(tindex) = ...
 	$var(tindex) = ...
 	$var(tlabel) = ...
 	$var(tlabel) = ...
-	t_append_to("$var(tindex)", "$var(tlabel", "location");
+	ts_append_to("$var(tindex)", "$var(tlabel", "location");
 }
 }
 ...
 ...
 </programlisting>
 </programlisting>

+ 4 - 4
modules/tsilo/t_append.c → modules/tsilo/ts_append.c

@@ -35,9 +35,9 @@
 #include "../../parser/contact/parse_contact.h"
 #include "../../parser/contact/parse_contact.h"
 #include "tsilo.h"
 #include "tsilo.h"
 #include "ts_hash.h"
 #include "ts_hash.h"
-#include "t_append.h"
+#include "ts_append.h"
 
 
-int t_append(struct sip_msg* msg, str *ruri, char *table) {
+int ts_append(struct sip_msg* msg, str *ruri, char *table) {
 	ts_urecord_t* _r;
 	ts_urecord_t* _r;
 	ts_transaction_t* ptr;
 	ts_transaction_t* ptr;
 
 
@@ -57,7 +57,7 @@ int t_append(struct sip_msg* msg, str *ruri, char *table) {
 
 
 	while(ptr) {
 	while(ptr) {
 		LM_DBG("transaction %u:%u found for %.*s, going to append branches\n",ptr->tindex, ptr->tlabel, ruri->len, ruri->s);
 		LM_DBG("transaction %u:%u found for %.*s, going to append branches\n",ptr->tindex, ptr->tlabel, ruri->len, ruri->s);
-		t_append_to(msg, ptr->tindex, ptr->tlabel, table);
+		ts_append_to(msg, ptr->tindex, ptr->tlabel, table);
 		ptr = ptr->next;
 		ptr = ptr->next;
 	}
 	}
 
 
@@ -66,7 +66,7 @@ int t_append(struct sip_msg* msg, str *ruri, char *table) {
 	return 1;
 	return 1;
 }
 }
 
 
-int t_append_to(struct sip_msg* msg, int tindex, int tlabel, char *table) {
+int ts_append_to(struct sip_msg* msg, int tindex, int tlabel, char *table) {
 	struct cell     *t;
 	struct cell     *t;
 	struct sip_msg *orig_msg;
 	struct sip_msg *orig_msg;
 
 

+ 4 - 4
modules/tsilo/t_append.h → modules/tsilo/ts_append.h

@@ -19,10 +19,10 @@
  *
  *
  */
  */
 
 
-#ifndef _T_APPEND_H
-#define _T_APPEND_H
+#ifndef _TS_APPEND_H
+#define _TS_APPEND_H
 
 
-int t_append(struct sip_msg* msg, str *ruri, char *table);
-int t_append_to(struct sip_msg* msg, int tindex, int tlabel, char *table);
+int ts_append(struct sip_msg* msg, str *ruri, char *table);
+int ts_append_to(struct sip_msg* msg, int tindex, int tlabel, char *table);
 
 
 #endif
 #endif

+ 2 - 2
modules/tsilo/t_store.c → modules/tsilo/ts_store.c

@@ -35,9 +35,9 @@
 #include "../../parser/contact/parse_contact.h"
 #include "../../parser/contact/parse_contact.h"
 #include "tsilo.h"
 #include "tsilo.h"
 #include "ts_hash.h"
 #include "ts_hash.h"
-#include "t_store.h"
+#include "ts_store.h"
 
 
-int t_store(struct sip_msg* msg) {
+int ts_store(struct sip_msg* msg) {
 	struct cell     *t;
 	struct cell     *t;
 	str ruri;
 	str ruri;
 	ts_urecord_t* r;
 	ts_urecord_t* r;

+ 3 - 3
modules/tsilo/t_store.h → modules/tsilo/ts_store.h

@@ -19,9 +19,9 @@
  *
  *
  */
  */
 
 
-#ifndef _T_STORE_H
-#define _T_STORE_H
+#ifndef _TS_STORE_H
+#define _TS_STORE_H
 
 
-int t_store(struct sip_msg* msg);
+int ts_store(struct sip_msg* msg);
 
 
 #endif
 #endif

+ 20 - 20
modules/tsilo/tsilo.c

@@ -35,8 +35,8 @@
 
 
 #include "ts_hash.h"
 #include "ts_hash.h"
 #include "ts_handlers.h"
 #include "ts_handlers.h"
-#include "t_append.h"
-#include "t_store.h"
+#include "ts_append.h"
+#include "ts_store.h"
 
 
 MODULE_VERSION
 MODULE_VERSION
 
 
@@ -53,20 +53,20 @@ static int hash_size = 2048;
 static int mod_init(void);
 static int mod_init(void);
 static void destroy(void);
 static void destroy(void);
 
 
-static int w_t_append_to(struct sip_msg* msg, char *idx, char *lbl, char *d);
-static int fixup_t_append_to(void** param, int param_no);
-static int w_t_append(struct sip_msg* _msg, char *_table, char *_ruri);
-static int fixup_t_append(void** param, int param_no);
+static int w_ts_append_to(struct sip_msg* msg, char *idx, char *lbl, char *d);
+static int fixup_ts_append_to(void** param, int param_no);
+static int w_ts_append(struct sip_msg* _msg, char *_table, char *_ruri);
+static int fixup_ts_append(void** param, int param_no);
 
 
-static int w_t_store(struct sip_msg* msg);
+static int w_ts_store(struct sip_msg* msg);
 
 
 
 
 static cmd_export_t cmds[]={
 static cmd_export_t cmds[]={
-	{"t_append_to", (cmd_function)w_t_append_to,  3,
-		fixup_t_append_to, REQUEST_ROUTE | FAILURE_ROUTE },
-	{"t_append", (cmd_function)w_t_append,  2,
-		fixup_t_append, REQUEST_ROUTE | FAILURE_ROUTE },
-	{"t_store", (cmd_function)w_t_store,  0,
+	{"ts_append_to", (cmd_function)w_ts_append_to,  3,
+		fixup_ts_append_to, REQUEST_ROUTE | FAILURE_ROUTE },
+	{"ts_append", (cmd_function)w_ts_append,  2,
+		fixup_ts_append, REQUEST_ROUTE | FAILURE_ROUTE },
+	{"ts_store", (cmd_function)w_ts_store,  0,
 		0 , REQUEST_ROUTE | FAILURE_ROUTE },
 		0 , REQUEST_ROUTE | FAILURE_ROUTE },
 	{0,0,0,0,0}
 	{0,0,0,0,0}
 };
 };
@@ -151,7 +151,7 @@ static void destroy(void)
  *
  *
  */
  */
 
 
-static int fixup_t_append_to(void** param, int param_no)
+static int fixup_ts_append_to(void** param, int param_no)
 {
 {
 	if (param_no==1 || param_no==2) {
 	if (param_no==1 || param_no==2) {
 		return fixup_igp_null(param, 1);
 		return fixup_igp_null(param, 1);
@@ -167,7 +167,7 @@ static int fixup_t_append_to(void** param, int param_no)
 	return 0;
 	return 0;
 }
 }
 
 
-static int fixup_t_append(void** param, int param_no)
+static int fixup_ts_append(void** param, int param_no)
 {
 {
 	if (param_no==1) {
 	if (param_no==1) {
 		if(strlen((char*)*param)<=1 && (*(char*)(*param)==0 || *(char*)(*param)=='0')) {
 		if(strlen((char*)*param)<=1 && (*(char*)(*param)==0 || *(char*)(*param)=='0')) {
@@ -186,7 +186,7 @@ static int fixup_t_append(void** param, int param_no)
 /**
 /**
  *
  *
  */
  */
-static int w_t_append(struct sip_msg* _msg, char *_table, char *_ruri)
+static int w_ts_append(struct sip_msg* _msg, char *_table, char *_ruri)
 {
 {
 	str ruri = {0};
 	str ruri = {0};
 
 
@@ -194,12 +194,12 @@ static int w_t_append(struct sip_msg* _msg, char *_table, char *_ruri)
 		LM_ERR("invalid ruri parameter\n");
 		LM_ERR("invalid ruri parameter\n");
 		return -1;
 		return -1;
 	}
 	}
-	return t_append(_msg, &ruri, _table);
+	return ts_append(_msg, &ruri, _table);
 }
 }
 /**
 /**
  *
  *
  */
  */
-static int w_t_append_to(struct sip_msg* msg, char *idx, char *lbl, char *table)
+static int w_ts_append_to(struct sip_msg* msg, char *idx, char *lbl, char *table)
 {
 {
 	unsigned int tindex;
 	unsigned int tindex;
 	unsigned int tlabel;
 	unsigned int tlabel;
@@ -214,13 +214,13 @@ static int w_t_append_to(struct sip_msg* msg, char *idx, char *lbl, char *table)
 		return -1;
 		return -1;
 	}
 	}
 
 
-	return t_append_to(msg, tindex, tlabel, table);
+	return ts_append_to(msg, tindex, tlabel, table);
 }
 }
 
 
 /**
 /**
  *
  *
  */
  */
-static int w_t_store(struct sip_msg* msg)
+static int w_ts_store(struct sip_msg* msg)
 {
 {
-	return t_store(msg);
+	return ts_store(msg);
 }
 }

+ 2 - 2
modules/tsilo/tsilo.h

@@ -20,8 +20,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
  */
 
 
-#ifndef _TM_APPEND_MOD_H_
-#define _TM_APPEND_MOD_H_
+#ifndef _TSILO_MOD_H_
+#define _TSILO_MOD_H_
 
 
 #include "../../modules/tm/tm_load.h"
 #include "../../modules/tm/tm_load.h"
 #include "../../modules/registrar/api.h"
 #include "../../modules/registrar/api.h"