2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
6 #ifndef __UM_SLIP_PROTO_H__
7 #define __UM_SLIP_PROTO_H__
9 /* SLIP protocol characters. */
10 #define SLIP_END 0300 /* indicates end of frame */
11 #define SLIP_ESC 0333 /* indicates byte stuffing */
12 #define SLIP_ESC_END 0334 /* ESC ESC_END means END 'data' */
13 #define SLIP_ESC_ESC 0335 /* ESC ESC_ESC means ESC 'data' */
15 static inline int slip_unesc(unsigned char c
,char *buf
,int *pos
, int *esc
)
45 static inline int slip_esc(unsigned char *s
, unsigned char *d
, int len
)
47 unsigned char *ptr
= d
;
51 * Send an initial END character to flush out any
52 * data that may have accumulated in the receiver
59 * For each byte in the packet, send the appropriate
60 * character sequence, according to the SLIP protocol.
67 *ptr
++ = SLIP_ESC_END
;
71 *ptr
++ = SLIP_ESC_ESC
;
85 * Overrides for Emacs so that we follow Linus's tabbing style.
86 * Emacs will notice this stuff at the end of the file and automatically
87 * adjust the settings for this buffer only. This must remain at the end
89 * ---------------------------------------------------------------------------
91 * c-file-style: "linux"