summaryrefslogtreecommitdiffstats
path: root/qarsh_packet.h
diff options
context:
space:
mode:
authorNathan Straz <nstraz@redhat.com>2013-08-13 15:05:06 -0400
committerNathan Straz <nstraz@redhat.com>2013-09-11 17:49:12 -0400
commit5be1f6c7a3dbfd172c243a08d9f46867b3ca413f (patch)
treee71d47c63ac40adcb7b9e865f5360583fb9bc424 /qarsh_packet.h
parent0a361ddae1649b0a3102e113d16e6f7f07f6d7e8 (diff)
downloadqarsh-5be1f6c7a3dbfd172c243a08d9f46867b3ca413f.tar.gz
qarsh-5be1f6c7a3dbfd172c243a08d9f46867b3ca413f.tar.xz
qarsh-5be1f6c7a3dbfd172c243a08d9f46867b3ca413f.zip
Get qacp local to remote working on main socket
I removed the buffering layer from recv_packet because it made the logic too complex around the pselect in qarshd. Now only read as much as needed to get each packet. qarshd adds an array for remote file descriptors which is only a stub for now. This needs to be expanded to allow multiple file transfers at the same time for runcmd.
Diffstat (limited to 'qarsh_packet.h')
-rw-r--r--qarsh_packet.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/qarsh_packet.h b/qarsh_packet.h
index 42f4b61..908a6da 100644
--- a/qarsh_packet.h
+++ b/qarsh_packet.h
@@ -80,13 +80,12 @@ struct qp_kill_pkt {
struct qp_recvfile_pkt {
char *qp_path;
mode_t qp_mode;
- int qp_if_port;
off_t qp_count;
};
struct qp_sendfile_pkt {
char *qp_path;
- int qp_of_port;
+ int qp_remfd; /* file descriptor on client side */
};
struct qp_rstat_pkt {
@@ -105,8 +104,6 @@ struct qp_data_pkt {
void *qp_blob;
};
-#define QP_VERSION 1
-
struct qa_packet {
enum qa_packet_type qp_type;
int qp_seq; /* Sequence number for this packet */
@@ -147,8 +144,8 @@ struct qa_packet *make_qp_runcmd(char *cmdline, int p_in, int p_out, int p_err);
struct qa_packet *make_qp_cmdexit(pid_t pid, int status);
struct qa_packet *make_qp_setuser(char *user, char *group);
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_recvfile(const char *path, off_t count, mode_t mode);
+struct qa_packet *make_qp_sendfile(const char *path, int remfd);
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);