Browse code

modules_k/*: moved k modules in directory modules/

Daniel-Constantin Mierla authored on 20/01/2013 11:57:52
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,174 +0,0 @@
1
-/* $Id$
2
- *
3
- * Copyright (C) 2006-2007 VozTelecom Sistemas S.L
4
- *
5
- * This file is part of Kamailio, a free SIP server.
6
- *
7
- * Kamailio is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License as published by
9
- * the Free Software Foundation; either version 2 of the License, or
10
- * (at your option) any later version
11
- *
12
- * Kamailio is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License 
18
- * along with this program; if not, write to the Free Software 
19
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
- */
21
-
22
-/*
23
- * =====================================================================================
24
- * 
25
- *        Filename:  encode_content_type.c
26
- * 
27
- *     Description:  [en|de]code content type
28
- * 
29
- *         Version:  1.0
30
- *         Created:  21/11/05 20:40:25 CET
31
- *        Revision:  none
32
- *        Compiler:  gcc
33
- * 
34
- *          Author:  Elias Baixas (EB), elias@conillera.net
35
- *         Company:  VozTele.com
36
- * 
37
- * =====================================================================================
38
- */
39
-
40
-#define _GNU_SOURCE
41
-#include <stdio.h>
42
-#include <netinet/in.h>
43
-#include <string.h>
44
-#include "../../parser/parse_content.h"
45
-#include "encode_content_type.h"
46
-
47
-int encode_content_type(char *hdrstart,int hdrlen,unsigned int bodi,char *where)
48
-{
49
-   return encode_mime_type(hdrstart,hdrlen,bodi,where);
50
-}
51
-
52
-int print_encoded_content_type(FILE* fd,char *hdr,int hdrlen,unsigned char* payload,int paylen,char *prefix)
53
-{
54
-   unsigned int type;
55
-   memcpy(&type,payload,sizeof(unsigned int));
56
-   return print_encoded_mime_type(fd,hdr,hdrlen,&type,paylen,prefix);
57
-}
58
-
59
-int encode_accept(char *hdrstart,int hdrlen,unsigned int *bodi,char *where)
60
-{
61
-   int i;
62
-
63
-   for(i=0;bodi[i]!=0;i++){
64
-      encode_mime_type(hdrstart,hdrlen,bodi[i],&where[1+i*sizeof(unsigned int)]);
65
-   }
66
-   where[0]=(unsigned char)i;
67
-
68
-   return 1+i*sizeof(unsigned int);
69
-}
70
-
71
-int print_encoded_accept(FILE* fd,char *hdr,int hdrlen,unsigned char* payload,int paylen,char *prefix)
72
-{
73
-   int i;
74
-   unsigned int type;
75
-   for(i=0;i<payload[0];i++){
76
-      memcpy(&type,&payload[1+i*sizeof(unsigned int)],sizeof(unsigned int));
77
-      print_encoded_mime_type(fd,hdr,hdrlen,&type,4,prefix);
78
-   }
79
-   return 1;
80
-
81
-}
82
-
83
-int encode_mime_type(char *hdrstart,int hdrlen,unsigned int bodi,char *where)
84
-{
85
-   unsigned int type;
86
-
87
-   type=htonl(bodi);
88
-   memcpy(where,&type,sizeof(unsigned int));
89
-
90
-   return sizeof(int);
91
-}
92
-
93
-int print_encoded_mime_type(FILE *fd,char *hdr,int hdrlen,unsigned int* payload,int paylen,char *prefix)
94
-{
95
-   unsigned int type;
96
-   char *chtype,*chsubtype;
97
-
98
-   type=ntohl(*payload);
99
-
100
-   switch(type>>16){
101
-      case TYPE_TEXT:
102
-	 chtype="text";
103
-	 break;
104
-      case TYPE_MESSAGE:
105
-	 chtype="message";
106
-	 break;
107
-      case TYPE_APPLICATION:
108
-	 chtype="application";
109
-	 break;
110
-      case TYPE_MULTIPART:
111
-	 chtype="multipart";
112
-	 break;
113
-      case TYPE_ALL:
114
-	 chtype="all";
115
-	 break;
116
-      case TYPE_UNKNOWN:
117
-	 chtype="unknown";
118
-	 break;
119
-      default:
120
-	chtype="(didn't know this type existed)";
121
-	break;
122
-   }
123
-
124
-   switch(type&0xFF){
125
-      case SUBTYPE_PLAIN:
126
-	 chsubtype="SUBTYPE_PLAIN";
127
-	 break;
128
-      case SUBTYPE_CPIM:
129
-	 chsubtype="SUBTYPE_CPIM";
130
-	 break;
131
-      case SUBTYPE_SDP:
132
-	 chsubtype="SUBTYPE_SDP";
133
-	 break;
134
-      case SUBTYPE_CPLXML:
135
-	 chsubtype="SUBTYPE_CPLXML";
136
-	 break;
137
-      case SUBTYPE_PIDFXML:
138
-	 chsubtype="SUBTYPE_PIDFXML";
139
-	 break;
140
-      case SUBTYPE_RLMIXML:
141
-	 chsubtype="SUBTYPE_RLMIXML";
142
-	 break;
143
-      case SUBTYPE_RELATED:
144
-	 chsubtype="SUBTYPE_RELATED";
145
-	 break;
146
-      case SUBTYPE_LPIDFXML:
147
-	 chsubtype="SUBTYPE_LPIDFXML";
148
-	 break;
149
-      case SUBTYPE_XPIDFXML:
150
-	 chsubtype="SUBTYPE_XPIDFXML";
151
-	 break;
152
-      case SUBTYPE_WATCHERINFOXML:
153
-	 chsubtype="SUBTYPE_WATCHERINFOXML";
154
-	 break;
155
-      case SUBTYPE_EXTERNAL_BODY:
156
-	 chsubtype="SUBTYPE_EXTERNAL_BODY";
157
-	 break;
158
-      case SUBTYPE_XML_MSRTC_PIDF:
159
-	 chsubtype="SUBTYPE_XML_MSRTC_PIDF";
160
-	 break;
161
-      case SUBTYPE_ALL:
162
-	 chsubtype="SUBTYPE_ALL";
163
-	 break;
164
-      case SUBTYPE_UNKNOWN:
165
-	 chsubtype="SUBTYPE_UNKNOWN";
166
-	 break;
167
-      default:
168
-	 chsubtype="(didnt know this subtype existed)";
169
-   }
170
-
171
-   fprintf(fd,"%sTYPE:[%s]\n",prefix,chtype);
172
-   fprintf(fd,"%sSUBTYPE:[%s]\n",prefix,chsubtype);
173
-   return 0;
174
-}
Browse code

