aboutsummaryrefslogtreecommitdiffstats
path: root/com32/sysdump/backend.h
diff options
context:
space:
mode:
Diffstat (limited to 'com32/sysdump/backend.h')
-rw-r--r--com32/sysdump/backend.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/com32/sysdump/backend.h b/com32/sysdump/backend.h
index a83e3938..343d2960 100644
--- a/com32/sysdump/backend.h
+++ b/com32/sysdump/backend.h
@@ -5,12 +5,23 @@
#include <inttypes.h>
#include <stdbool.h>
#include <zlib.h>
+#include "serial.h"
+
+/* Backend flags */
+#define BE_NEEDLEN 0x01
struct backend {
const char *name;
- int blocksize;
+ const char *helpmsg;
+ int minargs;
+
+ unsigned int blocksize;
+ unsigned int flags;
+
+ size_t dbytes;
+ size_t zbytes;
- int (*open)(struct backend *, const char *argv[]);
+ int (*open)(struct backend *, const char *argv[], size_t len);
int (*write)(struct backend *, const char *buf, size_t len);
z_stream zstream;
@@ -24,15 +35,19 @@ struct backend {
uint16_t srv_port;
uint16_t seq;
} tftp;
+ struct {
+ struct serial_if serial;
+ uint16_t seq;
+ } ymodem;
};
};
/* zout.c */
-int init_data(struct backend *be, const char *argv[]);
+int init_data(struct backend *be, const char *argv[], size_t len);
int write_data(struct backend *be, const void *buf, size_t len, bool flush);
/* cpio.c */
-int cpio_init(struct backend *be, const char *argv[]);
+int cpio_init(struct backend *be, const char *argv[], size_t len);
int cpio_mkdir(struct backend *be, const char *filename);
int cpio_writefile(struct backend *be, const char *filename,
const void *data, size_t len);
@@ -41,4 +56,9 @@ int cpio_close(struct backend *be);
/* backends.c */
struct backend *get_backend(const char *name);
+/* backends */
+extern struct backend be_tftp;
+extern struct backend be_ymodem;
+extern struct backend be_null;
+
#endif /* BACKEND_H */