Cosmetics from FreeBSD.

This commit is contained in:
Ralf Corsepius
2009-02-10 08:25:06 +00:00
parent 282e6fd079
commit 0d37bf16e5
2 changed files with 29 additions and 47 deletions

View File

@@ -130,7 +130,7 @@ static int xdr_int_decode(struct mbuf **ptr,int *iptr);
static void printip(char *prefix,struct in_addr addr); static void printip(char *prefix,struct in_addr addr);
#ifdef BOOTP_DEBUG #ifdef BOOTP_DEBUG
void bootpboot_p_sa(struct sockaddr *sa,struct sockaddr *ma); void bootpboot_p_sa(struct sockaddr *sa, struct sockaddr *ma);
void bootpboot_p_ma(struct sockaddr *ma); void bootpboot_p_ma(struct sockaddr *ma);
void bootpboot_p_rtentry(struct rtentry *rt); void bootpboot_p_rtentry(struct rtentry *rt);
void bootpboot_p_tree(struct radix_node *rn); void bootpboot_p_tree(struct radix_node *rn);
@@ -155,11 +155,11 @@ bootpc_adjust_interface(struct ifreq *ireq,struct socket *so,
void bootpc_init(int update_files); void bootpc_init(int update_files);
#ifdef BOOTP_DEBUG #ifdef BOOTP_DEBUG
void bootpboot_p_sa(sa,ma) void
struct sockaddr *sa; bootpboot_p_sa(struct sockaddr *sa, struct sockaddr *ma)
struct sockaddr *ma;
{ {
if (!sa) {
if (sa == NULL) {
printf("(sockaddr *) <null>"); printf("(sockaddr *) <null>");
return; return;
} }
@@ -187,37 +187,41 @@ void bootpboot_p_sa(sa,ma)
} }
break; break;
default: default:
printf("af%d",sa->sa_family); printf("af%d",sa->sa_family);
} }
} }
void bootpboot_p_ma(ma) void
struct sockaddr *ma; bootpboot_p_ma(struct sockaddr *ma)
{ {
if (!ma) {
if (ma == NULL) {
printf("<null>"); printf("<null>");
return; return;
} }
printf("%x",*(int*)ma); printf("%x", *(int*)ma);
} }
void bootpboot_p_rtentry(rt) void
struct rtentry *rt; bootpboot_p_rtentry(struct rtentry *rt)
{ {
bootpboot_p_sa(rt_key(rt),rt_mask(rt));
bootpboot_p_sa(rt_key(rt), rt_mask(rt));
printf(" "); printf(" ");
bootpboot_p_ma(rt->rt_genmask); bootpboot_p_ma(rt->rt_genmask);
printf(" "); printf(" ");
bootpboot_p_sa(rt->rt_gateway,NULL); bootpboot_p_sa(rt->rt_gateway, NULL);
printf(" "); printf(" ");
printf("flags %x",(unsigned short) rt->rt_flags); printf("flags %x", (unsigned short) rt->rt_flags);
printf(" %d",rt->rt_rmx.rmx_expire); printf(" %d", rt->rt_rmx.rmx_expire);
printf(" %s%d\n",rt->rt_ifp->if_name,rt->rt_ifp->if_unit); printf(" %s%d\n", rt->rt_ifp->if_name,rt->rt_ifp->if_unit);
} }
void bootpboot_p_tree(rn)
struct radix_node *rn; void
bootpboot_p_tree(struct radix_node *rn)
{ {
while (rn) {
while (rn != NULL) {
if (rn->rn_b < 0) { if (rn->rn_b < 0) {
if (rn->rn_flags & RNF_ROOT) { if (rn->rn_flags & RNF_ROOT) {
} else { } else {
@@ -233,13 +237,16 @@ void bootpboot_p_tree(rn)
} }
} }
void bootpboot_p_rtlist(void) void
bootpboot_p_rtlist(void)
{ {
printf("Routing table:\n"); printf("Routing table:\n");
bootpboot_p_tree(rt_tables[AF_INET]->rnh_treetop); bootpboot_p_tree(rt_tables[AF_INET]->rnh_treetop);
} }
void bootpboot_p_iflist(void) void
bootpboot_p_iflist(void)
{ {
struct ifnet *ifp; struct ifnet *ifp;
struct ifaddr *ifa; struct ifaddr *ifa;
@@ -705,27 +712,6 @@ getdec(char **ptr)
} }
#endif #endif
#if !defined(__rtems__)
static char *
substr(char *a, char *b)
{
char *loc1;
char *loc2;
while (*a != '\0') {
loc1 = a;
loc2 = b;
while (*loc1 == *loc2++) {
if (*loc1 == '\0') return (0);
loc1++;
if (*loc2 == '\0') return (loc1);
}
a++;
}
return (0);
}
#endif
static void printip(char *prefix,struct in_addr addr) static void printip(char *prefix,struct in_addr addr)
{ {
uint32_t ip; uint32_t ip;

View File

@@ -13,10 +13,6 @@
* 2. Redistributions in binary form must reproduce the above copyright * 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors * 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.