dnxProtocol.h File Reference

#include <time.h>
#include "dnxTransport.h"

Go to the source code of this file.

Data Structures

struct  DnxXID
 DNX wire transaction ID structure. More...
struct  DnxNodeRequest
 Request job wire structure. More...
struct  DnxJob
 Send job wire structure. More...
struct  DnxResult
 Send job results wire structure. More...
struct  DnxMgmtRequest
 DNX management request wire structure. More...
struct  DnxMgmtReply
 DNX management response wire structure. More...

Enumerations

enum  DnxObjType {
  DNX_OBJ_SCHEDULER = 0, DNX_OBJ_DISPATCHER, DNX_OBJ_WORKER, DNX_OBJ_COLLECTOR,
  DNX_OBJ_REAPER, DNX_OBJ_JOB, DNX_OBJ_MANAGER, DNX_OBJ_MAX,
  DNX_OBJ_SCHEDULER = 0, DNX_OBJ_DISPATCHER, DNX_OBJ_WORKER, DNX_OBJ_COLLECTOR,
  DNX_OBJ_REAPER, DNX_OBJ_JOB, DNX_OBJ_MANAGER, DNX_OBJ_MAX
}
 Defines the type of a DNX object in a network message. More...
enum  DnxReqType {
  DNX_REQ_REGISTER = 0, DNX_REQ_DEREGISTER, DNX_REQ_ACK, DNX_REQ_NAK,
  DNX_REQ_REGISTER = 0, DNX_REQ_DEREGISTER, DNX_REQ_ACK, DNX_REQ_NAK
}
 Defines the type of a DNX worker node network request. More...
enum  DnxJobState {
  DNX_JOB_NULL = 0, DNX_JOB_PENDING, DNX_JOB_INPROGRESS, DNX_JOB_COMPLETE,
  DNX_JOB_EXPIRED, DNX_JOB_NULL = 0, DNX_JOB_PENDING, DNX_JOB_INPROGRESS,
  DNX_JOB_COMPLETE, DNX_JOB_EXPIRED
}
 Defines the state of a DNX job. More...

Functions

int dnxSendMgmtRequest (DnxChannel *channel, DnxMgmtRequest *pRequest)
 Issue a management request.
int dnxSendMgmtReply (DnxChannel *channel, DnxMgmtReply *pReply, char *address)
 Issue a management reply.
int dnxWaitForMgmtReply (DnxChannel *channel, DnxMgmtReply *pReply, int timeout)
 Wait for a management reply to come in (server).
int dnxWaitForMgmtRequest (DnxChannel *channel, DnxMgmtRequest *pRequest, char *address, int timeout)
 Wait for a management request to come in (client).
int dnxMakeXID (DnxXID *pxid, DnxObjType xType, unsigned long xSerial, unsigned long xSlot)
 Create a transaction id (XID) from a type, serial number and slot value.
int dnxEqualXIDs (DnxXID *pxa, DnxXID *pxb)
 Compare two XID's for equality; return a boolean value.


Enumeration Type Documentation

Defines the state of a DNX job.

Enumerator:
DNX_JOB_NULL 
DNX_JOB_PENDING 
DNX_JOB_INPROGRESS 
DNX_JOB_COMPLETE 
DNX_JOB_EXPIRED 
DNX_JOB_NULL 
DNX_JOB_PENDING 
DNX_JOB_INPROGRESS 
DNX_JOB_COMPLETE 
DNX_JOB_EXPIRED 

Definition at line 170 of file dnxProtocol.h.

enum DnxObjType

Defines the type of a DNX object in a network message.

Enumerator:
DNX_OBJ_SCHEDULER 
DNX_OBJ_DISPATCHER 
DNX_OBJ_WORKER 
DNX_OBJ_COLLECTOR 
DNX_OBJ_REAPER 
DNX_OBJ_JOB 
DNX_OBJ_MANAGER 
DNX_OBJ_MAX 
DNX_OBJ_SCHEDULER 
DNX_OBJ_DISPATCHER 
DNX_OBJ_WORKER 
DNX_OBJ_COLLECTOR 
DNX_OBJ_REAPER 
DNX_OBJ_JOB 
DNX_OBJ_MANAGER 
DNX_OBJ_MAX 

