Browse code

TM callbacks, acc, flags

Jiri Kuthan authored on 13/05/2002 01:15:40
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,1110 +0,0 @@
1
-/*
2
- * $Id$
3
- * 
4
- * sip first line parsing automaton
5
- * 
6
- */
7
-
8
-
9
-
10
-#include "dprint.h"
11
-#include "msg_parser.h"
12
-
13
-
14
-/* grammar:
15
-	request  =  method SP uri SP version CRLF
16
-	response =  version SP status  SP reason  CRLF
17
-	(version = "SIP/2.0")
18
-*/
19
-
20
-/*known methods: INVITE, ACK, CANCEL, BYE*/
21
-
22
-enum{ START,
23
-		INVITE1, INVITE2, INVITE3, INVITE4, INVITE5,
24
-		ACK1,    ACK2,
25
-		CANCEL1, CANCEL2, CANCEL3, CANCEL4, CANCEL5,
26
-		BYE1, BYE2,
27
-		SIP1, SIP2, SIP3, SIP4, SIP5, SIP6,
28
-		FIN_INVITE=100, FIN_ACK, FIN_CANCEL, FIN_BYE, FIN_SIP,
29
-		P_METHOD=200, L_URI, P_URI, L_VER, 
30
-		VER1, VER2, VER3, VER4, VER5, VER6, FIN_VER,
31
-		L_STATUS, P_STATUS, L_REASON, P_REASON,
32
-		L_LF, F_CR, F_LF
33
-};
34
-
35
-
36
-
37
-char* parse_fline(char* buffer, char* end, struct msg_start* fl)
38
-{
39
-	char* tmp;
40
-	register int state;
41
-	unsigned short stat;
42
-
43
-	stat=0;
44
-	fl->type=SIP_REQUEST;
45
-	state=START;
46
-	for(tmp=buffer;tmp<end;tmp++){
47
-		switch(*tmp){
48
-			case ' ':
49
-			case '\t':
50
-				switch(state){
51
-					case START: /*allow space at the beginnig, althoug not
52
-								  legal*/
53
-						break;
54
-					case L_URI:
55
-					case L_VER:
56
-					case L_STATUS:
57
-					case L_REASON:
58
-					case L_LF:
59
-						 /*eat  space*/
60
-						break;
61
-					case FIN_INVITE:
62
-						*tmp=0;
63
-						fl->u.request.method.len=tmp-fl->u.request.method.s;
64
-						fl->u.request.method_value=METHOD_INVITE;
65
-						state=L_URI;
66
-						break;
67
-					case FIN_ACK:
68
-						*tmp=0;
69
-						fl->u.request.method.len=tmp-fl->u.request.method.s;
70
-						fl->u.request.method_value=METHOD_ACK;
71
-						state=L_URI;
72
-						break;
73
-					case FIN_CANCEL:
74
-						*tmp=0;
75
-						fl->u.request.method.len=tmp-fl->u.request.method.s;
76
-						fl->u.request.method_value=METHOD_CANCEL;
77
-						state=L_URI;
78
-						break;
79
-					case FIN_BYE:
80
-						*tmp=0;
81
-						fl->u.request.method.len=tmp-fl->u.request.method.s;
82
-						fl->u.request.method_value=METHOD_BYE;
83
-						state=L_URI;
84
-						break;
85
-					case FIN_SIP:
86
-						*tmp=0;
87
-						fl->u.reply.version.len=tmp-fl->u.reply.version.s;
88
-						state=L_STATUS;
89
-						fl->type=SIP_REPLY;
90
-						break;
91
-					case P_URI:
92
-						*tmp=0;
93
-						fl->u.request.uri.len=tmp-fl->u.request.uri.s;
94
-						state=L_VER;
95
-						break;
96
-					case FIN_VER:
97
-						*tmp=0;
98
-						fl->u.request.version.len=tmp-fl->u.request.version.s;
99
-						state=L_LF;
100
-						break;
101
-					case P_STATUS:
102
-						*tmp=0;
103
-						fl->u.reply.status.len=tmp-fl->u.reply.status.s;
104
-						state=L_REASON;
105
-						break;
106
-					case P_REASON:
107
-					 /*	*tmp=0;
108
-						fl->u.reply.reason.len=tmp-fl->u.reply.reason.s;
109
-						*/
110
-						break;
111
-					case VER1:
112
-					case VER2:
113
-					case VER3:
114
-					case VER4:
115
-					case VER5:
116
-					case VER6:
117
-						LOG(L_ERR, "ERROR: parse_first_line: invalid version "
118
-								" in request\n");
119
-						goto error;
120
-					case P_METHOD:
121
-					default:
122
-						*tmp=0;
123
-						fl->u.request.method.len=tmp-fl->u.request.method.s;
124
-						fl->u.request.method_value=METHOD_OTHER;
125
-						state=L_URI;
126
-				}
127
-				break;
128
-			case 's':
129
-			case 'S':
130
-				switch(state){
131
-					case START:
132
-						state=SIP1;
133
-						fl->u.reply.version.s=tmp;
134
-						break;
135
-					case P_URI:
136
-					case P_REASON:
137
-					case P_METHOD:
138
-						break;
139
-					case L_REASON:
140
-						fl->u.reply.reason.s=tmp;
141
-						state=P_REASON;
142
-						break;
143
-					case P_STATUS:
144
-					case L_STATUS:
145
-						LOG(L_ERR, "ERROR: parse_first_line: non-number "
146
-								"character <%c> in request status\n", *tmp);
147
-						goto error;
148
-					case L_LF:
149
-						LOG(L_ERR, "ERROR: parse_first_line: invalid "
150
-								"character <%c> in request\n", *tmp);
151
-						goto error;
152
-					case L_URI:
153
-						fl->u.request.uri.s=tmp;
154
-						state=P_URI;
155
-						break;
156
-					case L_VER:
157
-						fl->u.request.version.s=tmp;
158
-						state=VER1;
159
-						break;
160
-					case VER1:
161
-					case VER2:
162
-					case VER3:
163
-					case VER4:
164
-					case VER5:
165
-					case VER6:
166
-					case FIN_VER:
167
-						LOG(L_ERR, "ERROR: parse_first_line: invalid version "
168
-								" in request\n");
169
-						goto error;
170
-					default:
171
-						state=P_METHOD;
172
-				}
173
-				break;
174
-					
175
-			case 'i':
176
-			case 'I':
177
-				switch(state){
178
-					case START:
179
-						state=INVITE1;
180
-						fl->u.request.method.s=tmp;
181
-						break;
182
-					case INVITE3:
183
-						state=INVITE4;
184
-						break;
185
-					case SIP1:
186
-						state=SIP2;
187
-						break;
188
-					case P_URI:
189
-					case P_REASON:
190
-					case P_METHOD:
191
-						break;
192
-					case L_REASON:
193
-						fl->u.reply.reason.s=tmp;
194
-						state=P_REASON;
195
-						break;
196
-					case P_STATUS:
197
-					case L_STATUS:
198
-						LOG(L_ERR, "ERROR: parse_first_line: non-number "
199
-								"character <%c> in request status\n", *tmp);
200
-						goto error;
201
-					case L_LF:
202
-						LOG(L_ERR, "ERROR: parse_first_line: invalid "
203
-								"character <%c> in request\n", *tmp);
204
-						goto error;
205
-					case L_URI:
206
-						fl->u.request.uri.s=tmp;
207
-						state=P_URI;
208
-						break;
209
-					case VER1:
210
-						state=VER2;
211
-						break;
212
-					case L_VER:
213
-					case VER2:
214
-					case VER3:
215
-					case VER4:
216
-					case VER5:
217
-					case VER6:
218
-					case FIN_VER:
219
-						LOG(L_ERR, "ERROR: parse_first_line: invalid version "
220
-								" in request\n");
221
-						goto error;
222
-					default:
223
-						state=P_METHOD;
224
-				}
225
-				break;
226
-				
227
-			case 'p':
228
-			case 'P':
229
-				switch(state){
230
-					case START:
231
-						state=P_METHOD;
232
-						fl->u.request.method.s=tmp;
233
-						break;
234
-					case SIP2:
235
-						state=SIP3;
236
-						break;
237
-					case P_URI:
238
-					case P_REASON:
239
-					case P_METHOD:
240
-						break;
241
-					case L_REASON:
242
-						fl->u.reply.reason.s=tmp;
243
-						state=P_REASON;
244
-						break;
245
-					case P_STATUS:
246
-					case L_STATUS:
247
-						LOG(L_ERR, "ERROR: parse_first_line: non-number "
248
-								"character <%c> in request status\n", *tmp);
249
-						goto error;
250
-					case L_LF:
251
-						LOG(L_ERR, "ERROR: parse_first_line: invalid "
252
-								"character <%c> in request\n", *tmp);
253
-						goto error;
254
-					case L_URI:
255
-						fl->u.request.uri.s=tmp;
256
-						state=P_URI;
257
-						break;
258
-					case VER2:
259
-						state=VER3;
260
-						break;
261
-					case L_VER:
262
-					case VER1:
263
-					case VER3:
264
-					case VER4:
265
-					case VER5:
266
-					case VER6:
267
-					case FIN_VER:
268
-						LOG(L_ERR, "ERROR: parse_first_line: invalid version "
269
-								" in request\n");
270
-						goto error;
271
-					default:
272
-						state=P_METHOD;
273
-				}
274
-				break;
275
-
276
-			
277
-			case '/':
278
-				switch(state){
279
-					case START:
280
-						state=P_METHOD;
281
-						fl->u.request.method.s=tmp;
282
-						break;
283
-					case SIP3:
284
-						state=SIP4;
285
-						break;
286
-					case P_URI:
287
-					case P_REASON:
288
-					case P_METHOD:
289
-						break;
290
-					case L_REASON:
291
-						fl->u.reply.reason.s=tmp;
292
-						state=P_REASON;
293
-						break;
294
-					case P_STATUS:
295
-					case L_STATUS:
296
-						LOG(L_ERR, "ERROR: parse_first_line: non-number "
297
-								"character <%c> in request status\n", *tmp);
298
-						goto error;
299
-					case L_LF:
300
-						LOG(L_ERR, "ERROR: parse_first_line: invalid "
301
-								"character <%c> in request\n", *tmp);
302
-						goto error;
303
-					case L_URI:
304
-						fl->u.request.uri.s=tmp;
305
-						state=P_URI;
306
-						break;
307
-					case VER3:
308
-						state=VER4;
309
-						break;
310
-					case L_VER:
311
-					case VER1:
312
-					case VER2:
313
-					case VER4:
314
-					case VER5:
315
-					case VER6:
316
-					case FIN_VER:
317
-						LOG(L_ERR, "ERROR: parse_first_line: invalid version "
318
-								" in request\n");
319
-						goto error;
320
-					default:
321
-						state=P_METHOD;
322
-				}
323
-				break;
324
-			
325
-			case '2':
326
-				switch(state){
327
-					case START:
328
-						state=P_METHOD;
329
-						fl->u.request.method.s=tmp;
330
-						break;
331
-					case SIP4:
332
-						state=SIP5;
333
-						break;
334
-					case P_URI:
335
-					case P_REASON:
336
-					case P_METHOD:
337
-						break;
338
-					case L_REASON:
339
-						fl->u.reply.reason.s=tmp;
340
-						state=P_REASON;
341
-						break;
342
-					case P_STATUS:
343
-						stat=stat*10+*tmp-'0';
344
-						break;
345
-					case L_STATUS:
346
-						stat=*tmp-'0';
347
-						fl->u.reply.status.s=tmp;
348
-						break;
349
-					case L_LF:
350
-						LOG(L_ERR, "ERROR: parse_first_line: invalid "
351
-								"character <%c> in request\n", *tmp);
352
-						goto error;
353
-					case L_URI:
354
-						fl->u.request.uri.s=tmp;
355
-						state=P_URI;
356
-						break;
357
-					case VER4:
358
-						state=VER5;
359
-						break;
360
-					case L_VER:
361
-					case VER1:
362
-					case VER2:
363
-					case VER3:
364
-					case VER5:
365
-					case VER6:
366
-					case FIN_VER:
367
-						LOG(L_ERR, "ERROR: parse_first_line: invalid version "
368
-								" in request\n");
369
-						goto error;
370
-					default:
371
-						state=P_METHOD;
372
-				}
373
-				break;
374
-			
375
-			case '.':
376
-				switch(state){
377
-					case START:
378
-						state=P_METHOD;
379
-						fl->u.request.method.s=tmp;
380
-						break;
381
-					case SIP5:
382
-						state=SIP6;
383
-						break;
384
-					case P_URI:
385
-					case P_REASON:
386
-					case P_METHOD:
387
-						break;
388
-					case L_REASON:
389
-						fl->u.reply.reason.s=tmp;
390
-						state=P_REASON;
391
-						break;
392
-					case P_STATUS:
393
-					case L_STATUS:
394
-						LOG(L_ERR, "ERROR: parse_first_line: non-number "
395
-								"character <%c> in request status\n", *tmp);
396
-						goto error;
397
-					case L_LF:
398
-						LOG(L_ERR, "ERROR: parse_first_line: invalid "
399
-								"character <%c> in request\n", *tmp);
400
-						goto error;
401
-					case L_URI:
402
-						fl->u.request.uri.s=tmp;
403
-						state=P_URI;
404
-						break;
405
-					case VER5:
406
-						state=VER6;
407
-						break;
408
-					case L_VER:
409
-					case VER1:
410
-					case VER2:
411
-					case VER3:
412
-					case VER4:
413
-					case VER6:
414
-					case FIN_VER:
415
-						LOG(L_ERR, "ERROR: parse_first_line: invalid version "
416
-								" in request\n");
417
-						goto error;
418
-					default:
419
-						state=P_METHOD;
420
-				}
421
-				break;
422
-			
423
-			case '0':
424
-				switch(state){
425
-					case START:
426
-						state=P_METHOD;
427
-						fl->u.request.method.s=tmp;
428
-						break;
429
-					case SIP6:
430
-						state=FIN_SIP;
431
-						break;
432
-					case P_URI:
433
-					case P_REASON:
434
-					case P_METHOD:
435
-						break;
436
-					case L_REASON:
437
-						fl->u.reply.reason.s=tmp;
438
-						state=P_REASON;
439
-						break;
440
-					case P_STATUS:
441
-						stat=stat*10;
442
-						break;
443
-					case L_STATUS:
444
-						stat=0;
445
-						fl->u.reply.status.s=tmp;
446
-						break;
447
-					case L_LF:
448
-						LOG(L_ERR, "ERROR: parse_first_line: invalid "
449
-								"character <%c> in request\n", *tmp);
450
-						goto error;
451
-					case L_URI:
452
-						fl->u.request.uri.s=tmp;
453
-						state=P_URI;
454
-						break;
455
-					case VER6:
456
-						state=FIN_VER;
457
-						break;
458
-					case L_VER:
459
-					case VER1:
460
-					case VER2:
461
-					case VER3:
462
-					case VER4:
463
-					case VER5:
464
-					case FIN_VER:
465
-						LOG(L_ERR, "ERROR: parse_first_line: invalid version "
466
-								" in request\n");
467
-						goto error;
468
-					default:
469
-						state=P_METHOD;
470
-				}
471
-				break;
472
-			
473
-			case 'n':
474
-			case 'N':
475
-				switch(state){
476
-					case START:
477
-						state=P_METHOD;
478
-						fl->u.request.method.s=tmp;
479
-						break;
480
-					case INVITE1:
481
-						state=INVITE2;
482
-						break;
483
-					case CANCEL2:
484
-						state=CANCEL3;
485
-						break;
486
-					case P_URI:
487
-					case P_REASON:
488
-					case P_METHOD:
489
-						break;
490
-					case L_REASON:
491
-						fl->u.reply.reason.s=tmp;
492
-						state=P_REASON;
493
-						break;
494
-					case P_STATUS:
495
-					case L_STATUS:
496
-						LOG(L_ERR, "ERROR: parse_first_line: non-number "
497
-								"character <%c> in request status\n", *tmp);
498
-						goto error;
499
-					case L_LF:
500
-						LOG(L_ERR, "ERROR: parse_first_line: invalid "
501
-								"character <%c> in request\n", *tmp);
502
-						goto error;
503
-					case L_URI:
504
-						fl->u.request.uri.s=tmp;
505
-						state=P_URI;
506
-						break;
507
-					case L_VER:
508
-					case VER1:
509
-					case VER2:
510
-					case VER3:
511
-					case VER4:
512
-					case VER5:
513
-					case VER6:
514
-					case FIN_VER:
515
-						LOG(L_ERR, "ERROR: parse_first_line: invalid version "
516
-								" in request\n");
517
-						goto error;
518
-					default:
519
-						state=P_METHOD;
520
-				}
521
-				break;
522
-
523
-			case 'v':
524
-			case 'V':
525
-				switch(state){
526
-					case START:
527
-						state=P_METHOD;
528
-						fl->u.request.method.s=tmp;
529
-						break;
530
-					case INVITE2:
531
-						state=INVITE3;
532
-						break;
533
-					case P_URI:
534
-					case P_REASON:
535
-					case P_METHOD:
536
-						break;
537
-					case L_REASON:
538
-						fl->u.reply.reason.s=tmp;
539
-						state=P_REASON;
540
-						break;
541
-					case P_STATUS:
542
-					case L_STATUS:
543
-						LOG(L_ERR, "ERROR: parse_first_line: non-number "
544
-								"character <%c> in request status\n", *tmp);
545
-						goto error;
546
-					case L_LF:
547
-						LOG(L_ERR, "ERROR: parse_first_line: invalid "
548
-								"character <%c> in request\n", *tmp);
549
-						goto error;
550
-					case L_URI:
551
-						fl->u.request.uri.s=tmp;
552
-						state=P_URI;
553
-						break;
554
-					case L_VER:
555
-					case VER1:
556
-					case VER2:
557
-					case VER3:
558
-					case VER4:
559
-					case VER5:
560
-					case VER6:
561
-					case FIN_VER:
562
-						LOG(L_ERR, "ERROR: parse_first_line: invalid version "
563
-								" in request\n");
564
-						goto error;
565
-					default:
566
-						state=P_METHOD;
567
-				}
568
-				break;
569
-
570
-			case 't':
571
-			case 'T':
572
-				switch(state){
573
-					case START:
574
-						state=P_METHOD;
575
-						fl->u.request.method.s=tmp;
576
-						break;
577
-					case INVITE4:
578
-						state=INVITE5;
579
-						break;
580
-					case P_URI:
581
-					case P_REASON:
582
-					case P_METHOD:
583
-						break;
584
-					case L_REASON:
585
-						fl->u.reply.reason.s=tmp;
586
-						state=P_REASON;
587
-						break;
588
-					case P_STATUS:
589
-					case L_STATUS:
590
-						LOG(L_ERR, "ERROR: parse_first_line: non-number "
591
-								"character <%c> in request status\n", *tmp);
592
-						goto error;
593
-					case L_LF:
594
-						LOG(L_ERR, "ERROR: parse_first_line: invalid "
595
-								"character <%c> in request\n", *tmp);
596
-						goto error;
597
-					case L_URI:
598
-						fl->u.request.uri.s=tmp;
599
-						state=P_URI;
600
-						break;
601
-					case L_VER:
602
-					case VER1:
603
-					case VER2:
604
-					case VER3:
605
-					case VER4:
606
-					case VER5:
607
-					case VER6:
608
-					case FIN_VER:
609
-						LOG(L_ERR, "ERROR: parse_first_line: invalid version "
610
-								" in request\n");
611
-						goto error;
612
-					default:
613
-						state=P_METHOD;
614
-				}
615
-				break;
616
-
617
-			case 'e':
618
-			case 'E':
619
-				switch(state){
620
-					case START:
621
-						state=P_METHOD;
622
-						fl->u.request.method.s=tmp;
623
-						break;
624
-					case INVITE5:
625
-						state=FIN_INVITE;
626
-						break;
627
-					case CANCEL4:
628
-						state=CANCEL5;
629
-						break;
630
-					case BYE2:
631
-						state=FIN_BYE;
632
-						break;
633
-					case P_URI:
634
-					case P_REASON:
635
-					case P_METHOD:
636
-						break;
637
-					case L_REASON:
638
-						fl->u.reply.reason.s=tmp;
639
-						state=P_REASON;
640
-						break;
641
-					case P_STATUS:
642
-					case L_STATUS:
643
-						LOG(L_ERR, "ERROR: parse_first_line: non-number "
644
-								"character <%c> in request status\n", *tmp);
645
-						goto error;
646
-					case L_LF:
647
-						LOG(L_ERR, "ERROR: parse_first_line: invalid "
648
-								"character <%c> in request\n", *tmp);
649
-						goto error;
650
-					case L_URI:
651
-						fl->u.request.uri.s=tmp;
652
-						state=P_URI;
653
-						break;
654
-					case L_VER:
655
-					case VER1:
656
-					case VER2:
657
-					case VER3:
658
-					case VER4:
659
-					case VER5:
660
-					case VER6:
661
-					case FIN_VER:
662
-						LOG(L_ERR, "ERROR: parse_first_line: invalid version "
663
-								" in request\n");
664
-						goto error;
665
-					default:
666
-						state=P_METHOD;
667
-				}
668
-				break;
669
-
670
-			case 'a':
671
-			case 'A':
672
-				switch(state){
673
-					case START:
674
-						state=ACK1;
675
-						fl->u.request.method.s=tmp;
676
-						break;
677
-					case CANCEL1:
678
-						state=CANCEL2;
679
-						break;
680
-					case BYE2:
681
-						state=FIN_BYE;
682
-						break;
683
-					case P_URI:
684
-					case P_REASON:
685
-					case P_METHOD:
686
-						break;
687
-					case L_REASON:
688
-						fl->u.reply.reason.s=tmp;
689
-						state=P_REASON;
690
-						break;
691
-					case P_STATUS:
692
-					case L_STATUS:
693
-						LOG(L_ERR, "ERROR: parse_first_line: non-number "
694
-								"character <%c> in request status\n", *tmp);
695
-						goto error;
696
-					case L_LF:
697
-						LOG(L_ERR, "ERROR: parse_first_line: invalid "
698
-								"character <%c> in request\n", *tmp);
699
-						goto error;
700
-					case L_URI:
701
-						fl->u.request.uri.s=tmp;
702
-						state=P_URI;
703
-						break;
704
-					case L_VER:
705
-					case VER1:
706
-					case VER2:
707
-					case VER3:
708
-					case VER4:
709
-					case VER5:
710
-					case VER6:
711
-					case FIN_VER:
712
-						LOG(L_ERR, "ERROR: parse_first_line: invalid version "
713
-								" in request\n");
714
-						goto error;
715
-					default:
716
-						state=P_METHOD;
717
-				}
718
-				break;
719
-
720
-			case 'c':
721
-			case 'C':
722
-				switch(state){
723
-					case START:
724
-						state=CANCEL1;
725
-						fl->u.request.method.s=tmp;
726
-						break;
727
-					case CANCEL3:
728
-						state=CANCEL4;
729
-						break;
730
-					case ACK1:
731
-						state=ACK2;
732
-						break;
733
-					case P_URI:
734
-					case P_REASON:
735
-					case P_METHOD:
736
-						break;
737
-					case L_REASON:
738
-						fl->u.reply.reason.s=tmp;
739
-						state=P_REASON;
740
-						break;
741
-					case P_STATUS:
742
-					case L_STATUS:
743
-						LOG(L_ERR, "ERROR: parse_first_line: non-number "
744
-								"character <%c> in request status\n", *tmp);
745
-						goto error;
746
-					case L_LF:
747
-						LOG(L_ERR, "ERROR: parse_first_line: invalid "
748
-								"character <%c> in request\n", *tmp);
749
-						goto error;
750
-					case L_URI:
751
-						fl->u.request.uri.s=tmp;
752
-						state=P_URI;
753
-						break;
754
-					case L_VER:
755
-					case VER1:
756
-					case VER2:
757
-					case VER3:
758
-					case VER4:
759
-					case VER5:
760
-					case VER6:
761
-					case FIN_VER:
762
-						LOG(L_ERR, "ERROR: parse_first_line: invalid version "
763
-								" in request\n");
764
-						goto error;
765
-					default:
766
-						state=P_METHOD;
767
-				}
768
-				break;
769
-
770
-			case 'k':
771
-			case 'K':
772
-				switch(state){
773
-					case START:
774
-						state=P_METHOD;
775
-						fl->u.request.method.s=tmp;
776
-						break;
777
-					case ACK2:
778
-						state=FIN_ACK;
779
-						break;
780
-					case P_URI:
781
-					case P_REASON:
782
-					case P_METHOD:
783
-						break;
784
-					case L_REASON:
785
-						fl->u.reply.reason.s=tmp;
786
-						state=P_REASON;
787
-						break;
788
-					case P_STATUS:
789
-					case L_STATUS:
790
-						LOG(L_ERR, "ERROR: parse_first_line: non-number "
791
-								"character <%c> in request status\n", *tmp);
792
-						goto error;
793
-					case L_LF:
794
-						LOG(L_ERR, "ERROR: parse_first_line: invalid "
795
-								"character <%c> in request\n", *tmp);
796
-						goto error;
797
-					case L_URI:
798
-						fl->u.request.uri.s=tmp;
799
-						state=P_URI;
800
-						break;
801
-					case L_VER:
802
-					case VER1:
803
-					case VER2:
804
-					case VER3:
805
-					case VER4:
806
-					case VER5:
807
-					case VER6:
808
-					case FIN_VER:
809
-						LOG(L_ERR, "ERROR: parse_first_line: invalid version "
810
-								" in request\n");
811
-						goto error;
812
-					default:
813
-						state=P_METHOD;
814
-				}
815
-				break;
816
-
817
-			case 'l':
818
-			case 'L':
819
-				switch(state){
820
-					case START:
821
-						state=P_METHOD;
822
-						fl->u.request.method.s=tmp;
823
-						break;
824
-					case CANCEL5:
825
-						state=FIN_CANCEL;
826
-						break;
827
-					case P_URI:
828
-					case P_REASON:
829
-					case P_METHOD:
830
-						break;
831
-					case L_REASON:
832
-						fl->u.reply.reason.s=tmp;
833
-						state=P_REASON;
834
-						break;
835
-					case P_STATUS:
836
-					case L_STATUS:
837
-						LOG(L_ERR, "ERROR: parse_first_line: non-number "
838
-								"character <%c> in request status\n", *tmp);
839
-						goto error;
840
-					case L_LF:
841
-						LOG(L_ERR, "ERROR: parse_first_line: invalid "
842
-								"character <%c> in request\n", *tmp);
843
-						goto error;
844
-					case L_URI:
845
-						fl->u.request.uri.s=tmp;
846
-						state=P_URI;
847
-						break;
848
-					case L_VER:
849
-					case VER1:
850
-					case VER2:
851
-					case VER3:
852
-					case VER4:
853
-					case VER5:
854
-					case VER6:
855
-					case FIN_VER:
856
-						LOG(L_ERR, "ERROR: parse_first_line: invalid version "
857
-								" in request\n");
858
-						goto error;
859
-					default:
860
-						state=P_METHOD;
861
-				}
862
-				break;
863
-
864
-			case 'b':
865
-			case 'B':
866
-				switch(state){
867
-					case START:
868
-						state=BYE1;
869
-						fl->u.request.method.s=tmp;
870
-						break;
871
-					case P_URI:
872
-					case P_REASON:
873
-					case P_METHOD:
874
-						break;
875
-					case L_REASON:
876
-						fl->u.reply.reason.s=tmp;
877
-						state=P_REASON;
878
-						break;
879
-					case P_STATUS:
880
-					case L_STATUS:
881
-						LOG(L_ERR, "ERROR: parse_first_line: non-number "
882
-								"character <%c> in request status\n", *tmp);
883
-						goto error;
884
-					case L_LF:
885
-						LOG(L_ERR, "ERROR: parse_first_line: invalid "
886
-								"character <%c> in request\n", *tmp);
887
-						goto error;
888
-					case L_URI:
889
-						fl->u.request.uri.s=tmp;
890
-						state=P_URI;
891
-						break;
892
-					case L_VER:
893
-					case VER1:
894
-					case VER2:
895
-					case VER3:
896
-					case VER4:
897
-					case VER5:
898
-					case VER6:
899
-					case FIN_VER:
900
-						LOG(L_ERR, "ERROR: parse_first_line: invalid version "
901
-								" in request\n");
902
-						goto error;
903
-					default:
904
-						state=P_METHOD;
905
-				}
906
-				break;
907
-
908
-			case 'y':
909