fred-mod-whoisd-3.10.2
whois-client.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007 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, version 2 of the License.
9  *
10  * FRED is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with FRED. If not, see <http://www.gnu.org/licenses/>.
17  */
26 #ifndef WHOIS_CLIENT_H
27 #define WHOIS_CLIENT_H
28 
37 #define CORBA_OK 0
39 #define CORBA_OK_LIMIT 1
40 #define CORBA_SERVICE_FAILED 2
41 #define CORBA_INTERNAL_ERROR 3
42 #define CORBA_UNKNOWN_ERROR 4
51 #define TIME_BUFFER_LENGTH 60
52 
53 #define MAX_ERROR_MSG_LEN 100
54 
58 #define MAX_OBJECT_COUNT 100
59 
62 typedef void *service_Whois;
65 typedef void *service_Logger;
66 
67 #define T_NONE 0 /* Nothing. */
68 #define T_DOMAIN 1 /* Object type domain. */
69 #define T_NSSET 2 /* Object type nsset. */
70 #define T_CONTACT 4 /* Object type contact. */
71 #define T_REGISTRAR 8 /* Object type registrar. */
72 #define T_KEYSET 16 /* Object type keyset. */
73 
77 typedef enum {
78  SA_NONE = 0,
79  SA_REGISTRANT,
80  SA_ADMIN_C,
81  SA_TEMP_C,
82  SA_NSSET,
83  SA_KEYSET,
84  SA_NSERVER,
85  SA_TECH_C
87 
91 /*
92  * This enum reflects database table request_type
93  */
94 typedef enum {
95  Info = 1105,
97 
101 typedef struct {
104  int type;
105  const char *value;
107 
109 typedef struct {
110  char *domain;
111  char *registrant;
112  char **admin_c;
113  char **temp_c;
114  char *nsset;
115  char *keyset;
116  char *registrar;
117  char **status;
118  char *registered;
119  char *changed;
120  char *expire;
122  int *status_ids;
123 }obj_domain;
124 
126 typedef struct {
127  char *nsset;
128  char **nserver;
129  char **nserver_addrs;
130  char **tech_c;
131  char *registrar;
132  char *created;
133  char *changed;
134 }obj_nsset;
135 
137 typedef struct {
138  int key_tag;
139  int alg;
141  char *digest;
144 
146 typedef struct {
147  int flags;
148  int protocol;
149  int alg;
150  char *public_key;
151 } keyset_dnskey;
152 
154 typedef struct {
155  char *keyset;
157  char **tech_c;
162  char *registrar;
163  char *created;
164  char *changed;
165 } obj_keyset;
166 
168 typedef struct {
169  char *contact;
170  char *org;
171  char *name;
172  char **address;
173  char *phone;
174  char *fax_no;
175  char *e_mail;
176  char *registrar;
177  char *created;
178  char *changed;
179  int disclose;
182 }obj_contact;
183 
185 typedef struct {
186  char *registrar;
187  char *org;
188  char *url;
189  char *phone;
190  char **address;
192 
194 typedef struct {
195  int type;
196  union {
197  obj_domain d;
198  obj_nsset n;
199  obj_keyset k;
200  obj_contact c;
201  obj_registrar r;
202  }obj;
204 
216 int
218  const whois_request *wr,
219  general_object *objects,
220  char *timebuf,
221  char *errmsg);
222 
232 void whois_release_data(general_object *object_list);
233 
234 int check_duplicates(int type, char *handle, general_object *objects, int index_free);
235 
246 int
248  const char *sourceIP,
249  const char *content,
250  ccReg_RequestProperties *properties,
251  ccReg_TID *log_entry_id,
252  char *errmsg);
253 
264 int
266  const char *content,
267  ccReg_RequestProperties *properties,
268  ccReg_TID log_entry_id,
269  CORBA_long result_code,
270  char *errmsg);
271 
272 #endif /* WHOIS_CLIENT_H */
char * name
Name of contact.
Definition: whois-client.h:171
int disclose
Whether this contact is published: 1 for true if this flag is set, only contact and registrar field a...
Definition: whois-client.h:179
char * created
Date of nsset creation.
Definition: whois-client.h:132
keyset_dnskey * keys
DNS Keys.
Definition: whois-client.h:160
Structure holding nsset data.
Definition: whois-client.h:126
int type
Object type number.
Definition: whois-client.h:195
char * registrar
Handle of registrar.
Definition: whois-client.h:176
char * registrar
Handle of registrar.
Definition: whois-client.h:116
int norecursion
if true, recursion is switched off
Definition: whois-client.h:103
char ** nserver
Nameservers in nsset.
Definition: whois-client.h:128
Structure holding domain data.
Definition: whois-client.h:109
int digest_type
Digest type (must be SHA-1)
Definition: whois-client.h:140
int alg
Algorithm type.
Definition: whois-client.h:139
char * domain
Domain name.
Definition: whois-client.h:110
char * registered
Date of domain registration.
Definition: whois-client.h:118
Structure holding registrar data.
Definition: whois-client.h:185
char ** nserver_addrs
IP Addresses for each nameserver.
Definition: whois-client.h:129
Structure holding keyset data.
Definition: whois-client.h:154
search_axis
Axes used in reverse searches.
Definition: whois-client.h:77
char * expire
Expiration date of domain.
Definition: whois-client.h:120
char * phone
Phone number.
Definition: whois-client.h:173
char * registrant
Registrant.
Definition: whois-client.h:111
char * keyset
Handle of keyset.
Definition: whois-client.h:155
void * service_Whois
reference to the whois corba service
Definition: whois-client.h:62
char * registrar
Handle of registrar.
Definition: whois-client.h:131
char * changed
Last update of nsset.
Definition: whois-client.h:133
char * contact
Handle of contact.
Definition: whois-client.h:169
char * registrar
Handle of registrar.
Definition: whois-client.h:162
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)
Update and close existing event using logging daemon.
Definition: whois-client.c:1260
keyset_dsrecord * ds
Delegation signer records.
Definition: whois-client.h:159
char ** tech_c
Handles of technical contacts.
Definition: whois-client.h:157
int * status_ids
Untranslated status numbers from corba.
Definition: whois-client.h:122
const char * value
value to search for
Definition: whois-client.h:105
DNSKey record (part of keyset object)
Definition: whois-client.h:146
Delegation signer record (part of keyset object)
Definition: whois-client.h:137
char * changed
Last update of domain.
Definition: whois-client.h:119
char * created
Date of contact creation.
Definition: whois-client.h:177
char ** tech_c
Handles of techical contacts.
Definition: whois-client.h:130
void whois_release_data(general_object *object_list)
Release data.
Definition: whois-client.c:1432
Whois request structure.
Definition: whois-client.h:101
char * registrar
Handle of registrar.
Definition: whois-client.h:186
search_axis axe
which object type is used as search criteria
Definition: whois-client.h:102
char * org
Organization name.
Definition: whois-client.h:170
char * created
Date of keyset creation.
Definition: whois-client.h:163
char * fax_no
Fax number.
Definition: whois-client.h:174
int alg
algorithm type
Definition: whois-client.h:149
int type
type of the objects we&#39;re looking for
Definition: whois-client.h:104
char * org
Organization.
Definition: whois-client.h:187
char ** address
Address information.
Definition: whois-client.h:190
char * keyset
KeySet handle.
Definition: whois-client.h:115
char * nsset
Handle of nsset.
Definition: whois-client.h:127
char * url
URL of registrar&#39;s web pages.
Definition: whois-client.h:188
int key_tag
Key tag for DNSKEY RR (RFC 4043 for details)
Definition: whois-client.h:138
int whois_corba_call(service_Whois service, const whois_request *wr, general_object *objects, char *timebuf, char *errmsg)
The core function of whois module performs actual query.
Definition: whois-client.c:1331
char ** temp_c
Temporary contacts.
Definition: whois-client.h:113
int flags
key properties.
Definition: whois-client.h:147
char * validated_to
Not NULL if it is an ENUM domain.
Definition: whois-client.h:121
char ** address
Address information.
Definition: whois-client.h:172
char * e_mail
Email.
Definition: whois-client.h:175
int max_sig_life
Signature expiration period.
Definition: whois-client.h:142
char * public_key
base64 encoded public key
Definition: whois-client.h:150
char ** status
Status array for domain.
Definition: whois-client.h:117
char * changed
Last update of keyset.
Definition: whois-client.h:164
whois_action_type
For now, only one action type is performed by whois.
Definition: whois-client.h:94
void * service_Logger
reference to the logger corba service
Definition: whois-client.h:65
Structure holding contact data.
Definition: whois-client.h:168
Structure able to hold any of the five types of whois objects.
Definition: whois-client.h:194
int whois_log_new_message(service_Logger service, const char *sourceIP, const char *content, ccReg_RequestProperties *properties, ccReg_TID *log_entry_id, char *errmsg)
Log a message using logging daemon.
Definition: whois-client.c:1187
int check_duplicates(int type, char *handle, general_object *objects, int index_free)
Check for duplicates in array of objects.
Definition: whois-client.c:180
int protocol
= 3
Definition: whois-client.h:148
char * digest
Digests in Delegation Signer records.
Definition: whois-client.h:141
char * nsset
Nsset handle.
Definition: whois-client.h:114
char * phone
Phone number.
Definition: whois-client.h:189
char ** admin_c
Administrators.
Definition: whois-client.h:112
char * changed
Last update of contact.
Definition: whois-client.h:178