-extern struct userenv *userenv_list;
-
-/*
- * Prototypes.
- */
-
-/* Procedures exported from main.c. */
-void set_ifunit(int); /* set stuff that depends on ifunit */
-void detach(void); /* Detach from controlling tty */
-void die(int); /* Cleanup and exit */
-void quit(void); /* like die(1) */
-void novm(char *); /* Say we ran out of memory, and die */
-void timeout(void (*func)(void *), void *arg, int s, int us);
- /* Call func(arg) after s.us seconds */
-void untimeout(void (*func)(void *), void *arg);
- /* Cancel call to func(arg) */
-void record_child(int, char *, void (*) (void *), void *, int);
-pid_t safe_fork(int, int, int); /* Fork & close stuff in child */
-int device_script(char *cmd, int in, int out, int dont_wait);
- /* Run `cmd' with given stdin and stdout */
-pid_t run_program(char *prog, char **args, int must_exist,
- void (*done)(void *), void *arg, int wait);
- /* Run program prog with args in child */
-void reopen_log(void); /* (re)open the connection to syslog */
-void print_link_stats(void); /* Print stats, if available */
-void reset_link_stats(int); /* Reset (init) stats when link goes up */
-void update_link_stats(int); /* Get stats at link termination */
-void script_setenv(char *, char *, int); /* set script env var */
-void script_unsetenv(char *); /* unset script env var */
-void new_phase(int); /* signal start of new phase */
-void add_notifier(struct notifier **, notify_func, void *);
-void remove_notifier(struct notifier **, notify_func, void *);
-void notify(struct notifier *, int);
-int ppp_send_config(int, int, u_int32_t, int, int);
-int ppp_recv_config(int, int, u_int32_t, int, int);
-const char *protocol_name(int);
-void remove_pidfiles(void);
-void lock_db(void);
-void unlock_db(void);
-
-/* Procedures exported from tty.c. */
-void tty_init(void);
-
-/* Procedures exported from utils.c. */
-void log_packet(u_char *, int, char *, int);
- /* Format a packet and log it with syslog */
-void print_string(char *, int, printer_func, void *);
- /* Format a string for output */
-int slprintf(char *, int, char *, ...); /* sprintf++ */
-int vslprintf(char *, int, char *, va_list); /* vsprintf++ */
-size_t strlcpy(char *, const char *, size_t); /* safe strcpy */
-size_t strlcat(char *, const char *, size_t); /* safe strncpy */
-void dbglog(char *, ...); /* log a debug message */
-void info(char *, ...); /* log an informational message */
-void notice(char *, ...); /* log a notice-level message */
-void warn(char *, ...); /* log a warning message */
-void error(char *, ...); /* log an error message */
-void fatal(char *, ...); /* log an error message and die(1) */
-void init_pr_log(const char *, int); /* initialize for using pr_log */
-void pr_log(void *, char *, ...); /* printer fn, output to syslog */
-void end_pr_log(void); /* finish up after using pr_log */
-void dump_packet(const char *, u_char *, int);
- /* dump packet to debug log if interesting */
-ssize_t complete_read(int, void *, size_t);
- /* read a complete buffer */
-
-/* Procedures exported from auth.c */
-void link_required(int); /* we are starting to use the link */
-void start_link(int); /* bring the link up now */
-void link_terminated(int); /* we are finished with the link */
-void link_down(int); /* the LCP layer has left the Opened state */
-void upper_layers_down(int);/* take all NCPs down */
-void link_established(int); /* the link is up; authenticate now */
-void start_networks(int); /* start all the network control protos */
-void continue_networks(int); /* start network [ip, etc] control protos */
-void np_up(int, int); /* a network protocol has come up */
-void np_down(int, int); /* a network protocol has gone down */
-void np_finished(int, int); /* a network protocol no longer needs link */
-void auth_peer_fail(int, int);
- /* peer failed to authenticate itself */
-void auth_peer_success(int, int, int, char *, int);
- /* peer successfully authenticated itself */
-void auth_withpeer_fail(int, int);
- /* we failed to authenticate ourselves */
-void auth_withpeer_success(int, int, int);
- /* we successfully authenticated ourselves */
-void auth_check_options(void);
- /* check authentication options supplied */
-void auth_reset(int); /* check what secrets we have */
-int check_passwd(int, char *, int, char *, int, char **);
- /* Check peer-supplied username/password */
-int get_secret(int, char *, char *, char *, int *, int);
- /* get "secret" for chap */
-int get_srp_secret(int unit, char *client, char *server, char *secret,
- int am_server);
-int auth_ip_addr(int, u_int32_t);
- /* check if IP address is authorized */
-int auth_number(void); /* check if remote number is authorized */
-int bad_ip_adrs(u_int32_t);
- /* check if IP address is unreasonable */
-
-/* Procedures exported from demand.c */
-void demand_conf(void); /* config interface(s) for demand-dial */
-void demand_block(void); /* set all NPs to queue up packets */
-void demand_unblock(void); /* set all NPs to pass packets */
-void demand_discard(void); /* set all NPs to discard packets */
-void demand_rexmit(int); /* retransmit saved frames for an NP */
-int loop_chars(unsigned char *, int); /* process chars from loopback */
-int loop_frame(unsigned char *, int); /* should we bring link up? */
-
-/* Procedures exported from multilink.c */
-#ifdef HAVE_MULTILINK
-void mp_check_options(void); /* Check multilink-related options */
-int mp_join_bundle(void); /* join our link to an appropriate bundle */
-void mp_exit_bundle(void); /* have disconnected our link from bundle */
-void mp_bundle_terminated(void);
-char *epdisc_to_str(struct epdisc *); /* string from endpoint discrim. */
-int str_to_epdisc(struct epdisc *, char *); /* endpt disc. from str */
-#else
-#define mp_bundle_terminated() /* nothing */
-#define mp_exit_bundle() /* nothing */
-#define doing_multilink 0
-#define multilink_master 0
-#endif
-
-/* Procedures exported from sys-*.c */
-void sys_init(void); /* Do system-dependent initialization */
-void sys_cleanup(void); /* Restore system state before exiting */
-int sys_check_options(void); /* Check options specified */
-void sys_close(void); /* Clean up in a child before execing */
-int ppp_available(void); /* Test whether ppp kernel support exists */
-int get_pty(int *, int *, char *, int); /* Get pty master/slave */
-int open_ppp_loopback(void); /* Open loopback for demand-dialling */
-int tty_establish_ppp(int); /* Turn serial port into a ppp interface */
-void tty_disestablish_ppp(int); /* Restore port to normal operation */
-void generic_disestablish_ppp(int dev_fd); /* Restore device setting */
-int generic_establish_ppp(int dev_fd); /* Make a ppp interface */
-void make_new_bundle(int, int, int, int); /* Create new bundle */
-int bundle_attach(int); /* Attach link to existing bundle */
-void cfg_bundle(int, int, int, int); /* Configure existing bundle */
-void destroy_bundle(void); /* Tell driver to destroy bundle */
-void clean_check(void); /* Check if line was 8-bit clean */
-void set_up_tty(int, int); /* Set up port's speed, parameters, etc. */
-void restore_tty(int); /* Restore port's original parameters */
-void setdtr(int, int); /* Raise or lower port's DTR line */
-void output(int, u_char *, int); /* Output a PPP packet */
-void wait_input(struct timeval *);
- /* Wait for input, with timeout */
-void add_fd(int); /* Add fd to set to wait for */
-void remove_fd(int); /* Remove fd from set to wait for */
-int read_packet(u_char *); /* Read PPP packet */
-int get_loop_output(void); /* Read pkts from loopback */
-void tty_send_config(int, u_int32_t, int, int);
- /* Configure i/f transmit parameters */
-void tty_set_xaccm(ext_accm);
- /* Set extended transmit ACCM */
-void tty_recv_config(int, u_int32_t, int, int);
- /* Configure i/f receive parameters */
-int ccp_test(int, u_char *, int, int);
- /* Test support for compression scheme */
-void ccp_flags_set(int, int, int);
- /* Set kernel CCP state */
-int ccp_fatal_error(int); /* Test for fatal decomp error in kernel */
-int get_idle_time(int, struct ppp_idle *);
- /* Find out how long link has been idle */
-int get_ppp_stats(int, struct pppd_stats *);
- /* Return link statistics */
-void netif_set_mtu(int, int); /* Set PPP interface MTU */
-int netif_get_mtu(int); /* Get PPP interface MTU */
-int sifvjcomp(int, int, int, int);
- /* Configure VJ TCP header compression */
-int sifup(int); /* Configure i/f up for one protocol */
-int sifnpmode(int u, int proto, enum NPmode mode);
- /* Set mode for handling packets for proto */
-int sifdown(int); /* Configure i/f down for one protocol */
-int sifaddr(int, u_int32_t, u_int32_t, u_int32_t);
- /* Configure IPv4 addresses for i/f */
-int cifaddr(int, u_int32_t, u_int32_t);
- /* Reset i/f IP addresses */
-#ifdef INET6
-int ether_to_eui64(eui64_t *p_eui64); /* convert eth0 hw address to EUI64 */
-int sif6up(int); /* Configure i/f up for IPv6 */
-int sif6down(int); /* Configure i/f down for IPv6 */
-int sif6addr(int, eui64_t, eui64_t);
- /* Configure IPv6 addresses for i/f */
-int cif6addr(int, eui64_t, eui64_t);
- /* Remove an IPv6 address from i/f */
-#endif
-int sifdefaultroute(int, u_int32_t, u_int32_t);
- /* Create default route through i/f */
-int cifdefaultroute(int, u_int32_t, u_int32_t);
- /* Delete default route through i/f */
-#ifdef INET6
-int sif6defaultroute(int, eui64_t, eui64_t);
- /* Create default IPv6 route through i/f */
-int cif6defaultroute(int, eui64_t, eui64_t);
- /* Delete default IPv6 route through i/f */
-#endif
-int sifproxyarp(int, u_int32_t);
- /* Add proxy ARP entry for peer */
-int cifproxyarp(int, u_int32_t);
- /* Delete proxy ARP entry for peer */
-u_int32_t GetMask(u_int32_t); /* Get appropriate netmask for address */
-int lock(char *); /* Create lock file for device */
-int relock(int); /* Rewrite lock file with new pid */
-void unlock(void); /* Delete previously-created lock file */
-void logwtmp(const char *, const char *, const char *);
- /* Write entry to wtmp file */
-int get_host_seed(void); /* Get host-dependent random number seed */
-int have_route_to(u_int32_t); /* Check if route to addr exists */
-#ifdef PPP_FILTER
-int set_filters(struct bpf_program *pass, struct bpf_program *active);
- /* Set filter programs in kernel */
-#endif
-#ifdef IPX_CHANGE
-int sipxfaddr(int, unsigned long, unsigned char *);
-int cipxfaddr(int);
-#endif
-int get_if_hwaddr(u_char *addr, char *name);
-char *get_first_ethernet(void);
-int get_time(struct timeval *);
- /* Get current time, monotonic if possible. */
-
-/* Procedures exported from options.c */
-int setipaddr(char *, char **, int); /* Set local/remote ip addresses */
-int parse_args(int argc, char **argv);
- /* Parse options from arguments given */
-int options_from_file(char *filename, int must_exist, int check_prot,
- int privileged);
- /* Parse options from an options file */
-int options_from_user(void); /* Parse options from user's .ppprc */
-int options_for_tty(void); /* Parse options from /etc/ppp/options.tty */
-int options_from_list(struct wordlist *, int privileged);
- /* Parse options from a wordlist */
-int getword(FILE *f, char *word, int *newlinep, char *filename);
- /* Read a word from a file */
-void option_error(char *fmt, ...);
- /* Print an error message about an option */
-int int_option(char *, int *);
- /* Simplified number_option for decimal ints */
-void add_options(option_t *); /* Add extra options */
-void check_options(void); /* check values after all options parsed */
-int override_value(char *, int, const char *);
- /* override value if permitted by priority */
-void print_options(printer_func, void *);
- /* print out values of all options */
-
-int parse_dotted_ip(char *, u_int32_t *);
-
-/*
- * Hooks to enable plugins to change various things.