File: cmdmode.c

package info (click to toggle)
openswan 1%3A2.4.6%2Bdfsg.2-1.1
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 24,996 kB
  • ctags: 16,877
  • sloc: ansic: 121,112; sh: 19,524; xml: 9,699; asm: 4,422; perl: 4,087; makefile: 3,367; tcl: 713; exp: 657; yacc: 396; pascal: 328; lex: 289; sed: 265; awk: 124; lisp: 3
file content (716 lines) | stat: -rw-r--r-- 15,897 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
/*
 * @(#) jig to exercise a UML/FreeSWAN kernel with two interfaces
 *
 * Copyright (C) 2001 Michael Richardson  <mcr@freeswan.org>
 * 
 * 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.  See <http://www.fsf.org/copyleft/gpl.txt>.
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 *
 * RCSID $Id: cmdmode.c,v 1.9 2003/05/05 18:00:06 mcr Exp $
 *
 * @(#) based upon uml_router from User-Mode-Linux tools package
 *
 */

#include <sys/stat.h>
#include <sys/types.h>
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#include <assert.h>
#include <setjmp.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <netinet/in.h>
#include <net/ethernet.h>
#include <net/if_arp.h>
#include <ctype.h>

#define _GNU_SOURCE 1
#include <getopt.h>

#include "pcap.h"
#include <sys/queue.h>

#include "nethub.h"
#include "netjig.h"

/*
 * QUIT
 */
int quitprog(struct netjig_state *ns, int argc, char **argv)
{
  ns->done=1;
  ns->waitplay=1;
  return 0;
}


/*
 * NEWSWITCH --arpreply switch-name 
 */
int create_new_switch(struct netjig_state *ns, int argc, char **argv)
{
	int opt;
	struct nethub *nh;
	int arpreply;
	static struct option long_options[] =
		{
			{"help",        no_argument, 0, 'h'},
			{"arpreply",    no_argument, 0, 'a'},
			{NULL,          0,           0, 0},
		};

	arpreply=0;
	opterr=0;
	optind=1;
	while((opt = getopt_long(argc, argv, "ha",
				 long_options, NULL)) !=  EOF) {
		switch(opt) {
		default:
		case 'h':
			fprintf(ns->cmdproto_out,"FAIL 3 LINES\n");
			goto usage;

		case 'a':
			arpreply++;
			break;
		}
	}

	if(optind+1 != argc) {
		fprintf(ns->cmdproto_out,"FAIL 4 LINES\n");
	usage:
		fprintf(ns->cmdproto_out,"ERROR - missing switchname\n");
			fprintf(ns->cmdproto_out,"NEWSWITCH --arpreply switchname\n"
			       "\tswitchname is name of hub\n"
			       "\treturns environment variables for new sockets\n");
			fflush(stdout);
			return 1;
	}

	nh = init_nethub(ns, argv[optind],
			 NULL, NULL, /* compat_v0 */ 1);
	nh->nh_allarp = arpreply;

	fprintf(ns->cmdproto_out,"OK 3 LINES\n");
	fprintf(ns->cmdproto_out,"ARPREPLY=%d\n", arpreply);
	fprintf(ns->cmdproto_out,"%s\n%s\n", nh->ctl_socket_name_env, nh->data_socket_name_env);
	fflush(ns->cmdproto_out);
	return 0;
}

void nosig(int sig)
{
  fprintf(stderr, "Caught signal %d, cleaning up and exiting\n", sig);
}

/*
 * SETDEBUG value
 */
int setdebug(struct netjig_state *ns, int argc, char **argv)
{
	int newdebug;
	char *foo;
	int opt;
	static struct option long_options[] =
		{
			{"help",        no_argument, 0, 'h'},
			{ NULL,         0, 0, 0},

		};

	opterr=0;
	optind=1;
	while((opt = getopt_long(argc, argv, "h",
				 long_options, NULL)) !=  EOF) {
		switch(opt) {
		default:
			fprintf(ns->cmdproto_out,"FAIL 4 LINES\n");
			fprintf(ns->cmdproto_out, "unknown option %s\n",
				argv[optind]);
			goto usage;
		case 'h':
			fprintf(ns->cmdproto_out,"FAIL 1 LINES\n");
		usage:
			fprintf(ns->cmdproto_out,"debug <num> - sets the debug level\n");
			fflush(stdout);
			return 1;
		}
	}


	if(argc > 1) {
		newdebug=strtol(argv[1], &foo, 0);
		if(optarg==foo) {
			fprintf(ns->cmdproto_out,"FAIL 2 LINES\n");
			fprintf(ns->cmdproto_out,"ERROR - bad value: %s\n",argv[0]);
			goto usage;
		}
		ns->debug = newdebug;
	} else {
			fprintf(ns->cmdproto_out,"OK 1 LINES\n");
			fprintf(ns->cmdproto_out,"debug=%d\n", ns->debug);
			return 0;
	}
		
	return 0;
}


