/* Handle an input data byte in normal state.  */
static int state_normal_input(struct network_interface_slip_t *self_p, uint8_t data)
/* Handle an input data byte in normal state.  */
static int state_normal_input(struct network_interface_slip_t *self_p, uint8_t data)
{
    int res = 1;
    switch (data) {
    case SLIP_END:
        if (self_p->frame.size > 0) {
            tcpip_input(self_p->frame.pbuf_p,
                        self_p->network_interface.netif_p);
            self_p->frame.pbuf_p = pbuf_alloc(PBUF_LINK,
                                              (PBUF_POOL_BUFSIZE
                                               - PBUF_LINK_HLEN),
                                              PBUF_POOL);
            self_p->frame.buf_p = self_p->frame.pbuf_p->payload;
            self_p->frame.size = 0;
        }
        res = 0;
        break;
    case SLIP_ESC:
        self_p->state = NETWORK_INTERFACE_SLIP_STATE_ESCAPE;
        res = 0;
        break;
    default:
        break;
    }
    return (res);
}