Jelajahi Sumber

nathelper: Decrease ambiguity by renaming sipping_disable_bflag to natping_disable_bflag

Richard Fuchs 12 tahun lalu
induk
melakukan
93b2b3ba79

+ 30 - 30
modules/nathelper/README

@@ -53,9 +53,9 @@ Ovidiu Sas
               4.5. natping_socket (string)
               4.5. natping_socket (string)
               4.6. received_avp (str)
               4.6. received_avp (str)
               4.7. sipping_bflag (integer)
               4.7. sipping_bflag (integer)
-              4.8. sipping_disable_bflag (integer)
-              4.9. sipping_from (string)
-              4.10. sipping_method (string)
+              4.8. sipping_from (string)
+              4.9. sipping_method (string)
+              4.10. natping_disable_bflag (integer)
               4.11. nortpproxy_str (string)
               4.11. nortpproxy_str (string)
               4.12. keepalive_timeout (int)
               4.12. keepalive_timeout (int)
 
 
@@ -94,9 +94,9 @@ Ovidiu Sas
    1.5. Set natping_socket parameter
    1.5. Set natping_socket parameter
    1.6. Set received_avp parameter
    1.6. Set received_avp parameter
    1.7. Set sipping_bflag parameter
    1.7. Set sipping_bflag parameter
-   1.8. Set sipping_disable_bflag parameter
-   1.9. Set sipping_from parameter
-   1.10. Set sipping_method parameter
+   1.8. Set sipping_from parameter
+   1.9. Set sipping_method parameter
+   1.10. Set natping_disable_bflag parameter
    1.11. Set nortpproxy_str parameter
    1.11. Set nortpproxy_str parameter
    1.12. Set keepalive_timeout parameter
    1.12. Set keepalive_timeout parameter
    1.13. fix_nated_contact usage
    1.13. fix_nated_contact usage
@@ -130,9 +130,9 @@ Chapter 1. Admin Guide
         4.5. natping_socket (string)
         4.5. natping_socket (string)
         4.6. received_avp (str)
         4.6. received_avp (str)
         4.7. sipping_bflag (integer)
         4.7. sipping_bflag (integer)
-        4.8. sipping_disable_bflag (integer)
-        4.9. sipping_from (string)
-        4.10. sipping_method (string)
+        4.8. sipping_from (string)
+        4.9. sipping_method (string)
+        4.10. natping_disable_bflag (integer)
         4.11. nortpproxy_str (string)
         4.11. nortpproxy_str (string)
         4.12. keepalive_timeout (int)
         4.12. keepalive_timeout (int)
 
 
@@ -229,9 +229,9 @@ Chapter 1. Admin Guide
    4.5. natping_socket (string)
    4.5. natping_socket (string)
    4.6. received_avp (str)
    4.6. received_avp (str)
    4.7. sipping_bflag (integer)
    4.7. sipping_bflag (integer)
-   4.8. sipping_disable_bflag (integer)
-   4.9. sipping_from (string)
-   4.10. sipping_method (string)
+   4.8. sipping_from (string)
+   4.9. sipping_method (string)
+   4.10. natping_disable_bflag (integer)
    4.11. nortpproxy_str (string)
    4.11. nortpproxy_str (string)
    4.12. keepalive_timeout (int)
    4.12. keepalive_timeout (int)
 
 
@@ -335,21 +335,7 @@ modparam("nathelper", "received_avp", "$avp(i:42)")
 modparam("nathelper", "sipping_bflag", 7)
 modparam("nathelper", "sipping_bflag", 7)
 ...
 ...
 
 
-4.8. sipping_disable_bflag (integer)
-
-   What branch flag should be used by the module to disable NAT pings on a
-   per-registration basis. If the given flag is set for a particular
-   registration, then no NAT pings will be sent at all, regardless of any
-   other conditions.
-
-   Default value is -1 (disabled).
-
-   Example 1.8. Set sipping_disable_bflag parameter
-...
-modparam("nathelper", "sipping_disable_bflag", 8)
-...
-
-4.9. sipping_from (string)
+4.8. sipping_from (string)
 
 
    The parameter sets the SIP URI to be used in generating the SIP
    The parameter sets the SIP URI to be used in generating the SIP
    requests for NAT ping purposes. To enable the SIP request pinging
    requests for NAT ping purposes. To enable the SIP request pinging
@@ -358,23 +344,37 @@ modparam("nathelper", "sipping_disable_bflag", 8)
 
 
    Default value is “NULL”.
    Default value is “NULL”.
 
 
-   Example 1.9. Set sipping_from parameter
+   Example 1.8. Set sipping_from parameter
 ...
 ...
 modparam("nathelper", "sipping_from", "sip:[email protected]")
 modparam("nathelper", "sipping_from", "sip:[email protected]")
 ...
 ...
 
 
-4.10. sipping_method (string)
+4.9. sipping_method (string)
 
 
    The parameter sets the SIP method to be used in generating the SIP
    The parameter sets the SIP method to be used in generating the SIP
    requests for NAT ping purposes.
    requests for NAT ping purposes.
 
 
    Default value is “OPTIONS”.
    Default value is “OPTIONS”.
 
 
-   Example 1.10. Set sipping_method parameter
+   Example 1.9. Set sipping_method parameter
 ...
 ...
 modparam("nathelper", "sipping_method", "INFO")
 modparam("nathelper", "sipping_method", "INFO")
 ...
 ...
 
 
