Browse code

- removed implementation of fifo and unixsocket servers from core (it will be implemented in modules instead)

Jan Janak authored on 21/12/2005 17:27:21
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,143 +0,0 @@
1
-/*
2
- * $Id$
3
- *
4
- * UNIX Domain Socket Server
5
- *
6
- * Copyright (C) 2001-2004 FhG Fokus
7
- *
8
- * This file is part of ser, a free SIP server.
9
- *
10
- * ser is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License as published by
12
- * the Free Software Foundation; either version 2 of the License, or
13
- * (at your option) any later version
14
- *
15
- * For a license to use the ser software under conditions
16
- * other than those described here, or to purchase support for this
17
- * software, please contact iptel.org by e-mail at the following addresses:
18
- *    info@iptel.org
19
- *
20
- * ser is distributed in the hope that it will be useful,
21
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
- * GNU General Public License for more details.
24
- *
25
- * You should have received a copy of the GNU General Public License 
26
- * along with this program; if not, write to the Free Software 
27
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
28
- */
29
-
30
-#ifndef _UNIXSOCK_SERVER_H
31
-#define _UNIXSOCK_SERVER_H
32
-
33
-
34
-#include <sys/types.h>
35
-#include <sys/un.h>
36
-#include <unistd.h>
37
-#include "str.h"
38
-
39
-
40
-typedef int (unixsock_f)(str* msg);
41
-
42
-
43
-struct unixsock_cmd {
44
-	str name;                   /* The name of the function */
45
-	unixsock_f* f;              /* Function to be called */
46
-	struct unixsock_cmd* next;  /* Next element in the linked list */
47
-};
48
-
49
-
50
-/*
51
- * Initialize Unix domain socket server
52
- */
53
-int init_unixsock_socket(void);
54
-
55
-
56
-/*
57
- * Initialize Unix domain socket server
58
- */
59
-int init_unixsock_children(void);
60
-
61
-
62
-/*
63
- * Clean up
64
- */
65
-void close_unixsock_server(void);
66
-
67
-
68
-/*
69
- * Register a new command
70
- */
71
-int unixsock_register_cmd(char* name, unixsock_f* f);
72
-
73
-
74
-/*
75
- * Reset the reply buffer -- start to write
76
- * at the beginning
77
- */
78
-void unixsock_reply_reset(void);
79
-
80
-
81
-/*
82
- * Add ASCIIZ to the reply buffer
83
- */
84
-int unixsock_reply_asciiz(char* str);
85
-
86
-
87
-/*
88
- * Add a string represented by str structure
89
- * to the reply buffer
90
- */
91
-int unixsock_reply_str(str* s);
92
-
93
-
94
-/*
95
- * Printf-like reply function
96
- */
97
-int unixsock_reply_printf(char* fmt, ...);
98
-
99
-
100
-/*
101
- * Send the reply
102
- */
103
-ssize_t unixsock_reply_send(void);
104
-
105
-
106
-/*
107
- * Send the reply to the given destination
108
- */
109
-ssize_t unixsock_reply_sendto(struct sockaddr_un* to);
110
-
111
-
112
-/*
113
- * Read a line, the result will be stored in line
114
- * parameter, the data is not copied, it's just
115
- * a pointer to an existing buffer
116
- */
117
-int unixsock_read_line(str* line, str* source);
118
-
119
-
120
-/*
121
- * Read body until the closing .CRLF, no CRLF recovery
122
- * is done so no additional buffer is necessary, body will
123
- * point to an existing buffer
124
- */
125
-int unixsock_read_body(str* body, str* source);
126
-
127
-
128
-/*
129
- * Read a set of lines, the functions performs CRLF recovery,
130
- * therefore lineset must point to an additional buffer
131
- * to which the data will be copied. Initial lineset->len contains
132
- * the size of the buffer
133
- */
134
-int unixsock_read_lineset(str* lineset, str* source);
135
-
136
-
137
-/*
138
- * Return the address of the sender
139
- */
140
-struct sockaddr_un* unixsock_sender_addr(void);
141
-
142
-
143
-#endif /* _UNIXSOCK_SERVER_H */
Browse code

