%{ /****************************************************************************** * Copyright (c) 2000-2023 Ericsson Telecom AB * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * * Contributors: * Gabor Szalai - initial implementation and initial documentation * Gergely Futo * Laszlo Skumat * Pinter Norbert * Oliver Ferenc Czerman * Peter Balazs * Koppány Csaba Béla * Kulcsár Endre * Szalai Zsolt ******************************************************************************/ // // File: SIP_parse.l // Rev: R17B // Prodnr: CNL 113 319 // Reference: RFC3261, RFC2806, RFC2976, RFC3262, RFC3311, RFC3323, // RFC3325, RFC3326, RFC3265, RFC3455, RFC4244, RFC4538, // RFC6442, RFC6086, RFC6050 // IETF Draft draft-ietf-dip-session-timer-15.txt, // IETF Draft draft-levy-sip-diversion-08.txt, RFC5009 // IETF draft-ott-sip-serv-indication-notification-00 // IETF draft-holmberg-sipcore-proxy-feature-04, // #include #include #include #include "SIP_parse.h" //needed for re-definition of YY_INPUT !! #include "SIPmsg_Types.hh" #include "SIP_parse_.tab.h" #include "memory.h" using namespace SIPmsg__Types; // Message pointers extern RequestLine *rqlineptr; extern StatusLine *stlineptr; extern MessageHeader *headerptr; extern PDU__SIP *msgptr; extern int wildcarded_enabled_parser; static const MessageHeader emptyheaders=MessageHeader( OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE, OMIT_VALUE ); // header part pointers SipUrl *uriptr=NULL; GenericParam__List *paramptr=NULL; OptionTag__List *optptr=NULL; RouteBody__List *routeptr=NULL; // parameter counters int paramcount; int urlparamcount; int headercount; int optioncount; int rcount; // header counters int acceptcount; int aceptenccount; int acceptlangcount; int alertinfcount; int allowcount; int callinfocount; int contactcount; int contentenccount; int contentlangcount; int errorinfocount; int featureCapscount; int inreplytocount; int passertedidcount; int ppreferredidcount; int privacycount; int proxyreqcount; int reasoncount; int recroutecount; int recvinfocount; int routecount; int reqcount; int suppcount; int unsuppcount; int servercount; int useragentcount; int viacount; int warncount; int undefcount; int erro_handling_sip_parser; int aos_count; extern char comment_buf[1500]; int num_chars = 0; int pos_in_buf = 0; int kovall =0; int level=0; int paramptrused=0; void initcounters(); char* strupr(char* str); char * stream_buffer; // EPTEBAL void dump(char* buf, int len) { for (int i=0; i{OLDCRLF}+ num_chars+=SIP_parse_leng; {METHOD} { num_chars+=SIP_parse_leng; BEGIN(requriver); SIP_parse_lval.sv = stream_buffer; pos_in_buf=SIP_parse_leng+3; strcpy(SIP_parse_lval.sv,strupr(SIP_parse_text)); //dump(stream_buffer, 20); SIP_parse_lval.sv[SIP_parse_leng]='_';SIP_parse_lval.sv[SIP_parse_leng+1]='E';SIP_parse_lval.sv[SIP_parse_leng+2]='\0'; if(msgptr){ headerptr = &(msgptr->request().msgHeader()); *headerptr=emptyheaders; rqlineptr=&(msgptr->request().requestLine()); } else { rqlineptr = new RequestLine; } /*initcounters();*/ return _METHOD;} {SPHTVER} { num_chars+=SIP_parse_leng; BEGIN(statuscode); SIP_parse_lval.sv = stream_buffer; pos_in_buf=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv, SIP_parse_text); //dump(stream_buffer, 20); if(msgptr){ headerptr = &(msgptr->response().msgHeader()); *headerptr=emptyheaders; stlineptr=&(msgptr->response().statusLine()); } else { stlineptr=new StatusLine; } /*initcounters();*/ return SIP_SPHT_VERSION;} {VER} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return SIP_VERSION; // New style num_chars+=SIP_parse_leng; //SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); //printf("SIP_VERSION: %d, %p, %s, %s\n", pos_in_buf, stream_buffer, stream_buffer, SIP_parse_lval.sv); return SIP_VERSION;} {TOKEN}{COLON} {//num_chars+=SIP_parse_leng; if(strcasecmp(SIP_parse_text,"tel:")){BEGIN(uriwithparamusrtel);} else {BEGIN(uriwithparamhstprt);} kovall=requriver; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); SIP_parse_lval.sv[SIP_parse_leng-1]='\0'; return SCHEME; // New style num_chars+=SIP_parse_leng; if(!strcasecmp(SIP_parse_text,"urn:")){ BEGIN(urn); } else if(strcasecmp(SIP_parse_text,"tel:")){ BEGIN(uriwithparamusrtel); } else { BEGIN(uriwithparamhstprt); } kovall=requriver; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); SIP_parse_lval.sv[SIP_parse_leng-1]='\0'; return SCHEME;} {SP} num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; return _SP; {DIGIT}{3} num_chars+=SIP_parse_leng; BEGIN(reasonsp); SIP_parse_lval.iv=atoi(SIP_parse_text); return EXTENSION_CODE; {SP} num_chars+=SIP_parse_leng; BEGIN(reason); SIP_parse_lval.cv=SIP_parse_text[0]; return _SP; {UTF8WOE}* {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return REASON_PHRASE; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return REASON_PHRASE; } ({ANLWS}|{NONLWS}|{SP}|{HT})+ {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return CONTENT_WITHOUTENDINGCRLF; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return CONTENT_WITHOUTENDINGCRLF; } ({ANLWS}|{NONLWSA}|{SP}|{HT})+ {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _STOKEN; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _STOKEN; } {ANLWS}*[,] num_chars+=SIP_parse_leng; return SOMELWSCOMMA; {CRLF} num_chars+=SIP_parse_leng; BEGIN(INITIAL); return LONE_CRLF; {ANCRLF} num_chars+=SIP_parse_leng; BEGIN(front); return _CRLF; {ANCRLF} num_chars+=SIP_parse_leng; BEGIN(front); return _CRLF; {ANCRLF} num_chars+=SIP_parse_leng; BEGIN(front); return _CRLF; {ANCRLF} num_chars+=SIP_parse_leng; BEGIN(front); return _CRLF; {ANCRLF} num_chars+=SIP_parse_leng; BEGIN(front); return _CRLF; {ANCRLF} num_chars+=SIP_parse_leng; BEGIN(front); return _CRLF; {ANCRLF} num_chars+=SIP_parse_leng; BEGIN(front); return _CRLF; {ANCRLF} num_chars+=SIP_parse_leng; BEGIN(front); return _CRLF; {ANCRLF} num_chars+=SIP_parse_leng; BEGIN(front); return _CRLF; {ANCRLF} num_chars+=SIP_parse_leng; BEGIN(front); return _CRLF; {ANCRLF} num_chars+=SIP_parse_leng; BEGIN(front); return _CRLF; {ANCRLF} num_chars+=SIP_parse_leng; BEGIN(front); return _CRLF; {ANCRLF} num_chars+=SIP_parse_leng; BEGIN(front); return _CRLF; {ANCRLF} num_chars+=SIP_parse_leng; BEGIN(front); return _CRLF; (({A}{C}{C}{E}{P}{T}[-]{C}{O}{N}{T}{A}{C}{T})|{A}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(fromparam); return ACCEPTCONTACTLWSCOLON; (({R}{E}{J}{E}{C}{T}[-]{C}{O}{N}{T}{A}{C}{T})|{J}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(fromparam); return REJECTCONTACTLWSCOLON; (({R}{E}{Q}{U}{E}{S}{T}[-]{D}{I}{S}{P}{O}{S}{I}{T}{I}{O}{N})|{D}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(fromparam); return REQDISPLWSCOLON; (({R}{E}{F}{E}{R}[-]{T}{O})|{R}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(fromfield); return REFER_TOLWSCOLON; (({R}{E}{F}{E}{R}{R}{E}{D}[-]{B}{Y})|{B}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(fromfield); return REFERREDBYTOLWSCOLON; (({F}{R}{O}{M})|{F}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(fromfield); return FROMLWSCOLON; {QDSTR} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return QUOTED_STRING; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return QUOTED_STRING; } {TOKEN}(({ANLWS}*{TOKEN})*) {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return TOKENS; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return TOKENS; } [<] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(uriwithparamscheme);kovall=fromparam; return _ABO; {TOKEN}{COLON} {//num_chars+=SIP_parse_leng; if(strcasecmp(SIP_parse_text,"tel:")){BEGIN(uriwithoutparamusrtel);} else {BEGIN(uriwithoutparamhstprt);};kovall=fromparam; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); SIP_parse_lval.sv[SIP_parse_leng-1]='\0'; return SCHEME; // New style num_chars+=SIP_parse_leng; if(!strcasecmp(SIP_parse_text,"urn:")){ BEGIN(urn); } else if(strcasecmp(SIP_parse_text,"tel:")){ BEGIN(uriwithoutparamusrtel); } else { BEGIN(uriwithoutparamhstprt); } kovall=fromparam; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); SIP_parse_lval.sv[SIP_parse_leng-1]='\0'; return SCHEME;} [u][r][n]{COLON}[u][r][n][-][7]{COLON}{TOKEN} {num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _TOKEN; } {D}{I}{G}{E}{S}{T} num_chars+=SIP_parse_leng; return _DIGEST; {TOKEN} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _TOKEN; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _TOKEN; } {ANLWS}+ num_chars+=SIP_parse_leng; return SOMELWS; [=] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; return EQUALSIGN; {HOST} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; } {HOST2} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; // New style if(!wildcarded_enabled_parser){ num_chars+=SIP_parse_leng; SIP_parse_lval.cv='!'; return '!'; } num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; } {QDSTR} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return QUOTED_STRING; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return QUOTED_STRING; } {ANLWS}*[,] num_chars+=SIP_parse_leng; return SOMELWSCOMMA; {ANCRLF} num_chars+=SIP_parse_leng; BEGIN(front); return _CRLF; {ANLWS}+ num_chars+=SIP_parse_leng; return SOMELWS; {ANLWS}+ num_chars+=SIP_parse_leng; return SOMELWS; {ANLWS}+ num_chars+=SIP_parse_leng; return SOMELWS; {ANLWS}+ num_chars+=SIP_parse_leng; return SOMELWS; {ANLWS}*[;] num_chars+=SIP_parse_leng; return SOMELWS_SEMICOLON; {ANLWS}*[;] num_chars+=SIP_parse_leng; return SOMELWS_SEMICOLON; {TOKEN} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); if (strcmp(SIP_parse_lval.sv,"*")){return _TOKEN;} else {return _STAR;}; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); if (strcmp(SIP_parse_lval.sv,"*")){ return _TOKEN; } else { return _STAR; } } [=] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; return EQUALSIGN; {HOST} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; } {IPVSIXA} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; } {HOST2} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; // New style if(!wildcarded_enabled_parser){ num_chars+=SIP_parse_leng; SIP_parse_lval.cv='!'; return '!'; } num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; } {QDSTR} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return QUOTED_STRING; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return QUOTED_STRING; } {ANLWS}*[,] num_chars+=SIP_parse_leng; return SOMELWSCOMMA; {ANLWS}*[,] num_chars+=SIP_parse_leng; return SOMELWSCOMMA; {ANLWS}*[,] num_chars+=SIP_parse_leng; return SOMELWSCOMMA; [/] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; return _SLASH; {NONLWSD}+ {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _TOKEN; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _TOKEN; } [<] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(callinfouri); return _ABO; {NONLWSB}* {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _URLTOKEN; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _URLTOKEN; } [>] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(callinfo); return _ABC; {ANLWS}+ num_chars+=SIP_parse_leng; return SOMELWS; {ANLWS}*[;] num_chars+=SIP_parse_leng; return SOMELWS_SEMICOLON; {ANLWS}*[;] num_chars+=SIP_parse_leng; BEGIN(eventparamst);return SOMELWS_SEMICOLON; {TOKEN} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _TOKEN; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _TOKEN; } {PORT} num_chars+=SIP_parse_leng; SIP_parse_lval.iv=atoi(SIP_parse_text); return _PORT; {TOKEN} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _TOKEN; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _TOKEN; } [=] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; return EQUALSIGN; {HOST} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; } {HOST2} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; // New style if(!wildcarded_enabled_parser){ num_chars+=SIP_parse_leng; SIP_parse_lval.cv='!'; return '!'; } num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; } {QDSTR} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return QUOTED_STRING; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return QUOTED_STRING; } {ANCRLF} num_chars+=SIP_parse_leng; BEGIN(front); return _CRLF; {WTOKEN} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _TOKEN; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _TOKEN; } {ANLWS}*[.] num_chars+=SIP_parse_leng; return _DOT; {TOKEN_NO_DOT} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _TOKEN_NO_DOT; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _TOKEN_NO_DOT; } [(] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(par);kovall=retryafter;level=1; return SPARENT; [(] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(par);kovall=server;level=1; return SPARENT; [(] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(par);kovall=useragent;level=1; return SPARENT; ({ANLWS}|{NONLWSD}|{SP}|{HT})+ {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _COMMENT; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _COMMENT; } [(] {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); level++; return _COMMENT; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); level++; return _COMMENT; } [)] {//num_chars+=SIP_parse_leng; level--; // if(!level) {BEGIN(kovall); SIP_parse_lval.cv=SIP_parse_text[0]; return EPARENT;} // else {SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _COMMENT;} // New style num_chars+=SIP_parse_leng; level--; if(!level) { BEGIN(kovall); SIP_parse_lval.cv=SIP_parse_text[0]; return EPARENT;} else { SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _COMMENT; } } {ANLWS}+ num_chars+=SIP_parse_leng; return SOMELWS; {HEX}+ {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text);return _HEXTOKEN; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HEXTOKEN; } {HEX}+ { num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HEXTOKEN; } {HEX}+ {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text);return _TOKEN; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _TOKEN; } {ANLWS}+ num_chars+=SIP_parse_leng; return SOMELWS; [.] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; return _DOT; [<] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(alertinfouri);kovall=fromparam; return _ABO; {NONLWSB}* {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _URLTOKEN; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _URLTOKEN; } [>] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(alertinfo); return _ABC; [<] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(errorinfouri);kovall=fromparam; return _ABO; {NONLWSB}* {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _URLTOKEN; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _URLTOKEN; } [>] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(errorinfo); return _ABC; (({T}{O})|{T}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(tofield); return TOLWSCOLON; {QDSTR} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return QUOTED_STRING; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return QUOTED_STRING; } {TOKEN}(({ANLWS}*{TOKEN})*) {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return TOKENS; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return TOKENS; } {TOKEN}(({ANLWS}*{TOKEN})*) {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); //if (strcmp(SIP_parse_lval.sv,"*")){return TOKENS;} //else {return _STAR;} // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); if (strcmp(SIP_parse_lval.sv,"*")) { return TOKENS; } else { return _STAR; } } [<] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(uriwithparamscheme); kovall=toparam; return _ABO; {TOKEN}{COLON} {//num_chars+=SIP_parse_leng; if(strcasecmp(SIP_parse_text,"tel:")){BEGIN(uriwithoutparamusrtel);} else {BEGIN(uriwithoutparamhstprt);}; kovall=toparam; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); SIP_parse_lval.sv[SIP_parse_leng-1]='\0'; return SCHEME; // New style num_chars+=SIP_parse_leng; if(!strcasecmp(SIP_parse_text,"urn:")){ BEGIN(urn); } else if(strcasecmp(SIP_parse_text,"tel:")){ BEGIN(uriwithoutparamusrtel); } else { BEGIN(uriwithoutparamhstprt); } kovall=toparam; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); SIP_parse_lval.sv[SIP_parse_leng-1]='\0'; return SCHEME; } [<] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(uriwithparamscheme); kovall=contact; return _ABO; {TOKEN}{COLON} {//num_chars+=SIP_parse_leng; if(strcasecmp(SIP_parse_text,"tel:")){BEGIN(uriwithoutparamusrtel);} else {BEGIN(uriwithoutparamhstprt);}; kovall=contact; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); SIP_parse_lval.sv[SIP_parse_leng-1]='\0'; return SCHEME; // New style num_chars+=SIP_parse_leng; if(!strcasecmp(SIP_parse_text,"urn:")){ BEGIN(urn); } else if(strcasecmp(SIP_parse_text,"tel:")){ BEGIN(uriwithoutparamusrtel); } else { BEGIN(uriwithoutparamhstprt); } kovall=contact; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); SIP_parse_lval.sv[SIP_parse_leng-1]='\0'; return SCHEME; } [<] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(uriwithparamscheme); kovall=recroute; return _ABO; [<] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(uriwithparamscheme); kovall=routest; return _ABO; [<] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(uriwithparamscheme); kovall=replyto; return _ABO; {TOKEN}{COLON} {//num_chars+=SIP_parse_leng;if(strcasecmp(SIP_parse_text,"tel:")){BEGIN(uriwithoutparamusrtel);} else {BEGIN(uriwithoutparamhstprt);} kovall=replyto; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); SIP_parse_lval.sv[SIP_parse_leng-1]='\0'; return SCHEME; // New style num_chars+=SIP_parse_leng; if(!strcasecmp(SIP_parse_text,"urn:")){ BEGIN(urn); } else if(strcasecmp(SIP_parse_text,"tel:")){ BEGIN(uriwithoutparamusrtel); } else { BEGIN(uriwithoutparamhstprt); } kovall=replyto; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); SIP_parse_lval.sv[SIP_parse_leng-1]='\0'; return SCHEME; } {TOKEN_ID} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _CALLID; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _CALLID; } /****************** SIP URI *****************/ {TOKEN}{COLON} {//num_chars+=SIP_parse_leng; if(strcasecmp(SIP_parse_text,"tel:")){BEGIN(uriwithparamusrtel);} else {BEGIN(uriwithparamhstprt);} SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); SIP_parse_lval.sv[SIP_parse_leng-1]='\0'; return SCHEME; // New style num_chars+=SIP_parse_leng; if(!strcasecmp(SIP_parse_text,"urn:")){ BEGIN(urnwithparams); } else if(strcasecmp(SIP_parse_text,"tel:")){ BEGIN(uriwithparamusrtel); } else { BEGIN(uriwithparamhstprt); } SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); SIP_parse_lval.sv[SIP_parse_leng-1]='\0'; return SCHEME; } {USERIN} {//num_chars+=SIP_parse_leng; BEGIN(uriwithparamhstprt); SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text);SIP_parse_lval.sv[SIP_parse_leng-1]='\0'; return USERINFO_AT; // New style num_chars+=SIP_parse_leng; BEGIN(uriwithparamhstprt); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); SIP_parse_lval.sv[SIP_parse_leng-1]='\0'; return USERINFO_AT; } {USERIN2} {//num_chars+=SIP_parse_leng; BEGIN(uriwithparamhstprt); SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text);SIP_parse_lval.sv[SIP_parse_leng-1]='\0'; return USERINFO_AT; // New style if(!wildcarded_enabled_parser){ num_chars+=SIP_parse_leng; SIP_parse_lval.cv='['; return '['; } num_chars+=SIP_parse_leng; BEGIN(uriwithparamhstprt); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); SIP_parse_lval.sv[SIP_parse_leng-1]='\0'; return USERINFO_AT; } {USERIN} {//num_chars+=SIP_parse_leng; BEGIN(uriwithoutparamhstprt); SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); SIP_parse_lval.sv[SIP_parse_leng-1]='\0';return USERINFO_AT; // New style num_chars+=SIP_parse_leng; BEGIN(uriwithoutparamhstprt); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); SIP_parse_lval.sv[SIP_parse_leng-1]='\0'; return USERINFO_AT; } {USERIN2} {//num_chars+=SIP_parse_leng; BEGIN(uriwithoutparamhstprt); SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); SIP_parse_lval.sv[SIP_parse_leng-1]='\0';return USERINFO_AT; // New style if(!wildcarded_enabled_parser){ num_chars+=SIP_parse_leng; SIP_parse_lval.cv='['; return '['; } num_chars+=SIP_parse_leng; BEGIN(uriwithoutparamhstprt); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); SIP_parse_lval.sv[SIP_parse_leng-1]='\0'; return USERINFO_AT; } ([/]*){HOST} {//num_chars+=SIP_parse_leng; BEGIN(uriwithparamcolprt); SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; // New style num_chars+=SIP_parse_leng; BEGIN(uriwithparamcolprt); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; } ([/]*){HOST2} {//num_chars+=SIP_parse_leng; BEGIN(uriwithparamcolprt); SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; // New style if(!wildcarded_enabled_parser){ num_chars+=SIP_parse_leng; SIP_parse_lval.cv='!'; return '!'; } num_chars+=SIP_parse_leng; BEGIN(uriwithparamcolprt); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; } ([/]*){HOST} {//num_chars+=SIP_parse_leng; BEGIN(uriwithoutparamcolprt); SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; // New style num_chars+=SIP_parse_leng; BEGIN(uriwithoutparamcolprt); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; } ([/]*){HOST2} {//num_chars+=SIP_parse_leng; BEGIN(uriwithoutparamcolprt); SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; // New style if(!wildcarded_enabled_parser){ num_chars+=SIP_parse_leng; SIP_parse_lval.cv='!'; return '!'; } num_chars+=SIP_parse_leng; BEGIN(uriwithoutparamcolprt); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; } ([/]*){HOST} {//num_chars+=SIP_parse_leng; BEGIN(uriwithparamcolprt); SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; // New style num_chars+=SIP_parse_leng; BEGIN(uriwithparamcolprt); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; } ([/]*){HOST2} {//num_chars+=SIP_parse_leng; BEGIN(uriwithparamcolprt); SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; // New style if(!wildcarded_enabled_parser){ num_chars+=SIP_parse_leng; SIP_parse_lval.cv='!'; return '!'; } num_chars+=SIP_parse_leng; BEGIN(uriwithparamcolprt); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; } ([/]*){HOST} {//num_chars+=SIP_parse_leng; BEGIN(uriwithoutparamcolprt); SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; // New style num_chars+=SIP_parse_leng; BEGIN(uriwithoutparamcolprt); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; } {URNDEF} { // New style num_chars+=SIP_parse_leng; BEGIN(uriwithparamcolprt); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; } {URNDEF2} { // New style num_chars+=SIP_parse_leng; BEGIN(kovall); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; } ([/]*){HOST2} {//num_chars+=SIP_parse_leng; BEGIN(uriwithoutparamcolprt); SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; // New style if(!wildcarded_enabled_parser){ num_chars+=SIP_parse_leng; SIP_parse_lval.cv='!'; return '!'; } num_chars+=SIP_parse_leng; BEGIN(uriwithoutparamcolprt); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; } {COLON} num_chars+=SIP_parse_leng; BEGIN(uriwithparamport); SIP_parse_lval.cv=SIP_parse_text[0]; return _COLON; {COLON} num_chars+=SIP_parse_leng; BEGIN(uriwithoutparamport); SIP_parse_lval.cv=SIP_parse_text[0]; return _COLON; {SP} num_chars+=SIP_parse_leng; BEGIN(kovall); return _SP; {ANLWS}+ num_chars+=SIP_parse_leng; BEGIN(kovall); return SOMELWS; {ANLWS}*[,] num_chars+=SIP_parse_leng; BEGIN(kovall); return SOMELWSCOMMA; [>] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(kovall); return _ABC; [\042] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(kovall); return _ABC; {SP} num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(kovall); return _SP; [;] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(uriparam);return SEMICOLON; [\077] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(uriheadr); return QUESTMARK; {ANLWS}*[;] num_chars+=SIP_parse_leng; BEGIN(kovall); return SOMELWS_SEMICOLON; {PORT} num_chars+=SIP_parse_leng; BEGIN(uriparam); SIP_parse_lval.iv=atoi(SIP_parse_text); return _PORT; {PORT} num_chars+=SIP_parse_leng; BEGIN(kovall); SIP_parse_lval.iv=atoi(SIP_parse_text); return _PORT; [>] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(kovall); return _ABC; [\042] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(kovall); return _ABC; {SP} num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(kovall); return _SP; [;] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; return SEMICOLON; {TOKEN} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _TOKEN; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _TOKEN; } {PNAME} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _TOKEN; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _TOKEN; } [=] num_chars+=SIP_parse_leng; BEGIN (uriparamvalue); SIP_parse_lval.cv=SIP_parse_text[0]; return EQUALSIGN; {PVALUE} {//num_chars+=SIP_parse_leng;BEGIN (uriparam); SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _TOKEN; // New style num_chars+=SIP_parse_leng; BEGIN (uriparam); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _TOKEN; } {HOST} {//num_chars+=SIP_parse_leng;BEGIN (uriparam); SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; // New style num_chars+=SIP_parse_leng; BEGIN (uriparam); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; } {HOST2} {//num_chars+=SIP_parse_leng;BEGIN (uriparam); SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; // New style if(!wildcarded_enabled_parser){ num_chars+=SIP_parse_leng; SIP_parse_lval.cv='!'; return '!'; } num_chars+=SIP_parse_leng; BEGIN (uriparam); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; } {QDSTR} {//num_chars+=SIP_parse_leng;BEGIN (uriparam); SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return QUOTED_STRING; // New style num_chars+=SIP_parse_leng; BEGIN (uriparam); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return QUOTED_STRING; } [\077] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(uriheadr); return QUESTMARK; [>] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(kovall); return _ABC; [\042 num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(kovall); return _ABC; {SP} num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; BEGIN(kovall); return _SP; [&] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; return AMPERSANT; {HNAME} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HNAME; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HNAME; } [=] num_chars+=SIP_parse_leng; BEGIN (uriheadrhvalue); SIP_parse_lval.cv=SIP_parse_text[0]; return EQUALSIGN; {HVALUE} {//num_chars+=SIP_parse_leng; BEGIN(uriheadr); SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HVALUE; // New style num_chars+=SIP_parse_leng; BEGIN(uriheadr); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HVALUE; } /***************** SIP URI end ***********/ (({C}{O}{N}{T}{A}{C}{T})|{M}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(contactbeg); return CONTACTLWSCOLON; ({P}[-]{A}{S}{2}{E}{R}{T}{E}{D}[-]{I}{D}{E}{N}{T}{I}{T}{Y}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(contactbeg); return PASSERTEDLWSCOLON; ({P}[-]{P}{R}{E}{F}{E}{R}{2}{E}{D}[-]{I}{D}{E}{N}{T}{I}{T}{Y}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(contactbeg); return PPREFERREDLWSCOLON; ({P}{R}{O}{X}{Y}[-]{A}{U}{T}{H}{E}{N}{T}{I}{C}{A}{T}{E}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(proxyauthentication); return PROXY_AUTHENTICATELWSCOLON; ({W}{3}[-]{A}{U}{T}{H}{E}{N}{T}{I}{C}{A}{T}{E}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(wauth); return WWW_AUTHENTICATELWSCOLON; (({C}{A}{L}{2}[-]{I}{D})|{I}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(callid); return CALL_IDLWSCOLON; {NONLWS_NONSC}+ { // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _CALLID; } {ANLWS}*[;] { num_chars+=SIP_parse_leng; BEGIN(fromparam);return SOMELWS_SEMICOLON;} (({S}{U}{P}{2}{O}{R}{T}{E}{D})|{K}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(supportedst); optioncount=suppcount; if(optioncount){ optptr=&((OptionTag__List&)((Supported&)headerptr->supported()).optionsTags()); } else{ optptr=new OptionTag__List; } return SUPPORTEDLWSCOLON;} (({V}{I}{A})|{V}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(via1); return VIALWSCOLON; {PRTNAME} {//num_chars+=SIP_parse_leng; BEGIN(via2); SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return PROTOCOL_NAME; // New style num_chars+=SIP_parse_leng; BEGIN(via2); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return PROTOCOL_NAME; } {PRTVERS} {//num_chars+=SIP_parse_leng; BEGIN(via3); SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return PROTOCOL_VERSION; // New style num_chars+=SIP_parse_leng; BEGIN(via3); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return PROTOCOL_VERSION; } {TRNSPRT} {//num_chars+=SIP_parse_leng; BEGIN(via4); SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return TRANSPORT; // New style num_chars+=SIP_parse_leng; BEGIN(via4); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return TRANSPORT; } {HOST} {//num_chars+=SIP_parse_leng; BEGIN(via1); SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; // New style num_chars+=SIP_parse_leng; BEGIN(via1); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; } {HOST2} {//num_chars+=SIP_parse_leng; BEGIN(via1); SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; // New style if(!wildcarded_enabled_parser){ num_chars+=SIP_parse_leng; SIP_parse_lval.cv='!'; return '!'; } num_chars+=SIP_parse_leng; BEGIN(via1); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; } {COLON} num_chars+=SIP_parse_leng; BEGIN(viaport); return _COLON; {PORT} num_chars+=SIP_parse_leng; BEGIN(via1); SIP_parse_lval.iv=atoi(SIP_parse_text); return _PORT; {ANLWS}*[,](({ANLWS}|[,])*) num_chars+=SIP_parse_leng; BEGIN(via1); return SOMELWS_COMMA_SOMELWS; {ANLWS}*[/]({ANLWS}*) num_chars+=SIP_parse_leng; SIP_parse_lval.cv='/'; return SOMELWS_SLASH_SOMELWS; {ANLWS}*{AT}({ANLWS}*) num_chars+=SIP_parse_leng; BEGIN(routest);return _AT; {ANLWS}*[;] num_chars+=SIP_parse_leng; BEGIN(viaparam); return SOMELWS_SEMICOLON; {ANLWS}*[;] num_chars+=SIP_parse_leng; BEGIN(fromparam); return SOMELWS_SEMICOLON; ({P}[-]{D}{C}{S}[-]{L}{A}{E}{S}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(laessthost);return PLAESLWSCOLON; ([c][o][n][t][e][n][t]){ANLWS}*[=] num_chars+=SIP_parse_leng; BEGIN(laessthost); return _LAES_CONTENT; {HOST} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; } {HOST2} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; // New style if(!wildcarded_enabled_parser){ num_chars+=SIP_parse_leng; SIP_parse_lval.cv='!'; return '!'; } num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _HOST; } {COLON} num_chars+=SIP_parse_leng; BEGIN(laesst2); return _COLON; {PORT} num_chars+=SIP_parse_leng; BEGIN(laesst); SIP_parse_lval.iv=atoi(SIP_parse_text); return _PORT; {ANLWS}*[;] num_chars+=SIP_parse_leng; BEGIN(laesst); return SOMELWS_SEMICOLON; {ANLWS}+ num_chars+=SIP_parse_leng; return SOMELWS; {ANCRLF} num_chars+=SIP_parse_leng; BEGIN(front); return _CRLF; {TOKEN} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _TOKEN; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _TOKEN; } [=] num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; return EQUALSIGN; {QDSTR} {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return QUOTED_STRING; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return QUOTED_STRING; } (({S}{U}{B}{J}{E}{C}{T})|{S}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(generalcontent); return SUBJECTLWSCOLON; (({C}{O}{N}{T}{E}{N}{T}[-]{E}{N}{C}{O}{D}{I}{N}{G})|{E}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(contentencoding); return CONTENT_ENCODINGLWSCOLON; (({C}{O}{N}{T}{E}{N}{T}[-]{L}{E}{N}{G}{T}{H})|{L}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(contentlength); return CONTENT_LENGTHLWSCOLON; {DIGIT}+ {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return SOMEDIGITS; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return SOMEDIGITS; } {DIGIT}+ {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return SOMEDIGITS; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); BEGIN(fromparam); return SOMEDIGITS; } (({C}{O}{N}{T}{E}{N}{T}[-]{T}{Y}{P}{E})|{C}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(contenttype); return CONTENT_TYPELWSCOLON; ({ANLWS}|{NONLWS}|{SP}|{HT})+ {//num_chars+=SIP_parse_leng; SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); return _TYPEID; // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _TYPEID; } ({A}{C}{2}{E}{P}{T}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(acceptst); return ACCEPTLWSCOLON;} ({A}{C}{2}{E}{P}{T}[-]{E}{N}{C}{O}{D}{I}{N}{G}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(acceptstencoding); return ACCEPT_ENCODINGLWSCOLON; ({A}{C}{2}{E}{P}{T}[-]{L}{A}{N}{G}{U}{A}{G}{E}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(acceptstlang); return ACCEPT_LANGUAGELWSCOLON; ({C}{A}{L}{2}[-]{I}{N}{F}{O}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(callinfo); return CALL_INFOLWSCOLON; ({C}{S}{E}{Q}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(cseq); return CSEQLWSCOLON; {TOKEN} { // New style num_chars+=SIP_parse_leng; SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); return _METHOD; } ({D}{A}{T}{E}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(datestate); return DATELWSCOLON; ({M}{I}{M}{E}[-]{V}{E}{R}{S}{I}{O}{N}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(mimever); return MIME_VERSIONLWSCOLON; ({O}{R}{G}{A}{N}{I}{Z}{A}{T}{I}{O}{N}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(organization); return ORGANIZATIONLWSCOLON; ({P}{R}{I}{V}{A}{C}{Y}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(privacyst); return PRIVACYLWSCOLON; ({R}{E}{C}{O}{R}{D}[-]{R}{O}{U}{T}{E}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(recroute); rcount=recroutecount; if(rcount){ routeptr=& headerptr->recordRoute()().routeBody(); } else{ routeptr=new RouteBody__List; } return RECORD_ROUTELWSCOLON;} ({R}{E}{Q}{U}{I}{R}{E}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(requirest); optioncount=reqcount; if(optioncount){ optptr=& headerptr->require()().optionsTags(); } else{ optptr=new OptionTag__List; } return REQUIRELWSCOLON;} ({T}{I}{M}{E}{S}{T}{A}{M}{P}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(timestamp); return TIMESTAMPLWSCOLON; ({R}{A}{C}{K}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(rackst); return RACKLWSCOLON; ({R}{S}{E}{Q}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(rseqst); return RSEQLWSCOLON; (({E}{V}{E}{N}{T})|{O}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(eventst); return EVENTLWSCOLON; ({A}{C}{C}{E}{P}{T}[-]{R}{E}{S}{O}{U}{R}{C}{E}[-]{P}{R}{I}{O}{R}{I}{T}{Y}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(alloweventst); return ACCEPTRESPRIOLWSCOLON; ({R}{E}{S}{O}{U}{R}{C}{E}[-]{P}{R}{I}{O}{R}{I}{T}{Y}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(alloweventst); return RESPRIOLWSCOLON; (({A}{L}{L}{O}{W}[-]{E}{V}{E}{N}{T}{S})|{U}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(alloweventst); return ALLOWEVENTLWSCOLON; ({U}{S}{E}{R}[-]{A}{G}{E}{N}{T}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(useragent); return USER_AGENTLWSCOLON; ({E}{R}{2}{O}{R}[-]{I}{N}{F}{O}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(errorinfo); return ERROR_INFOLWSCOLON; ({R}{E}{T}{R}{Y}[-]{A}{F}{T}{E}{R}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(retryafter);level=0; return RETRY_AFTERLWSCOLON; ({M}{I}{N}[-]{S}{E}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(retryafter); return MINSELWSCOLON; ({S}{E}{C}{U}{R}{I}{T}{Y}[-]{C}{L}{I}{E}{N}{T}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(routest); return SECCLIENTLWSCOLON; ({S}{E}{C}{U}{R}{I}{T}{Y}[-]{S}{E}{R}{V}{E}{R}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(routest); return SECSERVERLWSCOLON; ({S}{E}{C}{U}{R}{I}{T}{Y}[-]{V}{E}{R}{I}{F}{Y}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(routest); return SECVERIFYLWSCOLON; (({S}{E}{S}{S}{I}{O}{N}[-]{E}{X}{P}{I}{R}{E}{S})|({X})){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(routest); return SESSIONEXPWSCOLON; ({S}{E}{S}{S}{I}{O}{N}[-]{I}{D}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(routest); return SESSIONIDLWSCOLON; ({S}{E}{R}{V}{E}{R}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(server); return SERVERLWSCOLON; ({U}{N}{S}{U}{P}{2}{O}{R}{T}{E}{D}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(unsupportedst); optioncount=unsuppcount; if(optioncount){ optptr=& headerptr->unsupported()().optionsTags(); } else{ optptr=new OptionTag__List; } return UNSUPPORTEDLWSCOLON;} ({W}{A}{R}{N}{I}{N}{G}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(warning); return WARNINGLWSCOLON; {COLON} num_chars+=SIP_parse_leng; return _COLON; ({A}{L}{E}{R}{T}[-]{I}{N}{F}{O}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(alertinfo); return ALERT_INFOLWSCOLON; ({A}{U}{T}{H}{O}{R}{I}{Z}{A}{T}{I}{O}{N}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(authorization); return AUTHORIZATIONLWSCOLON; ({A}{U}{T}{H}{E}{N}{T}{I}{C}{A}{T}{I}{O}{N}[-]{I}{N}{F}{O}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(authinfo); return AUTHINFOLWSCOLON; ({I}{N}[-]{R}{E}{P}{L}{Y}[-]{T}{O}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(inreplyto); return IN_REPLY_TOLWSCOLON; ({R}{E}{P}{L}{Y}[-]{T}{O}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(replyto); return REPLY_TOLWSCOLON; ({M}{A}{X}[-]{F}{O}{R}{W}{A}{R}{D}{S}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(maxforwards); return MAX_FORWARDSLWSCOLON; ({P}{R}{I}{O}{R}{I}{T}{Y}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(generalcontent); return PRIORITYLWSCOLON; ({P}{R}{O}{X}{Y}[-]{A}{U}{T}{H}{O}{R}{I}{Z}{A}{T}{I}{O}{N}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(proxyauthorization); return PROXY_AUTHORIZATIONLWSCOLON; ({P}{R}{O}{X}{Y}[-]{R}{E}{Q}{U}{I}{R}{E}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(proxyreq); optioncount=proxyreqcount; if(optioncount){ optptr=& headerptr->proxyRequire()().optionsTags(); } else{ optptr=new OptionTag__List; } return PROXY_REQUIRELWSCOLON;} ({S}{I}{P}[-]{I}{F}[-]{M}{A}{T}{C}{H}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(routest);return IFMATCHLWSCOLON;} ({S}{I}{P}[-]{E}{T}{A}{G}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(routest);return ETAGLWSCOLON;} ({R}{E}{P}{L}{A}{C}{E}{S}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(replacesst);return REPLACESLWSCOLON;} ({J}{O}{I}{N}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(replacesst);return JOINLWSCOLON;} ({H}{I}{S}{T}{O}{R}{Y}[-]{I}{N}{F}{O}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(routest);return HISTORYLWSCOLON;} ({P}[-]{D}{C}{S}[-]{B}{I}{L}{L}{I}{N}{G}[-]{I}{N}{F}{O}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(billinginfost);return PBILLINGINFOLWSCOLON;} ({P}[-]{E}{A}{R}{L}{Y}[-]{M}{E}{D}{I}{A}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(routest);return PEARLYMEDIALWSCOLON;} ({P}[-]{D}{C}{S}[-]{O}{S}{P}{S}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(routest);return POSPSLWSCOLON;} ({P}[-]{D}{C}{S}[-]{R}{E}{D}{I}{R}{E}{C}{T}){ANLWS}*{COLON}{ANLWS}*[\042] {num_chars+=SIP_parse_leng; BEGIN(uriwithparamscheme);kovall=routest;return PDCSREDIRLWSCOLON;} ({P}[-]{U}{S}{E}{R}[-]{D}{A}{T}{A}{B}{A}{S}{E}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(routest);return PUSERDBASELWSCOLON;} ({P}[-]{D}{C}{S}[-]{T}{R}{A}{C}{E}[-]{P}{A}{R}{T}{Y}[-]{I}{D}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(routest);return PTARCEPTYIDLWSCOLON;} ({P}[-]{A}{S}{S}{O}{C}{I}{A}{T}{E}{D}[-]{U}{R}{I}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(routest);return PASSOCURILWSCOLON;} ({G}{E}{O}{L}{O}{C}{A}{T}{I}{O}{N}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(routest);return GEOLOCATIONLWSCOLON;} ({G}{E}{O}{L}{O}{C}{A}{T}{I}{O}{N}[-]{R}{O}{U}{T}{I}{N}{G}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(fromparam);return GEOROUTINGLWSCOLON;} ({G}{E}{O}{L}{O}{C}{A}{T}{I}{O}{N}[-]{E}{R}{R}{O}{R}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(geolocationerror);return GEOLOCERRORLWSCOLON;} ({P}[-]{C}{A}{L}{L}{E}{D}[-]{P}{A}{R}{T}{Y}[-]{I}{D}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(routest);return PCALLEPPTYLWSCOLON;} ({P}[-]{V}{I}{S}{I}{T}{E}{D}[-]{N}{E}{T}{W}{O}{R}{K}[-]{I}{D}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(routest);return PVISITEDNETLWSCOLON;} ({P}[-]{A}{C}{C}{E}{S}{S}[-]{N}{E}{T}{W}{O}{R}{K}[-]{I}{N}{F}{O}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(routest);return PACCESSNETLWSCOLON;} ({P}[-]{L}{A}{S}{T}[-]{A}{C}{C}{E}{S}{S}[-]{N}{E}{T}{W}{O}{R}{K}[-]{I}{N}{F}{O}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(routest);return PLASTACCESSNETLWSCOLON;} ({A}{N}{S}{W}{E}{R}[-]{M}{O}{D}{E}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(routest);return ANSWERMODELWSCOLON;} ({P}{R}{I}{V}[-]{A}{N}{S}{W}{E}{R}[-]{M}{O}{D}{E}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(routest);return PRIVANSWERMODELWSCOLON;} ({A}{L}{E}{R}{T}[-]{M}{O}{D}{E}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(routest);return ALERTMODELWSCOLON;} ({R}{E}{F}{E}{R}[-]{S}{U}{B}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(routest);return REFERSUBLWSCOLON;} ({P}[-]{A}{L}{E}{R}{T}{I}{N}{G}[-]{M}{O}{D}{E}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(routest);return PALERTINGMODELWSCOLON;} ({P}[-]{A}{N}{S}{W}{E}{R}[-]{S}{T}{A}{T}{E}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(routest);return PANSWERSTATELWSCOLON;} ({P}[-]{C}{H}{A}{R}{G}{I}{N}{G}[-]{F}{U}{N}{C}{T}{I}{O}{N}[-]{A}{D}{D}{R}{E}{S}{S}{E}{S}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(routest);return PCHARGEADDRLWSCOLON;} ({P}[-]{C}{H}{A}{R}{G}{I}{N}{G}[-]{V}{E}{C}{T}{O}{R}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(routest);return PCHARGEVECTORLWSCOLON;} ({P}{A}{T}{H}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(routest); return PATHLWSCOLON; ({S}{E}{R}{V}{I}{C}{E}[-]{R}{O}{U}{T}{E}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(routest); return SERVICEROUTELWSCOLON; ({R}{O}{U}{T}{E}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(routest); rcount=routecount; if(rcount){ routeptr=& headerptr->route()().routeBody(); } else{ routeptr=new RouteBody__List; } return ROUTELWSCOLON;} ({D}{I}{V}{E}{R}{S}{I}{O}{N}){ANLWS}*{COLON} {num_chars+=SIP_parse_leng; BEGIN(routest);return DIVERSIONWSCOLON;} ({A}{L}{2}{O}{W}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(allow); return ALLOWLWSCOLON; ({C}{O}{N}{T}{E}{N}{T}[-]{D}{I}{S}{P}{O}{S}{I}{T}{I}{O}{N}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(contentdisp); return CONTENT_DISPOSITIONLWSCOLON; ({R}{E}{A}{S}{O}{N}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(contentdisp); return REASONLWSCOLON; ({S}{U}{B}{S}{C}{R}{I}{P}{T}{I}{O}{N}[-]{S}{T}{A}{T}{E}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(contentdisp); return SUBSTATEWSCOLON; ({T}{A}{R}{G}{E}{T}[-]{D}{I}{A}{L}{O}{G}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(callid); return TARGETDIALOGLWSCOLON; (({F}{E}{A}{T}{U}{R}{E}[-]{C}{A}{P}{S}|{F}{C})){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(routest); return FEATURECAPSLWSCOLON; ({I}{N}{F}{O}[-]{P}{A}{C}{K}{A}{G}{E}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(contentdisp); return INFOPACKAGELWSCOLON; ({R}{E}{C}{V}[-]{I}{N}{F}{O}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(acceptstlang); return RECVINFOLWSCOLON; ({C}{O}{N}{T}{E}{N}{T}[-]{L}{A}{N}{G}{U}{A}{G}{E}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(contentlang); return CONTENT_LANGUAGELWSCOLON; ({P}[-]{M}{E}{D}{I}{A}[-]{A}{U}{T}{H}{O}{R}{I}{Z}{A}{T}{I}{O}{N}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(pmeadiaauth); return PMEDIAAUTHLWSCOLON; ({E}{X}{P}{I}{R}{E}{S}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(expires); return EXPIRESLWSCOLON; ({M}{I}{N}[-]{E}{X}{P}{I}{R}{E}{S}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(minexpires); return MINEXPIRESLWSCOLON; ({P}[-]{S}{E}{R}{V}{E}{D}[-]{U}{S}{E}{R}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(fromfield); return PSERVEDUSERLWSCOLON; ({P}[-]{P}{R}{O}{F}{I}{L}{E}[-]{K}{E}{Y}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(fromfield); return PPROFILEKEYLWSCOLON; ({P}[-]{S}{E}{R}{V}{I}{C}{E}[-]{I}{N}{D}{I}{C}{A}{T}{I}{O}{N}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(pserviceindication); return PSERVICEINDICATIONLWSCOLON; ({P}[-]{S}{E}{R}{V}{I}{C}{E}[-]{N}{O}{T}{I}{F}{I}{C}{A}{T}{I}{O}{N}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(pservicenotification); return PSERVICENOTIFICATIONLWSCOLON; ({P}[-]{A}{S}{S}{E}{R}{T}{E}{D}[-]{S}{E}{R}{V}{I}{C}{E}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(passertedservice);return PASSERTEDSERVICELWSCOLON; ({P}[-]{P}{R}{E}{F}{E}{R}{R}{E}{D}[-]{S}{E}{R}{V}{I}{C}{E}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(ppreferredservice); return PPREFERREDSERVICELWSCOLON; ({X}[-]{A}{U}{T}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(xaut); return XAUTLWSCOLON; ({X}[-]{C}{A}{R}{R}{I}{E}{R}[-]{I}{N}{F}{O}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(xcarrierinfo); return XCARRIERINFOLWSCOLON; ({X}[-]{C}{H}{G}{D}{E}{L}{A}{Y}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(xchgdelay); return XCHGDELAYLWSCOLON; ({X}[-]{F}{C}{I}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(xfci);return XFCILWSCOLON; ({P}[-]{A}{R}{E}{A}[-]{I}{N}{F}{O}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(routest); return PAREAINFOLWSCOLON; ({X}[-]{C}{H}{G}{I}{N}{F}{O}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(routest); return XCHGINFOLWSCOLON; ({C}{O}{N}{V}{E}{R}{S}{A}{T}{I}{O}{N}[-]{I}{D}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(callid); return CONVERSATIONIDLWSCOLON; ({C}{O}{N}{T}{R}{I}{B}{U}{T}{I}{O}{N}[-]{I}{D}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(callid); return CONTRIBUTIONIDLWSCOLON; ({I}{N}{R}{E}{P}{L}{Y}{T}{O}[-]{C}{O}{N}{T}{R}{I}{B}{U}{T}{I}{O}{N}[-]{I}{D}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(callid); return INREPLYTOCONTIDLWSCOLON; ({M}{E}{S}{S}{A}{G}{E}[-]{E}{X}{P}{I}{R}{E}{S}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(expires); return MESSAGEEXPIRESLWSCOLON; ({M}{E}{S}{S}{A}{G}{E}[-]{U}{I}{D}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(cseq); return MESSAGEUIDLWSCOLON; ({S}{E}{S}{S}{I}{O}{N}[-]{R}{E}{P}{L}{A}{C}{E}{S}){ANLWS}*{COLON} num_chars+=SIP_parse_leng; BEGIN(callid); return SESSIONREPLACESLWSCOLON; ({BADID}*)({ANLWS}*){COLON} {//num_chars+=SIP_parse_leng; BEGIN(generalcontent); SIP_parse_lval.sv=(char *)Malloc(SIP_parse_leng+1); strcpy(SIP_parse_lval.sv,SIP_parse_text); SIP_parse_lval.sv[strlen(SIP_parse_lval.sv)-1]='\0'; return OTHERLWSCOLON; // New style num_chars+=SIP_parse_leng; BEGIN(generalcontent); SIP_parse_lval.sv=stream_buffer+pos_in_buf; pos_in_buf+=SIP_parse_leng+1; strcpy(SIP_parse_lval.sv,SIP_parse_text); SIP_parse_lval.sv[strlen(SIP_parse_lval.sv)-1]='\0'; return OTHERLWSCOLON; } <*>. num_chars+=SIP_parse_leng; SIP_parse_lval.cv=SIP_parse_text[0]; return SIP_parse_text[0]; <*><> BEGIN(INITIAL); yyterminate(); %% #include "SIP_parse.h" char myinput[BUF_SIZE]; const char *myinputptr; const char *myinputlim; int SIP_parse_error(const char *s) { if (SIP_parse_text[0]=='\n'){ switch(erro_handling_sip_parser){ case 2: break; case 1: TTCN_warning("SIP Test Port: %s \"\\n\" -> unexpected character at character position %i.",s,num_chars); break; default: TTCN_error("SIP Test Port: %s \"\\n\" -> unexpected character at character position %i.",s,num_chars); break; } } else if (SIP_parse_text[0]=='\r'){ switch(erro_handling_sip_parser){ case 2: break; case 1: TTCN_warning("SIP Test Port: %s \"\\r\" -> unexpected character at character position %i.",s,num_chars); break; default: TTCN_error("SIP Test Port: %s \"\\r\" -> unexpected character at character position %i.",s,num_chars); break; } } else{ switch(erro_handling_sip_parser){ case 2: break; case 1: TTCN_warning("SIP Test Port: %s \"%s\" -> unexpected character at character position %i.",s,SIP_parse_text,num_chars); break; default: TTCN_error("SIP Test Port: %s \"%s\" -> unexpected character at character position %i.",s,SIP_parse_text,num_chars); break; } } return 0; } /*int my_SIP_parse_input(char *buffer, int max_size) { int n = myinputlim - myinputptr; if(n>0) { memcpy(buffer, myinputptr, n); myinputptr += n; } return n; } */ void initcounters(){ acceptcount=0; aceptenccount=0; acceptlangcount=0; alertinfcount=0; allowcount=0; callinfocount=0; contactcount=0; contentenccount=0; contentlangcount=0; errorinfocount=0; featureCapscount=0; inreplytocount=0; passertedidcount=0; ppreferredidcount=0; privacycount=0; proxyreqcount=0; reasoncount=0; recroutecount=0; recvinfocount=0; routecount=0; reqcount=0; suppcount=0; unsuppcount=0; servercount=0; useragentcount=0; viacount=0; warncount=0; undefcount=0; comment_buf[0]=comment_buf[1]='\0'; rcount=optioncount=paramcount=urlparamcount=headercount=0; delete paramptr; paramptr = new GenericParam__List; delete uriptr; uriptr=new SipUrl; } char* strupr(char* str){ int a=0; while(str[a]){str[a]=toupper(str[a]);a++;} return str; } //char * getstream() { // return YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; //} /* EPTEBAL */