GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LFS / V1-9-1

Constituent: lfs_lcp     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

LFS_lcp_command.c File Reference

Routines associated with CCSDS commands to subsystem LFS. More...

#include "unistd.h"
#include "fcntl.h"
#include "errno.h"
#include "stdio.h"
#include "string.h"
#include "dirent.h"
#include "sys/stat.h"
#include "PBI/Endianness.h"
#include "PBS/WCT.h"
#include "PBS/SEM.h"
#include "PBS/WUT.h"
#include "MSG/MSG_pubdefs.h"
#include "CCSDS/CCSDS_pkt.h"
#include "ITC/ITC_pubdefs.h"
#include "LSF/LSF.h"
#include "LSF/LSF_ids.h"
#include "FBS/FBS_pubrtos.h"
#include "LFS/LFS_cmddefs.h"
#include "LFS/LFS_cmdxtrn.h"
#include "LFS/LFS_tlmdefs.h"
#include "LFS/LFS_msg.h"
#include "QLFS/QLFS.h"
#include "LFS_lcp_private.h"

Include dependency graph for LFS_lcp_command.c:


Defines

#define CREAT(_path, _mode)   creat((_path), 0666)
#define MKDIR(_path)   mkdir((_path), 0777)
#define STATFS(_path, _buf)   statfs((_path), (_buf))

Typedefs

typedef statfs STATFS_T

Functions

