2 * $Id: data_lump.h,v 1.11 2004/08/24 08:45:10 janakj Exp $
4 * adding/removing headers or any other data chunk from a message
6 * Copyright (C) 2001-2003 FhG Fokus
8 * This file is part of ser, a free SIP server.
10 * ser is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version
15 * For a license to use the ser software under conditions
16 * other than those described here, or to purchase support for this
17 * software, please contact iptel.org by e-mail at the following addresses:
20 * ser is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 * 2003-01-29 s/int/enum ... more convenient for gdb (jiri)
32 * 2003-03-31 added subst lumps -- they expand in ip addr, port a.s.o (andrei)
33 * 2003-04-01 added opt (condition) lumps (andrei)
34 * 2003-04-02 added more subst lumps: SUBST_{SND,RCV}_ALL
35 * => ip:port;transport=proto (andrei)
43 #include "lump_struct.h"
44 #include "parser/msg_parser.h"
46 /* adds a header to the end */
47 struct lump* append_new_lump(struct lump** list, char* new_hdr,
49 /* inserts a header to the beginning */
50 struct lump* insert_new_lump(struct lump** list, char* new_hdr,
52 struct lump* insert_new_lump_after(struct lump* after,
53 char* new_hdr, int len, int type);
54 struct lump* insert_new_lump_before(struct lump* before, char* new_hdr,
56 /* substitutions (replace with ip address, port etc) */
57 struct lump* insert_subst_lump_after(struct lump* after, enum lump_subst subst,
59 struct lump* insert_subst_lump_before(struct lump* before,enum lump_subst subst,
62 /* conditional lumps */
63 struct lump* insert_cond_lump_after(struct lump* after, enum lump_conditions c,
65 struct lump* insert_cond_lump_before(struct lump* after, enum lump_conditions c,
68 /* removes an already existing header */
69 struct lump* del_lump(struct sip_msg* msg, int offset, int len, int type);
71 struct lump* anchor_lump(struct sip_msg* msg, int offset, int len, int type);
75 /* duplicates a lump list shallowly in pkg-mem */
76 struct lump* dup_lump_list( struct lump *l );
77 /* frees a shallowly duplicated lump list */
78 void free_duped_lump_list(struct lump* l);
81 /* remove all non-SHMEM lumps from the list */
82 void del_nonshm_lump( struct lump** lump_list );