Definition at line 148 of file dnxProtocol.h.

enum DnxReqType

Defines the type of a DNX worker node network request.

Enumerator:
DNX_REQ_REGISTER 
DNX_REQ_DEREGISTER 
DNX_REQ_ACK 
DNX_REQ_NAK 
DNX_REQ_REGISTER 
DNX_REQ_DEREGISTER 
DNX_REQ_ACK 
DNX_REQ_NAK 

Definition at line 161 of file dnxProtocol.h.


Function Documentation

int dnxEqualXIDs ( DnxXID pxa,
DnxXID pxb 
)

Compare two XID's for equality; return a boolean value.

Parameters:
[in] pxa - a reference to the first XID to be compared.
[in] pxb - a reference to the second XID to be compared.
Returns:
A boolean value; false (0) if pxa is NOT equal to pxa; true (!false) if pxa IS equal to pxb.

Definition at line 76 of file dnxProtocol.c.

int dnxMakeXID ( DnxXID pxid,
DnxObjType  xType,
unsigned long  xSerial,
unsigned long  xSlot 
)

Create a transaction id (XID) from a type, serial number and slot value.

Parameters:
[out] pxid - the address of storage for the XID to be returned.
[in] xType - the request type to be stored in the XID.
[in] xSerial - the serial number to be stored in the XID.
[in] xSlot - the slot number to be stored in the XID.
Returns:
Always returns zero.

Definition at line 54 of file dnxProtocol.c.

int dnxSendMgmtReply ( DnxChannel channel,
DnxMgmtReply pReply,
char *  address 
)

Issue a management reply.

Parameters:
[in] channel - the channel on which to send the management request.
[out] pReply - the management request to be sent.
[out] address - the address to which the reply should be sent.
Returns:
Zero on success, or a non-zero error value.

Definition at line 126 of file dnxProtocol.c.

int dnxSendMgmtRequest ( DnxChannel channel,
DnxMgmtRequest pRequest 
)

Issue a management request.

The address may not be specified, as this method is only to be used on active, connected, client-side code. The address used is the one specified when the connection was established.

Parameters:
[in] channel - the channel on which to send the management request.
[out] pRequest - the management request to be sent.
Returns:
Zero on success, or a non-zero error value.

Definition at line 96 of file dnxProtocol.c.

int dnxWaitForMgmtReply ( DnxChannel channel,
DnxMgmtReply pReply,
int  timeout 
)

Wait for a management reply to come in (server).

The address may not be retrieved as this command is only intended to be used by client code with an active, connected channel and we can only received data from one address.

Parameters:
[in] channel - the channel from which to read a management request.
[out] pReply - the address of storage in which to return the management reply.
[in] timeout - the maximum number of seconds the caller is willing to wait before accepting a timeout error.
Returns:
Zero on success, or a non-zero error value.

Definition at line 164 of file dnxProtocol.c.

int dnxWaitForMgmtRequest ( DnxChannel channel,
DnxMgmtRequest pRequest,
char *  address,
int  timeout 
)

Wait for a management request to come in (client).

Parameters:
[in] channel - the channel from which to read a management request.
[out] pRequest - the address of storage in which to return the management request.
[out] address - the address of storage in which to return the address of the sender. This parameter is optional and may be passed as NULL. If non-NULL, it should be large enough to store sockaddr_* data.
[in] timeout - the maximum number of seconds the caller is willing to wait before accepting a timeout error.
Returns:
Zero on success, or a non-zero error value.

Definition at line 213 of file dnxProtocol.c.


Generated on Tue Apr 13 15:15:29 2010 for DNX by  doxygen 1.5.6