diff options
Diffstat (limited to 'qarsh/qarsh_packet.h')
-rw-r--r-- | qarsh/qarsh_packet.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/qarsh/qarsh_packet.h b/qarsh/qarsh_packet.h index 64b2b2a..b858631 100644 --- a/qarsh/qarsh_packet.h +++ b/qarsh/qarsh_packet.h @@ -13,7 +13,9 @@ enum qa_packet_type { QP_ACK = 4, QP_CMDEXIT = 5, QP_SETUSER = 6, - QP_KILL = 7 + QP_KILL = 7, + QP_RECVFILE = 8, + QP_SENDFILE = 9 }; struct qp_hello_pkt { @@ -53,6 +55,20 @@ struct qp_kill_pkt { int qp_sig; }; +struct qp_recvfile_pkt { + char *qp_path; + mode_t qp_mode; + int qp_if_port; + size_t qp_count; +}; + +struct qp_sendfile_pkt { + char *qp_path; + int qp_of_port; + size_t qp_count; +}; + + #define QP_VERSION 1 struct qa_packet { @@ -66,6 +82,8 @@ struct qa_packet { struct qp_cmdexit_pkt cmdexit; struct qp_setuser_pkt setuser; struct qp_kill_pkt kill; + struct qp_recvfile_pkt recvfile; + struct qp_sendfile_pkt sendfile; } qp_u; }; @@ -76,6 +94,8 @@ struct qa_packet { #define qp_cmdexit qp_u.cmdexit #define qp_setuser qp_u.setuser #define qp_kill qp_u.kill +#define qp_recvfile qp_u.recvfile +#define qp_sendfile qp_u.sendfile /* Prototypes */ char *qp_packet_type(enum qa_packet_type t); @@ -87,6 +107,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, size_t count, mode_t mode); +struct qa_packet *make_qp_sendfile(const char *path, int of_port, size_t count); char *qptostr(struct qa_packet *qp, char **qpstr, int *qpsize); void qpfree(struct qa_packet *qp); void dump_qp(struct qa_packet *qp); |