* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define RCSID "$Id: main.c,v 1.125 2003/03/30 08:26:56 paulus Exp $"
+#define RCSID "$Id: main.c,v 1.127 2003/05/12 07:31:36 fcusack Exp $"
#include <stdio.h>
#include <ctype.h>
unsigned link_connect_time;
int link_stats_valid;
+int error_count;
+
/*
* We maintain a list of child process pids and
* functions to call when they exit.
waiting = 0;
- create_linkpidfile(getpid());
-
/*
* If we're doing dial-on-demand, set up the interface now.
*/
* Configure the interface and mark it up, etc.
*/
demand_conf();
+ create_linkpidfile(getpid());
}
do_callback = 0;
status = EXIT_FATAL_ERROR;
goto disconnect;
}
+ /* create the pid file, now that we've obtained a ppp interface */
+ if (!demand)
+ create_linkpidfile(getpid());
if (!demand && ifunit >= 0)
set_ifunit(1);
lcp_sprotrej(0, p - PPP_HDRLEN, len + PPP_HDRLEN);
}
+/*
+ * ppp_send_config - configure the transmit-side characteristics of
+ * the ppp interface. Returns -1, indicating an error, if the channel
+ * send_config procedure called error() (or incremented error_count
+ * itself), otherwise 0.
+ */
+int
+ppp_send_config(unit, mtu, accm, pcomp, accomp)
+ int unit, mtu;
+ u_int32_t accm;
+ int pcomp, accomp;
+{
+ int errs;
+
+ if (the_channel->send_config == NULL)
+ return 0;
+ errs = error_count;
+ (*the_channel->send_config)(mtu, accm, pcomp, accomp);
+ return (error_count != errs)? -1: 0;
+}
+
+/*
+ * ppp_recv_config - configure the receive-side characteristics of
+ * the ppp interface. Returns -1, indicating an error, if the channel
+ * recv_config procedure called error() (or incremented error_count
+ * itself), otherwise 0.
+ */
+int
+ppp_recv_config(unit, mru, accm, pcomp, accomp)
+ int unit, mru;
+ u_int32_t accm;
+ int pcomp, accomp;
+{
+ int errs;
+
+ if (the_channel->recv_config == NULL)
+ return 0;
+ errs = error_count;
+ (*the_channel->recv_config)(mru, accm, pcomp, accomp);
+ return (error_count != errs)? -1: 0;
+}
+
/*
* new_phase - signal the start of a new phase of pppd's operation.
*/