mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-08-08 08:33:39 +08:00
PPP, using err_t return type on ppp_ioctl()
This commit is contained in:
@@ -337,11 +337,12 @@ int ppp_free(ppp_pcb *pcb) {
|
||||
|
||||
/* Get and set parameters for the given connection.
|
||||
* Return 0 on success, an error code on failure. */
|
||||
int
|
||||
err_t
|
||||
ppp_ioctl(ppp_pcb *pcb, int cmd, void *arg)
|
||||
{
|
||||
if(NULL == pcb)
|
||||
return PPPERR_PARAM;
|
||||
if (pcb == NULL) {
|
||||
return ERR_VAL;
|
||||
}
|
||||
|
||||
switch(cmd) {
|
||||
case PPPCTLG_UPSTATUS: /* Get the PPP up status. */
|
||||
@@ -349,21 +350,21 @@ ppp_ioctl(ppp_pcb *pcb, int cmd, void *arg)
|
||||
goto fail;
|
||||
}
|
||||
*(int *)arg = (int)(pcb->if_up);
|
||||
return PPPERR_NONE;
|
||||
return ERR_OK;
|
||||
|
||||
case PPPCTLS_ERRCODE: /* Set the PPP error code. */
|
||||
if (!arg) {
|
||||
goto fail;
|
||||
}
|
||||
pcb->err_code = (u8_t)(*(int *)arg);
|
||||
return PPPERR_NONE;
|
||||
return ERR_OK;
|
||||
|
||||
case PPPCTLG_ERRCODE: /* Get the PPP error code. */
|
||||
if (!arg) {
|
||||
goto fail;
|
||||
}
|
||||
*(int *)arg = (int)(pcb->err_code);
|
||||
return PPPERR_NONE;
|
||||
return ERR_OK;
|
||||
|
||||
default:
|
||||
if (pcb->link_cb->ioctl) {
|
||||
@@ -372,7 +373,7 @@ ppp_ioctl(ppp_pcb *pcb, int cmd, void *arg)
|
||||
}
|
||||
|
||||
fail:
|
||||
return PPPERR_PARAM;
|
||||
return ERR_VAL;
|
||||
}
|
||||
|
||||
#if LWIP_NETIF_STATUS_CALLBACK
|
||||
|
||||
@@ -58,7 +58,7 @@ static void pppos_disconnect(ppp_pcb *ppp, void *ctx);
|
||||
static err_t pppos_destroy(ppp_pcb *ppp, void *ctx);
|
||||
static void pppos_send_config(ppp_pcb *ppp, void *ctx, u32_t accm);
|
||||
static void pppos_recv_config(ppp_pcb *ppp, void *ctx, u32_t accm);
|
||||
static int pppos_ioctl(ppp_pcb *pcb, void *ctx, int cmd, void *arg);
|
||||
static err_t pppos_ioctl(ppp_pcb *pcb, void *ctx, int cmd, void *arg);
|
||||
#if VJ_SUPPORT
|
||||
static void pppos_vjc_config(ppp_pcb *ppp, void *ctx, int vjcomp, int cidcomp, int maxcid);
|
||||
static err_t pppos_netif_input(ppp_pcb *ppp, void *ctx, struct pbuf *p, u16_t protocol);
|
||||
@@ -753,7 +753,7 @@ pppos_recv_config(ppp_pcb *ppp, void *ctx, u32_t accm)
|
||||
pppos->in_accm[0], pppos->in_accm[1], pppos->in_accm[2], pppos->in_accm[3]));
|
||||
}
|
||||
|
||||
static int
|
||||
static err_t
|
||||
pppos_ioctl(ppp_pcb *pcb, void *ctx, int cmd, void *arg)
|
||||
{
|
||||
pppos_pcb *pppos = (pppos_pcb *)ctx;
|
||||
@@ -765,13 +765,13 @@ pppos_ioctl(ppp_pcb *pcb, void *ctx, int cmd, void *arg)
|
||||
goto fail;
|
||||
}
|
||||
*(sio_fd_t *)arg = pppos->fd;
|
||||
return PPPERR_NONE;
|
||||
return ERR_OK;
|
||||
|
||||
default: ;
|
||||
}
|
||||
|
||||
fail:
|
||||
return PPPERR_PARAM;
|
||||
return ERR_VAL;
|
||||
}
|
||||
|
||||
#if VJ_SUPPORT
|
||||
|
||||
Reference in New Issue
Block a user