+/* 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 PPP_WITH_IPV6CP
+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, bool replace_default_rt);
+ /* Create default route through i/f */
+int cifdefaultroute(int, u_int32_t, u_int32_t);
+ /* Delete default route through i/f */
+#ifdef PPP_WITH_IPV6CP
+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_WITH_FILTER
+int set_filters(struct bpf_program *pass, struct bpf_program *active);
+ /* Set filter programs in kernel */
+#endif
+int get_if_hwaddr(u_char *addr, char *name);
+int get_first_ether_hwaddr(u_char *addr);
+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.
+ */
+extern int (*new_phase_hook)(int);
+extern int (*idle_time_hook)(struct ppp_idle *);
+extern int (*holdoff_hook)(void);
+extern int (*pap_check_hook)(void);
+extern int (*pap_auth_hook)(char *user, char *passwd, char **msgp,
+ struct wordlist **paddrs,
+ struct wordlist **popts);
+extern void (*pap_logout_hook)(void);
+extern int (*pap_passwd_hook)(char *user, char *passwd);
+extern int (*allowed_address_hook)(u_int32_t addr);
+extern void (*ip_up_hook)(void);
+extern void (*ip_down_hook)(void);
+extern void (*ip_choose_hook)(u_int32_t *);
+extern void (*ipv6_up_hook)(void);
+extern void (*ipv6_down_hook)(void);
+
+extern int (*chap_check_hook)(void);
+extern int (*chap_passwd_hook)(char *user, char *passwd);
+extern void (*multilink_join_hook)(void);
+
+#ifdef PPP_WITH_EAPTLS
+extern int (*eaptls_passwd_hook)(char *user, char *passwd);
+#endif
+
+/* Let a plugin snoop sent and received packets. Useful for L2TP */
+extern void (*snoop_recv_hook)(unsigned char *p, int len);
+extern void (*snoop_send_hook)(unsigned char *p, int len);