1 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,92 +0,0 @@ |
1 |
-/* |
|
2 |
- * $Id$ |
|
3 |
- * |
|
4 |
- * |
|
5 |
- * Copyright (C) 2001-2003 FhG Fokus |
|
6 |
- * |
|
7 |
- * This file is part of ser, a free SIP server. |
|
8 |
- * |
|
9 |
- * ser is free software; you can redistribute it and/or modify |
|
10 |
- * it under the terms of the GNU General Public License as published by |
|
11 |
- * the Free Software Foundation; either version 2 of the License, or |
|
12 |
- * (at your option) any later version |
|
13 |
- * |
|
14 |
- * For a license to use the ser software under conditions |
|
15 |
- * other than those described here, or to purchase support for this |
|
16 |
- * software, please contact iptel.org by e-mail at the following addresses: |
|
17 |
- * info@iptel.org |
|
18 |
- * |
|
19 |
- * ser is distributed in the hope that it will be useful, |
|
20 |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
21 |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
22 |
- * GNU General Public License for more details. |
|
23 |
- * |
|
24 |
- * You should have received a copy of the GNU General Public License |
|
25 |
- * along with this program; if not, write to the Free Software |
|
26 |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
27 |
- */ |
|
28 |
- |
|
29 |
- |
|
30 |
-#ifndef _FIFO_SERVER_H |
|
31 |
-#define _FIFO_SERVER_H |
|
32 |
- |
|
33 |
-#include <stdio.h> |
|
34 |
- |
|
35 |
-#define CMD_SEPARATOR ':' |
|
36 |
- |
|
37 |
-/* core FIFO command set */ |
|
38 |
-/* echo input */ |
|
39 |
-#define FIFO_PRINT "print" |
|
40 |
-/* print server's uptime */ |
|
41 |
-#define FIFO_UPTIME "uptime" |
|
42 |
-/* print server's version */ |
|
43 |
-#define FIFO_VERSION "version" |
|
44 |
-/* print available FIFO commands */ |
|
45 |
-#define FIFO_WHICH "which" |
|
46 |
-/* print server's process table */ |
|
47 |
-#define FIFO_PS "ps" |
|
48 |
-/* print server's command line arguments */ |
|
49 |
-#define FIFO_ARG "arg" |
|
50 |
-/* print server's working directory */ |
|
51 |
-#define FIFO_PWD "pwd" |
|
52 |
-/* kill the server */ |
|
53 |
-#define FIFO_KILL "kill" |
|
54 |
-#define FIFO_MEMINFO "meminfo" |
|
55 |
- |
|
56 |
-#define MAX_CTIME_LEN 128 |
|
57 |
- |
|
58 |
-typedef int (fifo_cmd)( FILE *fifo_stream, char *response_file ); |
|
59 |
- |
|
60 |
-struct fifo_command{ |
|
61 |
- fifo_cmd *f; |
|
62 |
- struct fifo_command *next; |
|
63 |
- void *param; |
|
64 |
- char *name; |
|
65 |
-}; |
|
66 |
- |
|
67 |
-int register_fifo_cmd(fifo_cmd f, char *cmd_name, void *param); |
|
68 |
- |
|
69 |
-/* read a single EoL-terminated line from fifo */ |
|
70 |
-int read_line( char *b, int max, FILE *stream, int *read ); |
|
71 |
-/* consume EoL from fifo */ |
|
72 |
-int read_eol( FILE *stream ); |
|
73 |
-/* consume a set of EoL-terminated lines terminated by an additional EoL */ |
|
74 |
-int read_line_set(char *buf, int max_len, FILE *fifo, int *len); |
|
75 |
-/* consume a set of EoL-terminated lines terminated by a single dot line */ |
|
76 |
-int read_body(char *buf, int max_len, FILE *fifo, int *len); |
|
77 |
- |
|
78 |
-int init_fifo_server(); |
|
79 |
-int start_fifo_server(); |
|
80 |
- |
|
81 |
-/* register core FIFO command set */ |
|
82 |
-int register_core_fifo(); |
|
83 |
- |
|
84 |
-FILE *open_reply_pipe( char *pipe_name ); |
|
85 |
- |
|
86 |
-/* tell FIFO client an error occurred via reply pipe */ |
|
87 |
-void fifo_reply( char *reply_fifo, char *reply_fmt, ... ); |
|
88 |
- |
|
89 |
-/* memory deallocation */ |
|
90 |
-void destroy_fifo(); |
|
91 |
- |
|
92 |
-#endif |
(where used = allocated shm mem + overhead)
... | ... |
@@ -2,7 +2,7 @@ |
2 | 2 |
* $Id$ |
3 | 3 |
* |
4 | 4 |
* |
5 |
- * Copyright (C) 2001-2003 Fhg Fokus |
|
5 |
+ * Copyright (C) 2001-2003 FhG Fokus |
|
6 | 6 |
* |
7 | 7 |
* This file is part of ser, a free SIP server. |
8 | 8 |
* |
... | ... |
@@ -77,12 +77,12 @@ int read_body(char *buf, int max_len, FILE *fifo, int *len); |
77 | 77 |
int init_fifo_server(); |
78 | 78 |
int start_fifo_server(); |
79 | 79 |
|
80 |
-/* regsiter core FIFO command set */ |
|
80 |
+/* register core FIFO command set */ |
|
81 | 81 |
int register_core_fifo(); |
82 | 82 |
|
83 | 83 |
FILE *open_reply_pipe( char *pipe_name ); |
84 | 84 |
|
85 |
-/* tell FIFO client an error occured via reply pipe */ |
|
85 |
+/* tell FIFO client an error occurred via reply pipe */ |
|
86 | 86 |
void fifo_reply( char *reply_fifo, char *reply_fmt, ... ); |
87 | 87 |
|
88 | 88 |
/* memory deallocation */ |
... | ... |
@@ -74,7 +74,8 @@ int read_line_set(char *buf, int max_len, FILE *fifo, int *len); |
74 | 74 |
/* consume a set of EoL-terminated lines terminated by a single dot line */ |
75 | 75 |
int read_body(char *buf, int max_len, FILE *fifo, int *len); |
76 | 76 |
|
77 |
-int open_fifo_server(); |
|
77 |
+int init_fifo_server(); |
|
78 |
+int start_fifo_server(); |
|
78 | 79 |
|
79 | 80 |
/* regsiter core FIFO command set */ |
80 | 81 |
int register_core_fifo(); |
... | ... |
@@ -45,6 +45,10 @@ |
45 | 45 |
#define FIFO_WHICH "which" |
46 | 46 |
/* print server's process table */ |
47 | 47 |
#define FIFO_PS "ps" |
48 |
+/* print server's command line arguments */ |
|
49 |
+#define FIFO_ARG "arg" |
|
50 |
+/* print server's working directory */ |
|
51 |
+#define FIFO_PWD "pwd" |
|
48 | 52 |
|
49 | 53 |
#define MAX_CTIME_LEN 128 |
50 | 54 |
|
... | ... |
@@ -1,8 +1,32 @@ |
1 | 1 |
/* |
2 | 2 |
* $Id$ |
3 | 3 |
* |
4 |
+ * |
|
5 |
+ * Copyright (C) 2001-2003 Fhg Fokus |
|
6 |
+ * |
|
7 |
+ * This file is part of ser, a free SIP server. |
|
8 |
+ * |
|
9 |
+ * ser is free software; you can redistribute it and/or modify |
|
10 |
+ * it under the terms of the GNU General Public License as published by |
|
11 |
+ * the Free Software Foundation; either version 2 of the License, or |
|
12 |
+ * (at your option) any later version |
|
13 |
+ * |
|
14 |
+ * For a license to use the ser software under conditions |
|
15 |
+ * other than those described here, or to purchase support for this |
|
16 |
+ * software, please contact iptel.org by e-mail at the following addresses: |
|
17 |
+ * info@iptel.org |
|
18 |
+ * |
|
19 |
+ * ser is distributed in the hope that it will be useful, |
|
20 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
21 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
22 |
+ * GNU General Public License for more details. |
|
23 |
+ * |
|
24 |
+ * You should have received a copy of the GNU General Public License |
|
25 |
+ * along with this program; if not, write to the Free Software |
|
26 |
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
4 | 27 |
*/ |
5 | 28 |
|
29 |
+ |
|
6 | 30 |
#ifndef _FIFO_SERVER_H |
7 | 31 |
#define _FIFO_SERVER_H |
8 | 32 |
|
... | ... |
@@ -11,10 +11,16 @@ |
11 | 11 |
#define CMD_SEPARATOR ':' |
12 | 12 |
|
13 | 13 |
/* core FIFO command set */ |
14 |
+/* echo input */ |
|
14 | 15 |
#define FIFO_PRINT "print" |
16 |
+/* print server's uptime */ |
|
15 | 17 |
#define FIFO_UPTIME "uptime" |
18 |
+/* print server's version */ |
|
16 | 19 |
#define FIFO_VERSION "version" |
20 |
+/* print available FIFO commands */ |
|
17 | 21 |
#define FIFO_WHICH "which" |
22 |
+/* print server's process table */ |
|
23 |
+#define FIFO_PS "ps" |
|
18 | 24 |
|
19 | 25 |
#define MAX_CTIME_LEN 128 |
20 | 26 |
|
... | ... |
@@ -43,7 +43,7 @@ int register_core_fifo(); |
43 | 43 |
FILE *open_reply_pipe( char *pipe_name ); |
44 | 44 |
|
45 | 45 |
/* tell FIFO client an error occured via reply pipe */ |
46 |
-void fifo_reply( char *reply_fifo, char *reply_txt); |
|
46 |
+void fifo_reply( char *reply_fifo, char *reply_fmt, ... ); |
|
47 | 47 |
|
48 | 48 |
|
49 | 49 |
#endif |
... | ... |
@@ -31,6 +31,8 @@ int read_line( char *b, int max, FILE *stream, int *read ); |
31 | 31 |
int read_eol( FILE *stream ); |
32 | 32 |
/* consume a set of EoL-terminated lines terminated by an additional EoL */ |
33 | 33 |
int read_line_set(char *buf, int max_len, FILE *fifo, int *len); |
34 |
+/* consume a set of EoL-terminated lines terminated by a single dot line */ |
|
35 |
+int read_body(char *buf, int max_len, FILE *fifo, int *len); |
|
34 | 36 |
|
35 | 37 |
int open_fifo_server(); |
36 | 38 |
|
... | ... |
@@ -10,6 +10,10 @@ |
10 | 10 |
|
11 | 11 |
#define CMD_SEPARATOR ':' |
12 | 12 |
|
13 |
+/* core FIFO command set */ |
|
14 |
+#define FIFO_PRINT "print" |
|
15 |
+#define FIFO_UPTIME "uptime" |
|
16 |
+ |
|
13 | 17 |
typedef int (fifo_cmd)( FILE *fifo_stream, char *response_file ); |
14 | 18 |
|
15 | 19 |
struct fifo_command{ |
... | ... |
@@ -30,5 +34,9 @@ int read_line_set(char *buf, int max_len, FILE *fifo, int *len); |
30 | 34 |
|
31 | 35 |
int open_fifo_server(); |
32 | 36 |
|
33 |
-int print_fifo_cmd( FILE *stream, char *response_file ); |
|
37 |
+/* regsiter core FIFO command set */ |
|
38 |
+int register_core_fifo(); |
|
39 |
+ |
|
40 |
+FILE *open_reply_pipe( char *pipe_name ); |
|
41 |
+ |
|
34 | 42 |
#endif |
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,34 @@ |
1 |
+/* |
|
2 |
+ * $Id$ |
|
3 |
+ * |
|
4 |
+ */ |
|
5 |
+ |
|
6 |
+#ifndef _FIFO_SERVER_H |
|
7 |
+#define _FIFO_SERVER_H |
|
8 |
+ |
|
9 |
+#include <stdio.h> |
|
10 |
+ |
|
11 |
+#define CMD_SEPARATOR ':' |
|
12 |
+ |
|
13 |
+typedef int (fifo_cmd)( FILE *fifo_stream, char *response_file ); |
|
14 |
+ |
|
15 |
+struct fifo_command{ |
|
16 |
+ fifo_cmd *f; |
|
17 |
+ struct fifo_command *next; |
|
18 |
+ void *param; |
|
19 |
+ char *name; |
|
20 |
+}; |
|
21 |
+ |
|
22 |
+int register_fifo_cmd(fifo_cmd f, char *cmd_name, void *param); |
|
23 |
+ |
|
24 |
+/* read a single EoL-terminated line from fifo */ |
|
25 |
+int read_line( char *b, int max, FILE *stream, int *read ); |
|
26 |
+/* consume EoL from fifo */ |
|
27 |
+int read_eol( FILE *stream ); |
|
28 |
+/* consume a set of EoL-terminated lines terminated by an additional EoL */ |
|
29 |
+int read_line_set(char *buf, int max_len, FILE *fifo, int *len); |
|
30 |
+ |
|
31 |
+int open_fifo_server(); |
|
32 |
+ |
|
33 |
+int print_fifo_cmd( FILE *stream, char *response_file ); |
|
34 |
+#endif |