treewide: refactor help messages
Subsystems (2)
PATCH 1/1 treewide: refactor help messages
Every tool in the iproute2 package have one or more function to show an help message to the user. Some of these functions print the help line by line with a series of printf call, e.g. ip/xfrm_state.c does 60 fprintf calls.
If we group all the calls to a single one and just concatenate strings, we save a lot of libc calls and thus object size. The size difference of the compiled binaries calculated with bloat-o-meter is:
ip/ip:
add/remove: 0/0 grow/shrink: 5/15 up/down: 103/-4796 (-4693)
Total: Before=672591, After=667898, chg -0.70%
ip/rtmon:
add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-54 (-54)
Total: Before=48879, After=48825, chg -0.11%
tc/tc:
add/remove: 0/2 grow/shrink: 31/10 up/down: 882/-6133 (-5251)
Total: Before=351912, After=346661, chg -1.49%
bridge/bridge:
add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-459 (-459)
Total: Before=70502, After=70043, chg -0.65%
misc/lnstat:
add/remove: 0/1 grow/shrink: 1/0 up/down: 48/-486 (-438)
Total: Before=9960, After=9522, chg -4.40%
tipc/tipc:
add/remove: 0/0 grow/shrink: 1/1 up/down: 18/-62 (-44)
Total: Before=79182, After=79138, chg -0.06%While at it, indent some strings which were starting at column 0, and use tabs where possible, to have a consistent style across helps.
--- bridge/link.c | 35 +++++----- bridge/mdb.c | 5 +- ip/ip.c | 26 ++++---- ip/ip6tunnel.c | 35 +++++----- ip/ipaddress.c | 53 +++++++-------- ip/ipaddrlabel.c | 5 +- ip/ipila.c | 10 +-- ip/iplink.c | 107 +++++++++++++++--------------- ip/iplink_bridge.c | 66 +++++++++---------- ip/iplink_bridge_slave.c | 40 ++++++------ ip/iplink_geneve.c | 32 ++++----- ip/iplink_hsr.c | 24 +++---- ip/iplink_ipoib.c | 4 +- ip/iplink_vlan.c | 16 ++--- ip/iplink_vxlan.c | 54 +++++++-------- ip/ipmaddr.c | 5 +- ip/ipmonitor.c | 9 +-- ip/ipmroute.c | 10 +-- ip/ipneigh.c | 17 +++-- ip/ipnetns.c | 23 +++---- ip/ipntable.c | 12 ++-- ip/ipseg6.c | 13 ++-- ip/iptunnel.c | 25 +++---- ip/iptuntap.c | 13 ++-- ip/ipvrf.c | 9 +-- ip/link_gre.c | 63 ++++++++---------- ip/link_gre6.c | 73 ++++++++++----------- ip/link_ip6tnl.c | 67 ++++++++----------- ip/link_iptnl.c | 63 ++++++++---------- ip/link_vti.c | 24 +++---- ip/link_vti6.c | 24 +++---- ip/link_xfrm.c | 7 +- ip/rtmon.c | 9 +-- ip/tcp_metrics.c | 9 +-- ip/xfrm_monitor.c | 5 +- ip/xfrm_policy.c | 99 +++++++++++++++------------- ip/xfrm_state.c | 138 ++++++++++++++++++++++----------------- misc/lnstat.c | 47 ++++++------- misc/nstat.c | 24 +++---- tc/e_bpf.c | 28 ++++---- tc/f_basic.c | 16 +++-- tc/f_bpf.c | 62 +++++++++--------- tc/f_flow.c | 30 ++++----- tc/f_flower.c | 90 ++++++++++++------------- tc/f_fw.c | 19 ++---- tc/f_matchall.c | 16 +++-- tc/f_route.c | 12 ++-- tc/f_rsvp.c | 19 +++--- tc/f_tcindex.c | 7 +- tc/m_action.c | 26 ++++---- tc/m_bpf.c | 54 +++++++-------- tc/m_connmark.c | 5 +- tc/m_estimator.c | 9 +-- tc/m_gact.c | 3 +- tc/m_ife.c | 9 ++- tc/m_pedit.c | 2 +- tc/m_police.c | 18 ++--- tc/m_sample.c | 19 +++--- tc/m_simple.c | 5 +- tc/m_tunnel_key.c | 4 +- tc/q_atm.c | 5 +- tc/q_cake.c | 30 ++++----- tc/q_cbq.c | 20 +++--- tc/q_cbs.c | 6 +- tc/q_choke.c | 5 +- tc/q_codel.c | 7 +- tc/q_etf.c | 11 ++-- tc/q_fq.c | 15 +++-- tc/q_fq_codel.c | 11 ++-- tc/q_gred.c | 11 ++-- tc/q_hhf.c | 13 ++-- tc/q_mqprio.c | 13 ++-- tc/q_netem.c | 32 ++++----- tc/q_pie.c | 7 +- tc/q_red.c | 7 +- tc/q_sfq.c | 13 ++-- tc/q_taprio.c | 15 +++-- tc/q_tbf.c | 7 +- tc/tc.c | 12 ++-- tc/tc_class.c | 17 ++--- tc/tc_exec.c | 9 +-- tc/tc_qdisc.c | 25 +++---- tipc/bearer.c | 44 ++++++------- 83 files changed, 1066 insertions(+), 1022 deletions(-)
bridge/link.c +18 -17
@@ -254,23 +254,24 @@ int print_linkinfo(struct nlmsghdr *n, void *arg)static void usage (void ) { -fprintf (stderr,"Usage: bridge link set dev DEV [ cost COST ] [ priority PRIO ] [ state STATE ]\n" ); -fprintf (stderr," [ guard {on | off} ]\n" ); -fprintf (stderr," [ hairpin {on | off} ]\n" ); -fprintf (stderr," [ fastleave {on | off} ]\n" ); -fprintf (stderr," [ root_block {on | off} ]\n" ); -fprintf (stderr," [ learning {on | off} ]\n" ); -fprintf (stderr," [ learning_sync {on | off} ]\n" ); -fprintf (stderr," [ flood {on | off} ]\n" ); -fprintf (stderr," [ mcast_flood {on | off} ]\n" ); -fprintf (stderr," [ mcast_to_unicast {on | off} ]\n" ); -fprintf (stderr," [ neigh_suppress {on | off} ]\n" ); -fprintf (stderr," [ vlan_tunnel {on | off} ]\n" ); -fprintf (stderr," [ isolated {on | off} ]\n" ); -fprintf (stderr," [ hwmode {vepa | veb} ]\n" ); -fprintf (stderr," [ backup_port DEVICE ] [ nobackup_port ]\n" ); -fprintf (stderr," [ self ] [ master ]\n" ); -fprintf (stderr," bridge link show [dev DEV]\n" ); +fprintf (stderr, +"Usage: bridge link set dev DEV [ cost COST ] [ priority PRIO ] [ state STATE ]\n" +" [ guard {on | off} ]\n" +" [ hairpin {on | off} ]\n" +" [ fastleave {on | off} ]\n" +" [ root_block {on | off} ]\n" +" [ learning {on | off} ]\n" +" [ learning_sync {on | off} ]\n" +" [ flood {on | off} ]\n" +" [ mcast_flood {on | off} ]\n" +" [ mcast_to_unicast {on | off} ]\n" +" [ neigh_suppress {on | off} ]\n" +" [ vlan_tunnel {on | off} ]\n" +" [ isolated {on | off} ]\n" +" [ hwmode {vepa | veb} ]\n" +" [ backup_port DEVICE ] [ nobackup_port ]\n" +" [ self ] [ master ]\n" +" bridge link show [dev DEV]\n" );exit (-1 ); }
bridge/mdb.c +3 -2
@@ -30,8 +30,9 @@ static unsigned int filter_index, filter_vlan;static void usage (void ) { -fprintf (stderr,"Usage: bridge mdb { add | del } dev DEV port PORT grp GROUP [permanent | temp] [vid VID]\n" ); -fprintf (stderr," bridge mdb {show} [ dev DEV ] [ vid VID ]\n" ); +fprintf (stderr, +"Usage: bridge mdb { add | del } dev DEV port PORT grp GROUP [permanent | temp] [vid VID]\n" +" bridge mdb {show} [ dev DEV ] [ vid VID ]\n" );exit (-1 ); }
ip/ip.c +13 -13
@@ -45,19 +45,19 @@ static void usage(void) __attribute__((noreturn));static void usage (void ) {fprintf (stderr, -"Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n" -" ip [ -force ] -batch filename\n" -"where OBJECT := { link | address | addrlabel | route | rule | neigh | ntable |\n" -" tunnel | tuntap | maddress | mroute | mrule | monitor | xfrm |\n" -" netns | l2tp | fou | macsec | tcp_metrics | token | netconf | ila |\n" -" vrf | sr }\n" -" OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n" -" -h[uman-readable] | -iec | -j[son] | -p[retty] |\n" -" -f[amily] { inet | inet6 | mpls | bridge | link } |\n" -" -4 | -6 | -I | -D | -M | -B | -0 |\n" -" -l[oops] { maximum-addr-flush-attempts } | -br[ief] |\n" -" -o[neline] | -t[imestamp] | -ts[hort] | -b[atch] [filename] |\n" -" -rc[vbuf] [size] | -n[etns] name | -a[ll] | -c[olor]}\n" ); +"Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n" +" ip [ -force ] -batch filename\n" +"where OBJECT := { link | address | addrlabel | route | rule | neigh | ntable |\n" +" tunnel | tuntap | maddress | mroute | mrule | monitor | xfrm |\n" +" netns | l2tp | fou | macsec | tcp_metrics | token | netconf | ila |\n" +" vrf | sr }\n" +" OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n" +" -h[uman-readable] | -iec | -j[son] | -p[retty] |\n" +" -f[amily] { inet | inet6 | mpls | bridge | link } |\n" +" -4 | -6 | -I | -D | -M | -B | -0 |\n" +" -l[oops] { maximum-addr-flush-attempts } | -br[ief] |\n" +" -o[neline] | -t[imestamp] | -ts[hort] | -b[atch] [filename] |\n" +" -rc[vbuf] [size] | -n[etns] name | -a[ll] | -c[olor]}\n" );exit (-1 ); }
ip/ip6tunnel.c +18 -17
@@ -46,24 +46,25 @@ static void usage(void) __attribute__((noreturn));static void usage (void ) { -fprintf (stderr,"Usage: ip -f inet6 tunnel { add | change | del | show } [ NAME ]\n" ); -fprintf (stderr," [ mode { ip6ip6 | ipip6 | ip6gre | vti6 | any } ]\n" ); -fprintf (stderr," [ remote ADDR local ADDR ] [ dev PHYS_DEV ]\n" ); -fprintf (stderr," [ encaplimit ELIM ]\n" ); -fprintf (stderr," [ hoplimit TTL ] [ tclass TCLASS ] [ flowlabel FLOWLABEL ]\n" ); -fprintf (stderr," [ dscp inherit ]\n" ); -fprintf (stderr," [ [no]allow-localremote ]\n" ); -fprintf (stderr," [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n" ); -fprintf (stderr,"\n" ); -fprintf (stderr,"Where: NAME := STRING\n" ); -fprintf (stderr," ADDR := IPV6_ADDRESS\n" ); -fprintf (stderr," ELIM := { none | 0..255 }(default=%d)\n" , -IPV6_DEFAULT_TNL_ENCAP_LIMIT ); -fprintf (stderr," TTL := 0..255 (default=%d)\n" , +fprintf (stderr, +"Usage: ip -f inet6 tunnel { add | change | del | show } [ NAME ]\n" +" [ mode { ip6ip6 | ipip6 | ip6gre | vti6 | any } ]\n" +" [ remote ADDR local ADDR ] [ dev PHYS_DEV ]\n" +" [ encaplimit ELIM ]\n" +" [ hoplimit TTL ] [ tclass TCLASS ] [ flowlabel FLOWLABEL ]\n" +" [ dscp inherit ]\n" +" [ [no]allow-localremote ]\n" +" [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n" +"\n" +"Where: NAME := STRING\n" +" ADDR := IPV6_ADDRESS\n" +" ELIM := { none | 0..255 }(default=%d)\n" +" TTL := 0..255 (default=%d)\n" +" TCLASS := { 0x0..0xff | inherit }\n" +" FLOWLABEL := { 0x0..0xfffff | inherit }\n" +" KEY := { DOTTED_QUAD | NUMBER }\n" , +IPV6_DEFAULT_TNL_ENCAP_LIMIT ,DEFAULT_TNL_HOP_LIMIT ); -fprintf (stderr," TCLASS := { 0x0..0xff | inherit }\n" ); -fprintf (stderr," FLOWLABEL := { 0x0..0xfffff | inherit }\n" ); -fprintf (stderr," KEY := { DOTTED_QUAD | NUMBER }\n" );exit (-1 ); }
ip/ipaddress.c +27 -26
59 lines not on this page · raw message
ip/ipaddrlabel.c +3 -2
@@ -49,8 +49,9 @@ static void usage(void) __attribute__((noreturn));static void usage (void ) { -fprintf (stderr,"Usage: ip addrlabel { add | del } prefix PREFIX [ dev DEV ] [ label LABEL ]\n" ); -fprintf (stderr," ip addrlabel [ list | flush | help ]\n" ); +fprintf (stderr, +"Usage: ip addrlabel { add | del } prefix PREFIX [ dev DEV ] [ label LABEL ]\n" +" ip addrlabel [ list | flush | help ]\n" );exit (-1 ); }
ip/ipila.c +5 -5
@@ -28,11 +28,11 @@static void usage (void ) {fprintf (stderr, -"Usage: ip ila add loc_match LOCATOR_MATCH loc LOCATOR [ dev DEV ] OPTIONS\n" -" ip ila del loc_match LOCATOR_MATCH [ loc LOCATOR ] [ dev DEV ]\n" -" ip ila list\n" -"OPTIONS := [ csum-mode { adj-transport | neutral-map | neutral-map-auto | no-action } ]\n" -" [ ident-type { luid | use-format } ]\n" ); +"Usage: ip ila add loc_match LOCATOR_MATCH loc LOCATOR [ dev DEV ] OPTIONS\n" +" ip ila del loc_match LOCATOR_MATCH [ loc LOCATOR ] [ dev DEV ]\n" +" ip ila list\n" +"OPTIONS := [ csum-mode { adj-transport | neutral-map | neutral-map-auto | no-action } ]\n" +" [ ident-type { luid | use-format } ]\n" );exit (-1 ); }
ip/iplink.c +54 -53
129 lines not on this page · raw message
ip/iplink_bridge.c +33 -33
72 lines not on this page · raw message
ip/iplink_bridge_slave.c +20 -20
@@ -23,26 +23,26 @@ static void print_explain(FILE *f) {fprintf (f,"Usage: ... bridge_slave [ fdb_flush ]\n" -" [ state STATE ]\n" -" [ priority PRIO ]\n" -" [ cost COST ]\n" -" [ guard {on | off} ]\n" -" [ hairpin {on | off} ]\n" -" [ fastleave {on | off} ]\n" -" [ root_block {on | off} ]\n" -" [ learning {on | off} ]\n" -" [ flood {on | off} ]\n" -" [ proxy_arp {on | off} ]\n" -" [ proxy_arp_wifi {on | off} ]\n" -" [ mcast_router MULTICAST_ROUTER ]\n" -" [ mcast_fast_leave {on | off} ]\n" -" [ mcast_flood {on | off} ]\n" -" [ mcast_to_unicast {on | off} ]\n" -" [ group_fwd_mask MASK ]\n" -" [ neigh_suppress {on | off} ]\n" -" [ vlan_tunnel {on | off} ]\n" -" [ isolated {on | off} ]\n" -" [ backup_port DEVICE ] [ nobackup_port ]\n" +" [ state STATE ]\n" +" [ priority PRIO ]\n" +" [ cost COST ]\n" +" [ guard {on | off} ]\n" +" [ hairpin {on | off} ]\n" +" [ fastleave {on | off} ]\n" +" [ root_block {on | off} ]\n" +" [ learning {on | off} ]\n" +" [ flood {on | off} ]\n" +" [ proxy_arp {on | off} ]\n" +" [ proxy_arp_wifi {on | off} ]\n" +" [ mcast_router MULTICAST_ROUTER ]\n" +" [ mcast_fast_leave {on | off} ]\n" +" [ mcast_flood {on | off} ]\n" +" [ mcast_to_unicast {on | off} ]\n" +" [ group_fwd_mask MASK ]\n" +" [ neigh_suppress {on | off} ]\n" +" [ vlan_tunnel {on | off} ]\n" +" [ isolated {on | off} ]\n" +" [ backup_port DEVICE ] [ nobackup_port ]\n" ); }
ip/iplink_geneve.c +16 -16
@@ -21,23 +21,23 @@ static void print_explain(FILE *f) {fprintf (f,"Usage: ... geneve id VNI\n" -" remote ADDR\n" -" [ ttl TTL ]\n" -" [ tos TOS ]\n" -" [ df DF ]\n" -" [ flowlabel LABEL ]\n" -" [ dstport PORT ]\n" -" [ [no]external ]\n" -" [ [no]udpcsum ]\n" -" [ [no]udp6zerocsumtx ]\n" -" [ [no]udp6zerocsumrx ]\n" +" remote ADDR\n" +" [ ttl TTL ]\n" +" [ tos TOS ]\n" +" [ df DF ]\n" +" [ flowlabel LABEL ]\n" +" [ dstport PORT ]\n" +" [ [no]external ]\n" +" [ [no]udpcsum ]\n" +" [ [no]udp6zerocsumtx ]\n" +" [ [no]udp6zerocsumrx ]\n" "\n" -"Where: VNI := 0-16777215\n" -" ADDR := IP_ADDRESS\n" -" TOS := { NUMBER | inherit }\n" -" TTL := { 1..255 | auto | inherit }\n" -" DF := { unset | set | inherit }\n" -" LABEL := 0-1048575\n" +"Where: VNI := 0-16777215\n" +" ADDR := IP_ADDRESS\n" +" TOS := { NUMBER | inherit }\n" +" TTL := { 1..255 | auto | inherit }\n" +" DF := { unset | set | inherit }\n" +" LABEL := 0-1048575\n" ); }
ip/iplink_hsr.c +12 -12
@@ -24,18 +24,18 @@static void print_usage (FILE *f) {fprintf (f, -"Usage:\tip link add name NAME type hsr slave1 SLAVE1-IF slave2 SLAVE2-IF\n" -"\t[ supervision ADDR-BYTE ] [version VERSION]\n" -"\n" -"NAME\n" -" name of new hsr device (e.g. hsr0)\n" -"SLAVE1-IF, SLAVE2-IF\n" -" the two slave devices bound to the HSR device\n" -"ADDR-BYTE\n" -" 0-255; the last byte of the multicast address used for HSR supervision\n" -" frames (default = 0)\n" -"VERSION\n" -" 0,1; the protocol version to be used. (default = 0)\n" ); +"Usage:\tip link add name NAME type hsr slave1 SLAVE1-IF slave2 SLAVE2-IF\n" +"\t[ supervision ADDR-BYTE ] [version VERSION]\n" +"\n" +"NAME\n" +" name of new hsr device (e.g. hsr0)\n" +"SLAVE1-IF, SLAVE2-IF\n" +" the two slave devices bound to the HSR device\n" +"ADDR-BYTE\n" +" 0-255; the last byte of the multicast address used for HSR supervision\n" +" frames (default = 0)\n" +"VERSION\n" +" 0,1; the protocol version to be used. (default = 0)\n" ); }static void usage (void )
ip/iplink_ipoib.c +2 -2
@@ -23,8 +23,8 @@ static void print_explain(FILE *f) {fprintf (f,"Usage: ... ipoib [ pkey PKEY ]\n" -" [ mode {datagram | connected} ]\n" -" [ umcast {0|1} ]\n" +" [ mode {datagram | connected} ]\n" +" [ umcast {0|1} ]\n" "\n" "PKEY := 0x8001-0xffff\n" );
ip/iplink_vlan.c +8 -8
@@ -22,14 +22,14 @@ static void print_explain(FILE *f) {fprintf (f,"Usage: ... vlan id VLANID\n" -" [ protocol VLANPROTO ]\n" -" [ reorder_hdr { on | off } ]\n" -" [ gvrp { on | off } ]\n" -" [ mvrp { on | off } ]\n" -" [ loose_binding { on | off } ]\n" -" [ bridge_binding { on | off } ]\n" -" [ ingress-qos-map QOS-MAP ]\n" -" [ egress-qos-map QOS-MAP ]\n" +" [ protocol VLANPROTO ]\n" +" [ reorder_hdr { on | off } ]\n" +" [ gvrp { on | off } ]\n" +" [ mvrp { on | off } ]\n" +" [ loose_binding { on | off } ]\n" +" [ bridge_binding { on | off } ]\n" +" [ ingress-qos-map QOS-MAP ]\n" +" [ egress-qos-map QOS-MAP ]\n" "\n" "VLANID := 0-4095\n" "VLANPROTO: [ 802.1Q | 802.1ad ]\n"
ip/iplink_vxlan.c +27 -27
61 lines not on this page · raw message
ip/ipmaddr.c +3 -2
@@ -39,8 +39,9 @@ static void usage(void) __attribute__((noreturn));static void usage (void ) { -fprintf (stderr,"Usage: ip maddr [ add | del ] MULTIADDR dev STRING\n" ); -fprintf (stderr," ip maddr show [ dev STRING ]\n" ); +fprintf (stderr, +"Usage: ip maddr [ add | del ] MULTIADDR dev STRING\n" +" ip maddr show [ dev STRING ]\n" );exit (-1 ); }
ip/ipmonitor.c +5 -4
@@ -29,10 +29,11 @@ int listen_all_nsid;static void usage (void ) { -fprintf (stderr,"Usage: ip monitor [ all | LISTofOBJECTS ] [ FILE ] [ label ] [all-nsid] [dev DEVICE]\n" ); -fprintf (stderr,"LISTofOBJECTS := link | address | route | mroute | prefix |\n" ); -fprintf (stderr," neigh | netconf | rule | nsid\n" ); -fprintf (stderr,"FILE := file FILENAME\n" ); +fprintf (stderr, +"Usage: ip monitor [ all | LISTofOBJECTS ] [ FILE ] [ label ] [all-nsid] [dev DEVICE]\n" +"LISTofOBJECTS := link | address | route | mroute | prefix |\n" +" neigh | netconf | rule | nsid\n" +"FILE := file FILENAME\n" );exit (-1 ); }
ip/ipmroute.c +6 -4
@@ -35,12 +35,14 @@ static void usage(void) __attribute__((noreturn));static void usage (void ) { -fprintf (stderr,"Usage: ip mroute show [ [ to ] PREFIX ] [ from PREFIX ] [ iif DEVICE ]\n" ); -fprintf (stderr," [ table TABLE_ID ]\n" ); -fprintf (stderr,"TABLE_ID := [ local | main | default | all | NUMBER ]\n" ); +fprintf (stderr, +"Usage: ip mroute show [ [ to ] PREFIX ] [ from PREFIX ] [ iif DEVICE ]\n" +" [ table TABLE_ID ]\n" +"TABLE_ID := [ local | main | default | all | NUMBER ]\n" #if 0 -fprintf (stderr,"Usage: ip mroute [ add | del ] DESTINATION from SOURCE [ iif DEVICE ] [ oif DEVICE ]\n" ); +"Usage: ip mroute [ add | del ] DESTINATION from SOURCE [ iif DEVICE ] [ oif DEVICE ]\n" #endif + );exit (-1 ); }
ip/ipneigh.c +10 -7
@@ -48,13 +48,16 @@ static void usage(void) __attribute__((noreturn));static void usage (void ) { -fprintf (stderr,"Usage: ip neigh { add | del | change | replace }\n" -" { ADDR [ lladdr LLADDR ] [ nud STATE ] | proxy ADDR } [ dev DEV ]\n" ); -fprintf (stderr," [ router ] [ extern_learn ] [ protocol PROTO ]\n\n" ); -fprintf (stderr," ip neigh { show | flush } [ proxy ] [ to PREFIX ] [ dev DEV ] [ nud STATE ]\n" ); -fprintf (stderr," [ vrf NAME ]\n\n" ); -fprintf (stderr,"STATE := { permanent | noarp | stale | reachable | none |\n" -" incomplete | delay | probe | failed }\n" ); +fprintf (stderr, +"Usage: ip neigh { add | del | change | replace }\n" +" { ADDR [ lladdr LLADDR ] [ nud STATE ] | proxy ADDR } [ dev DEV ]\n" +" [ router ] [ extern_learn ] [ protocol PROTO ]\n" +"\n" +" ip neigh { show | flush } [ proxy ] [ to PREFIX ] [ dev DEV ] [ nud STATE ]\n" +" [ vrf NAME ]\n" +"\n" +"STATE := { permanent | noarp | stale | reachable | none |\n" +" incomplete | delay | probe | failed }\n" );exit (-1 ); }
ip/ipnetns.c +12 -11
@@ -26,17 +26,18 @@static int usage (void ) { -fprintf (stderr,"Usage: ip netns list\n" ); -fprintf (stderr," ip netns add NAME\n" ); -fprintf (stderr," ip netns attach NAME PID\n" ); -fprintf (stderr," ip netns set NAME NETNSID\n" ); -fprintf (stderr," ip [-all] netns delete [NAME]\n" ); -fprintf (stderr," ip netns identify [PID]\n" ); -fprintf (stderr," ip netns pids NAME\n" ); -fprintf (stderr," ip [-all] netns exec [NAME] cmd ...\n" ); -fprintf (stderr," ip netns monitor\n" ); -fprintf (stderr," ip netns list-id\n" ); -fprintf (stderr,"NETNSID := auto | POSITIVE-INT\n" ); +fprintf (stderr, +"Usage: ip netns list\n" +" ip netns add NAME\n" +" ip netns attach NAME PID\n" +" ip netns set NAME NETNSID\n" +" ip [-all] netns delete [NAME]\n" +" ip netns identify [PID]\n" +" ip netns pids NAME\n" +" ip [-all] netns exec [NAME] cmd ...\n" +" ip netns monitor\n" +" ip netns list-id\n" +"NETNSID := auto | POSITIVE-INT\n" );exit (-1 ); }
ip/ipntable.c +6 -6
@@ -47,15 +47,15 @@ static void usage(void) {fprintf (stderr,"Usage: ip ntable change name NAME [ dev DEV ]\n" -" [ thresh1 VAL ] [ thresh2 VAL ] [ thresh3 VAL ] [ gc_int MSEC ]\n" -" [ PARMS ]\n" +" [ thresh1 VAL ] [ thresh2 VAL ] [ thresh3 VAL ] [ gc_int MSEC ]\n" +" [ PARMS ]\n" "Usage: ip ntable show [ dev DEV ] [ name NAME ]\n" "PARMS := [ base_reachable MSEC ] [ retrans MSEC ] [ gc_stale MSEC ]\n" -" [ delay_probe MSEC ] [ queue LEN ]\n" -" [ app_probes VAL ] [ ucast_probes VAL ] [ mcast_probes VAL ]\n" -" [ anycast_delay MSEC ] [ proxy_delay MSEC ] [ proxy_queue LEN ]\n" -" [ locktime MSEC ]\n" +" [ delay_probe MSEC ] [ queue LEN ]\n" +" [ app_probes VAL ] [ ucast_probes VAL ] [ mcast_probes VAL ]\n" +" [ anycast_delay MSEC ] [ proxy_delay MSEC ] [ proxy_queue LEN ]\n" +" [ locktime MSEC ]\n" );exit (-1 );
ip/ipseg6.c +7 -6
@@ -32,12 +32,13 @@static void usage (void ) { -fprintf (stderr,"Usage: ip sr { COMMAND | help }\n" ); -fprintf (stderr," ip sr hmac show\n" ); -fprintf (stderr," ip sr hmac set KEYID ALGO\n" ); -fprintf (stderr," ip sr tunsrc show\n" ); -fprintf (stderr," ip sr tunsrc set ADDRESS\n" ); -fprintf (stderr,"where ALGO := { sha1 | sha256 }\n" ); +fprintf (stderr, +"Usage: ip sr { COMMAND | help }\n" +" ip sr hmac show\n" +" ip sr hmac set KEYID ALGO\n" +" ip sr tunsrc show\n" +" ip sr tunsrc set ADDRESS\n" +"where ALGO := { sha1 | sha256 }\n" );exit (-1 ); }
ip/iptunnel.c +13 -12
@@ -32,18 +32,19 @@ static void usage(void) __attribute__((noreturn));static void usage (void ) { -fprintf (stderr,"Usage: ip tunnel { add | change | del | show | prl | 6rd } [ NAME ]\n" ); -fprintf (stderr," [ mode { ipip | gre | sit | isatap | vti } ] [ remote ADDR ] [ local ADDR ]\n" ); -fprintf (stderr," [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n" ); -fprintf (stderr," [ prl-default ADDR ] [ prl-nodefault ADDR ] [ prl-delete ADDR ]\n" ); -fprintf (stderr," [ 6rd-prefix ADDR ] [ 6rd-relay_prefix ADDR ] [ 6rd-reset ]\n" ); -fprintf (stderr," [ ttl TTL ] [ tos TOS ] [ [no]pmtudisc ] [ dev PHYS_DEV ]\n" ); -fprintf (stderr,"\n" ); -fprintf (stderr,"Where: NAME := STRING\n" ); -fprintf (stderr," ADDR := { IP_ADDRESS | any }\n" ); -fprintf (stderr," TOS := { STRING | 00..ff | inherit | inherit/STRING | inherit/00..ff }\n" ); -fprintf (stderr," TTL := { 1..255 | inherit }\n" ); -fprintf (stderr," KEY := { DOTTED_QUAD | NUMBER }\n" ); +fprintf (stderr, +"Usage: ip tunnel { add | change | del | show | prl | 6rd } [ NAME ]\n" +" [ mode { ipip | gre | sit | isatap | vti } ] [ remote ADDR ] [ local ADDR ]\n" +" [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n" +" [ prl-default ADDR ] [ prl-nodefault ADDR ] [ prl-delete ADDR ]\n" +" [ 6rd-prefix ADDR ] [ 6rd-relay_prefix ADDR ] [ 6rd-reset ]\n" +" [ ttl TTL ] [ tos TOS ] [ [no]pmtudisc ] [ dev PHYS_DEV ]\n" +"\n" +"Where: NAME := STRING\n" +" ADDR := { IP_ADDRESS | any }\n" +" TOS := { STRING | 00..ff | inherit | inherit/STRING | inherit/00..ff }\n" +" TTL := { 1..255 | inherit }\n" +" KEY := { DOTTED_QUAD | NUMBER }\n" );exit (-1 ); }
ip/iptuntap.c +7 -6
@@ -40,12 +40,13 @@ static void usage(void) __attribute__((noreturn));static void usage (void ) { -fprintf (stderr,"Usage: ip tuntap { add | del | show | list | lst | help } [ dev PHYS_DEV ]\n" ); -fprintf (stderr," [ mode { tun | tap } ] [ user USER ] [ group GROUP ]\n" ); -fprintf (stderr," [ one_queue ] [ pi ] [ vnet_hdr ] [ multi_queue ] [ name NAME ]\n" ); -fprintf (stderr,"\n" ); -fprintf (stderr,"Where: USER := { STRING | NUMBER }\n" ); -fprintf (stderr," GROUP := { STRING | NUMBER }\n" ); +fprintf (stderr, +"Usage: ip tuntap { add | del | show | list | lst | help } [ dev PHYS_DEV ]\n" +" [ mode { tun | tap } ] [ user USER ] [ group GROUP ]\n" +" [ one_queue ] [ pi ] [ vnet_hdr ] [ multi_queue ] [ name NAME ]\n" +"\n" +"Where: USER := { STRING | NUMBER }\n" +" GROUP := { STRING | NUMBER }\n" );exit (-1 ); }
ip/ipvrf.c +5 -4
@@ -36,10 +36,11 @@ static struct link_filter vrf_filter;static void usage (void ) { -fprintf (stderr,"Usage: ip vrf show [NAME] ...\n" ); -fprintf (stderr," ip vrf exec [NAME] cmd ...\n" ); -fprintf (stderr," ip vrf identify [PID]\n" ); -fprintf (stderr," ip vrf pids [NAME]\n" ); +fprintf (stderr, +"Usage: ip vrf show [NAME] ...\n" +" ip vrf exec [NAME] cmd ...\n" +" ip vrf identify [PID]\n" +" ip vrf pids [NAME]\n" );exit (-1 ); }
ip/link_gre.c +29 -34
70 lines not on this page · raw message
ip/link_gre6.c +34 -39
80 lines not on this page · raw message
ip/link_ip6tnl.c +28 -39
74 lines not on this page · raw message
ip/link_iptnl.c +28 -35
74 lines not on this page · raw message
ip/link_vti.c +9 -15
@@ -26,22 +26,16 @@static void vti_print_help (struct link_util *lu,int argc,char **argv,FILE *f) {fprintf (f, -"Usage: ... %-4s [ remote ADDR ]\n" , - lu->id - ); -fprintf (f, -" [ local ADDR ]\n" -" [ [i|o]key KEY ]\n" -" [ dev PHYS_DEV ]\n" -" [ fwmark MARK ]\n" +"Usage: ... %-4s [ remote ADDR ]\n" +" [ local ADDR ]\n" +" [ [i|o]key KEY ]\n" +" [ dev PHYS_DEV ]\n" +" [ fwmark MARK ]\n" "\n" - ); -fprintf (f, -"Where: ADDR := { IP%s_ADDRESS }\n" -" KEY := { DOTTED_QUAD | NUMBER }\n" -" MARK := { 0x0..0xffffffff }\n" , -"" - ); +"Where: ADDR := { IP_ADDRESS }\n" +" KEY := { DOTTED_QUAD | NUMBER }\n" +" MARK := { 0x0..0xffffffff }\n" , + lu->id); } static int vti_parse_opt(struct link_util *lu, int argc, char **argv,
ip/link_vti6.c +9 -15
@@ -28,22 +28,16 @@ static void vti6_print_help(struct link_util *lu, int argc, char **argv, FILE *f) {fprintf (f, -"Usage: ... %-4s [ remote ADDR ]\n" , - lu->id - ); -fprintf (f, -" [ local ADDR ]\n" -" [ [i|o]key KEY ]\n" -" [ dev PHYS_DEV ]\n" -" [ fwmark MARK ]\n" +"Usage: ... %-4s [ remote ADDR ]\n" +" [ local ADDR ]\n" +" [ [i|o]key KEY ]\n" +" [ dev PHYS_DEV ]\n" +" [ fwmark MARK ]\n" "\n" - ); -fprintf (f, -"Where: ADDR := { IP%s_ADDRESS }\n" -" KEY := { DOTTED_QUAD | NUMBER }\n" -" MARK := { 0x0..0xffffffff }\n" , -"V6" - ); +"Where: ADDR := { IPV6_ADDRESS }\n" +" KEY := { DOTTED_QUAD | NUMBER }\n" +" MARK := { 0x0..0xffffffff }\n" , + lu->id); } static int vti6_parse_opt(struct link_util *lu, int argc, char **argv,
ip/link_xfrm.c +5 -2
@@ -16,8 +16,11 @@static void xfrm_print_help (struct link_util *lu,int argc,char **argv,FILE *f) { -fprintf (f,"Usage: ... %-4s dev PHYS_DEV [ if_id IF-ID ]\n" , lu->id); -fprintf (f,"\nWhere: IF-ID := { 0x0..0xffffffff }\n" ); +fprintf (f, +"Usage: ... %-4s dev PHYS_DEV [ if_id IF-ID ]\n" +"\n" +"Where: IF-ID := { 0x0..0xffffffff }\n" , + lu->id); } static int xfrm_parse_opt(struct link_util *lu, int argc, char **argv,
ip/rtmon.c +5 -4
@@ -62,10 +62,11 @@ static int dump_msg2(struct nlmsghdr *n, void *arg)static void usage (void ) { -fprintf (stderr,"Usage: rtmon [ OPTIONS ] file FILE [ all | LISTofOBJECTS ]\n" ); -fprintf (stderr,"OPTIONS := { -f[amily] { inet | inet6 | link | help } |\n" -" -4 | -6 | -0 | -V[ersion] }\n" ); -fprintf (stderr,"LISTofOBJECTS := [ link ] [ address ] [ route ]\n" ); +fprintf (stderr, +"Usage: rtmon [ OPTIONS ] file FILE [ all | LISTofOBJECTS ]\n" +"OPTIONS := { -f[amily] { inet | inet6 | link | help } |\n" +" -4 | -6 | -0 | -V[ersion] }\n" +"LISTofOBJECTS := [ link ] [ address ] [ route ]\n" );exit (-1 ); }
ip/tcp_metrics.c +5 -4
@@ -28,10 +28,11 @@static void usage (void ) { -fprintf (stderr,"Usage: ip tcp_metrics/tcpmetrics { COMMAND | help }\n" ); -fprintf (stderr," ip tcp_metrics { show | flush } SELECTOR\n" ); -fprintf (stderr," ip tcp_metrics delete [ address ] ADDRESS\n" ); -fprintf (stderr,"SELECTOR := [ [ address ] PREFIX ]\n" ); +fprintf (stderr, +"Usage: ip tcp_metrics/tcpmetrics { COMMAND | help }\n" +" ip tcp_metrics { show | flush } SELECTOR\n" +" ip tcp_metrics delete [ address ] ADDRESS\n" +"SELECTOR := [ [ address ] PREFIX ]\n" );exit (-1 ); }
ip/xfrm_monitor.c +3 -2
@@ -39,8 +39,9 @@ static bool nokeys;static void usage (void ) { -fprintf (stderr,"Usage: ip xfrm monitor [ nokeys ] [ all-nsid ] [ all | OBJECTS | help ]\n" ); -fprintf (stderr,"OBJECTS := { acquire | expire | SA | aevent | policy | report }\n" ); +fprintf (stderr, +"Usage: ip xfrm monitor [ nokeys ] [ all-nsid ] [ all | OBJECTS | help ]\n" +"OBJECTS := { acquire | expire | SA | aevent | policy | report }\n" );exit (-1 ); }
ip/xfrm_policy.c +54 -45
105 lines not on this page · raw message
ip/xfrm_state.c +78 -60
144 lines not on this page · raw message
misc/lnstat.c +25 -22
53 lines not on this page · raw message
misc/nstat.c +12 -12
@@ -528,18 +528,18 @@ static void usage(void) __attribute__((noreturn));static void usage (void ) {fprintf (stderr, -"Usage: nstat [OPTION] [ PATTERN [ PATTERN ] ]\n" -" -h, --help this message\n" -" -a, --ignore ignore history\n" -" -d, --scan=SECS sample every statistics every SECS\n" -" -j, --json format output in JSON\n" -" -n, --nooutput do history only\n" -" -p, --pretty pretty print\n" -" -r, --reset reset history\n" -" -s, --noupdate don't update history\n" -" -t, --interval=SECS report average over the last SECS\n" -" -V, --version output version information\n" -" -z, --zeros show entries with zero activity\n" ); +"Usage: nstat [OPTION] [ PATTERN [ PATTERN ] ]\n" +" -h, --help this message\n" +" -a, --ignore ignore history\n" +" -d, --scan=SECS sample every statistics every SECS\n" +" -j, --json format output in JSON\n" +" -n, --nooutput do history only\n" +" -p, --pretty pretty print\n" +" -r, --reset reset history\n" +" -s, --noupdate don't update history\n" +" -t, --interval=SECS report average over the last SECS\n" +" -V, --version output version information\n" +" -z, --zeros show entries with zero activity\n" );exit (-1 ); }
tc/e_bpf.c +15 -13
@@ -26,19 +26,21 @@ static char *argv_default[] = { BPF_DEFAULT_CMD, NULL };static void explain (void ) { -fprintf (stderr,"Usage: ... bpf [ import UDS_FILE ] [ run CMD ]\n" ); -fprintf (stderr," ... bpf [ debug ]\n" ); -fprintf (stderr," ... bpf [ graft MAP_FILE ] [ key KEY ]\n" ); -fprintf (stderr," `... [ object-file OBJ_FILE ] [ type TYPE ] [ section NAME ] [ verbose ]\n" ); -fprintf (stderr," `... [ object-pinned PROG_FILE ]\n" ); -fprintf (stderr,"\n" ); -fprintf (stderr,"Where UDS_FILE provides the name of a unix domain socket file\n" ); -fprintf (stderr,"to import eBPF maps and the optional CMD denotes the command\n" ); -fprintf (stderr,"to be executed (default: \'%s\').\n" ,BPF_DEFAULT_CMD ); -fprintf (stderr,"Where MAP_FILE points to a pinned map, OBJ_FILE to an object file\n" ); -fprintf (stderr,"and PROG_FILE to a pinned program. TYPE can be {cls, act}, where\n" ); -fprintf (stderr,"\'cls\' is default. KEY is optional and can be inferred from the\n" ); -fprintf (stderr,"section name, otherwise it needs to be provided.\n" ); +fprintf (stderr, +"Usage: ... bpf [ import UDS_FILE ] [ run CMD ]\n" +" ... bpf [ debug ]\n" +" ... bpf [ graft MAP_FILE ] [ key KEY ]\n" +" `... [ object-file OBJ_FILE ] [ type TYPE ] [ section NAME ] [ verbose ]\n" +" `... [ object-pinned PROG_FILE ]\n" +"\n" +"Where UDS_FILE provides the name of a unix domain socket file\n" +"to import eBPF maps and the optional CMD denotes the command\n" +"to be executed (default: \'%s\').\n" +"Where MAP_FILE points to a pinned map, OBJ_FILE to an object file\n" +"and PROG_FILE to a pinned program. TYPE can be {cls, act}, where\n" +"\'cls\' is default. KEY is optional and can be inferred from the\n" +"section name, otherwise it needs to be provided.\n" , +BPF_DEFAULT_CMD ); }static int bpf_num_env_entries (void )
tc/f_basic.c +9 -7
@@ -26,13 +26,15 @@static void explain (void ) { -fprintf (stderr,"Usage: ... basic [ match EMATCH_TREE ]\n" ); -fprintf (stderr," [ action ACTION_SPEC ] [ classid CLASSID ]\n" ); -fprintf (stderr,"\n" ); -fprintf (stderr,"Where: SELECTOR := SAMPLE SAMPLE ...\n" ); -fprintf (stderr," FILTERID := X:Y:Z\n" ); -fprintf (stderr," ACTION_SPEC := ... look at individual actions\n" ); -fprintf (stderr,"\nNOTE: CLASSID is parsed as hexadecimal input.\n" ); +fprintf (stderr, +"Usage: ... basic [ match EMATCH_TREE ]\n" +" [ action ACTION_SPEC ] [ classid CLASSID ]\n" +"\n" +"Where: SELECTOR := SAMPLE SAMPLE ...\n" +" FILTERID := X:Y:Z\n" +" ACTION_SPEC := ... look at individual actions\n" +"\n" +"NOTE: CLASSID is parsed as hexadecimal input.\n" ); } static int basic_parse_opt(struct filter_util *qu, char *handle,
tc/f_bpf.c +32 -30
68 lines not on this page · raw message
tc/f_flow.c +15 -15
@@ -21,21 +21,21 @@static void explain (void ) {fprintf (stderr, -"Usage: ... flow ...\n" -"\n" -" [mapping mode]: map key KEY [ OPS ] ...\n" -" [hashing mode]: hash keys KEY-LIST ... [ perturb SECS ]\n" -"\n" -" [ divisor NUM ] [ baseclass ID ] [ match EMATCH_TREE ]\n" -" [ action ACTION_SPEC ]\n" -"\n" -"KEY-LIST := [ KEY-LIST , ] KEY\n" -"KEY := [ src | dst | proto | proto-src | proto-dst | iif | priority |\n" -" mark | nfct | nfct-src | nfct-dst | nfct-proto-src |\n" -" nfct-proto-dst | rt-classid | sk-uid | sk-gid |\n" -" vlan-tag | rxhash ]\n" -"OPS := [ or NUM | and NUM | xor NUM | rshift NUM | addend NUM ]\n" -"ID := X:Y\n" +"Usage: ... flow ...\n" +"\n" +" [mapping mode]: map key KEY [ OPS ] ...\n" +" [hashing mode]: hash keys KEY-LIST ... [ perturb SECS ]\n" +"\n" +" [ divisor NUM ] [ baseclass ID ] [ match EMATCH_TREE ]\n" +" [ action ACTION_SPEC ]\n" +"\n" +"KEY-LIST := [ KEY-LIST , ] KEY\n" +"KEY := [ src | dst | proto | proto-src | proto-dst | iif | priority |\n" +" mark | nfct | nfct-src | nfct-dst | nfct-proto-src |\n" +" nfct-proto-dst | rt-classid | sk-uid | sk-gid |\n" +" vlan-tag | rxhash ]\n" +"OPS := [ or NUM | and NUM | xor NUM | rshift NUM | addend NUM ]\n" +"ID := X:Y\n" ); }
tc/f_flower.c +45 -45
99 lines not on this page · raw message
tc/f_fw.c +7 -12
@@ -25,18 +25,13 @@static void explain (void ) {fprintf (stderr, -"Usage: ... fw [ classid CLASSID ] [ indev DEV ] [ action ACTION_SPEC ]\n" ); -fprintf (stderr, -" CLASSID := Push matching packets to the class identified by CLASSID with format X:Y\n" ); -fprintf (stderr, -" CLASSID is parsed as hexadecimal input.\n" ); -fprintf (stderr, -" DEV := specify device for incoming device classification.\n" ); -fprintf (stderr, -" ACTION_SPEC := Apply an action on matching packets.\n" ); -fprintf (stderr, -" NOTE: handle is represented as HANDLE[/FWMASK].\n" ); -fprintf (stderr," FWMASK is 0xffffffff by default.\n" ); +"Usage: ... fw [ classid CLASSID ] [ indev DEV ] [ action ACTION_SPEC ]\n" +" CLASSID := Push matching packets to the class identified by CLASSID with format X:Y\n" +" CLASSID is parsed as hexadecimal input.\n" +" DEV := specify device for incoming device classification.\n" +" ACTION_SPEC := Apply an action on matching packets.\n" +" NOTE: handle is represented as HANDLE[/FWMASK].\n" +" FWMASK is 0xffffffff by default.\n" ); }static int fw_parse_opt (struct filter_util *qu,char *handle,int argc,char **argv,struct nlmsghdr *n)
tc/f_matchall.c +9 -7
@@ -25,13 +25,15 @@static void explain (void ) { -fprintf (stderr,"Usage: ... matchall [skip_sw | skip_hw]\n" ); -fprintf (stderr," [ action ACTION_SPEC ] [ classid CLASSID ]\n" ); -fprintf (stderr,"\n" ); -fprintf (stderr,"Where: SELECTOR := SAMPLE SAMPLE ...\n" ); -fprintf (stderr," FILTERID := X:Y:Z\n" ); -fprintf (stderr," ACTION_SPEC := ... look at individual actions\n" ); -fprintf (stderr,"\nNOTE: CLASSID is parsed as hexadecimal input.\n" ); +fprintf (stderr, +"Usage: ... matchall [skip_sw | skip_hw]\n" +" [ action ACTION_SPEC ] [ classid CLASSID ]\n" +"\n" +"Where: SELECTOR := SAMPLE SAMPLE ...\n" +" FILTERID := X:Y:Z\n" +" ACTION_SPEC := ... look at individual actions\n" +"\n" +"NOTE: CLASSID is parsed as hexadecimal input.\n" ); } static int matchall_parse_opt(struct filter_util *qu, char *handle,
tc/f_route.c +7 -5
@@ -26,11 +26,13 @@static void explain (void ) { -fprintf (stderr,"Usage: ... route [ from REALM | fromif TAG ] [ to REALM ]\n" ); -fprintf (stderr," [ classid CLASSID ] [ action ACTION_SPEC ]\n" ); -fprintf (stderr," ACTION_SPEC := ... look at individual actions\n" ); -fprintf (stderr," CLASSID := X:Y\n" ); -fprintf (stderr,"\nNOTE: CLASSID is parsed as hexadecimal input.\n" ); +fprintf (stderr, +"Usage: ... route [ from REALM | fromif TAG ] [ to REALM ]\n" +" [ classid CLASSID ] [ action ACTION_SPEC ]\n" +" ACTION_SPEC := ... look at individual actions\n" +" CLASSID := X:Y\n" +"\n" +"NOTE: CLASSID is parsed as hexadecimal input.\n" ); }static int route_parse_opt (struct filter_util *qu,char *handle,int argc,char **argv,struct nlmsghdr *n)
tc/f_rsvp.c +10 -9
@@ -25,15 +25,16 @@static void explain (void ) { -fprintf (stderr,"Usage: ... rsvp ipproto PROTOCOL session DST[/PORT | GPI ]\n" ); -fprintf (stderr," [ sender SRC[/PORT | GPI ] ]\n" ); -fprintf (stderr," [ classid CLASSID ] [ action ACTION_SPEC ]\n" ); -fprintf (stderr," [ tunnelid ID ] [ tunnel ID skip NUMBER ]\n" ); -fprintf (stderr,"Where: GPI := { flowlabel NUMBER | spi/ah SPI | spi/esp SPI |\n" ); -fprintf (stderr," u{8|16|32} NUMBER mask MASK at OFFSET}\n" ); -fprintf (stderr," ACTION_SPEC := ... look at individual actions\n" ); -fprintf (stderr," FILTERID := X:Y\n" ); -fprintf (stderr,"\nNOTE: CLASSID is parsed as hexadecimal input.\n" ); +fprintf (stderr, +"Usage: ... rsvp ipproto PROTOCOL session DST[/PORT | GPI ]\n" +" [ sender SRC[/PORT | GPI ] ]\n" +" [ classid CLASSID ] [ action ACTION_SPEC ]\n" +" [ tunnelid ID ] [ tunnel ID skip NUMBER ]\n" +"Where: GPI := { flowlabel NUMBER | spi/ah SPI | spi/esp SPI |\n" +" u{8|16|32} NUMBER mask MASK at OFFSET}\n" +" ACTION_SPEC := ... look at individual actions\n" +" FILTERID := X:Y\n" +"\nNOTE: CLASSID is parsed as hexadecimal input.\n" ); } static int get_addr_and_pi(int *argc_p, char ***argv_p, inet_prefix *addr,
tc/f_tcindex.c +4 -3
@@ -17,9 +17,10 @@static void explain (void ) { -fprintf (stderr," Usage: ... tcindex [ hash SIZE ] [ mask MASK ] [ shift SHIFT ]\n" ); -fprintf (stderr," [ pass_on | fall_through ]\n" ); -fprintf (stderr," [ classid CLASSID ] [ action ACTION_SPEC ]\n" ); +fprintf (stderr, +" Usage: ... tcindex [ hash SIZE ] [ mask MASK ] [ shift SHIFT ]\n" +" [ pass_on | fall_through ]\n" +" [ classid CLASSID ] [ action ACTION_SPEC ]\n" ); } static int tcindex_parse_opt(struct filter_util *qu, char *handle, int argc,
tc/m_action.c +13 -13
@@ -43,20 +43,20 @@ static void act_usage(void)* does that, they would know how to fix this .. * */ -fprintf (stderr,"usage: tc actions <ACTSPECOP>*\n" );fprintf (stderr, -"Where: \tACTSPECOP := ACR | GD | FL\n" -"\tACR := add | change | replace <ACTSPEC>*\n" -"\tGD := get | delete | <ACTISPEC>*\n" -"\tFL := ls | list | flush | <ACTNAMESPEC>\n" -"\tACTNAMESPEC := action <ACTNAME>\n" -"\tACTISPEC := <ACTNAMESPEC> <INDEXSPEC>\n" -"\tACTSPEC := action <ACTDETAIL> [INDEXSPEC]\n" -"\tINDEXSPEC := index <32 bit indexvalue>\n" -"\tACTDETAIL := <ACTNAME> <ACTPARAMS>\n" -"\t\tExample ACTNAME is gact, mirred, bpf, etc\n" -"\t\tEach action has its own parameters (ACTPARAMS)\n" -"\n" ); +"usage: tc actions <ACTSPECOP>*\n" +"Where: ACTSPECOP := ACR | GD | FL\n" +" ACR := add | change | replace <ACTSPEC>*\n" +" GD := get | delete | <ACTISPEC>*\n" +" FL := ls | list | flush | <ACTNAMESPEC>\n" +" ACTNAMESPEC := action <ACTNAME>\n" +" ACTISPEC := <ACTNAMESPEC> <INDEXSPEC>\n" +" ACTSPEC := action <ACTDETAIL> [INDEXSPEC]\n" +" INDEXSPEC := index <32 bit indexvalue>\n" +" ACTDETAIL := <ACTNAME> <ACTPARAMS>\n" +" Example ACTNAME is gact, mirred, bpf, etc\n" +" Each action has its own parameters (ACTPARAMS)\n" +"\n" );exit (-1 ); }
tc/m_bpf.c +28 -26
60 lines not on this page · raw message
tc/m_connmark.c +3 -2
@@ -27,8 +27,9 @@static void explain (void ) { -fprintf (stderr,"Usage: ... connmark [zone ZONE] [CONTROL] [index <INDEX>]\n" ); -fprintf (stderr,"where :\n" +fprintf (stderr, +"Usage: ... connmark [zone ZONE] [CONTROL] [index <INDEX>]\n" +"where :\n" "\tZONE is the conntrack zone\n" "\tCONTROL := reclassify | pipe | drop | continue | ok |\n" "\t goto chain <CHAIN_INDEX>\n" );
tc/m_estimator.c +5 -4
@@ -27,10 +27,11 @@ static void est_help(void);static void est_help (void ) { -fprintf (stderr,"Usage: ... estimator INTERVAL TIME-CONST\n" ); -fprintf (stderr," INTERVAL is interval between measurements\n" ); -fprintf (stderr," TIME-CONST is averaging time constant\n" ); -fprintf (stderr,"Example: ... est 1sec 8sec\n" ); +fprintf (stderr, +"Usage: ... estimator INTERVAL TIME-CONST\n" +" INTERVAL is interval between measurements\n" +" TIME-CONST is averaging time constant\n" +"Example: ... est 1sec 8sec\n" ); }int parse_estimator (int *p_argc,char ***p_argv,struct tc_estimator *est)
tc/m_gact.c +1 -2
@@ -53,8 +53,7 @@ explain(void)"\tINDEX := index value used\n" "\n");#else -fprintf (stderr,"Usage: ... gact <ACTION> [INDEX]\n" ); -fprintf (stderr, +fprintf (stderr,"Usage: ... gact <ACTION> [INDEX]\n" "Where: \tACTION := reclassify | drop | continue | pass | pipe |\n" " \t goto chain <CHAIN_INDEX> | jump <JUMP_COUNT>\n" "\tINDEX := index value used\n"
tc/m_ife.c +4 -5
@@ -28,8 +28,7 @@static void ife_explain (void ) {fprintf (stderr, -"Usage:... ife {decode|encode} [{ALLOW|USE} ATTR] [dst DMAC] [src SMAC] [type TYPE] [CONTROL] [index INDEX]\n" ); -fprintf (stderr, +"Usage:... ife {decode|encode} [{ALLOW|USE} ATTR] [dst DMAC] [src SMAC] [type TYPE] [CONTROL] [index INDEX]\n" "\tALLOW := Encode direction. Allows encoding specified metadata\n" "\t\t e.g \"allow mark\"\n" "\tUSE := Encode direction. Enforce Static encoding of specified metadata\n"
@@ -39,9 +38,9 @@ static void ife_explain(void)"\tSMAC := optional 6 byte Source MAC address to encode\n" "\tTYPE := optional 16 bit ethertype to encode\n" "\tCONTROL := reclassify|pipe|drop|continue|ok\n" - "\tINDEX := optional IFE table index value used\n"); -fprintf (stderr,"encode is used for sending IFE packets\n" ); -fprintf (stderr,"decode is used for receiving IFE packets\n" ); +"\tINDEX := optional IFE table index value used\n" +"encode is used for sending IFE packets\n" + "decode is used for receiving IFE packets\n"); }static void ife_usage (void )
tc/m_pedit.c +1 -1
@@ -34,8 +34,8 @@ static int pedit_debug;static void explain (void ) { -fprintf (stderr,"Usage: ... pedit munge [ex] <MUNGE> [CONTROL]\n" );fprintf (stderr, +"Usage: ... pedit munge [ex] <MUNGE> [CONTROL]\n" "Where: MUNGE := <RAW>|<LAYERED>\n" "\t<RAW>:= <OFFSETC>[ATC]<CMD>\n \t\tOFFSETC:= offset <offval> <u8|u16|u32>\n" "\t\tATC:= at <atval> offmask <maskval> shift <shiftval>\n"
tc/m_police.c +9 -9
@@ -37,15 +37,15 @@ struct action_util police_action_util = {static void usage (void ) { -fprintf (stderr,"Usage: ... police rate BPS burst BYTES[/BYTES] [ mtu BYTES[/BYTES] ]\n" ); -fprintf (stderr," [ peakrate BPS ] [ avrate BPS ] [ overhead BYTES ]\n" ); -fprintf (stderr," [ linklayer TYPE ] [ CONTROL ]\n" ); - -fprintf (stderr,"Where: CONTROL := conform-exceed <EXCEEDACT>[/NOTEXCEEDACT]\n" ); -fprintf (stderr," Define how to handle packets which exceed (<EXCEEDACT>)\n" ); -fprintf (stderr," or conform (<NOTEXCEEDACT>) the configured bandwidth limit.\n" ); -fprintf (stderr," EXCEEDACT/NOTEXCEEDACT := { pipe | ok | reclassify | drop | continue |\n" ); -fprintf (stderr," goto chain <CHAIN_INDEX> }\n" ); +fprintf (stderr, +"Usage: ... police rate BPS burst BYTES[/BYTES] [ mtu BYTES[/BYTES] ]\n" +" [ peakrate BPS ] [ avrate BPS ] [ overhead BYTES ]\n" +" [ linklayer TYPE ] [ CONTROL ]\n" +"Where: CONTROL := conform-exceed <EXCEEDACT>[/NOTEXCEEDACT]\n" +" Define how to handle packets which exceed (<EXCEEDACT>)\n" +" or conform (<NOTEXCEEDACT>) the configured bandwidth limit.\n" +" EXCEEDACT/NOTEXCEEDACT := { pipe | ok | reclassify | drop | continue |\n" +" goto chain <CHAIN_INDEX> }\n" );exit (-1 ); }
tc/m_sample.c +10 -9
@@ -18,15 +18,16 @@static void explain (void ) { -fprintf (stderr,"Usage: sample SAMPLE_CONF\n" ); -fprintf (stderr,"where:\n" ); -fprintf (stderr,"\tSAMPLE_CONF := SAMPLE_PARAMS | SAMPLE_INDEX\n" ); -fprintf (stderr,"\tSAMPLE_PARAMS := rate RATE group GROUP [trunc SIZE] [SAMPLE_INDEX]\n" ); -fprintf (stderr,"\tSAMPLE_INDEX := index INDEX\n" ); -fprintf (stderr,"\tRATE := The ratio of packets observed at the data source to the samples generated.\n" ); -fprintf (stderr,"\tGROUP := the psample sampling group\n" ); -fprintf (stderr,"\tSIZE := the truncation size\n" ); -fprintf (stderr,"\tINDEX := integer index of the sample action\n" ); +fprintf (stderr, +"Usage: sample SAMPLE_CONF\n" +"where:\n" +"\tSAMPLE_CONF := SAMPLE_PARAMS | SAMPLE_INDEX\n" +"\tSAMPLE_PARAMS := rate RATE group GROUP [trunc SIZE] [SAMPLE_INDEX]\n" +"\tSAMPLE_INDEX := index INDEX\n" +"\tRATE := The ratio of packets observed at the data source to the samples generated.\n" +"\tGROUP := the psample sampling group\n" +"\tSIZE := the truncation size\n" +"\tINDEX := integer index of the sample action\n" ); }static void usage (void )
tc/m_simple.c +3 -2
@@ -80,8 +80,9 @@#endif static void explain (void ) { -fprintf (stderr,"Usage:... simple [sdata STRING] [index INDEX] [CONTROL]\n" ); -fprintf (stderr,"\tSTRING being an arbitrary string\n" +fprintf (stderr, +"Usage:... simple [sdata STRING] [index INDEX] [CONTROL]\n" +"\tSTRING being an arbitrary string\n" "\tINDEX := optional index value used\n" "\tCONTROL := reclassify|pipe|drop|continue|ok\n" ); }
tc/m_tunnel_key.c +2 -2
@@ -21,9 +21,9 @@static void explain (void ) { -fprintf (stderr,"Usage: tunnel_key unset\n" ); -fprintf (stderr," tunnel_key set <TUNNEL_KEY>\n" );fprintf (stderr, +"Usage: tunnel_key unset\n" +" tunnel_key set <TUNNEL_KEY>\n" "Where TUNNEL_KEY is a combination of:\n" "id <TUNNELID>\n" "src_ip <IP> (mandatory)\n"
tc/q_atm.c +3 -2
@@ -40,8 +40,9 @@ static int atm_parse_opt(struct qdisc_util *qu, int argc, char **argv,static void explain (void ) { -fprintf (stderr,"Usage: ... atm ( pvc ADDR | svc ADDR [ sap SAP ] ) [ qos QOS ] [ sndbuf BYTES ]\n" ); -fprintf (stderr," [ hdr HEX... ] [ excess ( CLASSID | clp ) ] [ clip ]\n" ); +fprintf (stderr, +"Usage: ... atm ( pvc ADDR | svc ADDR [ sap SAP ] ) [ qos QOS ] [ sndbuf BYTES ]\n" +" [ hdr HEX... ] [ excess ( CLASSID | clp ) ] [ clip ]\n" ); }
tc/q_cake.c +15 -15
@@ -71,21 +71,21 @@ static struct cake_preset *find_preset(char *argv)static void explain (void ) {fprintf (stderr, -"Usage: ... cake [ bandwidth RATE | unlimited* | autorate-ingress ]\n" -" [ rtt TIME | datacentre | lan | metro | regional |\n" -" internet* | oceanic | satellite | interplanetary ]\n" -" [ besteffort | diffserv8 | diffserv4 | diffserv3* ]\n" -" [ flowblind | srchost | dsthost | hosts | flows |\n" -" dual-srchost | dual-dsthost | triple-isolate* ]\n" -" [ nat | nonat* ]\n" -" [ wash | nowash* ]\n" -" [ split-gso* | no-split-gso ]\n" -" [ ack-filter | ack-filter-aggressive | no-ack-filter* ]\n" -" [ memlimit LIMIT ]\n" -" [ fwmark MASK ]\n" -" [ ptm | atm | noatm* ] [ overhead N | conservative | raw* ]\n" -" [ mpu N ] [ ingress | egress* ]\n" -" (* marks defaults)\n" ); +"Usage: ... cake [ bandwidth RATE | unlimited* | autorate-ingress ]\n" +" [ rtt TIME | datacentre | lan | metro | regional |\n" +" internet* | oceanic | satellite | interplanetary ]\n" +" [ besteffort | diffserv8 | diffserv4 | diffserv3* ]\n" +" [ flowblind | srchost | dsthost | hosts | flows |\n" +" dual-srchost | dual-dsthost | triple-isolate* ]\n" +" [ nat | nonat* ]\n" +" [ wash | nowash* ]\n" +" [ split-gso* | no-split-gso ]\n" +" [ ack-filter | ack-filter-aggressive | no-ack-filter* ]\n" +" [ memlimit LIMIT ]\n" +" [ fwmark MASK ]\n" +" [ ptm | atm | noatm* ] [ overhead N | conservative | raw* ]\n" +" [ mpu N ] [ ingress | egress* ]\n" +" (* marks defaults)\n" ); } static int cake_parse_opt(struct qdisc_util *qu, int argc, char **argv,
tc/q_cbq.c +11 -9
@@ -25,19 +25,21 @@static void explain_class (void ) { -fprintf (stderr,"Usage: ... cbq bandwidth BPS rate BPS maxburst PKTS [ avpkt BYTES ]\n" ); -fprintf (stderr," [ minburst PKTS ] [ bounded ] [ isolated ]\n" ); -fprintf (stderr," [ allot BYTES ] [ mpu BYTES ] [ weight RATE ]\n" ); -fprintf (stderr," [ prio NUMBER ] [ cell BYTES ] [ ewma LOG ]\n" ); -fprintf (stderr," [ estimator INTERVAL TIME_CONSTANT ]\n" ); -fprintf (stderr," [ split CLASSID ] [ defmap MASK/CHANGE ]\n" ); -fprintf (stderr," [ overhead BYTES ] [ linklayer TYPE ]\n" ); +fprintf (stderr, +"Usage: ... cbq bandwidth BPS rate BPS maxburst PKTS [ avpkt BYTES ]\n" +" [ minburst PKTS ] [ bounded ] [ isolated ]\n" +" [ allot BYTES ] [ mpu BYTES ] [ weight RATE ]\n" +" [ prio NUMBER ] [ cell BYTES ] [ ewma LOG ]\n" +" [ estimator INTERVAL TIME_CONSTANT ]\n" +" [ split CLASSID ] [ defmap MASK/CHANGE ]\n" +" [ overhead BYTES ] [ linklayer TYPE ]\n" ); }static void explain (void ) { -fprintf (stderr,"Usage: ... cbq bandwidth BPS avpkt BYTES [ mpu BYTES ]\n" ); -fprintf (stderr," [ cell BYTES ] [ ewma LOG ]\n" ); +fprintf (stderr, +"Usage: ... cbq bandwidth BPS avpkt BYTES [ mpu BYTES ]\n" +" [ cell BYTES ] [ ewma LOG ]\n" ); }static void explain1 (char *arg)
tc/q_cbs.c +3 -3
@@ -24,9 +24,9 @@static void explain (void ) { -fprintf (stderr,"Usage: ... cbs hicredit BYTES locredit BYTES sendslope BPS idleslope BPS\n" ); -fprintf (stderr," [offload 0|1]\n" ); - +fprintf (stderr, +"Usage: ... cbs hicredit BYTES locredit BYTES sendslope BPS idleslope BPS\n" +" [offload 0|1]\n" ); }static void explain1 (const char *arg,const char *val)
tc/q_choke.c +3 -2
@@ -26,8 +26,9 @@static void explain (void ) { -fprintf (stderr,"Usage: ... choke limit PACKETS bandwidth KBPS [ecn]\n" ); -fprintf (stderr," [ min PACKETS ] [ max PACKETS ] [ burst PACKETS ]\n" ); +fprintf (stderr, +"Usage: ... choke limit PACKETS bandwidth KBPS [ecn]\n" +" [ min PACKETS ] [ max PACKETS ] [ burst PACKETS ]\n" ); } static int choke_parse_opt(struct qdisc_util *qu, int argc, char **argv,
tc/q_codel.c +4 -3
@@ -52,9 +52,10 @@static void explain (void ) { -fprintf (stderr,"Usage: ... codel [ limit PACKETS ] [ target TIME ]\n" ); -fprintf (stderr," [ interval TIME ] [ ecn | noecn ]\n" ); -fprintf (stderr," [ ce_threshold TIME ]\n" ); +fprintf (stderr, +"Usage: ... codel [ limit PACKETS ] [ target TIME ]\n" +" [ interval TIME ] [ ecn | noecn ]\n" +" [ ce_threshold TIME ]\n" ); } static int codel_parse_opt(struct qdisc_util *qu, int argc, char **argv,
tc/q_etf.c +7 -4
@@ -38,8 +38,9 @@ static const struct static_clockid {static void explain (void ) { -fprintf (stderr,"Usage: ... etf delta NANOS clockid CLOCKID [offload] [deadline_mode]\n" ); -fprintf (stderr,"CLOCKID must be a valid SYS-V id (i.e. CLOCK_TAI)\n" ); +fprintf (stderr, +"Usage: ... etf delta NANOS clockid CLOCKID [offload] [deadline_mode]\n" +"CLOCKID must be a valid SYS-V id (i.e. CLOCK_TAI)\n" ); }static void explain1 (const char *arg,const char *val)
@@ -49,8 +50,10 @@ static void explain1(const char *arg, const char *val)static void explain_clockid (const char *val) { -fprintf (stderr,"etf: illegal value for \"clockid\": \"%s\".\n" , val); -fprintf (stderr,"It must be a valid SYS-V id (i.e. CLOCK_TAI)\n" ); +fprintf (stderr, +"etf: illegal value for \"clockid\": \"%s\".\n" +"It must be a valid SYS-V id (i.e. CLOCK_TAI)\n" , + val); }static int get_clockid (__s32 *val,const char *arg)
tc/q_fq.c +8 -7
@@ -50,13 +50,14 @@static void explain (void ) { -fprintf (stderr,"Usage: ... fq [ limit PACKETS ] [ flow_limit PACKETS ]\n" ); -fprintf (stderr," [ quantum BYTES ] [ initial_quantum BYTES ]\n" ); -fprintf (stderr," [ maxrate RATE ] [ buckets NUMBER ]\n" ); -fprintf (stderr," [ [no]pacing ] [ refill_delay TIME ]\n" ); -fprintf (stderr," [ low_rate_threshold RATE ]\n" ); -fprintf (stderr," [ orphan_mask MASK]\n" ); -fprintf (stderr," [ ce_threshold TIME ]\n" ); +fprintf (stderr, +"Usage: ... fq [ limit PACKETS ] [ flow_limit PACKETS ]\n" +" [ quantum BYTES ] [ initial_quantum BYTES ]\n" +" [ maxrate RATE ] [ buckets NUMBER ]\n" +" [ [no]pacing ] [ refill_delay TIME ]\n" +" [ low_rate_threshold RATE ]\n" +" [ orphan_mask MASK]\n" +" [ ce_threshold TIME ]\n" ); }static unsigned int ilog2 (unsigned int val)
tc/q_fq_codel.c +6 -5
@@ -49,11 +49,12 @@static void explain (void ) { -fprintf (stderr,"Usage: ... fq_codel [ limit PACKETS ] [ flows NUMBER ]\n" ); -fprintf (stderr," [ memory_limit BYTES ]\n" ); -fprintf (stderr," [ target TIME ] [ interval TIME ]\n" ); -fprintf (stderr," [ quantum BYTES ] [ [no]ecn ]\n" ); -fprintf (stderr," [ ce_threshold TIME ]\n" ); +fprintf (stderr, +"Usage: ... fq_codel [ limit PACKETS ] [ flows NUMBER ]\n" +"[ memory_limit BYTES ]\n" +"[ target TIME ] [ interval TIME ]\n" +"[ quantum BYTES ] [ [no]ecn ]\n" +"[ ce_threshold TIME ]\n" ); } static int fq_codel_parse_opt(struct qdisc_util *qu, int argc, char **argv,
tc/q_gred.c +6 -5
@@ -36,11 +36,12 @@static void explain (void ) { -fprintf (stderr,"Usage: tc qdisc { add | replace | change } ... gred setup vqs NUMBER\n" ); -fprintf (stderr," default DEFAULT_VQ [ grio ] [ limit BYTES ] [ecn] [harddrop]\n" ); -fprintf (stderr," tc qdisc change ... gred vq VQ [ prio VALUE ] limit BYTES\n" ); -fprintf (stderr," min BYTES max BYTES avpkt BYTES [ burst PACKETS ]\n" ); -fprintf (stderr," [ probability PROBABILITY ] [ bandwidth KBPS ] [ecn] [harddrop]\n" ); +fprintf (stderr, +"Usage: tc qdisc { add | replace | change } ... gred setup vqs NUMBER\n" +" default DEFAULT_VQ [ grio ] [ limit BYTES ] [ecn] [harddrop]\n" +" tc qdisc change ... gred vq VQ [ prio VALUE ] limit BYTES\n" +" min BYTES max BYTES avpkt BYTES [ burst PACKETS ]\n" +" [ probability PROBABILITY ] [ bandwidth KBPS ] [ecn] [harddrop]\n" ); } static int init_gred(struct qdisc_util *qu, int argc, char **argv,
tc/q_hhf.c +7 -6
@@ -17,12 +17,13 @@static void explain (void ) { -fprintf (stderr,"Usage: ... hhf [ limit PACKETS ] [ quantum BYTES]\n" ); -fprintf (stderr," [ hh_limit NUMBER ]\n" ); -fprintf (stderr," [ reset_timeout TIME ]\n" ); -fprintf (stderr," [ admit_bytes BYTES ]\n" ); -fprintf (stderr," [ evict_timeout TIME ]\n" ); -fprintf (stderr," [ non_hh_weight NUMBER ]\n" ); +fprintf (stderr, +"Usage: ... hhf [ limit PACKETS ] [ quantum BYTES]\n" +" [ hh_limit NUMBER ]\n" +" [ reset_timeout TIME ]\n" +" [ admit_bytes BYTES ]\n" +" [ evict_timeout TIME ]\n" +" [ non_hh_weight NUMBER ]\n" ); } static int hhf_parse_opt(struct qdisc_util *qu, int argc, char **argv,
tc/q_mqprio.c +7 -6
@@ -23,13 +23,14 @@static void explain (void ) { -fprintf (stderr,"Usage: ... mqprio [num_tc NUMBER] [map P0 P1 ...]\n" ); -fprintf (stderr," [queues count1@offset1 count2@offset2 ...] " ); -fprintf (stderr,"[hw 1|0]\n" ); -fprintf (stderr," [mode dcb|channel]\n" ); -fprintf (stderr," [shaper bw_rlimit SHAPER_PARAMS]\n" +fprintf (stderr, +"Usage: ... mqprio [num_tc NUMBER] [map P0 P1 ...]\n" +" [queues count1@offset1 count2@offset2 ...] " +"[hw 1|0]\n" +" [mode dcb|channel]\n" +" [shaper bw_rlimit SHAPER_PARAMS]\n" "Where: SHAPER_PARAMS := { min_rate MIN_RATE1 MIN_RATE2 ...|\n" -" max_rate MAX_RATE1 MAX_RATE2 ... }\n" ); +" max_rate MAX_RATE1 MAX_RATE2 ... }\n" ); } static int mqprio_parse_opt(struct qdisc_util *qu, int argc,
tc/q_netem.c +16 -16
@@ -30,22 +30,22 @@static void explain (void ) {fprintf (stderr, -"Usage: ... netem [ limit PACKETS ]\n" \ -" [ delay TIME [ JITTER [CORRELATION]]]\n" \ -" [ distribution {uniform|normal|pareto|paretonormal} ]\n" \ -" [ corrupt PERCENT [CORRELATION]]\n" \ -" [ duplicate PERCENT [CORRELATION]]\n" \ -" [ loss random PERCENT [CORRELATION]]\n" \ -" [ loss state P13 [P31 [P32 [P23 P14]]]\n" \ -" [ loss gemodel PERCENT [R [1-H [1-K]]]\n" \ -" [ ecn ]\n" \ -" [ reorder PRECENT [CORRELATION] [ gap DISTANCE ]]\n" \ -" [ rate RATE [PACKETOVERHEAD] [CELLSIZE] [CELLOVERHEAD]]\n" \ -" [ slot MIN_DELAY [MAX_DELAY] [packets MAX_PACKETS]" \ -" [bytes MAX_BYTES]]\n" \ -" [ slot distribution" \ -" {uniform|normal|pareto|paretonormal|custom} DELAY JITTER" \ -" [packets MAX_PACKETS] [bytes MAX_BYTES]]\n" ); +"Usage: ... netem [ limit PACKETS ]\n" \ +" [ delay TIME [ JITTER [CORRELATION]]]\n" \ +" [ distribution {uniform|normal|pareto|paretonormal} ]\n" \ +" [ corrupt PERCENT [CORRELATION]]\n" \ +" [ duplicate PERCENT [CORRELATION]]\n" \ +" [ loss random PERCENT [CORRELATION]]\n" \ +" [ loss state P13 [P31 [P32 [P23 P14]]]\n" \ +" [ loss gemodel PERCENT [R [1-H [1-K]]]\n" \ +" [ ecn ]\n" \ +" [ reorder PRECENT [CORRELATION] [ gap DISTANCE ]]\n" \ +" [ rate RATE [PACKETOVERHEAD] [CELLSIZE] [CELLOVERHEAD]]\n" \ +" [ slot MIN_DELAY [MAX_DELAY] [packets MAX_PACKETS]" \ +" [bytes MAX_BYTES]]\n" \ +" [ slot distribution" \ +" {uniform|normal|pareto|paretonormal|custom} DELAY JITTER" \ +" [packets MAX_PACKETS] [bytes MAX_BYTES]]\n" ); }static void explain1 (const char *arg)
tc/q_pie.c +4 -3
@@ -30,9 +30,10 @@static void explain (void ) { -fprintf (stderr,"Usage: ... pie [ limit PACKETS ][ target TIME us]\n" ); -fprintf (stderr," [ tupdate TIME us][ alpha ALPHA ]" ); -fprintf (stderr,"[beta BETA ][bytemode | nobytemode][ecn | noecn ]\n" ); +fprintf (stderr, +"Usage: ... pie [ limit PACKETS ][ target TIME us]\n" +" [ tupdate TIME us][ alpha ALPHA ]" +"[beta BETA ][bytemode | nobytemode][ecn | noecn ]\n" ); }#define ALPHA_MAX 32
tc/q_red.c +4 -3
@@ -27,9 +27,10 @@static void explain (void ) { -fprintf (stderr,"Usage: ... red limit BYTES [min BYTES] [max BYTES] avpkt BYTES [burst PACKETS]\n" ); -fprintf (stderr," [adaptive] [probability PROBABILITY] [bandwidth KBPS]\n" ); -fprintf (stderr," [ecn] [harddrop]\n" ); +fprintf (stderr, +"Usage: ... red limit BYTES [min BYTES] [max BYTES] avpkt BYTES [burst PACKETS]\n" +" [adaptive] [probability PROBABILITY] [bandwidth KBPS]\n" +" [ecn] [harddrop]\n" ); } static int red_parse_opt(struct qdisc_util *qu, int argc, char **argv,
tc/q_sfq.c +7 -6
@@ -26,12 +26,13 @@static void explain (void ) { -fprintf (stderr,"Usage: ... sfq [ limit NUMBER ] [ perturb SECS ] [ quantum BYTES ]\n" ); -fprintf (stderr," [ divisor NUMBER ] [ flows NUMBER] [ depth NUMBER ]\n" ); -fprintf (stderr," [ headdrop ]\n" ); -fprintf (stderr," [ redflowlimit BYTES ] [ min BYTES ] [ max BYTES ]\n" ); -fprintf (stderr," [ avpkt BYTES ] [ burst PACKETS ] [ probability P ]\n" ); -fprintf (stderr," [ ecn ] [ harddrop ]\n" ); +fprintf (stderr, +"Usage: ... sfq [ limit NUMBER ] [ perturb SECS ] [ quantum BYTES ]\n" +" [ divisor NUMBER ] [ flows NUMBER] [ depth NUMBER ]\n" +" [ headdrop ]\n" +" [ redflowlimit BYTES ] [ min BYTES ] [ max BYTES ]\n" +" [ avpkt BYTES ] [ burst PACKETS ] [ probability P ]\n" +" [ ecn ] [ harddrop ]\n" ); }static int sfq_parse_opt (struct qdisc_util *qu,int argc,char **argv,struct nlmsghdr *n,const char *dev)
tc/q_taprio.c +8 -7
@@ -47,13 +47,14 @@ static const struct static_clockid {static void explain (void ) { -fprintf (stderr,"Usage: ... taprio clockid CLOCKID\n" ); -fprintf (stderr," [num_tc NUMBER] [map P0 P1 ...] " ); -fprintf (stderr," [queues COUNT@OFFSET COUNT@OFFSET COUNT@OFFSET ...] " ); -fprintf (stderr," [ [sched-entry index cmd gate-mask interval] ... ] " ); -fprintf (stderr," [base-time time] " ); -fprintf (stderr,"\nCLOCKID must be a valid SYS-V id (i.e. CLOCK_TAI)" ); -fprintf (stderr,"\n" ); +fprintf (stderr, +"Usage: ... taprio clockid CLOCKID\n" +" [num_tc NUMBER] [map P0 P1 ...] " +" [queues COUNT@OFFSET COUNT@OFFSET COUNT@OFFSET ...] " +" [ [sched-entry index cmd gate-mask interval] ... ] " +" [base-time time] " +"\n" +"CLOCKID must be a valid SYS-V id (i.e. CLOCK_TAI)\n" ); }static void explain_clockid (const char *val)
tc/q_tbf.c +4 -3
@@ -24,9 +24,10 @@static void explain (void ) { -fprintf (stderr,"Usage: ... tbf limit BYTES burst BYTES[/BYTES] rate KBPS [ mtu BYTES[/BYTES] ]\n" ); -fprintf (stderr," [ peakrate KBPS ] [ latency TIME ] " ); -fprintf (stderr,"[ overhead BYTES ] [ linklayer TYPE ]\n" ); +fprintf (stderr, +"Usage: ... tbf limit BYTES burst BYTES[/BYTES] rate KBPS [ mtu BYTES[/BYTES] ]\n" +" [ peakrate KBPS ] [ latency TIME ] " +"[ overhead BYTES ] [ linklayer TYPE ]\n" ); }static void explain1 (const char *arg,const char *val)
tc/tc.c +6 -6
@@ -194,14 +194,14 @@ noexist:static void usage (void ) {fprintf (stderr, -"Usage: tc [ OPTIONS ] OBJECT { COMMAND | help }\n" -" tc [-force] -batch filename\n" +"Usage: tc [ OPTIONS ] OBJECT { COMMAND | help }\n" +" tc [-force] -batch filename\n" "where OBJECT := { qdisc | class | filter | chain |\n" -" action | monitor | exec }\n" +" action | monitor | exec }\n" " OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[aw] |\n" -" -o[neline] | -j[son] | -p[retty] | -c[olor]\n" -" -b[atch] [filename] | -n[etns] name |\n" -" -nm | -nam[es] | { -cf | -conf } path }\n" ); +" -o[neline] | -j[son] | -p[retty] | -c[olor]\n" +" -b[atch] [filename] | -n[etns] name |\n" +" -nm | -nam[es] | { -cf | -conf } path }\n" ); }static int do_cmd (int argc,char **argv,void *buf,size_t buflen)
tc/tc_class.c +9 -8
@@ -43,14 +43,15 @@ static void usage(void);static void usage (void ) { -fprintf (stderr,"Usage: tc class [ add | del | change | replace | show ] dev STRING\n" ); -fprintf (stderr," [ classid CLASSID ] [ root | parent CLASSID ]\n" ); -fprintf (stderr," [ [ QDISC_KIND ] [ help | OPTIONS ] ]\n" ); -fprintf (stderr,"\n" ); -fprintf (stderr," tc class show [ dev STRING ] [ root | parent CLASSID ]\n" ); -fprintf (stderr,"Where:\n" ); -fprintf (stderr,"QDISC_KIND := { prio | cbq | etc. }\n" ); -fprintf (stderr,"OPTIONS := ... try tc class add <desired QDISC_KIND> help\n" ); +fprintf (stderr, +"Usage: tc class [ add | del | change | replace | show ] dev STRING\n" +" [ classid CLASSID ] [ root | parent CLASSID ]\n" +" [ [ QDISC_KIND ] [ help | OPTIONS ] ]\n" +"\n" +" tc class show [ dev STRING ] [ root | parent CLASSID ]\n" +"Where:\n" +"QDISC_KIND := { prio | cbq | etc. }\n" +"OPTIONS := ... try tc class add <desired QDISC_KIND> help\n" ); }static int tc_class_modify (int cmd,unsigned int flags,int argc,char **argv)
tc/tc_exec.c +5 -4
@@ -23,10 +23,11 @@ static void *BODY;static void usage (void ) { -fprintf (stderr,"Usage: tc exec [ EXEC_TYPE ] [ help | OPTIONS ]\n" ); -fprintf (stderr,"Where:\n" ); -fprintf (stderr,"EXEC_TYPE := { bpf | etc. }\n" ); -fprintf (stderr,"OPTIONS := ... try tc exec <desired EXEC_KIND> help\n" ); +fprintf (stderr, +"Usage: tc exec [ EXEC_TYPE ] [ help | OPTIONS ]\n" +"Where:\n" +"EXEC_TYPE := { bpf | etc. }\n" +"OPTIONS := ... try tc exec <desired EXEC_KIND> help\n" ); }static int parse_noeopt (struct exec_util *eu,int argc,char **argv)
tc/tc_qdisc.c +13 -12
@@ -27,18 +27,19 @@static int usage (void ) { -fprintf (stderr,"Usage: tc qdisc [ add | del | replace | change | show ] dev STRING\n" ); -fprintf (stderr," [ handle QHANDLE ] [ root | ingress | clsact | parent CLASSID ]\n" ); -fprintf (stderr," [ estimator INTERVAL TIME_CONSTANT ]\n" ); -fprintf (stderr," [ stab [ help | STAB_OPTIONS] ]\n" ); -fprintf (stderr," [ ingress_block BLOCK_INDEX ] [ egress_block BLOCK_INDEX ]\n" ); -fprintf (stderr," [ [ QDISC_KIND ] [ help | OPTIONS ] ]\n" ); -fprintf (stderr,"\n" ); -fprintf (stderr," tc qdisc show [ dev STRING ] [ ingress | clsact ] [ invisible ]\n" ); -fprintf (stderr,"Where:\n" ); -fprintf (stderr,"QDISC_KIND := { [p|b]fifo | tbf | prio | cbq | red | etc. }\n" ); -fprintf (stderr,"OPTIONS := ... try tc qdisc add <desired QDISC_KIND> help\n" ); -fprintf (stderr,"STAB_OPTIONS := ... try tc qdisc add stab help\n" ); +fprintf (stderr, +"Usage: tc qdisc [ add | del | replace | change | show ] dev STRING\n" +" [ handle QHANDLE ] [ root | ingress | clsact | parent CLASSID ]\n" +" [ estimator INTERVAL TIME_CONSTANT ]\n" +" [ stab [ help | STAB_OPTIONS] ]\n" +" [ ingress_block BLOCK_INDEX ] [ egress_block BLOCK_INDEX ]\n" +" [ [ QDISC_KIND ] [ help | OPTIONS ] ]\n" +"\n" +" tc qdisc show [ dev STRING ] [ ingress | clsact ] [ invisible ]\n" +"Where:\n" +"QDISC_KIND := { [p|b]fifo | tbf | prio | cbq | red | etc. }\n" +"OPTIONS := ... try tc qdisc add <desired QDISC_KIND> help\n" +"STAB_OPTIONS := ... try tc qdisc add stab help\n" );return -1 ; }
tipc/bearer.c +21 -23
76 lines not on this page · raw message
Signature · 1 line
2.21.0
Quoted 27 lines · On Fri, 17 May 2019 15:38:28 +0200 Matteo Croce <[email protected]> wrote:
Every tool in the iproute2 package have one or more function to show an help message to the user. Some of these functions print the help line by line with a series of printf call, e.g.
ip/xfrm_state.cdoes 60 fprintf calls.
If we group all the calls to a single one and just concatenate strings, we save a lot of libc calls and thus object size. The size difference of the compiled binaries calculated with bloat-o-meter is:ip/ip: add/remove: 0/0 grow/shrink: 5/15 up/down: 103/-4796 (-4693) Total: Before=672591, After=667898, chg -0.70% ip/rtmon: add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-54 (-54) Total: Before=48879, After=48825, chg -0.11% tc/tc: add/remove: 0/2 grow/shrink: 31/10 up/down: 882/-6133 (-5251) Total: Before=351912, After=346661, chg -1.49% bridge/bridge: add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-459 (-459) Total: Before=70502, After=70043, chg -0.65% misc/lnstat: add/remove: 0/1 grow/shrink: 1/0 up/down: 48/-486 (-438) Total: Before=9960, After=9522, chg -4.40% tipc/tipc: add/remove: 0/0 grow/shrink: 1/1 up/down: 18/-62 (-44) Total: Before=79182, After=79138, chg -0.06%
Quoted 4 lines
While at it, indent some strings which were starting at column 0, and use tabs where possible, to have a consistent style across helps.
Signed-off-by Matteo Croce <[email protected]>
Looks good thanks, I had been doing this bit by bit over time.
David Ahern
AppliedQuoted 8 lines · Matteo Croce
Every tool in the iproute2 package have one or more function to show an help message to the user. Some of these functions print the help line by line with a series of printf call, e.g.
ip/xfrm_state.cdoes 60 fprintf calls.
If we group all the calls to a single one and just concatenate strings, we save a lot of libc calls and thus object size. The size difference of the compiled binaries calculated with bloat-o-meter is:
...
Quoted 6 lines
While at it, indent some strings which were starting at column 0, and use tabs where possible, to have a consistent style across helps.
Signed-off-by Matteo Croce <[email protected]>---
applied to iproute2-next. Thanks for taking the time to clean this up.