/*
 * SETRATE value
 */
int setrate(struct netjig_state *ns, int argc, char **argv)
{
	int newrate;
	char *foo;
	int opt;
	static struct option long_options[] =
		{
			{"help",        no_argument, 0, 'h'},
			{ NULL,         0, 0, 0},

		};

	opterr=0;
	optind=1;
	while((opt = getopt_long(argc, argv, "h",
				 long_options, NULL)) !=  EOF) {
		switch(opt) {
		default:
			fprintf(ns->cmdproto_out,"FAIL 4 LINES\n");
			fprintf(ns->cmdproto_out, "unknown option %s\n",
				argv[optind]);
			goto usage;
		case 'h':
			fprintf(ns->cmdproto_out,"FAIL 1 LINES\n");
		usage:
			fprintf(ns->cmdproto_out,"setrate <num> - sets the packet replay rate (in ms)\n");
			fflush(stdout);
			return 1;
		}
	}


	if(argc > 1) {
	  newrate=strtol(argv[1], &foo, 0);
	  if(optarg==foo) {
	    fprintf(ns->cmdproto_out,"FAIL 2 LINES\n");
	    fprintf(ns->cmdproto_out,"ERROR - bad value: %s\n",argv[0]);
	    goto usage;
	  } else {
	    ns->packetrate = newrate;
	    fprintf(ns->cmdproto_out,"OK 1 LINES\n");
	    fprintf(ns->cmdproto_out,"packetrate=%d\n", ns->packetrate);
	    return 0;
	  }
	}
		
	return 0;
}

/*
 * SETARP --switchname=foo {--on,--off}
 */
int setarp(struct netjig_state *ns, int argc, char **argv)
{
	int opt;
	struct nethub *nh;
	int arpon;
	char *switchname;
	static struct option long_options[] =
		{
			{"help",        no_argument, 0, 'h'},
			{"switchname",  required_argument, 0, 's'},
			{"on",          no_argument, 0, 'y'},
			{"off",         no_argument, 0, 'n'},
			{ NULL,         0, 0, 0},

		};

	arpon = -1;
	opterr=0;
	optind=1;
	while((opt = getopt_long(argc, argv, "hs:yn",
				 long_options, NULL)) !=  EOF) {
		switch(opt) {
		default:
		  fprintf(ns->cmdproto_out,"FAIL 5 LINES\n");
		  fprintf(ns->cmdproto_out, "unknown option %s\n",
			  argv[optind]);
		  goto usage;
		case 'h':
			fprintf(ns->cmdproto_out,"FAIL 4 LINES\n");
		usage:
			fprintf(ns->cmdproto_out,"RECORDFILE - records a pcap file from an interface.\n"
				"\t--switchname=name   which hub to record\n"
				"\t--on                turn on  ARP replies for the named switch\n"
				"\t--off               turn off ARP replies for the named switch\n"
				);

			fflush(stdout);
			return 1;
		case 's':
			switchname=optarg;
			break;
		case 'y':
			arpon=1;
			break;
		case 'n':
			arpon=0;
			break;
		}
	}

	nh = find_nethubbyname(ns, switchname);
	if(nh==NULL) {  /* not found */
		fprintf(ns->cmdproto_out,"FAIL 1 LINES\n");
		fprintf(ns->cmdproto_out,"ERROR - switch '%s' not found\n", switchname);
		return 2;
	}
	  
	if(arpon == -1) {
		fprintf(ns->cmdproto_out,"OK 1 LINES\n");
		fprintf(ns->cmdproto_out,"switch '%s' ARP state is: %d\n", switchname, nh->nh_allarp);
		return 3;
	}
		
	if(ns->debug) {
	  fprintf(stderr, "%s: switch '%s' setting arp reply to %d\n",
		  progname, nh->nh_name, arpon);
	}

	nh->nh_allarp = arpon;
	fprintf(ns->cmdproto_out,"OK 0 LINES\n");
	fflush(ns->cmdproto_out);
	return 0;
}

