Browse Source

Merge pull request #491 from mslehto/bsdtcpops

Make tcpops module usable on BSD
Camille Oudot 9 years ago
parent
commit
094613b85d
3 changed files with 14 additions and 13 deletions
  1. 5 5
      modules/tcpops/doc/functions.xml
  2. 1 1
      modules/tcpops/doc/tcpops.xml
  3. 8 7
      tcp_options.h

+ 5 - 5
modules/tcpops/doc/functions.xml

@@ -18,7 +18,7 @@
 		<para>Meaning of the parameters is as follows:</para>
 		<para>Meaning of the parameters is as follows:</para>
 		<itemizedlist>
 		<itemizedlist>
 			<listitem>
 			<listitem>
-				<para><emphasis>conid</emphasis> (optionnal): the Kamailio internal
+				<para><emphasis>conid</emphasis> (optional): the Kamailio internal
 				connection id (as in the <emphasis>$conid</emphasis> pseudovariable).
 				connection id (as in the <emphasis>$conid</emphasis> pseudovariable).
 				</para>
 				</para>
 			</listitem>
 			</listitem>
@@ -48,7 +48,7 @@
 		<para>Meaning of the parameters is as follows:</para>
 		<para>Meaning of the parameters is as follows:</para>
 		<itemizedlist>
 		<itemizedlist>
 			<listitem>
 			<listitem>
-				<para><emphasis>conid</emphasis> (optionnal): the Kamailio internal
+				<para><emphasis>conid</emphasis> (optional): the Kamailio internal
 				connection id (as in the <emphasis>$conid</emphasis> pseudovariable).
 				connection id (as in the <emphasis>$conid</emphasis> pseudovariable).
 				</para>
 				</para>
 			</listitem>
 			</listitem>
@@ -83,7 +83,7 @@
 		<para>Meaning of the parameters is as follows:</para>
 		<para>Meaning of the parameters is as follows:</para>
 		<itemizedlist>
 		<itemizedlist>
 			<listitem>
 			<listitem>
-				<para><emphasis>conid</emphasis> (optionnal): the kamailio internal
+				<para><emphasis>conid</emphasis> (optional): the kamailio internal
 				connection id on which TCP keepalive will be enabled. If no parameter
 				connection id on which TCP keepalive will be enabled. If no parameter
 				is given, the keepalive mechanism will be enabled on the current message
 				is given, the keepalive mechanism will be enabled on the current message
 				source connection.
 				source connection.
@@ -140,7 +140,7 @@ onreply_route[foo] {
 		<para>Meaning of the parameters is as follows:</para>
 		<para>Meaning of the parameters is as follows:</para>
 		<itemizedlist>
 		<itemizedlist>
 			<listitem>
 			<listitem>
-				<para><emphasis>conid</emphasis> (optionnal): the kamailio internal
+				<para><emphasis>conid</emphasis> (optional): the kamailio internal
 				connection id on which TCP keepalive will be disabled. If no parameter
 				connection id on which TCP keepalive will be disabled. If no parameter
 				is given, the keepalive mechanism will be disabled on the current message
 				is given, the keepalive mechanism will be disabled on the current message
 				source connection.
 				source connection.
@@ -181,7 +181,7 @@ onreply_route[foo] {
                 <para>Meaning of the parameters is as follows:</para>
                 <para>Meaning of the parameters is as follows:</para>
                 <itemizedlist>
                 <itemizedlist>
                         <listitem>
                         <listitem>
-                                <para><emphasis>conid</emphasis> (optionnal): the kamailio internal
+                                <para><emphasis>conid</emphasis> (optional): the kamailio internal
                                 connection id on which to set the new lifetime. If no parameter
                                 connection id on which to set the new lifetime. If no parameter
                                 is given, it will be set on the current message source connection.
                                 is given, it will be set on the current message source connection.
                                 </para>
                                 </para>

+ 1 - 1
modules/tcpops/doc/tcpops.xml

@@ -45,7 +45,7 @@
 	<para>
 	<para>
 	<emphasis>Note</emphasis>: the keepalive functions only work on systems with the
 	<emphasis>Note</emphasis>: the keepalive functions only work on systems with the
 	HAVE_TCP_KEEPIDLE, HAVE_TCP_KEEPCNT and HAVE_TCP_KEEPINTVL macros defined
 	HAVE_TCP_KEEPIDLE, HAVE_TCP_KEEPCNT and HAVE_TCP_KEEPINTVL macros defined
-	(currently only Linux).
+	(Linux, FreeBSD, DragonFly BSD, NetBSD).
 	</para>
 	</para>
     </section>
     </section>
     
     

+ 8 - 7
tcp_options.h

@@ -23,6 +23,7 @@
 
 
 #ifdef USE_TCP
 #ifdef USE_TCP
 
 
+#include <netinet/tcp.h>
 #ifndef NO_TCP_ASYNC
 #ifndef NO_TCP_ASYNC
 #define TCP_ASYNC /* enabled async mode */
 #define TCP_ASYNC /* enabled async mode */
 #endif
 #endif
@@ -74,24 +75,24 @@
 
 
 /* keepintvl */
 /* keepintvl */
 #ifndef NO_TCP_KEEPINTVL
 #ifndef NO_TCP_KEEPINTVL
-#ifdef __OS_linux
+#ifdef TCP_KEEPINTVL
 #define HAVE_TCP_KEEPINTVL
 #define HAVE_TCP_KEEPINTVL
-#endif /* __OS_ */
-#endif /* NO_TCP_KEEPIDLE */
+#endif /* TCP_KEEPINTVL */
+#endif /* NO_TCP_KEEPINTVL */
 
 
 /* keepidle */
 /* keepidle */
 #ifndef NO_TCP_KEEPIDLE
 #ifndef NO_TCP_KEEPIDLE
-#ifdef __OS_linux
+#ifdef TCP_KEEPIDLE
 #define HAVE_TCP_KEEPIDLE
 #define HAVE_TCP_KEEPIDLE
-#endif /* __OS_*/
+#endif /* TCP_KEEPIDLE*/
 #endif /* NO_TCP_KEEPIDLE */
 #endif /* NO_TCP_KEEPIDLE */
 
 
 
 
 /* keepcnt */
 /* keepcnt */
 #ifndef NO_TCP_KEEPCNT
 #ifndef NO_TCP_KEEPCNT
-#ifdef __OS_linux
+#ifdef TCP_KEEPCNT
 #define HAVE_TCP_KEEPCNT
 #define HAVE_TCP_KEEPCNT
-#endif /* __OS_ */
+#endif /* TCP_KEEPCNT */
 #endif /* NO_TCP_KEEPCNT */
 #endif /* NO_TCP_KEEPCNT */