OSDN Git Service

Add MS7619SE
[uclinux-h8/uClinux-dist.git] / user / ser / data_lump.h
1 /*
2  * $Id: data_lump.h,v 1.11 2004/08/24 08:45:10 janakj Exp $
3  *
4  * adding/removing headers or any other data chunk from a message
5  *
6  * Copyright (C) 2001-2003 FhG Fokus
7  *
8  * This file is part of ser, a free SIP server.
9  *
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
14  *
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:
18  *    info@iptel.org
19  *
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.
24  *
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
28  */
29 /* History:
30  * --------
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)
36  *
37  */
38
39
40 #ifndef data_lump_h
41 #define data_lump_h
42
43 #include "lump_struct.h"
44 #include "parser/msg_parser.h"
45
46 /* adds a header to the end */
47 struct lump* append_new_lump(struct lump** list, char* new_hdr,
48                                                          int len, int type);
49 /* inserts a header to the beginning */
50 struct lump* insert_new_lump(struct lump** list, char* new_hdr,
51                                                           int len, int type);
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,
55                                                                         int len,int type);
56 /* substitutions (replace with ip address, port etc) */
57 struct lump* insert_subst_lump_after(struct lump* after,  enum lump_subst subst,
58                                                                         int type);
59 struct lump* insert_subst_lump_before(struct lump* before,enum lump_subst subst,
60                                                                         int type);
61
62 /* conditional lumps */
63 struct lump* insert_cond_lump_after(struct lump* after, enum lump_conditions c,
64                                                                         int type);
65 struct lump* insert_cond_lump_before(struct lump* after, enum lump_conditions c,
66                                                                         int type);
67
68 /* removes an already existing header */
69 struct lump* del_lump(struct sip_msg* msg, int offset, int len, int type);
70 /* set an anchor */
71 struct lump* anchor_lump(struct sip_msg* msg, int offset, int len, int type);
72
73
74
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);
79
80
81 /* remove all non-SHMEM lumps from the list */
82 void del_nonshm_lump( struct lump** lump_list );
83
84 #endif