aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Delevoryas <pdel@fb.com>2021-12-02 21:13:39 -0800
committerPeter Delevoryas <pdel@fb.com>2022-05-11 15:57:57 -0700
commit5025b871c36fd5b9daf3085f0a8c73d7d34c692d (patch)
tree9e84f866ce0b5670304c77f6bfc9f0da9b533ea5
parentb397a330e244a94019dd88d5c98b805568cf5a8a (diff)
downloadslirp-5025b871c36fd5b9daf3085f0a8c73d7d34c692d.zip
slirp-5025b871c36fd5b9daf3085f0a8c73d7d34c692d.tar.gz
slirp-5025b871c36fd5b9daf3085f0a8c73d7d34c692d.tar.bz2
ncsi: Pass Slirp structure to response handlers
This will let us use Slirp fields to generate more interesting NC-SI responses. Signed-off-by: Peter Delevoryas <pdel@fb.com>
-rw-r--r--src/ncsi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ncsi.c b/src/ncsi.c
index f3427bd..e556193 100644
--- a/src/ncsi.c
+++ b/src/ncsi.c
@@ -56,7 +56,7 @@ static uint32_t ncsi_calculate_checksum(uint8_t *data, int len)
}
/* Get Capabilities */
-static int ncsi_rsp_handler_gc(struct ncsi_rsp_pkt_hdr *rnh)
+static int ncsi_rsp_handler_gc(Slirp *slirp, struct ncsi_rsp_pkt_hdr *rnh)
{
struct ncsi_rsp_gc_pkt *rsp = (struct ncsi_rsp_gc_pkt *)rnh;
@@ -71,7 +71,7 @@ static int ncsi_rsp_handler_gc(struct ncsi_rsp_pkt_hdr *rnh)
}
/* Get Link status */
-static int ncsi_rsp_handler_gls(struct ncsi_rsp_pkt_hdr *rnh)
+static int ncsi_rsp_handler_gls(Slirp *slirp, struct ncsi_rsp_pkt_hdr *rnh)
{
struct ncsi_rsp_gls_pkt *rsp = (struct ncsi_rsp_gls_pkt *)rnh;
@@ -80,7 +80,7 @@ static int ncsi_rsp_handler_gls(struct ncsi_rsp_pkt_hdr *rnh)
}
/* Get Parameters */
-static int ncsi_rsp_handler_gp(struct ncsi_rsp_pkt_hdr *rnh)
+static int ncsi_rsp_handler_gp(Slirp *slirp, struct ncsi_rsp_pkt_hdr *rnh)
{
struct ncsi_rsp_gp_pkt *rsp = (struct ncsi_rsp_gp_pkt *)rnh;
@@ -96,7 +96,7 @@ static int ncsi_rsp_handler_gp(struct ncsi_rsp_pkt_hdr *rnh)
static const struct ncsi_rsp_handler {
unsigned char type;
int payload;
- int (*handler)(struct ncsi_rsp_pkt_hdr *rnh);
+ int (*handler)(Slirp *slirp, struct ncsi_rsp_pkt_hdr *rnh);
} ncsi_rsp_handlers[] = { { NCSI_PKT_RSP_CIS, 4, NULL },
{ NCSI_PKT_RSP_SP, 4, NULL },
{ NCSI_PKT_RSP_DP, 4, NULL },
@@ -178,7 +178,7 @@ void ncsi_input(Slirp *slirp, const uint8_t *pkt, int pkt_len)
if (handler->handler) {
/* TODO: handle errors */
- handler->handler(rnh);
+ handler->handler(slirp, rnh);
}
ncsi_rsp_len += handler->payload;
} else {