Lines Matching refs:slip
5 int slip_proto_read(int fd, void *buf, int len, struct slip_proto *slip) in slip_proto_read() argument
9 if(slip->more > 0){ in slip_proto_read()
11 while(i < slip->more){ in slip_proto_read()
12 size = slip_unesc(slip->ibuf[i++], slip->ibuf, in slip_proto_read()
13 &slip->pos, &slip->esc); in slip_proto_read()
15 memcpy(buf, slip->ibuf, size); in slip_proto_read()
16 memmove(slip->ibuf, &slip->ibuf[i], in slip_proto_read()
17 slip->more - i); in slip_proto_read()
18 slip->more = slip->more - i; in slip_proto_read()
22 slip->more = 0; in slip_proto_read()
25 n = net_read(fd, &slip->ibuf[slip->pos], in slip_proto_read()
26 sizeof(slip->ibuf) - slip->pos); in slip_proto_read()
30 start = slip->pos; in slip_proto_read()
32 size = slip_unesc(slip->ibuf[start + i], slip->ibuf,&slip->pos, in slip_proto_read()
33 &slip->esc); in slip_proto_read()
35 memcpy(buf, slip->ibuf, size); in slip_proto_read()
36 memmove(slip->ibuf, &slip->ibuf[start+i+1], in slip_proto_read()
38 slip->more = n - (i + 1); in slip_proto_read()
45 int slip_proto_write(int fd, void *buf, int len, struct slip_proto *slip) in slip_proto_write() argument
49 actual = slip_esc(buf, slip->obuf, len); in slip_proto_write()
50 n = net_write(fd, slip->obuf, actual); in slip_proto_write()