Replaced dprintf for fprintf (dprintf is somewhat gnu-specific and does not compile on Mac). even though it was just used for debugging (not on the module) it prevented compilation

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5192 689a6050-402a-0410-94f2-e92a70836424

Elias Baixas authored on 13/11/2008 10:18:48
Showing 1 changed files
... ...
@@ -49,7 +49,7 @@ int encode_content_type(char *hdrstart,int hdrlen,unsigned int bodi,char *where)
49 49
    return encode_mime_type(hdrstart,hdrlen,bodi,where);
50 50
 }
51 51
 
52
-int print_encoded_content_type(int fd,char *hdr,int hdrlen,unsigned char* payload,int paylen,char *prefix)
52
+int print_encoded_content_type(FILE* fd,char *hdr,int hdrlen,unsigned char* payload,int paylen,char *prefix)
53 53
 {
54 54
    unsigned int type;
55 55
    memcpy(&type,payload,sizeof(unsigned int));
... ...
@@ -68,7 +68,7 @@ int encode_accept(char *hdrstart,int hdrlen,unsigned int *bodi,char *where)
68 68
    return 1+i*sizeof(unsigned int);
69 69
 }
70 70
 
71
-int print_encoded_accept(int fd,char *hdr,int hdrlen,unsigned char* payload,int paylen,char *prefix)
71
+int print_encoded_accept(FILE* fd,char *hdr,int hdrlen,unsigned char* payload,int paylen,char *prefix)
72 72
 {
73 73
    int i;
74 74
    unsigned int type;
... ...
@@ -90,7 +90,7 @@ int encode_mime_type(char *hdrstart,int hdrlen,unsigned int bodi,char *where)
90 90
    return sizeof(int);
91 91
 }
92 92
 
