diff options
author | brian <brian@FreeBSD.org> | 1997-10-26 01:04:02 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-10-26 01:04:02 +0000 |
commit | 486b8925ecb0d408e403474828e20c1cce8aaec8 (patch) | |
tree | cca66974908224bf517868aaafb2e4acd1abe88d /usr.sbin/ppp/async.c | |
parent | 1d2927c9fac7bcfe68bf6ab502c716adc91d6f09 (diff) | |
download | FreeBSD-src-486b8925ecb0d408e403474828e20c1cce8aaec8.zip FreeBSD-src-486b8925ecb0d408e403474828e20c1cce8aaec8.tar.gz |
Cosmetic (no functional changes):
o Add missing $Id$s
o Move extern decls from .c -> .h files
o Staticize
o Remove #includes from .h files
o style(9)ify includes
o bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
index -> strchr
rindex -> strrchr
o Move timeout.h -> timer.h (making it consistent w/ timer.c)
o Add -Wmissing-prototypes
Diffstat (limited to 'usr.sbin/ppp/async.c')
-rw-r--r-- | usr.sbin/ppp/async.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/usr.sbin/ppp/async.c b/usr.sbin/ppp/async.c index 3b414e9..99ef1ad 100644 --- a/usr.sbin/ppp/async.c +++ b/usr.sbin/ppp/async.c @@ -17,28 +17,41 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: async.c,v 1.10 1997/06/23 23:08:23 brian Exp $ + * $Id: async.c,v 1.11 1997/08/25 00:29:05 brian Exp $ * */ +#include <sys/param.h> +#include <netinet/in.h> + +#include <stdio.h> +#include <string.h> +#include <termios.h> + +#include "mbuf.h" +#include "log.h" +#include "defs.h" +#include "timer.h" #include "fsm.h" #include "hdlc.h" #include "lcp.h" #include "lcpproto.h" #include "modem.h" #include "loadalias.h" +#include "command.h" #include "vars.h" #include "os.h" +#include "async.h" #define HDLCSIZE (MAX_MRU*2+6) -struct async_state { +static struct async_state { int mode; int length; u_char hbuff[HDLCSIZE]; /* recv buffer */ u_char xbuff[HDLCSIZE]; /* xmit buffer */ u_long my_accmap; u_long his_accmap; -} AsyncState; +} AsyncState; #define MODE_HUNT 0x01 #define MODE_ESC 0x02 @@ -54,7 +67,7 @@ AsyncInit() } void -SetLinkParams(struct lcpstate * lcp) +SetLinkParams(struct lcpstate *lcp) { struct async_state *stp = &AsyncState; @@ -66,7 +79,7 @@ SetLinkParams(struct lcpstate * lcp) * Encode into async HDLC byte code if necessary */ static void -HdlcPutByte(u_char ** cp, u_char c, int proto) +HdlcPutByte(u_char **cp, u_char c, int proto) { u_char *wp; @@ -85,7 +98,7 @@ HdlcPutByte(u_char ** cp, u_char c, int proto) } void -AsyncOutput(int pri, struct mbuf * bp, int proto) +AsyncOutput(int pri, struct mbuf *bp, int proto) { struct async_state *hs = &AsyncState; u_char *cp, *sp, *ep; @@ -120,7 +133,7 @@ AsyncOutput(int pri, struct mbuf * bp, int proto) pfree(bp); } -struct mbuf * +static struct mbuf * AsyncDecode(u_char c) { struct async_state *hs = &AsyncState; @@ -164,14 +177,14 @@ AsyncDecode(u_char c) } void -AsyncInput(u_char * buff, int cnt) +AsyncInput(u_char *buff, int cnt) { struct mbuf *bp; OsAddInOctets(cnt); if (DEV_IS_SYNC) { bp = mballoc(cnt, MB_ASYNC); - bcopy(buff, MBUF_CTOP(bp), cnt); + memcpy(MBUF_CTOP(bp), buff, cnt); bp->cnt = cnt; HdlcInput(bp); } else { |