GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > QMEM / V0-2-0

Constituent: qmem_dump_packets     Tag: linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

qmem_dump_packets.c File Reference

Display memory dump information within a set of CCSDS packets. More...

#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/stat.h>
#include "QMEM/QMEM.h"

Include dependency graph for qmem_dump_packets.c:


Data Structures

struct  _Dump_State
 State information for collecting memory dump datagrams. More...

Defines

#define PROG_NAME   "qmem_dump_packets"
#define STATUS_USAGE   ( -1)
#define STATUS_BAD_OPEN   ( -4)
#define STATUS_BAD_CLOSE   ( -5)
#define STATUS_TRUNCATED   (-10)
#define STATUS_BAD_PKT   (-11)
#define STATUS_BAD_ALLOC   (-12)
#define STATUS_BAD_PARSE   (-13)
#define STATUS_SHORT_BUFFER   (-14)

Typedefs

typedef _Dump_State Dump_State
 Typedef for _Dump_State.

Functions

static int show_usage (void)
 Display a usage message for the program.
static int show_bad_packet (unsigned int file_offset)
 Display a bad CCSDS packet message.
static int show_short_buffer (unsigned int buf_bytes, unsigned int bytes_needed)
 Display a short packet buffer message.
static int show_truncated (char *desc, unsigned int file_offset)
 Display a truncated file message.
static int show_qmem_status (QMEM_Status q_status)
 Display QMEM function failure status.
static int alloc (void **alloc_pp, unsigned int num_bytes)
 Allocate memory.
static void display_dump (Dump_State *state_p)
 Display memory dump information.
static int get_ccsds_pkt (Dump_State *state_p)
 Read a CCSDS packet into a packet buffer.
static int parse_buffer (Dump_State *state_p)
 Parse a packet buffer as a memory dump datagram.
static int process_file (FILE *in_file, char *out_fname)
 Read CCSDS packets from a file and process them as datagrams.
int main (int argc, char **argv)
 Entry point for the program.

Detailed Description

Display memory dump information within a set of CCSDS packets.

**  CVS $Id: qmem_dump_packets.c,v 1.2 2005/12/27 14:51:26 dmay Exp $
**  

This utility extracts memory dump information from a set of CCSDS packets and displays the results.

See the show_usage() function for a description of the options for this program.


Function Documentation

int alloc void **  alloc_pp,
unsigned int  num_bytes
[static]
 

Allocate memory.

Parameters:
alloc_pp Location to return pointer to allocated memory.
num_bytes Number of bytes to allocate.
Returns:
Error status code.

void display_dump Dump_State state_p  )  [static]
 

Display memory dump information.

Parameters:
state_p Pointer to dump state.
Returns:
Error status code.

int get_ccsds_pkt Dump_State state_p  )  [static]
 

Read a CCSDS packet into a packet buffer.

Parameters:
state_p Pointer to dump state.
Returns:
Error status code.

int main int  argc,
char **  argv
 

Entry point for the program.

Parameters:
argc Number of command-line arguments.
argv Array of pointers to the command-line arguments.
Returns:
Error status code.

int parse_buffer Dump_State state_p  )  [static]
 

Parse a packet buffer as a memory dump datagram.

Parameters:
state_p Pointer to dump state.
Returns:
Error status code.

int process_file FILE *  in_file,
char *  out_fname
[static]
 

Read CCSDS packets from a file and process them as datagrams.

Parameters:
in_file Pointer to input file.
out_fname Name of output file prefix.
Returns:
Error status code.

int show_bad_packet unsigned int  file_offset  )  [static]
 

Display a bad CCSDS packet message.

Parameters:
file_offset Current offset within packet file.
Returns:
Error status code.

int show_qmem_status QMEM_Status  q_status  )  [static]
 

Display QMEM function failure status.

Parameters:
q_status Status value returned from QMEM function.
Returns:
Error status code.

int show_short_buffer unsigned int  buf_bytes,
unsigned int  bytes_needed
[static]
 

Display a short packet buffer message.

Parameters:
buf_bytes Size, in bytes, of the packet buffer.
bytes_needed Amount of data, in bytes, to store in pkt buffer.
Returns:
Error status code.

int show_truncated char *  desc,
unsigned int  file_offset
[static]
 

Display a truncated file message.

Parameters:
desc Description of current activity.
file_offset Current offset within packet file.
Returns:
Error status code.

int show_usage void   )  [static]
 

Display a usage message for the program.

Returns:
Error status code.


Generated on Sun Jun 14 02:18:30 2009 by  doxygen 1.4.4