"Robert P. J. Day" | 63fc1a9 | 2006-07-02 19:47:05 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
Glenn L McGrath | 9a2d272 | 2002-11-10 01:33:55 +0000 | [diff] [blame] | 2 | /* |
Denys Vlasenko | 0ef64bd | 2010-08-16 20:14:46 +0200 | [diff] [blame] | 3 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
Glenn L McGrath | 9a2d272 | 2002-11-10 01:33:55 +0000 | [diff] [blame] | 4 | * |
Denys Vlasenko | e0a6220 | 2010-07-24 23:26:58 +0200 | [diff] [blame] | 5 | * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> |
Glenn L McGrath | 9a2d272 | 2002-11-10 01:33:55 +0000 | [diff] [blame] | 6 | * |
| 7 | * Changes: |
Denys Vlasenko | fb132e4 | 2010-10-29 11:46:52 +0200 | [diff] [blame] | 8 | * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses |
Bernhard Reutner-Fischer | 6c4dade | 2008-09-25 12:13:34 +0000 | [diff] [blame] | 9 | * Bernhard Reutner-Fischer rewrote to use index_in_substr_array |
Glenn L McGrath | 9a2d272 | 2002-11-10 01:33:55 +0000 | [diff] [blame] | 10 | */ |
Denys Vlasenko | 47367e1 | 2016-11-23 09:05:14 +0100 | [diff] [blame] | 11 | //config:config IP |
Denys Vlasenko | b097a84 | 2018-12-28 03:20:17 +0100 | [diff] [blame] | 12 | //config: bool "ip (35 kb)" |
Denys Vlasenko | 47367e1 | 2016-11-23 09:05:14 +0100 | [diff] [blame] | 13 | //config: default y |
Denys Vlasenko | 47367e1 | 2016-11-23 09:05:14 +0100 | [diff] [blame] | 14 | //config: help |
Denys Vlasenko | 72089cf | 2017-07-21 09:50:55 +0200 | [diff] [blame] | 15 | //config: The "ip" applet is a TCP/IP interface configuration and routing |
Denys Vlasenko | 68b653b | 2017-07-27 10:53:09 +0200 | [diff] [blame] | 16 | //config: utility. |
| 17 | //config: Short forms (enabled below) are busybox-specific extensions. |
| 18 | //config: The standard "ip" utility does not provide them. If you are |
| 19 | //config: trying to be portable, it's better to use "ip CMD" forms. |
Denys Vlasenko | 47367e1 | 2016-11-23 09:05:14 +0100 | [diff] [blame] | 20 | //config: |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 21 | //config:config IPADDR |
Denys Vlasenko | 4eed2c6 | 2017-07-18 22:01:24 +0200 | [diff] [blame] | 22 | //config: bool "ipaddr (14 kb)" |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 23 | //config: default y |
| 24 | //config: select FEATURE_IP_ADDRESS |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 25 | //config: help |
Denys Vlasenko | 68b653b | 2017-07-27 10:53:09 +0200 | [diff] [blame] | 26 | //config: Short form of "ip addr" |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 27 | //config: |
| 28 | //config:config IPLINK |
Denys Vlasenko | b097a84 | 2018-12-28 03:20:17 +0100 | [diff] [blame] | 29 | //config: bool "iplink (17 kb)" |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 30 | //config: default y |
| 31 | //config: select FEATURE_IP_LINK |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 32 | //config: help |
Denys Vlasenko | 68b653b | 2017-07-27 10:53:09 +0200 | [diff] [blame] | 33 | //config: Short form of "ip link" |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 34 | //config: |
| 35 | //config:config IPROUTE |
Denys Vlasenko | 4eed2c6 | 2017-07-18 22:01:24 +0200 | [diff] [blame] | 36 | //config: bool "iproute (15 kb)" |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 37 | //config: default y |
| 38 | //config: select FEATURE_IP_ROUTE |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 39 | //config: help |
Denys Vlasenko | 68b653b | 2017-07-27 10:53:09 +0200 | [diff] [blame] | 40 | //config: Short form of "ip route" |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 41 | //config: |
| 42 | //config:config IPTUNNEL |
Denys Vlasenko | 4eed2c6 | 2017-07-18 22:01:24 +0200 | [diff] [blame] | 43 | //config: bool "iptunnel (9.6 kb)" |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 44 | //config: default y |
| 45 | //config: select FEATURE_IP_TUNNEL |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 46 | //config: help |
Denys Vlasenko | 68b653b | 2017-07-27 10:53:09 +0200 | [diff] [blame] | 47 | //config: Short form of "ip tunnel" |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 48 | //config: |
| 49 | //config:config IPRULE |
Denys Vlasenko | 4eed2c6 | 2017-07-18 22:01:24 +0200 | [diff] [blame] | 50 | //config: bool "iprule (10 kb)" |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 51 | //config: default y |
| 52 | //config: select FEATURE_IP_RULE |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 53 | //config: help |
Denys Vlasenko | 68b653b | 2017-07-27 10:53:09 +0200 | [diff] [blame] | 54 | //config: Short form of "ip rule" |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 55 | //config: |
| 56 | //config:config IPNEIGH |
Denys Vlasenko | 4eed2c6 | 2017-07-18 22:01:24 +0200 | [diff] [blame] | 57 | //config: bool "ipneigh (8.3 kb)" |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 58 | //config: default y |
| 59 | //config: select FEATURE_IP_NEIGH |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 60 | //config: help |
Denys Vlasenko | 68b653b | 2017-07-27 10:53:09 +0200 | [diff] [blame] | 61 | //config: Short form of "ip neigh" |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 62 | //config: |
Denys Vlasenko | 47367e1 | 2016-11-23 09:05:14 +0100 | [diff] [blame] | 63 | //config:config FEATURE_IP_ADDRESS |
| 64 | //config: bool "ip address" |
| 65 | //config: default y |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 66 | //config: depends on IP || IPADDR |
Denys Vlasenko | 47367e1 | 2016-11-23 09:05:14 +0100 | [diff] [blame] | 67 | //config: help |
Denys Vlasenko | 72089cf | 2017-07-21 09:50:55 +0200 | [diff] [blame] | 68 | //config: Address manipulation support for the "ip" applet. |
Denys Vlasenko | 47367e1 | 2016-11-23 09:05:14 +0100 | [diff] [blame] | 69 | //config: |
| 70 | //config:config FEATURE_IP_LINK |
| 71 | //config: bool "ip link" |
| 72 | //config: default y |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 73 | //config: depends on IP || IPLINK |
Denys Vlasenko | 47367e1 | 2016-11-23 09:05:14 +0100 | [diff] [blame] | 74 | //config: help |
Denys Vlasenko | 72089cf | 2017-07-21 09:50:55 +0200 | [diff] [blame] | 75 | //config: Configure network devices with "ip". |
Denys Vlasenko | 47367e1 | 2016-11-23 09:05:14 +0100 | [diff] [blame] | 76 | //config: |
| 77 | //config:config FEATURE_IP_ROUTE |
| 78 | //config: bool "ip route" |
| 79 | //config: default y |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 80 | //config: depends on IP || IPROUTE |
Denys Vlasenko | 47367e1 | 2016-11-23 09:05:14 +0100 | [diff] [blame] | 81 | //config: help |
Denys Vlasenko | 72089cf | 2017-07-21 09:50:55 +0200 | [diff] [blame] | 82 | //config: Add support for routing table management to "ip". |
Denys Vlasenko | 47367e1 | 2016-11-23 09:05:14 +0100 | [diff] [blame] | 83 | //config: |
| 84 | //config:config FEATURE_IP_ROUTE_DIR |
| 85 | //config: string "ip route configuration directory" |
| 86 | //config: default "/etc/iproute2" |
| 87 | //config: depends on FEATURE_IP_ROUTE |
| 88 | //config: help |
Denys Vlasenko | 72089cf | 2017-07-21 09:50:55 +0200 | [diff] [blame] | 89 | //config: Location of the "ip" applet routing configuration. |
Denys Vlasenko | 47367e1 | 2016-11-23 09:05:14 +0100 | [diff] [blame] | 90 | //config: |
| 91 | //config:config FEATURE_IP_TUNNEL |
| 92 | //config: bool "ip tunnel" |
| 93 | //config: default y |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 94 | //config: depends on IP || IPTUNNEL |
Denys Vlasenko | 47367e1 | 2016-11-23 09:05:14 +0100 | [diff] [blame] | 95 | //config: help |
Denys Vlasenko | 72089cf | 2017-07-21 09:50:55 +0200 | [diff] [blame] | 96 | //config: Add support for tunneling commands to "ip". |
Denys Vlasenko | 47367e1 | 2016-11-23 09:05:14 +0100 | [diff] [blame] | 97 | //config: |
| 98 | //config:config FEATURE_IP_RULE |
| 99 | //config: bool "ip rule" |
| 100 | //config: default y |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 101 | //config: depends on IP || IPRULE |
Denys Vlasenko | 47367e1 | 2016-11-23 09:05:14 +0100 | [diff] [blame] | 102 | //config: help |
Denys Vlasenko | 72089cf | 2017-07-21 09:50:55 +0200 | [diff] [blame] | 103 | //config: Add support for rule commands to "ip". |
Denys Vlasenko | 47367e1 | 2016-11-23 09:05:14 +0100 | [diff] [blame] | 104 | //config: |
| 105 | //config:config FEATURE_IP_NEIGH |
| 106 | //config: bool "ip neighbor" |
| 107 | //config: default y |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 108 | //config: depends on IP || IPNEIGH |
Denys Vlasenko | 47367e1 | 2016-11-23 09:05:14 +0100 | [diff] [blame] | 109 | //config: help |
Denys Vlasenko | 72089cf | 2017-07-21 09:50:55 +0200 | [diff] [blame] | 110 | //config: Add support for neighbor commands to "ip". |
Denys Vlasenko | 47367e1 | 2016-11-23 09:05:14 +0100 | [diff] [blame] | 111 | //config: |
Denys Vlasenko | 47367e1 | 2016-11-23 09:05:14 +0100 | [diff] [blame] | 112 | //config:config FEATURE_IP_RARE_PROTOCOLS |
| 113 | //config: bool "Support displaying rarely used link types" |
| 114 | //config: default n |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 115 | //config: depends on IP || IPADDR || IPLINK || IPROUTE || IPTUNNEL || IPRULE || IPNEIGH |
Denys Vlasenko | 47367e1 | 2016-11-23 09:05:14 +0100 | [diff] [blame] | 116 | //config: help |
Denys Vlasenko | 72089cf | 2017-07-21 09:50:55 +0200 | [diff] [blame] | 117 | //config: If you are not going to use links of type "frad", "econet", |
| 118 | //config: "bif" etc, you probably don't need to enable this. |
| 119 | //config: Ethernet, wireless, infrared, ppp/slip, ip tunnelling |
| 120 | //config: link types are supported without this option selected. |
Denys Vlasenko | 47367e1 | 2016-11-23 09:05:14 +0100 | [diff] [blame] | 121 | |
Denys Vlasenko | b63afea | 2017-09-18 15:45:13 +0200 | [diff] [blame] | 122 | //applet:IF_IP( APPLET_NOEXEC(ip , ip , BB_DIR_SBIN, BB_SUID_DROP, ip )) |
| 123 | //applet:IF_IPADDR( APPLET_NOEXEC(ipaddr , ipaddr , BB_DIR_SBIN, BB_SUID_DROP, ipaddr )) |
| 124 | //applet:IF_IPLINK( APPLET_NOEXEC(iplink , iplink , BB_DIR_SBIN, BB_SUID_DROP, iplink )) |
| 125 | //applet:IF_IPROUTE( APPLET_NOEXEC(iproute , iproute , BB_DIR_SBIN, BB_SUID_DROP, iproute )) |
| 126 | //applet:IF_IPRULE( APPLET_NOEXEC(iprule , iprule , BB_DIR_SBIN, BB_SUID_DROP, iprule )) |
| 127 | //applet:IF_IPTUNNEL(APPLET_NOEXEC(iptunnel, iptunnel, BB_DIR_SBIN, BB_SUID_DROP, iptunnel)) |
| 128 | //applet:IF_IPNEIGH( APPLET_NOEXEC(ipneigh , ipneigh , BB_DIR_SBIN, BB_SUID_DROP, ipneigh )) |
Denys Vlasenko | 47367e1 | 2016-11-23 09:05:14 +0100 | [diff] [blame] | 129 | |
| 130 | //kbuild:lib-$(CONFIG_IP) += ip.o |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 131 | //kbuild:lib-$(CONFIG_IPADDR) += ip.o |
| 132 | //kbuild:lib-$(CONFIG_IPLINK) += ip.o |
| 133 | //kbuild:lib-$(CONFIG_IPROUTE) += ip.o |
| 134 | //kbuild:lib-$(CONFIG_IPRULE) += ip.o |
| 135 | //kbuild:lib-$(CONFIG_IPTUNNEL) += ip.o |
| 136 | //kbuild:lib-$(CONFIG_IPNEIGH) += ip.o |
Glenn L McGrath | 9a2d272 | 2002-11-10 01:33:55 +0000 | [diff] [blame] | 137 | |
Denys Vlasenko | 4eaa0f7 | 2017-04-07 18:14:46 +0200 | [diff] [blame] | 138 | //--------------123456789.123456789.123456789.123456789.123456789.123456789.123456789.123....79 |
Pere Orga | 5bc8c00 | 2011-04-11 03:29:49 +0200 | [diff] [blame] | 139 | //usage:#define ipaddr_trivial_usage |
Denys Vlasenko | 1238988 | 2017-01-21 14:27:07 +0100 | [diff] [blame] | 140 | //usage: "add|del IFADDR dev IFACE | show|flush [dev IFACE] [to PREFIX]" |
Pere Orga | 5bc8c00 | 2011-04-11 03:29:49 +0200 | [diff] [blame] | 141 | //usage:#define ipaddr_full_usage "\n\n" |
Christian Eggers | 31d34f3 | 2020-06-29 17:57:25 +0200 | [diff] [blame] | 142 | //usage: "ipaddr add|change|replace|delete dev IFACE [CONFFLAG-LIST] IFADDR\n" |
Denys Vlasenko | 7121bb8 | 2017-04-07 18:22:41 +0200 | [diff] [blame] | 143 | //usage: " IFADDR := PREFIX | ADDR peer PREFIX [broadcast ADDR|+|-]\n" |
| 144 | //usage: " [anycast ADDR] [label STRING] [scope SCOPE]\n" |
| 145 | //usage: " PREFIX := ADDR[/MASK]\n" |
| 146 | //usage: " SCOPE := [host|link|global|NUMBER]\n" |
Christian Eggers | 31d34f3 | 2020-06-29 17:57:25 +0200 | [diff] [blame] | 147 | //usage: " CONFFLAG-LIST := [CONFFLAG-LIST] CONFFLAG\n" |
| 148 | //usage: " CONFFLAG := [noprefixroute]\n" |
Denys Vlasenko | 7121bb8 | 2017-04-07 18:22:41 +0200 | [diff] [blame] | 149 | //usage: "ipaddr show|flush [dev IFACE] [scope SCOPE] [to PREFIX] [label PATTERN]" |
Pere Orga | 5bc8c00 | 2011-04-11 03:29:49 +0200 | [diff] [blame] | 150 | //usage: |
Denys Vlasenko | 4eaa0f7 | 2017-04-07 18:14:46 +0200 | [diff] [blame] | 151 | //--------------123456789.123456789.123456789.123456789.123456789.123456789.123456789.123....79 |
Pere Orga | 5bc8c00 | 2011-04-11 03:29:49 +0200 | [diff] [blame] | 152 | //usage:#define iplink_trivial_usage |
Jan Luebbe | 79cda95 | 2018-02-20 19:28:02 +0100 | [diff] [blame] | 153 | //usage: /*Usage:iplink*/"set IFACE [up|down] [arp on|off] [multicast on|off]\n" |
Jan Luebbe | e789c3b | 2018-02-14 14:05:27 +0100 | [diff] [blame] | 154 | //usage: " [promisc on|off] [mtu NUM] [name NAME] [qlen NUM] [address MAC]\n" |
Nicholas Niro | c28313b | 2020-04-22 23:36:11 -0400 | [diff] [blame] | 155 | //usage: " [master IFACE | nomaster] [netns PID]" |
Jan Luebbe | 79cda95 | 2018-02-20 19:28:02 +0100 | [diff] [blame] | 156 | // * short help shows only "set" command, long help continues (with just one "\n") |
| 157 | // * and shows all other commands: |
| 158 | //usage:#define iplink_full_usage "\n" |
| 159 | //usage: "iplink add [link IFACE] IFACE [address MAC] type TYPE [ARGS]\n" |
| 160 | //usage: "iplink delete IFACE type TYPE [ARGS]\n" |
| 161 | //usage: " TYPE ARGS := vlan VLANARGS | vrf table NUM\n" |
| 162 | //usage: " VLANARGS := id VLANID [protocol 802.1q|802.1ad] [reorder_hdr on|off]\n" |
| 163 | //usage: " [gvrp on|off] [mvrp on|off] [loose_binding on|off]\n" |
Denys Vlasenko | 1238988 | 2017-01-21 14:27:07 +0100 | [diff] [blame] | 164 | //usage: "iplink show [IFACE]" |
Jan Luebbe | 79cda95 | 2018-02-20 19:28:02 +0100 | [diff] [blame] | 165 | //upstream man ip-link: |
| 166 | //===================== |
| 167 | //ip link add [link DEV] [ name ] NAME |
| 168 | // [ txqueuelen PACKETS ] |
| 169 | // [ address LLADDR ] |
| 170 | // [ broadcast LLADDR ] |
| 171 | // [ mtu MTU ] [index IDX ] |
| 172 | // [ numtxqueues QUEUE_COUNT ] |
| 173 | // [ numrxqueues QUEUE_COUNT ] |
| 174 | // type TYPE [ ARGS ] |
| 175 | // ip link delete { DEVICE | dev DEVICE | group DEVGROUP } type TYPE [ ARGS ] |
| 176 | // ip link set { DEVICE | dev DEVICE | group DEVGROUP } [ { up | down } ] |
| 177 | // [ arp { on | off } ] |
| 178 | // [ dynamic { on | off } ] |
| 179 | // [ multicast { on | off } ] |
| 180 | // [ allmulticast { on | off } ] |
| 181 | // [ promisc { on | off } ] |
| 182 | // [ trailers { on | off } ] |
| 183 | // [ txqueuelen PACKETS ] |
| 184 | // [ name NEWNAME ] |
| 185 | // [ address LLADDR ] |
| 186 | // [ broadcast LLADDR ] |
| 187 | // [ mtu MTU ] |
| 188 | // [ netns { PID | NAME } ] |
| 189 | // [ link-netnsid ID ] |
| 190 | // [ alias NAME ] |
| 191 | // [ vf NUM [ mac LLADDR ] |
| 192 | // [ vlan VLANID [ qos VLAN-QOS ] ] |
| 193 | // [ rate TXRATE ] |
| 194 | // [ spoofchk { on | off} ] |
| 195 | // [ query_rss { on | off} ] |
| 196 | // [ state { auto | enable | disable} ] ] |
| 197 | // [ trust { on | off} ] ] |
| 198 | // [ master DEVICE ] |
| 199 | // [ nomaster ] |
| 200 | // [ addrgenmode { eui64 | none | stable_secret | random } ] |
| 201 | // [ protodown { on | off } ] |
| 202 | // ip link show [ DEVICE | group GROUP ] [up] [master DEV] [type TYPE] |
| 203 | // ip link help [ TYPE ] |
| 204 | //TYPE := { vlan | veth | vcan | dummy | ifb | macvlan | macvtap | |
| 205 | // bridge | bond | ipoib | ip6tnl | ipip | sit | vxlan | |
| 206 | // gre | gretap | ip6gre | ip6gretap | vti | nlmon | |
| 207 | // bond_slave | ipvlan | geneve | bridge_slave | vrf } |
Pere Orga | 5bc8c00 | 2011-04-11 03:29:49 +0200 | [diff] [blame] | 208 | //usage: |
Denys Vlasenko | 4eaa0f7 | 2017-04-07 18:14:46 +0200 | [diff] [blame] | 209 | //--------------123456789.123456789.123456789.123456789.123456789.123456789.123456789.123....79 |
Pere Orga | 5bc8c00 | 2011-04-11 03:29:49 +0200 | [diff] [blame] | 210 | //usage:#define iproute_trivial_usage |
Denys Vlasenko | f3d705f | 2017-01-21 03:46:35 +0100 | [diff] [blame] | 211 | //usage: "list|flush|add|del|change|append|replace|test ROUTE" |
Pere Orga | 5bc8c00 | 2011-04-11 03:29:49 +0200 | [diff] [blame] | 212 | //usage:#define iproute_full_usage "\n\n" |
Denys Vlasenko | f3d705f | 2017-01-21 03:46:35 +0100 | [diff] [blame] | 213 | //usage: "iproute list|flush SELECTOR\n" |
Denys Vlasenko | 53782d9 | 2011-12-06 18:59:55 +0100 | [diff] [blame] | 214 | //usage: " SELECTOR := [root PREFIX] [match PREFIX] [proto RTPROTO]\n" |
Denys Vlasenko | 7121bb8 | 2017-04-07 18:22:41 +0200 | [diff] [blame] | 215 | //usage: " PREFIX := default|ADDR[/MASK]\n" |
Denys Vlasenko | 4eaa0f7 | 2017-04-07 18:14:46 +0200 | [diff] [blame] | 216 | //usage: "iproute get ADDR [from ADDR iif IFACE]\n" |
Denys Vlasenko | 1140bf3 | 2017-04-06 17:54:38 +0200 | [diff] [blame] | 217 | //usage: " [oif IFACE] [tos TOS]\n" |
| 218 | //usage: "iproute add|del|change|append|replace|test ROUTE\n" |
| 219 | //usage: " ROUTE := NODE_SPEC [INFO_SPEC]\n" |
| 220 | //usage: " NODE_SPEC := PREFIX"IF_FEATURE_IP_RULE(" [table TABLE_ID]")" [proto RTPROTO] [scope SCOPE] [metric METRIC]\n" |
| 221 | //usage: " INFO_SPEC := NH OPTIONS\n" |
Denys Vlasenko | 4eaa0f7 | 2017-04-07 18:14:46 +0200 | [diff] [blame] | 222 | //usage: " NH := [via [inet|inet6] ADDR] [dev IFACE] [src ADDR] [onlink]\n" |
Denys Vlasenko | d5342a1 | 2017-04-07 17:00:53 +0200 | [diff] [blame] | 223 | //usage: " OPTIONS := [mtu [lock] NUM] [advmss [lock] NUM]" |
Denys Vlasenko | 1140bf3 | 2017-04-06 17:54:38 +0200 | [diff] [blame] | 224 | //upstream man ip-route: |
| 225 | //====================== |
| 226 | //ip route { show | flush } SELECTOR |
| 227 | //ip route save SELECTOR |
| 228 | //ip route restore |
| 229 | //ip route get ADDRESS [ from ADDRESS iif STRING ] [ oif STRING ] [ tos TOS ] |
| 230 | //ip route { add | del | change | append | replace } ROUTE |
| 231 | //SELECTOR := [ root PREFIX ] [ match PREFIX ] [ exact PREFIX ] [ table TABLE_ID ] [ proto RTPROTO ] [ type TYPE ] [ scope SCOPE ] |
| 232 | //ROUTE := NODE_SPEC [ INFO_SPEC ] |
| 233 | //NODE_SPEC := [ TYPE ] PREFIX [ tos TOS ] [ table TABLE_ID ] [ proto RTPROTO ] [ scope SCOPE ] [ metric METRIC ] |
| 234 | //INFO_SPEC := NH OPTIONS FLAGS [ nexthop NH ] ... |
| 235 | //NH := [ encap ENCAP ] [ via [ FAMILY ] ADDRESS ] [ dev STRING ] [ weight NUMBER ] NHFLAGS |
| 236 | // ..............................................................^ I guess [src ADDRESS] should be here |
| 237 | //FAMILY := [ inet | inet6 | ipx | dnet | mpls | bridge | link ] |
| 238 | //OPTIONS := FLAGS [ mtu NUMBER ] [ advmss NUMBER ] [ as [ to ] ADDRESS ] rtt TIME ] [ rttvar TIME ] [ reordering NUMBER ] [ window NUMBER ] [ cwnd NUMBER ] [ ssthresh REALM ] [ realms REALM ] |
| 239 | // [ rto_min TIME ] [ initcwnd NUMBER ] [ initrwnd NUMBER ] [ features FEATURES ] [ quickack BOOL ] [ congctl NAME ] [ pref PREF ] [ expires TIME ] |
| 240 | //TYPE := [ unicast | local | broadcast | multicast | throw | unreachable | prohibit | blackhole | nat ] |
| 241 | //TABLE_ID := [ local | main | default | all | NUMBER ] |
| 242 | //SCOPE := [ host | link | global | NUMBER ] |
| 243 | //NHFLAGS := [ onlink | pervasive ] |
| 244 | //RTPROTO := [ kernel | boot | static | NUMBER ] |
| 245 | //FEATURES := [ ecn | ] |
| 246 | //PREF := [ low | medium | high ] |
| 247 | //ENCAP := [ MPLS | IP ] |
| 248 | //ENCAP_MPLS := mpls [ LABEL ] |
| 249 | //ENCAP_IP := ip id TUNNEL_ID dst REMOTE_IP [ tos TOS ] [ ttl TTL ] |
Pere Orga | 5bc8c00 | 2011-04-11 03:29:49 +0200 | [diff] [blame] | 250 | //usage: |
Denys Vlasenko | 4eaa0f7 | 2017-04-07 18:14:46 +0200 | [diff] [blame] | 251 | //--------------123456789.123456789.123456789.123456789.123456789.123456789.123456789.123....79 |
Pere Orga | 5bc8c00 | 2011-04-11 03:29:49 +0200 | [diff] [blame] | 252 | //usage:#define iprule_trivial_usage |
Denys Vlasenko | 1238988 | 2017-01-21 14:27:07 +0100 | [diff] [blame] | 253 | //usage: "[list] | add|del SELECTOR ACTION" |
Pere Orga | 5bc8c00 | 2011-04-11 03:29:49 +0200 | [diff] [blame] | 254 | //usage:#define iprule_full_usage "\n\n" |
Rui Salvaterra | eecd6f7 | 2020-07-31 10:10:36 +0100 | [diff] [blame] | 255 | //usage: " SELECTOR := [from PREFIX] [to PREFIX] [tos TOS] [fwmark FWMARK[/MASK]]\n" |
Denys Vlasenko | 1238988 | 2017-01-21 14:27:07 +0100 | [diff] [blame] | 256 | //usage: " [dev IFACE] [pref NUMBER]\n" |
Denys Vlasenko | 4eaa0f7 | 2017-04-07 18:14:46 +0200 | [diff] [blame] | 257 | //usage: " ACTION := [table TABLE_ID] [nat ADDR]\n" |
Denys Vlasenko | 8908c1d | 2017-01-21 03:56:46 +0100 | [diff] [blame] | 258 | //usage: " [prohibit|reject|unreachable]\n" |
Pere Orga | 5bc8c00 | 2011-04-11 03:29:49 +0200 | [diff] [blame] | 259 | //usage: " [realms [SRCREALM/]DSTREALM]\n" |
Denys Vlasenko | 8908c1d | 2017-01-21 03:56:46 +0100 | [diff] [blame] | 260 | //usage: " TABLE_ID := [local|main|default|NUMBER]" |
Pere Orga | 5bc8c00 | 2011-04-11 03:29:49 +0200 | [diff] [blame] | 261 | //usage: |
Denys Vlasenko | 4eaa0f7 | 2017-04-07 18:14:46 +0200 | [diff] [blame] | 262 | //--------------123456789.123456789.123456789.123456789.123456789.123456789.123456789.123....79 |
Pere Orga | 5bc8c00 | 2011-04-11 03:29:49 +0200 | [diff] [blame] | 263 | //usage:#define iptunnel_trivial_usage |
Denys Vlasenko | f3d705f | 2017-01-21 03:46:35 +0100 | [diff] [blame] | 264 | //usage: "add|change|del|show [NAME]\n" |
Denys Vlasenko | 3759516 | 2018-08-14 11:19:09 +0200 | [diff] [blame] | 265 | //usage: " [mode ipip|gre|sit] [remote ADDR] [local ADDR] [ttl TTL]" |
Pere Orga | 5bc8c00 | 2011-04-11 03:29:49 +0200 | [diff] [blame] | 266 | //usage:#define iptunnel_full_usage "\n\n" |
Denys Vlasenko | f3d705f | 2017-01-21 03:46:35 +0100 | [diff] [blame] | 267 | //usage: "iptunnel add|change|del|show [NAME]\n" |
| 268 | //usage: " [mode ipip|gre|sit] [remote ADDR] [local ADDR]\n" |
Pere Orga | 5bc8c00 | 2011-04-11 03:29:49 +0200 | [diff] [blame] | 269 | //usage: " [[i|o]seq] [[i|o]key KEY] [[i|o]csum]\n" |
| 270 | //usage: " [ttl TTL] [tos TOS] [[no]pmtudisc] [dev PHYS_DEV]" |
Curt Brune | 6993470 | 2015-10-14 12:53:47 +0200 | [diff] [blame] | 271 | //usage: |
| 272 | //usage:#define ipneigh_trivial_usage |
Denys Vlasenko | f3d705f | 2017-01-21 03:46:35 +0100 | [diff] [blame] | 273 | //usage: "show|flush [to PREFIX] [dev DEV] [nud STATE]" |
Denys Vlasenko | 1238988 | 2017-01-21 14:27:07 +0100 | [diff] [blame] | 274 | //usage:#define ipneigh_full_usage "" |
| 275 | //usage: |
| 276 | //usage:#if ENABLE_FEATURE_IP_ADDRESS || ENABLE_FEATURE_IP_ROUTE |
| 277 | //usage:# define IP_BAR_LINK "|" |
| 278 | //usage:#else |
| 279 | //usage:# define IP_BAR_LINK "" |
| 280 | //usage:#endif |
| 281 | //usage:#if ENABLE_FEATURE_IP_ADDRESS || ENABLE_FEATURE_IP_ROUTE || ENABLE_FEATURE_IP_LINK |
| 282 | //usage:# define IP_BAR_TUNNEL "|" |
| 283 | //usage:#else |
| 284 | //usage:# define IP_BAR_TUNNEL "" |
| 285 | //usage:#endif |
| 286 | //usage:#if ENABLE_FEATURE_IP_ADDRESS || ENABLE_FEATURE_IP_ROUTE || ENABLE_FEATURE_IP_LINK || ENABLE_FEATURE_IP_TUNNEL |
| 287 | //usage:# define IP_BAR_NEIGH "|" |
| 288 | //usage:#else |
| 289 | //usage:# define IP_BAR_NEIGH "" |
| 290 | //usage:#endif |
| 291 | //usage:#if ENABLE_FEATURE_IP_ADDRESS || ENABLE_FEATURE_IP_ROUTE || ENABLE_FEATURE_IP_LINK || ENABLE_FEATURE_IP_TUNNEL || ENABLE_FEATURE_IP_NEIGH |
| 292 | //usage:# define IP_BAR_RULE "|" |
| 293 | //usage:#else |
| 294 | //usage:# define IP_BAR_RULE "" |
| 295 | //usage:#endif |
| 296 | //usage: |
| 297 | //usage:#define ip_trivial_usage |
| 298 | //usage: "[OPTIONS] " |
| 299 | //usage: IF_FEATURE_IP_ADDRESS("address") |
| 300 | //usage: IF_FEATURE_IP_ROUTE( IF_FEATURE_IP_ADDRESS("|")"route") |
| 301 | //usage: IF_FEATURE_IP_LINK( IP_BAR_LINK "link") |
| 302 | //usage: IF_FEATURE_IP_TUNNEL( IP_BAR_TUNNEL"tunnel") |
| 303 | //usage: IF_FEATURE_IP_NEIGH( IP_BAR_NEIGH "neigh") |
| 304 | //usage: IF_FEATURE_IP_RULE( IP_BAR_RULE "rule") |
Denys Vlasenko | 3759516 | 2018-08-14 11:19:09 +0200 | [diff] [blame] | 305 | //usage: " [ARGS]" |
Denys Vlasenko | 1238988 | 2017-01-21 14:27:07 +0100 | [diff] [blame] | 306 | //usage:#define ip_full_usage "\n\n" |
| 307 | //usage: "OPTIONS := -f[amily] inet|inet6|link | -o[neline]\n" |
Denys Vlasenko | 1238988 | 2017-01-21 14:27:07 +0100 | [diff] [blame] | 308 | //usage: IF_FEATURE_IP_ADDRESS("\n" |
| 309 | //usage: "ip addr "ipaddr_trivial_usage) |
| 310 | //usage: IF_FEATURE_IP_ROUTE("\n" |
| 311 | //usage: "ip route "iproute_trivial_usage) |
| 312 | //usage: IF_FEATURE_IP_LINK("\n" |
| 313 | //usage: "ip link "iplink_trivial_usage) |
| 314 | //usage: IF_FEATURE_IP_TUNNEL("\n" |
| 315 | //usage: "ip tunnel "iptunnel_trivial_usage) |
| 316 | //usage: IF_FEATURE_IP_NEIGH("\n" |
| 317 | //usage: "ip neigh "ipneigh_trivial_usage) |
| 318 | //usage: IF_FEATURE_IP_RULE("\n" |
| 319 | //usage: "ip rule "iprule_trivial_usage) |
Pere Orga | 5bc8c00 | 2011-04-11 03:29:49 +0200 | [diff] [blame] | 320 | |
Denis Vlasenko | b6adbf1 | 2007-05-26 19:00:18 +0000 | [diff] [blame] | 321 | #include "libbb.h" |
Glenn L McGrath | 9a2d272 | 2002-11-10 01:33:55 +0000 | [diff] [blame] | 322 | |
Bernhard Reutner-Fischer | ab18782 | 2005-10-26 10:47:26 +0000 | [diff] [blame] | 323 | #include "libiproute/utils.h" |
| 324 | #include "libiproute/ip_common.h" |
Glenn L McGrath | 9a2d272 | 2002-11-10 01:33:55 +0000 | [diff] [blame] | 325 | |
Denys Vlasenko | 2e9b551 | 2010-07-24 23:27:38 +0200 | [diff] [blame] | 326 | typedef int FAST_FUNC (*ip_func_ptr_t)(char**); |
Denys Vlasenko | e0a6220 | 2010-07-24 23:26:58 +0200 | [diff] [blame] | 327 | |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 328 | #if ENABLE_IPADDR \ |
| 329 | || ENABLE_IPLINK \ |
| 330 | || ENABLE_IPROUTE \ |
| 331 | || ENABLE_IPRULE \ |
| 332 | || ENABLE_IPTUNNEL \ |
| 333 | || ENABLE_IPNEIGH |
Denys Vlasenko | e0a6220 | 2010-07-24 23:26:58 +0200 | [diff] [blame] | 334 | static int ip_do(ip_func_ptr_t ip_func, char **argv) |
Bernhard Reutner-Fischer | 07c394e | 2007-04-10 20:11:12 +0000 | [diff] [blame] | 335 | { |
Denis Vlasenko | 3246c0d | 2008-12-04 12:15:19 +0000 | [diff] [blame] | 336 | argv = ip_parse_common_args(argv + 1); |
Denis Vlasenko | ed6a49c | 2007-11-18 22:56:25 +0000 | [diff] [blame] | 337 | return ip_func(argv); |
Bernhard Reutner-Fischer | 07c394e | 2007-04-10 20:11:12 +0000 | [diff] [blame] | 338 | } |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 339 | #endif |
Bernhard Reutner-Fischer | 07c394e | 2007-04-10 20:11:12 +0000 | [diff] [blame] | 340 | |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 341 | #if ENABLE_IPADDR |
Denis Vlasenko | 9b49a5e | 2007-10-11 10:05:36 +0000 | [diff] [blame] | 342 | int ipaddr_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
Denis Vlasenko | a60f84e | 2008-07-05 09:18:54 +0000 | [diff] [blame] | 343 | int ipaddr_main(int argc UNUSED_PARAM, char **argv) |
Bernhard Reutner-Fischer | 07c394e | 2007-04-10 20:11:12 +0000 | [diff] [blame] | 344 | { |
Denis Vlasenko | 2570b2e | 2008-03-28 01:00:09 +0000 | [diff] [blame] | 345 | return ip_do(do_ipaddr, argv); |
Bernhard Reutner-Fischer | 07c394e | 2007-04-10 20:11:12 +0000 | [diff] [blame] | 346 | } |
| 347 | #endif |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 348 | #if ENABLE_IPLINK |
Denis Vlasenko | 9b49a5e | 2007-10-11 10:05:36 +0000 | [diff] [blame] | 349 | int iplink_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
Denis Vlasenko | a60f84e | 2008-07-05 09:18:54 +0000 | [diff] [blame] | 350 | int iplink_main(int argc UNUSED_PARAM, char **argv) |
Bernhard Reutner-Fischer | 07c394e | 2007-04-10 20:11:12 +0000 | [diff] [blame] | 351 | { |
Denis Vlasenko | 2570b2e | 2008-03-28 01:00:09 +0000 | [diff] [blame] | 352 | return ip_do(do_iplink, argv); |
Bernhard Reutner-Fischer | 07c394e | 2007-04-10 20:11:12 +0000 | [diff] [blame] | 353 | } |
| 354 | #endif |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 355 | #if ENABLE_IPROUTE |
Denis Vlasenko | 9b49a5e | 2007-10-11 10:05:36 +0000 | [diff] [blame] | 356 | int iproute_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
Denis Vlasenko | a60f84e | 2008-07-05 09:18:54 +0000 | [diff] [blame] | 357 | int iproute_main(int argc UNUSED_PARAM, char **argv) |
Bernhard Reutner-Fischer | 07c394e | 2007-04-10 20:11:12 +0000 | [diff] [blame] | 358 | { |
Denis Vlasenko | 2570b2e | 2008-03-28 01:00:09 +0000 | [diff] [blame] | 359 | return ip_do(do_iproute, argv); |
Bernhard Reutner-Fischer | 07c394e | 2007-04-10 20:11:12 +0000 | [diff] [blame] | 360 | } |
| 361 | #endif |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 362 | #if ENABLE_IPRULE |
Denis Vlasenko | 9b49a5e | 2007-10-11 10:05:36 +0000 | [diff] [blame] | 363 | int iprule_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
Denis Vlasenko | a60f84e | 2008-07-05 09:18:54 +0000 | [diff] [blame] | 364 | int iprule_main(int argc UNUSED_PARAM, char **argv) |
Bernhard Reutner-Fischer | 07c394e | 2007-04-10 20:11:12 +0000 | [diff] [blame] | 365 | { |
Denis Vlasenko | 2570b2e | 2008-03-28 01:00:09 +0000 | [diff] [blame] | 366 | return ip_do(do_iprule, argv); |
Bernhard Reutner-Fischer | 07c394e | 2007-04-10 20:11:12 +0000 | [diff] [blame] | 367 | } |
| 368 | #endif |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 369 | #if ENABLE_IPTUNNEL |
Denis Vlasenko | 9b49a5e | 2007-10-11 10:05:36 +0000 | [diff] [blame] | 370 | int iptunnel_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
Denis Vlasenko | a60f84e | 2008-07-05 09:18:54 +0000 | [diff] [blame] | 371 | int iptunnel_main(int argc UNUSED_PARAM, char **argv) |
Bernhard Reutner-Fischer | 07c394e | 2007-04-10 20:11:12 +0000 | [diff] [blame] | 372 | { |
Denis Vlasenko | 2570b2e | 2008-03-28 01:00:09 +0000 | [diff] [blame] | 373 | return ip_do(do_iptunnel, argv); |
Bernhard Reutner-Fischer | 07c394e | 2007-04-10 20:11:12 +0000 | [diff] [blame] | 374 | } |
| 375 | #endif |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 376 | #if ENABLE_IPNEIGH |
Curt Brune | 6993470 | 2015-10-14 12:53:47 +0200 | [diff] [blame] | 377 | int ipneigh_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
| 378 | int ipneigh_main(int argc UNUSED_PARAM, char **argv) |
| 379 | { |
| 380 | return ip_do(do_ipneigh, argv); |
| 381 | } |
| 382 | #endif |
Bernhard Reutner-Fischer | 07c394e | 2007-04-10 20:11:12 +0000 | [diff] [blame] | 383 | |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 384 | #if ENABLE_IP |
| 385 | static int FAST_FUNC ip_print_help(char **argv UNUSED_PARAM) |
| 386 | { |
| 387 | bb_show_usage(); |
| 388 | } |
Bernhard Reutner-Fischer | 07c394e | 2007-04-10 20:11:12 +0000 | [diff] [blame] | 389 | |
Denis Vlasenko | 9b49a5e | 2007-10-11 10:05:36 +0000 | [diff] [blame] | 390 | int ip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
Denis Vlasenko | a60f84e | 2008-07-05 09:18:54 +0000 | [diff] [blame] | 391 | int ip_main(int argc UNUSED_PARAM, char **argv) |
Glenn L McGrath | f112daa | 2002-12-01 23:04:06 +0000 | [diff] [blame] | 392 | { |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 393 | static const char keywords[] ALIGN1 = "" |
Denis Vlasenko | 5e34ff2 | 2009-04-21 11:09:40 +0000 | [diff] [blame] | 394 | IF_FEATURE_IP_ADDRESS("address\0") |
| 395 | IF_FEATURE_IP_ROUTE("route\0") |
Denys Vlasenko | e0a6220 | 2010-07-24 23:26:58 +0200 | [diff] [blame] | 396 | IF_FEATURE_IP_ROUTE("r\0") |
Denis Vlasenko | 5e34ff2 | 2009-04-21 11:09:40 +0000 | [diff] [blame] | 397 | IF_FEATURE_IP_LINK("link\0") |
Denys Vlasenko | e0a6220 | 2010-07-24 23:26:58 +0200 | [diff] [blame] | 398 | IF_FEATURE_IP_TUNNEL("tunnel\0") |
| 399 | IF_FEATURE_IP_TUNNEL("tunl\0") |
Denis Vlasenko | 5e34ff2 | 2009-04-21 11:09:40 +0000 | [diff] [blame] | 400 | IF_FEATURE_IP_RULE("rule\0") |
Curt Brune | 6993470 | 2015-10-14 12:53:47 +0200 | [diff] [blame] | 401 | IF_FEATURE_IP_NEIGH("neigh\0") |
Denis Vlasenko | 990d0f6 | 2007-07-24 15:54:42 +0000 | [diff] [blame] | 402 | ; |
Denys Vlasenko | 965b795 | 2020-11-30 13:03:03 +0100 | [diff] [blame] | 403 | static const ip_func_ptr_t ip_func_ptrs[] ALIGN_PTR = { |
Denys Vlasenko | e0a6220 | 2010-07-24 23:26:58 +0200 | [diff] [blame] | 404 | ip_print_help, |
| 405 | IF_FEATURE_IP_ADDRESS(do_ipaddr,) |
| 406 | IF_FEATURE_IP_ROUTE(do_iproute,) |
| 407 | IF_FEATURE_IP_ROUTE(do_iproute,) |
| 408 | IF_FEATURE_IP_LINK(do_iplink,) |
| 409 | IF_FEATURE_IP_TUNNEL(do_iptunnel,) |
| 410 | IF_FEATURE_IP_TUNNEL(do_iptunnel,) |
| 411 | IF_FEATURE_IP_RULE(do_iprule,) |
Curt Brune | 6993470 | 2015-10-14 12:53:47 +0200 | [diff] [blame] | 412 | IF_FEATURE_IP_NEIGH(do_ipneigh,) |
Bernhard Reutner-Fischer | e87d795 | 2007-04-10 18:43:27 +0000 | [diff] [blame] | 413 | }; |
Denys Vlasenko | e0a6220 | 2010-07-24 23:26:58 +0200 | [diff] [blame] | 414 | ip_func_ptr_t ip_func; |
| 415 | int key; |
Bernhard Reutner-Fischer | e87d795 | 2007-04-10 18:43:27 +0000 | [diff] [blame] | 416 | |
Denis Vlasenko | ed6a49c | 2007-11-18 22:56:25 +0000 | [diff] [blame] | 417 | argv = ip_parse_common_args(argv + 1); |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 418 | if (ARRAY_SIZE(ip_func_ptrs) > 1 && *argv) |
| 419 | key = index_in_substrings(keywords, *argv++); |
| 420 | else |
| 421 | key = -1; |
Denys Vlasenko | e0a6220 | 2010-07-24 23:26:58 +0200 | [diff] [blame] | 422 | ip_func = ip_func_ptrs[key + 1]; |
| 423 | |
Denis Vlasenko | ed6a49c | 2007-11-18 22:56:25 +0000 | [diff] [blame] | 424 | return ip_func(argv); |
Glenn L McGrath | 9a2d272 | 2002-11-10 01:33:55 +0000 | [diff] [blame] | 425 | } |
Denys Vlasenko | 7c5dea3 | 2016-12-22 22:30:13 +0100 | [diff] [blame] | 426 | #endif |