+4.10. natping_disable_bflag (integer)
+
+   What branch flag should be used by the module to disable NAT pings on a
+   per-registration basis. If the given flag is set for a particular
+   registration, then no NAT pings will be sent at all, regardless of any
+   other conditions.
+
+   Default value is -1 (disabled).
+
+   Example 1.10. Set natping_disable_bflag parameter
+...
+modparam("nathelper", "natping_disable_bflag", 8)
+...
+
 4.11. nortpproxy_str (string)
 4.11. nortpproxy_str (string)
 
 
    The parameter sets the SDP attribute used by nathelper to mark the
    The parameter sets the SDP attribute used by nathelper to mark the

+ 22 - 22
modules/nathelper/doc/nathelper_admin.xml

@@ -282,28 +282,6 @@ modparam("nathelper", "received_avp", "$avp(i:42)")
 ...
 ...
 modparam("nathelper", "sipping_bflag", 7)
 modparam("nathelper", "sipping_bflag", 7)
 ...
 ...
-</programlisting>
-		</example>
-	</section>
-	<section>
-		<title><varname>sipping_disable_bflag</varname> (integer)</title>
-		<para>
-		What branch flag should be used by the module to disable NAT pings
-		on a per-registration basis. If the given flag is set for a
-		particular registration, then no NAT pings will be sent at all,
-		regardless of any other conditions.
-		</para>
-		<para>
-		<emphasis>
-			Default value is -1 (disabled).
-		</emphasis>
-		</para>
-		<example>
-		<title>Set <varname>sipping_disable_bflag</varname> parameter</title>
-		<programlisting format="linespecific">
-...
-modparam("nathelper", "sipping_disable_bflag", 8)
-...
 </programlisting>
 </programlisting>
 		</example>
 		</example>
 	</section>
 	</section>
@@ -346,6 +324,28 @@ modparam("nathelper", "sipping_from", "sip:[email protected]")
 ...
 ...
 modparam("nathelper", "sipping_method", "INFO")
 modparam("nathelper", "sipping_method", "INFO")
 ...
 ...
+</programlisting>
+		</example>
+	</section>
+	<section>
+		<title><varname>natping_disable_bflag</varname> (integer)</title>
+		<para>
+		What branch flag should be used by the module to disable NAT pings
+		on a per-registration basis. If the given flag is set for a
+		particular registration, then no NAT pings will be sent at all,
+		regardless of any other conditions.
+		</para>
+		<para>
+		<emphasis>
+			Default value is -1 (disabled).
+		</emphasis>
+		</para>
+		<example>
+		<title>Set <varname>natping_disable_bflag</varname> parameter</title>
+		<programlisting format="linespecific">
+...
+modparam("nathelper", "natping_disable_bflag", 8)
+...
 </programlisting>
 </programlisting>
 		</example>
 		</example>
 	</section>
 	</section>

+ 4 - 4
modules/nathelper/nathelper.c

@@ -339,7 +339,7 @@ static const char sbuf[4] = {0, 0, 0, 0};
 static char *force_socket_str = 0;
 static char *force_socket_str = 0;
 static pid_t mypid;
 static pid_t mypid;
 static int sipping_flag = -1;
 static int sipping_flag = -1;
-static int sipping_disable_flag = -1;
+static int natping_disable_flag = -1;
 static int natping_processes = 1;
 static int natping_processes = 1;
 
 
 static str nortpproxy_str = str_init("a=nortpproxy:yes");
 static str nortpproxy_str = str_init("a=nortpproxy:yes");
@@ -413,7 +413,7 @@ static param_export_t params[] = {
 	{"sipping_from",          STR_PARAM, &sipping_from.s        },
 	{"sipping_from",          STR_PARAM, &sipping_from.s        },
 	{"sipping_method",        STR_PARAM, &sipping_method.s      },
 	{"sipping_method",        STR_PARAM, &sipping_method.s      },
 	{"sipping_bflag",         INT_PARAM, &sipping_flag          },
 	{"sipping_bflag",         INT_PARAM, &sipping_flag          },
-	{"sipping_disable_bflag", INT_PARAM, &sipping_disable_flag  },
+	{"natping_disable_bflag", INT_PARAM, &natping_disable_flag  },
 	{"natping_processes",     INT_PARAM, &natping_processes     },
 	{"natping_processes",     INT_PARAM, &natping_processes     },
 	{"natping_socket",        STR_PARAM, &natping_socket        },
 	{"natping_socket",        STR_PARAM, &natping_socket        },
 	{"keepalive_timeout",     INT_PARAM, &nh_keepalive_timeout  },
 	{"keepalive_timeout",     INT_PARAM, &nh_keepalive_timeout  },
@@ -678,7 +678,7 @@ mod_init(void)
 		}
 		}
 
 
 		sipping_flag = (sipping_flag==-1)?0:(1<<sipping_flag);
 		sipping_flag = (sipping_flag==-1)?0:(1<<sipping_flag);
-		sipping_disable_flag = (sipping_disable_flag==-1)?0:(1<<sipping_disable_flag);
+		natping_disable_flag = (natping_disable_flag==-1)?0:(1<<natping_disable_flag);
 
 
 		/* set reply function if SIP natping is enabled */
 		/* set reply function if SIP natping is enabled */
 		if (sipping_flag) {
 		if (sipping_flag) {
@@ -1997,7 +1997,7 @@ nh_timer(unsigned int ticks, void *timer_idx)
 		memcpy( &aorhash, cp, sizeof(aorhash));
 		memcpy( &aorhash, cp, sizeof(aorhash));
 		cp = (char*)cp + sizeof(aorhash);
 		cp = (char*)cp + sizeof(aorhash);
 
 
-		if ((flags & sipping_disable_flag)) /* always 0 if sipping_disable_flag not set */
+		if ((flags & natping_disable_flag)) /* always 0 if natping_disable_flag not set */
 			continue;
 			continue;
 
 
 		/* determin the destination */
 		/* determin the destination */