fred-mod-whoisd-3.8.0
|
00001 /* 00002 * Copyright (C) 2007 CZ.NIC, z.s.p.o. 00003 * 00004 * This file is part of FRED. 00005 * 00006 * FRED is free software: you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation, version 2 of the License. 00009 * 00010 * FRED is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with FRED. If not, see <http://www.gnu.org/licenses/>. 00017 */ 00026 #ifndef WHOIS_CLIENT_H 00027 #define WHOIS_CLIENT_H 00028 00037 #define CORBA_OK 0 00039 #define CORBA_OK_LIMIT 1 00040 #define CORBA_SERVICE_FAILED 2 00041 #define CORBA_INTERNAL_ERROR 3 00042 #define CORBA_UNKNOWN_ERROR 4 00051 #define TIME_BUFFER_LENGTH 60 00052 00053 #define MAX_ERROR_MSG_LEN 100 00054 00058 #define MAX_OBJECT_COUNT 100 00059 00062 typedef void *service_Whois; 00065 typedef void *service_Logger; 00066 00067 #define T_NONE 0 /* Nothing. */ 00068 #define T_DOMAIN 1 /* Object type domain. */ 00069 #define T_NSSET 2 /* Object type nsset. */ 00070 #define T_CONTACT 4 /* Object type contact. */ 00071 #define T_REGISTRAR 8 /* Object type registrar. */ 00072 #define T_KEYSET 16 /* Object type keyset. */ 00073 00077 typedef enum { 00078 SA_NONE = 0, 00079 SA_REGISTRANT, 00080 SA_ADMIN_C, 00081 SA_TEMP_C, 00082 SA_NSSET, 00083 SA_KEYSET, 00084 SA_NSERVER, 00085 SA_TECH_C 00086 }search_axis; 00087 00091 /* 00092 * This enum reflects database table request_type 00093 */ 00094 typedef enum { 00095 Info = 1105, 00096 } whois_action_type; 00097 00101 typedef struct { 00102 search_axis axe; 00103 int norecursion; 00104 int type; 00105 const char *value; 00106 }whois_request; 00107 00109 typedef struct { 00110 char *domain; 00111 char *registrant; 00112 char **admin_c; 00113 char **temp_c; 00114 char *nsset; 00115 char *keyset; 00116 char *registrar; 00117 char **status; 00118 char *registered; 00119 char *changed; 00120 char *expire; 00121 char *validated_to; 00122 int *status_ids; 00123 }obj_domain; 00124 00126 typedef struct { 00127 char *nsset; 00128 char **nserver; 00129 char **nserver_addrs; 00130 char **tech_c; 00131 char *registrar; 00132 char *created; 00133 char *changed; 00134 }obj_nsset; 00135 00137 typedef struct { 00138 int key_tag; 00139 int alg; 00140 int digest_type; 00141 char *digest; 00142 int max_sig_life; 00143 } keyset_dsrecord; 00144 00146 typedef struct { 00147 int flags; 00148 int protocol; 00149 int alg; 00150 char *public_key; 00151 } keyset_dnskey; 00152 00154 typedef struct { 00155 char *keyset; 00157 char **tech_c; 00159 keyset_dsrecord *ds; 00160 keyset_dnskey *keys; 00162 char *registrar; 00163 char *created; 00164 char *changed; 00165 } obj_keyset; 00166 00168 typedef struct { 00169 char *contact; 00170 char *org; 00171 char *name; 00172 char **address; 00173 char *phone; 00174 char *fax_no; 00175 char *e_mail; 00176 char *registrar; 00177 char *created; 00178 char *changed; 00179 int disclose; 00181 }obj_contact; 00182 00184 typedef struct { 00185 char *registrar; 00186 char *org; 00187 char *url; 00188 char *phone; 00189 char **address; 00190 }obj_registrar; 00191 00193 typedef struct { 00194 int type; 00195 union { 00196 obj_domain d; 00197 obj_nsset n; 00198 obj_keyset k; 00199 obj_contact c; 00200 obj_registrar r; 00201 }obj; 00202 }general_object; 00203 00215 int 00216 whois_corba_call(service_Whois service, 00217 const whois_request *wr, 00218 general_object *objects, 00219 char *timebuf, 00220 char *errmsg); 00221 00231 void whois_release_data(general_object *object_list); 00232 00233 int check_duplicates(int type, char *handle, general_object *objects, int index_free); 00234 00245 int 00246 whois_log_new_message(service_Logger service, 00247 const char *sourceIP, 00248 const char *content, 00249 ccReg_RequestProperties *properties, 00250 ccReg_TID *log_entry_id, 00251 char *errmsg); 00252 00253 00254 #endif /* WHOIS_CLIENT_H */