diff options
Diffstat (limited to 'qarsh/qarsh_packet.h')
-rw-r--r-- | qarsh/qarsh_packet.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/qarsh/qarsh_packet.h b/qarsh/qarsh_packet.h index b858631..c4316fd 100644 --- a/qarsh/qarsh_packet.h +++ b/qarsh/qarsh_packet.h @@ -2,6 +2,7 @@ # define _QARSH_PACKET_H 1 #include <sys/types.h> +#include <sys/stat.h> #define QARSH_MAX_PACKET_SIZE 32*1024 @@ -15,7 +16,8 @@ enum qa_packet_type { QP_SETUSER = 6, QP_KILL = 7, QP_RECVFILE = 8, - QP_SENDFILE = 9 + QP_SENDFILE = 9, + QP_RSTAT = 10 }; struct qp_hello_pkt { @@ -68,6 +70,14 @@ struct qp_sendfile_pkt { size_t qp_count; }; +struct qp_rstat_pkt { + char *qp_path; + mode_t qp_st_mode; + uid_t qp_st_uid; + gid_t qp_st_gid; + off_t qp_st_size; +}; + #define QP_VERSION 1 @@ -84,6 +94,7 @@ struct qa_packet { struct qp_kill_pkt kill; struct qp_recvfile_pkt recvfile; struct qp_sendfile_pkt sendfile; + struct qp_rstat_pkt rstat; } qp_u; }; @@ -96,6 +107,7 @@ struct qa_packet { #define qp_kill qp_u.kill #define qp_recvfile qp_u.recvfile #define qp_sendfile qp_u.sendfile +#define qp_rstat qp_u.rstat /* Prototypes */ char *qp_packet_type(enum qa_packet_type t); @@ -109,6 +121,7 @@ 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); +struct qa_packet *make_qp_rstat(const char *path, const struct stat *sb); char *qptostr(struct qa_packet *qp, char **qpstr, int *qpsize); void qpfree(struct qa_packet *qp); void dump_qp(struct qa_packet *qp); |