Commit Graph

49 Commits

Author SHA1 Message Date
Denys Vlasenko
7121bb8023 ipaddress: tweak help text more: mention "brd +" syntax
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-07 18:22:41 +02:00
Denys Vlasenko
4eaa0f7729 ipaddress: tweak help text
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-07 18:14:46 +02:00
Denys Vlasenko
d5342a1ad1 iproute: support advmss option
function                                             old     new   delta
iproute_modify                                      1164    1221     +57
str_is_lock                                            -      22     +22
packed_usage                                       31372   31382     +10
do_iproute                                           157     132     -25
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/1 up/down: 89/-25)             Total: 64 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-07 17:00:53 +02:00
Denys Vlasenko
1140bf39ab iproute: update help text, add commented-out code for unsupported options
function                                             old     new   delta
packed_usage                                       31327   31372     +45
do_iproute                                           132     157     +25
iproute_modify                                      1162    1164      +2
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/0 up/down: 72/0)               Total: 72 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-06 17:54:38 +02:00
Denys Vlasenko
2d4823b65b iplink: implement "set promisc on|off". Closes 4682
function                                             old     new   delta
do_iplink                                           1232    1269     +37
packed_usage                                       31337   31327     -10

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-06 16:06:04 +02:00
Denys Vlasenko
a7386bb35b ip link: tidying up
Misplaced comment. --help was wrong: dynamic on|off is not supported.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-06 15:55:29 +02:00
Denys Vlasenko
12389889c0 ip: better --help
Was:
    Usage: ip [OPTIONS] address|route|link|tunnel|neigh|rule [COMMAND]

    ip [OPTIONS] OBJECT [COMMAND]
    where OBJECT := address|route|link|tunnel|neigh|rule
    OPTIONS := -f[amily] inet|inet6|link | -o[neline]

User: instead of repeating list of OBJECTs twice, you could at least
show available COMMANDs...

Now:
    Usage: ip [OPTIONS] address|route|link|tunnel|neigh|rule [COMMAND]

    OPTIONS := -f[amily] inet|inet6|link | -o[neline]
    COMMAND :=
    ip addr add|del IFADDR dev IFACE | show|flush [dev IFACE] [to PREFIX]
    ip route list|flush|add|del|change|append|replace|test ROUTE
    ip link set IFACE [up|down] [arp on|off] | show [IFACE]
    ip tunnel add|change|del|show [NAME]
        [mode ipip|gre|sit]
        [remote ADDR] [local ADDR] [ttl TTL]
    ip neigh show|flush [to PREFIX] [dev DEV] [nud STATE]
    ip rule [list] | add|del SELECTOR ACTION

