sortlist.c revision 70e5a7403f0e0a3bd292b8287c5fed5772c15270
/*
* Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000, 2001 Internet Software Consortium.
*
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: sortlist.c,v 1.15 2007/06/19 23:46:59 tbox Exp $ */
/*! \file */
#include <config.h>
#include <named/sortlist.h>
const void **argp)
{
unsigned int i;
goto dont_sort;
/*
* 'e' refers to the current 'top level statement'
* in the sortlist (see ARM).
*/
if (e->type == dns_aclelementtype_nestedacl) {
goto dont_sort;
goto dont_sort;
} else {
/*
* BIND 8 allows bare elements at the top level
* as an undocumented feature.
*/
try_elt = e;
}
&matched_elt)) {
return (NS_SORTLISTTYPE_2ELEMENT);
return (NS_SORTLISTTYPE_2ELEMENT);
return (NS_SORTLISTTYPE_2ELEMENT);
} else {
/*
* BIND 8 allows a bare IP prefix as
* the 2nd element of a 2-element
* sortlist statement.
*/
return (NS_SORTLISTTYPE_1ELEMENT);
}
} else {
*argp = matched_elt;
return (NS_SORTLISTTYPE_1ELEMENT);
}
}
}
/* No match; don't sort. */
return (NS_SORTLISTTYPE_NONE);
}
int
int match;
if (match > 0)
return (match);
else if (match < 0)
else
return (INT_MAX / 2);
}
int
NULL)) {
return (0);
} else {
return (INT_MAX);
}
}
void
const void **argp)
{
switch (sortlisttype) {
case NS_SORTLISTTYPE_1ELEMENT:
break;
case NS_SORTLISTTYPE_2ELEMENT:
break;
case NS_SORTLISTTYPE_NONE:
break;
default:
"unexpected return from ns_sortlist_setup(): "
"%d", sortlisttype);
break;
}
}