summaryrefslogtreecommitdiffstats
path: root/net/ping.c
Commit message (Collapse)AuthorAgeFilesLines
* net: dns: return error codesSascha Hauer2018-11-291-3/+3
| | | | | | | | | | | | | | The resolv() function used to return the IP address. When net_udp_new() fails we return an error code though which the callers of resolv() take as an IP address. This is wrong of course and we could return 0 in this case. Instead we return an error code and pass the resolved IP as a pointer which allows us to return proper error codes. This patch also adds error messages and error returns to the various callers of resolv() which used to just continue with a zero IP and let the user figure out what went wrong. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ping command: Print which host is pingedSascha Hauer2018-11-291-0/+2
| | | | | | | | When a hostname instead a IP is given to the ping command then the IP the host is resolved to is a useful information. Add a message printing it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: ping: return an error exit code when connection failsMirko Damiani2015-04-031-3/+3
| | | | | | | | | ping command does not always returns 1 as exit code when connection to host fails. In particular it returns the exit code of the previous run. This patch fixes this issue. Signed-off-by: Mirko Damiani <mirko@develer.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: harmonize in-barebox documentationHolger Schurig2014-05-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does probably too much, but it's hard (and very cumbersome/time consuming) to break it out. What is does is this: * each command has one short description, e.g. "list MUX configuration" * made sure the short descriptions start lowercase * each command has one usage. That string contains just the options, e.g. "[-npn]". It's not part of the long help text. * that is, it doesn't say "[OPTIONS]" anymore, every usable option is listed by character in this (short) option string (the long description is in the long help text, as before) * help texts have been reworked, to make them - sometimes smaller - sometimes describe the options better - more often present themselves in a nicer format * all long help texts are now created with BUSYBOX_CMD_HELP_ macros, no more 'static const __maybe_unused char cmd_foobar_help[]' * made sure the long help texts starts uppercase * because cmdtp->name and cmdtp->opts together provide the new usage, all "Usage: foobar" texts have been removed from the long help texts * BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this is nicer in the source code * BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself * made sure no line gets longer than 77 characters * delibertely renamed cmdtp->usage, so that we can get compile-time errors (e.g. in out-of-tree modules that use register_command() * the 'help' command can now always emit the usage, even without compiled long help texts * 'help -v' gives a list of commands with their short description, this is similar like the old "help" command before my patchset * 'help -a' gives out help of all commands Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: group 'help' outputHolger Schurig2014-05-141-0/+1
| | | | | | | | | | | | | | | | | | | The old output of "help" was just producing a long list, that usually scrolled of the screen (even on a X11 terminal). This list is more compact, and also sorted by groups. The old output format (plus grouping) is now available with 'help -v'. Example: Information commands: ?, devinfo, help, iomem, meminfo, version Boot commands: boot, bootm, go, loadb, loads, loadx, loady, saves, uimage ... Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: ping: do not retry endlesslyWolfram Sang2012-04-051-0/+7
| | | | | Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: ping: remove unneeded initializationWolfram Sang2012-04-051-1/+1
| | | | | Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: ping: send PING packets with 1-second intervalWolfram Sang2012-04-051-1/+2
| | | | | | | Like standard ping does by default. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: remove struct command pointer from commandsSascha Hauer2012-02-271-1/+1
| | | | | | This is unused in all commands and thus can be removed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: add a context to the packet handlerSascha Hauer2011-04-121-2/+2
| | | | | | | This is not yet used, but with this the different network commands can get rid of their global data. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ping: make locally used functions staticSascha Hauer2010-10-211-2/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ping: resolv hostnamesSascha Hauer2010-06-171-1/+7
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* implement ping using new network stackSascha Hauer2010-06-171-73/+74
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: remove need for eth_halt/eth_openSascha Hauer2010-06-171-1/+0
| | | | | | | | | | | We used to eth_open/eth_halt the network devices during NetLoopInit which is called whenever the user enters a network command. Change this behaviour so that the current network device gets opened when making it the current one. With this change it's always possible to send packages and we are able to implement a new network stack in the next step. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* replace ET_DEBUG with pr_debugSascha Hauer2010-02-011-3/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove typedef cmd_tbl_t and replace it with struct commandSascha Hauer2010-02-011-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rename U-Boot-v2 project to bareboxSascha Hauer2009-12-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This has been done with the following script: find -path ./.git -prune -o -type f -print0 | xargs -0 -r sed -i \ -e 's/u2boot/barebox/g' \ -e 's/U2Boot/barebox/g' \ -e 's/U-boot V2/barebox/g' \ -e 's/u-boot v2/barebox/g' \ -e 's/U-Boot V2/barebox/g' \ -e 's/U-Boot-v2/barebox/g' \ -e 's/U_BOOT/BAREBOX/g' \ -e 's/UBOOT/BAREBOX/g' \ -e 's/uboot/barebox/g' \ -e 's/u-boot/barebox/g' \ -e 's/u_boot/barebox/g' \ -e 's/U-Boot/barebox/g' \ -e 's/U-boot/barebox/g' \ -e 's/U-BOOT/barebox/g' find -path ./.git -prune -o \( -name "*u-boot*" -o -name "*uboot*" -o -name "*u_boot*" \) -print0 | \ xargs -0 -r rename 's/u[-_]?boot/barebox/' It needs some manual fixup following in the next patch Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: remove maxargsSascha Hauer2009-10-191-1/+0
| | | | | | | No need to check for maximum argument counts. The commands are safe to be called with more arguments, so lets safe some bytes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: return COMMAND_ERROR_USAGESascha Hauer2009-10-191-4/+2
| | | | | | | instead of calling u_boot_cmd_usage in each command to safe space. Signed-off-by: Sascha Hauer <sha@pengutronix.de>
* ping: shorten usage infoSascha Hauer2009-10-191-1/+1
| | | | Signed-off-by: Sascha Hauer <sha@pengutronix.de>
* ping: do not return -1 in commandSascha Hauer2009-10-191-5/+2
| | | | | | Also, print usage if not enough arguments given. Signed-off-by: Sascha Hauer <sha@pengutronix.de>
* only the ping code is interested in the ping ipSascha Hauer2009-10-131-0/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ping.c: refactorSascha Hauer2009-10-131-9/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: remove switch/case in NetLoop()Sascha Hauer2009-10-131-1/+3
| | | | | | | | Instead of having a big switch/case for every protocol, do the right things in the individual functions before callong NetLoop(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: split NetLoop in NetLoop and NetLoopInitSascha Hauer2009-10-131-0/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: remove NetStartAgain()Sascha Hauer2009-10-131-1/+0
| | | | | | Do not let the network stack restart itself Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Fix string_to_ipSascha Hauer2008-08-201-2/+1
| | | | | | | | Use a pointer to an ip address instead of the return value in string_to_ip and use the return value for error indication only. 0.0.0.0 can be a valid ip address Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ping.c: remove volatile from variablesSascha Hauer2008-03-311-4/+4
|
* remove unneeded colatile from variableSascha Hauer2007-10-111-1/+1
|
* remove u-boot command paramter flagSascha Hauer2007-09-241-1/+1
|
* svn_rev_556Sascha Hauer2007-07-051-1/+1
| | | | unify help string style
* svn_rev_462Sascha Hauer2007-07-051-1/+1
| | | | | | | - Add help texts for many commands. - Let the linker sort the command table. - Add support for multiple argmuments in several commands (mkdir, rmdir, rm, cat)
* svn_rev_420Sascha Hauer2007-07-051-5/+5
| | | | | | | | | | | - do more POSIX: - use DIR instead of struct dirent - use (struct dirent)->d_name instead of (struct dirent)->name - switch to a new layout for U_BOOT_CMD: - use C99 initializers to be able to add more fields to the command struct - add aliases for commands (needed mainly for help -> ? and test -> [ - This is not done for all commands yet, but the compiler will tell you ;)
* svn_rev_101Sascha Hauer2007-07-051-0/+116