fred-mod-whoisd
Classes | Macros | Typedefs | Enumerations | Functions
/builddir/build/BUILD/fred-mod-whoisd-3.12.2/whois-client.h File Reference
#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.

Classes

struct  whois_request
 
struct  obj_domain
 
struct  obj_nsset
 
struct  keyset_dsrecord
 
struct  keyset_dnskey
 
struct  obj_keyset
 
struct  obj_contact
 
struct  obj_registrar
 
struct  general_object
 

Macros

#define CORBA_OK   0
 
#define CORBA_OK_LIMIT   1
 
#define CORBA_SERVICE_FAILED   2
 
#define CORBA_INTERNAL_ERROR   3
 
#define CORBA_UNKNOWN_ERROR   4
 
#define TIME_BUFFER_LENGTH   60
 
#define MAX_ERROR_MSG_LEN   100
 
#define MAX_OBJECT_COUNT   100
 
#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
 
typedef void * service_Logger
 

Enumerations

enum  search_axis {
  SA_NONE = 0 , SA_REGISTRANT , SA_ADMIN_C , SA_TEMP_C ,
  SA_NSSET , SA_KEYSET , SA_NSERVER , SA_TECH_C
}
 
enum  whois_action_type { Info = 1105 }
 

Functions

int whois_corba_call (service_Whois service, const whois_request *wr, general_object *objects, char *timebuf, char *errmsg)
 
void whois_release_data (general_object *object_list)
 
int check_duplicates (int type, char *handle, general_object *objects, int index_free)
 
int whois_log_new_message (service_Logger service, const char *sourceIP, const char *content, ccReg_RequestProperties *properties, ccReg_TID *log_entry_id, char *errmsg)
 
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)
 

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

◆ MAX_ERROR_MSG_LEN

#define MAX_ERROR_MSG_LEN   100

Length of buffer used to hold error message from corba backend.

◆ MAX_OBJECT_COUNT

#define MAX_OBJECT_COUNT   100

Length of array for result objects and also a limit for maximal number of objects returned by whois query.

◆ TIME_BUFFER_LENGTH

#define TIME_BUFFER_LENGTH   60

Length of buffer used to hold time of response generation (must be enough even for RFC822 date).

Typedef Documentation

◆ service_Logger

typedef void* service_Logger

reference to the logger corba service

◆ service_Whois

typedef void* service_Whois

reference to the whois corba service

Enumeration Type Documentation

◆ search_axis

Axes used in reverse searches.

◆ whois_action_type

For now, only one action type is performed by whois

Function Documentation

◆ check_duplicates()

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.

◆ whois_close_log_message()

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.

◆ whois_corba_call()

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.

Call the right function for the specific object type / search axis / handle combination

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

◆ whois_log_new_message()

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

◆ whois_release_data()

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.

Parameters
object_listWhois data to be freed.

Release data of any of the objects

Parameters
objectsObject to release