+#define PHASE_INITIALIZE 1
+#define PHASE_SERIALCONN 2
+#define PHASE_DORMANT 3
+#define PHASE_ESTABLISH 4
+#define PHASE_AUTHENTICATE 5
+#define PHASE_CALLBACK 6
+#define PHASE_NETWORK 7
+#define PHASE_RUNNING 8
+#define PHASE_TERMINATE 9
+#define PHASE_DISCONNECT 10
+#define PHASE_HOLDOFF 11
+#define PHASE_MASTER 12
+
+/*
+ * The following struct gives the addresses of procedures to call
+ * for a particular protocol.
+ */
+struct protent {
+ u_short protocol; /* PPP protocol number */
+ /* Initialization procedure */
+ void (*init)(int unit);
+ /* Process a received packet */
+ void (*input)(int unit, u_char *pkt, int len);
+ /* Process a received protocol-reject */
+ void (*protrej)(int unit);
+ /* Lower layer has come up */
+ void (*lowerup)(int unit);
+ /* Lower layer has gone down */
+ void (*lowerdown)(int unit);
+ /* Open the protocol */
+ void (*open)(int unit);
+ /* Close the protocol */
+ void (*close)(int unit, char *reason);
+ /* Print a packet in readable form */
+ int (*printpkt)(u_char *pkt, int len, printer_func printer, void *arg);
+ /* Process a received data packet */
+ void (*datainput)(int unit, u_char *pkt, int len);
+ bool enabled_flag; /* 0 iff protocol is disabled */
+ char *name; /* Text name of protocol */
+ char *data_name; /* Text name of corresponding data protocol */
+ option_t *options; /* List of command-line options */
+ /* Check requested options, assign defaults */
+ void (*check_options)(void);
+ /* Configure interface for demand-dial */
+ int (*demand_conf)(int unit);
+ /* Say whether to bring up link for this pkt */
+ int (*active_pkt)(u_char *pkt, int len);
+};
+
+/* Table of pointers to supported protocols */
+extern struct protent *protocols[];
+
+/*
+ * This struct contains pointers to a set of procedures for
+ * doing operations on a "channel". A channel provides a way
+ * to send and receive PPP packets - the canonical example is
+ * a serial port device in PPP line discipline (or equivalently
+ * with PPP STREAMS modules pushed onto it).
+ */
+struct channel {
+ /* set of options for this channel */
+ option_t *options;
+ /* find and process a per-channel options file */
+ void (*process_extra_options)(void);
+ /* check all the options that have been given */
+ void (*check_options)(void);
+ /* get the channel ready to do PPP, return a file descriptor */
+ int (*connect)(void);
+ /* we're finished with the channel */
+ void (*disconnect)(void);
+ /* put the channel into PPP `mode' */
+ int (*establish_ppp)(int);
+ /* take the channel out of PPP `mode', restore loopback if demand */
+ void (*disestablish_ppp)(int);
+ /* set the transmit-side PPP parameters of the channel */
+ void (*send_config)(int, u_int32_t, int, int);
+ /* set the receive-side PPP parameters of the channel */
+ void (*recv_config)(int, u_int32_t, int, int);
+ /* cleanup on error or normal exit */
+ void (*cleanup)(void);
+ /* close the device, called in children after fork */
+ void (*close)(void);
+};
+
+extern struct channel *the_channel;
+
+/*
+ * This structure contains environment variables that are set or unset
+ * by the user.
+ */
+struct userenv {
+ struct userenv *ue_next;
+ char *ue_value; /* value (set only) */
+ bool ue_isset; /* 1 for set, 0 for unset */
+ bool ue_priv; /* from privileged source */
+ const char *ue_source; /* source name */
+ char ue_name[1]; /* variable name */
+};
+
+extern struct userenv *userenv_list;