Browse code

core, lib, modules: restructured source code tree

- new folder src/ to hold the source code for main project applications
- main.c is in src/
- all core files are subfolder are in src/core/
- modules are in src/modules/
- libs are in src/lib/
- application Makefiles are in src/
- application binary is built in src/ (src/kamailio)

Daniel-Constantin Mierla authored on 07/12/2016 11:03:51
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,2798 +0,0 @@
1
-/*
2
- * via parsing automaton
3
- * 
4
- * Copyright (C) 2001-2003 FhG Fokus
5
- *
6
- * This file is part of Kamailio, a free SIP server.
7
- *
8
- * Kamailio is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation; either version 2 of the License, or
11
- * (at your option) any later version
12
- *
13
- * Kamailio is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License 
19
- * along with this program; if not, write to the Free Software 
20
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21
- */
22
-
23
-/** @file
24
- * @brief Parser :: Via parsing automation
25
- *
26
- * @ingroup parser
27
- */
28
-
29
-#include "../comp_defs.h"
30
-#include <stdlib.h>
31
-#include <string.h>
32
-#include "../dprint.h"
33
-#include "../ut.h"
34
-#include "../mem/mem.h"
35
-#include "../ip_addr.h"
36
-#include "parse_via.h"
37
-#include "parse_def.h"
38
-#include "msg_parser.h"
39
-
40
-
41
-
42
-/** \brief main via states (uri:port ...) */
43
-enum {	         
44
-	F_HOST, P_HOST,
45
-	L_PORT, F_PORT, P_PORT,
46
-	L_PARAM, F_PARAM, P_PARAM,
47
-	L_VIA, F_VIA,
48
-	F_COMMENT, P_COMMENT,
49
-	F_IP6HOST, P_IP6HOST, 
50
-	F_CRLF,
51
-	F_LF,
52
-	F_CR,
53
-	END_OF_HEADER
54
-};
55
-
56
-
57
-/** \brief first via part state */
58
-enum {
59
-	F_SIP = 100,
60
-	SIP1, SIP2, FIN_SIP,
61
-	L_VER, F_VER,
62
-	VER1, VER2, FIN_VER,
63
-	UDP1, UDP2, FIN_UDP,
64
-	TCP_TLS1, TCP2, FIN_TCP,
65
-	          TLS2, FIN_TLS,
66
-	SCTP1, SCTP2, SCTP3, FIN_SCTP,
67
-	WS_WSS1, WS_WSS2, FIN_WSS,
68
-	OTHER_PROTO,
69
-	L_PROTO, F_PROTO
70
-};
71
-
72
-
73
-/** \brief param related states
74
- * WARNING: keep in sync with parse_via.h, PARAM_HIDDEN, ...
75
- */
76
-enum {	
77
-	L_VALUE = 200, F_VALUE, P_VALUE, P_STRING,
78
-	HIDDEN1, HIDDEN2, HIDDEN3, HIDDEN4, HIDDEN5,
79
-	TTL1, TTL2,
80
-	BRANCH1, BRANCH2, BRANCH3, BRANCH4, BRANCH5,
81
-	MADDR1, MADDR2, MADDR3, MADDR4,
82
-	RECEIVED1, RECEIVED2, RECEIVED3, RECEIVED4, RECEIVED5, RECEIVED6,
83
-	RECEIVED7,
84
-	RPORT1, RPORT2, RPORT3,
85
-	ALIAS1, ALIAS2, ALIAS3, ALIAS4,
86
-#ifdef USE_COMP
87
-	COMP1, COMP2, COMP3, 
88
-	/* values */
89
-	L_COMP_VALUE, F_COMP_VALUE,
90
-	V_COMP_S, V_SIGCOMP_I, V_SIGCOMP_G, V_SIGCOMP_C, V_SIGCOMP_O, V_SIGCOMP_M,
91
-	FIN_V_SIGCOMP_P,
92
-	V_SERGZ_E, V_SERGZ_R, V_SERGZ_G, FIN_V_SERGZ_Z,
93
-#endif
94
-	     /* fin states (227-...)*/
95
-	FIN_HIDDEN = 230, FIN_TTL, FIN_BRANCH,
96
-	FIN_MADDR, FIN_RECEIVED, FIN_RPORT, FIN_I, FIN_ALIAS
97
-#ifdef USE_COMP
98
-	, FIN_COMP
99
-#endif
100
-	     /*GEN_PARAM,
101
-	       PARAM_ERROR*/ /* declared in msg_parser.h*/
102
-};
103
-
104
-
105
-/* entry state must be F_PARAM, or saved_state=F_PARAM and
106
- * state=F_{LF,CR,CRLF}!
107
- * output state = L_PARAM or F_PARAM or END_OF_HEADER
108
- * (and saved_state= last state); everything else => error 
109
- * WARNING: param->start must be filled before, it's used in param->size 
110
- * computation.
111
- */
112
-static /*inline*/ char* parse_via_param(char* const p, const char* const end,
113
-									unsigned char* const pstate, 
114
-				    					unsigned char* const psaved_state,
115
-									struct via_param* const param,
116
-									const struct via_body* vb)
117
-{
118
-	char* tmp;
119
-	register unsigned char state;
120
-	unsigned char saved_state;
121
-
122
-#define value_case(c, C, oldstate, newstate, start_of_value) \
123
-			case (c): \
124
-			case (C): \
125
-				switch(state){ \
126
-					case (oldstate): \
127
-						state=(newstate); \
128
-						if ((start_of_value))  param->value.s=tmp; \
129
-						break; \
130
-					default_value_cases \
131
-				} \
132
-				break
133
-
134
-#define value_case_double(c, C, oldstate1, newstate1, oldstate2, newstate2) \
135
-			case (c): \
136
-			case (C): \
137
-				switch(state){ \
138
-					case (oldstate1): \
139
-						state=(newstate1); \
140
-						break; \
141
-					case (oldstate2): \
142
-						state=(newstate2); \
143
-						break; \
144
-					default_value_cases \
145
-				} \
146
-				break
147
-
148
-#define default_value_cases \
149
-					case F_VALUE: \
150
-						state=P_VALUE; \
151
-						param->value.s=tmp; \
152
-						break; \
153
-					case P_VALUE: \
154
-					case P_STRING: \
155
-						break; \
156
-					case F_LF: \
157
-					case F_CR:  \
158
-					case F_CRLF: \
159
-						state=END_OF_HEADER; \
160
-						goto end_via; \
161
-					default: \
162
-						switch(state){ \
163
-							case F_COMP_VALUE: \
164
-								comp_unexpected_char; \
165
-								state=P_VALUE; \
166
-								param->value.s=tmp; \
167
-								break; \
168
-							comp_states_cases \
169
-							comp_fin_states_cases \
170
-								comp_unexpected_char; \
171
-								state=P_VALUE; \
172
-								break; \
173
-							default: \
174
-								LOG(L_ERR, "ERROR: parse_via_param: invalid " \
175
-									"char <%c> in state %d\n", *tmp, state); \
176
-								goto error; \
177
-						}
178
-
179
-#define comp_states_cases \
180
-					case V_COMP_S: \
181
-					case V_SIGCOMP_I: \
182
-					case V_SIGCOMP_G: \
183
-					case V_SIGCOMP_C: \
184
-					case V_SIGCOMP_O: \
185
-					case V_SIGCOMP_M: \
186
-					case V_SERGZ_E: \
187
-					case V_SERGZ_R: \
188
-					case V_SERGZ_G: 
189
-
190
-#define comp_fin_states_cases \
191
-					case FIN_V_SIGCOMP_P: \
192
-					case FIN_V_SERGZ_Z:
193
-
194
-
195
-/* if unrecognized/bad comp, don't return error, just ignore comp */
196
-#define comp_unexpected_char \
197
-							LOG(L_ERR, "parse_via_param: bad/unrecognized" \
198
-									" comp method\n"); \
199
-							vb->comp_no=0
200
-								
201
-
202
-
203
-	state=*pstate;
204
-	saved_state=*psaved_state;
205
-	param->type=PARAM_ERROR;
206
-
207
-	for (tmp=p;tmp<end;tmp++){
208
-		switch(*tmp){
209
-			case ' ':
210
-			case '\t':
211
-				switch(state){
212
-					case FIN_HIDDEN:
213
-					case FIN_ALIAS:
214
-						param->type=state;
215
-						param->name.len=tmp-param->name.s;
216
-						state=L_PARAM;
217
-						goto endofparam;
218
-					case FIN_BRANCH:
219
-					case FIN_TTL:
220
-					case FIN_MADDR:
221
-					case FIN_RECEIVED:
222
-					case FIN_RPORT:
223
-					case FIN_I:
224
-						param->type=state;
225
-						param->name.len=tmp-param->name.s;
226
-						state=L_VALUE;
227
-						goto find_value;
228
-#ifdef USE_COMP
229
-					case FIN_COMP:
230
-						param->type=state;
231
-						param->name.len=tmp-param->name.s;
232
-						state=L_COMP_VALUE;
233
-						goto find_value;
234
-#endif
235
-					case F_PARAM:
236
-						break;
237
-					case F_LF:
238
-					case F_CR:
239
-					case F_CRLF:
240
-						state=saved_state;
241
-						break;
242
-					case GEN_PARAM:
243
-					default:
244
-						param->type=GEN_PARAM;
245
-						param->name.len=tmp-param->name.s;
246
-						state=L_VALUE;
247
-						goto find_value;
248
-				}
249
-				break;
250
-			/* \n and \r*/
251
-			case '\n':
252
-				switch(state){
253
-					case FIN_HIDDEN:
254
-					case FIN_ALIAS:
255
-						param->type=state;
256
-						param->name.len=tmp-param->name.s;
257
-						param->size=tmp-param->start; 
258
-						saved_state=L_PARAM;
259
-						state=F_LF;
260
-						goto endofparam;
261
-					case FIN_BRANCH:
262
-					case FIN_TTL:
263
-					case FIN_MADDR:
264
-					case FIN_RECEIVED:
265
-					case FIN_I:
266
-					case FIN_RPORT:
267
-						param->type=state;
268
-						param->name.len=tmp-param->name.s;
269
-						param->size=tmp-param->start; 
270
-						saved_state=L_VALUE;
271
-						state=F_LF;
272
-						goto find_value;
273
-#ifdef USE_COMP
274
-					case FIN_COMP:
275
-						param->type=state;
276
-						param->name.len=tmp-param->name.s;
277
-						param->size=tmp-param->start; 
278
-						saved_state=L_COMP_VALUE;
279
-						state=F_LF;
280
-						goto find_value;
281
-#endif
282
-					case F_PARAM:
283
-						saved_state=state;
284
-						state=F_LF;
285
-						break;
286
-					case F_LF:
287
-					case F_CRLF:
288
-						state=END_OF_HEADER;
289
-						goto end_via;
290
-					case F_CR:
291
-						state=F_CRLF;
292
-						break;
293
-					case GEN_PARAM:
294
-					default:
295
-						param->type=GEN_PARAM;
296
-						saved_state=L_VALUE;
297
-						param->name.len=tmp-param->name.s;
298
-						param->size=tmp-param->start; 
299
-						state=F_LF;
300
-						goto find_value;
301
-				}
302
-				break;
303
-			case '\r':
304
-				switch(state){
305
-					case FIN_HIDDEN:
306
-					case FIN_ALIAS:
307
-						param->type=state;
308
-						param->name.len=tmp-param->name.s;
309
-						param->size=tmp-param->start; 
310
-						saved_state=L_PARAM;
311
-						state=F_CR;
312
-						goto endofparam;
313
-					case FIN_BRANCH:
314
-					case FIN_TTL:
315
-					case FIN_MADDR:
316
-					case FIN_RECEIVED:
317
-					case FIN_I:
318
-					case FIN_RPORT:
319
-						param->type=state;
320
-						param->name.len=tmp-param->name.s;
321
-						param->size=tmp-param->start; 
322
-						saved_state=L_VALUE;
323
-						state=F_CR;
324
-						goto find_value;
325
-#ifdef USE_COMP
326
-					case FIN_COMP:
327
-						param->type=state;
328
-						param->name.len=tmp-param->name.s;
329
-						param->size=tmp-param->start; 
330
-						saved_state=L_COMP_VALUE;
331
-						state=F_LF;
332
-						goto find_value;
333
-#endif
334
-					case F_PARAM:
335
-						saved_state=state;
336
-						state=F_CR;
337
-						break;
338
-					case F_CR:
339
-					case F_CRLF:
340
-						state=END_OF_HEADER;
341
-						goto end_via;
342
-					case GEN_PARAM:
343
-					default:
344
-						param->type=GEN_PARAM;
345
-						param->name.len=tmp-param->name.s;
346
-						param->size=tmp-param->start; 
347
-						saved_state=L_VALUE;
348
-						state=F_CR;
349
-						goto find_value;
350
-				}
351
-				break;
352
-
353
-			case '=':
354
-				switch(state){
355
-					case FIN_BRANCH:
356
-					case FIN_TTL:
357
-					case FIN_MADDR:
358
-					case FIN_RECEIVED:
359
-					case FIN_RPORT:
360
-					case FIN_I:
361
-						param->type=state;
362
-						param->name.len=tmp-param->name.s;
363
-						state=F_VALUE;
364
-						goto find_value;
365
-#ifdef USE_COMP
366
-					case FIN_COMP:
367
-						param->type=state;
368
-						param->name.len=tmp-param->name.s;
369
-						state=F_COMP_VALUE;
370
-						goto find_value;
371
-#endif
372
-					case F_PARAM:
373
-					case FIN_HIDDEN:
374
-					case FIN_ALIAS:
375
-						LOG(L_ERR, "ERROR: parse_via: invalid char <%c> in"
376
-								" state %d\n", *tmp, state);
377
-						goto error;
378
-					case F_CR:
379
-					case F_LF:
380
-					case F_CRLF:
381
-						state=END_OF_HEADER;
382
-						goto end_via;
383
-					case GEN_PARAM:
384
-					default:
385
-						param->type=GEN_PARAM;
386
-						param->name.len=tmp-param->name.s;
387
-						state=F_VALUE;
388
-						goto find_value;
389
-				}
390
-				break;
391
-			case ';':
392
-				switch(state){
393
-					case FIN_HIDDEN:
394
-					case FIN_RPORT: /* rport can appear w/o a value */
395
-					case FIN_ALIAS:
396
-						param->type=state;
397
-						param->name.len=tmp-param->name.s;
398
-						state=F_PARAM;
399
-						goto endofparam;
400
-					case FIN_BRANCH:
401
-					case FIN_MADDR:
402
-					case FIN_TTL:
403
-					case FIN_RECEIVED:
404
-					case FIN_I:
405
-#ifdef USE_COMP
406
-					case FIN_COMP:
407
-#endif
408
-						LOG(L_ERR, "ERROR: parse_via: invalid char <%c> in"
409
-								" state %d\n", *tmp, state);
410
-						goto error;
411
-					case F_CR:
412
-					case F_LF:
413
-					case F_CRLF:
414
-						state=END_OF_HEADER;
415
-						goto end_via;
416
-					case GEN_PARAM:
417
-					default:
418
-						param->type=GEN_PARAM;
419
-						param->name.len=tmp-param->name.s;
420
-						state=F_PARAM;
421
-						goto endofparam;
422
-				}
423
-				break;
424
-			case ',':
425
-				switch(state){
426
-					case FIN_HIDDEN:
427
-					case FIN_RPORT:
428
-					case FIN_ALIAS:
429
-						param->type=state;
430
-						param->name.len=tmp-param->name.s;
431
-						state=F_VIA;
432
-						goto endofvalue;
433
-					case FIN_BRANCH:
434
-					case FIN_MADDR:
435
-					case FIN_TTL:
436
-					case FIN_RECEIVED:
437
-					case FIN_I:
438
-#ifdef USE_COMP
439
-					case FIN_COMP:
440
-#endif
441
-						LOG(L_ERR, "ERROR: parse_via_param: new via found" 
442
-								"(',') when '=' expected (state %d=)\n",
443
-								state);
444
-						goto error; /* or we could ignore this bad param*/
445
-					case F_CR:
446
-					case F_LF:
447
-					case F_CRLF:
448
-						state=END_OF_HEADER;
449
-						goto end_via;
450
-					case GEN_PARAM:
451
-					default:
452
-						param->type=GEN_PARAM;
453
-						param->name.len=tmp-param->name.s;
454
-						state=F_VIA;
455
-						goto endofvalue;
456
-				}
457
-				break; 
458
-
459
-				/* param names */
460
-			case 'h':
461
-			case 'H':
462
-				switch(state){
463
-					case F_PARAM:
464
-						state=HIDDEN1;
465
-						param->name.s=tmp;
466
-						break;
467
-					case BRANCH5:
468
-						state=FIN_BRANCH;
469
-						break;
470
-					case GEN_PARAM:
471
-						break;
472
-					case F_CR:
473
-					case F_LF:
474
-					case F_CRLF:
475
-						state=END_OF_HEADER;
476
-						goto end_via;
477
-					default:
478
-						state=GEN_PARAM;
479
-				}
480
-				break;
481
-			case 'i':
482
-			case 'I':
483
-				switch(state){
484
-					case F_PARAM:
485
-						state=FIN_I;
486
-						param->name.s=tmp;
487
-						break;
488
-					case HIDDEN1:
489
-						state=HIDDEN2;
490
-						break;
491
-					case RECEIVED4:
492
-						state=RECEIVED5;
493
-						break;
494
-					case ALIAS2:
495
-						state=ALIAS3;
496
-						break;
497
-					case GEN_PARAM:
498
-						break;
499
-					case F_CR:
500
-					case F_LF:
501
-					case F_CRLF:
502
-						state=END_OF_HEADER;
503
-						goto end_via;
504
-					default:
505
-						state=GEN_PARAM;
506
-				}
507
-				break;
508
-			case 'd':
509
-			case 'D':
510
-				switch(state){
511
-					case F_PARAM:
512
-						state=GEN_PARAM;
513
-						param->name.s=tmp;
514
-						break;
515
-					case HIDDEN2:
516
-						state=HIDDEN3;
517
-						break;
518
-					case HIDDEN3:
519
-						state=HIDDEN4;
520
-						break;
521
-					case MADDR2:
522
-						state=MADDR3;
523
-						break;
524
-					case MADDR3:
525
-						state=MADDR4;
526
-						break;
527
-					case RECEIVED7:
528
-						state=FIN_RECEIVED;
529
-						break;
530
-					case GEN_PARAM:
531
-						break;
532
-					case F_CR:
533
-					case F_LF:
534
-					case F_CRLF:
535
-						state=END_OF_HEADER;
536
-						goto end_via;
537
-					default:
538
-						state=GEN_PARAM;
539
-				}
540
-				break;
541
-			case 'e':
542
-			case 'E':
543
-				switch(state){
544
-					case F_PARAM:
545
-						state=GEN_PARAM;
546
-						param->name.s=tmp;
547
-						break;
548
-					case HIDDEN4:
549
-						state=HIDDEN5;
550
-						break;
551
-					case RECEIVED1:
552
-						state=RECEIVED2;
553
-						break;
554
-					case RECEIVED3:
555
-						state=RECEIVED4;
556
-						break;
557
-					case RECEIVED6:
558
-						state=RECEIVED7;
559
-						break;
560
-					case GEN_PARAM:
561
-						break;
562
-					case F_CR:
563
-					case F_LF:
564
-					case F_CRLF:
565
-						state=END_OF_HEADER;
566
-						goto end_via;
567
-					default:
568
-						state=GEN_PARAM;
569
-				}
570
-				break;
571
-			case 'n':
572
-			case 'N':
573
-				switch(state){
574
-					case F_PARAM:
575
-						state=GEN_PARAM;
576
-						param->name.s=tmp;
577
-						break;
578
-					case HIDDEN5:
579
-						state=FIN_HIDDEN;
580
-						break;
581
-					case BRANCH3:
582
-						state=BRANCH4;
583
-						break;
584
-					case GEN_PARAM:
585
-						break;
586
-					case F_CR:
587
-					case F_LF:
588
-					case F_CRLF:
589
-						state=END_OF_HEADER;
590
-						goto end_via;
591
-					default:
592
-						state=GEN_PARAM;
593
-				}
594
-				break;
595
-			case 't':
596
-			case 'T':
597
-				switch(state){
598
-					case F_PARAM:
599
-						state=TTL1;
600
-						param->name.s=tmp;
601
-						break;
602
-					case TTL1:
603
-						state=TTL2;
604
-						break;
605
-					case RPORT3:
606
-						state=FIN_RPORT;
607
-						break;
608
-					case GEN_PARAM:
609
-						break;
610
-					case F_CR:
611
-					case F_LF:
612
-					case F_CRLF:
613
-						state=END_OF_HEADER;
614
-						goto end_via;
615
-					default:
616
-						state=GEN_PARAM;
617
-				}
618
-				break;
619
-			case 'l':
620
-			case 'L':
621
-				switch(state){
622
-					case F_PARAM:
623
-						state=GEN_PARAM;
624
-						param->name.s=tmp;
625
-						break;
626
-					case TTL2:
627
-						state=FIN_TTL;
628
-						break;
629
-					case ALIAS1:
630
-						state=ALIAS2;
631
-						break;
632
-					case GEN_PARAM:
633
-						break;
634
-					case F_CR:
635
-					case F_LF:
636
-					case F_CRLF:
637
-						state=END_OF_HEADER;
638
-						goto end_via;
639
-					default:
640
-						state=GEN_PARAM;
641
-				}
642
-				break;
643
-			case 'm':
644
-			case 'M':
645
-				switch(state){
646
-					case F_PARAM:
647
-						state=MADDR1;
648
-						param->name.s=tmp;
649
-						break;
650
-#ifdef USE_COMP
651
-					case COMP2:
652
-						state=COMP3;
653
-						break;
654
-#endif
655
-					case GEN_PARAM:
656
-						break;
657
-					case F_CR:
658
-					case F_LF:
659
-					case F_CRLF:
660
-						state=END_OF_HEADER;
661
-						goto end_via;
662
-					default:
663
-						state=GEN_PARAM;
664
-				}
665
-				break;
666
-			case 'a':
667
-			case 'A':
668
-				switch(state){
669
-					case F_PARAM:
670
-						state=ALIAS1;
671
-						param->name.s=tmp;
672
-						break;
673
-					case MADDR1:
674
-						state=MADDR2;
675
-						break;
676
-					case BRANCH2:
677
-						state=BRANCH3;
678
-						break;
679
-					case ALIAS3:
680
-						state=ALIAS4;
681
-						break;
682
-					case GEN_PARAM:
683
-						break;
684
-					case F_CR:
685
-					case F_LF:
686
-					case F_CRLF:
687
-						state=END_OF_HEADER;
688
-						goto end_via;
689
-					default:
690
-						state=GEN_PARAM;
691
-				}
692
-				break;
693
-			case 'r':
694
-			case 'R':
695
-				switch(state){
696
-					case MADDR4:
697
-						state=FIN_MADDR;
698
-						break;
699
-					case F_PARAM:
700
-						state=RECEIVED1;
701
-						param->name.s=tmp;
702
-						break;
703
-					case BRANCH1:
704
-						state=BRANCH2;
705
-						break;
706
-					case RPORT2:
707
-						state=RPORT3;
708
-						break;
709
-					case GEN_PARAM:
710
-						break;
711
-					case F_CR:
712
-					case F_LF:
713
-					case F_CRLF:
714
-						state=END_OF_HEADER;
715
-						goto end_via;
716
-					default:
717
-						state=GEN_PARAM;
718
-				}
719
-				break;
720
-			case 'c':
721
-			case 'C':
722
-				switch(state){
723
-					case F_PARAM:
724
-#ifdef USE_COMP
725
-						state=COMP1;
726
-#else
727
-						state=GEN_PARAM;
728
-#endif
729
-						param->name.s=tmp;
730
-						break;
731
-					case RECEIVED2:
732
-						state=RECEIVED3;
733
-						break;
734
-					case BRANCH4:
735
-						state=BRANCH5;
736
-						break;
737
-					case GEN_PARAM:
738
-						break;
739
-					case F_CR:
740
-					case F_LF:
741
-					case F_CRLF:
742
-						state=END_OF_HEADER;
743
-						goto end_via;
744
-					default:
745
-						state=GEN_PARAM;
746
-				}
747
-				break;
748
-			case 'v':
749
-			case 'V':
750
-				switch(state){
751
-					case F_PARAM:
752
-						state=GEN_PARAM;
753
-						param->name.s=tmp;
754
-						break;
755
-					case RECEIVED5:
756
-						state=RECEIVED6;
757
-						break;
758
-					case GEN_PARAM:
759
-						break;
760
-					case F_CR:
761
-					case F_LF:
762
-					case F_CRLF:
763
-						state=END_OF_HEADER;
764
-						goto end_via;
765
-					default:
766
-						state=GEN_PARAM;
767
-				}
768
-				break;
769
-			case 'b':
770
-			case 'B':
771
-				switch(state){
772
-					case F_PARAM:
773
-						state=BRANCH1;
774
-						param->name.s=tmp;
775
-						break;
776
-					case GEN_PARAM:
777
-						break;
778
-					case F_CR:
779
-					case F_LF:
780
-					case F_CRLF:
781
-						state=END_OF_HEADER;
782
-						goto end_via;
783
-					default:
784
-						state=GEN_PARAM;
785
-				}
786
-				break;
787
-			case 'p':
788
-			case 'P':
789
-				switch(state){
790
-					case F_PARAM:
791
-						state=GEN_PARAM;
792
-						param->name.s=tmp;
793
-						break;
794
-					case RECEIVED1:
795
-						state=RPORT1;
796
-						break;
797
-#ifdef USE_COMP
798
-					case COMP3:
799
-						state=FIN_COMP;
800
-						break;
801
-#endif
802
-					case F_CR:
803
-					case F_LF:
804
-					case F_CRLF:
805
-						state=END_OF_HEADER;
806
-						goto end_via;
807
-					default:
808
-						state=GEN_PARAM;
809
-				}
810
-				break;
811
-			case 'o':
812
-			case 'O':
813
-				switch(state){
814
-					case F_PARAM:
815
-						state=GEN_PARAM;
816
-						param->name.s=tmp;
817
-						break;
818
-					case RPORT1:
819
-						state=RPORT2;
820
-						break;
821
-#ifdef USE_COMP
822
-					case COMP1:
823
-						state=COMP2;
824
-						break;
825
-#endif
826
-					case F_CR:
827
-					case F_LF:
828
-					case F_CRLF:
829
-						state=END_OF_HEADER;
830
-						goto end_via;
831
-					default:
832
-						state=GEN_PARAM;
833
-				}
834
-				break;
835
-			case 's':
836
-			case 'S':
837
-				switch(state){
838
-					case F_PARAM:
839
-						state=GEN_PARAM;
840
-						param->name.s=tmp;
841
-						break;
842
-					case ALIAS4:
843
-						state=FIN_ALIAS;
844
-						break;
845
-					case F_CR:
846
-					case F_LF:
847
-					case F_CRLF:
848
-						state=END_OF_HEADER;
849
-						goto end_via;
850
-					default:
851
-						state=GEN_PARAM;
852
-				}
853
-				break;
854
-			default:
855
-				switch(state){
856
-					case F_PARAM:
857
-						state=GEN_PARAM;
858
-						param->name.s=tmp;
859
-						break;
860
-					case GEN_PARAM:
861
-						break;
862
-					case F_CR:
863
-					case F_LF:
864
-					case F_CRLF:
865
-						state=END_OF_HEADER;
866
-						goto end_via;
867
-					default:
868
-						state=GEN_PARAM;
869
-				}
870
-		}
871
-	}/* for tmp*/
872
-
873
-	/* end of packet? => error, no cr/lf,',' found!!!*/
874
-	saved_state=state;
875
-	state=END_OF_HEADER;
876
-	goto error;
877
-	
878
- find_value:
879
-	tmp++;
880
-	for(;*tmp;tmp++){
881
-		switch(*tmp){
882
-			case ' ':
883
-			case '\t':
884
-				switch(state){
885
-					case L_VALUE:
886
-					case F_VALUE: /*eat space*/
887
-						break; 
888
-					case P_VALUE:
889
-						state=L_PARAM;
890
-						param->value.len=tmp-param->value.s;
891
-						goto endofvalue;
892
-#ifdef USE_COMP
893
-					case L_COMP_VALUE:
894
-					case F_COMP_VALUE:
895
-						break; /* eat space */
896
-					case FIN_V_SIGCOMP_P:
897
-						state=L_PARAM;
898
-						param->value.len=tmp-param->value.s;
899
-						vb->comp_no=COMP_SIGCOMP;
900
-						goto endofvalue;
901
-					case FIN_V_SERGZ_Z:
902
-						state=L_PARAM;
903
-						param->value.len=tmp-param->value.s;
904
-						vb->comp_no=COMP_SIGCOMP;
905
-						goto endofvalue;
906
-					comp_states_cases
907
-						state=L_PARAM;
908
-						param->value.len=tmp-param->value.s;
909
-						comp_unexpected_char;