diff options
Diffstat (limited to 'networking/libiproute/utils.c')
-rw-r--r-- | networking/libiproute/utils.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/networking/libiproute/utils.c b/networking/libiproute/utils.c index 42025bc..fca167a 100644 --- a/networking/libiproute/utils.c +++ b/networking/libiproute/utils.c @@ -13,7 +13,7 @@ #include "utils.h" #include "inet_common.h" -unsigned get_hz(void) +unsigned FAST_FUNC get_hz(void) { static unsigned hz_internal; FILE *fp; @@ -35,7 +35,7 @@ unsigned get_hz(void) return hz_internal; } -unsigned get_unsigned(char *arg, const char *errmsg) +unsigned FAST_FUNC get_unsigned(char *arg, const char *errmsg) { unsigned long res; char *ptr; @@ -50,7 +50,7 @@ unsigned get_unsigned(char *arg, const char *errmsg) invarg_1_to_2(arg, errmsg); /* does not return */ } -uint32_t get_u32(char *arg, const char *errmsg) +uint32_t FAST_FUNC get_u32(char *arg, const char *errmsg) { unsigned long res; char *ptr; @@ -65,7 +65,7 @@ uint32_t get_u32(char *arg, const char *errmsg) invarg_1_to_2(arg, errmsg); /* does not return */ } -uint16_t get_u16(char *arg, const char *errmsg) +uint16_t FAST_FUNC get_u16(char *arg, const char *errmsg) { unsigned long res; char *ptr; @@ -80,7 +80,7 @@ uint16_t get_u16(char *arg, const char *errmsg) invarg_1_to_2(arg, errmsg); /* does not return */ } -int get_addr_1(inet_prefix *addr, char *name, int family) +int FAST_FUNC get_addr_1(inet_prefix *addr, char *name, int family) { memset(addr, 0, sizeof(*addr)); @@ -199,7 +199,7 @@ static void get_prefix_1(inet_prefix *dst, char *arg, int family) bb_error_msg_and_die("an %s %s is expected rather than \"%s\"", "inet", "prefix", arg); } -int get_addr(inet_prefix *dst, char *arg, int family) +int FAST_FUNC get_addr(inet_prefix *dst, char *arg, int family) { if (family == AF_PACKET) { bb_error_msg_and_die("\"%s\" may be inet %s, but it is not allowed in this context", arg, "address"); @@ -210,7 +210,7 @@ int get_addr(inet_prefix *dst, char *arg, int family) return 0; } -void get_prefix(inet_prefix *dst, char *arg, int family) +void FAST_FUNC get_prefix(inet_prefix *dst, char *arg, int family) { if (family == AF_PACKET) { bb_error_msg_and_die("\"%s\" may be inet %s, but it is not allowed in this context", arg, "prefix"); @@ -218,7 +218,7 @@ void get_prefix(inet_prefix *dst, char *arg, int family) get_prefix_1(dst, arg, family); } -uint32_t get_addr32(char *name) +uint32_t FAST_FUNC get_addr32(char *name) { inet_prefix addr; @@ -228,27 +228,29 @@ uint32_t get_addr32(char *name) return addr.data[0]; } -void incomplete_command(void) +char** FAST_FUNC next_arg(char **argv) { - bb_error_msg_and_die("command line is not complete, try \"help\""); + if (!*++argv) + bb_error_msg_and_die("command line is not complete, try \"help\""); + return argv; } -void invarg_1_to_2(const char *arg, const char *opt) +void FAST_FUNC invarg_1_to_2(const char *arg, const char *opt) { bb_error_msg_and_die(bb_msg_invalid_arg_to, arg, opt); } -void duparg(const char *key, const char *arg) +void FAST_FUNC duparg(const char *key, const char *arg) { bb_error_msg_and_die("duplicate \"%s\": \"%s\" is the second value", key, arg); } -void duparg2(const char *key, const char *arg) +void FAST_FUNC duparg2(const char *key, const char *arg) { bb_error_msg_and_die("either \"%s\" is duplicate, or \"%s\" is garbage", key, arg); } -int inet_addr_match(const inet_prefix *a, const inet_prefix *b, int bits) +int FAST_FUNC inet_addr_match(const inet_prefix *a, const inet_prefix *b, int bits) { const uint32_t *a1 = a->data; const uint32_t *a2 = b->data; @@ -276,7 +278,7 @@ int inet_addr_match(const inet_prefix *a, const inet_prefix *b, int bits) return 0; } -const char *rt_addr_n2a(int af, void *addr) +const char* FAST_FUNC rt_addr_n2a(int af, void *addr) { switch (af) { case AF_INET: @@ -290,7 +292,7 @@ const char *rt_addr_n2a(int af, void *addr) } #ifdef RESOLVE_HOSTNAMES -const char *format_host(int af, int len, void *addr) +const char* FAST_FUNC format_host(int af, int len, void *addr) { if (resolve_hosts) { struct hostent *h_ent; |