rtv_shell.c File Reference

#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/errno.h>
#include "shell/cli.h"
#include "rtvlib.h"
#include "bigfile.h"

Go to the source code of this file.

Data Structures

struct  get_file_read_data_t

Defines

#define STRTOHEX(x)   strtoul((x), NULL, 16)
#define STRTODEC(x)   strtoul((x), NULL, 10)

Functions

static void print_status_bar (FILE *fp, __u64 done, __u64 total)
static int hfs_rf_callback (unsigned char *buf, size_t len, size_t offset, void *vd)
static void rtvShellInit (void)
static int isaHexNum (const char *str)
static int ciCmdTestFxn (int argc, char **argv)
static int ciSetDbgLevel (int argc, char **argv)
static int ciRouteLogs (int argc, char **argv)
static int ciDiscoverDevices (int argc, char **argv)
static int ciGetDeviceInfo (int argc, char **argv)
static int ciGetGuide (int argc, char **argv)
static int ciDeviceList (int argc, char **argv)
static int ciFree (int argc, char **argv)
static int ciCryptTest (int argc, char **argv)
static int ciDeleteShow (int argc, char **argv)
static int ciGetPlayPosition (int argc, char **argv)
static int ciHttpFsVolinfo (int argc, char **argv)
static int ciHttpFsStatus (int argc, char **argv)
static int ciHttpFsListFiles (int argc, char **argv)
static int ciHttpFsGetFile (int argc, char **argv)
int main (int argc, char **argv)

Variables

cmdb_t cmd_list []


Define Documentation

#define STRTODEC x   )     strtoul((x), NULL, 10)
 

Definition at line 28 of file rtv_shell.c.

Referenced by ciDiscoverDevices().

#define STRTOHEX x   )     strtoul((x), NULL, 16)
 

Definition at line 27 of file rtv_shell.c.

Referenced by ciSetDbgLevel().


Function Documentation

static int ciCmdTestFxn int  argc,
char **  argv
[static]
 

Definition at line 99 of file rtv_shell.c.

References x.

static int ciCryptTest int  argc,
char **  argv
[static]
 

Definition at line 237 of file rtv_shell.c.

References rtv_crypt_test().

static int ciDeleteShow int  argc,
char **  argv
[static]
 

Definition at line 244 of file rtv_shell.c.

References rtv_device_t::device, rtv_device_t::guide, rtv_guide_export_t::num_rec_shows, rc, rtv_guide_export_t::rec_show_list, rtv_delete_show(), rtv_get_device_struct(), rtv_is_show_inuse(), rtv_release_show_and_wait(), and rtv_show_export_t::show_id.

static int ciDeviceList int  argc,
char **  argv
[static]
 

Definition at line 223 of file rtv_shell.c.

References rtv_print_device_list().

static int ciDiscoverDevices int  argc,
char **  argv
[static]
 

Definition at line 151 of file rtv_shell.c.

References rc, rtv_discover(), rtv_print_device_list(), and STRTODEC.

static int ciFree int  argc,
char **  argv
[static]
 

Definition at line 230 of file rtv_shell.c.

References rtv_free_devices().

static int ciGetDeviceInfo int  argc,
char **  argv
[static]
 

Definition at line 170 of file rtv_shell.c.

References rtv_device_t::device, rc, rtv_get_device_info(), and rtv_print_device_info().

Referenced by ciGetGuide().

static int ciGetGuide int  argc,
char **  argv
[static]
 

Definition at line 188 of file rtv_shell.c.

References ciGetDeviceInfo(), rtv_device_t::device, rtv_device_t::guide, rc, rtv_get_device_struct(), rtv_get_guide_snapshot(), and rtv_print_guide().

static int ciGetPlayPosition int  argc,
char **  argv
[static]
 

Definition at line 304 of file rtv_shell.c.

References rtv_device_t::device, rtv_device_t::guide, rtv_guide_export_t::num_rec_shows, rc, rtv_get_device_struct(), and rtv_get_play_position().

static int ciHttpFsGetFile int  argc,
char **  argv
[static]
 

Definition at line 444 of file rtv_shell.c.

References bfclose(), bfopen(), data, rtv_device_t::device, errno, hfs_rf_callback(), rc, rtv_free_file_info(), rtv_get_device_struct(), rtv_get_file_info(), rtv_print_file_info(), rtv_read_file_chunked(), rtv_fs_file_t::size, and rtv_fs_file_t::size_k.