93
-int print_encoded_mime_type(int fd,char *hdr,int hdrlen,unsigned int* payload,int paylen,char *prefix)
93
+int print_encoded_mime_type(FILE *fd,char *hdr,int hdrlen,unsigned int* payload,int paylen,char *prefix)
94 94
 {
95 95
    unsigned int type;
96 96
    char *chtype,*chsubtype;
... ...
@@ -168,7 +168,7 @@ int print_encoded_mime_type(int fd,char *hdr,int hdrlen,unsigned int* payload,in
168 168
 	 chsubtype="(didnt know this subtype existed)";
169 169
    }
170 170
 
171
-   dprintf(fd,"%sTYPE:[%s]\n",prefix,chtype);
172
-   dprintf(fd,"%sSUBTYPE:[%s]\n",prefix,chsubtype);
171
+   fprintf(fd,"%sTYPE:[%s]\n",prefix,chtype);
172
+   fprintf(fd,"%sSUBTYPE:[%s]\n",prefix,chsubtype);
173 173
    return 0;
174 174
 }
Browse code

- change name in copyright headers

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@4518 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt authored on 28/07/2008 15:39:28
Showing 1 changed files
... ...
@@ -2,14 +2,14 @@
2 2
  *
3 3
  * Copyright (C) 2006-2007 VozTelecom Sistemas S.L
4 4
  *
5
- * This file is part of openser, a free SIP server.
5
+ * This file is part of Kamailio, a free SIP server.
6 6
  *
7
- * openser is free software; you can redistribute it and/or modify
7
+ * Kamailio is free software; you can redistribute it and/or modify
8 8
  * it under the terms of the GNU General Public License as published by
9 9
  * the Free Software Foundation; either version 2 of the License, or
10 10
  * (at your option) any later version
11 11
  *
12
- * openser is distributed in the hope that it will be useful,
12
+ * Kamailio is distributed in the hope that it will be useful,
13 13
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 14
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 15
  * GNU General Public License for more details.
Browse code

- added license and copyright

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@1819 689a6050-402a-0410-94f2-e92a70836424

