Deleted Added
sdiff udiff text old ( 91623 ) new ( 93418 )
full compact
1/*-
2 * Copyright (c) 1998 Brian Somers <brian@Awfulhak.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/usr.sbin/ppp/datalink.c 91623 2002-03-04 10:08:57Z brian $
27 */
28
29#include <sys/param.h>
30#include <netinet/in.h>
31#include <netinet/in_systm.h>
32#include <netinet/ip.h>
33#include <sys/socket.h>
34#include <sys/un.h>

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

484 case DATALINK_CLOSED:
485 case DATALINK_OPENING:
486 break;
487
488 case DATALINK_HANGUP:
489 case DATALINK_DIAL:
490 case DATALINK_LOGOUT:
491 case DATALINK_LOGIN:
492 result = descriptor_Write(&dl->chat.desc, bundle, fdset);
493 break;
494
495 case DATALINK_READY:
496 case DATALINK_LCP:
497 case DATALINK_AUTH:
498 case DATALINK_CBCP:
499 case DATALINK_OPEN:
500 if (descriptor_IsSet(&dl->chap.desc, fdset))
501 result += descriptor_Write(&dl->chap.desc, bundle, fdset);
502 if (descriptor_IsSet(&dl->physical->desc, fdset))
503 result += descriptor_Write(&dl->physical->desc, bundle, fdset);
504 break;
505 }
506
507 return result;
508}
509
510static void
511datalink_ComeDown(struct datalink *dl, int how)
512{
513 int stayonline;
514
515 if (how == CLOSE_LCP)
516 datalink_DontHangup(dl);
517 else if (how == CLOSE_STAYDOWN)
518 datalink_StayDown(dl);

--- 936 unchanged lines hidden ---