00001 /* 00002 * $Id: parse_fline.h 4720 2008-08-23 10:56:15Z henningw $ 00003 * 00004 * Copyright (C) 2001-2003 FhG Fokus 00005 * 00006 * This file is part of Kamailio, a free SIP server. 00007 * 00008 * Kamailio is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation; either version 2 of the License, or 00011 * (at your option) any later version 00012 * 00013 * Kamailio is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program; if not, write to the Free Software 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00021 */ 00022 00023 /*! 00024 * \file 00025 * \brief SIP first line parsing automaton 00026 * \ingroup parser 00027 */ 00028 00029 #ifndef PARSE_FLINE_H 00030 #define PARSE_FLINE_H 00031 00032 #include "../str.h" 00033 00034 /*! Message is request */ 00035 #define SIP_REQUEST 1 00036 00037 /*! Message is reply */ 00038 #define SIP_REPLY 2 00039 00040 /*! Invalid message */ 00041 #define SIP_INVALID 0 00042 00043 #define SIP_VERSION "SIP/2.0" 00044 #define SIP_VERSION_LEN 7 00045 00046 #define INVITE "INVITE" 00047 #define CANCEL "CANCEL" 00048 #define ACK "ACK" 00049 #define BYE "BYE" 00050 #define INFO "INFO" 00051 00052 #define INVITE_LEN 6 00053 #define CANCEL_LEN 6 00054 #define ACK_LEN 3 00055 #define BYE_LEN 3 00056 #define INFO_LEN 4 00057 00058 00059 struct msg_start { 00060 int type; /*!< Type of the Message - Request/Response */ 00061 int len; /*!< length including delimiter */ 00062 union { 00063 struct { 00064 str method; /*!< Method string */ 00065 str uri; /*!< Request URI */ 00066 str version; /*!< SIP version */ 00067 int method_value; 00068 } request; 00069 struct { 00070 str version; /*!< SIP version */ 00071 str status; /*!< Reply status */ 00072 str reason; /*!< Reply reason phrase */ 00073 unsigned int statuscode; 00074 } reply; 00075 }u; 00076 }; 00077 00078 00079 char* parse_first_line(char* buffer, unsigned int len, struct msg_start * fl); 00080 00081 char* parse_fline(char* buffer, char* end, struct msg_start* fl); 00082 00083 00084 #endif /* PARSE_FLINE_H */
1.5.6