| // SPDX-License-Identifier: GPL-2.0 |
| int slip_proto_read(int fd, void *buf, int len, struct slip_proto *slip) |
| size = slip_unesc(slip->ibuf[i++], slip->ibuf, |
| memcpy(buf, slip->ibuf, size); |
| memmove(slip->ibuf, &slip->ibuf[i], |
| slip->more = slip->more - i; |
| n = net_read(fd, &slip->ibuf[slip->pos], |
| sizeof(slip->ibuf) - slip->pos); |
| size = slip_unesc(slip->ibuf[start + i], slip->ibuf,&slip->pos, |
| memcpy(buf, slip->ibuf, size); |
| memmove(slip->ibuf, &slip->ibuf[start+i+1], |
| slip->more = n - (i + 1); |
| int slip_proto_write(int fd, void *buf, int len, struct slip_proto *slip) |
| actual = slip_esc(buf, slip->obuf, len); |
| n = net_write(fd, slip->obuf, actual); |