Deleted Added
full compact
main.c (67912) main.c (71657)
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 * $FreeBSD: head/usr.sbin/ppp/main.c 67912 2000-10-30 00:15:29Z brian $
20 * $FreeBSD: head/usr.sbin/ppp/main.c 71657 2001-01-26 01:41:34Z brian $
21 *
22 * TODO:
23 */
24
25#include <sys/param.h>
26#include <netinet/in.h>
27#include <netinet/in_systm.h>
28#include <netinet/ip.h>

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

157 signal(SIGCONT, TerminalCont);
158 raise(SIGSTOP);
159}
160
161static void
162BringDownServer(int signo)
163{
164 /* Drops all child prompts too ! */
21 *
22 * TODO:
23 */
24
25#include <sys/param.h>
26#include <netinet/in.h>
27#include <netinet/in_systm.h>
28#include <netinet/ip.h>

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

157 signal(SIGCONT, TerminalCont);
158 raise(SIGSTOP);
159}
160
161static void
162BringDownServer(int signo)
163{
164 /* Drops all child prompts too ! */
165 server_Close(SignalBundle);
165 if (server_Close(SignalBundle))
166 log_Printf(LogPHASE, "Closed server socket\n");
166}
167
168static void
167}
168
169static void
170RestartServer(int signo)
171{
172 /* Drops all child prompts and re-opens the socket */
173 server_Reopen(SignalBundle);
174}
175
176static void
169Usage(void)
170{
171 fprintf(stderr, "Usage: ppp [-auto | -foreground | -background | -direct |"
172 " -dedicated | -ddial | -interactive]"
173#ifndef NOALIAS
174 " [-nat]"
175#endif
176 " [-quiet] [-unit N] [system ...]\n");

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

366 sig_signal(SIGINT, CloseConnection);
367 sig_signal(SIGQUIT, CloseSession);
368 sig_signal(SIGALRM, SIG_IGN);
369 signal(SIGPIPE, SIG_IGN);
370
371 if (sw.mode == PHYS_INTERACTIVE)
372 sig_signal(SIGTSTP, TerminalStop);
373
177Usage(void)
178{
179 fprintf(stderr, "Usage: ppp [-auto | -foreground | -background | -direct |"
180 " -dedicated | -ddial | -interactive]"
181#ifndef NOALIAS
182 " [-nat]"
183#endif
184 " [-quiet] [-unit N] [system ...]\n");

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

374 sig_signal(SIGINT, CloseConnection);
375 sig_signal(SIGQUIT, CloseSession);
376 sig_signal(SIGALRM, SIG_IGN);
377 signal(SIGPIPE, SIG_IGN);
378
379 if (sw.mode == PHYS_INTERACTIVE)
380 sig_signal(SIGTSTP, TerminalStop);
381
382 sig_signal(SIGUSR1, RestartServer);
374 sig_signal(SIGUSR2, BringDownServer);
375
376 lastlabel = argv[argc - 1];
377 for (arg = label; arg < argc; arg++) {
378 /* In case we use LABEL or ``set enddisc label'' */
379 bundle_SetLabel(bundle, lastlabel);
380 system_Select(bundle, argv[arg], CONFFILE, prompt, NULL);
381 }

--- 254 unchanged lines hidden ---
383 sig_signal(SIGUSR2, BringDownServer);
384
385 lastlabel = argv[argc - 1];
386 for (arg = label; arg < argc; arg++) {
387 /* In case we use LABEL or ``set enddisc label'' */
388 bundle_SetLabel(bundle, lastlabel);
389 system_Select(bundle, argv[arg], CONFFILE, prompt, NULL);
390 }

--- 254 unchanged lines hidden ---