Go to the documentation of this file.
27 #ifndef WHOIS_CLIENT_H
28 #define WHOIS_CLIENT_H
42 #define CORBA_OK_LIMIT 1
43 #define CORBA_SERVICE_FAILED 2
44 #define CORBA_INTERNAL_ERROR 3
45 #define CORBA_UNKNOWN_ERROR 4
54 #define TIME_BUFFER_LENGTH 60
56 #define MAX_ERROR_MSG_LEN 100
61 #define MAX_OBJECT_COUNT 100
251 const char *sourceIP,
253 ccReg_RequestProperties *properties,
254 ccReg_TID *log_entry_id,
270 ccReg_RequestProperties *properties,
271 ccReg_TID log_entry_id,
272 CORBA_long result_code,
int protocol
= 3
Definition: whois-client.h:151
char * created
Date of nsset creation.
Definition: whois-client.h:135
int type
type of the objects we're looking for
Definition: whois-client.h:107
static apr_status_t log_whois_request(whois_request *wr, conn_rec *c, char *content, whoisd_server_conf *sc, ccReg_TID *log_entry_id)
Call fred-logd now it mostly returns APR_SUCCESS because logger failure isn't fatal to whois itself o...
Definition: mod_whoisd.c:1001
char * changed
Last update of nsset.
Definition: whois-client.h:136
void whois_release_data(general_object *object_list)
Release data.
Definition: whois-client.c:1434
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:1262
keyset_dsrecord * ds
Delegation signer records.
Definition: whois-client.h:162
static int recurse_domain(service_Whois service, int rec, obj_domain *d, general_object *objects, int *index_free, char *errmsg)
The function does recursion on domain.
Definition: whois-client.c:991
static apr_status_t whois_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
Whois output filter inserts in front of every <LF>, which is not preceeded by <CR>,...
Definition: mod_whoisd.c:1391
#define MAX_WHOIS_REQUEST_LENGTH
Maximal length of input line.
Definition: mod_whoisd.c:94
char * registrar
Handle of registrar.
Definition: whois-client.h:165
search_axis axe
which object type is used as search criteria
Definition: whois-client.h:105
#define MAX_RETRIES
Max # of retries when COMM_FAILURE exception during CORBA call occurs.
Definition: whois-client.c:53
Structure holding registrar data.
Definition: whois-client.h:188
#define IS_SEARCH_SET(wr)
checks if there is any kind of search set in the query
Definition: mod_whoisd.c:120
int * status_ids
Untranslated status numbers from corba.
Definition: whois-client.h:125
static int get_registrar_by_handle(service_Whois service, const char *handle, general_object *objects, int *index_free, char *errmsg)
Search registrar by handle.
Definition: whois-client.c:243
static int recurse_keyset(service_Whois service, int rec, obj_keyset *k, general_object *objects, int *index_free, char *errmsg)
The function does recursion on keyset.
Definition: whois-client.c:592
static const char * indexlist
List of attributes which can be used in search, this is displayed with -q indexes.
Definition: mod_whoisd.c:159
static int translate_status(service_Whois service, general_object *objects, char *errmsg)
Translate status ids by domain objects to appropriate strings.
Definition: whois-client.c:880
#define MIN_WHOIS_REQUEST_LENGTH
Minimal length of input line.
Definition: mod_whoisd.c:93
char * registrar
Handle of registrar.
Definition: whois-client.h:119
static void print_keyset_object(apr_bucket_brigade *bb, obj_keyset *k)
Function prints keyset information to bucket brigade.
Definition: mod_whoisd.c:477
#define DEFAULT_DISCLAIMER
This default disclaimer should never be used in production release.
Definition: mod_whoisd.c:81
static void copy_keyset(general_object *obj, ccReg_KeySetDetail *c_keyset)
Copy corba representation of keyset object to our representation.
Definition: whois-client.c:494
static int get_keyset_by_handle(service_Whois service, const char *handle, int rec, general_object *objects, int *index_free, char *errmsg)
Search keyset by handle and dependent objects if recursion is switched on.
Definition: whois-client.c:684
char * object
Name of whois object.
Definition: mod_whoisd.c:105
#define TIME_BUFFER_LENGTH
Length of buffer used to hold time of response generation (must be enough even for RFC822 date).
Definition: whois-client.h:54
int alg
Algorithm type.
Definition: whois-client.h:142
static const char * set_whois_protocol(cmd_parms *cmd, void *dummy, int flag)
Routine disables or enables the operation of mod_whois.
Definition: mod_whoisd.c:1490
void whois_release_data(general_object *objects)
Release data of any of the objects.
Definition: whois-client.c:1434
static const char * templatelist
List of templates for all five object types.
Definition: mod_whoisd.c:182
char * registrant
Registrant.
Definition: whois-client.h:114
#define CORBA_SERVICE_FAILED
Could not obtain object's reference.
Definition: whois-client.h:43
module AP_MODULE_DECLARE_DATA whoisd_module
Whois module declaration.
Definition: mod_whoisd.c:96
#define ID_STATUS_OBJ_LINKED
ID of object status 'Linked'.
Definition: whois-client.c:44
void * service_Whois
reference to the whois corba service
Definition: whois-client.h:65
char * changed
Last update of keyset.
Definition: whois-client.h:167
char * registrar
Handle of registrar.
Definition: whois-client.h:189
char ** nserver
Nameservers in nsset.
Definition: whois-client.h:131
int flags
key properties.
Definition: whois-client.h:150
char * registered
Date of domain registration.
Definition: whois-client.h:121
int digest_type
Digest type (must be SHA-1)
Definition: whois-client.h:143
Structure holding keyset data.
Definition: whois-client.h:157
static int whois_postconfig_hook(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
Postconfig hook is a good occasion to check consistency of mod_whoisd configuration and to initialize...
Definition: mod_whoisd.c:1447
#define IS_NOT_COMM_FAILURE_EXCEPTION(_ev)
True if CORBA exception is COMM_FAILURE, which is used in retry loop.
Definition: whois-client.c:57
static void * create_whoisd_config(apr_pool_t *p, server_rec *s)
Create server configuration for whoisd module.
Definition: mod_whoisd.c:1677
#define MAXQPARLEN
Maximal length of -q parameter.
Definition: mod_whoisd.c:92
char * keyset
Handle of keyset.
Definition: whois-client.h:158
static void copy_nsset(general_object *obj, ccReg_NSSetDetail *c_nsset)
Copy corba representation of nsset object to our representation.
Definition: whois-client.c:441
static int get_contact_by_handle(service_Whois service, const char *handle, general_object *objects, int *index_free, char *errmsg)
Search contact by handle.
Definition: whois-client.c:321
Structure holding nsset data.
Definition: whois-client.h:129
Structure able to hold any of the five types of whois objects.
Definition: whois-client.h:197
char ** tech_c
Handles of techical contacts.
Definition: whois-client.h:133
int whoisd_enabled
Enabled/disabled flag.
Definition: mod_whoisd.c:102
int alg
algorithm type
Definition: whois-client.h:152
static void print_registrar_object(apr_bucket_brigade *bb, obj_registrar *r)
Function prints registrar information to bucket brigade.
Definition: mod_whoisd.c:569
char * created
Date of keyset creation.
Definition: whois-client.h:166
static void print_nsset_object(apr_bucket_brigade *bb, obj_nsset *n)
Function prints nsset information to bucket brigade.
Definition: mod_whoisd.c:407
#define NULL_STRDUP(src)
Call strdup on string only if it is not empty, otherwise return NULL.
Definition: whois-client.c:64
char * nsset
Nsset handle.
Definition: whois-client.h:117
static void copy_domain(general_object *obj, ccReg_DomainDetail *c_domain)
Copy corba representation of domain object to our representation.
Definition: whois-client.c:938
#define raised_exception(ev)
A shortcut for testing of CORBA exception appearence.
Definition: whois-client.c:51
#define ap_log_cerror(mark, level, status, c,...)
This is wrapper function for compatibility reason.
Definition: mod_whoisd.c:114
char ** tech_c
Handles of technical contacts.
Definition: whois-client.h:160
char * changed
Last update of domain.
Definition: whois-client.h:122
char * disclaimer
Disclaimer as a string.
Definition: mod_whoisd.c:104
union general_object::@0 obj
Union that can represent any of the objects.
Delegation signer record (part of keyset object)
Definition: whois-client.h:140
keyset_dnskey * keys
DNS Keys.
Definition: whois-client.h:163
static void register_hooks(apr_pool_t *p)
Function registering hooks of whoisd module.
Definition: mod_whoisd.c:1690
static void print_intro(apr_bucket_brigade *bb, conn_rec *c, const char *disclaimer, const char *timestamp)
Print whois disclaimer into the bucket brigade.
Definition: mod_whoisd.c:237
char * expire
Expiration date of domain.
Definition: whois-client.h:123
char * keyset
KeySet handle.
Definition: whois-client.h:118
static int get_nsset_by_handle(service_Whois service, const char *handle, int rec, general_object *objects, int *index_free, char *errmsg)
Search nsset by handle and dependent objects if recursion is switched on.
Definition: whois-client.c:624
static char * wrap_str(const char *str)
Function wraps strings passed from XML parser into strings accepted by CORBA.
Definition: mod_whoisd.c:982
Whois request structure.
Definition: whois-client.h:104
#define CORBA_OK_LIMIT
No error, but limit on # of objects was reached.
Definition: whois-client.h:42
static int get_keyset_by_attr(service_Whois service, const char *key, ccReg_KeySetInvKeyType attr, int rec, general_object *objects, int *index_free, char *errmsg)
Search keyset by its attribute and dependent objects if recursion is switched on.
Definition: whois-client.c:817
Configuration structure of whoisd module.
Definition: mod_whoisd.c:101
static int process_whois_connection(conn_rec *c)
Connection handler of mod_whoisd module.
Definition: mod_whoisd.c:1131
char * logger_object
Name of logger object.
Definition: mod_whoisd.c:106
DNSKey record (part of keyset object)
Definition: whois-client.h:149
static void print_contact_object(apr_bucket_brigade *bb, obj_contact *c)
Function prints contact information to bucket brigade.
Definition: mod_whoisd.c:530
char ** address
Address information.
Definition: whois-client.h:193
char ** status
Status array for domain.
Definition: whois-client.h:120
static int getobjtype(int *bittype, const char *strtype)
Function converts object type from string form to bit form.
Definition: mod_whoisd.c:945
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:1262
#define CORBA_INTERNAL_ERROR
Internal error == malloc failed.
Definition: whois-client.h:44
int max_sig_life
Signature expiration period.
Definition: whois-client.h:145
whois_action_type
For now, only one action type is performed by whois.
Definition: whois-client.h:97
static int get_domain_by_handle(service_Whois service, const char *handle, int rec, general_object *objects, int *index_free, char *errmsg)
Search domain by fqdn and dependent objects if recursion is switched on.
Definition: whois-client.c:1060
char ** temp_c
Temporary contacts.
Definition: whois-client.h:116
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:1189
char ** nserver_addrs
IP Addresses for each nameserver.
Definition: whois-client.h:132
static const char * usagestr
Error message in case of incorrect usage.
Definition: mod_whoisd.c:124
int key_tag
Key tag for DNSKEY RR (RFC 4043 for details)
Definition: whois-client.h:141
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:1333
char * url
URL of registrar's web pages.
Definition: whois-client.h:191
char * nsset
Handle of nsset.
Definition: whois-client.h:130
static const command_rec whoisd_cmds[]
Structure defining configuration options for whoisd module.
Definition: mod_whoisd.c:1656
static int get_nsset_by_attr(service_Whois service, const char *key, ccReg_NSSetInvKeyType attr, int rec, general_object *objects, int *index_free, char *errmsg)
Search nsset by its attribute and dependent objects if recursion is switched on.
Definition: whois-client.c:749
char * domain
Domain name.
Definition: whois-client.h:113
#define MAXARGS
Maximal number of whois arguments.
Definition: mod_whoisd.c:89
static char * read_request(conn_rec *c, int *http_status)
This will read whois request (one line of text).
Definition: mod_whoisd.c:851
#define IS_OBJECT_NOT_FOUND(_ev)
True if CORBA exception is ObjectNotFound.
Definition: whois-client.c:60
static int get_domain_by_attr(service_Whois service, const char *key, ccReg_DomainInvKeyType attr, int rec, general_object *objects, int *index_free, char *errmsg)
Search domain by its attribute and dependent objects if recursion is switched on.
Definition: whois-client.c:1125
int norecursion
if true, recursion is switched off
Definition: whois-client.h:106
#define MAX_ERROR_MSG_LEN
Length of buffer used to hold error message from corba backend.
Definition: whois-client.h:56
static const char * set_logger_object(cmd_parms *cmd, void *dummy, const char *name)
Routine sets name under which logger object is registered by nameservice.
Definition: mod_whoisd.c:1592
const int LC_UNIX_WHOIS
code of the servie according to the database table ‘service’
Definition: whois-client.c:73
int type
Object type number.
Definition: whois-client.h:198
const char * disclaimer_filename
File with disclaimer.
Definition: mod_whoisd.c:103
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:1189
Structure holding domain data.
Definition: whois-client.h:112
int check_duplicates(int type, char *handle, general_object *objects, int index_free)
Check for duplicates in array of objects.
Definition: whois-client.c:182
static void * get_corba_service(conn_rec *c, char *name)
Definition: mod_whoisd.c:594
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:1333
char ** admin_c
Administrators.
Definition: whois-client.h:115
#define RETR_SLEEP
Sleep interval in microseconds between retries.
Definition: whois-client.c:55
char * registrar
Handle of registrar.
Definition: whois-client.h:134
void * service_Logger
reference to the logger corba service
Definition: whois-client.h:68
static int recurse_nsset(service_Whois service, int rec, obj_nsset *n, general_object *objects, int *index_free, char *errmsg)
The function does recursion on nsset.
Definition: whois-client.c:560
static void print_domain_object(apr_bucket_brigade *bb, obj_domain *d)
Function prints domain information to bucket brigade.
Definition: mod_whoisd.c:371
static const char * set_whois_object(cmd_parms *cmd, void *dummy, const char *name)
Routine sets name under which is registered whois object by nameservice.
Definition: mod_whoisd.c:1628
#define CORBA_OK
No error occured.
Definition: whois-client.h:40
char * validated_to
Not NULL if it is an ENUM domain.
Definition: whois-client.h:124
static void send_error(conn_rec *c, const char *disclaimer, int nerr)
Routine trigerred upon error.
Definition: mod_whoisd.c:315
char * digest
Digests in Delegation Signer records.
Definition: whois-client.h:144
const char * value
value to search for
Definition: whois-client.h:108
static const char * set_disclaimer_file(cmd_parms *cmd, void *dummy, const char *a1)
Routine accepts name of file with disclaimer, it also reads the file and stores disclaimer in server ...
Definition: mod_whoisd.c:1513
const int IP_ADDR_LEN
maximum length of a string containing IP address
Definition: whois-client.c:68
char * org
Organization.
Definition: whois-client.h:190
#define MAX_OBJECT_COUNT
Length of array for result objects and also a limit for maximal number of objects returned by whois q...
Definition: whois-client.h:61
char * public_key
base64 encoded public key
Definition: whois-client.h:153
int check_duplicates(int type, char *handle, general_object *objects, int index_free)
Check for duplicates in array of objects.
Definition: whois-client.c:182
search_axis
Axes used in reverse searches.
Definition: whois-client.h:80
static apr_status_t process_whois_query(conn_rec *c, whoisd_server_conf *sc, whois_request *wr, ccReg_TID log_entry_id)
Whois request processor.
Definition: mod_whoisd.c:655
char * phone
Phone number.
Definition: whois-client.h:192
#define MAXAXELEN
Maximal length of search axe identifier.
Definition: mod_whoisd.c:91