/src/opensips/parser/parse_allow.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2004 Juha Heinanen |
3 | | * |
4 | | * This file is part of opensips, a free SIP server. |
5 | | * |
6 | | * opensips is free software; you can redistribute it and/or modify |
7 | | * it under the terms of the GNU General Public License as published by |
8 | | * the Free Software Foundation; either version 2 of the License, or |
9 | | * (at your option) any later version |
10 | | * |
11 | | * opensips is distributed in the hope that it will be useful, |
12 | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | | * GNU General Public License for more details. |
15 | | * |
16 | | * You should have received a copy of the GNU General Public License |
17 | | * along with this program; if not, write to the Free Software |
18 | | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
19 | | * |
20 | | * History: |
21 | | * ------- |
22 | | * 2006-03-02 parse_allow() parses and cumulates all ALLOW headers (bogdan) |
23 | | */ |
24 | | |
25 | | #ifndef PARSE_ALLOW_H |
26 | | #define PARSE_ALLOW_H |
27 | | |
28 | | #include "../mem/mem.h" |
29 | | #include "msg_parser.h" |
30 | | |
31 | | |
32 | | /* |
33 | | * casting macro for accessing Allow body |
34 | | */ |
35 | | #define get_allow_methods(p_msg) \ |
36 | | (((struct allow_body*)(p_msg)->allow->parsed)->allow_all) |
37 | | |
38 | | |
39 | | struct allow_body { |
40 | | unsigned int allow; /* allow mask for the current hdr */ |
41 | | unsigned int allow_all; /* allow mask for the all allow hdr - it's |
42 | | * set only for the first hdr in sibling |
43 | | * list*/ |
44 | | }; |
45 | | |
46 | | /* |
47 | | * Parse all Allow HFs |
48 | | */ |
49 | | int parse_allow( struct sip_msg *msg); |
50 | | |
51 | | |
52 | | static inline void free_allow(struct allow_body **ab) |
53 | 0 | { |
54 | 0 | if (ab && *ab) { |
55 | 0 | pkg_free(*ab); |
56 | 0 | *ab = 0; |
57 | 0 | } |
58 | 0 | } |
59 | | |
60 | | #endif /* PARSE_ALLOW_H */ |