fred-mod-whoisd
/build/mod-whoisd-3.15.0/whois-client.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2006-2024 CZ.NIC, z. s. p. o.
3 *
4 * This file is part of FRED.
5 *
6 * FRED 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 3 of the License, or
9 * (at your option) any later version.
10 *
11 * FRED 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 FRED. If not, see <https://www.gnu.org/licenses/>.
18 */
27#ifndef WHOIS_CLIENT_H
28#define WHOIS_CLIENT_H
29
30#include "Logger.h"
31
40#define CORBA_OK 0
42#define CORBA_OK_LIMIT 1
44#define CORBA_OK_AUCTION_PENDING 2
46#define CORBA_OK_BLACKLISTED 3
47#define CORBA_SERVICE_FAILED 4
48#define CORBA_INTERNAL_ERROR 5
49#define CORBA_UNKNOWN_ERROR 6
54inline int is_corba_ok(int corba_status_code)
55{
56 switch (corba_status_code)
57 {
58 case CORBA_OK:
59 case CORBA_OK_LIMIT:
62 return 1;
63 default:
64 return 0;
65 }
66}
67
72#define TIME_BUFFER_LENGTH 60
74#define MAX_ERROR_MSG_LEN 100
79#define MAX_OBJECT_COUNT 100
80
83typedef void *service_Whois;
86typedef void *service_Logger;
87
88#define T_NONE 0 /* Nothing. */
89#define T_DOMAIN 1 /* Object type domain. */
90#define T_NSSET 2 /* Object type nsset. */
91#define T_CONTACT 4 /* Object type contact. */
92#define T_REGISTRAR 8 /* Object type registrar. */
93#define T_KEYSET 16 /* Object type keyset. */
94
98typedef enum {
99 SA_NONE = 0,
100 SA_REGISTRANT,
101 SA_ADMIN_C,
102 SA_TEMP_C,
103 SA_NSSET,
104 SA_KEYSET,
105 SA_NSERVER,
106 SA_TECH_C
108
112/*
113 * This enum reflects database table request_type
114 */
115typedef enum {
116 Info = 1105,
118
122typedef struct {
125 int type;
126 const char *value;
128
130typedef struct {
131 char *domain;
133 char **admin_c;
134 char **temp_c;
135 char *nsset;
136 char *keyset;
137 char *registrar;
138 char **status;
140 char *changed;
141 char *expire;
145
147typedef struct {
148 char *nsset;
149 char **nserver;
151 char **tech_c;
152 char *registrar;
153 char *created;
154 char *changed;
155}obj_nsset;
156
158typedef struct {
160 int alg;
162 char *digest;
165
167typedef struct {
168 int flags;
170 int alg;
173
175typedef struct {
176 char *keyset;
178 char **tech_c;
183 char *registrar;
184 char *created;
185 char *changed;
186} obj_keyset;
187
189typedef struct {
190 char *contact;
191 char *org;
192 char *name;
193 char **address;
194 char *phone;
195 char *fax_no;
196 char *e_mail;
197 char *registrar;
198 char *created;
199 char *changed;
204
206typedef struct {
207 char *registrar;
208 char *org;
209 char *url;
210 char *phone;
211 char **address;
213
215typedef struct {
216 int type;
217 union {
218 obj_domain d;
219 obj_nsset n;
220 obj_keyset k;
221 obj_contact c;
223 }obj;
225
226typedef struct {
227 int size;
228 char **requested_by;
230
242int
244 const whois_request *wr,
245 general_object *objects,
246 char *timebuf,
247 char *errmsg,
248 void **exception_data);
249
259void whois_release_data(general_object *object_list);
260
261int check_duplicates(int type, char *handle, general_object *objects, int index_free);
262
273int
275 const char *sourceIP,
276 const char *content,
277 ccReg_RequestProperties *properties,
278 ccReg_TID *log_entry_id,
279 char *errmsg);
280
291int
293 const char *content,
294 ccReg_RequestProperties *properties,
295 ccReg_TID log_entry_id,
296 CORBA_long result_code,
297 char *errmsg);
298
299#endif /* WHOIS_CLIENT_H */
#define CORBA_OK_BLACKLISTED
Definition: whois-client.h:46
#define CORBA_OK_AUCTION_PENDING
Definition: whois-client.h:44
#define CORBA_OK_LIMIT
Definition: whois-client.h:42
#define CORBA_OK
Definition: whois-client.h:40
Definition: _dataTypes.h:318
Definition: whois-client.h:226
Definition: whois-client.h:215
int type
Definition: whois-client.h:216
Definition: whois-client.h:167
int flags
Definition: whois-client.h:168
int protocol
Definition: whois-client.h:169
int alg
Definition: whois-client.h:170
char * public_key
Definition: whois-client.h:171
Definition: whois-client.h:158
int alg
Definition: whois-client.h:160
char * digest
Definition: whois-client.h:162
int key_tag
Definition: whois-client.h:159
int max_sig_life
Definition: whois-client.h:163
int digest_type
Definition: whois-client.h:161
Definition: whois-client.h:189
char * name
Definition: whois-client.h:192
char * changed
Definition: whois-client.h:199
char * registrar
Definition: whois-client.h:197
int disclose
Definition: whois-client.h:200
char * created
Definition: whois-client.h:198
char ** address
Definition: whois-client.h:193
char * fax_no
Definition: whois-client.h:195
char * phone
Definition: whois-client.h:194
char * org
Definition: whois-client.h:191
char * e_mail
Definition: whois-client.h:196
char * contact
Definition: whois-client.h:190
Definition: whois-client.h:130
char * registrant
Definition: whois-client.h:132
char * validated_to
Definition: whois-client.h:142
char ** temp_c
Definition: whois-client.h:134
int * status_ids
Definition: whois-client.h:143
char * changed
Definition: whois-client.h:140
char * domain
Definition: whois-client.h:131
char ** admin_c
Definition: whois-client.h:133
char * keyset
Definition: whois-client.h:136
char * expire
Definition: whois-client.h:141
char * nsset
Definition: whois-client.h:135
char * registrar
Definition: whois-client.h:137
char ** status
Definition: whois-client.h:138
char * registered
Definition: whois-client.h:139
Definition: whois-client.h:175
keyset_dsrecord * ds
Definition: whois-client.h:180
char ** tech_c
Definition: whois-client.h:178
char * created
Definition: whois-client.h:184
char * changed
Definition: whois-client.h:185
keyset_dnskey * keys
Definition: whois-client.h:181
char * keyset
Definition: whois-client.h:176
char * registrar
Definition: whois-client.h:183
Definition: whois-client.h:147
char ** tech_c
Definition: whois-client.h:151
char ** nserver_addrs
Definition: whois-client.h:150
char * nsset
Definition: whois-client.h:148
char * changed
Definition: whois-client.h:154
char * registrar
Definition: whois-client.h:152
char ** nserver
Definition: whois-client.h:149
char * created
Definition: whois-client.h:153
Definition: whois-client.h:206
char ** address
Definition: whois-client.h:211
char * url
Definition: whois-client.h:209
char * phone
Definition: whois-client.h:210
char * registrar
Definition: whois-client.h:207
char * org
Definition: whois-client.h:208
Definition: whois-client.h:122
search_axis axe
Definition: whois-client.h:123
int norecursion
Definition: whois-client.h:124
const char * value
Definition: whois-client.h:126
int type
Definition: whois-client.h:125
int whois_close_log_message(service_Logger service, const char *content, ccReg_RequestProperties *properties, ccReg_TID log_entry_id, CORBA_long result_code, char *errmsg)
Definition: whois-client.c:1306
whois_action_type
Definition: whois-client.h:115
int check_duplicates(int type, char *handle, general_object *objects, int index_free)
Definition: whois-client.c:205
void * service_Logger
Definition: whois-client.h:86
int whois_corba_call(service_Whois service, const whois_request *wr, general_object *objects, char *timebuf, char *errmsg, void **exception_data)
Definition: whois-client.c:1420
void whois_release_data(general_object *object_list)
Definition: whois-client.c:1495
search_axis
Definition: whois-client.h:98
int whois_log_new_message(service_Logger service, const char *sourceIP, const char *content, ccReg_RequestProperties *properties, ccReg_TID *log_entry_id, char *errmsg)
Definition: whois-client.c:1234
void * service_Whois
Definition: whois-client.h:83