• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • Directories
  • File List
  • Globals

data_lump.h

Go to the documentation of this file.
00001 /*
00002  * $Id$
00003  *
00004  * adding/removing headers or any other data chunk from a message
00005  *
00006  * Copyright (C) 2001-2003 FhG Fokus
00007  *
00008  * This file is part of ser, a free SIP server.
00009  *
00010  * ser 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  * ser 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 
00025 /* History:
00026  * --------
00027  *  2003-01-29  s/int/enum ... more convenient for gdb (jiri)
00028  *  2003-03-31  added subst lumps -- they expand in ip addr, port a.s.o (andrei)
00029  *  2003-04-01  added opt (condition) lumps (andrei)
00030  *  2003-04-02  added more subst lumps: SUBST_{SND,RCV}_ALL  
00031  *              => ip:port;transport=proto (andrei)
00032  *  2005-03-22  the type of type attribute changed to enum _hdr_types_t (janakj)
00033  *
00034  */
00035 
00044 #ifndef data_lump_h
00045 #define data_lump_h
00046 
00047 #include "lump_struct.h"
00048 #include "parser/msg_parser.h"
00049 #include "parser/hf.h"
00050 
00051 
00052 /* adds a header right after an anchor point if exists */
00053 struct lump* add_new_lump(struct lump** list, char* new_hdr,
00054                                                          int len, enum _hdr_types_t type);
00055 
00057 struct lump* append_new_lump(struct lump** list, char* new_hdr,
00058                                                          int len, enum _hdr_types_t type);
00060 struct lump* insert_new_lump(struct lump** list, char* new_hdr,
00061                                                           int len, enum _hdr_types_t type);
00062 struct lump* insert_new_lump_after(struct lump* after,
00063                                                                         char* new_hdr, int len, enum _hdr_types_t type);
00064 struct lump* insert_new_lump_before(struct lump* before, char* new_hdr,
00065                                                                         int len,enum _hdr_types_t type);
00067 struct lump* insert_subst_lump_after(struct lump* after,  enum lump_subst subst,
00068                                                                         enum _hdr_types_t type);
00069 struct lump* insert_subst_lump_before(struct lump* before,enum lump_subst subst,
00070                                                                         enum _hdr_types_t type);
00071 
00073 struct lump* insert_cond_lump_after(struct lump* after, enum lump_conditions c,
00074                                                                         enum _hdr_types_t type);
00075 struct lump* insert_cond_lump_before(struct lump* after, enum lump_conditions c,
00076                                                                         enum _hdr_types_t type);
00077 
00079 /* set an anchor if there is no existing one at the given offset,
00080  * otherwise return the existing anchor */
00081 struct lump* anchor_lump2(struct sip_msg* msg, int offset, int len, enum _hdr_types_t type,
00082                                                                 int *is_ref);
00083 struct lump* del_lump(struct sip_msg* msg, int offset, int len, enum _hdr_types_t type);
00085 struct lump* anchor_lump(struct sip_msg* msg, int offset, int len, enum _hdr_types_t type);
00086 
00087 
00088 
00090 struct lump* dup_lump_list( struct lump *l );
00092 void free_duped_lump_list(struct lump* l);
00093 
00094 
00096 void del_nonshm_lump( struct lump** lump_list );
00097 
00098 #endif

Generated on Tue May 22 2012 13:10:05 for SIP Router by  doxygen 1.7.1