OpenDNSSEC-enforcer 1.3.0
/build/buildd/opendnssec-1.3.0/enforcer/ksm/include/ksm/db_fields.h
Go to the documentation of this file.
00001 /*
00002  * $Id: db_fields.h 5320 2011-07-12 10:42:26Z jakob $
00003  *
00004  * Copyright (c) 2008-2009 Nominet UK. All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions
00008  * are met:
00009  * 1. Redistributions of source code must retain the above copyright
00010  *    notice, this list of conditions and the following disclaimer.
00011  * 2. Redistributions in binary form must reproduce the above copyright
00012  *    notice, this list of conditions and the following disclaimer in the
00013  *    documentation and/or other materials provided with the distribution.
00014  *
00015  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
00016  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00017  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00018  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
00019  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00020  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
00021  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00022  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
00023  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00024  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
00025  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00026  *
00027  */
00028 
00029 #ifndef KSM_DB_FIELDS_H
00030 #define KSM_DB_FIELDS_H
00031 
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif
00035 
00036 /*+
00037  * db_fields.h - KSM database Field Definitions
00038  *
00039  * Description:
00040  *      Gives the relative positions of fields with a table.
00041  *
00042  *      Each constant is of the form
00043  *
00044  *          DB_<table name>_<field name>
00045  *
00046  *      Also defined are:
00047  *
00048  *          DB_INVALID          A value that is always an invalid field value
00049  *          DB_<table>_NFIELD   Number of fields in the given table
00050 -*/
00051 
00052 /* Invalid field number */
00053 
00054 #define DB_INVALID              -1
00055 
00056 /* Keydata_view fields */
00057 
00058 #define DB_KEYDATA_FIELDS       "id, state, generate, publish, ready, active, retire, dead, keytype, algorithm, location, zone_id, fixedDate"
00059 #define DB_KEYDATA_ID            0
00060 #define DB_KEYDATA_STATE         1
00061 #define DB_KEYDATA_GENERATE      2
00062 #define DB_KEYDATA_PUBLISH       3
00063 #define DB_KEYDATA_READY         4
00064 #define DB_KEYDATA_ACTIVE        5
00065 #define DB_KEYDATA_RETIRE        6
00066 #define DB_KEYDATA_DEAD          7
00067 #define DB_KEYDATA_KEYTYPE       8
00068 #define DB_KEYDATA_ALGORITHM     9
00069 #define DB_KEYDATA_LOCATION     10
00070 #define DB_KEYDATA_ZONE_ID      11
00071 #define DB_KEYDATA_FIXED_DATE   12
00072 
00073 #define DB_KEYDATA_NFIELD       13
00074 
00075 /* Parameter_view (and list) fields */
00076 
00077 #define DB_PARAMETER_VIEW_FIELDS    "name, category, parameter_id, value, policy_id"
00078 #define DB_PARAMETER_LIST_FIELDS    "name, category, parameter_id"
00079 #define DB_PARAMETER_NAME        0
00080 #define DB_PARAMETER_CATEGORY    1
00081 #define DB_PARAMETER_ID          2
00082 #define DB_PARAMETER_VALUE       3
00083 #define DB_PARAMETER_POLICY_ID   4
00084 
00085 #define DB_PARAMETER_VIEW_NFIELD      5
00086 #define DB_PARAMETER_LIST_NFIELD      3
00087 
00088 #define DB_POLICY_PARAMETER_NAME        0
00089 #define DB_POLICY_PARAMETER_CATEGORY    1
00090 #define DB_POLICY_PARAMETER_VALUE       2
00091 
00092 #define DB_SECURITY_MODULE_TABLE        "securitymodules"
00093 #define DB_SECURITY_MODULE_FIELDS       "id, name, capacity, requirebackup"
00094 #define DB_SECURITY_MODULE_ID           0
00095 #define DB_SECURITY_MODULE_NAME         1
00096 #define DB_SECURITY_MODULE_CAPACITY 2
00097 #define DB_SECURITY_MODULE_REQUIREBACKUP 3
00098 
00099 #define DB_ZONE_TABLE                   "zones"
00100 #define DB_ZONE_FIELDS                  "id, name, policy_id, signconf, input, output"
00101 #define DB_ZONE_ID                              0
00102 #define DB_ZONE_NAME                    1
00103 #define DB_ZONE_POLICY_ID       2
00104 #define DB_ZONE_SIGNCONF        3
00105 #define DB_ZONE_INPUT           4
00106 #define DB_ZONE_OUTPUT          5
00107 
00108 /* policy select variables, including salt */
00109 #define DB_POLICY_ID    0
00110 #define DB_POLICY_NAME  1
00111 #define DB_POLICY_DESCRIPTION   2
00112 #define DB_POLICY_AUDIT 3
00113 #define DB_POLICY_SALT  1
00114 #define DB_POLICY_SALT_STAMP    2
00115 
00116 
00117 /* when selecting count(*) from ... */
00118 #define DB_COUNT 0
00119 
00120 #ifdef __cplusplus
00121 };
00122 #endif
00123 
00124 #endif /* KSM_DB_FIELDS_H */