Commit Graph

20 Commits

Author SHA1 Message Date
Christoph J. Thompson
d1eea8db92 iproute: don't hardcode the path to config files
Allows using an alternate path for config files.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Christoph J. Thompson <cjsthompson@gmail.com>
Signed-off-by: Michael Bestas <mikeioannina@gmail.com>
2015-10-08 17:06:06 +02:00
Denys Vlasenko
413feca279 ip: increased max ID for /etc/iproute2/rt_tables to 1023
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-10-08 15:10:10 +02:00
Denys Vlasenko
3d8d5e8ad4 libiproute: use itoa() where appropriate
function                                             old     new   delta
rtnl_rtprot_a2n                                       31      88     +57
print_tunnel                                         647     640      -7
print_route                                         1865    1858      -7
print_linkinfo                                       820     812      -8
print_addrinfo                                      1241    1227     -14
rtnl_rttable_n2a                                      53      38     -15
rtnl_rtscope_n2a                                      53      38     -15
rtnl_rtrealm_n2a                                      53      38     -15
rtnl_dsfield_n2a                                      61      38     -23
rtnl_rtntype_n2a                                     118      89     -29
print_rule                                           724     689     -35
ipaddr_list_or_flush                                1293    1253     -40
rtnl_rtprot_n2a                                       53       -     -53
rtnl_rtprot_initialize                                63       -     -63
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 1/11 up/down: 57/-324)         Total: -267 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-10-08 13:02:28 +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
d31575a3ae libiproute/*: code shrink
function                                             old     new   delta
ll_addr_a2n                                          181     178      -3
rtnl_rtntype_a2n                                     198     194      -4
ipaddr_modify                                       1309    1305      -4
print_addrinfo                                      1303    1298      -5
do_iplink                                           1137    1132      -5
print_route                                         1609    1603      -6
parse_args                                          1440    1434      -6
iproute_list_or_flush                               1261    1254      -7
rtnl_rttable_a2n                                      39      31      -8
rtnl_rtscope_a2n                                      39      31      -8
rtnl_rtrealm_a2n                                      39      31      -8
rtnl_rtprot_a2n                                       39      31      -8
rtnl_dsfield_a2n                                      39      31      -8
ll_type_n2a                                           78      70      -8
get_rt_realms                                        115     107      -8
print_tunnel                                         656     647      -9
rtnl_rttable_n2a                                      63      53     -10
rtnl_rtscope_n2a                                      63      53     -10
rtnl_rtrealm_n2a                                      63      53     -10
rtnl_rtntype_n2a                                     128     118     -10
rtnl_dsfield_n2a                                      71      61     -10
print_linkinfo                                       815     805     -10
ipaddr_list_or_flush                                1246    1235     -11
iproute_modify                                      1048    1036     -12
iprule_modify                                        866     851     -15
print_rule                                           765     738     -27
ll_addr_n2a                                          182     150     -32
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/27 up/down: 0/-262)          Total: -262 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-13 17:58:24 +02:00
Denys Vlasenko
94466b8b8c libiproute: code and data shrink
function                                             old     new   delta
rtnl_a2n                                               -     126    +126
ll_remember_index                                    233     263     +30
find_by_index                                         26      36     +10
rtnl_rtprot_initialize                                66      70      +4
static.unit_chars                                      7       9      +2
rtnl_rttable_initialize                               73      75      +2
rtnl_rtscope_initialize                               83      85      +2
rtnl_rtrealm_initialize                               43      45      +2
rtnl_rtdsfield_initialize                             43      45      +2
rtnl_rttable_n2a                                      62      63      +1
rtnl_rtscope_n2a                                      62      63      +1
rtnl_rtrealm_n2a                                      62      63      +1
rtnl_dsfield_n2a                                      70      71      +1
ll_init_map                                           36      33      -3
make_human_readable_str                              262     258      -4
static.fmt                                            97      92      -5
static.fmt_tenths                                     10       -     -10
static.str                                            21       4     -17
static.res                                            20       -     -20
static.cache                                          24       4     -20
idxmap                                                64       4     -60
rtnl_rttable_a2n                                     154      39    -115
rtnl_rtscope_a2n                                     159      39    -120
rtnl_rtrealm_a2n                                     159      39    -120
rtnl_rtprot_a2n                                      159      39    -120
rtnl_dsfield_a2n                                     162      39    -123
------------------------------------------------------------------------------
(add/remove: 1/2 grow/shrink: 12/11 up/down: 184/-737)       Total: -553 bytes
   text           data            bss            dec            hex        filename
 820376            445           7668         828489          ca449        busybox_old
 819950            445           7548         827943          ca227        busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-13 16:27:11 +02:00
Denis Vlasenko
084266ed52 fix several problems with config parser:
a bug where it underflows the string
 a bug where it never frees parser_t struct
make read_config() return 0 if parser is NULL,
 make config_close() accept and ignore NULL parser -
 eliminates many if() blocks
reverse the sense of parser bit flags - negative flags
 are harder to grok.
hexdump: revert the change to use config parser, it is BIGGER
 and also requires additional quirks in parser
*: explicitly use PARSER_NORMAL instead of 0

function                                             old     new   delta
login_main                                          1575    1596     +21
config_close                                          18      29     +11
bbunpack                                             383     391      +8
qgravechar                                           106     109      +3
rtnl_tab_initialize                                  121     117      -4
expand                                              1697    1693      -4
man_main                                             717     712      -5
nameif_main                                          674     668      -6
hexdump_main                                         597     591      -6
read_config                                          217     209      -8
dnsd_main                                           1478    1470      -8
sysctl_main                                          203     189     -14
config_open2                                          44      25     -19
make_device                                         1177    1141     -36
config_read                                          597     549     -48
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/11 up/down: 43/-158)         Total: -115 bytes
2008-07-26 23:08:31 +00:00
Denis Vlasenko
0f99d49ae6 *: conversion to config parser
function                                             old     new   delta
config_read                                          540     597     +57
config_open2                                          41      44      +3
rtnl_rtprot_initialize                                70      66      -4
rtnl_rttable_initialize                               78      73      -5
rtnl_rtscope_initialize                               88      83      -5
rtnl_rtrealm_initialize                               48      43      -5
rtnl_rtdsfield_initialize                             48      43      -5
process_module                                       566     560      -6
bbunpack                                             391     383      -8
rtnl_tab_initialize                                  279     121    -158
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/8 up/down: 60/-196)          Total: -136 bytes
2008-07-24 23:38:04 +00:00
Denis Vlasenko
5415c856ea libbb: [x]fopen_for_{read,write} introduced and used.
(by Valdimir)

function                                             old     new   delta
config_open2                                           -      41     +41
config_read                                          507     542     +35
find_pair                                            169     187     +18
fopen_for_write                                        -      14     +14
fopen_for_read                                         -      14     +14
find_main                                            406     418     +12
xfopen_for_write                                       -      10     +10
xfopen_for_read                                        -      10     +10
popstring                                            134     140      +6
parse_inittab                                        396     401      +5
next_token                                           923     928      +5
pack_gzip                                           1659    1661      +2
bb__parsespent                                       117     119      +2
fallbackSort                                        1719    1717      -2
evalvar                                             1376    1374      -2
qrealloc                                              36      33      -3
...
...
...
...
singlemount                                         4579    4569     -10
process_stdin                                        443     433     -10
patch_main                                          1111    1101     -10
ifupdown_main                                       2175    2165     -10
file_action_grep                                      90      80     -10
uuidcache_init                                       649     637     -12
hush_main                                            797     785     -12
read_config                                          230     217     -13
dpkg_main                                           3835    3820     -15
read_line_input                                     3134    3110     -24
sysctl_main                                          232     203     -29
config_open                                           40      10     -30
WARN_BAD_LINE                                         44       -     -44
login_main                                          1714    1575    -139
------------------------------------------------------------------------------
(add/remove: 5/1 grow/shrink: 8/74 up/down: 174/-737)        Total: -563 bytes
2008-07-21 23:05:26 +00:00
Denis Vlasenko
ab2aea4447 preparatory patch for -Wwrite-strings #4 2007-01-29 22:51:58 +00:00
Denis Vlasenko
e27f15615f msh: double "static char line[LINELIM]" etc deleted.
massive amounts of assignments-in-ifs deleted
(some of which were VERY nasty)
2007-01-01 06:00:38 +00:00
Denis Vlasenko
d1a302b52f rt_names: stop allocating 5k in rwdata
objsizes: don't show build machinery's object modules
2006-12-31 20:40:20 +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
981b24db5e rt_names.c: move few strings into rodata 2006-09-28 22:36:23 +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
Eric Andersen
cbd1c85744 Kill off some unused code that was wasting several k, as noticed by
Denis Vlasenko when building with  -ffunction-sections -fdata-sections
2006-03-03 18:37:39 +00:00
Bernhard Reutner-Fischer
1d62d3b7b9 - make libiproute compile.. 2005-10-08 20:47:15 +00:00
Eric Andersen
14f5c8d764 Patch from Bernhard Fischer to make a bunch of symbols static
which were otherwise cluttering the global namespace.
2005-04-16 19:39:00 +00:00
Glenn L McGrath
275be87be7 Only included headers that are used. 2002-12-16 07:37:21 +00:00
Glenn L McGrath
9a2d27249c IP applet by Bastian Blank <waldi@debian.org> 2002-11-10 01:33:55 +00:00