Daniel-Constantin Mierla authored on 11/03/2007 19:20:59
Showing 1 changed files
... ...
@@ -1,4 +1,24 @@
1
-/* $Id$ */
1
+/* $Id$
2
+ *
3
+ * Copyright (C) 2006-2007 VozTelecom Sistemas S.L
4
+ *
5
+ * This file is part of openser, a free SIP server.
6
+ *
7
+ * openser is free software; you can redistribute it and/or modify
8
+ * it under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation; either version 2 of the License, or
10
+ * (at your option) any later version
11
+ *
12
+ * openser is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License 
18
+ * along with this program; if not, write to the Free Software 
19
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
+ */
21
+
2 22
 /*
3 23
  * =====================================================================================
4 24
  * 
Browse code

Added code files for SEAS module

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@1448 689a6050-402a-0410-94f2-e92a70836424

Elias Baixas authored on 22/12/2006 17:07:44
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,154 @@
1
+/* $Id$ */
2
+/*
3
+ * =====================================================================================
4
+ * 
5
+ *        Filename:  encode_content_type.c
6
+ * 
7
+ *     Description:  [en|de]code content type
8
+ * 
9
+ *         Version:  1.0
10
+ *         Created:  21/11/05 20:40:25 CET
11
+ *        Revision:  none
12
+ *        Compiler:  gcc
13
+ * 
14
+ *          Author:  Elias Baixas (EB), elias@conillera.net
15
+ *         Company:  VozTele.com
16
+ * 
17
+ * =====================================================================================
18
+ */
19
+
20
+#define _GNU_SOURCE
21
+#include <stdio.h>
22
+#include <netinet/in.h>
23
+#include <string.h>
24
+#include "../../parser/parse_content.h"
25
+#include "encode_content_type.h"
26
+
27
+int encode_content_type(char *hdrstart,int hdrlen,unsigned int bodi,char *where)
28
+{
29
+   return encode_mime_type(hdrstart,hdrlen,bodi,where);
30
+}
31
+
32
+int print_encoded_content_type(int fd,char *hdr,int hdrlen,unsigned char* payload,int paylen,char *prefix)
33
+{
34
+   unsigned int type;
35
+   memcpy(&type,payload,sizeof(unsigned int));
36
+   return print_encoded_mime_type(fd,hdr,hdrlen,&type,paylen,prefix);
37
+}
38
+
39
+int encode_accept(char *hdrstart,int hdrlen,unsigned int *bodi,char *where)
40
+{
41
+   int i;
42
+
43
+   for(i=0;bodi[i]!=0;i++){
44
+      encode_mime_type(hdrstart,hdrlen,bodi[i],&where[1+i*sizeof(unsigned int)]);
45
+   }
46
+   where[0]=(unsigned char)i;
47
+
48
+   return 1+i*sizeof(unsigned int);
49
+}
50
+
51
+int print_encoded_accept(int fd,char *hdr,int hdrlen,unsigned char* payload,int paylen,char *prefix)
52
+{
53
+   int i;
54
+   unsigned int type;
55
+   for(i=0;i<payload[0];i++){
56
+      memcpy(&type,&payload[1+i*sizeof(unsigned int)],sizeof(unsigned int));
57
+      print_encoded_mime_type(fd,hdr,hdrlen,&type,4,prefix);
58
+   }
59
+   return 1;
60
+
61
+}
62
+
63
+int encode_mime_type(char *hdrstart,int hdrlen,unsigned int bodi,char *where)
64
+{
65
+   unsigned int type;
66
+
67
+   type=htonl(bodi);
68
+   memcpy(where,&type,sizeof(unsigned int));
69
+
70
+   return sizeof(int);
71
+}
72
+
73
+int print_encoded_mime_type(int fd,char *hdr,int hdrlen,unsigned int* payload,int paylen,char *prefix)
74
+{
75
+   unsigned int type;
76
+   char *chtype,*chsubtype;
77
+
78
+   type=ntohl(*payload);
79
+
80
+   switch(type>>16){
81
+      case TYPE_TEXT:
82
+	 chtype="text";
83
+	 break;
84
+      case TYPE_MESSAGE:
85
+	 chtype="message";
86
+	 break;
87
+      case TYPE_APPLICATION:
88
+	 chtype="application";
89
+	 break;
90
+      case TYPE_MULTIPART:
91
+	 chtype="multipart";
92
+	 break;
93
+      case TYPE_ALL:
94
+	 chtype="all";
95
+	 break;
96
+      case TYPE_UNKNOWN:
97
+	 chtype="unknown";
98
+	 break;
99
+      default:
100
+	chtype="(didn't know this type existed)";
101
+	break;
102
+   }
103
+
104
+   switch(type&0xFF){
105
+      case SUBTYPE_PLAIN:
106
+	 chsubtype="SUBTYPE_PLAIN";
107
+	 break;
108
+      case SUBTYPE_CPIM:
109
+	 chsubtype="SUBTYPE_CPIM";
110
+	 break;
111
+      case SUBTYPE_SDP:
112
+	 chsubtype="SUBTYPE_SDP";
113
+	 break;
114
+      case SUBTYPE_CPLXML:
115
+	 chsubtype="SUBTYPE_CPLXML";
116
+	 break;
117
+      case SUBTYPE_PIDFXML:
118
+	 chsubtype="SUBTYPE_PIDFXML";
119
+	 break;
120
+      case SUBTYPE_RLMIXML:
121
+	 chsubtype="SUBTYPE_RLMIXML";
122
+	 break;
123
+      case SUBTYPE_RELATED:
124
+	 chsubtype="SUBTYPE_RELATED";
125
+	 break;
126
+      case SUBTYPE_LPIDFXML:
127
+	 chsubtype="SUBTYPE_LPIDFXML";
128
+	 break;
129
+      case SUBTYPE_XPIDFXML:
130
+	 chsubtype="SUBTYPE_XPIDFXML";
131
+	 break;
132
+      case SUBTYPE_WATCHERINFOXML:
133
+	 chsubtype="SUBTYPE_WATCHERINFOXML";
134
+	 break;
135
+      case SUBTYPE_EXTERNAL_BODY:
136
+	 chsubtype="SUBTYPE_EXTERNAL_BODY";
137
+	 break;
138
+      case SUBTYPE_XML_MSRTC_PIDF:
139
+	 chsubtype="SUBTYPE_XML_MSRTC_PIDF";
140
+	 break;
141
+      case SUBTYPE_ALL:
142
+	 chsubtype="SUBTYPE_ALL";
143
+	 break;
144
+      case SUBTYPE_UNKNOWN:
145
+	 chsubtype="SUBTYPE_UNKNOWN";
146
+	 break;
147
+      default:
148
+	 chsubtype="(didnt know this subtype existed)";
149
+   }
150
+
151
+   dprintf(fd,"%sTYPE:[%s]\n",prefix,chtype);
152
+   dprintf(fd,"%sSUBTYPE:[%s]\n",prefix,chsubtype);
153
+   return 0;
154
+}