/* Handle an input data byte in escaped state.  */
static int state_escaped_input(struct network_interface_slip_t *self_p, uint8_t data)
/* Handle an input data byte in escaped state.  */
static int state_escaped_input(struct network_interface_slip_t *self_p, uint8_t data)
{
    int res = 1;
    switch (data) {
    case SLIP_ESC_END:
        data = SLIP_END;
        break;
    case SLIP_ESC_ESC:
        data = SLIP_ESC;
        break;
    default:
        self_p->frame.size = 0;
        res = -1;
    }
    self_p->state = NETWORK_INTERFACE_SLIP_STATE_NORMAL;
    return (res);
}