<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
"http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd">
-<!-- File: $Id: Bv9ARM-book.xml,v 1.72 2000/12/20 03:36:18 marka Exp $ -->
+<!-- File: $Id: Bv9ARM-book.xml,v 1.72.2.1 2001/01/05 23:44:54 gson Exp $ -->
<book>
<para> This is the grammar of the <command>lwres</command>
statement in the <filename>named.conf</filename> file:</para>
<programlisting><command>lwres</command> {
- <optional> listen-on { <replaceable>address_match_list</replaceable> }; </optional>
+ <optional> listen-on { <replaceable>ip_addr</replaceable> <optional>port <replaceable>ip_port</replaceable></optional> ; <optional> <replaceable>ip_addr</replaceable> <optional>port <replaceable>ip_port</replaceable></optional> ; ... </optional> }; </optional>
<optional> view <replaceable>view_name</replaceable>; </optional>
<optional> search { <replaceable>domain_name</replaceable> ; <optional> <replaceable>ip_addr</replaceable> ; ... </optional> }; </optional>
<optional> ndots <replaceable>number</replaceable>; </optional>
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: confparser.y.dirty,v 1.44 2000/12/20 03:36:19 marka Exp $ */
+/* $Id: confparser.y.dirty,v 1.44.2.1 2001/01/05 23:44:56 gson Exp $ */
#include <config.h>
/*
* XXXJAB The #define for the default OMAPI port is not available
* to us, so we make our own.
+ *
+ * XXXBEW Same goes for the default LWRES port.
*/
#define OMAPI_DEFAULT_PORT 953
+#define LWRES_DEFAULT_PORT 921
#define CONF_MAX_IDENT 1024
isc_boolean_t createIfNeeded);
static isc_boolean_t keydefinedinscope(dns_c_ctx_t *cfg,
const char *name);
+static void replace_zero_ports(dns_c_iplist_t *list,
+ in_port_t val);
}
| L_ALSO_NOTIFY port_ip_list
{
+ replace_zero_ports($2, default_port);
tmpres = dns_c_ctx_setalsonotify(currcfg, $2);
dns_c_iplist_detach(&$2);
{
in_port_t port = $1;
dns_c_iplist_t *list = $3;
- unsigned int i;
-
- if (port == 0)
- port = default_port;
- for (i = 0 ; i < list->nextidx ; i++) {
- if (isc_sockaddr_getport(&list->ips[i]) == 0) {
- isc_sockaddr_setport(&list->ips[i], port);
- }
- }
+ if (port != 0)
+ replace_zero_ports(list, port);
$$ = list;
};
{
dns_c_view_t *view = dns_c_ctx_getcurrview(currcfg);
+ replace_zero_ports($2, default_port);
+
INSIST(view != NULL);
tmpres = dns_c_view_setalsonotify(view, $2);
INSIST(zone != NULL);
+ replace_zero_ports($2, default_port);
+
tmpres = dns_c_zone_setmasterips(zone, $2, ISC_FALSE);
if (tmpres == ISC_R_EXISTS) {
parser_error(ISC_FALSE,
INSIST(zone != NULL);
+ replace_zero_ports($2, default_port);
+
tmpres = dns_c_zone_setalsonotify(zone, $2, ISC_FALSE);
if (tmpres == ISC_R_EXISTS) {
parser_error(ISC_FALSE,
lwres_option: L_LISTEN_ON port_ip_list
{
dns_c_lwres_t *lwres;
+
+ replace_zero_ports($2, LWRES_DEFAULT_PORT);
+
lwres = ISC_LIST_TAIL(currcfg->lwres->lwreslist);
tmpres = dns_c_lwres_setlistenon(lwres, $2);
dns_c_iplist_detach(&$2);
return (rval);
}
+
+static void
+replace_zero_ports(dns_c_iplist_t *list, in_port_t val) {
+ unsigned int i;
+
+ for (i = 0 ; i < list->nextidx ; i++) {
+ if (isc_sockaddr_getport(&list->ips[i]) == 0)
+ isc_sockaddr_setport(&list->ips[i], val);
+ }
+}