changeset 257:c413e791595a

fc-tmsh: added check-ffs1 command, getting ready to begin ffs2 implementation
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Tue, 04 Feb 2014 07:22:19 +0000
parents 2f285f20d617
children ab66a2eea6a8
files rvinterf/etm/Makefile rvinterf/etm/etmbasic.c rvinterf/etm/misc.c rvinterf/etm/tmffs1.h rvinterf/etm/tmffs2.h rvinterf/etm/usercmd.c
diffstat 6 files changed, 138 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rvinterf/etm/Makefile	Tue Feb 04 05:03:57 2014 +0000
+++ b/rvinterf/etm/Makefile	Tue Feb 04 07:22:19 2014 +0000
@@ -3,8 +3,8 @@
 PROGS=	fc-tmsh
 INSTBIN=/usr/local/bin
 
-TMSH_OBJS=	abb.o etmbasic.o init.o interf.o launchrvif.o main.o pktsort.o \
-		tmcore.o ttymagic.o usercmd.o
+TMSH_OBJS=	abb.o etmbasic.o init.o interf.o launchrvif.o main.o misc.o \
+		pktsort.o tmcore.o ttymagic.o usercmd.o
 
 all:	${PROGS}
 
--- a/rvinterf/etm/etmbasic.c	Tue Feb 04 05:03:57 2014 +0000
+++ b/rvinterf/etm/etmbasic.c	Tue Feb 04 07:22:19 2014 +0000
@@ -52,6 +52,12 @@
 			goto runt;
 		tmcore_msg_rx();
 		return;
+	case ETM_FFS1:
+		print_etm_pkt_raw("FFS1");
+		return;
+	case ETM_FFS2:
+		print_etm_pkt_raw("FFS2");
+		return;
 	default:
 		print_etm_pkt_raw("ETM Unknown");
 	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rvinterf/etm/misc.c	Tue Feb 04 07:22:19 2014 +0000
@@ -0,0 +1,24 @@
+/*
+ * Commands which don't belong anywhere else
+ */
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <string.h>
+#include <strings.h>
+#include <stdlib.h>
+#include "../include/pktmux.h"
+#include "etm.h"
+#include "tmffs1.h"
+
+void
+cmd_check_ffs1(argc, argv)
+	char **argv;
+{
+	u_char cmdpkt[5];
+
+	cmdpkt[1] = ETM_FFS1;
+	cmdpkt[2] = FPI_TMFFS_VERSION;
+	cmdpkt[3] = FPI_END;
+	send_etm_cmd(cmdpkt, 3);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rvinterf/etm/tmffs1.h	Tue Feb 04 07:22:19 2014 +0000
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * FFS1 Protocol Indentifiers
+ ******************************************************************************/
+
+enum FFS1_PROTOCOL_IDENTIFIERS {
+    FPI_END = 0,         /* end */
+    FPI_BEGIN,           /* begin */
+    FPI_TMFFS_VERSION,   /* tmffs_version */
+
+    FPI_PREFORMAT,       /* preformat */
+    FPI_FORMAT,          /* format */
+
+    FPI_FCREATE,         /* fcreate */
+    FPI_FUPDATE,         /* fupdate */
+    FPI_FWRITE,          /* fwrite */
+    FPI_FREAD,           /* fread */
+    FPI_REMOVE,          /* remove */
+
+    FPI_MKDIR,           /* mkdir */
+    FPI_OPENDIR,         /* opendir */
+    FPI_READDIR,         /* readdir */
+
+    FPI_STAT,            /* stat */
+    FPI_LINKSTAT,        /* linkstat */
+
+    FPI_SYMLINK,         /* symlink */
+    FPI_READLINK,        /* readlink */
+
+    FPI_QUERY,           /* query */
+    FPI_FCONTROL,        /* fcontrol */
+
+    FPI_INIT,            /* init */
+    FPI_EXIT,            /* exit */
+
+    FPI_PCM_GETFILEINFO, /* getfileinfo */
+    FPI_PCM_READFILE,    /* readfile */
+    FPI_PCM_WRITEFILE,   /* writefile */
+    FPI_PCM_READRECORD,  /* readrecord */
+    FPI_PCM_WRITERECORD, /* writerecord */
+
+    FPI_BUFREAD,         /* buf_read */
+    FPI_BUFWRITE,        /* buf_write */
+    FPI_BUFSET,          /* buf_set */
+
+    FPI_UINT8,           /* UINT8 */
+    FPI_UINT16,          /* UINT16 */
+    FPI_UINT32,          /* UINT32 */
+    FPI_INT8,            /* INT8 */
+    FPI_INT16,           /* INT16 */
+    FPI_INT32,           /* INT32 */
+    FPI_BUFFER,          /* BUFFER */
+    FPI_DATA,            /* DATA */
+    FPI_STRBUF,          /* STRBUF */
+    FPI_STRING,          /* STRING */
+
+    FPI_TFFS             /* TFFS */
+
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rvinterf/etm/tmffs2.h	Tue Feb 04 07:22:19 2014 +0000
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * FFS2 Protocol Indentifiers
+ ******************************************************************************/
+
+enum FFS2_PROTOCOL_IDENTIFIERS {
+	TMFFS_FORMAT     = 'f',
+	TMFFS_PREFORMAT  = 'p',
+
+	TMFFS_MKDIR      = 'm',
+	TMFFS_OPENDIR    = 'o',
+	TMFFS_READDIR    = 'D',
+	TMFFS_REMOVE     = 'd',
+	TMFFS_RENAME     = 'n',
+	TMFFS_XLSTAT     = 'x',
+
+	TMFFS_SYMLINK    = 'y',
+	TMFFS_READLINK   = 'Y',
+
+	TMFFS_OPEN       = 'O',
+	TMFFS_CLOSE      = 'C',
+	TMFFS_READ       = 'R',
+	TMFFS_WRITE      = 'W',
+	TMFFS_SEEK       = 'S',
+
+	TMFFS_FTRUNCATE  = 'T',
+	TMFFS_TRUNCATE   = 't',
+
+	TMFFS_FILE_READ  = 'r',
+	TMFFS_FILE_WRITE = 'w',
+
+	TMFFS_FSTAT      = 'F',
+	TMFFS_LSTAT      = 'l',
+	TMFFS_STAT       = 's',
+
+	TMFFS_FCONTROL   = 'c',
+	TMFFS_QUERY      = 'q',
+
+	TMFFS_INIT       = 'i',
+	TMFFS_EXIT       = 'e', 
+
+	// Special
+	TMFFS_DIRXLSTAT  = 'X',
+
+	TMFFS_VERSION    = 'v',
+	TMFFS_TFFS       = 'z'
+}; 
--- a/rvinterf/etm/usercmd.c	Tue Feb 04 05:03:57 2014 +0000
+++ b/rvinterf/etm/usercmd.c	Tue Feb 04 07:22:19 2014 +0000
@@ -13,6 +13,7 @@
 
 extern void cmd_abbr();
 extern void cmd_abbw();
+extern void cmd_check_ffs1();
 extern void cmd_dieid();
 extern void cmd_etmpkt();
 extern void cmd_ping();
@@ -40,6 +41,7 @@
 } cmdtab[] = {
 	{"abbr", 2, 2, cmd_abbr},
 	{"abbw", 3, 3, cmd_abbw},
+	{"check-ffs1", 0, 0, cmd_check_ffs1},
 	{"dieid", 0, 0, cmd_dieid},
 	{"etmpkt", 1, 253, cmd_etmpkt},
 	{"exit", 0, 0, cmd_exit},