1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
/*
* $Id$
*
* Sanity Checks Module
*
* Copyright (C) 2006 iptelorg GbmH
*
* This file is part of ser, a free SIP server.
*
* ser is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version
*
* For a license to use the ser software under conditions
* other than those described here, or to purchase support for this
* software, please contact iptel.org by e-mail at the following addresses:
* info@iptel.org
*
* ser is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef MOD_SANITY_CHK_H
#define MOD_SANITY_CHK_H
#include "../../str.h"
#include "../../modules/sl/sl.h"
#include "../../parser/msg_parser.h"
#define SANITY_RURI_SIP_VERSION (1<<0)
#define SANITY_RURI_SCHEME (1<<1)
#define SANITY_REQUIRED_HEADERS (1<<2)
#define SANITY_VIA_SIP_VERSION (1<<3)
#define SANITY_VIA_PROTOCOL (1<<4)
#define SANITY_CSEQ_METHOD (1<<5)
#define SANITY_CSEQ_VALUE (1<<6)
#define SANITY_CL (1<<7)
#define SANITY_EXPIRES_VALUE (1<<8)
#define SANITY_PROXY_REQUIRE (1<<9)
#define SANITY_PARSE_URIS (1<<10)
#define SANITY_CHECK_DIGEST (1<<11)
#define SANITY_CHECK_DUPTAGS (1<<12)
#define SANITY_MAX_CHECKS (1<<13) /* Make sure this is the highest value */
/* VIA_SIP_VERSION and VIA_PROTOCOL do not work yet
* and PARSE_URIS is very expensive */
#define SANITY_DEFAULT_CHECKS SANITY_RURI_SIP_VERSION | \
SANITY_RURI_SCHEME | \
SANITY_REQUIRED_HEADERS | \
SANITY_CSEQ_METHOD | \
SANITY_CSEQ_VALUE | \
SANITY_CL | \
SANITY_EXPIRES_VALUE | \
SANITY_PROXY_REQUIRE | \
SANITY_CHECK_DIGEST
#define SANITY_URI_CHECK_RURI (1<<0)
#define SANITY_URI_CHECK_FROM (1<<1)
#define SANITY_URI_CHECK_TO (1<<2)
#define SANITY_URI_CHECK_CONTACT (1<<3)
#define SANITY_URI_MAX_CHECKS (1<<4) /* Make sure this is the highest value */
#define SANITY_DEFAULT_URI_CHECKS SANITY_URI_CHECK_RURI | \
SANITY_URI_CHECK_FROM | \
SANITY_URI_CHECK_TO
#define SANITY_CHECK_PASSED 1
#define SANITY_CHECK_FAILED 0
#define SANITY_CHECK_ERROR -1
struct _strlist {
str string; /* the string */
struct _strlist* next; /* the next strlist element */
};
typedef struct _strlist strl;
extern int default_checks;
extern strl* proxyrequire_list;
extern sl_api_t slb;
#endif /* MOD_SANITY_CHK_H */
|