/*
 * RECORDFILE --switchname=foo --recordfile=bar 
 */
int recordfile(struct netjig_state *ns, int argc, char **argv)
{
	int opt;
	struct nethub *nh;
	char *recordfilename;
	char *switchname;
	pcap_t *pt;
	static struct option long_options[] =
		{
			{"help",        no_argument, 0, 'h'},
			{"switchname",  required_argument, 0, 's'},
			{"recordfile",  required_argument, 0, 'f'},
			{"file",  required_argument, 0, 'f'},
			{ NULL,         0, 0, 0},

		};

	/*	signal(SIGUSR1, nosig); */
	/*pause(); */

	opterr=0;
	optind=1;
	while((opt = getopt_long(argc, argv, "f:hs:",
				 long_options, NULL)) !=  EOF) {
		switch(opt) {
		default:
		  fprintf(ns->cmdproto_out,"FAIL 4 LINES\n");
		  fprintf(ns->cmdproto_out, "unknown option %s\n",
			  argv[optind]);
		  goto usage;
		case 'h':
			fprintf(ns->cmdproto_out,"FAIL 3 LINES\n");
		usage:
			fprintf(ns->cmdproto_out,"RECORDFILE - records a pcap file from an interface.\n"
				"\t--switchname=name   which hub to record\n"
				"\t--recordfile=file   the pcap file to record\n");

			fflush(stdout);
			return 1;
		case 's':
			switchname=optarg;
			break;
		case 'f':
			recordfilename=optarg;
			break;
		}
	}

	nh = find_nethubbyname(ns, switchname);
	if(nh==NULL) {  /* not found */
	  fprintf(ns->cmdproto_out,"FAIL 1 LINES\n");
	  fprintf(ns->cmdproto_out,"ERROR - switch '%s' not found\n", switchname);
	  return 2;
	}
	  
	if(ns->debug) {
	  fprintf(stderr, "%s: will record %s from '%s' network\n",
		  progname, recordfilename, nh->nh_name);
	}

	pt = pcap_open_dead(DLT_EN10MB, 1536);
	nh->nh_output = pcap_dump_open(pt, recordfilename);

	if(nh->nh_output == NULL) {
	  fprintf(ns->cmdproto_out,"FAIL 1 LINES\n");
	  fprintf(ns->cmdproto_out,"ERROR - recordfile '%s' failed\n", recordfilename);
	  return 3;
	}
	  
	nh->nh_outputFile = strdup(recordfilename);

	fprintf(ns->cmdproto_out,"OK 0 LINES\n");
	fflush(ns->cmdproto_out);
	return 0;
}

/*
 * PLAYFILE --switchname=foo --playfile=bar --rate={#,ontick}
 */
