all: chat
chat: chat.o
- $(CC) -o chat chat.o
+ $(CC) $(LDFLAGS) -o chat chat.o
chat.o: chat.c
$(CC) -c $(CFLAGS) -o chat.o chat.c
COPTS = -O2 -pipe -Wall -g
LIBS =
-# Uncomment the next 2 lines to include support for Microsoft's
+# Uncomment the next line to include support for Microsoft's
# MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux.
CHAPMS=y
-USE_CRYPT=y
+#USE_CRYPT=y
# Don't use MSLANMAN unless you really know what you're doing.
#MSLANMAN=y
# Uncomment the next line to include support for MPPE. CHAPMS (above) must
# Linux distributions: Please leave TDB ENABLED in your builds.
USE_TDB=y
+# Uncomment the next line to enable Type=notify services in systemd
+# If enabled, and the user sets the up_sdnotify option, then
+# pppd will not detach and will notify systemd when up.
+#SYSTEMD=y
+
HAS_SHADOW=y
#USE_PAM=y
HAVE_INET6=y
ifdef NEEDDES
ifndef USE_CRYPT
-LIBS += -ldes $(LIBS)
+CFLAGS += -I/usr/include/openssl
+LIBS += -lcrypto
else
CFLAGS += -DUSE_CRYPT=1
endif
CFLAGS += -DLOCKLIB=1
endif
+ifdef SYSTEMD
+LIBS += -lsystemd
+CFLAGS += -DSYSTEMD=1
+endif
+
ifdef PLUGIN
CFLAGS += -DPLUGIN
-LDFLAGS += -Wl,-E
+LDFLAGS_PLUGIN += -Wl,-E
LIBS += -ldl
endif
$(INSTALL) -c -m 444 pppd.8 $(MANDIR)
pppd: $(PPPDOBJS)
- $(CC) $(CFLAGS) $(LDFLAGS) -o pppd $(PPPDOBJS) $(LIBS)
+ $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_PLUGIN) -o pppd $(PPPDOBJS) $(LIBS)
srp-entry: srp-entry.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ srp-entry.c $(LIBS)
#endif
#include <time.h>
+#ifdef SYSTEMD
+#include <systemd/sd-daemon.h>
+#endif
+
#include "pppd.h"
#include "fsm.h"
#include "lcp.h"
/*
* Detach now, if the updetach option was given.
*/
- if (updetach && !nodetach)
+ if (updetach && !nodetach) {
+ dbglog("updetach is set. Now detaching.");
detach();
+#ifdef SYSTEMD
+ } else if (nodetach && up_sdnotify) {
+ dbglog("up_sdnotify is set. Now notifying systemd: READY=1");
+ sd_notify(0, "READY=1");
+#endif
+ }
}
++num_np_up;
}
f->nakloops = 0;
} else {
- /* we sent CONFACK or CONFREJ */
+ /* we sent CONFNAK or CONFREJ */
if (f->state != ACKRCVD)
f->state = REQSENT;
if( code == CONFNAK )
static const char rcsid[] = RCSID;
/* interface vars */
-char ifname[32]; /* Interface name */
+char ifname[MAXIFNAMELEN]; /* Interface name */
int ifunit; /* Interface unit number */
struct channel *the_channel;
static void handle_events __P((void));
void print_link_stats __P((void));
-extern char *ttyname __P((int));
extern char *getlogin __P((void));
int main __P((int, char *[]));
NULL
};
-/*
- * If PPP_DRV_NAME is not defined, use the default "ppp" as the device name.
- */
-#if !defined(PPP_DRV_NAME)
-#define PPP_DRV_NAME "ppp"
-#endif /* !defined(PPP_DRV_NAME) */
-
int
main(argc, argv)
int argc;
set_ifunit(iskey)
int iskey;
{
- info("Using interface %s%d", PPP_DRV_NAME, ifunit);
- slprintf(ifname, sizeof(ifname), "%s%d", PPP_DRV_NAME, ifunit);
+ if (req_ifname[0] != '\0')
+ slprintf(ifname, sizeof(ifname), "%s", req_ifname);
+ else
+ slprintf(ifname, sizeof(ifname), "%s%d", PPP_DRV_NAME, ifunit);
+ info("Using interface %s", ifname);
script_setenv("IFNAME", ifname, iskey);
if (iskey) {
create_pidfile(getpid()); /* write pid to file */
script_env[i] = newstring;
else
add_script_env(i, newstring);
- } else {
+ } else if (p != NULL) {
remove_script_env(i);
}
}
bool nodetach = 0; /* Don't detach from controlling tty */
bool updetach = 0; /* Detach once link is up */
bool master_detach; /* Detach when we're (only) multilink master */
+#ifdef SYSTEMD
+bool up_sdnotify = 0; /* Notify systemd once link is up */
+#endif
int maxconnect = 0; /* Maximum connect time */
char user[MAXNAMELEN]; /* Username for PAP */
char passwd[MAXSECRETLEN]; /* Password for PAP */
bool tune_kernel; /* may alter kernel settings */
int connect_delay = 1000; /* wait this many ms after connect script */
int req_unit = -1; /* requested interface unit */
+char req_ifname[MAXIFNAMELEN]; /* requested interface name */
bool multilink = 0; /* Enable multilink operation */
char *bundle_name = NULL; /* bundle name for multilink */
bool dump_options; /* print out option values */
"Don't detach from controlling tty", OPT_PRIO | 1 },
{ "-detach", o_bool, &nodetach,
"Don't detach from controlling tty", OPT_ALIAS | OPT_PRIOSUB | 1 },
+#ifdef SYSTEMD
+ { "up_sdnotify", o_bool, &up_sdnotify,
+ "Notify systemd once link is up (implies nodetach)",
+ OPT_PRIOSUB | OPT_A2COPY | 1, &nodetach },
+#endif
{ "updetach", o_bool, &updetach,
"Detach from controlling tty once link is up",
OPT_PRIOSUB | OPT_A2CLR | 1, &nodetach },
"PPP interface unit number to use if possible",
OPT_PRIO | OPT_LLIMIT, 0, 0 },
+ { "ifname", o_string, req_ifname,
+ "Set PPP interface name",
+ OPT_PRIO | OPT_PRIV | OPT_STATIC, NULL, MAXIFNAMELEN },
+
{ "dump", o_bool, &dump_options,
"Print out option values after parsing all options", 1 },
{ "dryrun", o_bool, &dryrun,
option_error("unexpected = in name: %s", arg);
return 0;
}
- if (arg == '\0') {
+ if (*arg == '\0') {
option_error("missing variable name for unset");
return 0;
}
#CC = gcc
COPTS = -O2 -g
CFLAGS = $(COPTS) -I.. -I../../include -fPIC
-LDFLAGS = -shared
+LDFLAGS_SHARED = -shared
INSTALL = install
DESTDIR = $(INSTROOT)@DESTDIR@
for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all || exit $$?; done
%.so: %.c
- $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^
+ $(CC) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) $(CFLAGS) $^
VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../patchlevel.h)
#CC = gcc
COPTS = -O2 -g
CFLAGS = $(COPTS) -I../.. -I../../../include -fPIC
-LDFLAGS = -shared
+LDFLAGS_SHARED = -shared
INSTALL = install
#***********************************************************************
all: $(PLUGIN)
$(PLUGIN): $(PLUGIN_OBJS)
- $(CC) $(CFLAGS) -o $@ -shared $^ $(LIBS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(LDFLAGS_SHARED) $^ $(LIBS)
install: all
$(INSTALL) -d -m 755 $(LIBDIR)
#CC = gcc
COPTS = -O2 -g
CFLAGS = $(COPTS) -I. -I../.. -I../../../include -fPIC
-LDFLAGS = -shared
+LDFLAGS_SHARED = -shared
INSTALL = install
#***********************************************************************
all: $(PLUGINS)
%.so: %.o
- $(CC) $(CFLAGS) -o $@ -shared $^ $(LIBS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(LDFLAGS_SHARED) $^ $(LIBS)
install: all
$(INSTALL) -d -m 755 $(LIBDIR)
$(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)
radius.so: radius.o libradiusclient.a
- $(CC) -o radius.so -shared radius.o libradiusclient.a
+ $(CC) $(LDFLAGS) -o radius.so -shared radius.o libradiusclient.a
radattr.so: radattr.o
- $(CC) -o radattr.so -shared radattr.o
+ $(CC) $(LDFLAGS) -o radattr.so -shared radattr.o
radrealms.so: radrealms.o
- $(CC) -o radrealms.so -shared radrealms.o
+ $(CC) $(LDFLAGS) -o radrealms.so -shared radrealms.o
CLIENTOBJS = avpair.o buildreq.o config.o dict.o ip_util.o \
clientid.o sendserver.o lock.o util.o md5.o
rc_avpair_add(&send, PW_USER_NAME, rstate.user, 0, VENDOR_NONE);
+ if (rstate.class_len > 0)
+ rc_avpair_add(&send, PW_CLASS,
+ rstate.class, rstate.class_len, VENDOR_NONE);
+
av_type = PW_STATUS_STOP;
rc_avpair_add(&send, PW_ACCT_STATUS_TYPE, &av_type, 0, VENDOR_NONE);
rc_avpair_add(&send, PW_USER_NAME, rstate.user, 0, VENDOR_NONE);
+ if (rstate.class_len > 0)
+ rc_avpair_add(&send, PW_CLASS,
+ rstate.class, rstate.class_len, VENDOR_NONE);
+
av_type = PW_STATUS_ALIVE;
rc_avpair_add(&send, PW_ACCT_STATUS_TYPE, &av_type, 0, VENDOR_NONE);
all: rp-pppoe.so pppoe-discovery
pppoe-discovery: pppoe-discovery.o debug.o
- $(CC) -o pppoe-discovery pppoe-discovery.o debug.o
+ $(CC) $(LDFLAGS) -o pppoe-discovery pppoe-discovery.o debug.o
pppoe-discovery.o: pppoe-discovery.c
$(CC) $(CFLAGS) -c -o pppoe-discovery.o pppoe-discovery.c
$(CC) $(CFLAGS) -c -o debug.o debug.c
rp-pppoe.so: plugin.o discovery.o if.o common.o
- $(CC) -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o
+ $(CC) $(LDFLAGS) -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o
install: all
$(INSTALL) -d -m 755 $(LIBDIR)
*
*/
+#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
exit(status);
}
+void error(char *fmt, ...)
+{
+ va_list pvar;
+ va_start(pvar, fmt);
+ vfprintf(stderr, fmt, pvar);
+ va_end(pvar);
+}
+
/* Initialize frame types to RFC 2516 values. Some broken peers apparently
use different frame types... sigh... */
switch(type) {
case TAG_AC_NAME:
pc->seenACName = 1;
- printf("Access-Concentrator: %.*s\n", (int) len, data);
+ if (conn->printACNames) {
+ printf("Access-Concentrator: %.*s\n", (int) len, data);
+ }
if (conn->acName && len == strlen(conn->acName) &&
!strncmp((char *) data, conn->acName, len)) {
pc->acNameOK = 1;
break;
case TAG_SERVICE_NAME:
pc->seenServiceName = 1;
- if (len > 0) {
+ if (conn->printACNames && len > 0) {
printf(" Service-Name: %.*s\n", (int) len, data);
}
if (conn->serviceName && len == strlen(conn->serviceName) &&
}
break;
case TAG_AC_COOKIE:
- printf("Got a cookie:");
- /* Print first 20 bytes of cookie */
- for (i=0; i<len && i < 20; i++) {
- printf(" %02x", (unsigned) data[i]);
+ if (conn->printACNames) {
+ printf("Got a cookie:");
+ /* Print first 20 bytes of cookie */
+ for (i=0; i<len && i < 20; i++) {
+ printf(" %02x", (unsigned) data[i]);
+ }
+ if (i < len) printf("...");
+ printf("\n");
}
- if (i < len) printf("...");
- printf("\n");
conn->cookie.type = htons(type);
conn->cookie.length = htons(len);
memcpy(conn->cookie.payload, data, len);
break;
case TAG_RELAY_SESSION_ID:
- printf("Got a Relay-ID:");
- /* Print first 20 bytes of relay ID */
- for (i=0; i<len && i < 20; i++) {
- printf(" %02x", (unsigned) data[i]);
+ if (conn->printACNames) {
+ printf("Got a Relay-ID:");
+ /* Print first 20 bytes of relay ID */
+ for (i=0; i<len && i < 20; i++) {
+ printf(" %02x", (unsigned) data[i]);
+ }
+ if (i < len) printf("...");
+ printf("\n");
}
- if (i < len) printf("...");
- printf("\n");
conn->relayId.type = htons(type);
conn->relayId.length = htons(len);
memcpy(conn->relayId.payload, data, len);
break;
case TAG_SERVICE_NAME_ERROR:
- printf("Got a Service-Name-Error tag: %.*s\n", (int) len, data);
+ if (conn->printACNames) {
+ printf("Got a Service-Name-Error tag: %.*s\n", (int) len, data);
+ }
break;
case TAG_AC_SYSTEM_ERROR:
- printf("Got a System-Error tag: %.*s\n", (int) len, data);
+ if (conn->printACNames) {
+ printf("Got a System-Error tag: %.*s\n", (int) len, data);
+ }
break;
case TAG_GENERIC_ERROR:
- printf("Got a Generic-Error tag: %.*s\n", (int) len, data);
+ if (conn->printACNames) {
+ printf("Got a Generic-Error tag: %.*s\n", (int) len, data);
+ }
break;
}
}
continue;
}
conn->numPADOs++;
- printf("--------------------------------------------------\n");
if (pc.acNameOK && pc.serviceNameOK) {
memcpy(conn->peerEth, packet.ethHdr.h_source, ETH_ALEN);
if (conn->printACNames) {
(unsigned) conn->peerEth[3],
(unsigned) conn->peerEth[4],
(unsigned) conn->peerEth[5]);
+ printf("--------------------------------------------------\n");
continue;
}
conn->discoveryState = STATE_RECEIVED_PADO;
discovery(PPPoEConnection *conn)
{
int padiAttempts = 0;
- int timeout = PADI_TIMEOUT;
+ int timeout = conn->discoveryTimeout;
conn->discoverySocket =
openInterface(conn->ifName, Eth_PPPOE_Discovery, conn->myEth);
do {
padiAttempts++;
- if (padiAttempts > MAX_PADI_ATTEMPTS) {
+ if (padiAttempts > conn->discoveryAttempts) {
fprintf(stderr, "Timeout waiting for PADO packets\n");
close(conn->discoverySocket);
conn->discoverySocket = -1;
memset(conn, 0, sizeof(PPPoEConnection));
- while ((opt = getopt(argc, argv, "I:D:VUAS:C:h")) > 0) {
+ conn->printACNames = 1;
+ conn->discoveryTimeout = PADI_TIMEOUT;
+ conn->discoveryAttempts = MAX_PADI_ATTEMPTS;
+
+ while ((opt = getopt(argc, argv, "I:D:VUQS:C:t:a:h")) > 0) {
switch(opt) {
case 'S':
conn->serviceName = xstrdup(optarg);
case 'C':
conn->acName = xstrdup(optarg);
break;
+ case 't':
+ if (sscanf(optarg, "%d", &conn->discoveryTimeout) != 1) {
+ fprintf(stderr, "Illegal argument to -t: Should be -t timeout\n");
+ exit(EXIT_FAILURE);
+ }
+ if (conn->discoveryTimeout < 1) {
+ conn->discoveryTimeout = 1;
+ }
+ break;
+ case 'a':
+ if (sscanf(optarg, "%d", &conn->discoveryAttempts) != 1) {
+ fprintf(stderr, "Illegal argument to -a: Should be -a attempts\n");
+ exit(EXIT_FAILURE);
+ }
+ if (conn->discoveryAttempts < 1) {
+ conn->discoveryAttempts = 1;
+ }
+ break;
case 'U':
conn->useHostUniq = 1;
break;
case 'I':
conn->ifName = xstrdup(optarg);
break;
- case 'A':
- /* this is the default */
+ case 'Q':
+ conn->printACNames = 0;
break;
case 'V':
case 'h':
conn->discoverySocket = -1;
conn->sessionSocket = -1;
- conn->printACNames = 1;
discovery(conn);
- exit(0);
+
+ if (!conn->numPADOs)
+ exit(1);
+ else
+ exit(0);
}
void rp_fatal(char const *str)
void usage(void)
{
fprintf(stderr, "Usage: pppoe-discovery [options]\n");
+ fprintf(stderr, "Options:\n");
+ fprintf(stderr, " -I if_name -- Specify interface (default eth0)\n");
+ fprintf(stderr, " -D filename -- Log debugging information in filename.\n");
+ fprintf(stderr,
+ " -t timeout -- Initial timeout for discovery packets in seconds\n"
+ " -a attempts -- Number of discovery attempts\n"
+ " -V -- Print version and exit.\n"
+ " -Q -- Quit Mode: Do not print access concentrator names\n"
+ " -S name -- Set desired service name.\n"
+ " -C name -- Set desired access concentrator name.\n"
+ " -U -- Use Host-Unique to allow multiple PPPoE sessions.\n"
+ " -h -- Print usage information.\n");
fprintf(stderr, "\nVersion " RP_VERSION "\n");
}
#include <sys/socket.h>
#endif
+/* This has to be included before Linux 4.8's linux/in.h
+ * gets dragged in. */
+#include <netinet/in.h>
+
/* Ugly header files on some Linux boxes... */
#if defined(HAVE_LINUX_IF_H)
#include <linux/if.h>
#include <linux/if_ether.h>
#endif
-#include <netinet/in.h>
-
#ifdef HAVE_NETINET_IF_ETHER_H
#include <sys/types.h>
#endif
-
/* Ethernet frame types according to RFC 2516 */
#define ETH_PPPOE_DISCOVERY 0x8863
#define ETH_PPPOE_SESSION 0x8864
int error; /* Error packet received */
int debug; /* Set to log packets sent and received */
int discoveryTimeout; /* Timeout for discovery packets */
+ int discoveryAttempts; /* Number of discovery attempts */
int seenMaxPayload;
int mtu; /* Stored MTU */
int mru; /* Stored MRU */
des_key[7] = Get7Bits(key, 49);
#ifndef USE_CRYPT
- des_set_odd_parity((des_cblock *)des_key);
+ DES_set_odd_parity((DES_cblock *)des_key);
#endif
}
}
#else /* USE_CRYPT */
-static des_key_schedule key_schedule;
+static DES_key_schedule key_schedule;
bool
DesSetkey(key)
u_char *key;
{
- des_cblock des_key;
+ DES_cblock des_key;
MakeKey(key, des_key);
- des_set_key(&des_key, key_schedule);
+ DES_set_key(&des_key, &key_schedule);
return (1);
}
bool
-DesEncrypt(clear, key, cipher)
+DesEncrypt(clear, cipher)
u_char *clear; /* IN 8 octets */
u_char *cipher; /* OUT 8 octets */
{
- des_ecb_encrypt((des_cblock *)clear, (des_cblock *)cipher,
- key_schedule, 1);
+ DES_ecb_encrypt((DES_cblock *)clear, (DES_cblock *)cipher,
+ &key_schedule, 1);
return (1);
}
u_char *cipher; /* IN 8 octets */
u_char *clear; /* OUT 8 octets */
{
- des_ecb_encrypt((des_cblock *)cipher, (des_cblock *)clear,
- key_schedule, 0);
+ DES_ecb_encrypt((DES_cblock *)cipher, (DES_cblock *)clear,
+ &key_schedule, 0);
return (1);
}
.TP
.B unit \fInum
Sets the ppp unit number (for a ppp0 or ppp1 etc interface name) for outbound
-connections.
+connections. If the unit is already in use a dynamically allocated number will
+be used.
+.TP
+.B ifname \fIstring
+Set the ppp interface name for outbound connections. If the interface name is
+already in use, or if the name cannot be used for any other reason, pppd will
+terminate.
.TP
.B unset \fIname
Remove a variable from the environment variable for scripts that are
the first network control protocol, usually the IP control protocol,
has come up).
.TP
+.B up_sdnotify
+Use this option to run pppd in systemd service units of Type=notify
+(\fBup_sdnotify\fR implies \fBnodetach\fR).
+When \fBup_sdnotify\fR is enabled, pppd will notify systemd once
+it has successfully established the ppp connection (to the point where
+the first network control protocl, usually the IP control protocol,
+has come up). This option is only availble when pppd is compiled with
+systemd support.
+.TP
.B usehostname
Enforce the use of the hostname (with domain name appended, if given)
as the name of the local system for authentication purposes (overrides
#define MAXARGS 1 /* max # args to a command */
#define MAXNAMELEN 256 /* max length of hostname or name for auth */
#define MAXSECRETLEN 256 /* max length of password or secret */
+#define MAXIFNAMELEN 32 /* max length of interface name; or use IFNAMSIZ, can we
+ always include net/if.h? */
+
+/*
+ * If PPP_DRV_NAME is not defined, use the default "ppp" as the device name.
+ * Where should PPP_DRV_NAME come from? Do we include it here?
+ */
+#if !defined(PPP_DRV_NAME)
+#define PPP_DRV_NAME "ppp"
+#endif /* !defined(PPP_DRV_NAME) */
/*
* Option descriptor structure.
extern u_int32_t netmask; /* IP netmask to set on interface */
extern bool lockflag; /* Create lock file to lock the serial dev */
extern bool nodetach; /* Don't detach from controlling tty */
+#ifdef SYSTEMD
+extern bool up_sdnotify; /* Notify systemd once link is up (implies nodetach) */
+#endif
extern bool updetach; /* Detach from controlling tty when link up */
extern bool master_detach; /* Detach when multilink master without link */
extern char *initializer; /* Script to initialize physical link */
extern int connect_delay; /* Time to delay after connect script */
extern int max_data_rate; /* max bytes/sec through charshunt */
extern int req_unit; /* interface unit number to use */
+extern char req_ifname[MAXIFNAMELEN]; /* interface name to use */
extern bool multilink; /* enable multilink operation */
extern bool noendpoint; /* don't send or accept endpt. discrim. */
extern char *bundle_name; /* bundle name for multilink */
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
-#include <sys/errno.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/utsname.h>
#include <sys/sysmacros.h>
+#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <syslog.h>
}
if (x < 0)
error("Couldn't create new ppp unit: %m");
+
+ if (x == 0 && req_ifname[0] != '\0') {
+ struct ifreq ifr;
+ char t[MAXIFNAMELEN];
+ memset(&ifr, 0, sizeof(struct ifreq));
+ slprintf(t, sizeof(t), "%s%d", PPP_DRV_NAME, ifunit);
+ strncpy(ifr.ifr_name, t, IF_NAMESIZE);
+ strncpy(ifr.ifr_newname, req_ifname, IF_NAMESIZE);
+ x = ioctl(sock_fd, SIOCSIFNAME, &ifr);
+ if (x < 0)
+ error("Couldn't rename interface %s to %s: %m", t, req_ifname);
+ else
+ info("Renamed interface %s to %s", t, req_ifname);
+ }
+
return x;
}
all: pppdump
pppdump: $(OBJS)
- $(CC) -o pppdump $(OBJS)
+ $(CC) $(LDFLAGS) -o pppdump $(OBJS)
clean:
rm -f pppdump $(OBJS) *~
$(INSTALL) -c -m 444 pppstats.8 $(MANDIR)
pppstats: $(PPPSTATSRCS)
- $(CC) $(CFLAGS) -o pppstats pppstats.c $(LIBS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o pppstats pppstats.c $(LIBS)
clean:
rm -f pppstats *~ #* core
int dflag; /* print data rates, not bytes */
int interval, count;
int infinite;
-int unit;
int s; /* socket or /dev/ppp file descriptor */
int signalled; /* set if alarm goes off "early" */
char *progname;
{
int c;
#ifdef STREAMS
+ int unit;
char *dev;
#endif
if (argc > 0)
interface = argv[0];
- if (sscanf(interface, PPP_DRV_NAME "%d", &unit) != 1) {
- fprintf(stderr, "%s: invalid interface '%s' specified\n",
- progname, interface);
- }
-
#ifndef STREAMS
{
struct ifreq ifr;
}
#else /* STREAMS */
+ if (sscanf(interface, PPP_DRV_NAME "%d", &unit) != 1) {
+ fprintf(stderr, "%s: invalid interface '%s' specified\n",
+ progname, interface);
+ }
+
#ifdef __osf__
dev = "/dev/streams/ppp";
#else
if [ -s /var/log/ppp.log ]; then
exec tail "$@" /var/log/ppp.log
else
- exec tail "$@" /var/log/syslog | grep ' \(pppd\|chat\)\['
+ exec grep ' \(pppd\|chat\)\[' /var/log/syslog | tail "$@"
fi