Bladeren bron

- minor serdev doc edits
- removed fifo default value
- added -i fifo_path parameter
- updated man page

Andrei Pelinescu-Onciul 23 jaren geleden
bovenliggende
commit
97f17e60a1
5 gewijzigde bestanden met toevoegingen van 28 en 14 verwijderingen
  1. 9 8
      doc/serdev/serdev.sgml
  2. 1 1
      fifo_server.c
  3. 8 4
      main.c
  4. 3 1
      parser/msg_parser.h
  5. 7 0
      ser.8

+ 9 - 8
doc/serdev/serdev.sgml

@@ -1,4 +1,5 @@
-<!DOCTYPE Book SYSTEM "/usr/share/sgml/docbook/dtd-4.2/docbook.dtd">
+<!-- $Id$ -->
+<!DOCTYPE Book PUBLIC "-//OASIS//DTD DocBook V4.2//EN">
 
 <book label="serdev" id="serdev" lang="EN">
     <title>SIP Express Router</title>
@@ -93,8 +94,8 @@
 	<section id="cmd-line-params">
 	    <title>Processing Command Line Parameters</title>
 	    <para>
-		<acronym>SER</acronym> utilizes <acronym>GNU</acronym><function moreinfo="none">getopt</function>function to 
-		parse command line parameters.
+		<acronym>SER</acronym> utilizes the <function moreinfo="none">getopt
+		</function>function to parse command line parameters.
 		The function is extensively described in the man pages.
 	    </para>
 	</section> <!-- cmd-line-params -->
@@ -242,18 +243,18 @@
 		    will be issued and the server will be aborted.
 		</para>
 		<para>
-		    There is a utility called Bison. Input of the utility is a file containing the grammar of
+		    There is a utility called yacc. Input of the utility is a file containing the grammar of
 		    the configuration file, in addition to the grammar, you can describe what action the parser
 		    should do at various stages of parsing. For example, you can instruct the parser to create a
 		    structure describing an <acronym>IP</acronym> address every time it finds an <acronym>IP</acronym> 
 		    address in the configuration file and convert the address to its binary representation.
 		</para>
-		<para>For more information see Bison documentation.</para>
+		<para>For more information see yacc documentation.</para>
 		<para>
-		    Bison creates the parser when the server is being compiled from the sources.
-		    Input file for bison is <filename moreinfo="none">cfg.y</filename>. The file contains grammar
+		    yacc creates the parser when the server is being compiled from the sources.
+		    Input file for yacc is <filename moreinfo="none">cfg.y</filename>. The file contains grammar
 		    of the config file along with actions that create the binary representation of the file.
-		    Bison will write its result into file <filename moreinfo="none">cfg.tab.c</filename>. The
+		    Yacc will write its result into file <filename moreinfo="none">cfg.tab.c</filename>. The
 		    file contains function <function moreinfo="none">yyparse</function> which will parse the whole
 		    configuration file and construct the binary representation. For more information about the
 		    bison input file syntax see bison documentation.

+ 1 - 1
fifo_server.c

@@ -76,7 +76,7 @@
 #include "pt.h"
 
 /* FIFO server vars */
-char *fifo="/tmp/ser_fifo"; /* FIFO name */
+char *fifo=0; /* FIFO name */
 int fifo_mode=S_IRUSR | S_IWUSR | S_IRGRP | 
 	S_IWGRP | S_IROTH | S_IWOTH;
 pid_t fifo_pid;

+ 8 - 4
main.c

@@ -173,9 +173,10 @@ Options:\n\
     -t  dir      chroot to \"dir\"\n\
     -u uid       change uid \n\
     -g gid       change gid \n\
-    -P file      create a pid file\n"
+    -P file      create a pid file\n\
+    -i fifo_path create a fifo (usefull for monitoring " NAME ") \n"
 #ifdef STATS
-"    -s file	 File to which statistics is dumped (disabled otherwise)\n"
+"    -s file     File to which statistics is dumped (disabled otherwise)\n"
 #endif
 ;
 
@@ -917,7 +918,7 @@ int main(int argc, char** argv)
 #ifdef STATS
 	"s:"
 #endif
-	"f:p:m:b:l:n:rRvdDEVhw:t:u:g:P:";
+	"f:p:m:b:l:n:rRvdDEVhw:t:u:g:P:i:";
 	
 	while((c=getopt(argc,argv,options))!=-1){
 		switch(c){
@@ -1043,6 +1044,9 @@ int main(int argc, char** argv)
 			case 'P':
 					pid_file=optarg;
 					break;
+			case 'i':
+					fifo=optarg;
+					break;
 			case '?':
 					if (isprint(optopt))
 						fprintf(stderr, "Unknown option `-%c´.\n", optopt);
@@ -1073,7 +1077,7 @@ int main(int argc, char** argv)
 	}
 
 
-        init_hfname_parser();
+	init_hfname_parser();
 	init_digest_parser();
 
 	/* init hash fucntion */

+ 3 - 1
parser/msg_parser.h

@@ -91,7 +91,9 @@ struct sip_msg {
 	int parsed_flag;               /* Already parsed header field types */
 
 	     /* Via, To, CSeq, Call-Id, From, end of header*/
-	     /* first occurance of it; subsequent occurances saved in 'headers' */
+	     /* pointers to the first occurances of these headers;
+		  * everything is also saved in 'headers'
+		  * (WARNING: do not deallocate them twice!)*/
 
 	struct hdr_field* h_via1;
 	struct hdr_field* h_via2;

+ 7 - 0
ser.8

@@ -32,6 +32,8 @@ ser \- very fast and configurable sip proxy
 .BI \-g " gid"
 ] [
 .BI \-P " pid\-file"
+] [
+.BI \-i " fifo\-path"
 ]
 
 .SH DESCRIPTION
@@ -126,6 +128,11 @@ runs.
 Creates a file containing the pid of the main 
 .B ser 
 process.
+.TP
+.BI \-i " fifo\-path"
+Creates a fifo, usefull for monitoring
+.B ser
+status.
 
 
 .SH FILES