/* vi: set sw=4 ts=4: */
/*
- * ll_addr.c
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
+ * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*/
#include <net/if_arp.h>
#include "utils.h"
-const char *ll_addr_n2a(unsigned char *addr, int alen, int type, char *buf, int blen)
+const char* FAST_FUNC ll_addr_n2a(unsigned char *addr, int alen, int type, char *buf, int blen)
{
int i;
int l;
- if (alen == 4 &&
- (type == ARPHRD_TUNNEL || type == ARPHRD_SIT || type == ARPHRD_IPGRE)) {
+ if (alen == 4
+ && (type == ARPHRD_TUNNEL || type == ARPHRD_SIT || type == ARPHRD_IPGRE)
+ ) {
return inet_ntop(AF_INET, addr, buf, blen);
}
l = 0;
- for (i=0; i<alen; i++) {
- if (i==0) {
- snprintf(buf+l, blen, ":%02x"+1, addr[i]);
+ for (i = 0; i < alen; i++) {
+ if (i == 0) {
+ snprintf(buf + l, blen, ":%02x"+1, addr[i]);
blen -= 2;
l += 2;
} else {
- snprintf(buf+l, blen, ":%02x", addr[i]);
+ snprintf(buf + l, blen, ":%02x", addr[i]);
blen -= 3;
l += 3;
}
return buf;
}
-int ll_addr_a2n(unsigned char *lladdr, int len, char *arg)
+int FAST_FUNC ll_addr_a2n(unsigned char *lladdr, int len, char *arg)
{
int i;