- missing header on netbsd - removed -Wcast-align for mips2

Andrei Pelinescu-Onciul authored on 12/09/2004 17:26:59
Showing 1 changed files
... ...
@@ -31,6 +31,7 @@
31 31
 #define _UNIXSOCK_SERVER_H
32 32
 
33 33
 
34
+#include <sys/types.h>
34 35
 #include <sys/un.h>
35 36
 #include <unistd.h>
36 37
 #include "str.h"
Browse code

- Spelling checked - READMEs updated

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

Initialization if unix domain socket split

Jan Janak authored on 09/03/2004 11:10:59
Showing 1 changed files
... ...
@@ -49,7 +49,13 @@ struct unixsock_cmd {
49 49
 /*
50 50
  * Initialize Unix domain socket server
51 51
  */
52
-int init_unixsock_server(void);
52
+int init_unixsock_socket(void);
53
+
54
+
55
+/*
56
+ * Initialize Unix domain socket server
57
+ */
58
+int init_unixsock_children(void);
53 59
 
54 60
 
55 61
 /*
Browse code

Missing header field added

Jan Janak authored on 05/03/2004 19:27:40
Showing 1 changed files
... ...
@@ -32,6 +32,7 @@
32 32
 
33 33
 
34 34
 #include <sys/un.h>
35
+#include <unistd.h>
35 36
 #include "str.h"
36 37
 
37 38
 
Browse code

Additional socket in non-blocking mode created for sending replies

Jan Janak authored on 04/03/2004 12:23:05
Showing 1 changed files
... ...
@@ -129,7 +129,7 @@ int unixsock_read_lineset(str* lineset, str* source);
129 129
 /*
130 130
  * Return the address of the sender
131 131
  */
132
-struct sockaddr_un* unixsock_sender_address(void);
132
+struct sockaddr_un* unixsock_sender_addr(void);
133 133
 
134 134
 
135 135
 #endif /* _UNIXSOCK_SERVER_H */
Browse code

unixsock_reply_sendto added.

Jan Janak authored on 03/03/2004 20:41:52
Showing 1 changed files
... ...
@@ -95,6 +95,12 @@ int unixsock_reply_printf(char* fmt, ...);
95 95
 ssize_t unixsock_reply_send(void);
96 96
 
97 97
 
98
+/*
99
+ * Send the reply to the given destination
100
+ */
101
+ssize_t unixsock_reply_sendto(struct sockaddr_un* to);
102
+
103
+
98 104
 /*
99 105
  * Read a line, the result will be stored in line
100 106
  * parameter, the data is not copied, it's just
... ...
@@ -120,4 +126,10 @@ int unixsock_read_body(str* body, str* source);
120 126
 int unixsock_read_lineset(str* lineset, str* source);
121 127
 
122 128
 
129
+/*
130
+ * Return the address of the sender
131
+ */
132
+struct sockaddr_un* unixsock_sender_address(void);
133
+
134
+
123 135
 #endif /* _UNIXSOCK_SERVER_H */
Browse code

- Better API for sending replies - Core commands implemented

Jan Janak authored on 03/03/2004 15:36:55
Showing 1 changed files
... ...
@@ -60,19 +60,39 @@ void close_unixsock_server(void);
60 60
 /*
61 61
  * Register a new command
62 62
  */
63
-int unixsock_register_cmd(str* name, unixsock_f* f);
63
+int unixsock_register_cmd(char* name, unixsock_f* f);
64 64
 
65 65
 
66 66
 /*
67
- * add a text to the reply
67
+ * Reset the reply buffer -- start to write
68
+ * at the beginning
68 69
  */
69
-int unixsock_add_to_reply(const char* buf, size_t len);
70
+void unixsock_reply_reset(void);
71
+
72
+
73
+/*
74
+ * Add ASCIIZ to the reply buffer
75
+ */
76
+int unixsock_reply_asciiz(char* str);
77
+
78
+
79
+/*
80
+ * Add a string represented by str structure
81
+ * to the reply buffer
82
+ */
83
+int unixsock_reply_str(str* s);
84
+
85
+
86
+/*
87
+ * Printf-like reply function
88
+ */
89
+int unixsock_reply_printf(char* fmt, ...);
70 90
 
71 91
 
72 92
 /*
73 93
  * Send the reply
74 94
  */
75
-ssize_t unixsock_send_reply(void);
95
+ssize_t unixsock_reply_send(void);
76 96
 
77 97
 
78 98
 /*
Browse code

Did not commit in the previous run...

Jan Janak authored on 02/03/2004 16:07:14
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,103 @@
1
+/*
2
+ * $Id$
3
+ *
4
+ * UNIX Domain Socket Server
5
+ *
6
+ * Copyright (C) 2001-2004 Fhg Fokus
7
+ *
8
+ * This file is part of ser, a free SIP server.
9
+ *
10
+ * ser is free software; you can redistribute it and/or modify
11
+ * it under the terms of the GNU General Public License as published by
12
+ * the Free Software Foundation; either version 2 of the License, or
13
+ * (at your option) any later version
14
+ *
15
+ * For a license to use the ser software under conditions
16
+ * other than those described here, or to purchase support for this
17
+ * software, please contact iptel.org by e-mail at the following addresses:
18
+ *    info@iptel.org
19
+ *
20
+ * ser is distributed in the hope that it will be useful,
21
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
+ * GNU General Public License for more details.
24
+ *
25
+ * You should have received a copy of the GNU General Public License 
26
+ * along with this program; if not, write to the Free Software 
27
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
28
+ */
29
+
30
+#ifndef _UNIXSOCK_SERVER_H
31
+#define _UNIXSOCK_SERVER_H
32
+
33
+
34
+#include <sys/un.h>
35
+#include "str.h"
36
+
37
+
38
+typedef int (unixsock_f)(str* msg);
39
+
40
+
41
+struct unixsock_cmd {
42
+	str name;                   /* The name of the function */
43
+	unixsock_f* f;              /* Function to be called */
44
+	struct unixsock_cmd* next;  /* Next element in the linked list */
45
+};
46
+
47
+
48
+/*
49
+ * Initialize Unix domain socket server
50
+ */
51
+int init_unixsock_server(void);
52
+
53
+
54
+/*
55
+ * Clean up
56
+ */
57
+void close_unixsock_server(void);
58
+
59
+
60
+/*
61
+ * Register a new command
62
+ */
63
+int unixsock_register_cmd(str* name, unixsock_f* f);
64
+
65
+
66
+/*
67
+ * add a text to the reply
68
+ */
69
+int unixsock_add_to_reply(const char* buf, size_t len);
70
+
71
+
72
+/*
73
+ * Send the reply
74
+ */
75
+ssize_t unixsock_send_reply(void);
76
+
77
+
78
+/*
79
+ * Read a line, the result will be stored in line
80
+ * parameter, the data is not copied, it's just
81
+ * a pointer to an existing buffer
82
+ */
83
+int unixsock_read_line(str* line, str* source);
84
+
85
+
86
+/*
87
+ * Read body until the closing .CRLF, no CRLF recovery
88
+ * is done so no additional buffer is necessary, body will
89
+ * point to an existing buffer
90
+ */
91
+int unixsock_read_body(str* body, str* source);
92
+
93
+
94
+/*
95
+ * Read a set of lines, the functions performs CRLF recovery,
96
+ * therefore lineset must point to an additional buffer
97
+ * to which the data will be copied. Initial lineset->len contains
98
+ * the size of the buffer
99
+ */
100
+int unixsock_read_lineset(str* lineset, str* source);
101
+
102
+
103
+#endif /* _UNIXSOCK_SERVER_H */