static int ciHttpFsListFiles int  argc,
char **  argv
[static]
 

Definition at line 398 of file rtv_shell.c.

References rtv_device_t::device, rc, rtv_free_file_list(), rtv_get_device_struct(), rtv_get_filelist(), and rtv_print_file_list().

static int ciHttpFsStatus int  argc,
char **  argv
[static]
 

Definition at line 371 of file rtv_shell.c.

References rtv_device_t::device, rc, rtv_free_file_info(), rtv_get_device_struct(), rtv_get_file_info(), and rtv_print_file_info().

static int ciHttpFsVolinfo int  argc,
char **  argv
[static]
 

Definition at line 344 of file rtv_shell.c.

References rtv_device_t::device, rc, rtv_free_volinfo(), rtv_get_device_struct(), rtv_get_volinfo(), and rtv_print_volinfo().

static int ciRouteLogs int  argc,
char **  argv
[static]
 

Definition at line 137 of file rtv_shell.c.

References rc, and rtv_route_logs().

static int ciSetDbgLevel int  argc,
char **  argv
[static]
 

Definition at line 120 of file rtv_shell.c.

References isaHexNum(), rtv_get_dbgmask(), rtv_set_dbgmask(), and STRTOHEX.

static int hfs_rf_callback unsigned char *  buf,
size_t  len,
size_t  offset,
void *  vd
[static]
 

Definition at line 62 of file rtv_shell.c.

References bfwrite(), get_file_read_data_t::bytes, get_file_read_data_t::dstfile, get_file_read_data_t::fullsize, and print_status_bar().

Referenced by ciHttpFsGetFile().

static int isaHexNum const char *  str  )  [static]
 

Definition at line 82 of file rtv_shell.c.

Referenced by ciSetDbgLevel().

int main int  argc,
char **  argv
 

Definition at line 560 of file rtv_shell.c.

References cmd_list, rtv_init_lib(), and rtvShellInit().

static void print_status_bar FILE *  fp,
__u64  done,
__u64  total
[static]
 

Definition at line 40 of file rtv_shell.c.

Referenced by hfs_rf_callback().

static void rtvShellInit void   )  [static]
 

Definition at line 73 of file rtv_shell.c.

Referenced by main().


Variable Documentation

cmdb_t cmd_list[]
 

Initial value:

 {
   {"sendlogs",   ciRouteLogs,       0, MAX_PARMS, "send logs to a file"              },
   {"sdm",        ciSetDbgLevel,     0, MAX_PARMS, "set the debug trace mask"         },
   {"discover",   ciDiscoverDevices, 0, MAX_PARMS, "discover RTV devices"             },
   {"di",         ciGetDeviceInfo,   0, MAX_PARMS, "get RTV device information"       },
   {"devlist",    ciDeviceList,      0, MAX_PARMS, "print device list summary"        },
   {"guide",      ciGetGuide,        0, MAX_PARMS, "get RTV guide"                    },
   {"delshow",    ciDeleteShow,      0, MAX_PARMS, "delete a show"                    },
   {"playpos",    ciGetPlayPosition, 0, MAX_PARMS, "get shows current play position"  },
   {"free",       ciFree,            0, MAX_PARMS, "free rtv data struct"             },
   {"fsvi",       ciHttpFsVolinfo,   0, MAX_PARMS, "http filesystem: get volume info" },
   {"fsstat",     ciHttpFsStatus,    0, MAX_PARMS, "http filesystem: get file status" },
   {"fsls",       ciHttpFsListFiles, 0, MAX_PARMS, "http filesystem: list directory"  },
   {"fsget",      ciHttpFsGetFile,   0, MAX_PARMS, "http filesystem: get file"        },
   {"crypttest",  ciCryptTest,       0, MAX_PARMS, "Test encryption routines"         },
   {"clitestfxn", ciCmdTestFxn,      0, MAX_PARMS, "test parameter parsing"           },
   {"",           NULL,              0, 0,         ""                                 },
}

Definition at line 540 of file rtv_shell.c.

Referenced by main().


Generated on Fri Sep 10 03:13:24 2010 for mvpmc by  doxygen 1.4.6