While at it, tweak tc --help too (it stays disabled, thus no effect)

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-21 14:27:07 +01:00
Denys Vlasenko
8908c1d4f5 more ip --help fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-21 03:56:46 +01:00
Denys Vlasenko
f3d705f41b make --help texts smaller
function                                             old     new   delta
packed_usage                                       31035   30968     -67

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-21 03:46:57 +01:00
Denys Vlasenko
7c5dea399b ip: make ip aliases individually selectable
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-12-22 22:30:13 +01:00
Denys Vlasenko
6bfab0c49f ipneigh: add this shortcur similar to other "ip <CMD>" shortcuts
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-11-23 09:18:05 +01:00
Denys Vlasenko
47367e1d50 Convert all networking/* applets to "new style" applet definitions
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-11-23 09:05:14 +01:00
Curt Brune
69934701fd networking: add 'ip neigh' command
This patch ports the 'ip neigh' command, originally written by Alexey
Kuznetsov, <kuznet@ms2.inr.ac.ru>, to busybox.

The base of the port is the version of iproute that shipped with
Debian Squeeze, taken from:

  http://http.debian.net/debian/pool/main/i/iproute/iproute_20100519.orig.tar.gz

This patch has actively been used by the Open Network Install
Environment (ONIE) project for over 3 years without incident.

function                                             old     new   delta
print_neigh                                            -     933    +933
ipneigh_list_or_flush                                  -     742    +742
get_hz                                                 -     109    +109
do_ipneigh                                             -      62     +62
do_iproute                                          2112    2153     +41
packed_usage                                       30647   30667     +20
ipneigh_main                                           -      14     +14
static.ip_neigh_commands                               -      12     +12
static.nuds                                            -       9      +9
static.ip_func_ptrs                                   32      36      +4
print_route                                         1858    1727    -131
------------------------------------------------------------------------------
(add/remove: 8/0 grow/shrink: 3/1 up/down: 1946/-131)        Total: 1815 bytes

Signed-off-by: Curt Brune <curt@cumulusnetworks.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-10-14 12:53:47 +02:00
Michael Tokarev
6a7cd3d4ab ip addr: support change and replace commands
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-07-01 18:26:41 +02:00
Denys Vlasenko
53782d9221 iproute: fix help text
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-12-06 18:59:55 +01:00
Denys Vlasenko
66426760be *: remove "Options:" string from help texts
function                                             old     new   delta
packed_usage                                       28706   28623     -83

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-05 03:58:28 +02:00
Pere Orga
5bc8c005a8 move remaining help text from include/usage.src.h
Signed-off-by: Pere Orga <gotrunks@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-11 03:29:49 +02:00
Denys Vlasenko
fb132e4737 whitespace cleanup
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-29 11:46:52 +02:00
Denys Vlasenko
0ef64bdb40 *: make GNU licensing statement forms more regular
This change retains "or later" state! No licensing _changes_ here,
only form is adjusted (article, space between "GPL" and "v2" and so on).

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-16 20:14:46 +02:00
Denys Vlasenko
2e9b5510d6 libiproute: code shrink by adding FAST_FUNC
function                                             old     new   delta
ipaddr_list_or_flush                                1282    1293     +11
ip_parse_common_args                                 153     151      -2
ip_main                                               53      50      -3
ip_do                                                 19      15      -4
do_iptunnel                                          985     980      -5
do_iprule                                            982     977      -5
do_iplink                                           1637    1631      -6
do_iproute                                          2105    2098      -7
do_ipaddr                                           1406    1398      -8
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/8 up/down: 11/-40)            Total: -29 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-24 23:27:38 +02:00
Denys Vlasenko
e0a622093c ip: fix "ip r" breakage
function                                             old     new   delta
static.ip_func_ptrs                                    -      32     +32
ip_main                                              110      53     -57
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/1 up/down: 32/-57)            Total: -25 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-24 23:26:58 +02:00
Denis Vlasenko
5e34ff29bc *: mass renaming of USE_XXXX to IF_XXXX
and SKIP_XXXX to IF_NOT_XXXX - the second one was especially
badly named. It was not skipping anything!
2009-04-21 11:09:40 +00:00
Denis Vlasenko
3246c0de12 iproute: fix ipXXX utilities trying to parse their applet name
as their 1st parameter.
2008-12-04 12:15:19 +00:00
Bernhard Reutner-Fischer
6c4dadefb6 - update my name. No obj-code changes ;) 2008-09-25 12:13:34 +00:00
Denis Vlasenko
a60f84ebf0 *: rename ATTRIBUTE_XXX to just XXX. 2008-07-05 09:18:54 +00:00
Denis Vlasenko
2570b2e575 whitespace fixes 2008-03-28 01:00:09 +00:00
Denis Vlasenko
68404f13d4 *: add -Wunused-parameter; fix resulting breakage
function                                             old     new   delta
procps_scan                                         1265    1298     +33
aliascmd                                             278     283      +5
parse_file_cmd                                       116     120      +4
dname_enc                                            373     377      +4
setcmd                                                90      93      +3
execcmd                                               57      60      +3
count_lines                                           72      74      +2
process_command_subs                                 340     339      -1
test_main                                            409     407      -2
mknod_main                                           179     177      -2
handle_incoming_and_exit                            2653    2651      -2
argstr                                              1312    1310      -2
shiftcmd                                             131     128      -3
exitcmd                                               46      43      -3
dotcmd                                               297     294      -3
breakcmd                                              86      83      -3
evalpipe                                             353     349      -4
evalcommand                                         1180    1176      -4
evalcmd                                              109     105      -4
send_tree                                            374     369      -5
mkfifo_main                                           82      77      -5
evalsubshell                                         152     147      -5
typecmd                                               75      69      -6
letcmd                                                61      55      -6
add_cmd                                             1190    1183      -7
main                                                 891     883      -8
ash_main                                            1415    1407      -8
parse_stream                                        1377    1367     -10
alloc_procps_scan                                     55       -     -55
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 7/21 up/down: 54/-148)          Total: -94 bytes
   text    data     bss     dec     hex filename
 797195     658    7428  805281   c49a1 busybox_old
 797101     658    7428  805187   c4943 busybox_unstripped
2008-03-17 09:00:54 +00:00
Denis Vlasenko
e3cbfb91d2 vi: introduce FEATURE_VI_8BIT (as vi currently is not Unicode capable,
people may want to disable display of high-bit chars)
ip: build fixlet
2007-12-22 17:00:11 +00:00
Denis Vlasenko
ed6a49c657 ip: stop propagating argc; optimize ip_parse_common_args
function                                             old     new   delta
find_pair                                            167     187     +20
static.families                                        -      17     +17
die_must_be_on_off                                     -      11     +11
...
on_off                                                33      22     -11
do_ipaddr                                            103      90     -13
do_iptunnel                                         1001     986     -15
iproute_list_or_flush                               1237    1217     -20
static.ip_common_commands                             43      22     -21
do_iproute                                          2217    2193     -24
parse_args                                          1444    1414     -30
ip_do                                                 47      16     -31
do_iprule                                            994     963     -31
ip_main                                              153     113     -40
ipaddr_modify                                       1357    1305     -52
ipaddr_list_or_flush                                2543    2490     -53
ip_parse_common_args                                 294     159    -135
------------------------------------------------------------------------------
(add/remove: 4/1 grow/shrink: 4/24 up/down: 85/-563)         Total: -478 bytes
   text    data     bss     dec     hex filename
 775561     966    9236  785763   bfd63 busybox_old
 775073     962    9236  785271   bfb77 busybox_unstripped
2007-11-18 22:56:25 +00:00
Denis Vlasenko
9b49a5ed85 add -fvisibility=hidden to CC flags, mark XXX_main functions
EXTERNALLY_VISIBLE. 5% size reduction of libbusybox.so
2007-10-11 10:05:36 +00:00
Denis Vlasenko
6ca409e0e4 trylink: produce even more info about final link stage
trylink: explain how to modify link and drastically decrease amount
  of padding (unfortunately, needs hand editing ATM).
*: add ALIGN1 / ALIGN2 to global strings and arrays of bytes and shorts

size saving: 0.5k
2007-08-12 20:58:27 +00:00
Denis Vlasenko
990d0f63ee Replace index_in_[sub]str_array with index_in_[sub]strings,
which scans thru "abc\0def\0123\0\0" type strings. Saves 250 bytes.

   text    data     bss     dec     hex filename
 781266    1328   11844  794438   c1f46 busybox_old
 781010    1328   11844  794182   c1e46 busybox_unstripped
2007-07-24 15:54:42 +00:00
Denis Vlasenko
b6adbf1be2 usage.c: remove reference to busybox.h
*: s/include "busybox.h"/include "libbb.h"
2007-05-26 19:00:18 +00:00
Denis Vlasenko
d46e6d1a55 fix trivial compile errors found by randomconfig run 2007-05-17 12:58:30 +00:00
Bernhard Reutner-Fischer
07c394e69b - mv ip*_main into ip.c; use a dispatcher to save on needless duplication.
Saves a minor 12b.
2007-04-10 20:11:12 +00:00
Bernhard Reutner-Fischer
e87d7955f8 - rewrite the ip applet to be less bloaty
- mark libiproute's matches() as deprecated. Convert to index_in_(sub)str_array()!
   text    data     bss     dec     hex filename
    314       0       0     314     13a ip.o.orig
    200       0       0     200      c8 ip.o
Using a smallint for the key would save another byte.
2007-04-10 18:43:27 +00:00
Denis Vlasenko
540a2a1f3b libiproute: audit callgraph, shortcut error paths into die() functions.
Kill a few statics, made other globals smaller:
oneline is smallint, _SL_ is char

function                                             old     new   delta
print_tunnel                                         693     731     +38
print_route                                         1775    1777      +2
print_addrinfo                                      1495    1497      +2
ipaddr_list_or_flush                                2826    2828      +2
oneline                                                4       1      -3
_SL_                                                   4       1      -3
ipaddr_modify                                       1476    1472      -4
parse_address                                        124     119      -5
ip_parse_common_args                                 429     423      -6
on_off                                                53      46      -7
do_del_ioctl                                         113     106      -7
do_add_ioctl                                         120     113      -7
do_show                                              864     856      -8
iprule_list                                          157     148      -9
do_iptunnel                                          310     299     -11
do_add                                               143     126     -17
get_ctl_fd                                            95      76     -19
set_address                                          108      84     -24
ip_main                                              351     323     -28
static.ifr                                            32       -     -32
parse_args                                          1992    1949     -43
iproute_list_or_flush                               1673    1582     -91
do_iplink                                           1583    1485     -98
filter                                               280       -    -280
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 4/18 up/down: 44/-702)         Total: -658 bytes
2007-04-07 01:14:45 +00:00
Denis Vlasenko
06af216528 suppress warnings about easch <applet>_main() having
no preceding prototype
2007-02-03 17:28:39 +00:00
Denis Vlasenko
fd94efa41f fix numbering in switch(): we don't have "del" anymore,
substring match on "delete" handles it ok. But we (I?)
forgot to renumber case labels...
2007-01-27 13:13:45 +00:00
Bernhard Reutner-Fischer
921f5df25f - add 'ip rule' support. First take..
text    data     bss     dec     hex filename
   2999       0       0    2999     bb7 networking/libiproute/iprule.o
2006-11-21 15:36:08 +00:00
Denis Vlasenko
5af906e7c8 rename: compare_string_array -> index_in_str_array
introduce index_in_substr_array and use it in
iproute2
2006-11-05 18:05:09 +00:00
"Robert P. J. Day"
63fc1a9e08 Standardize on the vi editing directives being on the first line. 2006-07-02 19:47:05 +00:00
"Robert P. J. Day"
d35ef0f666 More removal of "#if 0" content. 2006-07-01 14:59:54 +00:00
Bernhard Reutner-Fischer
19008b8373 - reuse strings and messages. Saves about 600B 2006-06-07 20:17:41 +00:00
Bernhard Reutner-Fischer
ab1878245c * uniq.c: remove unneeded include and use short boilerplate.
* coreutils.h: remove prototype of non-existing xgetoptfile_sort_uniq
	and add boilerplate.
	* networking/{ipaddr,ip,iplink,iproute,iptunnel}.c: touch includes
	and use short boilerplate.
	* libiproute/iproute.c: rename round to avoid clashes with older
	SuSE gcc and use short boilerplate.
2005-10-26 10:47:26 +00:00
Glenn L McGrath
19efb3dc59 Fix compile error if CONFIG_FEATURE_IP_ADDR isnt enabled 2004-04-12 02:35:44 +00:00
Manuel Novoa III
cad5364599 Major coreutils update. 2003-03-19 09:13:01 +00:00
Glenn L McGrath
f112daa232 Enable ip commands to be compiled seperate from ip, modifed patch from Bastian Blank 2002-12-01 23:04:06 +00:00
Glenn L McGrath
9a2d27249c IP applet by Bastian Blank <waldi@debian.org> 2002-11-10 01:33:55 +00:00