mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-25 09:09:40 -05:00
iana ports automated.
git-svn-id: file:///svn/unbound/trunk@1028 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
20ee8c10f5
commit
234defa371
6 changed files with 1977 additions and 29 deletions
|
|
@ -293,6 +293,13 @@ download_ldns:
|
||||||
mv ldns-*_pre_*.tar.gz ldns-src.tar.gz
|
mv ldns-*_pre_*.tar.gz ldns-src.tar.gz
|
||||||
rm ldns-*_pre_*.tar.gz.sha1 ldns_makedist.sh
|
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.
|
# Automatic dependencies.
|
||||||
$(BUILD)%.d: $(srcdir)/%.c
|
$(BUILD)%.d: $(srcdir)/%.c
|
||||||
$(INFO) Depend $<
|
$(INFO) Depend $<
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
10 April 2008: Wouter
|
10 April 2008: Wouter
|
||||||
- --with-libevent works with latest libevent 1.4.99-trunk.
|
- --with-libevent works with latest libevent 1.4.99-trunk.
|
||||||
- added log file statistics perl script to contrib.
|
- added log file statistics perl script to contrib.
|
||||||
|
- automatic iana ports update from makefile.
|
||||||
|
|
||||||
9 April 2008: Wouter
|
9 April 2008: Wouter
|
||||||
- configure can detect libev(from its build directory) when passed
|
- configure can detect libev(from its build directory) when passed
|
||||||
|
|
|
||||||
|
|
@ -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_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_XXD='fwd_compress_c00c.tpkg'
|
||||||
NEED_NC='fwd_compress_c00c.tpkg'
|
NEED_NC='fwd_compress_c00c.tpkg'
|
||||||
|
NEED_CURL='06-ianaports.tpkg'
|
||||||
|
|
||||||
cd testdata;
|
cd testdata;
|
||||||
sh ../testcode/mini_tpkg.sh clean
|
sh ../testcode/mini_tpkg.sh clean
|
||||||
|
|
@ -21,6 +22,11 @@ for test in `ls *.tpkg`; do
|
||||||
SKIP=1;
|
SKIP=1;
|
||||||
fi
|
fi
|
||||||
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 echo $NEED_LDNS_TESTNS | grep $test >/dev/null; then
|
||||||
if test ! -x "`which ldns-testns`"; then
|
if test ! -x "`which ldns-testns`"; then
|
||||||
SKIP=1;
|
SKIP=1;
|
||||||
|
|
|
||||||
BIN
testdata/06-ianaports.tpkg
vendored
Normal file
BIN
testdata/06-ianaports.tpkg
vendored
Normal file
Binary file not shown.
|
|
@ -455,12 +455,10 @@ config_delete(struct config_file* cfg)
|
||||||
static void
|
static void
|
||||||
init_outgoing_availports(int* a, int num)
|
init_outgoing_availports(int* a, int num)
|
||||||
{
|
{
|
||||||
/* generated with
|
/* generated with make iana_update */
|
||||||
grep "/udp" /etc/services | awk '{print $2;}' | sed -e 's?/udp??' | sort -n | grep -v 0 | sed -e 's/^\(.*\)$/\1,/' > util/iana_ports.inc
|
|
||||||
*/
|
|
||||||
const int iana_assigned[] = {
|
const int iana_assigned[] = {
|
||||||
#include "util/iana_ports.inc"
|
#include "util/iana_ports.inc"
|
||||||
0 }; /* trailing 0 to put behind trailing comma */
|
-1 }; /* end marker to put behind trailing comma */
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
/* do not use <1024, that could be trouble with the system, privs */
|
/* 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;
|
a[i] = i;
|
||||||
}
|
}
|
||||||
/* pick out all the IANA assigned ports */
|
/* 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)
|
if(iana_assigned[i] < num)
|
||||||
a[iana_assigned[i]] = 0;
|
a[iana_assigned[i]] = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1984
util/iana_ports.inc
1984
util/iana_ports.inc
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue