cr_db.h

Go to the documentation of this file.
00001 /*
00002  * $Id$
00003  *
00004  * Copyright (C) 2007 1&1 Internet AG
00005  *
00006  * This file is part of SIP-router, a free SIP server.
00007  *
00008  * SIP-router is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version
00012  *
00013  * SIP-router is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License 
00019  * along with this program; if not, write to the Free Software 
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021  */
00022 
00030 #ifndef CR_DB_H
00031 #define CR_DB_H
00032 
00033 #include "../../lib/srdb1/db.h"
00034 #include "db_carrierroute.h"
00035 #include "cr_data.h"
00036 
00037 
00038 #define COLUMN_NUM 12
00039 #define COL_ID             0
00040 #define COL_CARRIER        1
00041 #define COL_DOMAIN         2
00042 #define COL_SCAN_PREFIX    3
00043 #define COL_FLAGS          4
00044 #define COL_MASK           5
00045 #define COL_PROB           6
00046 #define COL_REWRITE_HOST   7
00047 #define COL_STRIP          8
00048 #define COL_REWRITE_PREFIX 9
00049 #define COL_REWRITE_SUFFIX 10
00050 #define COL_COMMENT        11
00051 
00052 #define FAILURE_COLUMN_NUM 10
00053 #define FCOL_ID             0
00054 #define FCOL_CARRIER        1
00055 #define FCOL_DOMAIN         2
00056 #define FCOL_SCAN_PREFIX    3
00057 #define FCOL_HOST_NAME      4
00058 #define FCOL_REPLY_CODE     5
00059 #define FCOL_FLAGS          6
00060 #define FCOL_MASK           7
00061 #define FCOL_NEXT_DOMAIN    8
00062 #define FCOL_COMMENT        9
00063 
00064 #define CARRIER_NAME_COLUMN_NUM 2
00065 #define CARRIER_NAME_ID_COL 0
00066 #define CARRIER_NAME_NAME_COL 1
00067 
00068 #define DOMAIN_NAME_COLUMN_NUM 2
00069 #define DOMAIN_NAME_ID_COL 0
00070 #define DOMAIN_NAME_NAME_COL 1
00071 
00072 extern str * columns[];
00073 extern str * carrier_columns[];
00074 extern str * failure_columns[];
00075 
00076 
00087 int load_route_data_db (struct route_data_t * rd);
00088 
00089 int load_user_carrier(str * user, str * domain);
00090 
00091 #endif