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
43 
44 #define CORBA_OK_AUCTION_PENDING 2
45 
46 #define CORBA_OK_BLACKLISTED 3
47 #define CORBA_SERVICE_FAILED 4
48 #define CORBA_INTERNAL_ERROR 5
49 #define CORBA_UNKNOWN_ERROR 6
54 inline 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
73 
74 #define MAX_ERROR_MSG_LEN 100
75 
79 #define MAX_OBJECT_COUNT 100
80 
83 typedef void *service_Whois;
86 typedef 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 
98 typedef 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
107 }search_axis;
108 
112 /*
113  * This enum reflects database table request_type
114  */
115 typedef enum {
116  Info = 1105,
118 
122 typedef struct {
125  int type;
126  const char *value;
128 
130 typedef struct {
131  char *domain;
132  char *registrant;
133  char **admin_c;
134  char **temp_c;
135  char *nsset;
136  char *keyset;
137  char *registrar;
138  char **status;
139  char *registered;
140  char *changed;
141  char *expire;
143  int *status_ids;
144 }obj_domain;
145 
147 typedef struct {
148  char *nsset;
149  char **nserver;
150  char **nserver_addrs;
151  char **tech_c;
152  char *registrar;
153  char *created;
154  char *changed;
155 }obj_nsset;
156 
158 typedef struct {
159  int key_tag;
160  int alg;
162  char *digest;
165 
167 typedef struct {
168  int flags;
169  int protocol;
170  int alg;
171  char *public_key;
172 } keyset_dnskey;
173 
175 typedef struct {
176  char *keyset;
178  char **tech_c;
183  char *registrar;
184  char *created;
185  char *changed;
186 } obj_keyset;
187 
189 typedef 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;
200  int disclose;
203 }obj_contact;
204 
206 typedef struct {
207  char *registrar;
208  char *org;
209  char *url;
210  char *phone;
211  char **address;
213 
215 typedef struct {
216  int type;
217  union {
218  obj_domain d;
219  obj_nsset n;
220  obj_keyset k;
221  obj_contact c;
222  obj_registrar r;
223  }obj;
225 
226 typedef struct {
227  int size;
228  char **requested_by;
230 
242 int
244  const whois_request *wr,
245  general_object *objects,
246  char *timebuf,
247  char *errmsg,
248  void **exception_data);
249 
259 void whois_release_data(general_object *object_list);
260 
261 int check_duplicates(int type, char *handle, general_object *objects, int index_free);
262 
273 int
275  const char *sourceIP,
276  const char *content,
277  ccReg_RequestProperties *properties,
278  ccReg_TID *log_entry_id,
279  char *errmsg);
280 
291 int
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 */
keyset_dnskey::protocol
int protocol
Definition: whois-client.h:169
obj_nsset::created
char * created
Definition: whois-client.h:153
whois_request::type
int type
Definition: whois-client.h:125
obj_nsset::changed
char * changed
Definition: whois-client.h:154
whois_release_data
void whois_release_data(general_object *object_list)
Definition: whois-client.c:1495
whois_close_log_message
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
obj_keyset::ds
keyset_dsrecord * ds
Definition: whois-client.h:180
obj_contact::contact
char * contact
Definition: whois-client.h:190
obj_keyset::registrar
char * registrar
Definition: whois-client.h:183
whois_request::axe
search_axis axe
Definition: whois-client.h:123
obj_registrar
Definition: whois-client.h:206
obj_contact::org
char * org
Definition: whois-client.h:191
CORBA_sequence_ccReg_RequestProperty
Definition: _dataTypes.h:318
obj_domain::status_ids
int * status_ids
Definition: whois-client.h:143
obj_contact::phone
char * phone
Definition: whois-client.h:194
obj_domain::registrar
char * registrar
Definition: whois-client.h:137
keyset_dsrecord::alg
int alg
Definition: whois-client.h:160
obj_domain::registrant
char * registrant
Definition: whois-client.h:132
service_Whois
void * service_Whois
Definition: whois-client.h:83
CORBA_OK_AUCTION_PENDING
#define CORBA_OK_AUCTION_PENDING
Definition: whois-client.h:44
obj_keyset::changed
char * changed
Definition: whois-client.h:185
obj_registrar::registrar
char * registrar
Definition: whois-client.h:207
obj_nsset::nserver
char ** nserver
Definition: whois-client.h:149
keyset_dnskey::flags
int flags
Definition: whois-client.h:168
obj_domain::registered
char * registered
Definition: whois-client.h:139
keyset_dsrecord::digest_type
int digest_type
Definition: whois-client.h:161
obj_keyset
Definition: whois-client.h:175
obj_contact::disclose
int disclose
Definition: whois-client.h:200
obj_contact::fax_no
char * fax_no
Definition: whois-client.h:195
obj_keyset::keyset
char * keyset
Definition: whois-client.h:176
obj_nsset
Definition: whois-client.h:147
general_object
Definition: whois-client.h:215
obj_nsset::tech_c
char ** tech_c
Definition: whois-client.h:151
keyset_dnskey::alg
int alg
Definition: whois-client.h:170
obj_keyset::created
char * created
Definition: whois-client.h:184
obj_domain::nsset
char * nsset
Definition: whois-client.h:135
obj_keyset::tech_c
char ** tech_c
Definition: whois-client.h:178
obj_domain::changed
char * changed
Definition: whois-client.h:140
obj_contact::e_mail
char * e_mail
Definition: whois-client.h:196
keyset_dsrecord
Definition: whois-client.h:158
obj_keyset::keys
keyset_dnskey * keys
Definition: whois-client.h:181
obj_domain::expire
char * expire
Definition: whois-client.h:141
obj_domain::keyset
char * keyset
Definition: whois-client.h:136
whois_request
Definition: whois-client.h:122
CORBA_OK_LIMIT
#define CORBA_OK_LIMIT
Definition: whois-client.h:42
keyset_dnskey
Definition: whois-client.h:167
obj_registrar::address
char ** address
Definition: whois-client.h:211
obj_domain::status
char ** status
Definition: whois-client.h:138
obj_contact
Definition: whois-client.h:189
whois_corba_call
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
keyset_dsrecord::max_sig_life
int max_sig_life
Definition: whois-client.h:163
whois_action_type
whois_action_type
Definition: whois-client.h:115
CORBA_OK_BLACKLISTED
#define CORBA_OK_BLACKLISTED
Definition: whois-client.h:46
obj_domain::temp_c
char ** temp_c
Definition: whois-client.h:134
obj_contact::changed
char * changed
Definition: whois-client.h:199
whois_log_new_message
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
obj_nsset::nserver_addrs
char ** nserver_addrs
Definition: whois-client.h:150
obj_contact::name
char * name
Definition: whois-client.h:192
keyset_dsrecord::key_tag
int key_tag
Definition: whois-client.h:159
obj_registrar::url
char * url
Definition: whois-client.h:209
obj_nsset::nsset
char * nsset
Definition: whois-client.h:148
obj_domain::domain
char * domain
Definition: whois-client.h:131
whois_request::norecursion
int norecursion
Definition: whois-client.h:124
obj_contact::registrar
char * registrar
Definition: whois-client.h:197
obj_contact::created
char * created
Definition: whois-client.h:198
general_object::type
int type
Definition: whois-client.h:216
obj_domain
Definition: whois-client.h:130
check_duplicates
int check_duplicates(int type, char *handle, general_object *objects, int index_free)
Definition: whois-client.c:205
exception_blacklisted_data_t
Definition: whois-client.h:226
obj_domain::admin_c
char ** admin_c
Definition: whois-client.h:133
obj_nsset::registrar
char * registrar
Definition: whois-client.h:152
service_Logger
void * service_Logger
Definition: whois-client.h:86
obj_contact::address
char ** address
Definition: whois-client.h:193
CORBA_OK
#define CORBA_OK
Definition: whois-client.h:40
obj_domain::validated_to
char * validated_to
Definition: whois-client.h:142
keyset_dsrecord::digest
char * digest
Definition: whois-client.h:162
whois_request::value
const char * value
Definition: whois-client.h:126
obj_registrar::org
char * org
Definition: whois-client.h:208
keyset_dnskey::public_key
char * public_key
Definition: whois-client.h:171
search_axis
search_axis
Definition: whois-client.h:98
obj_registrar::phone
char * phone
Definition: whois-client.h:210