int playfile(struct netjig_state *ns, int argc, char **argv)
{
	int opt;
	struct nethub *nh;
	char errbuf[256];
	int rate;
	char *playfilename;
	char *switchname;
	char *foo;
	static struct option long_options[] =
		{
			{"help",        no_argument, 0, 'h'},
			{"switchname",  required_argument, 0, 's'},
			{"playfile",    required_argument, 0, 'f'},
			{"file",        required_argument, 0, 'f'},
			{"rate",        required_argument, 0, 'r'},
			{ NULL,         0, 0, 0}, 
		};

	opterr=0;
	optind=1;
	while((opt = getopt_long(argc, argv, "f:hr:s:",
				 long_options, NULL)) !=  EOF) {
		switch(opt) {
		default:
			fprintf(ns->cmdproto_out,"FAIL 6 LINES\n");
			fprintf(ns->cmdproto_out, "unknown option %s\n",
				argv[optind]);
			goto usage;
		case 'h':
			fprintf(ns->cmdproto_out,"FAIL 5 LINES\n");
		usage:
			fprintf(ns->cmdproto_out,"PLAYFILE - replays a pcap file out a network.\n"
				"\t--switchname=name   which hub to play through\n"
				"\t--playfile=file     the pcap file to play\n"
				"\t--rate=num/onclick  how many seconds between packets."
				"\t                    \"ontick\" means to play a packet each time the \n"
				"\t                    TICK cmd is invoked\n");
			fflush(stdout);
			return 1;
		case 's':
			switchname=optarg;
			break;
		case 'f':
			playfilename=optarg;
			break;
		case 'r':
		  if(strcasecmp(optarg, "ontick")==0) {
		    rate=-1;
		  } else {
		    rate=strtol(optarg, &foo, 0);
		    if(optarg==foo) {
		      fprintf(ns->cmdproto_out,"FAIL 7 LINES\n");
		      fprintf(ns->cmdproto_out,"ERROR - bad rate: %s\n",optarg);
		      goto usage;
		    }
		  }
		}
	}

	if(switchname==NULL) {
	  goto usage;
	}

	if(playfilename==NULL) {
	  goto usage;
	}

	nh = find_nethubbyname(ns, switchname);
	if(nh==NULL) {  /* not found */
	  fprintf(ns->cmdproto_out,"FAIL 1 LINES\n");
	  fprintf(ns->cmdproto_out,"ERROR - switch '%s' not found\n", switchname);
	  return 2;
	}
	  
	if(ns->debug) {
	  fprintf(stderr, "%s: will play %s to '%s' network\n",
		  progname, playfilename, nh->nh_name);
	}

	nh->nh_input = pcap_open_offline(playfilename, errbuf);
	if(nh->nh_input == NULL) {
	  fprintf(ns->cmdproto_out,"FAIL 1 LINES\n");
	  fprintf(ns->cmdproto_out,"ERROR - playfile '%s': %s\n",
		  playfilename, errbuf);
	  fprintf(stderr, "pcap_open_offline: %s\n", errbuf);
	  return 3;
	}
	  
	nh->nh_inputFile = strdup(playfilename);

	nh->nh_rate = rate;
	
	fprintf(ns->cmdproto_out,"OK 0 LINES\n");
	fflush(ns->cmdproto_out);
	return 0;
}

/*
 * TICK - send a packet
 */
int tickcmd(struct netjig_state *ns, int argc, char **argv)
{
  ns->forcetick=1;
  return 0;
}

/*
 * WAITPLAY --switchname=all
 */
int waitplay(struct netjig_state *ns, int argc, char **argv)
{
	int opt;
	char *switchname;
	static struct option long_options[] =
		{
			{"help",        no_argument, 0, 'h'},
			{"switchname",  required_argument, 0, 's'},
		};

	opterr=0;
	optind=1;
	while((opt = getopt_long(argc, argv, "f:hr:s:",
				 long_options, NULL)) !=  EOF) {
		switch(opt) {
		default:
			fprintf(ns->cmdproto_out, "FAIL 3 LINES\n");
			fprintf(ns->cmdproto_out, "unknown option %s\n",
				argv[optind]);
			goto usage;
		case 'h':
			fprintf(ns->cmdproto_out,"FAIL 2 LINES\n");
		usage:
			fprintf(ns->cmdproto_out,"WAITPLAY - waits for all packets from a given switch to be played.\n"
				"\t--switchname=name   which hub to play through\n");
			fflush(stdout);
			return 1;
		case 's':
			switchname=optarg;
			break;
		}
	}

	ns->waitplay=1;
	return 0;
}

/*
 * CD dir
 */
int dochdir(struct netjig_state *ns, int argc, char **argv)
{
	int opt;
	static struct option long_options[] =
		{
			{"help",        no_argument, 0, 'h'},
		};

	opterr=0;
	optind=1;
	while((opt = getopt_long(argc, argv, "h",
				 long_options, NULL)) !=  EOF) {
		switch(opt) {
		default:
			fprintf(ns->cmdproto_out, "FAIL 3 LINES\n");
			fprintf(ns->cmdproto_out, "unknown option %s\n",
				argv[optind]);
			goto usage;
		case 'h':
			fprintf(ns->cmdproto_out,"FAIL 2 LINES\n");
		usage:
			fprintf(ns->cmdproto_out,"CD <dir> - changes directory\n");
			fflush(stdout);
			return 1;
		}
	}

	if(optind == argc) {
	  /* no arguments! */
	  goto usage;
	}
	
	if(chdir(argv[optind])!=0) {
	  int e;
	  e=errno;
	  fprintf(ns->cmdproto_out,"FAIL 1 LINES\n");
	  fprintf(ns->cmdproto_out,"ERROR - chdir(%s) : %s\n",
		  argv[optind], strerror(e));
	  return 1;
	}
	  
	fprintf(ns->cmdproto_out,"OK 1 LINES\n");
	fprintf(ns->cmdproto_out,"DIR=%s\n",getcwd(NULL, 0));
	return 0;
}

