diff options
Diffstat (limited to 'networking/arp.c')
-rw-r--r-- | networking/arp.c | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/networking/arp.c b/networking/arp.c index f42e09f7c..f85a91022 100644 --- a/networking/arp.c +++ b/networking/arp.c | |||
@@ -313,6 +313,26 @@ static void | |||
313 | arp_disp(const char *name, char *ip, int type, int arp_flags, | 313 | arp_disp(const char *name, char *ip, int type, int arp_flags, |
314 | char *hwa, char *mask, char *dev) | 314 | char *hwa, char *mask, char *dev) |
315 | { | 315 | { |
316 | static const int arp_masks[] = { | ||
317 | ATF_PERM, ATF_PUBL, | ||
318 | #ifdef HAVE_ATF_MAGIC | ||
319 | ATF_MAGIC, | ||
320 | #endif | ||
321 | #ifdef HAVE_ATF_DONTPUB | ||
322 | ATF_DONTPUB, | ||
323 | #endif | ||
324 | ATF_USETRAILERS, | ||
325 | }; | ||
326 | static const char arp_labels[] ALIGN1 = "PERM\0""PUP\0" | ||
327 | #ifdef HAVE_ATF_MAGIC | ||
328 | "AUTO\0" | ||
329 | #endif | ||
330 | #ifdef HAVE_ATF_DONTPUB | ||
331 | "DONTPUB\0" | ||
332 | #endif | ||
333 | "TRAIL\0" | ||
334 | ; | ||
335 | |||
316 | const struct hwtype *xhw; | 336 | const struct hwtype *xhw; |
317 | 337 | ||
318 | xhw = get_hwntype(type); | 338 | xhw = get_hwntype(type); |
@@ -333,22 +353,8 @@ arp_disp(const char *name, char *ip, int type, int arp_flags, | |||
333 | if (arp_flags & ATF_NETMASK) | 353 | if (arp_flags & ATF_NETMASK) |
334 | printf("netmask %s ", mask); | 354 | printf("netmask %s ", mask); |
335 | 355 | ||
336 | if (arp_flags & ATF_PERM) | 356 | print_flags_separated(arp_masks, arp_labels, arp_flags, " "); |
337 | printf("PERM "); | 357 | printf(" on %s\n", dev); |
338 | if (arp_flags & ATF_PUBL) | ||
339 | printf("PUP "); | ||
340 | #ifdef HAVE_ATF_MAGIC | ||
341 | if (arp_flags & ATF_MAGIC) | ||
342 | printf("AUTO "); | ||
343 | #endif | ||
344 | #ifdef HAVE_ATF_DONTPUB | ||
345 | if (arp_flags & ATF_DONTPUB) | ||
346 | printf("DONTPUB "); | ||
347 | #endif | ||
348 | if (arp_flags & ATF_USETRAILERS) | ||
349 | printf("TRAIL "); | ||
350 | |||
351 | printf("on %s\n", dev); | ||
352 | } | 358 | } |
353 | 359 | ||
354 | /* Display the contents of the ARP cache in the kernel. */ | 360 | /* Display the contents of the ARP cache in the kernel. */ |