*/
#ifdef HAVE_CONFIG_H
-#include <config.h>
+#include "config.h"
#endif
#include <stdarg.h>
#include <string.h>
#include <time.h>
#include <signal.h>
+#include <sys/time.h>
#include "pppoe.h"
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef HAVE_NETPACKET_PACKET_H
-#include <netpacket/packet.h>
-#elif defined(HAVE_LINUX_IF_PACKET_H)
-#include <linux/if_packet.h>
-#endif
-
-#ifdef HAVE_ASM_TYPES_H
-#include <asm/types.h>
-#endif
-
-#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
-
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef HAVE_NET_IF_ARP_H
-#include <net/if_arp.h>
-#endif
-
int debug;
int got_sigterm;
int pppoe_verbose;
optarg, strerror(errno));
exit(1);
}
- fprintf(debugFile, "pppoe-discovery from pppd %s\n", VERSION);
+ fprintf(debugFile, "pppoe-discovery from pppd %s\n", PPPD_VERSION);
break;
case 'I':
conn->ifName = xstrdup(optarg);
}
}
+ if (optind != argc) {
+ fprintf(stderr, "%s: extra argument '%s'\n", argv[0], argv[optind]);
+ usage();
+ exit(EXIT_FAILURE);
+ }
+
if (!conn->ifName) {
fprintf(stderr, "Interface was not specified\n");
exit(EXIT_FAILURE);
" -U -- Use Host-Unique to allow multiple PPPoE sessions.\n"
" -W hexvalue -- Set the Host-Unique to the supplied hex string.\n"
" -h -- Print usage information.\n");
- fprintf(stderr, "\npppoe-discovery from pppd " VERSION "\n");
+ fprintf(stderr, "\npppoe-discovery from pppd " PPPD_VERSION "\n");
}