void finish_waitplay(struct netjig_state *ns)
{
  fprintf(ns->cmdproto_out,"OK 0 LINES\n");
  ns->waitplay=0;
  cmdprompt(ns);
}


void cmdprompt(struct netjig_state *ns)
{
	if(ns->cmdlaststat) {
		fprintf(ns->cmdproto_out,"FAIL stat=%d netjig>", ns->cmdlaststat);
	} else {
		fprintf(ns->cmdproto_out,"OK netjig>");
	}
	ns->cmdlaststat=0;
	fflush(stdout);
}

int cmdparse(struct netjig_state *ns,
	     char   *cmdline)
{
	char *argv[256];
	int   argc;
	char *arg;
	static struct cmd_entry {
		const char *cmdname;
		int (*cmdfunc)(struct netjig_state *, int, char **);
	} cmds[]={
		{"newswitch", create_new_switch},
		{"playfile",  playfile},
		{"recordfile",recordfile},
		{"quit",      quitprog},
		{"waitplay",  waitplay},
		{"tick",      tickcmd},
		{"setrate",   setrate},
		{"setarp",    setarp},
		{"debug",     setdebug},
		{"chdir",     dochdir},
		{"cd",        dochdir},
		{NULL,        NULL}};
	struct cmd_entry *ce;

	argc=0;
	while((arg=strsep(&cmdline, " \t\n"))!=NULL) {
	  argv[argc++]=arg;
	  while(cmdline && isspace(*cmdline)) {
	    cmdline++;
	  }
	}
	argv[argc]=NULL;

	if(argc==0 || argv[0][0]=='\0') {
		return 0;
	}

	ce=cmds;
	if(strcasecmp("help", argv[0]) == 0) {
		fprintf(ns->cmdproto_out, "FAIL %d LINES\n",
			(sizeof(cmds)/sizeof(struct cmd_entry))-1);
		while(ce->cmdname != NULL) {
			fprintf(ns->cmdproto_out, "\t%s\n", ce->cmdname);
			ce++;
		}
		ns->cmdlaststat=1;
		cmdprompt(ns);
		return 0;
	}
	
	while(ce->cmdname != NULL) {
		if(strcasecmp(ce->cmdname, argv[0])==0) {
			ns->cmdlaststat=(*ce->cmdfunc)(ns, argc, argv);
			if(!ns->waitplay) {
			  cmdprompt(ns);
			}
			return ns->cmdlaststat;
		}
		ce++;
	}

	if(ce->cmdname==NULL) {
	  ns->cmdlaststat=4;
	  cmdprompt(ns);
	}
	return 0;
}

int cmdread(struct netjig_state *ns,
	     char  *buf,
	     int    len)
{
	char *nl;
	int   cmdlen;

	/* 
	 * have to handle partial reads and multiple commands
	 * per read, since this may in fact be a file or a pipe.
	 */
	if((ns->cmdloc + len) > CMDBUF_LEN-1) {
		fprintf(stderr, "Command is too long, discarding!\n");
		fflush(stdout);
		
		ns->cmdloc=0;
		return 0;
	}
	memcpy(ns->cmdbuf+ns->cmdloc, buf, len);
	ns->cmdloc+=len;
	ns->cmdbuf[ns->cmdloc]='\0';

	while((nl = strchr(ns->cmdbuf, '\n')) != NULL) {
		/* found a newline, so turn it into a \0, and process the
		 * command, and then we will pull the rest of the buffer
		 * up.
		 */
		*nl='\0';
		cmdlen=nl-ns->cmdbuf+1;

		cmdparse(ns, ns->cmdbuf);

		memmove(ns->cmdbuf, ns->cmdbuf+cmdlen, cmdlen);
		ns->cmdloc -= cmdlen;
	}
	return 1;
}

/*
 * $Log
 *
 */

/*
 *
 * Local variables:
 * c-file-style: "linux"
 * c-basic-offset: 2
 * End:
 *
 */