diff options
-rw-r--r-- | networking/libiproute/ipaddress.c | 4 | ||||
-rw-r--r-- | networking/libiproute/iproute.c | 2 | ||||
-rw-r--r-- | networking/libiproute/iprule.c | 10 | ||||
-rw-r--r-- | networking/libiproute/iptunnel.c | 2 | ||||
-rw-r--r-- | networking/libiproute/ll_addr.c | 12 | ||||
-rw-r--r-- | networking/libiproute/ll_proto.c | 4 | ||||
-rw-r--r-- | networking/libiproute/ll_types.c | 4 | ||||
-rw-r--r-- | networking/libiproute/rt_names.c | 45 | ||||
-rw-r--r-- | networking/libiproute/rt_names.h | 31 | ||||
-rw-r--r-- | networking/libiproute/rtm_map.c | 9 | ||||
-rw-r--r-- | networking/libiproute/rtm_map.h | 6 |
11 files changed, 68 insertions, 61 deletions
diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c index 39af88324..86d27548b 100644 --- a/networking/libiproute/ipaddress.c +++ b/networking/libiproute/ipaddress.c | |||
@@ -162,7 +162,7 @@ static NOINLINE int print_linkinfo(const struct nlmsghdr *n) | |||
162 | 162 | ||
163 | if (!filter.family || filter.family == AF_PACKET) { | 163 | if (!filter.family || filter.family == AF_PACKET) { |
164 | SPRINT_BUF(b1); | 164 | SPRINT_BUF(b1); |
165 | printf("%c link/%s ", _SL_, ll_type_n2a(ifi->ifi_type, b1, sizeof(b1))); | 165 | printf("%c link/%s ", _SL_, ll_type_n2a(ifi->ifi_type, b1)); |
166 | 166 | ||
167 | if (tb[IFLA_ADDRESS]) { | 167 | if (tb[IFLA_ADDRESS]) { |
168 | fputs(ll_addr_n2a(RTA_DATA(tb[IFLA_ADDRESS]), | 168 | fputs(ll_addr_n2a(RTA_DATA(tb[IFLA_ADDRESS]), |
@@ -308,7 +308,7 @@ static int FAST_FUNC print_addrinfo(const struct sockaddr_nl *who UNUSED_PARAM, | |||
308 | RTA_DATA(rta_tb[IFA_ANYCAST]), | 308 | RTA_DATA(rta_tb[IFA_ANYCAST]), |
309 | abuf, sizeof(abuf))); | 309 | abuf, sizeof(abuf))); |
310 | } | 310 | } |
311 | printf("scope %s ", rtnl_rtscope_n2a(ifa->ifa_scope, b1, sizeof(b1))); | 311 | printf("scope %s ", rtnl_rtscope_n2a(ifa->ifa_scope, b1)); |
312 | if (ifa->ifa_flags & IFA_F_SECONDARY) { | 312 | if (ifa->ifa_flags & IFA_F_SECONDARY) { |
313 | ifa->ifa_flags &= ~IFA_F_SECONDARY; | 313 | ifa->ifa_flags &= ~IFA_F_SECONDARY; |
314 | printf("secondary "); | 314 | printf("secondary "); |
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c index ac7eec598..7031bed34 100644 --- a/networking/libiproute/iproute.c +++ b/networking/libiproute/iproute.c | |||
@@ -196,7 +196,7 @@ static int FAST_FUNC print_route(const struct sockaddr_nl *who UNUSED_PARAM, | |||
196 | printf("Deleted "); | 196 | printf("Deleted "); |
197 | } | 197 | } |
198 | if (r->rtm_type != RTN_UNICAST && !filter.type) { | 198 | if (r->rtm_type != RTN_UNICAST && !filter.type) { |
199 | printf("%s ", rtnl_rtntype_n2a(r->rtm_type, b1, sizeof(b1))); | 199 | printf("%s ", rtnl_rtntype_n2a(r->rtm_type, b1)); |
200 | } | 200 | } |
201 | 201 | ||
202 | if (tb[RTA_DST]) { | 202 | if (tb[RTA_DST]) { |
diff --git a/networking/libiproute/iprule.c b/networking/libiproute/iprule.c index bec530dcb..e52473117 100644 --- a/networking/libiproute/iprule.c +++ b/networking/libiproute/iprule.c | |||
@@ -113,7 +113,7 @@ static int FAST_FUNC print_rule(const struct sockaddr_nl *who UNUSED_PARAM, | |||
113 | } | 113 | } |
114 | 114 | ||
115 | if (r->rtm_tos) { | 115 | if (r->rtm_tos) { |
116 | printf("tos %s ", rtnl_dsfield_n2a(r->rtm_tos, b1, sizeof(b1))); | 116 | printf("tos %s ", rtnl_dsfield_n2a(r->rtm_tos, b1)); |
117 | } | 117 | } |
118 | if (tb[RTA_PROTOINFO]) { | 118 | if (tb[RTA_PROTOINFO]) { |
119 | printf("fwmark %#x ", *(uint32_t*)RTA_DATA(tb[RTA_PROTOINFO])); | 119 | printf("fwmark %#x ", *(uint32_t*)RTA_DATA(tb[RTA_PROTOINFO])); |
@@ -124,7 +124,7 @@ static int FAST_FUNC print_rule(const struct sockaddr_nl *who UNUSED_PARAM, | |||
124 | } | 124 | } |
125 | 125 | ||
126 | if (r->rtm_table) | 126 | if (r->rtm_table) |
127 | printf("lookup %s ", rtnl_rttable_n2a(r->rtm_table, b1, sizeof(b1))); | 127 | printf("lookup %s ", rtnl_rttable_n2a(r->rtm_table, b1)); |
128 | 128 | ||
129 | if (tb[RTA_FLOW]) { | 129 | if (tb[RTA_FLOW]) { |
130 | uint32_t to = *(uint32_t*)RTA_DATA(tb[RTA_FLOW]); | 130 | uint32_t to = *(uint32_t*)RTA_DATA(tb[RTA_FLOW]); |
@@ -132,10 +132,10 @@ static int FAST_FUNC print_rule(const struct sockaddr_nl *who UNUSED_PARAM, | |||
132 | to &= 0xFFFF; | 132 | to &= 0xFFFF; |
133 | if (from) { | 133 | if (from) { |
134 | printf("realms %s/", | 134 | printf("realms %s/", |
135 | rtnl_rtrealm_n2a(from, b1, sizeof(b1))); | 135 | rtnl_rtrealm_n2a(from, b1)); |
136 | } | 136 | } |
137 | printf("%s ", | 137 | printf("%s ", |
138 | rtnl_rtrealm_n2a(to, b1, sizeof(b1))); | 138 | rtnl_rtrealm_n2a(to, b1)); |
139 | } | 139 | } |
140 | 140 | ||
141 | if (r->rtm_type == RTN_NAT) { | 141 | if (r->rtm_type == RTN_NAT) { |
@@ -148,7 +148,7 @@ static int FAST_FUNC print_rule(const struct sockaddr_nl *who UNUSED_PARAM, | |||
148 | } else | 148 | } else |
149 | printf("masquerade"); | 149 | printf("masquerade"); |
150 | } else if (r->rtm_type != RTN_UNICAST) | 150 | } else if (r->rtm_type != RTN_UNICAST) |
151 | fputs(rtnl_rtntype_n2a(r->rtm_type, b1, sizeof(b1)), stdout); | 151 | fputs(rtnl_rtntype_n2a(r->rtm_type, b1), stdout); |
152 | 152 | ||
153 | bb_putchar('\n'); | 153 | bb_putchar('\n'); |
154 | /*fflush(stdout);*/ | 154 | /*fflush(stdout);*/ |
diff --git a/networking/libiproute/iptunnel.c b/networking/libiproute/iptunnel.c index 6a841aadb..836709c7e 100644 --- a/networking/libiproute/iptunnel.c +++ b/networking/libiproute/iptunnel.c | |||
@@ -436,7 +436,7 @@ static void print_tunnel(struct ip_tunnel_parm *p) | |||
436 | printf(" inherit"); | 436 | printf(" inherit"); |
437 | if (p->iph.tos & ~1) | 437 | if (p->iph.tos & ~1) |
438 | printf("%c%s ", p->iph.tos & 1 ? '/' : ' ', | 438 | printf("%c%s ", p->iph.tos & 1 ? '/' : ' ', |
439 | rtnl_dsfield_n2a(p->iph.tos & ~1, b1, sizeof(b1))); | 439 | rtnl_dsfield_n2a(p->iph.tos & ~1, b1)); |
440 | } | 440 | } |
441 | if (!(p->iph.frag_off & htons(IP_DF))) | 441 | if (!(p->iph.frag_off & htons(IP_DF))) |
442 | printf(" nopmtudisc"); | 442 | printf(" nopmtudisc"); |
diff --git a/networking/libiproute/ll_addr.c b/networking/libiproute/ll_addr.c index f50e37193..f59831cc1 100644 --- a/networking/libiproute/ll_addr.c +++ b/networking/libiproute/ll_addr.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include "utils.h" | 17 | #include "utils.h" |
18 | 18 | ||
19 | 19 | ||
20 | const char *ll_addr_n2a(unsigned char *addr, int alen, int type, char *buf, int blen) | 20 | const char* FAST_FUNC ll_addr_n2a(unsigned char *addr, int alen, int type, char *buf, int blen) |
21 | { | 21 | { |
22 | int i; | 22 | int i; |
23 | int l; | 23 | int l; |
@@ -27,13 +27,13 @@ const char *ll_addr_n2a(unsigned char *addr, int alen, int type, char *buf, int | |||
27 | return inet_ntop(AF_INET, addr, buf, blen); | 27 | return inet_ntop(AF_INET, addr, buf, blen); |
28 | } | 28 | } |
29 | l = 0; | 29 | l = 0; |
30 | for (i=0; i<alen; i++) { | 30 | for (i = 0; i < alen; i++) { |
31 | if (i==0) { | 31 | if (i == 0) { |
32 | snprintf(buf+l, blen, ":%02x"+1, addr[i]); | 32 | snprintf(buf + l, blen, ":%02x"+1, addr[i]); |
33 | blen -= 2; | 33 | blen -= 2; |
34 | l += 2; | 34 | l += 2; |
35 | } else { | 35 | } else { |
36 | snprintf(buf+l, blen, ":%02x", addr[i]); | 36 | snprintf(buf + l, blen, ":%02x", addr[i]); |
37 | blen -= 3; | 37 | blen -= 3; |
38 | l += 3; | 38 | l += 3; |
39 | } | 39 | } |
@@ -41,7 +41,7 @@ const char *ll_addr_n2a(unsigned char *addr, int alen, int type, char *buf, int | |||
41 | return buf; | 41 | return buf; |
42 | } | 42 | } |
43 | 43 | ||
44 | int ll_addr_a2n(unsigned char *lladdr, int len, char *arg) | 44 | int FAST_FUNC ll_addr_a2n(unsigned char *lladdr, int len, char *arg) |
45 | { | 45 | { |
46 | int i; | 46 | int i; |
47 | 47 | ||
diff --git a/networking/libiproute/ll_proto.c b/networking/libiproute/ll_proto.c index a93493538..145902b2e 100644 --- a/networking/libiproute/ll_proto.c +++ b/networking/libiproute/ll_proto.c | |||
@@ -98,7 +98,7 @@ __PF(ECONET,econet) | |||
98 | #undef __PF | 98 | #undef __PF |
99 | 99 | ||
100 | 100 | ||
101 | const char *ll_proto_n2a(unsigned short id, char *buf, int len) | 101 | const char* FAST_FUNC ll_proto_n2a(unsigned short id, char *buf, int len) |
102 | { | 102 | { |
103 | unsigned i; | 103 | unsigned i; |
104 | id = ntohs(id); | 104 | id = ntohs(id); |
@@ -110,7 +110,7 @@ const char *ll_proto_n2a(unsigned short id, char *buf, int len) | |||
110 | return buf; | 110 | return buf; |
111 | } | 111 | } |
112 | 112 | ||
113 | int ll_proto_a2n(unsigned short *id, char *buf) | 113 | int FAST_FUNC ll_proto_a2n(unsigned short *id, char *buf) |
114 | { | 114 | { |
115 | unsigned i; | 115 | unsigned i; |
116 | for (i = 0; i < ARRAY_SIZE(llproto_names); i++) { | 116 | for (i = 0; i < ARRAY_SIZE(llproto_names); i++) { |
diff --git a/networking/libiproute/ll_types.c b/networking/libiproute/ll_types.c index d5d2a1f39..3861c2870 100644 --- a/networking/libiproute/ll_types.c +++ b/networking/libiproute/ll_types.c | |||
@@ -15,7 +15,7 @@ | |||
15 | #include "libbb.h" | 15 | #include "libbb.h" |
16 | #include "rt_names.h" | 16 | #include "rt_names.h" |
17 | 17 | ||
18 | const char *ll_type_n2a(int type, char *buf, int len) | 18 | const char* FAST_FUNC ll_type_n2a(int type, char *buf) |
19 | { | 19 | { |
20 | static const char arphrd_name[] = | 20 | static const char arphrd_name[] = |
21 | /* 0, */ "generic" "\0" | 21 | /* 0, */ "generic" "\0" |
@@ -200,6 +200,6 @@ const char *ll_type_n2a(int type, char *buf, int len) | |||
200 | return aname; | 200 | return aname; |
201 | aname += strlen(aname) + 1; | 201 | aname += strlen(aname) + 1; |
202 | } | 202 | } |
203 | snprintf(buf, len, "[%d]", type); | 203 | sprintf(buf, "[%d]", type); |
204 | return buf; | 204 | return buf; |
205 | } | 205 | } |
diff --git a/networking/libiproute/rt_names.c b/networking/libiproute/rt_names.c index 2699dba3d..8dd16e3d3 100644 --- a/networking/libiproute/rt_names.c +++ b/networking/libiproute/rt_names.c | |||
@@ -90,10 +90,10 @@ static void rtnl_rtprot_initialize(void) | |||
90 | rtnl_tab_initialize("/etc/iproute2/rt_protos", rtnl_rtprot_tab->tab); | 90 | rtnl_tab_initialize("/etc/iproute2/rt_protos", rtnl_rtprot_tab->tab); |
91 | } | 91 | } |
92 | 92 | ||
93 | const char* rtnl_rtprot_n2a(int id, char *buf, int len) | 93 | const char* FAST_FUNC rtnl_rtprot_n2a(int id, char *buf) |
94 | { | 94 | { |
95 | if (id < 0 || id >= 256) { | 95 | if (id < 0 || id >= 256) { |
96 | snprintf(buf, len, "%d", id); | 96 | sprintf(buf, "%d", id); |
97 | return buf; | 97 | return buf; |
98 | } | 98 | } |
99 | 99 | ||
@@ -101,11 +101,12 @@ const char* rtnl_rtprot_n2a(int id, char *buf, int len) | |||
101 | 101 | ||
102 | if (rtnl_rtprot_tab->tab[id]) | 102 | if (rtnl_rtprot_tab->tab[id]) |
103 | return rtnl_rtprot_tab->tab[id]; | 103 | return rtnl_rtprot_tab->tab[id]; |
104 | snprintf(buf, len, "%d", id); | 104 | /* buf is SPRINT_BSIZE big */ |
105 | sprintf(buf, "%d", id); | ||
105 | return buf; | 106 | return buf; |
106 | } | 107 | } |
107 | 108 | ||
108 | int rtnl_rtprot_a2n(uint32_t *id, char *arg) | 109 | int FAST_FUNC rtnl_rtprot_a2n(uint32_t *id, char *arg) |
109 | { | 110 | { |
110 | rtnl_rtprot_initialize(); | 111 | rtnl_rtprot_initialize(); |
111 | return rtnl_a2n(rtnl_rtprot_tab, id, arg, 0); | 112 | return rtnl_a2n(rtnl_rtprot_tab, id, arg, 0); |
@@ -127,10 +128,10 @@ static void rtnl_rtscope_initialize(void) | |||
127 | rtnl_tab_initialize("/etc/iproute2/rt_scopes", rtnl_rtscope_tab->tab); | 128 | rtnl_tab_initialize("/etc/iproute2/rt_scopes", rtnl_rtscope_tab->tab); |
128 | } | 129 | } |
129 | 130 | ||
130 | const char* rtnl_rtscope_n2a(int id, char *buf, int len) | 131 | const char* FAST_FUNC rtnl_rtscope_n2a(int id, char *buf) |
131 | { | 132 | { |
132 | if (id < 0 || id >= 256) { | 133 | if (id < 0 || id >= 256) { |
133 | snprintf(buf, len, "%d", id); | 134 | sprintf(buf, "%d", id); |
134 | return buf; | 135 | return buf; |
135 | } | 136 | } |
136 | 137 | ||
@@ -138,11 +139,12 @@ const char* rtnl_rtscope_n2a(int id, char *buf, int len) | |||
138 | 139 | ||
139 | if (rtnl_rtscope_tab->tab[id]) | 140 | if (rtnl_rtscope_tab->tab[id]) |
140 | return rtnl_rtscope_tab->tab[id]; | 141 | return rtnl_rtscope_tab->tab[id]; |
141 | snprintf(buf, len, "%d", id); | 142 | /* buf is SPRINT_BSIZE big */ |
143 | sprintf(buf, "%d", id); | ||
142 | return buf; | 144 | return buf; |
143 | } | 145 | } |
144 | 146 | ||
145 | int rtnl_rtscope_a2n(uint32_t *id, char *arg) | 147 | int FAST_FUNC rtnl_rtscope_a2n(uint32_t *id, char *arg) |
146 | { | 148 | { |
147 | rtnl_rtscope_initialize(); | 149 | rtnl_rtscope_initialize(); |
148 | return rtnl_a2n(rtnl_rtscope_tab, id, arg, 0); | 150 | return rtnl_a2n(rtnl_rtscope_tab, id, arg, 0); |
@@ -159,17 +161,17 @@ static void rtnl_rtrealm_initialize(void) | |||
159 | rtnl_tab_initialize("/etc/iproute2/rt_realms", rtnl_rtrealm_tab->tab); | 161 | rtnl_tab_initialize("/etc/iproute2/rt_realms", rtnl_rtrealm_tab->tab); |
160 | } | 162 | } |
161 | 163 | ||
162 | int rtnl_rtrealm_a2n(uint32_t *id, char *arg) | 164 | int FAST_FUNC rtnl_rtrealm_a2n(uint32_t *id, char *arg) |
163 | { | 165 | { |
164 | rtnl_rtrealm_initialize(); | 166 | rtnl_rtrealm_initialize(); |
165 | return rtnl_a2n(rtnl_rtrealm_tab, id, arg, 0); | 167 | return rtnl_a2n(rtnl_rtrealm_tab, id, arg, 0); |
166 | } | 168 | } |
167 | 169 | ||
168 | #if ENABLE_FEATURE_IP_RULE | 170 | #if ENABLE_FEATURE_IP_RULE |
169 | const char* rtnl_rtrealm_n2a(int id, char *buf, int len) | 171 | const char* FAST_FUNC rtnl_rtrealm_n2a(int id, char *buf) |
170 | { | 172 | { |
171 | if (id < 0 || id >= 256) { | 173 | if (id < 0 || id >= 256) { |
172 | snprintf(buf, len, "%d", id); | 174 | sprintf(buf, "%d", id); |
173 | return buf; | 175 | return buf; |
174 | } | 176 | } |
175 | 177 | ||
@@ -177,7 +179,8 @@ const char* rtnl_rtrealm_n2a(int id, char *buf, int len) | |||
177 | 179 | ||
178 | if (rtnl_rtrealm_tab->tab[id]) | 180 | if (rtnl_rtrealm_tab->tab[id]) |
179 | return rtnl_rtrealm_tab->tab[id]; | 181 | return rtnl_rtrealm_tab->tab[id]; |
180 | snprintf(buf, len, "%d", id); | 182 | /* buf is SPRINT_BSIZE big */ |
183 | sprintf(buf, "%d", id); | ||
181 | return buf; | 184 | return buf; |
182 | } | 185 | } |
183 | #endif | 186 | #endif |
@@ -193,10 +196,10 @@ static void rtnl_rtdsfield_initialize(void) | |||
193 | rtnl_tab_initialize("/etc/iproute2/rt_dsfield", rtnl_rtdsfield_tab->tab); | 196 | rtnl_tab_initialize("/etc/iproute2/rt_dsfield", rtnl_rtdsfield_tab->tab); |
194 | } | 197 | } |
195 | 198 | ||
196 | const char * rtnl_dsfield_n2a(int id, char *buf, int len) | 199 | const char* FAST_FUNC rtnl_dsfield_n2a(int id, char *buf) |
197 | { | 200 | { |
198 | if (id < 0 || id >= 256) { | 201 | if (id < 0 || id >= 256) { |
199 | snprintf(buf, len, "%d", id); | 202 | sprintf(buf, "%d", id); |
200 | return buf; | 203 | return buf; |
201 | } | 204 | } |
202 | 205 | ||
@@ -204,11 +207,12 @@ const char * rtnl_dsfield_n2a(int id, char *buf, int len) | |||
204 | 207 | ||
205 | if (rtnl_rtdsfield_tab->tab[id]) | 208 | if (rtnl_rtdsfield_tab->tab[id]) |
206 | return rtnl_rtdsfield_tab->tab[id]; | 209 | return rtnl_rtdsfield_tab->tab[id]; |
207 | snprintf(buf, len, "0x%02x", id); | 210 | /* buf is SPRINT_BSIZE big */ |
211 | sprintf(buf, "0x%02x", id); | ||
208 | return buf; | 212 | return buf; |
209 | } | 213 | } |
210 | 214 | ||
211 | int rtnl_dsfield_a2n(uint32_t *id, char *arg) | 215 | int FAST_FUNC rtnl_dsfield_a2n(uint32_t *id, char *arg) |
212 | { | 216 | { |
213 | rtnl_rtdsfield_initialize(); | 217 | rtnl_rtdsfield_initialize(); |
214 | return rtnl_a2n(rtnl_rtdsfield_tab, id, arg, 16); | 218 | return rtnl_a2n(rtnl_rtdsfield_tab, id, arg, 16); |
@@ -229,10 +233,10 @@ static void rtnl_rttable_initialize(void) | |||
229 | rtnl_tab_initialize("/etc/iproute2/rt_tables", rtnl_rttable_tab->tab); | 233 | rtnl_tab_initialize("/etc/iproute2/rt_tables", rtnl_rttable_tab->tab); |
230 | } | 234 | } |
231 | 235 | ||
232 | const char *rtnl_rttable_n2a(int id, char *buf, int len) | 236 | const char* FAST_FUNC rtnl_rttable_n2a(int id, char *buf) |
233 | { | 237 | { |
234 | if (id < 0 || id >= 256) { | 238 | if (id < 0 || id >= 256) { |
235 | snprintf(buf, len, "%d", id); | 239 | sprintf(buf, "%d", id); |
236 | return buf; | 240 | return buf; |
237 | } | 241 | } |
238 | 242 | ||
@@ -240,11 +244,12 @@ const char *rtnl_rttable_n2a(int id, char *buf, int len) | |||
240 | 244 | ||
241 | if (rtnl_rttable_tab->tab[id]) | 245 | if (rtnl_rttable_tab->tab[id]) |
242 | return rtnl_rttable_tab->tab[id]; | 246 | return rtnl_rttable_tab->tab[id]; |
243 | snprintf(buf, len, "%d", id); | 247 | /* buf is SPRINT_BSIZE big */ |
248 | sprintf(buf, "%d", id); | ||
244 | return buf; | 249 | return buf; |
245 | } | 250 | } |
246 | 251 | ||
247 | int rtnl_rttable_a2n(uint32_t *id, char *arg) | 252 | int FAST_FUNC rtnl_rttable_a2n(uint32_t *id, char *arg) |
248 | { | 253 | { |
249 | rtnl_rttable_initialize(); | 254 | rtnl_rttable_initialize(); |
250 | return rtnl_a2n(rtnl_rttable_tab, id, arg, 0); | 255 | return rtnl_a2n(rtnl_rttable_tab, id, arg, 0); |
diff --git a/networking/libiproute/rt_names.h b/networking/libiproute/rt_names.h index a2d4fd142..e73aa851c 100644 --- a/networking/libiproute/rt_names.h +++ b/networking/libiproute/rt_names.h | |||
@@ -4,25 +4,26 @@ | |||
4 | 4 | ||
5 | PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN | 5 | PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN |
6 | 6 | ||
7 | extern const char* rtnl_rtprot_n2a(int id, char *buf, int len); | 7 | /* buf is SPRINT_BSIZE big */ |
8 | extern const char* rtnl_rtscope_n2a(int id, char *buf, int len); | 8 | extern const char* rtnl_rtprot_n2a(int id, char *buf) FAST_FUNC; |
9 | extern const char* rtnl_rtrealm_n2a(int id, char *buf, int len); | 9 | extern const char* rtnl_rtscope_n2a(int id, char *buf) FAST_FUNC; |
10 | extern const char* rtnl_dsfield_n2a(int id, char *buf, int len); | 10 | extern const char* rtnl_rtrealm_n2a(int id, char *buf) FAST_FUNC; |
11 | extern const char* rtnl_rttable_n2a(int id, char *buf, int len); | 11 | extern const char* rtnl_dsfield_n2a(int id, char *buf) FAST_FUNC; |
12 | extern int rtnl_rtprot_a2n(uint32_t *id, char *arg); | 12 | extern const char* rtnl_rttable_n2a(int id, char *buf) FAST_FUNC; |
13 | extern int rtnl_rtscope_a2n(uint32_t *id, char *arg); | 13 | extern int rtnl_rtprot_a2n(uint32_t *id, char *arg) FAST_FUNC; |
14 | extern int rtnl_rtrealm_a2n(uint32_t *id, char *arg); | 14 | extern int rtnl_rtscope_a2n(uint32_t *id, char *arg) FAST_FUNC; |
15 | extern int rtnl_dsfield_a2n(uint32_t *id, char *arg); | 15 | extern int rtnl_rtrealm_a2n(uint32_t *id, char *arg) FAST_FUNC; |
16 | extern int rtnl_rttable_a2n(uint32_t *id, char *arg); | 16 | extern int rtnl_dsfield_a2n(uint32_t *id, char *arg) FAST_FUNC; |
17 | extern int rtnl_rttable_a2n(uint32_t *id, char *arg) FAST_FUNC; | ||
17 | 18 | ||
18 | extern const char* ll_type_n2a(int type, char *buf, int len); | 19 | extern const char* ll_type_n2a(int type, char *buf) FAST_FUNC; |
19 | 20 | ||
20 | extern const char* ll_addr_n2a(unsigned char *addr, int alen, int type, | 21 | extern const char* ll_addr_n2a(unsigned char *addr, int alen, int type, |
21 | char *buf, int blen); | 22 | char *buf, int blen) FAST_FUNC; |
22 | extern int ll_addr_a2n(unsigned char *lladdr, int len, char *arg); | 23 | extern int ll_addr_a2n(unsigned char *lladdr, int len, char *arg) FAST_FUNC; |
23 | 24 | ||
24 | extern const char* ll_proto_n2a(unsigned short id, char *buf, int len); | 25 | extern const char* ll_proto_n2a(unsigned short id, char *buf, int len) FAST_FUNC; |
25 | extern int ll_proto_a2n(unsigned short *id, char *buf); | 26 | extern int ll_proto_a2n(unsigned short *id, char *buf) FAST_FUNC; |
26 | 27 | ||
27 | POP_SAVED_FUNCTION_VISIBILITY | 28 | POP_SAVED_FUNCTION_VISIBILITY |
28 | 29 | ||
diff --git a/networking/libiproute/rtm_map.c b/networking/libiproute/rtm_map.c index 6fe5c4b75..5e358e105 100644 --- a/networking/libiproute/rtm_map.c +++ b/networking/libiproute/rtm_map.c | |||
@@ -15,7 +15,7 @@ | |||
15 | #include "rt_names.h" | 15 | #include "rt_names.h" |
16 | #include "utils.h" | 16 | #include "utils.h" |
17 | 17 | ||
18 | const char *rtnl_rtntype_n2a(int id, char *buf, int len) | 18 | const char* FAST_FUNC rtnl_rtntype_n2a(int id, char *buf) |
19 | { | 19 | { |
20 | switch (id) { | 20 | switch (id) { |
21 | case RTN_UNSPEC: | 21 | case RTN_UNSPEC: |
@@ -43,13 +43,14 @@ const char *rtnl_rtntype_n2a(int id, char *buf, int len) | |||
43 | case RTN_XRESOLVE: | 43 | case RTN_XRESOLVE: |
44 | return "xresolve"; | 44 | return "xresolve"; |
45 | default: | 45 | default: |
46 | snprintf(buf, len, "%d", id); | 46 | /* buf is SPRINT_BSIZE big */ |
47 | sprintf(buf, "%d", id); | ||
47 | return buf; | 48 | return buf; |
48 | } | 49 | } |
49 | } | 50 | } |
50 | 51 | ||
51 | 52 | ||
52 | int rtnl_rtntype_a2n(int *id, char *arg) | 53 | int FAST_FUNC rtnl_rtntype_a2n(int *id, char *arg) |
53 | { | 54 | { |
54 | static const char keywords[] ALIGN1 = | 55 | static const char keywords[] ALIGN1 = |
55 | "local\0""nat\0""broadcast\0""brd\0""anycast\0" | 56 | "local\0""nat\0""broadcast\0""brd\0""anycast\0" |
@@ -95,7 +96,7 @@ int rtnl_rtntype_a2n(int *id, char *arg) | |||
95 | return 0; | 96 | return 0; |
96 | } | 97 | } |
97 | 98 | ||
98 | int get_rt_realms(uint32_t *realms, char *arg) | 99 | int FAST_FUNC get_rt_realms(uint32_t *realms, char *arg) |
99 | { | 100 | { |
100 | uint32_t realm = 0; | 101 | uint32_t realm = 0; |
101 | char *p = strchr(arg, '/'); | 102 | char *p = strchr(arg, '/'); |
diff --git a/networking/libiproute/rtm_map.h b/networking/libiproute/rtm_map.h index ab1b70e45..4377bd590 100644 --- a/networking/libiproute/rtm_map.h +++ b/networking/libiproute/rtm_map.h | |||
@@ -4,10 +4,10 @@ | |||
4 | 4 | ||
5 | PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN | 5 | PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN |
6 | 6 | ||
7 | const char *rtnl_rtntype_n2a(int id, char *buf, int len); | 7 | const char *rtnl_rtntype_n2a(int id, char *buf) FAST_FUNC; |
8 | int rtnl_rtntype_a2n(int *id, char *arg); | 8 | int rtnl_rtntype_a2n(int *id, char *arg) FAST_FUNC; |
9 | 9 | ||
10 | int get_rt_realms(uint32_t *realms, char *arg); | 10 | int get_rt_realms(uint32_t *realms, char *arg) FAST_FUNC; |
11 | 11 | ||
12 | POP_SAVED_FUNCTION_VISIBILITY | 12 | POP_SAVED_FUNCTION_VISIBILITY |
13 | 13 | ||