summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/ip.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-11-22 03:37:54 +0000
committerbrian <brian@FreeBSD.org>1997-11-22 03:37:54 +0000
commita7f001c816c9390acda1c72f889fd110f8d75563 (patch)
tree876d508224fb0bc9435a2e3b83f73719b56ad0b6 /usr.sbin/ppp/ip.c
parent13d351d26116b6bf544f619e0de396a53d47ccd1 (diff)
downloadFreeBSD-src-a7f001c816c9390acda1c72f889fd110f8d75563.zip
FreeBSD-src-a7f001c816c9390acda1c72f889fd110f8d75563.tar.gz
Fix prototypes.
Remove extraneous decls. Add ``const'' to several places. Allow ``make NOALIAS=1'' to remove IP aliasing. Merge with OpenBSD - only the Makefiles vary. We can now survive a compile with -Wall -Wbad-function-cast -Wcast-align -Wcast-qual -Winline -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -Wchar-subscripts (although the Makefile just contains -Wall).
Diffstat (limited to 'usr.sbin/ppp/ip.c')
-rw-r--r--usr.sbin/ppp/ip.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/usr.sbin/ppp/ip.c b/usr.sbin/ppp/ip.c
index ed27692..533798f 100644
--- a/usr.sbin/ppp/ip.c
+++ b/usr.sbin/ppp/ip.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: ip.c,v 1.30 1997/11/16 22:15:03 brian Exp $
+ * $Id: ip.c,v 1.31 1997/11/18 14:52:04 brian Exp $
*
* TODO:
* o Return ICMP message for filterd packet
@@ -35,10 +35,14 @@
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <net/if.h>
+#ifdef __FreeBSD__
#include <net/if_var.h>
+#endif
#include <net/if_tun.h>
+#ifndef NOALIAS
#include <alias.h>
+#endif
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@@ -46,6 +50,7 @@
#include <termios.h>
#include <unistd.h>
+#include "command.h"
#include "mbuf.h"
#include "log.h"
#include "defs.h"
@@ -54,10 +59,8 @@
#include "lcpproto.h"
#include "hdlc.h"
#include "loadalias.h"
-#include "command.h"
#include "vars.h"
#include "filter.h"
-#include "log.h"
#include "os.h"
#include "ipcp.h"
#include "vjcomp.h"
@@ -69,7 +72,7 @@
static struct pppTimer IdleTimer;
static void
-IdleTimeout()
+IdleTimeout(void *v)
{
LogPrintf(LogPHASE, "Idle timer expired.\n");
reconnect(RECON_FALSE);
@@ -109,7 +112,7 @@ StopIdleTimer()
* If any IP layer traffic is detected, refresh IdleTimer.
*/
static void
-RestartIdleTimer()
+RestartIdleTimer(void)
{
if (!(mode & (MODE_DEDICATED | MODE_DDIAL)) && ipKeepAlive) {
StartTimer(&IdleTimer);
@@ -117,18 +120,16 @@ RestartIdleTimer()
}
}
-static u_short interactive_ports[32] = {
+static const u_short interactive_ports[32] = {
544, 513, 514, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 21, 22, 23, 0, 0, 0, 0, 0, 0, 0, 543,
};
#define INTERACTIVE(p) (interactive_ports[(p) & 0x1F] == (p))
-static char *TcpFlags[] = {
- "FIN", "SYN", "RST", "PSH", "ACK", "URG",
-};
+static const char *TcpFlags[] = { "FIN", "SYN", "RST", "PSH", "ACK", "URG" };
-static char *Direction[] = {"INP", "OUT", "OUT", "IN/OUT"};
+static const char *Direction[] = {"INP", "OUT", "OUT", "IN/OUT"};
static struct filterent *Filters[] = {ifilters, ofilters, dfilters, afilters};
static int
@@ -376,7 +377,7 @@ IpInput(struct mbuf * bp)
u_char *cp;
struct mbuf *wp;
int nb, nw;
- struct tun_data tun, *frag;
+ struct tun_data tun;
tun_fill_header(tun, AF_INET);
cp = tun.data;
@@ -387,7 +388,9 @@ IpInput(struct mbuf * bp)
nb += wp->cnt;
}
+#ifndef NOALIAS
if (mode & MODE_ALIAS) {
+ struct tun_data *frag;
int iresult;
char *fptr;
@@ -445,7 +448,9 @@ IpInput(struct mbuf * bp)
VarPacketAliasSaveFragment(frag->data);
}
}
- } else { /* no aliasing */
+ } else
+#endif /* #ifndef NOALIAS */
+ { /* no aliasing */
if (PacketCheck(tun.data, nb, FL_IN) < 0) {
pfree(bp);
return;
OpenPOWER on IntegriCloud