fred-mod-whoisd
|
#include <assert.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <orbit/orbit.h>
#include <ORBitservices/CosNaming.h>
#include "whois-client.h"
#include "Whois.h"
Macros | |
#define | ID_STATUS_OBJ_LINKED 16 |
#define | ID_STATUS_OBJ_MOJEIDCONTACT 24 |
#define | raised_exception(ev) ((ev)->_major != CORBA_NO_EXCEPTION) |
#define | MAX_RETRIES 3 |
#define | RETR_SLEEP 100000 |
#define | IS_NOT_COMM_FAILURE_EXCEPTION(_ev) (strcmp((_ev)->_id, "IDL:omg.org/CORBA/COMM_FAILURE:1.0")) |
#define | IS_OBJECT_NOT_FOUND(_ev) (!strcmp((_ev)->_id, "IDL:ccReg/Whois/ObjectNotFound:1.0")) |
#define | NULL_STRDUP(src) ((*(src) == '\0') ? NULL : strdup(src)) |
#define | COPY_ADDRESS_LINE(str) do{ if (*(str) != '\0') r->address[line++] = strdup(str); }while(0) |
#define | COPY_ADDRESS_LINE(str) do{ if (*(str) != '\0') c->address[line++] = strdup(str); }while(0) |
Functions | |
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) |
int | whois_corba_call (service_Whois service, const whois_request *wr, general_object *objects, char *timebuf, char *errmsg) |
void | whois_release_data (general_object *objects) |
Variables | |
const int | IP_ADDR_LEN = 39 |
const int | LC_UNIX_WHOIS = 0 |
Implementation of CORBA backend used for querying CORBA server for information about an object.
#define ID_STATUS_OBJ_LINKED 16 |
ID of object status 'Linked'
#define ID_STATUS_OBJ_MOJEIDCONTACT 24 |
ID of object status 'mojeidContact'
#define IS_NOT_COMM_FAILURE_EXCEPTION | ( | _ev | ) | (strcmp((_ev)->_id, "IDL:omg.org/CORBA/COMM_FAILURE:1.0")) |
True if CORBA exception is COMM_FAILURE, which is used in retry loop.
#define IS_OBJECT_NOT_FOUND | ( | _ev | ) | (!strcmp((_ev)->_id, "IDL:ccReg/Whois/ObjectNotFound:1.0")) |
True if CORBA exception is ObjectNotFound
#define MAX_RETRIES 3 |
Max # of retries when COMM_FAILURE exception during CORBA call occurs.
#define NULL_STRDUP | ( | src | ) | ((*(src) == '\0') ? NULL : strdup(src)) |
Call strdup on string only if it is not empty, otherwise return NULL.
#define raised_exception | ( | ev | ) | ((ev)->_major != CORBA_NO_EXCEPTION) |
A shortcut for testing of CORBA exception appearence.
#define RETR_SLEEP 100000 |
Sleep interval in microseconds between retries.
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. |
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. |
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
service | Whois CORBA object reference. |
wr | Whois request. |
objects | Array of resulting objects. |
timebuf | Timestamp. |
errmsg |
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
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. |
void whois_release_data | ( | general_object * | objects | ) |
Release data of any of the objects
objects | Object to release |
const int IP_ADDR_LEN = 39 |
maximum length of a string containing IP address
const int LC_UNIX_WHOIS = 0 |
code of the servie according to the database table ‘service’