fred-mod-eppd-2.14.2
Defines | Typedefs | Enumerations | Functions
epp-client.h File Reference

Interface definition of corba module. More...

#include "epp_common.h"
#include "EPP.h"

Go to the source code of this file.

Defines

#define MAX_RETRIES   3
 Maximum number of retries when connection failure occurs before the failure is announced to a caller.
#define RETR_SLEEP   100000
 Number of microseconds between retries when connection failure occurs.
#define raised_exception(ev)   ((ev)->_major != CORBA_NO_EXCEPTION)
 Quick test if corba exception was raised.
#define DB_FIELD_SIZE   2000
 Maximal size of property value in database.
#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 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 MAX_ERROR_MSG_LEN   100

Typedefs

typedef void * service_EPP
 Reference to EPP CORBA service.
typedef void * service_Logger
 Reference to fred-logd CORBA service.

Enumerations

enum  corba_status { CORBA_OK, CORBA_ERROR, CORBA_INT_ERROR, CORBA_REMOTE_ERROR }
 Possible return values of functions from corba module. More...

Functions

char * wrap_str (const char *str)
 Function wraps strings passed from XML parser into strings accepted by CORBA.
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.
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.
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.
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.
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.
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.

Detailed Description

Interface definition of corba module.


Define Documentation

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

True if exception is EPP_ERROR.

Referenced by handle_exception().

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

True if exception is NO_MESSAGES.

Referenced by handle_exception().

#define IS_NOT_COMM_FAILURE_EXCEPTION (   _ev)    (strcmp((_ev)->_id, "IDL:omg.org/CORBA/COMM_FAILURE:1.0"))
#define raised_exception (   ev)    ((ev)->_major != CORBA_NO_EXCEPTION)
#define RETR_SLEEP   100000

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.

References EPP_ERROR, epplog(), IS_NOT_COMM_FAILURE_EXCEPTION, MAX_RETRIES, raised_exception, and RETR_SLEEP.

Referenced by call_corba(), and epp_process_connection().

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.

References CORBA_INT_ERROR, epp_call_check(), epp_call_create_contact(), epp_call_create_domain(), epp_call_create_keyset(), epp_call_create_nsset(), epp_call_creditinfo(), epp_call_delete(), epp_call_dummy(), epp_call_getInfoResults(), epp_call_info(), epp_call_info_contact(), epp_call_info_domain(), epp_call_info_keyset(), epp_call_info_nsset(), epp_call_list(), epp_call_poll_ack(), epp_call_poll_req(), epp_call_renew_domain(), epp_call_sendauthinfo(), epp_call_test_nsset(), epp_call_transfer(), epp_call_update_contact(), epp_call_update_domain(), epp_call_update_keyset(), epp_call_update_nsset(), EPP_DEBUG, epplog(), epp_command_data::noresdata, and epp_command_data::type.

Referenced by call_corba().

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.

References CLEAR_CERRNO, CORBA_ERROR, CORBA_INT_ERROR, CORBA_OK, EPP_DEBUG, EPP_ERROR, epplog(), IS_NOT_COMM_FAILURE_EXCEPTION, MAX_RETRIES, epp_context::pool, raised_exception, RETR_SLEEP, and unwrap_str().

Referenced by epp_process_connection(), and epp_request_loop().

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.

References epps_login::clID, epp_command_data::clTRID, CORBA_INT_ERROR, epp_command_data::data, epilog_success(), EPP_DEBUG, epplog(), handle_exception(), IS_NOT_COMM_FAILURE_EXCEPTION, epps_login::lang, MAX_RETRIES, epps_login::newPW, epp_command_data::noresdata, epps_login::pw, raised_exception, RETR_SLEEP, wrap_str(), and epp_command_data::xml_in.

Referenced by call_login().

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.

References epp_command_data::clTRID, CORBA_INT_ERROR, epilog_success(), EPP_DEBUG, epplog(), handle_exception(), IS_NOT_COMM_FAILURE_EXCEPTION, MAX_RETRIES, epp_command_data::noresdata, raised_exception, RETR_SLEEP, and epp_command_data::xml_in.

Referenced by call_corba().

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.

Referenced by epp_call_check(), epp_call_create_contact(), epp_call_create_domain(), epp_call_create_keyset(), epp_call_create_nsset(), epp_call_dummy(), epp_call_info(), epp_call_login(), epp_call_renew_domain(), epp_call_sendauthinfo(), epp_call_test_nsset(), epp_call_transfer(), epp_call_update_contact(), epp_call_update_domain(), epp_call_update_keyset(), and epp_call_update_nsset().