Sprinkle #ifdef INET to make a GENERIC kernel compile with INET undefined.

This commit is contained in:
christos 2004-12-06 02:59:23 +00:00
parent d1b8269758
commit 64573a67d7
14 changed files with 162 additions and 54 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_upl.c,v 1.20 2004/04/23 17:25:25 itojun Exp $ */
/* $NetBSD: if_upl.c,v 1.21 2004/12/06 02:59:23 christos Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
* All rights reserved.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_upl.c,v 1.20 2004/04/23 17:25:25 itojun Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_upl.c,v 1.21 2004/12/06 02:59:23 christos Exp $");
#include "opt_inet.h"
#include "opt_ns.h"
@ -77,8 +77,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_upl.c,v 1.20 2004/04/23 17:25:25 itojun Exp $");
#include <netinet/in.h>
#include <netinet/in_var.h>
#include <netinet/if_inarp.h>
#else
#error upl without INET?
#endif
#ifdef NS
@ -1072,6 +1070,7 @@ upl_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
Static void
upl_input(struct ifnet *ifp, struct mbuf *m)
{
#ifdef INET
struct ifqueue *inq;
int s;
@ -1093,6 +1092,7 @@ upl_input(struct ifnet *ifp, struct mbuf *m)
}
IF_ENQUEUE(inq, m);
splx(s);
#endif
ifp->if_ipackets++;
ifp->if_ibytes += m->m_len;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fil.c,v 1.6 2004/12/01 08:25:54 martin Exp $ */
/* $NetBSD: fil.c,v 1.7 2004/12/06 02:59:23 christos Exp $ */
/*
* Copyright (C) 1993-2003 by Darren Reed.
@ -135,7 +135,7 @@ struct file;
#if !defined(lint)
#if defined(__NetBSD__)
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.6 2004/12/01 08:25:54 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.7 2004/12/06 02:59:23 christos Exp $");
#else
static const char sccsid[] = "@(#)fil.c 1.36 6/5/96 (C) 1993-2000 Darren Reed";
static const char rcsid[] = "@(#)Id: fil.c,v 2.243.2.25 2004/06/30 11:26:08 darrenr Exp";
@ -2765,7 +2765,11 @@ void *l4hdr;
m->m_off += hlen;
# endif
m->m_len -= hlen;
#ifdef INET
sum2 = in_cksum(m, slen);
#else
sum2 = 0;
#endif
m->m_len += hlen;
# if BSD >= 199103
m->m_data -= hlen;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ip_auth.c,v 1.1 2004/10/01 15:25:59 christos Exp $ */
/* $NetBSD: ip_auth.c,v 1.2 2004/12/06 02:59:23 christos Exp $ */
/*
* Copyright (C) 1998-2003 by Darren Reed & Guido van Rooij.
@ -121,7 +121,7 @@ extern struct ifqueue ipintrq; /* ip packet input queue */
#if !defined(lint)
#if defined(__NetBSD__)
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ip_auth.c,v 1.1 2004/10/01 15:25:59 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: ip_auth.c,v 1.2 2004/12/06 02:59:23 christos Exp $");
#else
static const char rcsid[] = "@(#)Id: ip_auth.c,v 2.73.2.2 2004/06/08 13:14:12 darrenr Exp";
#endif
@ -372,7 +372,9 @@ int mode;
mb_t *m;
#if defined(_KERNEL) && !defined(MENTAT) && !defined(linux) && \
(!defined(__FreeBSD_version) || (__FreeBSD_version < 501000))
#ifdef INET
struct ifqueue *ifq;
#endif
# ifdef USE_SPL
int s;
# endif /* USE_SPL */
@ -509,6 +511,7 @@ fr_authioctlloop:
RWLOCK_EXIT(&ipf_auth);
#ifdef _KERNEL
if ((m != NULL) && (au->fra_info.fin_out != 0)) {
#ifdef INET
# ifdef MENTAT
error = !putq(fra->fra_q, m);
# else /* MENTAT */
@ -524,11 +527,13 @@ fr_authioctlloop:
# endif
# endif /* Linux */
# endif /* MENTAT */
#endif
if (error != 0)
fr_authstats.fas_sendfail++;
else
fr_authstats.fas_sendok++;
} else if (m) {
#ifdef INET
# ifdef MENTAT
error = !putq(fra->fra_q, m);
# else /* MENTAT */
@ -555,6 +560,7 @@ fr_authioctlloop:
# endif
# endif /* Linux */
# endif /* MENTAT */
#endif
if (error != 0)
fr_authstats.fas_quefail++;
else

View File

@ -1,4 +1,4 @@
/* $NetBSD: ip_fil_netbsd.c,v 1.2 2004/10/31 04:52:50 darrenr Exp $ */
/* $NetBSD: ip_fil_netbsd.c,v 1.3 2004/12/06 02:59:23 christos Exp $ */
/*
* Copyright (C) 1993-2003 by Darren Reed.
@ -70,7 +70,9 @@ static const char rcsid[] = "@(#)Id: ip_fil_netbsd.c,v 2.55.2.12 2004/07/06 11:1
#include "netinet/ip_pool.h"
#include <sys/md5.h>
#include <sys/kernel.h>
#ifdef INET
extern int ip_optcopy __P((struct ip *, struct ip *));
#endif
#ifdef IPFILTER_M_IPFILTER
MALLOC_DEFINE(M_IPFILTER, "IP Filter", "IP Filter packet filter data structures");
@ -141,6 +143,7 @@ int dir;
return error;
}
#ifdef INET
#if defined(M_CSUM_TCPv4)
/*
* If the packet is out-bound, we can't delay checksums
@ -155,6 +158,7 @@ int dir;
}
}
#endif /* M_CSUM_TCPv4 */
#endif
ip = mtod(*mp, struct ip *);
hlen = ip->ip_hl << 2;
@ -332,8 +336,10 @@ pfil_error:
fr_savep = fr_checkp;
fr_checkp = fr_check;
#ifdef INET
if (fr_control_forwarding & 1)
ipforwarding = 1;
#endif
SPL_X(s);
@ -377,8 +383,10 @@ int ipldetach()
(void) frflush(IPL_LOGIPF, 0, FR_INQUE|FR_OUTQUE|FR_INACTIVE);
(void) frflush(IPL_LOGIPF, 0, FR_INQUE|FR_OUTQUE);
#ifdef INET
if (fr_control_forwarding & 2)
ipforwarding = 0;
#endif
#ifdef NETBSD_PF
# if (__NetBSD_Version__ >= 104200000)
@ -800,6 +808,7 @@ fr_info_t *fin;
return fr_send_ip(fin, m, &m);
}
#endif
#ifdef INET
ip->ip_p = IPPROTO_TCP;
ip->ip_len = htons(sizeof(struct tcphdr));
ip->ip_src.s_addr = fin->fin_daddr;
@ -807,6 +816,9 @@ fr_info_t *fin;
tcp2->th_sum = in_cksum(m, hlen + sizeof(*tcp2));
ip->ip_len = hlen + sizeof(*tcp2);
return fr_send_ip(fin, m, &m);
#else
return 0;
#endif
}
@ -815,7 +827,7 @@ fr_info_t *fin;
mb_t *m, **mpp;
{
fr_info_t fnew;
ip_t *ip, *oip;
ip_t *ip;
int hlen;
ip = mtod(m, ip_t *);
@ -824,9 +836,11 @@ mb_t *m, **mpp;
IP_V_A(ip, fin->fin_v);
switch (fin->fin_v)
{
#ifdef INET
case 4 :
{
ip_t *oip = fin->fin_ip;
fnew.fin_v = 4;
oip = fin->fin_ip;
IP_HL_A(ip, sizeof(*oip) >> 2);
ip->ip_tos = oip->ip_tos;
ip->ip_id = fr_nextipid(fin);
@ -835,6 +849,8 @@ mb_t *m, **mpp;
ip->ip_sum = 0;
hlen = sizeof(*oip);
break;
}
#endif
#ifdef USE_INET6
case 6 :
{
@ -1122,9 +1138,11 @@ frdest_t *fdp;
ifp = ro->ro_rt->rt_ifp;
if ((ro->ro_rt == NULL) || (ifp == NULL)) {
#ifdef INET
if (in_localaddr(ip->ip_dst))
error = EHOSTUNREACH;
else
#endif
error = ENETUNREACH;
goto bad;
}
@ -1173,6 +1191,7 @@ frdest_t *fdp;
if (ip->ip_len <= ifp->if_mtu) {
ip->ip_len = htons(ip->ip_len);
ip->ip_off = htons(ip->ip_off);
#ifdef INET
#if defined(M_CSUM_IPv4)
if (ifp->if_capabilities & IFCAP_CSUM_IPv4)
m->m_pkthdr.csuminfo |= M_CSUM_IPv4;
@ -1182,6 +1201,7 @@ frdest_t *fdp;
if (!ip->ip_sum)
ip->ip_sum = in_cksum(m, hlen);
#endif /* M_CSUM_IPv4 */
#endif
error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst,
ro->ro_rt);
goto done;
@ -1225,10 +1245,12 @@ frdest_t *fdp;
m->m_data += max_linkhdr;
mhip = mtod(m, struct ip *);
bcopy((char *)ip, (char *)mhip, sizeof(*ip));
#ifdef INET
if (hlen > sizeof (struct ip)) {
mhlen = ip_optcopy(ip, mhip) + sizeof (struct ip);
IP_HL_A(mhip, mhlen >> 2);
}
#endif
m->m_len = mhlen;
mhip->ip_off = ((off - hlen) >> 3) + ip_off;
if (off + len >= ip->ip_len)
@ -1245,7 +1267,9 @@ frdest_t *fdp;
m->m_pkthdr.rcvif = NULL;
mhip->ip_off = htons((u_short)mhip->ip_off);
mhip->ip_sum = 0;
#ifdef INET
mhip->ip_sum = in_cksum(m, mhlen);
#endif
*mnext = m;
mnext = &m->m_act;
}
@ -1257,7 +1281,9 @@ frdest_t *fdp;
ip->ip_len = htons((u_short)(hlen + firstlen));
ip->ip_off = htons((u_short)IP_MF);
ip->ip_sum = 0;
#ifdef INET
ip->ip_sum = in_cksum(m0, hlen);
#endif
sendorfree:
for (m = m0; m; m = m0) {
m0 = m->m_act;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_fddisubr.c,v 1.52 2004/03/22 18:02:12 matt Exp $ */
/* $NetBSD: if_fddisubr.c,v 1.53 2004/12/06 02:59:23 christos Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -96,7 +96,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_fddisubr.c,v 1.52 2004/03/22 18:02:12 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_fddisubr.c,v 1.53 2004/12/06 02:59:23 christos Exp $");
#include "opt_inet.h"
#include "opt_atalk.h"
@ -601,10 +601,12 @@ fddi_input(ifp, m)
struct ifnet *ifp;
struct mbuf *m;
{
#if defined(INET) || defined(INET6) || defined(NS) || defined(DECNET) || defined(IPX) || defined(NETATALK)
struct ifqueue *inq;
int s;
#endif
struct llc *l;
struct fddi_header *fh;
int s;
MCLAIM(m, &((struct ethercom *)ifp)->ec_rx_mowner);
if ((ifp->if_flags & IFF_UP) == 0) {
@ -817,11 +819,14 @@ fddi_input(ifp, m)
default:
ifp->if_noproto++;
#if defined(INET) || defined(INET6) || defined(NS) || defined(DECNET) || defined(IPX) || defined(NETATALK)
dropanyway:
#endif
m_freem(m);
return;
}
#if defined(INET) || defined(INET6) || defined(NS) || defined(DECNET) || defined(IPX) || defined(NETATALK)
s = splnet();
if (IF_QFULL(inq)) {
IF_DROP(inq);
@ -829,6 +834,7 @@ fddi_input(ifp, m)
} else
IF_ENQUEUE(inq, m);
splx(s);
#endif
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_gre.c,v 1.53 2004/12/04 18:31:43 peter Exp $ */
/* $NetBSD: if_gre.c,v 1.54 2004/12/06 02:59:23 christos Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -46,12 +46,13 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_gre.c,v 1.53 2004/12/04 18:31:43 peter Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_gre.c,v 1.54 2004/12/06 02:59:23 christos Exp $");
#include "opt_inet.h"
#include "opt_ns.h"
#include "bpfilter.h"
#ifdef INET
#include <sys/param.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
@ -118,18 +119,6 @@ struct if_clone gre_cloner =
int gre_compute_route(struct gre_softc *sc);
void greattach __P((int));
/* ARGSUSED */
void
greattach(count)
int count;
{
LIST_INIT(&gre_softc_list);
if_clone_attach(&gre_cloner);
}
int
gre_clone_create(ifc, unit)
struct if_clone *ifc;
@ -607,3 +596,17 @@ gre_in_cksum(u_int16_t *p, u_int len)
sum += (sum >> 16);
return (~sum);
}
#endif
void greattach __P((int));
/* ARGSUSED */
void
greattach(count)
int count;
{
#ifdef INET
LIST_INIT(&gre_softc_list);
if_clone_attach(&gre_cloner);
#endif
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_sl.c,v 1.89 2004/12/05 15:00:47 peter Exp $ */
/* $NetBSD: if_sl.c,v 1.90 2004/12/06 02:59:23 christos Exp $ */
/*
* Copyright (c) 1987, 1989, 1992, 1993
@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_sl.c,v 1.89 2004/12/05 15:00:47 peter Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_sl.c,v 1.90 2004/12/06 02:59:23 christos Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@ -94,8 +94,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_sl.c,v 1.89 2004/12/05 15:00:47 peter Exp $");
#include <netinet/in_systm.h>
#include <netinet/in_var.h>
#include <netinet/ip.h>
#else
#error Slip without inet?
#endif
#include <net/slcompress.h>
@ -261,7 +259,9 @@ slinit(sc)
sc->sc_mp = sc->sc_pktstart = (u_char *) sc->sc_mbuf->m_ext.ext_buf +
BUFOFFSET;
#ifdef INET
sl_compress_init(&sc->sc_comp);
#endif
return (1);
}
@ -461,10 +461,12 @@ sloutput(ifp, m, dst, rtp)
return (EHOSTUNREACH);
}
ip = mtod(m, struct ip *);
#ifdef INET
if (sc->sc_if.if_flags & SC_NOICMP && ip->ip_p == IPPROTO_ICMP) {
m_freem(m);
return (ENETRESET); /* XXX ? */
}
#endif
s = spltty();
if (sc->sc_oqlen && sc->sc_ttyp->t_outq.c_cc == sc->sc_oqlen) {
@ -480,6 +482,7 @@ sloutput(ifp, m, dst, rtp)
splx(s);
s = splnet();
#ifdef INET
if ((ip->ip_tos & IPTOS_LOWDELAY) != 0
#ifdef ALTQ
&& ALTQ_IS_ENABLED(&ifp->if_snd) == 0
@ -494,6 +497,7 @@ sloutput(ifp, m, dst, rtp)
error = 0;
}
} else
#endif
IFQ_ENQUEUE(&ifp->if_snd, m, &pktattr, error);
if (error) {
splx(s);
@ -715,7 +719,10 @@ slintr(void *arg)
struct tty *tp = sc->sc_ttyp;
struct mbuf *m;
int s, len;
u_char *pktstart, c;
u_char *pktstart;
#ifdef INET
u_char c;
#endif
#if NBPFILTER > 0
u_char chdr[CHDR_LEN];
#endif
@ -726,7 +733,9 @@ slintr(void *arg)
* Output processing loop.
*/
for (;;) {
#ifdef INET
struct ip *ip;
#endif
struct mbuf *m2;
#if NBPFILTER > 0
struct mbuf *bpf_m;
@ -781,12 +790,14 @@ slintr(void *arg)
} else
bpf_m = NULL;
#endif
#ifdef INET
if ((ip = mtod(m, struct ip *))->ip_p == IPPROTO_TCP) {
if (sc->sc_if.if_flags & SC_COMPRESS)
*mtod(m, u_char *) |=
sl_compress_tcp(m, ip,
&sc->sc_comp, 1);
}
#endif
#if NBPFILTER > 0
if (sc->sc_if.if_bpf && bpf_m != NULL)
bpf_mtap_sl_out(sc->sc_if.if_bpf, mtod(m, u_char *),
@ -912,6 +923,7 @@ slintr(void *arg)
memcpy(chdr, pktstart, CHDR_LEN);
}
#endif /* NBPFILTER > 0 */
#ifdef INET
if ((c = (*pktstart & 0xf0)) != (IPVERSION << 4)) {
if (c & 0x80)
c = TYPE_COMPRESSED_TCP;
@ -947,6 +959,7 @@ slintr(void *arg)
continue;
}
}
#endif
m->m_data = (caddr_t) pktstart;
m->m_pkthdr.len = m->m_len = len;
#if NBPFILTER > 0
@ -976,6 +989,7 @@ slintr(void *arg)
sc->sc_if.if_ipackets++;
sc->sc_lastpacket = time;
#ifdef INET
s = splnet();
if (IF_QFULL(&ipintrq)) {
IF_DROP(&ipintrq);
@ -987,6 +1001,7 @@ slintr(void *arg)
schednetisr(NETISR_IP);
}
splx(s);
#endif
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_spppsubr.c,v 1.78 2004/09/18 16:04:41 yamt Exp $ */
/* $NetBSD: if_spppsubr.c,v 1.79 2004/12/06 02:59:23 christos Exp $ */
/*
* Synchronous PPP/Cisco link level subroutines.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.78 2004/09/18 16:04:41 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.79 2004/12/06 02:59:23 christos Exp $");
#include "opt_inet.h"
#include "opt_ipx.h"
@ -372,14 +372,16 @@ static const char *sppp_phase_name(int phase);
static const char *sppp_proto_name(u_short proto);
static const char *sppp_state_name(int state);
static int sppp_params(struct sppp *sp, int cmd, void *data);
#ifdef INET
static void sppp_get_ip_addrs(struct sppp *sp, u_int32_t *src, u_int32_t *dst,
u_int32_t *srcmask);
static void sppp_set_ip_addrs(struct sppp *sp, u_int32_t myaddr, u_int32_t hisaddr);
static void sppp_clear_ip_addrs(struct sppp *sp);
#endif
static void sppp_keepalive(void *dummy);
static void sppp_phase_network(struct sppp *sp);
static void sppp_print_bytes(const u_char *p, u_short len);
static void sppp_print_string(const char *p, u_short len);
static void sppp_set_ip_addrs(struct sppp *sp, u_int32_t myaddr, u_int32_t hisaddr);
static void sppp_clear_ip_addrs(struct sppp *sp);
#ifdef INET6
static void sppp_get_ip6_addrs(struct sppp *sp, struct in6_addr *src,
struct in6_addr *dst, struct in6_addr *srcmask);
@ -1189,7 +1191,9 @@ sppp_cisco_input(struct sppp *sp, struct mbuf *m)
{
STDDCL;
struct cisco_packet *h;
#ifdef INET
u_int32_t me, mymask;
#endif
if (m->m_pkthdr.len < CISCO_PACKET_LEN) {
if (debug)
@ -1243,9 +1247,11 @@ sppp_cisco_input(struct sppp *sp, struct mbuf *m)
}
break;
case CISCO_ADDR_REQ:
#ifdef INET
sppp_get_ip_addrs(sp, &me, 0, &mymask);
if (me != 0L)
sppp_cisco_send(sp, CISCO_ADDR_REPLY, me, mymask);
#endif
break;
}
}
@ -2740,14 +2746,18 @@ sppp_ipcp_open(struct sppp *sp)
sp->ipcp.req_hisaddr = 0;
memset(&sp->dns_addrs, 0, sizeof sp->dns_addrs);
#ifdef INET
sppp_get_ip_addrs(sp, &myaddr, &hisaddr, 0);
#else
myaddr = hisaddr = 0;
#endif
/*
* If we don't have his address, this probably means our
* interface doesn't want to talk IP at all. (This could
* be the case if somebody wants to speak only IPX, for
* example.) Don't open IPCP in this case.
*/
if (hisaddr == 0L) {
if (hisaddr == 0) {
/* XXX this message should go away */
if (debug)
log(LOG_DEBUG, "%s: ipcp_open(): no IP interface\n",
@ -2779,11 +2789,13 @@ sppp_ipcp_close(struct sppp *sp)
STDDCL;
sppp_close_event(&ipcp, sp);
#ifdef INET
if (sp->ipcp.flags & (IPCP_MYADDR_DYN|IPCP_HISADDR_DYN))
/*
* Some address was dynamic, clear it again.
*/
sppp_clear_ip_addrs(sp);
#endif
if (sp->pp_saved_mtu > 0) {
ifp->if_mtu = sp->pp_saved_mtu;
@ -2875,7 +2887,11 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
if (sp->ipcp.flags & IPCP_HISADDR_SEEN)
hisaddr = sp->ipcp.req_hisaddr; /* we already aggreed on that */
else
#ifdef INET
sppp_get_ip_addrs(sp, 0, &hisaddr, 0); /* user configuration */
#else
hisaddr = 0;
#endif
if (debug)
log(LOG_DEBUG, "%s: ipcp parse opt values: ",
ifp->if_xname);
@ -3098,6 +3114,7 @@ sppp_ipcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len)
static void
sppp_ipcp_tlu(struct sppp *sp)
{
#ifdef INET
/* we are up. Set addresses and notify anyone interested */
STDDCL;
u_int32_t myaddr, hisaddr;
@ -3120,6 +3137,7 @@ sppp_ipcp_tlu(struct sppp *sp)
if (sp->pp_con)
sp->pp_con(sp);
#endif
}
static void
@ -3145,7 +3163,9 @@ static void
sppp_ipcp_scr(struct sppp *sp)
{
char opt[6 /* compression */ + 6 /* address */ + 12 /* dns addresses */];
#ifdef INET
u_int32_t ouraddr;
#endif
int i = 0;
#ifdef notyet
@ -3159,6 +3179,7 @@ sppp_ipcp_scr(struct sppp *sp)
}
#endif
#ifdef INET
if (sp->ipcp.opts & (1 << IPCP_OPT_ADDRESS)) {
if (sp->ipcp.flags & IPCP_MYADDR_SEEN)
ouraddr = sp->ipcp.req_myaddr; /* not sure if this can ever happen */
@ -3171,6 +3192,7 @@ sppp_ipcp_scr(struct sppp *sp)
opt[i++] = ouraddr >> 8;
opt[i++] = ouraddr;
}
#endif
if (sp->query_dns & 1) {
opt[i++] = IPCP_OPT_PRIMDNS;
@ -4708,6 +4730,7 @@ sppp_keepalive(void *dummy)
callout_reset(&keepalive_ch, hz * LCP_KEEPALIVE_INTERVAL, sppp_keepalive, NULL);
}
#ifdef INET
/*
* Get both IP addresses.
*/
@ -4858,6 +4881,7 @@ found:
#endif
}
}
#endif
#ifdef INET6
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_strip.c,v 1.56 2004/12/05 15:00:47 peter Exp $ */
/* $NetBSD: if_strip.c,v 1.57 2004/12/06 02:59:23 christos Exp $ */
/* from: NetBSD: if_sl.c,v 1.38 1996/02/13 22:00:23 christos Exp $ */
/*
@ -87,7 +87,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_strip.c,v 1.56 2004/12/05 15:00:47 peter Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_strip.c,v 1.57 2004/12/06 02:59:23 christos Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@ -123,8 +123,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_strip.c,v 1.56 2004/12/05 15:00:47 peter Exp $");
#include <netinet/in_systm.h>
#include <netinet/in_var.h>
#include <netinet/ip.h>
#else
#error Starmode Radio IP configured without configuring inet?
#endif
#include <net/slcompress.h>
@ -436,7 +434,9 @@ stripinit(sc)
}
}
#ifdef INET
sl_compress_init(&sc->sc_comp);
#endif
/* Initialize radio probe/reset state machine */
sc->sc_state = ST_DEAD; /* assumet the worst. */
@ -801,6 +801,7 @@ stripoutput(ifp, m, dst, rt)
}
ip = mtod(m, struct ip *);
#ifdef INET
if (sc->sc_if.if_flags & SC_NOICMP && ip->ip_p == IPPROTO_ICMP) {
m_freem(m);
return (ENETRESET); /* XXX ? */
@ -812,6 +813,7 @@ stripoutput(ifp, m, dst, rt)
)
ifq = &sc->sc_fastq;
else
#endif
ifq = NULL;
/*
@ -1106,7 +1108,10 @@ stripintr(void *arg)
struct tty *tp = sc->sc_ttyp;
struct mbuf *m;
int s, len;
u_char *pktstart, c;
u_char *pktstart;
#ifdef INET
u_char c;
#endif
#if NBPFILTER > 0
u_char chdr[CHDR_LEN];
#endif
@ -1117,7 +1122,9 @@ stripintr(void *arg)
* Output processing loop.
*/
for (;;) {
#ifdef INET
struct ip *ip;
#endif
#if NBPFILTER > 0
struct mbuf *bpf_m;
#endif
@ -1173,12 +1180,14 @@ stripintr(void *arg)
} else
bpf_m = NULL;
#endif
#ifdef INET
if ((ip = mtod(m, struct ip *))->ip_p == IPPROTO_TCP) {
if (sc->sc_if.if_flags & SC_COMPRESS)
*mtod(m, u_char *) |=
sl_compress_tcp(m, ip,
&sc->sc_comp, 1);
}
#endif
#if NBPFILTER > 0
if (sc->sc_if.if_bpf && bpf_m != NULL)
bpf_mtap_sl_out(sc->sc_if.if_bpf, mtod(m, u_char *),
@ -1222,6 +1231,7 @@ stripintr(void *arg)
memcpy(chdr, pktstart, CHDR_LEN);
}
#endif /* NBPFILTER > 0 */
#ifdef INET
if ((c = (*pktstart & 0xf0)) != (IPVERSION << 4)) {
if (c & 0x80)
c = TYPE_COMPRESSED_TCP;
@ -1257,6 +1267,7 @@ stripintr(void *arg)
continue;
}
}
#endif
m->m_data = (caddr_t) pktstart;
m->m_pkthdr.len = m->m_len = len;
#if NPBFILTER > 0
@ -1286,6 +1297,7 @@ stripintr(void *arg)
sc->sc_if.if_ipackets++;
sc->sc_lastpacket = time;
#ifdef INET
s = splnet();
if (IF_QFULL(&ipintrq)) {
IF_DROP(&ipintrq);
@ -1297,6 +1309,7 @@ stripintr(void *arg)
schednetisr(NETISR_IP);
}
splx(s);
#endif
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_tokensubr.c,v 1.26 2004/06/18 19:41:25 wiz Exp $ */
/* $NetBSD: if_tokensubr.c,v 1.27 2004/12/06 02:59:23 christos Exp $ */
/*
* Copyright (c) 1982, 1989, 1993
@ -99,7 +99,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_tokensubr.c,v 1.26 2004/06/18 19:41:25 wiz Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_tokensubr.c,v 1.27 2004/12/06 02:59:23 christos Exp $");
#include "opt_inet.h"
#include "opt_atalk.h"
@ -732,7 +732,9 @@ token_input(ifp, m)
default:
/* printf("token_input: unknown dsap 0x%x\n", l->llc_dsap); */
ifp->if_noproto++;
#if defined(INET) || defined(NS) || defined(DECNET)
dropanyway:
#endif
m_freem(m);
return;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_tun.c,v 1.74 2004/12/04 23:22:58 peter Exp $ */
/* $NetBSD: if_tun.c,v 1.75 2004/12/06 02:59:23 christos Exp $ */
/*
* Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk>
@ -15,7 +15,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.74 2004/12/04 23:22:58 peter Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.75 2004/12/06 02:59:23 christos Exp $");
#include "opt_inet.h"
#include "opt_ns.h"
@ -491,11 +491,11 @@ tun_output(ifp, m0, dst, rt)
struct rtentry *rt;
{
struct tun_softc *tp = ifp->if_softc;
#ifdef INET
int s;
int error;
#endif
#ifdef INET
int mlen;
#endif
ALTQ_DECL(struct altq_pktattr pktattr;)
s = splnet();

View File

@ -1,4 +1,4 @@
/* $NetBSD: radix.c,v 1.24 2004/08/17 07:05:34 itojun Exp $ */
/* $NetBSD: radix.c,v 1.25 2004/12/06 02:59:23 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1993
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: radix.c,v 1.24 2004/08/17 07:05:34 itojun Exp $");
__KERNEL_RCSID(0, "$NetBSD: radix.c,v 1.25 2004/12/06 02:59:23 christos Exp $");
#ifndef _NET_RADIX_H_
#include <sys/param.h>
@ -948,7 +948,9 @@ rn_init()
for (dom = domains; dom; dom = dom->dom_next)
if (dom->dom_maxrtkey > max_keylen)
max_keylen = dom->dom_maxrtkey;
#ifdef INET
encap_setkeylen();
#endif
#endif
if (max_keylen == 0) {
log(LOG_ERR,

View File

@ -1,4 +1,4 @@
/* $NetBSD: slcompress.c,v 1.25 2003/08/07 16:32:58 agc Exp $ */
/* $NetBSD: slcompress.c,v 1.26 2004/12/06 02:59:23 christos Exp $ */
/* Id: slcompress.c,v 1.3 1996/05/24 07:04:47 paulus Exp */
/*
@ -41,8 +41,10 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.25 2003/08/07 16:32:58 agc Exp $");
__KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.26 2004/12/06 02:59:23 christos Exp $");
#include "opt_inet.h"
#ifdef INET
#include <sys/param.h>
#include <sys/mbuf.h>
#include <sys/systm.h>
@ -625,3 +627,4 @@ bad:
INCR(sls_errorin)
return (-1);
}
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: slcompress.h,v 1.13 2003/08/07 16:32:59 agc Exp $ */
/* $NetBSD: slcompress.h,v 1.14 2004/12/06 02:59:23 christos Exp $ */
/* Id: slcompress.h,v 1.4 1994/09/21 06:50:08 paulus Exp */
/*
@ -123,7 +123,9 @@ struct cstate {
u_char cs_filler;
union {
char csu_hdr[MAX_HDR];
#ifdef INET
struct ip csu_ip; /* ip/tcp hdr from most recent packet */
#endif
} slcs_u;
};
#define cs_ip slcs_u.csu_ip
@ -156,8 +158,10 @@ struct slcompress {
void sl_compress_init __P((struct slcompress *));
void sl_compress_setup __P((struct slcompress *, int));
#ifdef INET
u_int sl_compress_tcp __P((struct mbuf *,
struct ip *, struct slcompress *, int));
#endif
int sl_uncompress_tcp __P((u_char **, int, u_int, struct slcompress *));
int sl_uncompress_tcp_core __P((u_char *, int, int, u_int,
struct slcompress *, u_char **, u_int *));