FACT++  1.0
feeserver.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <dim/dis.h>
#include <math.h>
#include <time.h>
#include <sys/time.h>
#include <pthread.h>
#include <errno.h>
#include <signal.h>
#include "fee_types.h"
#include "fee_functions.h"
#include "fee_defines.h"
#include "feepacket_flags.h"
#include "fee_errors.h"
#include "ce_command.h"
+ Include dependency graph for feeserver.c:

Go to the source code of this file.

Functions

int main (int argc, char **arg)
 
void initialize ()
 
void threadInitializeCE ()
 
void signalCEready (int ceState)
 
void command_handler (int *tag, char *address, int *size)
 
void ack_service (int *tag, char **address, int *size)
 
void leaveCommandHandler (unsigned int id, short errorCode, unsigned int msgType, char *message)
 
void unlockIssueMutex ()
 
int publish (Item *item)
 
void add_item_node (unsigned int _id, Item *_item)
 
void createLogMessage (unsigned int type, char *description, char *origin)
 
bool checkLogLevel (int event)
 
void dim_error_msg_handler (int severity, int error_code, char *msg)
 
char * mapDimErrorCodes (int errorCode)
 
int start (int initState)
 
int startMonitorThread ()
 
void monitorValues ()
 
bool checkLocation (ItemNode *node)
 
int startLogWatchDogThread ()
 
void runLogWatchDog ()
 
bool checkReplicatedLogMessage ()
 
void * threadIssue (void *threadParam)
 
char * createHeader (unsigned int id, short errorCode, bool huffmanFlag, bool checksumFlag, int checksum)
 
bool checkCommand (char *payload, int size, unsigned int checksum)
 
unsigned int calculateChecksum (unsigned char *buffer, int size)
 
char * marshallHeader (CommandHeader *pHeader)
 
void updateFeeServer (IssueStruct *issueParam)
 
void restartFeeServer ()
 
void triggerRestart (int exitVal)
 
int setDeadband (IssueStruct *issueParam)
 
int getDeadband (IssueStruct *issueParam)
 
int setIssueTimeout (IssueStruct *issueParam)
 
int getIssueTimeout (IssueStruct *issueParam)
 
int setUpdateRate (IssueStruct *issueParam)
 
int getUpdateRate (IssueStruct *issueParam)
 
int setLogLevel (IssueStruct *issueParam)
 
int getLogLevel (IssueStruct *issueParam)
 
void provideUpdateRate ()
 
unsigned int setDeadbandBroadcast (char *name, float newDeadbandBC)
 
int updateFeeService (char *serviceName)
 
void initIssueStruct (IssueStruct *issueStr)
 
void initMessageStruct ()
 
void initItemNode (ItemNode *iNode)
 
ItemNode * findItem (char *name)
 
void unpublishItemList ()
 
void interrupt_handler (int sig)
 
void fee_exit_handler (unsigned int state)
 
void dim_dummy_exit_handler (int *bufp)
 
void cleanUp ()
 
int deleteItemList ()
 
int publishInt (IntItem *intItem)
 
void add_int_item_node (unsigned int _id, IntItem *_int_item)
 
IntItemNode * findIntItem (char *name)
 
int deleteIntItemList ()
 
void initIntItemNode (IntItemNode *intItemNode)
 
void unpublishIntItemList ()
 
Item * createItem ()
 
IntItem * createIntItem ()
 
Item * fillItem (float *floatLocation, char *itemName, float defDeadband)
 
IntItem * fillIntItem (int *intLocation, char *itemName, int defDeadband)
 
void monitorIntValues ()
 
bool checkIntLocation (IntItemNode *node)
 
int publishFloat (FloatItem *floatItem)
 
FloatItem * createFloatItem ()
 
FloatItem * fillFloatItem (float *floatLocation, char *itemName, float defDeadband)
 
MemoryNode * findMemoryNode (void *addr)
 
MemoryNode * createMemoryNode (unsigned int size, char type, char *module, unsigned int preSize)
 
void freeMemoryNode (MemoryNode *node)
 
void cleanupMemoryList ()
 
int allocateMemory (unsigned int size, char type, char *module, char prefixPurpose, void **ptr)
 
int freeMemory (void *addr)
 
