Merge "Add usage message to dectect new versions of IpUtilsIpVersionPingInterface"

This commit is contained in:
Zuul
2025-08-07 07:27:24 +00:00
committed by Gerrit Code Review

View File

@@ -274,12 +274,62 @@ Usage: ping -6 [-aAbBdDfhLnOqrRUvV] [-c count] [-i interval] [-I interface]
""".strip()
IP_VERSION_IPUTILS_PING_USAGE_NEW = """
ping: invalid option -- '-'
Usage
ping [options] <destination>
Options:
<destination> dns name or ip address
-a use audible ping
-A use adaptive ping
-B sticky source address
-c <count> stop after <count> replies
-D print timestamps
-d use SO_DEBUG socket option
-f flood ping
-h print help and exit
-I <interface> either interface name or address
-i <interval> seconds between sending each packet
-L suppress loopback of multicast packets
-l <preload> send <preload> number of packages while waiting replies
-m <mark> tag the packets going out
-M <pmtud opt> define mtu discovery, can be one of <do|dont|want>
-n no dns name resolution
-O report outstanding replies
-p <pattern> contents of padding byte
-q quiet output
-Q <tclass> use quality of service <tclass> bits
-s <size> use <size> as number of data bytes to be sent
-S <size> use <size> as SO_SNDBUF socket option value
-t <ttl> define time to live
-U print user-to-user latency
-v verbose output
-V print version and exit
-w <deadline> reply wait <deadline> in seconds
-W <timeout> time to wait for response
IPv4 options:
-4 use IPv4
-b allow pinging broadcast
-R record route
-T <timestamp> define timestamp, can be one of {timestamp_formats}
IPv6 options:
-6 use IPv6
-F <flowlabel> define flow label, default is random
-N <nodeinfo opt> use icmp6 node info query, try <help> as argument
""".strip().format(timestamp_formats="<tsonly|tsandaddr|tsprespec>")
@ping_interface
class IpUtilsIpVersionPingInterface(IpUtilsPingInterface,
IpVersionPingInterface):
def match_ping_usage(self, usage):
return usage.startswith(IP_VERSION_IPUTILS_PING_USAGE)
return (usage.startswith(IP_VERSION_IPUTILS_PING_USAGE) or
usage.startswith(IP_VERSION_IPUTILS_PING_USAGE_NEW))
BUSYBOX_PING_USAGE = """