Deleted Added
full compact
async.c (26142) async.c (26516)
1/*
2 * PPP Async HDLC Module
3 *
4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp)
5 *
6 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
7 *
8 * Redistribution and use in source and binary forms are permitted
9 * provided that the above copyright notice and this paragraph are
10 * duplicated in all such forms and that any documentation,
11 * advertising materials, and other materials related to such
12 * distribution and use acknowledge that the software was developed
13 * by the Internet Initiative Japan, Inc. The name of the
14 * IIJ may not be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 *
1/*
2 * PPP Async HDLC Module
3 *
4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp)
5 *
6 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
7 *
8 * Redistribution and use in source and binary forms are permitted
9 * provided that the above copyright notice and this paragraph are
10 * duplicated in all such forms and that any documentation,
11 * advertising materials, and other materials related to such
12 * distribution and use acknowledge that the software was developed
13 * by the Internet Initiative Japan, Inc. The name of the
14 * IIJ may not be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 *
20 * $Id: async.c,v 1.7 1997/02/22 16:09:59 peter Exp $
20 * $Id: async.c,v 1.8 1997/05/26 00:43:55 brian Exp $
21 *
22 */
23#include "fsm.h"
24#include "hdlc.h"
25#include "lcp.h"
26#include "lcpproto.h"
27#include "modem.h"
28#include "loadalias.h"

--- 87 unchanged lines hidden (view full) ---

116 return;
117 }
118 }
119 wp = wp->next;
120 }
121 *cp ++ = HDLC_SYN;
122
123 cnt = cp - hs->xbuff;
21 *
22 */
23#include "fsm.h"
24#include "hdlc.h"
25#include "lcp.h"
26#include "lcpproto.h"
27#include "modem.h"
28#include "loadalias.h"

--- 87 unchanged lines hidden (view full) ---

116 return;
117 }
118 }
119 wp = wp->next;
120 }
121 *cp ++ = HDLC_SYN;
122
123 cnt = cp - hs->xbuff;
124 LogDumpBuff(LOG_ASYNC, "WriteModem", hs->xbuff, cnt);
124 LogDumpBuff(LogASYNC, "WriteModem", hs->xbuff, cnt);
125 WriteModem(pri, (char *)hs->xbuff, cnt);
126 OsAddOutOctets(cnt);
127 pfree(bp);
128}
129
130struct mbuf *
131AsyncDecode(c)
132u_char c;

--- 18 unchanged lines hidden (view full) ---

151 if (!(hs->mode & MODE_ESC)) {
152 hs->mode |= MODE_ESC;
153 break;
154 }
155 /* Fall into ... */
156 default:
157 if (hs->length >= HDLCSIZE) {
158 /* packet is too large, discard it */
125 WriteModem(pri, (char *)hs->xbuff, cnt);
126 OsAddOutOctets(cnt);
127 pfree(bp);
128}
129
130struct mbuf *
131AsyncDecode(c)
132u_char c;

--- 18 unchanged lines hidden (view full) ---

151 if (!(hs->mode & MODE_ESC)) {
152 hs->mode |= MODE_ESC;
153 break;
154 }
155 /* Fall into ... */
156 default:
157 if (hs->length >= HDLCSIZE) {
158 /* packet is too large, discard it */
159 logprintf("too large, diacarding.\n");
159 LogPrintf(LogERROR, "Packet too large (%d), diacarding.\n", hs->length);
160 hs->length = 0;
161 hs->mode = MODE_HUNT;
162 break;
163 }
164 if (hs->mode & MODE_ESC) {
165 c ^= HDLC_XOR;
166 hs->mode &= ~MODE_ESC;
167 }

--- 28 unchanged lines hidden ---
160 hs->length = 0;
161 hs->mode = MODE_HUNT;
162 break;
163 }
164 if (hs->mode & MODE_ESC) {
165 c ^= HDLC_XOR;
166 hs->mode &= ~MODE_ESC;
167 }

--- 28 unchanged lines hidden ---