summaryrefslogtreecommitdiffstats
path: root/qarsh/qarsh_packet.h
diff options
context:
space:
mode:
Diffstat (limited to 'qarsh/qarsh_packet.h')
-rw-r--r--qarsh/qarsh_packet.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/qarsh/qarsh_packet.h b/qarsh/qarsh_packet.h
index b21661b..b6d821b 100644
--- a/qarsh/qarsh_packet.h
+++ b/qarsh/qarsh_packet.h
@@ -11,7 +11,8 @@ enum qa_packet_type {
QP_RETURNCODE = 2,
QP_RUNCMD = 3,
QP_ACK = 4,
- QP_CMDEXIT = 5
+ QP_CMDEXIT = 5,
+ QP_SETUSER = 6
};
struct qp_hello_pkt {
@@ -42,6 +43,11 @@ struct qp_cmdexit_pkt {
int qp_status;
};
+struct qp_setuser_pkt {
+ char *qp_user;
+ char *qp_group;
+};
+
#define QP_VERSION 1
struct qa_packet {
@@ -53,6 +59,7 @@ struct qa_packet {
struct qp_runcmd_pkt runcmd;
struct qp_ack_pkt ack;
struct qp_cmdexit_pkt cmdexit;
+ struct qp_setuser_pkt setuser;
} qp_u;
};
@@ -61,14 +68,17 @@ struct qa_packet {
#define qp_runcmd qp_u.runcmd
#define qp_ack qp_u.ack
#define qp_cmdexit qp_u.cmdexit
+#define qp_setuser qp_u.setuser
/* Prototypes */
char *qp_packet_type(enum qa_packet_type t);
struct qa_packet *parse_packets(char *buf, int n);
struct qa_packet *make_qp_hello(char *greeting);
+struct qa_packet *make_qp_returncode(int rc, int eno, char *strerr);
struct qa_packet *make_qp_ack(enum qa_packet_type t, int i);
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);
char *qptostr(struct qa_packet *qp, char **qpstr, int *qpsize);
void qpfree(struct qa_packet *qp);
void dump_qp(struct qa_packet *qp);