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 
29 #include "Logger.h"
30 
39 #define CORBA_OK 0
41 #define CORBA_OK_LIMIT 1
42 #define CORBA_SERVICE_FAILED 2
43 #define CORBA_INTERNAL_ERROR 3
44 #define CORBA_UNKNOWN_ERROR 4
53 #define TIME_BUFFER_LENGTH 60
54 
55 #define MAX_ERROR_MSG_LEN 100
56 
60 #define MAX_OBJECT_COUNT 100
61 
64 typedef void *service_Whois;
67 typedef void *service_Logger;
68 
69 #define T_NONE 0 /* Nothing. */
70 #define T_DOMAIN 1 /* Object type domain. */
71 #define T_NSSET 2 /* Object type nsset. */
72 #define T_CONTACT 4 /* Object type contact. */
73 #define T_REGISTRAR 8 /* Object type registrar. */
74 #define T_KEYSET 16 /* Object type keyset. */
75 
79 typedef enum {
80  SA_NONE = 0,
81  SA_REGISTRANT,
82  SA_ADMIN_C,
83  SA_TEMP_C,
84  SA_NSSET,
85  SA_KEYSET,
86  SA_NSERVER,
87  SA_TECH_C
89 
93 /*
94  * This enum reflects database table request_type
95  */
96 typedef enum {
97  Info = 1105,
99 
103 typedef struct {
106  int type;
107  const char *value;
109 
111 typedef struct {
112  char *domain;
113  char *registrant;
114  char **admin_c;
115  char **temp_c;
116  char *nsset;
117  char *keyset;
118  char *registrar;
119  char **status;
120  char *registered;
121  char *changed;
122  char *expire;
124  int *status_ids;
125 }obj_domain;
126 
128 typedef struct {
129  char *nsset;
130  char **nserver;
131  char **nserver_addrs;
132  char **tech_c;
133  char *registrar;
134  char *created;
135  char *changed;
136 }obj_nsset;
137 
139 typedef struct {
140  int key_tag;
141  int alg;
143  char *digest;
146 
148 typedef struct {
149  int flags;
150  int protocol;
151  int alg;
152  char *public_key;
153 } keyset_dnskey;
154 
156 typedef struct {
157  char *keyset;
159  char **tech_c;
164  char *registrar;
165  char *created;
166  char *changed;
167 } obj_keyset;
168 
170 typedef struct {
171  char *contact;
172  char *org;
173  char *name;
174  char **address;
175  char *phone;
176  char *fax_no;
177  char *e_mail;
178  char *registrar;
179  char *created;
180  char *changed;
181  int disclose;
184 }obj_contact;
185 
187 typedef struct {
188  char *registrar;
189  char *org;
190  char *url;
191  char *phone;
192  char **address;
194 
196 typedef struct {
197  int type;
198  union {
199  obj_domain d;
200  obj_nsset n;
201  obj_keyset k;
202  obj_contact c;
203  obj_registrar r;
204  }obj;
206 
218 int
220  const whois_request *wr,
221  general_object *objects,
222  char *timebuf,
223  char *errmsg);
224 
234 void whois_release_data(general_object *object_list);
235 
236 int check_duplicates(int type, char *handle, general_object *objects, int index_free);
237 
248 int
250  const char *sourceIP,
251  const char *content,
252  ccReg_RequestProperties *properties,
253  ccReg_TID *log_entry_id,
254  char *errmsg);
255 
266 int
268  const char *content,
269  ccReg_RequestProperties *properties,
270  ccReg_TID log_entry_id,
271  CORBA_long result_code,
272  char *errmsg);
273 
274 #endif /* WHOIS_CLIENT_H */
char * name
Name of contact.
Definition: whois-client.h:173
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:181
char * created
Date of nsset creation.
Definition: whois-client.h:134
keyset_dnskey * keys
DNS Keys.
Definition: whois-client.h:162
Structure holding nsset data.
Definition: whois-client.h:128
int type
Object type number.
Definition: whois-client.h:197
char * registrar
Handle of registrar.
Definition: whois-client.h:178
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 new event using logging daemon.
Definition: whois-client.c:1188
int check_duplicates(int type, char *handle, general_object *objects, int index_free)
Check for duplicates in array of objects.
Definition: whois-client.c:181
void whois_release_data(general_object *objects)
Release data of any of the objects.
Definition: whois-client.c:1433
char * registrar
Handle of registrar.
Definition: whois-client.h:118
int norecursion
if true, recursion is switched off
Definition: whois-client.h:105
char ** nserver
Nameservers in nsset.
Definition: whois-client.h:130
Structure holding domain data.
Definition: whois-client.h:111
int digest_type
Digest type (must be SHA-1)
Definition: whois-client.h:142
int alg
Algorithm type.
Definition: whois-client.h:141
char * domain
Domain name.
Definition: whois-client.h:112
char * registered
Date of domain registration.
Definition: whois-client.h:120
Structure holding registrar data.
Definition: whois-client.h:187
char ** nserver_addrs
IP Addresses for each nameserver.
Definition: whois-client.h:131
Structure holding keyset data.
Definition: whois-client.h:156
search_axis
Axes used in reverse searches.
Definition: whois-client.h:79
char * expire
Expiration date of domain.
Definition: whois-client.h:122
char * phone
Phone number.
Definition: whois-client.h:175
char * registrant
Registrant.
Definition: whois-client.h:113
char * keyset
Handle of keyset.
Definition: whois-client.h:157
void * service_Whois
reference to the whois corba service
Definition: whois-client.h:64
char * registrar
Handle of registrar.
Definition: whois-client.h:133
char * changed
Last update of nsset.
Definition: whois-client.h:135
char * contact
Handle of contact.
Definition: whois-client.h:171
char * registrar
Handle of registrar.
Definition: whois-client.h:164
keyset_dsrecord * ds
Delegation signer records.
Definition: whois-client.h:161
char ** tech_c
Handles of technical contacts.
Definition: whois-client.h:159
int * status_ids
Untranslated status numbers from corba.
Definition: whois-client.h:124
const char * value
value to search for
Definition: whois-client.h:107
DNSKey record (part of keyset object)
Definition: whois-client.h:148
Delegation signer record (part of keyset object)
Definition: whois-client.h:139
char * changed
Last update of domain.
Definition: whois-client.h:121
char * created
Date of contact creation.
Definition: whois-client.h:179
char ** tech_c
Handles of techical contacts.
Definition: whois-client.h:132
Whois request structure.
Definition: whois-client.h:103
char * registrar
Handle of registrar.
Definition: whois-client.h:188
search_axis axe
which object type is used as search criteria
Definition: whois-client.h:104
char * org
Organization name.
Definition: whois-client.h:172
char * created
Date of keyset creation.
Definition: whois-client.h:165
char * fax_no
Fax number.
Definition: whois-client.h:176
int alg
algorithm type
Definition: whois-client.h:151
int type
type of the objects we&#39;re looking for
Definition: whois-client.h:106
char * org
Organization.
Definition: whois-client.h:189
char ** address
Address information.
Definition: whois-client.h:192
char * keyset
KeySet handle.
Definition: whois-client.h:117
char * nsset
Handle of nsset.
Definition: whois-client.h:129
char * url
URL of registrar&#39;s web pages.
Definition: whois-client.h:190
int key_tag
Key tag for DNSKEY RR (RFC 4043 for details)
Definition: whois-client.h:140
char ** temp_c
Temporary contacts.
Definition: whois-client.h:115
int flags
key properties.
Definition: whois-client.h:149
char * validated_to
Not NULL if it is an ENUM domain.
Definition: whois-client.h:123
char ** address
Address information.
Definition: whois-client.h:174
char * e_mail
Email.
Definition: whois-client.h:177
int max_sig_life
Signature expiration period.
Definition: whois-client.h:144
char * public_key
base64 encoded public key
Definition: whois-client.h:152
char ** status
Status array for domain.
Definition: whois-client.h:119
char * changed
Last update of keyset.
Definition: whois-client.h:166
whois_action_type
For now, only one action type is performed by whois.
Definition: whois-client.h:96
int whois_corba_call(service_Whois service, const whois_request *wr, general_object *objects, char *timebuf, char *errmsg)
Call the right function for the specific object type / search axis / handle combination.
Definition: whois-client.c:1332
void * service_Logger
reference to the logger corba service
Definition: whois-client.h:67
Structure holding contact data.
Definition: whois-client.h:170
Structure able to hold any of the five types of whois objects.
Definition: whois-client.h:196
int protocol
= 3
Definition: whois-client.h:150
char * digest
Digests in Delegation Signer records.
Definition: whois-client.h:143
char * nsset
Nsset handle.
Definition: whois-client.h:116
char * phone
Phone number.
Definition: whois-client.h:191
char ** admin_c
Administrators.
Definition: whois-client.h:114
char * changed
Last update of contact.
Definition: whois-client.h:180
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:1261