static unsigned int LFS_dumpDir (LFS_Control *ctl, DIR *directory, unsigned int cpu, unsigned int devNum, unsigned int dirNum, unsigned int xactId)
static unsigned int LFS_dumpRoot (LFS_Control *ctl, DIR *directory, unsigned int cpu, unsigned int devNum, unsigned int xactId)
unsigned int LFS_LLFSFILEDELETE (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Callback function for the LLFSFILEDEL command.
unsigned int LFS_LLFSFILECOPY (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Callback function for the LLFSFILECOPY command.
unsigned int LFS_LLFSDIRCREATE (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Callback function for the LLFSDIRCREATE command.
unsigned int LFS_LLFSDIRDELETE (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Callback function for the LLFSDIRDELETE command.
unsigned int LFS_LLFSFILEDUMPC (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Callback function for the LLFSFILEDUMPC command.
unsigned int LFS_LLFSFILEDUMPS (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Callback function for the LLFSFILEDUMPS command.
unsigned int LFS_LLFSDIRDUMP (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Callback function for the LLFSDIRDUMP command.
unsigned int LFS_LLFSSYSSTATUS (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Callback function for the LLFSSYSSTATUS command.
unsigned int LFS_LLFSSYSFORMAT (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Callback function for the LLFSSYSFORMAT command.
unsigned int LFS_LLFSSYSCHECK (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Callback function for the LLFSSYSCHECK command.
unsigned int LFS_LLFSSYSMOUNT (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Callback function for the LLFSSYSMOUNT command.

Detailed Description

Routines associated with CCSDS commands to subsystem LFS.

Author:
D.L. Wood

Define Documentation

#define CREAT _path,
_mode   )     creat((_path), 0666)
 

Portable macro for creat() system call.

#define MKDIR _path   )     mkdir((_path), 0777)
 

Portable macro for mkdir() system call.

#define STATFS _path,
_buf   )     statfs((_path), (_buf))
 

Portable call to statfs()/statvfs() system call.


Typedef Documentation

STATFS_T
 

Portable definition for statfs/statvfs structure.


Function Documentation

static unsigned int LFS_dumpDir LFS_Control ctl,
DIR *  directory,
unsigned int  cpu,
unsigned int  devNum,
unsigned int  dirNum,
unsigned int  xactId
[static]
 

Dumps the contents of a sub-directory into directory dump telemetry packets. The function is called in response to a LLFSDIRDUMP telecommand when the directory number is not '127' (regular subdirectory). A series of LLFSDIRLIST telemetry packets is generated, one for each entry in the directory. Only regular files should be stored here.

Parameters:
ctl LFS control structure.
directory The directory stream pointer.
cpu The LAT CPU unit number.
devNum The device number.
dirNum The directory number.
xactId The transaction ID.
Returns:
A LFS MSG code.

static unsigned int LFS_dumpRoot LFS_Control ctl,
DIR *  directory,
unsigned int  cpu,
unsigned int  devNum,
unsigned int  xactId
[static]
 

Dumps the contents of the root directory into directory dump telemetry packets. The function is called in response to a LLFSDIRDUMP telecommand when the directory number is specified as '127'. A series of LLFSROOTLIST telemetry packets is generated, one for each entry in the device root directory. Only sub-directories should be stored here.

Parameters:
ctl LFS control structure.
directory The directory stream pointer.
cpu The LAT CPU unit number.
devNum The device number.
xactId The trasaction ID.
Returns:
A LFS MSG code.

unsigned int LFS_LLFSDIRCREATE void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len
 

Callback function for the LLFSDIRCREATE command.

After translating the target directory path, the directory is created.

Parameters:
prm User context parameter
qitem Queue item
pay Payload pointer
len Payload length
Returns:
A LFS MSG code.

unsigned int LFS_LLFSDIRDELETE void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len
 

Callback function for the LLFSDIRDELETE command.

After translating the target directory path, the directory is deleted.

Parameters:
prm User context parameter
qitem Queue item
pay Payload pointer
len Payload length
Returns:
A LFS MSG code.

unsigned int LFS_LLFSDIRDUMP void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len
 

Callback function for the LLFSDIRDUMP command.

The target directory is opened for reading, and either LFS_dumpDir() or LFS_dumpRoot() is called to generate the telemetry response diagnostic packets.

Parameters:
prm User context parameter
qitem Queue item
pay Payload pointer
len Payload length
Returns:
A LFS MSG code.

unsigned int LFS_LLFSFILECOPY void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len
 

Callback function for the LLFSFILECOPY command.

After translating the file system paths, the source file contents are copied to the destination file.

Parameters:
prm User context parameter
qitem Queue item
pay Payload pointer
len Payload length
Returns:
A LFS MSG code.

unsigned int LFS_LLFSFILEDELETE void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len
 

Callback function for the LLFSFILEDEL command.

After translating the target file path, the file is deleted.

Parameters:
prm User context parameter
qitem Queue item
pay Payload pointer
len Payload length
Returns:
A LFS MSG code.

unsigned int LFS_LLFSFILEDUMPC void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len
 

Callback function for the LLFSFILEDUMPC command.

After translating the file ID to a path, the file is opened for reading and a series of LLFSDUMPCTDB telemetry packets is generated. Each telemetry packet contains a portion of the file data, and the offset and size members provide the attributes of the data contained in each packet. These telemetry packets are delivered to the CTDB interface.

Parameters:
prm User context parameter
qitem Queue item
pay Payload pointer
len Payload length
Returns:
A LFS MSG code.

unsigned int LFS_LLFSFILEDUMPS void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len
 

Callback function for the LLFSFILEDUMPS command.

After translating the file ID to a path, the file is opened for reading and a series of LLFSDUMPSSR telemetry packets is generated. Each telemetry packet contains a portion of the file data, and the offset and size members provide the attributes of the data contained in each packet. These telemetry packets are delivered to the SSR interface. Each telemetry packet contains one QLFS datagram.

Parameters:
prm User context parameter
qitem Queue item
pay Payload pointer
len Payload length
Returns:
A LFS MSG code.

unsigned int LFS_LLFSSYSCHECK void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len
 

Callback function for the LLFSSYSCHECK command.

Consistency check an on-board file system by running the 'chkdsk' utility.

Parameters:
prm User context parameter
qitem Queue item
pay Payload pointer
len Payload length
Returns:
A LFS MSG code.

unsigned int LFS_LLFSSYSFORMAT void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len
 

Callback function for the LLFSSYSFORMAT command.

Re-format an on-board file system. This is potentially dangerous.

Parameters:
prm User context parameter
qitem Queue item
pay Payload pointer
len Payload length
Returns:
A LFS MSG code.

unsigned int LFS_LLFSSYSMOUNT void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len
 

Callback function for the LLFSSYSMOUNT command.

Manually mount an on-board file system.

Parameters:
prm User context parameter
qitem Queue item
pay Payload pointer
len Payload length
Returns:
A LFS MSG code.

unsigned int LFS_LLFSSYSSTATUS void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len
 

Callback function for the LLFSSYSSTATUS command.

After the target file system status is obtained from the system, a single LLFSSYSREPORT telemetry packet is generated to report the results.

Parameters:
prm User context parameter
qitem Queue item
pay Payload pointer
len Payload length
Returns:
A LFS MSG code.


Generated on Tue Jun 20 20:41:24 2006 by  doxygen 1.4.4