mirror of
https://github.com/sheumann/hush.git
synced 2024-12-23 05:29:58 +00:00
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>
This commit is contained in:
parent
e0a622093c
commit
2e9b5510d6
@ -22,12 +22,12 @@
|
||||
|| ENABLE_FEATURE_IP_TUNNEL \
|
||||
|| ENABLE_FEATURE_IP_RULE
|
||||
|
||||
static int ip_print_help(char **argv UNUSED_PARAM)
|
||||
static int FAST_FUNC ip_print_help(char **argv UNUSED_PARAM)
|
||||
{
|
||||
bb_show_usage();
|
||||
}
|
||||
|
||||
typedef int (*ip_func_ptr_t)(char**);
|
||||
typedef int FAST_FUNC (*ip_func_ptr_t)(char**);
|
||||
|
||||
static int ip_do(ip_func_ptr_t ip_func, char **argv)
|
||||
{
|
||||
|
@ -15,22 +15,21 @@
|
||||
|
||||
PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
|
||||
|
||||
extern char **ip_parse_common_args(char **argv);
|
||||
extern int print_neigh(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg);
|
||||
extern int ipaddr_list_or_flush(char **argv, int flush);
|
||||
extern int iproute_monitor(char **argv);
|
||||
extern void iplink_usage(void) NORETURN;
|
||||
extern void ipneigh_reset_filter(void);
|
||||
char FAST_FUNC **ip_parse_common_args(char **argv);
|
||||
//int FAST_FUNC print_neigh(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg);
|
||||
int FAST_FUNC ipaddr_list_or_flush(char **argv, int flush);
|
||||
//int FAST_FUNC iproute_monitor(char **argv);
|
||||
//void FAST_FUNC ipneigh_reset_filter(void);
|
||||
|
||||
extern int do_ipaddr(char **argv);
|
||||
extern int do_iproute(char **argv);
|
||||
extern int do_iprule(char **argv);
|
||||
extern int do_ipneigh(char **argv);
|
||||
extern int do_iptunnel(char **argv);
|
||||
extern int do_iplink(char **argv);
|
||||
extern int do_ipmonitor(char **argv);
|
||||
extern int do_multiaddr(char **argv);
|
||||
extern int do_multiroute(char **argv);
|
||||
int FAST_FUNC do_ipaddr(char **argv);
|
||||
int FAST_FUNC do_iproute(char **argv);
|
||||
int FAST_FUNC do_iprule(char **argv);
|
||||
//int FAST_FUNC do_ipneigh(char **argv);
|
||||
int FAST_FUNC do_iptunnel(char **argv);
|
||||
int FAST_FUNC do_iplink(char **argv);
|
||||
//int FAST_FUNC do_ipmonitor(char **argv);
|
||||
//int FAST_FUNC do_multiaddr(char **argv);
|
||||
//int FAST_FUNC do_multiroute(char **argv);
|
||||
|
||||
POP_SAVED_FUNCTION_VISIBILITY
|
||||
|
||||
|
@ -22,7 +22,7 @@ family_t preferred_family = AF_UNSPEC;
|
||||
smallint oneline;
|
||||
char _SL_;
|
||||
|
||||
char **ip_parse_common_args(char **argv)
|
||||
char** FAST_FUNC ip_parse_common_args(char **argv)
|
||||
{
|
||||
static const char ip_common_commands[] ALIGN1 =
|
||||
"oneline" "\0"
|
||||
|
@ -415,7 +415,7 @@ static void ipaddr_reset_filter(int _oneline)
|
||||
}
|
||||
|
||||
/* Return value becomes exitcode. It's okay to not return at all */
|
||||
int ipaddr_list_or_flush(char **argv, int flush)
|
||||
int FAST_FUNC ipaddr_list_or_flush(char **argv, int flush)
|
||||
{
|
||||
static const char option[] ALIGN1 = "to\0""scope\0""up\0""label\0""dev\0";
|
||||
|
||||
@ -747,7 +747,7 @@ static int ipaddr_modify(int cmd, char **argv)
|
||||
}
|
||||
|
||||
/* Return value becomes exitcode. It's okay to not return at all */
|
||||
int do_ipaddr(char **argv)
|
||||
int FAST_FUNC do_ipaddr(char **argv)
|
||||
{
|
||||
static const char commands[] ALIGN1 =
|
||||
"add\0""delete\0""list\0""show\0""lst\0""flush\0";
|
||||
|
@ -362,7 +362,7 @@ static int do_change(char **argv, const unsigned rtm)
|
||||
}
|
||||
|
||||
/* Return value becomes exitcode. It's okay to not return at all */
|
||||
int do_iplink(char **argv)
|
||||
int FAST_FUNC do_iplink(char **argv)
|
||||
{
|
||||
static const char keywords[] ALIGN1 =
|
||||
"add\0""delete\0""set\0""show\0""lst\0""list\0";
|
||||
|
@ -869,7 +869,7 @@ static int iproute_get(char **argv)
|
||||
}
|
||||
|
||||
/* Return value becomes exitcode. It's okay to not return at all */
|
||||
int do_iproute(char **argv)
|
||||
int FAST_FUNC do_iproute(char **argv)
|
||||
{
|
||||
static const char ip_route_commands[] ALIGN1 =
|
||||
/*0-3*/ "add\0""append\0""change\0""chg\0"
|
||||
|
@ -304,7 +304,7 @@ static int iprule_modify(int cmd, char **argv)
|
||||
}
|
||||
|
||||
/* Return value becomes exitcode. It's okay to not return at all */
|
||||
int do_iprule(char **argv)
|
||||
int FAST_FUNC do_iprule(char **argv)
|
||||
{
|
||||
static const char ip_rule_commands[] ALIGN1 =
|
||||
"add\0""delete\0""list\0""show\0";
|
||||
|
@ -556,7 +556,7 @@ static int do_show(char **argv)
|
||||
}
|
||||
|
||||
/* Return value becomes exitcode. It's okay to not return at all */
|
||||
int do_iptunnel(char **argv)
|
||||
int FAST_FUNC do_iptunnel(char **argv)
|
||||
{
|
||||
static const char keywords[] ALIGN1 =
|
||||
"add\0""change\0""delete\0""show\0""list\0""lst\0";
|
||||
|
Loading…
Reference in New Issue
Block a user