int publishChar (CharItem *charItem)
 — NEW FEATURE SINCE VERSION 0.8.2b [Char channel] (2007-07-28) — /// More...
 
CharItem * createCharItem ()
 
CharItem * fillCharItem (void(*funcPointer)(long *, int **, int *), char *itemName, long tag)
 
void add_char_item_node (unsigned int _id, CharItem *_char_item)
 
CharItemNode * findCharItem (char *name)
 
int deleteCharItemList ()
 
void initCharItemNode (CharItemNode *charItemNode)
 
void unpublishCharItemList ()
 
bool setFeeProperty (FeeProperty *prop)
 – NEW FEATURE V. 0.9.1 [Set FeeServer Properies in CE] (2007-08-17) – /// More...
 
void createBenchmark (char *msg)
 

Variables

Return to feeserver c CVS log Up to[MAIN] dcscvs FeeServer feeserver src File
 
Return to feeserver c CVS log Up to[MAIN] dcscvs FeeServer feeserver src Wed May
 
Return to feeserver c CVS log Up to[MAIN] dcscvs FeeServer feeserver src Wed HEAD
 
Return to feeserver c CVS log Up to[MAIN] dcscvs FeeServer feeserver src Wed FeeServer_v0 v0 dev
 
Return to feeserver c CVS log Up to[MAIN] dcscvs FeeServer feeserver src Wed FeeServer_v0 v0 FeeServer_v0 v0 FeeServer_v0 v0 FeeServer_v0 v0 FeeServer_v0 v0 FeeServer_v0 v0
 
Return to feeserver c CVS log Up to[MAIN] dcscvs FeeServer feeserver src Wed FeeServer_v0 v0 FeeServer_v0 v0 FeeServer_v0 v0 FeeServer_v0 v0 FeeServer_v0 v0 FeeServer_v0 FeeServer_v0 v0 FeeServer_v0 v0 FeeServer_v0 v0 FeeServer_v0 v0 FeeServer_v0 v0 dev Changes since
 
static bool ceReadySignaled = false
 
static int ceInitState = CE_NOT_INIT
 
static ItemNode * firstNode = 0
 
static ItemNode * lastNode = 0
 
static MessageStruct message
 
static MessageStruct lastMessage
 
static unsigned short replicatedMsgCount = 0
 
static bool logWatchDogRunning = false
 
static unsigned int logWatchDogTimeout = DEFAULT_LOG_WATCHDOG_TIMEOUT
 
static unsigned int nodesAmount = 0
 
static bool monitorThreadStarted = false
 
static unsigned int serviceACKID
 
static unsigned int messageServiceID
 
static unsigned int commandID
 
static char * cmndACK = 0
 
static int cmndACKSize = 0
 
static char * serverName = 0
 
static int serverNameLength = 0
 
static unsigned short updateRate = DEFAULT_UPDATE_RATE
 
static unsigned long issueTimeout = DEFAULT_ISSUE_TIMEOUT
 
static unsigned int logLevel = DEFAULT_LOGLEVEL
 
static pthread_t thread_init
 
static pthread_t thread_mon
 
static pthread_t thread_logWatchdog
 
static pthread_cond_t cond = PTHREAD_COND_INITIALIZER
 
static pthread_cond_t init_cond = PTHREAD_COND_INITIALIZER
 
static pthread_mutex_t wait_mut = PTHREAD_MUTEX_INITIALIZER
 
static pthread_mutex_t wait_init_mut = PTHREAD_MUTEX_INITIALIZER
 
static pthread_mutex_t command_mut = PTHREAD_MUTEX_INITIALIZER
 
static pthread_mutex_t log_mut = PTHREAD_MUTEX_INITIALIZER
 
static IntItemNode * firstIntNode = 0
 
static IntItemNode * lastIntNode = 0
 
static unsigned int intNodesAmount = 0
 
static pthread_t thread_mon_int
 
static bool intMonitorThreadStarted = false
 
static MemoryNode * firstMemoryNode = 0
 
static MemoryNode * lastMemoryNode = 0
 
static unsigned int charNodesAmount = 0
 -— NEW FEATURE SINCE VERSION 0.8.2b [Char Channel] (2007-07-28) –— /// More...
 
static CharItemNode * firstCharNode = 0
 
static CharItemNode * lastCharNode = 0