Browse code

*** empty log message ***

Bogdan-Andrei Iancu authored on 27/11/2001 18:49:24
Showing 4 changed files
... ...
@@ -119,7 +119,7 @@ error:
119 119
 
120 120
 
121 121
 
122
-struct cell*  build_cell( struct s_table* hash_table , struct sip_msg* p_msg )
122
+struct cell*  build_cell( struct sip_msg* p_msg )
123 123
 {
124 124
    struct cell*  new_cell;
125 125
    int                i;
... ...
@@ -123,7 +123,7 @@ struct s_table* init_hash_table();
123 123
 void                  free_hash_table( struct s_table* hash_table );
124 124
 
125 125
 void                free_cell( struct cell* dead_cell );
126
-struct cell*  build_cell( struct s_table* hash_table , struct sip_msg* p_msg );
126
+struct cell*  build_cell( struct sip_msg* p_msg );
127 127
 
128 128
 void remove_from_hash_table( struct s_table *hash_table,  struct cell * p_cell );
129 129
 void    insert_into_hash_table( struct s_table *hash_table,  struct cell * p_cell );
... ...
@@ -44,7 +44,7 @@ int t_add_transaction( struct s_table* hash_table , struct sip_msg* p_msg )
44 44
          return -1;
45 45
 
46 46
    /* creates a new transaction */
47
-   new_cell = build_cell( hash_table , p_msg ) ;
47
+   new_cell = build_cell( p_msg ) ;
48 48
    if  ( !new_cell )
49 49
       return -2;
50 50
    insert_into_hash_table( hash_table , new_cell );
51 51
new file mode 100644
... ...
@@ -0,0 +1,58 @@
1
+#ifndef _T_FUNCS_H
2
+#define _T_FUNCS_H
3
+
4
+#include "../../msg_parser.h"
5
+
6
+struct s_table;
7
+struct timer;
8
+struct entry;
9
+struct cell;
10
+
11
+#include "timer.h"
12
+#include "lock.h"
13
+#include "sip_msg.h"
14
+
15
+#define sh_malloc( size )     malloc(size)
16
+#define sh_free( ptr )           free(ptr)
17
+#define get_cseq( p_msg)    ((struct cseq_body*)p_msg->cseq->parsed)
18
+
19
+
20
+
21
+/* function returns:
22
+ *       0 - a new transaction was created
23
+ *      -1 - retransmission
24
+ *      -2 - error
25
+ */
26
+int  t_add_transaction( struct s_table* hash_table , struct sip_msg* p_msg );
27
+
28
+
29
+/* function returns:
30
+ *       0 - transaction wasn't found
31
+ *       1 - transaction found
32
+ */
33
+int  t_lookup_request( struct s_table* hash_table , struct sip_msg* p_msg );
34
+
35
+
36
+/* function returns:
37
+ *       0 - forward successfull
38
+ *      -1 - error during forward
39
+ */
40
+int t_forward( struct s_table* hash_table , struct sip_msg* p_msg , unsigned int dst_ip , unsigned int dst_port);
41
+
42
+
43
+
44
+/*  This function is called whenever a reply for our module is received; we need to register
45
+  *  this function on module initialization;
46
+  *  Returns :   1 - core router stops
47
+  *                    0 - core router relay statelessly
48
+  */
49
+int t_on_reply_received( struct s_table  *hash_table , struct sip_msg  *p_msg ) ;
50
+
51
+
52
+
53
+/* Retransmits the last sent inbound reply.
54
+  */
55
+int t_retransmit_reply( struct s_table * , struct sip_msg *  );
56
+
57
+
58
+#endif