00001 /* 00002 * $Id: utils.h 5318 2008-12-08 16:38:47Z henningw $ 00003 * 00004 * Sdp mangler module 00005 * 00006 * Copyright (C) 2001-2003 FhG Fokus 00007 * 00008 * This file is part of Kamailio, a free SIP server. 00009 * 00010 * Kamailio is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version 00014 * 00015 * Kamailio is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with this program; if not, write to the Free Software 00022 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00023 * 00024 * History: 00025 * -------- 00026 * 2003-04-07 first version. 00027 */ 00028 00029 #ifndef UTILS_H 00030 #define UTILS_H 00031 00032 #include "../../parser/msg_parser.h" /* struct sip_msg */ 00033 00034 /* replace a part of a sip message identified by (start address,length) with a new part 00035 @param msg a pointer to a sip message 00036 @param oldstr the start address of the part to be modified 00037 @param oldlen the length of the part being modified 00038 @param newstr the start address of the part to be added 00039 @param oldlen the length of the part being added 00040 @return 0 in case of success, negative on error 00041 */ 00042 00043 int patch (struct sip_msg *msg, char *oldstr, unsigned int oldlen, 00044 char *newstr, unsigned int newlen); 00045 /* 00046 modify the Content-Length header of a sip message 00047 @param msg a pointer to a sip message 00048 @param newValue the new value of Content-Length 00049 @return 0 in case of success, negative on error 00050 */ 00051 int patch_content_length (struct sip_msg *msg, unsigned int newValue); 00052 00053 #endif
1.5.6