]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/demand.c
pppd.8: Document netmask option
[ppp.git] / pppd / demand.c
index 289c9f8fdd57959588e65835d16cc3adf7950c6a..b7f95083ed8b4d5a321908c7060d7e4175420c64 100644 (file)
@@ -17,7 +17,7 @@
  * 3. Redistributions of any form whatsoever must retain the following
  *    acknowledgment:
  *    "This product includes software developed by Paul Mackerras
- *     <paulus@samba.org>".
+ *     <paulus@ozlabs.org>".
  *
  * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
  * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
 
 #define RCSID  "$Id: demand.c,v 1.20 2005/08/25 12:14:18 paulus Exp $"
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/resource.h>
 #include <sys/stat.h>
 #include <sys/socket.h>
-#ifdef PPP_FILTER
+#ifdef PPP_WITH_FILTER
 #include <pcap-bpf.h>
 #endif
 
-#include "pppd.h"
+#include "pppd-private.h"
 #include "fsm.h"
 #include "ipcp.h"
 #include "lcp.h"
@@ -93,12 +97,12 @@ demand_conf(void)
     flush_flag = 0;
     fcs = PPP_INITFCS;
 
-    netif_set_mtu(0, MIN(lcp_allowoptions[0].mru, PPP_MRU));
+    ppp_set_mtu(0, MIN(lcp_allowoptions[0].mru, PPP_MRU));
     if (ppp_send_config(0, PPP_MRU, (u_int32_t) 0, 0, 0) < 0
        || ppp_recv_config(0, PPP_MRU, (u_int32_t) 0, 0, 0) < 0)
            fatal("Couldn't set up demand-dialled PPP interface: %m");
 
-#ifdef PPP_FILTER
+#ifdef PPP_WITH_FILTER
     set_filters(&pass_filter, &active_filter);
 #endif
 
@@ -206,6 +210,7 @@ static u_short fcstab[256] = {
        0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330,
        0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78
 };
+#define PPP_FCS(fcs, c)        (((fcs) >> 8) ^ fcstab[((fcs) ^ (c)) & 0xff])
 
 /*
  * loop_chars - process characters received from the loopback.
@@ -332,7 +337,7 @@ active_packet(unsigned char *p, int len)
     if (len < PPP_HDRLEN)
        return 0;
     proto = PPP_PROTOCOL(p);
-#ifdef PPP_FILTER
+#ifdef PPP_WITH_FILTER
     p[0] = 1;          /* outbound packet indicator */
     if ((pass_filter.bf_len != 0
         && bpf_filter(pass_filter.bf_insns, p, len, len) == 0)