12 #define BE_NEEDLEN 0x01
14 struct upload_backend
{
25 int (*write
)(struct upload_backend
*);
33 int init_data(struct upload_backend
*be
, const char *argv
[]);
34 int write_data(struct upload_backend
*be
, const void *buf
, size_t len
);
35 int flush_data(struct upload_backend
*be
);
38 #define cpio_init init_data
39 int cpio_hdr(struct upload_backend
*be
, uint32_t mode
, size_t datalen
,
40 const char *filename
);
41 int cpio_mkdir(struct upload_backend
*be
, const char *filename
);
42 int cpio_writefile(struct upload_backend
*be
, const char *filename
,
43 const void *data
, size_t len
);
44 int cpio_close(struct upload_backend
*be
);
45 #define MODE_FILE 0100644
46 #define MODE_DIR 0040755
49 struct upload_backend
*get_upload_backend(const char *name
);
52 extern struct upload_backend upload_tftp
;
53 extern struct upload_backend upload_ymodem
;
54 extern struct upload_backend upload_srec
;
56 #endif /* BACKEND_H */