aboutsummaryrefslogtreecommitdiff
path: root/networking/nslookup.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* nslookup: implement support for SRV recordsJo-Philipp Wich2019-10-271-0/+20
| | | | | | | | | | | Add support for querying and parsing SRV DNS records. function old new delta send_queries 1711 1865 +154 qtypes 72 80 +8 Signed-off-by: Jo-Philipp Wich <jo@mein.io> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nslookup: handle replies without RRsJo-Philipp Wich2019-10-271-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Under some circumstances, a DNS reply might contain no resource records, e.g. when a valid domain is queried that does not have records of the requested type. Example with nslookup from BIND dnsutils: $ nslookup -q=SRV example.org Server: 10.11.12.13 Address: 10.11.12.13#53 Non-authoritative answer: *** Can't find example.org: No answer Currently the busybox nslookup applet simply prints nothing after the "Non-authoritative answer:" line in the same situation. This change modifies nslookup to either print "Parse error" or "No answer" diagnostics, depending on the parse_reply() return value. function old new delta send_queries 1676 1711 +35 Signed-off-by: Jo-Philipp Wich <jo@mein.io> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: reduce the overhead of single parameter bb_error_msg() callsJames Byrne2019-07-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Back in 2007, commit 0c97c9d43707 ("'simple' error message functions by Loic Grenie") introduced bb_simple_perror_msg() to allow for a lower overhead call to bb_perror_msg() when only a string was being printed with no parameters. This saves space for some CPU architectures because it avoids the overhead of a call to a variadic function. However there has never been a simple version of bb_error_msg(), and since 2007 many new calls to bb_perror_msg() have been added that only take a single parameter and so could have been using bb_simple_perror_message(). This changeset introduces 'simple' versions of bb_info_msg(), bb_error_msg(), bb_error_msg_and_die(), bb_herror_msg() and bb_herror_msg_and_die(), and replaces all calls that only take a single parameter, or use something like ("%s", arg), with calls to the corresponding 'simple' version. Since it is likely that single parameter calls to the variadic functions may be accidentally reintroduced in the future a new debugging config option WARN_SIMPLE_MSG has been introduced. This uses some macro magic which will cause any such calls to generate a warning, but this is turned off by default to avoid use of the unpleasant macros in normal circumstances. This is a large changeset due to the number of calls that have been replaced. The only files that contain changes other than simple substitution of function calls are libbb.h, libbb/herror_msg.c, libbb/verror_msg.c and libbb/xfuncs_printf.c. In miscutils/devfsd.c, networking/udhcp/common.h and util-linux/mdev.c additonal macros have been added for logging so that single parameter and multiple parameter logging variants exist. The amount of space saved varies considerably by architecture, and was found to be as follows (for 'defconfig' using GCC 7.4): Arm: -92 bytes MIPS: -52 bytes PPC: -1836 bytes x86_64: -938 bytes Note that for the MIPS architecture only an exception had to be made disabling the 'simple' calls for 'udhcp' (in networking/udhcp/common.h) because it made these files larger on MIPS. Signed-off-by: James Byrne <james.byrne@origamienergy.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nslookup: return exitcode 1 on resolution errorsDenys Vlasenko2019-01-091-4/+8
| | | | | | | | function old new delta nslookup_main 757 760 +3 send_queries 1690 1677 -13 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* config: update size informationDenys Vlasenko2018-12-281-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nslookup: add support for search domains, closes 11161Denys Vlasenko2018-08-011-22/+82
| | | | | | | | | | | function old new delta parse_resolvconf - 311 +311 add_query_with_search - 105 +105 nslookup_main 873 757 -116 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 0/1 up/down: 416/-116) Total: 300 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nslookup: placate "warning: unused variable i"Denys Vlasenko2018-06-271-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nslookup: simplify make_ptrDenys Vlasenko2018-04-151-37/+34
| | | | | | | function old new delta nslookup_main 2644 2611 -33 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nslookup: get rid of query::rlen fieldDenys Vlasenko2018-04-151-10/+15
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nslookup: move array of queries to "globals"Denys Vlasenko2018-04-151-48/+38
| | | | | | | | | | function old new delta add_query 95 89 -6 nslookup_main 2692 2641 -51 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-57) Total: -57 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nslookup: accept lowercase -type=soa, document query typesDenys Vlasenko2018-04-151-2/+3
| | | | | | | | | | | | | Usage: nslookup [-type=QUERY_TYPE] [-debug] HOST [DNS_SERVER] Query DNS about HOST QUERY_TYPE: soa,ns,a,aaaa,cname,mx,txt,ptr,any function old new delta packed_usage 32189 32258 +69 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nslookup: change -stats to -debug (it's a bug in bind that it accepts -s)Denys Vlasenko2018-04-151-8/+11
| | | | | | | | | | function old new delta packed_usage 32211 32189 -22 nslookup_main 2754 2692 -62 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-84) Total: -84 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nslookup: rework option parsingDenys Vlasenko2018-04-151-91/+113
| | | | | | | | | | | | | | function old new delta nslookup_main 2715 2754 +39 packed_usage 32179 32211 +32 add_ns 65 66 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 72/0) Total: 72 bytes text data bss dec hex filename 926262 555 5740 932557 e3acd busybox_old 926239 555 5740 932534 e3ab6 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nslookup: smaller qtypes[] arrayDenys Vlasenko2018-04-151-9/+6
| | | | | | | | | | | | | function old new delta nslookup_main 2708 2715 +7 qtypes 80 72 -8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 7/-8) Total: -1 bytes text data bss dec hex filename 926277 555 5740 932572 e3adc busybox_old 926262 555 5740 932557 e3acd busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nslookup: process replies immediately, do not store themDenys Vlasenko2018-04-151-86/+110
| | | | | | | | | | function old new delta nslookup_main 1837 2708 +871 parse_reply 852 - -852 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/0 up/down: 871/-852) Total: 19 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nslookup: fix output corruption for "nslookup 1.2.3.4"Denys Vlasenko2018-04-141-4/+2
| | | | | | | function old new delta nslookup_main 1832 1837 +5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nslookup: more closely resemble output format of bind-utils-9.11.3Denys Vlasenko2018-04-141-35/+17
| | | | | | | | | | function old new delta nslookup_main 1880 1832 -48 parse_reply 1022 852 -170 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-218) Total: -218 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nslookup: shrink send_queries()Denys Vlasenko2018-04-141-118/+123
| | | | | | | | | | | | | function old new delta rcodes 68 64 -4 nslookup_main 2007 1880 -127 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-131) Total: -131 bytes text data bss dec hex filename 926735 555 5740 933030 e3ca6 busybox_old 926525 555 5740 932820 e3bd4 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nslookup: use xmalloc_sockaddr2dotted() instead of homegrown functionDenys Vlasenko2018-04-141-37/+11
| | | | | | | function old new delta nslookup_main 2091 2007 -84 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nslookup: usee bbox network functions instead of opne-coded messDenys Vlasenko2018-04-141-240/+70
| | | | | | | | | | function old new delta nslookup_main 2363 2091 -272 add_ns 663 65 -598 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-870) Total: -870 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nslookup: add openwrt / lede versionDenys Vlasenko2018-04-141-11/+908
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Needs work on size reduction function old new delta nslookup_main 114 2363 +2249 parse_reply - 1022 +1022 add_ns - 663 +663 ns_parserr - 486 +486 ns_initparse - 184 +184 ns_skiprr - 117 +117 add_query - 95 +95 qtypes - 80 +80 rcodes - 68 +68 dn_skipname - 58 +58 ns_name_uncompress - 56 +56 ns_get16 - 13 +13 v4_mapped - 12 +12 ns_get32 - 9 +9 res_init 3 - -3 __res_state 6 - -6 xmalloc_sockaddr2hostonly_noport 10 - -10 gai_strerror 47 - -47 set_default_dns 95 - -95 print_host 199 - -199 static.res 512 - -512 ------------------------------------------------------------------------------ (add/remove: 15/10 grow/shrink: 1/0 up/down: 5112/-872) Total: 4240 bytes text data bss dec hex filename 921944 555 6252 928751 e2bef busybox_old 927375 555 5740 933670 e3f26 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* config: deindent all help textsDenys Vlasenko2017-07-211-1/+1
| | | | | | Those two spaces after tab have no effect, and always a nuisance when editing. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Update remaining menuconfig items with approximate applet sizesDenys Vlasenko2017-07-191-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Convert all networking/* applets to "new style" applet definitionsDenys Vlasenko2016-11-231-0/+9
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nslookup: set default DNS server again. Hopefully helps with 675Denys Vlasenko2013-06-271-2/+13
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* move remaining help text from include/usage.src.hPere Orga2011-04-111-0/+14
| | | | | Signed-off-by: Pere Orga <gotrunks@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* don't call freeaddinfo(NULL)Vitaly Magerya2011-03-221-2/+2
| | | | | Signed-off-by: Vitaly Magerya <vmagerya@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: make GNU licensing statement forms more regularDenys Vlasenko2010-08-161-1/+1
| | | | | | | This change retains "or later" state! No licensing _changes_ here, only form is adjusted (article, space between "GPL" and "v2" and so on). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nslookup: glibc + IPv6 address of DNS server don't mix (yet)Denis Vlasenko2008-11-171-4/+9
|
* nslookup: allow usage of IPv6 addresses or hostnamesDenis Vlasenko2008-11-161-11/+26
| | | | | | for DNS server name; allow for port specification. Tested to work: "nslookup google.com [::1]:5353"
* nslookup: tiny shrink (-5 bytes); add comment about res_initDenis Vlasenko2008-11-041-8/+9
| | | | | inet_common: cosmetics, no code changes
* add -fvisibility=hidden to CC flags, mark XXX_main functionsDenis Vlasenko2007-10-111-1/+1
| | | | | EXTERNALLY_VISIBLE. 5% size reduction of libbusybox.so
* printf("%s\n") -> puts()Denis Vlasenko2007-10-011-1/+1
|
* introduce bb_putchar(). saves ~1800 on uclibc (less on glibc).Denis Vlasenko2007-09-271-1/+1
|
* introduce and use xdup2(int, int)Denis Vlasenko2007-08-181-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | stop checking whether setsockopt_reuseaddr(int fd) was successful (it always is) remove second parameter (sockllen) from xmalloc_sockaddr2xxxxx functions sockaddr2str 142 156 +14 collect_blk 467 474 +7 xdup2 28 33 +5 singlemount 4456 4454 -2 print_host 214 212 -2 nslookup_main 139 137 -2 ftpgetput_main 414 412 -2 udhcpd_main 1258 1255 -3 udhcpc_main 2405 2402 -3 traceroute_main 4125 4122 -3 nc_main 1072 1069 -3 buffer_fill_and_print 76 73 -3 xmalloc_sockaddr2hostonly_noport 18 14 -4 xmalloc_sockaddr2host_noport 18 14 -4 xmalloc_sockaddr2host 15 11 -4 xmalloc_sockaddr2dotted_noport 18 14 -4 xmalloc_sockaddr2dotted 18 14 -4 wget_main 2618 2614 -4 ping_main 393 389 -4 ip_port_str 120 115 -5 dhcprelay_main 1146 1141 -5 dnsd_main 1531 1525 -6 passwd_main 1110 1102 -8 udhcp_kernel_packet 206 197 -9 udhcp_listen_socket 154 144 -10 getty_main 2576 2566 -10 setup 655 640 -15 xmove_fd 51 34 -17 dolisten 759 742 -17 tcpudpsvd_main 1866 1836 -30 startservice 339 299 -40
* usage.c: remove reference to busybox.hDenis Vlasenko2007-05-261-1/+1
| | | | | *: s/include "busybox.h"/include "libbb.h"
* style fixes. No code changesDenis Vlasenko2007-04-121-1/+1
|
* add x to IPv6 functions which can dieDenis Vlasenko2007-02-041-1/+1
|
* suppress warnings about easch <applet>_main() havingDenis Vlasenko2007-02-031-0/+1
| | | | no preceding prototype
* clean up commented out old codeDenis Vlasenko2007-01-221-54/+1
|
* nslookup: full circle. Here we started IPv6 work. Use "new API"Denis Vlasenko2007-01-221-29/+88
| | | | and thus save a few bytes.
* - sed -i -e "/\$Id:/d;"Bernhard Reutner-Fischer2007-01-221-1/+0
|
* Trailing whitespace removal over entire treeDenis Vlasenko2007-01-111-3/+3
|
* wget: fix error message.Denis Vlasenko2006-11-101-1/+1
| | | | | | | | | | | | | | | Bad: wget http://127.0.0.1:81/fgdg/Makefile Connecting to 127.0.0.1[127.0.0.1]:81 : HTTP/1.0 404 Not Foundror 404 Not Found Good: wget http://127.0.0.1:81/fgdg/Makefile Connecting to 127.0.0.1[127.0.0.1]:81 get: server returned error: HTTP/1.0 404 Not Found nslookup: fix my mistake applets: make Bernhard Fischer <rep.nop@aon.at> happy :)
* small ipv6 doc changes; nslookup a tiny bit smallerDenis Vlasenko2006-11-071-2/+3
|
* nslookup: make it more IPv6 friendlyDenis Vlasenko2006-10-261-125/+80
|
* silly size savings and capitalization fixesDenis Vlasenko2006-10-261-2/+2
|
* Add one-line GPL boilerplate to these source files."Robert P. J. Day"2006-07-111-14/+1
|
* return failure when nslookup failsEric Andersen2004-10-131-2/+5
|
* Remove trailing whitespace. Update copyright to include 2004.Eric Andersen2004-03-151-2/+2
|