From dbc54da5c73d9e8dd1b8a258a4723279423e6e58 Mon Sep 17 00:00:00 2001 From: Hannes Reinecke Date: Mon, 11 Apr 2022 11:27:53 +0200 Subject: redir: IDE-redirection receive stubs Signed-off-by: Hannes Reinecke --- redir.c | 17 +++++++++++++++-- redir.h | 3 +-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/redir.c b/redir.c index 03e948a..bd54637 100644 --- a/redir.c +++ b/redir.c @@ -369,7 +369,7 @@ int redir_sol_send(struct redir *r, unsigned char *buf, int blen) return rc; } -int redir_sol_recv(struct redir *r) +int redir_recv(struct redir *r) { unsigned char msg[64]; int count, len, bshift; @@ -500,7 +500,7 @@ repeat: case SOL_DATA_FROM_HOST: if (r->blen < 10) /* header length */ goto again; - bshift = redir_sol_recv(r); + bshift = redir_recv(r); if (bshift < 0) goto err; break; @@ -570,6 +570,19 @@ repeat: } redir_state(r, REDIR_RUN_IDER); break; + case IDER_DATA_FROM_HOST: + if (r->blen < 10) /* header length */ + goto again; + bshift = redir_recv(r); + if (bshift < 0) + goto err; + break; + case END_IDER_REDIRECTION_REPLY: + bshift = r->blen; /* FIXME */ + if (r->blen < bshift) + goto again; + redir_stop(r); + break; default: snprintf(r->err, sizeof(r->err), "%s: unknown r->buf 0x%02x", __FUNCTION__, r->buf[0]); diff --git a/redir.h b/redir.h index 64d46a7..06822d4 100644 --- a/redir.h +++ b/redir.h @@ -61,12 +61,11 @@ int redir_connect(struct redir *r); int redir_start(struct redir *r); int redir_stop(struct redir *r); int redir_auth(struct redir *r); +int redir_recv(struct redir *r); int redir_sol_start(struct redir *r); int redir_sol_stop(struct redir *r); int redir_sol_send(struct redir *r, unsigned char *buf, int blen); -int redir_sol_recv(struct redir *r); int redir_ider_start(struct redir *r); int redir_ider_stop(struct redir *r); int redir_ider_send(struct redir *r, unsigned char *buf, int blen); -int redir_ider_recv(struct redir *r); int redir_data(struct redir *r); -- cgit