* Foundation; either version 2 of the License, or (at
* your option) any later version.
*
- * $Id: route.c,v 1.7 2001/02/20 06:14:08 andersen Exp $
+ * $Id: route.c,v 1.10 2001/03/21 07:34:26 andersen Exp $
*
* displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru>
- * busybox style adjustments by Larry Doolittle <LRDoolittle@lbl.gov>
- * displayroute() format now matches net-tools-1.57/lib/inet_gr.c line 173.
+ * adjustments by Larry Doolittle <LRDoolittle@lbl.gov>
*/
#include <sys/types.h>
static int
INET_resolve(char *name, struct sockaddr *sa)
{
- struct sockaddr_in *sin = (struct sockaddr_in *)sa;
+ struct sockaddr_in *s_in = (struct sockaddr_in *)sa;
- sin->sin_family = AF_INET;
- sin->sin_port = 0;
+ s_in->sin_family = AF_INET;
+ s_in->sin_port = 0;
/* Default is special, meaning 0.0.0.0. */
if (strcmp(name, "default")==0) {
- sin->sin_addr.s_addr = INADDR_ANY;
+ s_in->sin_addr.s_addr = INADDR_ANY;
return 1;
}
/* Look to see if it's a dotted quad. */
- if (inet_aton(name, &sin->sin_addr)) {
+ if (inet_aton(name, &s_in->sin_addr)) {
return 0;
}
/* guess not.. */
return EXIT_SUCCESS;
}
-void displayroutes(void)
+static void displayroutes(void)
{
char buff[256];
int nl = 0 ;
inet_ntoa(dest)));
strcpy(sgw, (gw.s_addr==0 ? "*" :
inet_ntoa(gw)));
- printf("%-15s %-15s %-15s %-5s %-6d %-2d %7d %s\n",
+ printf("%-16s%-16s%-16s%-6s%-6d %-2d %7d %s\n",
sdest, sgw,
inet_ntoa(mask),
flags, metric, ref, use, buff);
if (*argv == NULL) {
displayroutes();
- exit(EXIT_SUCCESS);
+ return EXIT_SUCCESS;
} else {
/* check verb */
if (strcmp(*argv, "add")==0)