fred-mod-eppd
Macros | Typedefs | Enumerations | Functions
/build/mod-eppd-2.21.0/epp-client.h File Reference
#include "EPP.h"
#include "epp_common.h"
Include dependency graph for epp-client.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MAX_RETRIES   3
 
#define RETR_SLEEP   100000
 
#define raised_exception(ev)   ((ev)->_major != CORBA_NO_EXCEPTION)
 
#define DB_FIELD_SIZE   2000
 
#define IS_NOT_COMM_FAILURE_EXCEPTION(_ev)   (strcmp((_ev)->_id, "IDL:omg.org/CORBA/COMM_FAILURE:1.0"))
 
#define IS_EPP_ERROR(_ev)   (!strcmp((_ev)->_id, "IDL:ccReg/EPP/EppError:1.0"))
 
#define IS_NO_MESSAGES(_ev)   (!strcmp((_ev)->_id, "IDL:ccReg/EPP/NoMessages:1.0"))
 
#define MAX_ERROR_MSG_LEN   100
 

Typedefs

typedef void * service_EPP
 
typedef void * service_Logger
 

Enumerations

enum  corba_status { CORBA_OK, CORBA_ERROR, CORBA_INT_ERROR, CORBA_REMOTE_ERROR }
 

Functions

char * wrap_str (const char *str)
 
int epp_call_hello (epp_context *epp_ctx, service_EPP service, char **version, char **curdate)
 
corba_status epp_call_login (epp_context *epp_ctx, service_EPP service, unsigned long long *loginid, const ccReg_TID request_id, epp_lang *lang, const char *fingerprint, epp_command_data *cdata)
 
corba_status epp_call_logout (epp_context *epp_ctx, service_EPP service, unsigned long long *loginid, const ccReg_TID request_id, epp_command_data *cdata)
 
corba_status epp_call_cmd (epp_context *epp_ctx, service_EPP service, unsigned long long loginid, const ccReg_TID request_id, epp_command_data *cdata)
 
void epp_call_save_output_xml (epp_context *epp_ctx, service_EPP service, epp_command_data *cdata, const char *xml)
 
void epp_call_CloseSession (epp_context *epp_ctx, service_EPP service, unsigned long long loginid)
 

Detailed Description

Interface definition of corba module.

Macro Definition Documentation

#define DB_FIELD_SIZE   2000

Maximal size of property value in database

#define IS_EPP_ERROR (   _ev)    (!strcmp((_ev)->_id, "IDL:ccReg/EPP/EppError:1.0"))

True if exception is EPP_ERROR.

#define IS_NO_MESSAGES (   _ev)    (!strcmp((_ev)->_id, "IDL:ccReg/EPP/NoMessages:1.0"))

True if exception is NO_MESSAGES.

#define IS_NOT_COMM_FAILURE_EXCEPTION (   _ev)    (strcmp((_ev)->_id, "IDL:omg.org/CORBA/COMM_FAILURE:1.0"))

True if exception is COMM_FAILURE, which is used in retry loop.

#define MAX_RETRIES   3

Maximum number of retries when connection failure occurs before the failure is announced to a caller.

#define raised_exception (   ev)    ((ev)->_major != CORBA_NO_EXCEPTION)

Quick test if corba exception was raised.

#define RETR_SLEEP   100000

Number of microseconds between retries when connection failure occurs.

Typedef Documentation

typedef void* service_EPP

Reference to EPP CORBA service

typedef void* service_Logger

Reference to fred-logd CORBA service

Enumeration Type Documentation

Possible return values of functions from corba module.

Enumerator
CORBA_OK 

No errors.

CORBA_ERROR 

Corba function call failed (e.g. server is not available).

CORBA_INT_ERROR 

This should occur unusualy (e.g. malloc failed)

CORBA_REMOTE_ERROR 

Epp server is responding but the response is not valid.

Function Documentation

void epp_call_CloseSession ( epp_context epp_ctx,
service_EPP  service,
unsigned long long  loginid 
)

Let the CR know that client has closed tcp session.

Parameters
epp_ctxEpp context (pool, connection and session id).
serviceEPP service.
loginidLogin ID of client.
corba_status epp_call_cmd ( epp_context epp_ctx,
service_EPP  service,
unsigned long long  loginid,
const ccReg_TID  request_id,
epp_command_data cdata 
)

Call generic command corba handler which decides what to do on the basis of cdata content.

login, logout commands are not handled by this function. They are rather handled by dedicated functions epp_call_login() and epp_call_logout(). For all other commands use this function.

Parameters
epp_ctxEpp context (pool, connection and session id).
serviceEPP service.
loginidSession identifier
request_idfred-logd request ID
cdataData from parsed xml command.
Returns
Status.
int epp_call_hello ( epp_context epp_ctx,
service_EPP  service,
char **  version,
char **  curdate 
)

Purpose of this function is to get version string of ccReg from corba server, which is used as part of server's name in <greeting> frame.

Parameters
epp_ctxEpp context (pool, connection and session id).
serviceEPP service.
versionOutput parameter version string.
curdateOutput parameter current date.
Returns
If successfull 1 and 0 if corba function call failed.
corba_status epp_call_login ( epp_context epp_ctx,
service_EPP  service,
unsigned long long *  loginid,
const ccReg_TID  request_id,
epp_lang lang,
const char *  fingerprint,
epp_command_data cdata 
)

Call corba login function, which sets up a session variables.

Parameters
epp_ctxEpp context (pool, connection and session id).
serviceEPP service.
loginidIf successfully logged in, the session identifier assigned by server will be stored in this parameter.
request_idfred-logd request ID
langIf successfully logged in, the selected language will be stored in this parameter.
fingerprintFingerprint of client's certificate.
cdataData from parsed xml command.
Returns
Status.
corba_status epp_call_logout ( epp_context epp_ctx,
service_EPP  service,
unsigned long long *  loginid,
const ccReg_TID  request_id,
epp_command_data cdata 
)

Call corba logout function.

Parameters
epp_ctxEpp context (pool, connection and session id).
serviceEPP service.
loginidSession identifier (may change inside).
request_idfred-logd request ID
cdataData from parsed xml command.
Returns
Status.
void epp_call_save_output_xml ( epp_context epp_ctx,
service_EPP  service,
epp_command_data cdata,
const char *  xml 
)

This function calls corba function which saves generated XML in database.

From architectural view THIS IS UGLY HACK! And until serving of EPP request will become complex operation composed from several function calls, it will remain so.

Parameters
epp_ctxEpp context (pool, connection and session id).
serviceEPP service.
cdataUsed to get svTRID.
xmlOutput XML.
char* wrap_str ( const char *  str)

Function wraps strings passed from XML parser into strings accepted by CORBA.

Null strings are transformed to empty strings. The resulting string must be freed with CORBA_free().

Parameters
strInput string.
Returns
Output string.