fred-mod-whoisd-3.12.1
Data Structures | Macros | Typedefs | Enumerations | Functions
whois-client.h File Reference

This file defines interface to CORBA backend. More...

#include "Logger.h"
Include dependency graph for whois-client.h:
This graph shows which files directly or indirectly include this file:

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...
 

Macros

#define CORBA_OK   0
 No error occured. More...
 
#define CORBA_OK_LIMIT   1
 No error, but limit on # of objects was reached. More...
 
#define CORBA_SERVICE_FAILED   2
 Could not obtain object's reference. More...
 
#define CORBA_INTERNAL_ERROR   3
 Internal error == malloc failed. More...
 
#define CORBA_UNKNOWN_ERROR   4
 Unknown error returned over CORBA. More...
 
#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. More...
 
#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. More...
 
void whois_release_data (general_object *object_list)
 Release data. More...
 
int check_duplicates (int type, char *handle, general_object *objects, int index_free)
 Check for duplicates in array of objects. More...
 
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. More...
 
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. More...
 

Detailed Description

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.

Macro Definition Documentation

#define MAX_ERROR_MSG_LEN   100

Function Documentation

int check_duplicates ( int  type,
char *  handle,
general_object objects,
int  index_free 
)

Check for duplicates in array of objects.

Parameters
typeWhich type of objects to look for.
handleHandle of the object.
objectsThe structure for holding any type of object
index_freeFirst free item in array of objects.
Returns
0 if no duplicates are present, 1 otherwise.

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.

Parameters
serviceWhois CORBA object reference.
contentRaw content of the message.
propertiesCustom properties parsed from the content
log_entry_idID of the log entry to be close
errmsgBuffer for error message.
Returns
Status.

References CORBA_OK, CORBA_SERVICE_FAILED, IS_NOT_COMM_FAILURE_EXCEPTION, MAX_ERROR_MSG_LEN, MAX_RETRIES, raised_exception, and RETR_SLEEP.

Referenced by process_whois_query().

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.

Parameters
serviceCorba reference of remote whois object.
wrRepresentation of whois request.
objectsList of objects to be printed.
timebufTime of response generation (buffer must be TIME_BUFFER_LENGTH bytes long).
errmsgBuffer for error message.
Returns
Status code.

The core function of whois module performs actual query.

Parameters
serviceWhois CORBA object reference.
wrWhois request.
objectsArray of resulting objects.
timebufTimestamp.
errmsg
Returns
Status.

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.

Parameters
serviceWhois CORBA object reference.
sourceIPIP of the host which sent the request.
contentRaw content of the message.
propertiesCustom properties parsed from the content
errmsgBuffer for error message.
Returns
Status.

Log a message using logging daemon.

Parameters
serviceWhois CORBA object reference.
sourceIPIP of the host which sent the request.
contentRaw content of the message.
propertiesCustom properties parsed from the content
log_entry_idOutput of ID from event logger
errmsgBuffer for error message.
Returns
Status.

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)