GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LHK / V12-0-4

Constituent: lhk     Tag: mv2304


Interface   Data Structures   File List   Data Fields   Globals  

LHK_callback.c File Reference

Everything mechanistic to service the CTDB housekeeping callback. More...

#include <stdlib.h>
#include <string.h>
#include "CDM/CDM_pubdefs.h"
#include "FBS/FBS_pubrtos.h"
#include "LHK/LHK_msgs.h"
#include "LHK_DB/LHK_DB_pktdefs.h"
#include "LHK_DB/LHK_DB_schedule.h"
#include "MDB/MDB_pubdefs.h"
#include "PBS/FFS.ih"
#include "PBS/INT.ih"
#include "LHK_prvdefs.h"

Include dependency graph for LHK_callback.c:


Functions

static unsigned int scheduleReplace (const LHK_DB_Packet *tbl, unsigned int len, LHK_cb_FreeSchedule *rtn, void *prm)
 Request a new housekeeping schedule.
static unsigned int scheduleScan (CDM_Database *cdm, LHK_Control *lcb)
 Scan CDMs for housekeeping schedules.
static unsigned int scheduleValidate (const LHK_DB_Packet *tbl, unsigned int len)
 Validate a housekeeping schedule.
unsigned int LHK_ctdbCallback (void *out, void *prm)
 Service a request for a housekeeping packet.
unsigned int LHK_scheduleGet ()
 Identify the schedule file in use.
unsigned int LHK_scheduleInitialize (LHK_Control *lcb)
 Service a request for a housekeeping packet.
unsigned int LHK_scheduleReplaceByFile (unsigned int fil)
 Request a new housekeeping schedule by file ID.
unsigned int LHK_scheduleReplaceByInstance (int instance)
 Request a new housekeeping schedule by file ID.

Variables

const LHK_DB_Packet LHK_defaultPacketList []
 Should no schedules be loaded...
const LHK_DB_Schedule LHK_defaultSchedule
 Should no schedules be loaded...

Detailed Description

Everything mechanistic to service the CTDB housekeeping callback.

CVS $Id: LHK_callback.c,v 1.1 2007/10/28 23:38:18 apw Exp $
Author:
A.P.Waite
LHK_callback.c provides all the mechanism for delivering housekeeping packets to the CTDB (the individual packets have to provide the logic for filling in the packets before they are delivered).

Function Documentation

unsigned int LHK_ctdbCallback void *  out,
void *  prm
 

Service a request for a housekeeping packet.

Parameters:
out (in) Output buffer (where the packet should be placed)
prm (in) User parameter
Return values:
LHK_GENERROR Generic error
LHK_SUCCESS Success
LHK_ctdbCallback() is the routine that runs in the CTDB callback context to provide a housekeeping packet.

unsigned int LHK_scheduleGet void   ) 
 

Identify the schedule file in use.

Return values:
0 Using the internal default schedule
x File ID of the schedule file in use
LHK_scheduleGet() returns the file ID for the schedule file currently in use (or zero if the internal default schedule is in use).

unsigned int LHK_scheduleInitialize LHK_Control lcb  ) 
 

Service a request for a housekeeping packet.

Parameters:
lcb (in) LHK control block
Return values:
LHK_GENERROR Generic error
LHK_SUCCESS Success
LHK_scheduleInitialize() sets up controls for housekeeping schedules.

unsigned int LHK_scheduleReplaceByFile unsigned int  fil  ) 
 

Request a new housekeeping schedule by file ID.

Parameters:
fil (in) File ID of file/CDM providing the new schedule
Return values:
LHK_GENERROR Generic error
LHK_SUCCESS Success
LHK_scheduleReplace() requests that the CTDB housekeeping callback change the housekeeping schedule in use with the one defined in the file/CDM with file ID fil.

unsigned int LHK_scheduleReplaceByInstance int  instance  ) 
 

Request a new housekeeping schedule by file ID.

Parameters:
instance (in) CMD instance number
Return values:
LHK_GENERROR Generic error
LHK_SUCCESS Success
LHK_scheduleReplaceByInstance() requests that the CTDB housekeeping callback change the housekeeping schedule in use with the one defined in the file/CDM with CDM instance number instance.

static unsigned int scheduleReplace const LHK_DB_Packet *  tbl,
unsigned int  len,
LHK_cb_FreeSchedule rtn,
void *  prm
[static]
 

Request a new housekeeping schedule.

Parameters:
tbl (in) Pointer to new table (simple list of APIDs)
len (in) Length of table
rtn (in) Routine to call when switch complete (can be NULL)
prm (in) User parameter to callback routine
Return values:
LHK_GENERROR Generic error
LHK_SUCCESS Success
scheduleReplace() requests that the CTDB housekeeping callback change the housekeeping schedule in use. To ensure thread safety, the table is not switched immediately, but will be switched the next time that the CTDB callback runs. Due to this asynchronicity, a callback (called in the CTDB callback context) is provided to dispose of the old housekeeping schedule, should that be necessary. Note the corollary: the schedule table (as defined by tbl and len) is not copied. The caller of this routine must ensure that the memory persists until rtn is called.

static unsigned int scheduleScan CDM_Database *  cdm,
LHK_Control lcb
[static]
 

Scan CDMs for housekeeping schedules.

Parameters:
cdm (in) CDM handle
lcb (in) LHK control block

static unsigned int scheduleValidate const LHK_DB_Packet *  tbl,
unsigned int  len
[static]
 

Validate a housekeeping schedule.

Parameters:
tbl (in) Pointer to new table (simple list of APIDs)
len (in) Length of table
Return values:
LHK_GENERROR Generic error
LHK_SUCCESS Success


Variable Documentation

const LHK_DB_Schedule LHK_defaultSchedule
 

Initial value:

{
    sizeof( LHK_defaultPacketList ) / sizeof( LHK_DB_Packet ),
    &LHK_defaultPacketList[0]
}
Should no schedules be loaded...


Generated on Mon Nov 5 04:41:18 2007 by  doxygen 1.4.4