summaryrefslogtreecommitdiffstats
path: root/qarsh_packet.h
diff options
context:
space:
mode:
authorNathan Straz <nstraz@redhat.com>2013-08-12 13:35:17 -0400
committerNathan Straz <nstraz@redhat.com>2013-09-11 17:40:06 -0400
commitb7aafc98a56966d4aab712ac0f73df0ae07ca657 (patch)
treeaefa2138f74f4e5cce7f5b6724191b18c52c68d3 /qarsh_packet.h
parent2faad967427b001262712523a7ffbf3e9b28d32a (diff)
downloadqarsh-b7aafc98a56966d4aab712ac0f73df0ae07ca657.tar.gz
qarsh-b7aafc98a56966d4aab712ac0f73df0ae07ca657.tar.xz
qarsh-b7aafc98a56966d4aab712ac0f73df0ae07ca657.zip
Add new data packet type
Diffstat (limited to 'qarsh_packet.h')
-rw-r--r--qarsh_packet.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/qarsh_packet.h b/qarsh_packet.h
index ec391c3..42f4b61 100644
--- a/qarsh_packet.h
+++ b/qarsh_packet.h
@@ -36,7 +36,8 @@ enum qa_packet_type {
QP_KILL = 7,
QP_RECVFILE = 8,
QP_SENDFILE = 9,
- QP_RSTAT = 10
+ QP_RSTAT = 10,
+ QP_DATA = 11
};
struct qp_hello_pkt {
@@ -96,6 +97,13 @@ struct qp_rstat_pkt {
off_t qp_st_size;
};
+struct qp_data_pkt {
+ int qp_remfd; /* remote fd to write to */
+ off_t qp_offset; /* offset in file for this data */
+ int qp_count; /* length of data buffer */
+ int free_blob; /* Whether qpfree should free the blob */
+ void *qp_blob;
+};
#define QP_VERSION 1
@@ -113,6 +121,7 @@ struct qa_packet {
struct qp_recvfile_pkt recvfile;
struct qp_sendfile_pkt sendfile;
struct qp_rstat_pkt rstat;
+ struct qp_data_pkt data;
} qp_u;
};
@@ -126,6 +135,7 @@ struct qa_packet {
#define qp_recvfile qp_u.recvfile
#define qp_sendfile qp_u.sendfile
#define qp_rstat qp_u.rstat
+#define qp_data qp_u.data
/* Prototypes */
char *qp_packet_type(enum qa_packet_type t);
@@ -140,6 +150,7 @@ struct qa_packet *make_qp_kill(int sig);
struct qa_packet *make_qp_recvfile(const char *path, int if_port, off_t count, mode_t mode);
struct qa_packet *make_qp_sendfile(const char *path, int of_port);
struct qa_packet *make_qp_rstat(const char *path, const struct stat *sb);
+struct qa_packet *make_qp_data(const int remfd, const off_t offset, const int count, void *blob);
int qptostr(struct qa_packet *qp, char *qpstr, int maxsize);
void qpfree(struct qa_packet *qp);
void dump_qp(struct qa_packet *qp);