Deleted Added
full compact
main.c (11336) main.c (13379)
1/*
2 * User Process PPP
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 * User Process PPP
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: main.c,v 1.10 1995/09/18 12:41:52 bde Exp $
20 * $Id: main.c,v 1.11 1995/10/08 14:57:29 amurai Exp $
21 *
22 * TODO:
23 * o Add commands for traffic summary, version display, etc.
24 * o Add signal handler for misc controls.
25 */
26#include "fsm.h"
27#include <fcntl.h>
28#include <paths.h>

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

60extern int IsInteractive();
61extern struct in_addr ifnetmask;
62static void DoLoop(void);
63static void TerminalStop();
64
65static struct termios oldtio; /* Original tty mode */
66static struct termios comtio; /* Command level tty mode */
67static int TermMode;
21 *
22 * TODO:
23 * o Add commands for traffic summary, version display, etc.
24 * o Add signal handler for misc controls.
25 */
26#include "fsm.h"
27#include <fcntl.h>
28#include <paths.h>

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

60extern int IsInteractive();
61extern struct in_addr ifnetmask;
62static void DoLoop(void);
63static void TerminalStop();
64
65static struct termios oldtio; /* Original tty mode */
66static struct termios comtio; /* Command level tty mode */
67static int TermMode;
68static int server, update;
68static int server;
69struct sockaddr_in ifsin;
70char pid_filename[128];
71
72static void
73TtyInit()
74{
75 struct termios newtio;
76 int stat;

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

140 fcntl(0, F_SETFL, stat);
141 tcsetattr(0, TCSANOW, &oldtio);
142}
143
144void
145Cleanup(excode)
146int excode;
147{
69struct sockaddr_in ifsin;
70char pid_filename[128];
71
72static void
73TtyInit()
74{
75 struct termios newtio;
76 int stat;

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

140 fcntl(0, F_SETFL, stat);
141 tcsetattr(0, TCSANOW, &oldtio);
142}
143
144void
145Cleanup(excode)
146int excode;
147{
148 int stat;
149
150 OsLinkdown();
151 OsCloseLink(1);
152 sleep(1);
153 if (mode & MODE_AUTO) {
154 DeleteIfRoutes(1);
155 unlink(pid_filename);
156 }

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

246}
247
248void
249main(argc, argv)
250int argc;
251char **argv;
252{
253 int tunno;
148
149 OsLinkdown();
150 OsCloseLink(1);
151 sleep(1);
152 if (mode & MODE_AUTO) {
153 DeleteIfRoutes(1);
154 unlink(pid_filename);
155 }

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

245}
246
247void
248main(argc, argv)
249int argc;
250char **argv;
251{
252 int tunno;
254 int on = 1;
255
256 argc--; argv++;
257
258 mode = MODE_INTER; /* default operation is interactive mode */
259 netfd = -1;
260 ProcessArgs(argc, argv);
261 Greetings();
262 GetUid();

--- 583 unchanged lines hidden ---
253
254 argc--; argv++;
255
256 mode = MODE_INTER; /* default operation is interactive mode */
257 netfd = -1;
258 ProcessArgs(argc, argv);
259 Greetings();
260 GetUid();

--- 583 unchanged lines hidden ---