summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rtadvd/dump.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/rtadvd/dump.c')
-rw-r--r--usr.sbin/rtadvd/dump.c47
1 files changed, 21 insertions, 26 deletions
diff --git a/usr.sbin/rtadvd/dump.c b/usr.sbin/rtadvd/dump.c
index b6d2298..796ba90 100644
--- a/usr.sbin/rtadvd/dump.c
+++ b/usr.sbin/rtadvd/dump.c
@@ -90,10 +90,8 @@ ether_str(sdl)
cp = (u_char *)LLADDR(sdl);
sprintf(ebuf, "%x:%x:%x:%x:%x:%x",
cp[0], cp[1], cp[2], cp[3], cp[4], cp[5]);
- }
- else {
+ } else
sprintf(ebuf, "NONE");
- }
return(ebuf);
}
@@ -119,11 +117,11 @@ if_dump()
if (rai->lastsent.tv_sec) {
/* note that ctime() appends CR by itself */
fprintf(fp, " Last RA sent: %s",
- ctime((time_t *)&rai->lastsent.tv_sec));
+ ctime((time_t *)&rai->lastsent.tv_sec));
}
if (rai->timer) {
fprintf(fp, " Next RA will be sent: %s",
- ctime((time_t *)&rai->timer->tm.tv_sec));
+ ctime((time_t *)&rai->timer->tm.tv_sec));
}
else
fprintf(fp, " RA timer is stopped");
@@ -131,32 +129,30 @@ if_dump()
rai->waiting, rai->initcounter);
/* statistics */
- fprintf(fp,
- " statistics: RA(out/in/inconsistent): "
- LONGLONG "/" LONGLONG "/" LONGLONG ", ",
- (unsigned long long)rai->raoutput,
- (unsigned long long)rai->rainput,
- (unsigned long long)rai->rainconsistent);
+ fprintf(fp, " statistics: RA(out/in/inconsistent): "
+ LONGLONG "/" LONGLONG "/" LONGLONG ", ",
+ (unsigned long long)rai->raoutput,
+ (unsigned long long)rai->rainput,
+ (unsigned long long)rai->rainconsistent);
fprintf(fp, "RS(input): " LONGLONG "\n",
- (unsigned long long)rai->rsinput);
+ (unsigned long long)rai->rsinput);
/* interface information */
if (rai->advlinkopt)
fprintf(fp, " Link-layer address: %s\n",
- ether_str(rai->sdl));
+ ether_str(rai->sdl));
fprintf(fp, " MTU: %d\n", rai->phymtu);
/* Router configuration variables */
- fprintf(fp,
- " DefaultLifetime: %d, MaxAdvInterval: %d, "
- "MinAdvInterval: %d\n",
- rai->lifetime, rai->maxinterval, rai->mininterval);
+ fprintf(fp, " DefaultLifetime: %d, MaxAdvInterval: %d, "
+ "MinAdvInterval: %d\n", rai->lifetime, rai->maxinterval,
+ rai->mininterval);
fprintf(fp, " Flags: %s%s%s, ",
- rai->managedflg ? "M" : "", rai->otherflg ? "O" : "",
+ rai->managedflg ? "M" : "", rai->otherflg ? "O" : "",
#ifdef MIP6
- rai->haflg ? "H" :
+ rai->haflg ? "H" :
#endif
- "");
+ "");
fprintf(fp, "Preference: %s, ",
rtpref_str[(rai->rtpref >> 3) & 0xff]);
fprintf(fp, "MTU: %d\n", rai->linkmtu);
@@ -170,7 +166,7 @@ if_dump()
if (rai->clockskew)
fprintf(fp, " Clock skew: %ldsec\n",
- rai->clockskew);
+ rai->clockskew);
for (first = 1, pfx = rai->prefix.next; pfx != &rai->prefix;
pfx = pfx->next) {
if (first) {
@@ -178,10 +174,9 @@ if_dump()
first = 0;
}
fprintf(fp, " %s/%d(",
- inet_ntop(AF_INET6, &pfx->prefix,
- prefixbuf, sizeof(prefixbuf)),
- pfx->prefixlen);
- switch(pfx->origin) {
+ inet_ntop(AF_INET6, &pfx->prefix, prefixbuf,
+ sizeof(prefixbuf)), pfx->prefixlen);
+ switch (pfx->origin) {
case PREFIX_FROM_KERNEL:
fprintf(fp, "KERNEL, ");
break;
@@ -241,7 +236,7 @@ rtadvd_dump_file(dumpfile)
{
if ((fp = fopen(dumpfile, "w")) == NULL) {
syslog(LOG_WARNING, "<%s> open a dump file(%s)",
- __func__, dumpfile);
+ __func__, dumpfile);
return;
}
OpenPOWER on IntegriCloud