fred-mod-whoisd-3.10.2
|
This file defines interface to CORBA backend. More...
Go to the source code of this file.
Data Structures | |
struct | whois_request |
Whois request structure. More... | |
struct | obj_domain |
Structure holding domain data. More... | |
struct | obj_nsset |
Structure holding nsset data. More... | |
struct | keyset_dsrecord |
Delegation signer record (part of keyset object) More... | |
struct | keyset_dnskey |
DNSKey record (part of keyset object) More... | |
struct | obj_keyset |
Structure holding keyset data. More... | |
struct | obj_contact |
Structure holding contact data. More... | |
struct | obj_registrar |
Structure holding registrar data. More... | |
struct | general_object |
Structure able to hold any of the five types of whois objects. More... | |
Defines | |
#define | CORBA_OK 0 |
No error occured. | |
#define | CORBA_OK_LIMIT 1 |
No error, but limit on # of objects was reached. | |
#define | CORBA_SERVICE_FAILED 2 |
Could not obtain object's reference. | |
#define | CORBA_INTERNAL_ERROR 3 |
Internal error == malloc failed. | |
#define | CORBA_UNKNOWN_ERROR 4 |
Unknown error returned over CORBA. | |
#define | TIME_BUFFER_LENGTH 60 |
Length of buffer used to hold time of response generation (must be enough even for RFC822 date). | |
#define | MAX_ERROR_MSG_LEN 100 |
Length of buffer used to hold error message from corba backend. | |
#define | MAX_OBJECT_COUNT 100 |
Length of array for result objects and also a limit for maximal number of objects returned by whois query. | |
#define | T_NONE 0 /* Nothing. */ |
#define | T_DOMAIN 1 /* Object type domain. */ |
#define | T_NSSET 2 /* Object type nsset. */ |
#define | T_CONTACT 4 /* Object type contact. */ |
#define | T_REGISTRAR 8 /* Object type registrar. */ |
#define | T_KEYSET 16 /* Object type keyset. */ |
Typedefs | |
typedef void * | service_Whois |
reference to the whois corba service | |
typedef void * | service_Logger |
reference to the logger corba service | |
Enumerations | |
enum | search_axis { SA_NONE = 0, SA_REGISTRANT, SA_ADMIN_C, SA_TEMP_C, SA_NSSET, SA_KEYSET, SA_NSERVER, SA_TECH_C } |
Axes used in reverse searches. | |
enum | whois_action_type { Info = 1105 } |
For now, only one action type is performed by whois. | |
Functions | |
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. | |
void | whois_release_data (general_object *object_list) |
Release data. | |
int | check_duplicates (int type, char *handle, general_object *objects, int index_free) |
Check for duplicates in array of objects. | |
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. | |
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. |
This file defines interface to CORBA backend.
The program is divided into two parts. First contains apache stuff and second implements CORBA calls to CORBA server, which are declared here.
#define MAX_ERROR_MSG_LEN 100 |
Length of buffer used to hold error message from corba backend.
Referenced by get_contact_by_handle(), get_domain_by_attr(), get_domain_by_handle(), get_keyset_by_attr(), get_keyset_by_handle(), get_nsset_by_attr(), get_nsset_by_handle(), get_registrar_by_handle(), log_whois_request(), process_whois_query(), translate_status(), whois_close_log_message(), and whois_log_new_message().
int check_duplicates | ( | int | type, |
char * | handle, | ||
general_object * | objects, | ||
int | index_free | ||
) |
Check for duplicates in array of objects.
type | Which type of objects to look for. |
handle | Handle of the object. |
objects | The structure for holding any type of object |
index_free | First free item in array of objects. |
References obj_contact::contact, obj_domain::domain, obj_keyset::keyset, obj_nsset::nsset, and obj_registrar::registrar.
Referenced by get_contact_by_handle(), get_domain_by_handle(), get_keyset_by_handle(), get_nsset_by_handle(), and get_registrar_by_handle().
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.
service | Whois CORBA object reference. |
content | Raw content of the message. |
properties | Custom properties parsed from the content |
log_entry_id | ID of the log entry to be close |
errmsg | Buffer for error message. |
References CORBA_OK, CORBA_SERVICE_FAILED, IS_NOT_COMM_FAILURE_EXCEPTION, MAX_ERROR_MSG_LEN, MAX_RETRIES, raised_exception, and RETR_SLEEP.
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.
service | Corba reference of remote whois object. |
wr | Representation of whois request. |
objects | List of objects to be printed. |
timebuf | Time of response generation (buffer must be TIME_BUFFER_LENGTH bytes long). |
errmsg | Buffer for error message. |
The core function of whois module performs actual query.
service | Whois CORBA object reference. |
wr | Whois request. |
objects | Array of resulting objects. |
timebuf | Timestamp. |
errmsg |
References whois_request::axe, CORBA_OK, CORBA_OK_LIMIT, get_contact_by_handle(), get_domain_by_attr(), get_domain_by_handle(), get_keyset_by_attr(), get_keyset_by_handle(), get_nsset_by_attr(), get_nsset_by_handle(), get_registrar_by_handle(), MAX_OBJECT_COUNT, whois_request::norecursion, TIME_BUFFER_LENGTH, translate_status(), whois_request::type, general_object::type, whois_request::value, and whois_release_data().
Referenced by process_whois_query().
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.
service | Whois CORBA object reference. |
sourceIP | IP of the host which sent the request. |
content | Raw content of the message. |
properties | Custom properties parsed from the content |
errmsg | Buffer for error message. |
Log a message using logging daemon.
service | Whois CORBA object reference. |
sourceIP | IP of the host which sent the request. |
content | Raw content of the message. |
properties | Custom properties parsed from the content |
log_entry_id | Output of ID from event logger |
errmsg | Buffer for error message. |
References CORBA_OK, CORBA_SERVICE_FAILED, IS_NOT_COMM_FAILURE_EXCEPTION, LC_UNIX_WHOIS, MAX_ERROR_MSG_LEN, MAX_RETRIES, raised_exception, and RETR_SLEEP.
Referenced by log_whois_request().
void whois_release_data | ( | general_object * | objects | ) |
Release data.
We don't want to mix apache pools with malloc and free routines within one file, so we have to explicitly call this function in order to release whois data returned from previous call. You must NOT pass NULL pointer as argument.
object_list | Whois data to be freed. |
Release data.
objects | Object to release |
References obj_contact::address, obj_registrar::address, obj_domain::admin_c, obj_domain::changed, obj_nsset::changed, obj_keyset::changed, obj_contact::changed, obj_contact::contact, obj_nsset::created, obj_keyset::created, obj_contact::created, keyset_dsrecord::digest, obj_contact::disclose, obj_domain::domain, obj_keyset::ds, obj_contact::e_mail, obj_domain::expire, obj_contact::fax_no, obj_keyset::keys, obj_domain::keyset, obj_keyset::keyset, MAX_OBJECT_COUNT, obj_contact::name, obj_nsset::nserver, obj_nsset::nserver_addrs, obj_domain::nsset, obj_nsset::nsset, general_object::obj, obj_contact::org, obj_registrar::org, obj_contact::phone, obj_registrar::phone, keyset_dnskey::public_key, obj_domain::registered, obj_domain::registrant, obj_domain::registrar, obj_nsset::registrar, obj_keyset::registrar, obj_contact::registrar, obj_registrar::registrar, obj_domain::status, obj_domain::status_ids, obj_nsset::tech_c, obj_keyset::tech_c, general_object::type, obj_registrar::url, and obj_domain::validated_to.
Referenced by process_whois_query(), and whois_corba_call().