aboutsummaryrefslogtreecommitdiff
path: root/route.c
diff options
context:
space:
mode:
Diffstat (limited to 'route.c')
-rw-r--r--route.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/route.c b/route.c
index 83a0be2d2..3fad81a01 100644
--- a/route.c
+++ b/route.c
@@ -15,7 +15,7 @@
15 * Foundation; either version 2 of the License, or (at 15 * Foundation; either version 2 of the License, or (at
16 * your option) any later version. 16 * your option) any later version.
17 * 17 *
18 * $Id: route.c,v 1.2 2001/02/14 19:26:39 andersen Exp $ 18 * $Id: route.c,v 1.3 2001/02/14 21:23:06 andersen Exp $
19 * 19 *
20 * displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru> 20 * displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru>
21 */ 21 */
@@ -115,7 +115,7 @@ INET_setroute(int action, int options, char **args)
115 args++; 115 args++;
116 } 116 }
117 if (*args == NULL) 117 if (*args == NULL)
118 usage(route_usage); 118 show_usage();
119 119
120 safe_strncpy(target, *args++, (sizeof target)); 120 safe_strncpy(target, *args++, (sizeof target));
121 121
@@ -152,7 +152,7 @@ INET_setroute(int action, int options, char **args)
152 152
153 args++; 153 args++;
154 if (!*args || !isdigit(**args)) 154 if (!*args || !isdigit(**args))
155 usage(route_usage); 155 show_usage();
156 metric = atoi(*args); 156 metric = atoi(*args);
157#if HAVE_NEW_ADDRT 157#if HAVE_NEW_ADDRT
158 rt.rt_metric = metric + 1; 158 rt.rt_metric = metric + 1;
@@ -168,7 +168,7 @@ INET_setroute(int action, int options, char **args)
168 168
169 args++; 169 args++;
170 if (!*args || mask_in_addr(rt)) 170 if (!*args || mask_in_addr(rt))
171 usage(route_usage); 171 show_usage();
172 safe_strncpy(netmask, *args, (sizeof netmask)); 172 safe_strncpy(netmask, *args, (sizeof netmask));
173 if ((isnet = INET_resolve(netmask, &mask)) < 0) { 173 if ((isnet = INET_resolve(netmask, &mask)) < 0) {
174 fprintf(stderr, "cant resolve netmask %s\n", netmask); 174 fprintf(stderr, "cant resolve netmask %s\n", netmask);
@@ -182,9 +182,9 @@ INET_setroute(int action, int options, char **args)
182 if (!strcmp(*args, "gw") || !strcmp(*args, "gateway")) { 182 if (!strcmp(*args, "gw") || !strcmp(*args, "gateway")) {
183 args++; 183 args++;
184 if (!*args) 184 if (!*args)
185 usage(route_usage); 185 show_usage();
186 if (rt.rt_flags & RTF_GATEWAY) 186 if (rt.rt_flags & RTF_GATEWAY)
187 usage(route_usage); 187 show_usage();
188 safe_strncpy(gateway, *args, (sizeof gateway)); 188 safe_strncpy(gateway, *args, (sizeof gateway));
189 if ((isnet = INET_resolve(gateway, &rt.rt_gateway)) < 0) { 189 if ((isnet = INET_resolve(gateway, &rt.rt_gateway)) < 0) {
190 fprintf(stderr, "cant resolve gw %s\n", gateway); 190 fprintf(stderr, "cant resolve gw %s\n", gateway);
@@ -205,7 +205,7 @@ INET_setroute(int action, int options, char **args)
205 args++; 205 args++;
206 rt.rt_flags |= RTF_MSS; 206 rt.rt_flags |= RTF_MSS;
207 if (!*args) 207 if (!*args)
208 usage(route_usage); 208 show_usage();
209 rt.rt_mss = atoi(*args); 209 rt.rt_mss = atoi(*args);
210 args++; 210 args++;
211 if (rt.rt_mss < 64 || rt.rt_mss > 32768) { 211 if (rt.rt_mss < 64 || rt.rt_mss > 32768) {
@@ -218,7 +218,7 @@ INET_setroute(int action, int options, char **args)
218 if (!strcmp(*args, "window")) { 218 if (!strcmp(*args, "window")) {
219 args++; 219 args++;
220 if (!*args) 220 if (!*args)
221 usage(route_usage); 221 show_usage();
222 rt.rt_flags |= RTF_WINDOW; 222 rt.rt_flags |= RTF_WINDOW;
223 rt.rt_window = atoi(*args); 223 rt.rt_window = atoi(*args);
224 args++; 224 args++;
@@ -232,7 +232,7 @@ INET_setroute(int action, int options, char **args)
232 if (!strcmp(*args, "irtt")) { 232 if (!strcmp(*args, "irtt")) {
233 args++; 233 args++;
234 if (!*args) 234 if (!*args)
235 usage(route_usage); 235 show_usage();
236 args++; 236 args++;
237#if HAVE_RTF_IRTT 237#if HAVE_RTF_IRTT
238 rt.rt_flags |= RTF_IRTT; 238 rt.rt_flags |= RTF_IRTT;
@@ -277,7 +277,7 @@ INET_setroute(int action, int options, char **args)
277 if (!strcmp(*args, "device") || !strcmp(*args, "dev")) { 277 if (!strcmp(*args, "device") || !strcmp(*args, "dev")) {
278 args++; 278 args++;
279 if (rt.rt_dev || *args == NULL) 279 if (rt.rt_dev || *args == NULL)
280 usage(route_usage); 280 show_usage();
281 rt.rt_dev = *args++; 281 rt.rt_dev = *args++;
282 continue; 282 continue;
283 } 283 }
@@ -285,9 +285,9 @@ INET_setroute(int action, int options, char **args)
285 if (!rt.rt_dev) { 285 if (!rt.rt_dev) {
286 rt.rt_dev = *args++; 286 rt.rt_dev = *args++;
287 if (*args) 287 if (*args)
288 usage(route_usage); /* must be last to catch typos */ 288 show_usage(); /* must be last to catch typos */
289 } else 289 } else
290 usage(route_usage); 290 show_usage();
291 } 291 }
292 292
293#if HAVE_RTF_REJECT 293#if HAVE_RTF_REJECT
@@ -420,7 +420,7 @@ int route_main(int argc, char **argv)
420 else if (!strcmp(*argv, "flush")) 420 else if (!strcmp(*argv, "flush"))
421 what = RTACTION_FLUSH; 421 what = RTACTION_FLUSH;
422 else 422 else
423 usage(route_usage); 423 show_usage();
424 } 424 }
425 425
426 INET_setroute(what, 0, ++argv); 426 INET_setroute(what, 0, ++argv);