iana ports automated.

git-svn-id: file:///svn/unbound/trunk@1028 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2008-04-10 10:52:22 +00:00
parent 20ee8c10f5
commit 234defa371
6 changed files with 1977 additions and 29 deletions

View file

@ -293,6 +293,13 @@ download_ldns:
mv ldns-*_pre_*.tar.gz ldns-src.tar.gz
rm ldns-*_pre_*.tar.gz.sha1 ldns_makedist.sh
iana_update:
curl http://www.iana.org/assignments/port-numbers -o port-numbers.tmp
egrep -v "Unassigned|Reserved" port-numbers.tmp | awk '{ match($$0, "[0-9]+/udp"); if (RLENGTH > 0) print substr($$0, RSTART, RLENGTH - 4) ","}' | sort -nu > portslist.tmp
-diff util/iana_ports.inc portslist.tmp
cat portslist.tmp > util/iana_ports.inc
rm -f port-numbers.tmp portslist.tmp
# Automatic dependencies.
$(BUILD)%.d: $(srcdir)/%.c
$(INFO) Depend $<

View file

@ -1,6 +1,7 @@
10 April 2008: Wouter
- --with-libevent works with latest libevent 1.4.99-trunk.
- added log file statistics perl script to contrib.
- automatic iana ports update from makefile.
9 April 2008: Wouter
- configure can detect libev(from its build directory) when passed

View file

@ -5,6 +5,7 @@ NEED_DOXYGEN='01-doc.tpkg'
NEED_LDNS_TESTNS='fwd_no_edns.tpkg fwd_tcp_tc.tpkg fwd_tcp.tpkg fwd_three_service.tpkg fwd_three.tpkg fwd_ttlexpire.tpkg fwd_udp.tpkg fwd_tcp_tc6.tpkg fwd_compress_c00c.tpkg fwd_ancil.tpkg stat_timer.tpkg 05-asynclook.tpkg stream_tcp.tpkg speed_cache.tpkg'
NEED_XXD='fwd_compress_c00c.tpkg'
NEED_NC='fwd_compress_c00c.tpkg'
NEED_CURL='06-ianaports.tpkg'
cd testdata;
sh ../testcode/mini_tpkg.sh clean
@ -21,6 +22,11 @@ for test in `ls *.tpkg`; do
SKIP=1;
fi
fi
if echo $NEED_CURL | grep $test >/dev/null; then
if test ! -x "`which curl`"; then
SKIP=1;
fi
fi
if echo $NEED_LDNS_TESTNS | grep $test >/dev/null; then
if test ! -x "`which ldns-testns`"; then
SKIP=1;

BIN
testdata/06-ianaports.tpkg vendored Normal file

Binary file not shown.

View file

@ -455,12 +455,10 @@ config_delete(struct config_file* cfg)
static void
init_outgoing_availports(int* a, int num)
{
/* generated with
grep "/udp" /etc/services | awk '{print $2;}' | sed -e 's?/udp??' | sort -n | grep -v 0 | sed -e 's/^\(.*\)$/\1,/' > util/iana_ports.inc
*/
/* generated with make iana_update */
const int iana_assigned[] = {
#include "util/iana_ports.inc"
0 }; /* trailing 0 to put behind trailing comma */
-1 }; /* end marker to put behind trailing comma */
int i;
/* do not use <1024, that could be trouble with the system, privs */
@ -468,7 +466,7 @@ init_outgoing_availports(int* a, int num)
a[i] = i;
}
/* pick out all the IANA assigned ports */
for(i=0; iana_assigned[i]; i++) {
for(i=0; iana_assigned[i]!=-1; i++) {
if(iana_assigned[i] < num)
a[iana_assigned[i]] = 0;
}

File diff suppressed because it is too large Load diff