00001 /* 00002 * $Id$ 00003 * 00004 * Sdp mangler module 00005 * 00006 * Copyright (C) 2001-2003 FhG Fokus 00007 * 00008 * This file is part of SIP-router, a free SIP server. 00009 * 00010 * SIP-router 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 * SIP-router 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 00037 #ifndef UTILS_H 00038 #define UTILS_H 00039 00040 #include "../../parser/msg_parser.h" /* struct sip_msg */ 00041 00042 /* replace a part of a sip message identified by (start address,length) with a new part 00043 @param msg a pointer to a sip message 00044 @param oldstr the start address of the part to be modified 00045 @param oldlen the length of the part being modified 00046 @param newstr the start address of the part to be added 00047 @param oldlen the length of the part being added 00048 @return 0 in case of success, negative on error 00049 */ 00050 00051 int patch (struct sip_msg *msg, char *oldstr, unsigned int oldlen, 00052 char *newstr, unsigned int newlen); 00053 /* 00054 modify the Content-Length header of a sip message 00055 @param msg a pointer to a sip message 00056 @param newValue the new value of Content-Length 00057 @return 0 in case of success, negative on error 00058 */ 00059 int patch_content_length (struct sip_msg *msg, unsigned int newValue); 00060 00061 #endif
1.7.1