- Nuke some more not needed #ifdef cruft.

This commit is contained in:
Andrew R. Reiter 2002-04-21 01:41:05 +00:00
parent 151740b470
commit 64151e7a8a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=95170
14 changed files with 0 additions and 319 deletions

View File

@ -235,12 +235,8 @@ struct t_atm_sap {
* ATM socket address
*/
struct sockaddr_atm { /* XNS_EXT */
#if (defined(BSD) && (BSD >= 199103))
u_char satm_len; /* Length of socket structure */
u_char satm_family; /* Address family */
#else
u_short satm_family; /* Address family */
#endif
struct t_atm_sap satm_addr; /* Protocol address */
};

View File

@ -92,7 +92,6 @@ static void atm_aal5_cpcs_data(void *, KBuffer *);
static caddr_t atm_aal5_getname(void *);
#if (defined(__FreeBSD__) && (BSD >= 199506))
/*
* New-style socket request routines
*/
@ -118,8 +117,6 @@ struct pr_usrreqs atm_aal5_usrreqs = {
soreceive, /* pru_soreceive */
sopoll /* pru_sopoll */
};
#endif
/*
* Local variables
@ -723,11 +720,7 @@ atm_aal5_incoming(tok, cop, ap, tokp)
* and it will allocate and setup most of the pcb.
*/
atm_sock_stat.as_inconn[atp0->atp_type]++;
#if (defined(BSD) && (BSD >= 199103))
so = sonewconn(atp0->atp_socket, 0);
#else
so = sonewconn(atp0->atp_socket);
#endif
if (so) {
/*

View File

@ -65,17 +65,11 @@ __RCSID("@(#) $FreeBSD$");
#endif
#if (defined(BSD) && (BSD < 199506))
extern int ifqmaxlen;
#endif
/*
* Local functions
*/
static int atm_physif_ioctl(int, caddr_t, caddr_t);
#if (defined(BSD) && (BSD >= 199306))
static int atm_netif_rtdel(struct radix_node *, void *);
#endif
static int atm_if_ioctl(struct ifnet *, u_long, caddr_t);
static int atm_ifparse(char *, char *, int, int *);
@ -319,11 +313,9 @@ atm_physif_ioctl(code, data, arg)
int count, len, buf_len = aip->air_buf_len;
int err = 0;
char ifname[2*IFNAMSIZ];
#if (defined(BSD) && (BSD >= 199103))
struct ifaddr *ifa;
struct in_ifaddr *ia;
struct sockaddr_dl *sdl;
#endif
switch ( aip->air_opcode ) {
@ -527,7 +519,6 @@ atm_physif_ioctl(code, data, arg)
ifp->if_output = atm_ifoutput;
ifp->if_ioctl = atm_if_ioctl;
ifp->if_snd.ifq_maxlen = ifqmaxlen;
#if (defined(BSD) && (BSD >= 199103))
/*
* Set if_type and if_baudrate
*/
@ -548,8 +539,6 @@ atm_physif_ioctl(code, data, arg)
ifp->if_baudrate = 9600;
break;
}
#endif
if ((err = atm_nif_attach(nip)) != 0) {
atm_free ( (caddr_t)nip );
@ -559,7 +548,6 @@ atm_physif_ioctl(code, data, arg)
atm_physif_freenifs(pip);
break;
}
#if (defined(BSD) && (BSD >= 199103))
/*
* Set macaddr in <Link> address
*/
@ -573,7 +561,6 @@ atm_physif_ioctl(code, data, arg)
bcopy ( (caddr_t)&cup->cu_config.ac_macaddr,
LLADDR(sdl), ifp->if_addrlen );
}
#endif
}
break;
@ -1005,17 +992,11 @@ atm_nif_setaddr(nip, ifa)
*
*/
int
#if (defined(BSD) && (BSD >= 199103))
atm_ifoutput(ifp, m, dst, rt)
#else
atm_ifoutput(ifp, m, dst)
#endif
struct ifnet *ifp;
KBuffer *m;
struct sockaddr *dst;
#if (defined(BSD) && (BSD >= 199103))
struct rtentry *rt;
#endif
{
u_short fam = dst->sa_family;
int (*func)(struct ifnet *, KBuffer *,

View File

@ -112,11 +112,7 @@ struct protosw atmsw[] = {
struct domain atmdomain = {
AF_ATM,
"atm",
#if defined(__FreeBSD__)
atm_initialize,
#else
0,
#endif
0,
0,
atmsw,
@ -126,7 +122,6 @@ struct domain atmdomain = {
DOMAIN_SET(atm);
#if (defined(__FreeBSD__) && (BSD >= 199506))
/*
* Protocol request not supported
*
@ -213,6 +208,3 @@ atm_proto_notsupp4(so, i, m, addr, m2, td)
{
return (EOPNOTSUPP);
}
#endif /* (defined(__FreeBSD__) && (BSD >= 199506)) */

View File

@ -71,7 +71,6 @@ static int atm_dgram_info(caddr_t);
/*
* New-style socket request routines
*/
#if (defined(__FreeBSD__) && (BSD >= 199506))
struct pr_usrreqs atm_dgram_usrreqs = {
atm_proto_notsupp1, /* pru_abort */
pru_accept_notsupp, /* pru_accept */
@ -91,7 +90,6 @@ struct pr_usrreqs atm_dgram_usrreqs = {
atm_proto_notsupp1, /* pru_shutdown */
atm_proto_notsupp3, /* pru_sockaddr */
};
#endif
/*

View File

@ -43,10 +43,7 @@
/*
* Global variable declarations
*/
/* atm_aal5.c */
#if (defined(__FreeBSD__) && (BSD >= 199506))
extern struct pr_usrreqs atm_aal5_usrreqs;
#endif
/* atm_proto.c */
extern struct domain atmdomain;
@ -68,10 +65,7 @@ extern int atm_dev_print;
extern int atm_print_data;
extern struct sp_info atm_attributes_pool;
/* atm_usrreq.c */
#if (defined(__FreeBSD__) && (BSD >= 199506))
extern struct pr_usrreqs atm_dgram_usrreqs;
#endif
/*
@ -124,27 +118,20 @@ int atm_netconv_deregister(struct atm_ncm *);
int atm_nif_attach(struct atm_nif *);
void atm_nif_detach(struct atm_nif *);
int atm_nif_setaddr(struct atm_nif *, struct ifaddr *);
#if (defined(BSD) && (BSD >= 199103))
int atm_ifoutput(struct ifnet *, KBuffer *,
struct sockaddr *, struct rtentry *);
#else
int atm_ifoutput(struct ifnet *, KBuffer *,
struct sockaddr *);
#endif
struct atm_pif *
atm_pifname(char *);
struct atm_nif *
atm_nifname(char *);
/* atm_proto.c */
#if (defined(__FreeBSD__) && (BSD >= 199506))
int atm_proto_notsupp1(struct socket *);
int atm_proto_notsupp2(struct socket *, struct sockaddr *,
struct thread *);
int atm_proto_notsupp3(struct socket *, struct sockaddr **);
int atm_proto_notsupp4(struct socket *, int, KBuffer *,
struct sockaddr *, KBuffer *, struct thread *);
#endif
/* atm_signal.c */
int atm_sigmgr_register(struct sigmgr *);
@ -187,13 +174,5 @@ int atm_stack_enq(int, void (*)(int, void *, int, int),
void atm_stack_drain(void);
void atm_intr(void);
void atm_pdu_print(KBuffer *, char *);
/* atm_usrreq.c */
#if (!(defined(__FreeBSD__) && (BSD >= 199506)))
int atm_dgram_usrreq(struct socket *, int, KBuffer *,
KBuffer *, KBuffer *);
#endif
#endif /* _KERNEL */
#endif /* _NETATM_ATM_VAR_H */

View File

@ -175,11 +175,7 @@ ipatm_nifstat(cmd, nip, arg)
/*
* We only care about IP addresses
*/
#if (defined(BSD) && (BSD >= 199103))
if (((struct ifaddr *)arg)->ifa_addr->sa_family != AF_INET)
#else
if (((struct ifaddr *)arg)->ifa_addr.sa_family != AF_INET)
#endif
break;
/*

View File

@ -127,9 +127,6 @@ ipatm_ipinput(inp, m)
struct ip_nif *inp;
KBuffer *m;
{
#if BSD < 199103
int space;
#endif
#ifdef DIAGNOSTIC
if (ipatm_print) {
@ -137,9 +134,6 @@ ipatm_ipinput(inp, m)
}
#endif
#if defined(BSD)
#if BSD >= 199103
#ifdef DIAGNOSTIC
if (!KB_ISPKT(m)) {
panic("ipatm_ipinput: no packet header");
@ -162,43 +156,6 @@ ipatm_ipinput(inp, m)
*/
m->m_pkthdr.rcvif = (struct ifnet *)inp->inf_nif;
#else /* ! BSD >= 199103 */
/*
* Stick ifnet pointer onto front of packet - hopefully
* there'll be room in the first buffer.
*/
KB_HEADROOM(m, space);
if (space < sizeof(struct ifnet *)) {
KBuffer *n;
/*
* We have to allocate another buffer and tack it
* onto the front of the packet
*/
KB_ALLOCPKT(n, sizeof(struct ifnet *),
KB_F_NOWAIT, KB_T_HEADER);
if (n == 0) {
KB_FREEALL(m);
ipatm_stat.ias_rcvnobuf++;
return (1);
}
KB_LEN(n) = sizeof(struct ifnet *);
KB_LINKHEAD(n, m);
m = n;
} else {
/*
* Header fits, just adjust buffer controls
*/
KB_HEADADJ(m, sizeof(struct ifnet *));
}
{
struct ifnet **p;
KB_DATASTART(m, p, struct ifnet **);
*p = (struct ifnet *)inp->inf_nif;
}
#endif /* ! BSD >= 199103 */
/*
* Finally, hand packet off to IP.
*
@ -208,13 +165,7 @@ ipatm_ipinput(inp, m)
*/
if (! IF_HANDOFF(&ipintrq, m, NULL))
return (1);
#if BSD < 199506
ipintr();
#else
schednetisr ( NETISR_IP );
#endif /* BSD >= 199506 */
#endif /* defined(BSD) */
return (0);
}

View File

@ -138,9 +138,6 @@ ipatm_ifoutput(ifp, m, dst)
}
} else {
struct in_ifaddr *ia;
#if (defined(BSD) && (BSD < 199306))
extern struct ifnet loif;
#endif
/*
* No VCC to destination
@ -166,11 +163,7 @@ ipatm_ifoutput(ifp, m, dst)
/*
* Is this a broadcast packet ??
*/
#if (defined(BSD) && (BSD >= 199306))
if (in_broadcast(((struct sockaddr_in *)dst)->sin_addr, ifp)) {
#else
if (in_broadcast(((struct sockaddr_in *)dst)->sin_addr)) {
#endif
struct ip_nif *inp;
int s;

View File

@ -230,11 +230,7 @@ ipatm_ioctl(code, data, arg1)
}
if ((ip.s_addr == INADDR_ANY) ||
#if (defined(BSD) && (BSD >= 199306))
in_broadcast(ip, &inp->inf_nif->nif_if) ||
#else
in_broadcast(ip) ||
#endif
IN_MULTICAST(ntohl(ip.s_addr))) {
err = EADDRNOTAVAIL;
break;
@ -293,11 +289,7 @@ ipatm_ioctl(code, data, arg1)
}
if ((ip.s_addr == INADDR_ANY) ||
#if (defined(BSD) && (BSD >= 199306))
in_broadcast(ip, &inp->inf_nif->nif_if) ||
#else
in_broadcast(ip) ||
#endif
IN_MULTICAST(ntohl(ip.s_addr))) {
err = EADDRNOTAVAIL;
break;

View File

@ -371,11 +371,7 @@ ipatm_openpvc(pvp, sivp)
* Validate fixed destination IP address
*/
if (pvp->ipp_dst.sin_addr.s_addr != INADDR_ANY) {
#if (defined(BSD) && (BSD >= 199306))
if (in_broadcast(pvp->ipp_dst.sin_addr, &nip->nif_if) ||
#else
if (in_broadcast(pvp->ipp_dst.sin_addr) ||
#endif
IN_MULTICAST(ntohl(pvp->ipp_dst.sin_addr.s_addr)) ||
ipatm_chknif(pvp->ipp_dst.sin_addr, inp)) {
err = EINVAL;

View File

@ -48,13 +48,11 @@
* UM_ZERO(addr, len) Zeros len bytes of data from addr.
*
*/
#if (defined(BSD) && (BSD >= 199103))
#define UM_ALLOC(size) malloc((size_t)(size))
#define UM_FREE(addr) free((void *)(addr))
#define UM_COPY(from, to, len) bcopy((void *)(from), (void *)(to),\
(size_t)(len))
#define UM_ZERO(addr, len) bzero((void *)(addr), (size_t)(len))
#endif
#ifdef _KERNEL
@ -141,7 +139,6 @@
* KB_PLENADJ(bfr, n) Adjust total packet length by n bytes.
*
*/
#if defined(BSD)
#include <sys/mbuf.h>
typedef struct mbuf KBuffer;
@ -153,8 +150,6 @@ typedef struct mbuf KBuffer;
#define KB_COPYALL M_COPYALL
#if BSD >= 199103
#define KB_NEXT(bfr) (bfr)->m_next
#define KB_LEN(bfr) (bfr)->m_len
#define KB_QNEXT(bfr) (bfr)->m_nextpkt
@ -291,159 +286,6 @@ typedef struct mbuf KBuffer;
}
#else /* ! BSD >= 199103 */
#define KB_NEXT(bfr) (bfr)->m_next
#define KB_LEN(bfr) (bfr)->m_len
#define KB_QNEXT(bfr) (bfr)->m_act
#define KB_ALLOC(bfr, size, flags, type) { \
if ((size) <= MLEN) { \
MGET((bfr), (flags), (type)); \
} else \
(bfr) = NULL; \
}
#define KB_ALLOCPKT(bfr, size, flags, type) { \
if ((size) <= MLEN) { \
MGET((bfr), (flags), (type)); \
} else \
(bfr) = NULL; \
}
#define KB_ALLOCEXT(bfr, size, flags, type) { \
if ((size) <= MCLBYTES) { \
MGET((bfr), (flags), (type)); \
if ((bfr) != NULL) { \
MCLGET(bfr); \
if ((bfr)->m_len != MCLBYTES) { \
m_freem((bfr)); \
(bfr) = NULL; \
} \
} \
} else \
(bfr) = NULL; \
}
#define KB_FREEONE(bfr, nxt) { \
(nxt) = m_free(bfr); \
}
#define KB_FREEALL(bfr) { \
m_freem(bfr); \
}
#define KB_COPY(bfr, off, len, new, flags) { \
(new) = m_copy((bfr), (off), (len)); \
}
#define KB_COPYDATA(bfr, off, len, datap) \
m_cpytoc((bfr), (off), (len), (datap))
#define KB_PULLUP(bfr, n, new) { \
(new) = m_pullup((bfr), (n)); \
}
#define KB_LINKHEAD(new, head) { \
(new)->m_next = (head); \
}
#define KB_LINK(new, prev) { \
(new)->m_next = (prev)->m_next; \
(prev)->m_next = (new); \
}
#define KB_UNLINKHEAD(head, next) { \
(next) = m_free((head)); \
(head) = NULL; \
}
#define KB_UNLINK(old, prev, next) { \
(next) = m_free((old)); \
(old) = NULL; \
(prev)->m_next = (next); \
}
#define KB_ISPKT(bfr) (0)
#define KB_ISEXT(bfr) M_HASCL(bfr)
#define KB_BFRSTART(bfr, x, t) { \
if (M_HASCL(bfr)) { \
if ((bfr)->m_cltype == MCL_STATIC) \
(x) = (t)(mtod((bfr), int) & ~(MCLBYTES - 1)); \
else \
(x) = (t)NULL; \
} else \
(x) = (t)((bfr)->m_dat); \
}
#define KB_BFREND(bfr, x, t) { \
if (M_HASCL(bfr)) { \
if ((bfr)->m_cltype == MCL_STATIC) \
(x) = (t)((mtod((bfr), int) & ~(MCLBYTES - 1)) \
+ MCLBYTES); \
else \
(x) = (t)NULL; \
} else \
(x) = (t)((bfr)->m_dat + MLEN); \
}
#define KB_BFRLEN(bfr) \
(M_HASCL(bfr) ? (((bfr)->m_cltype == MCL_STATIC) ? MCLBYTES : 0) : MLEN)
#define KB_DATASTART(bfr, x, t) { \
(x) = mtod((bfr), t); \
}
#define KB_DATAEND(bfr, x, t) { \
(x) = (t)(mtod((bfr), caddr_t) + (bfr)->m_len); \
}
#define KB_HEADSET(bfr, n) { \
if (M_HASCL(bfr)) { \
/* Assume cluster buffer is empty XXX */\
(bfr)->m_off += (n); \
} else \
(bfr)->m_off = MMINOFF + (n); \
}
#define KB_HEADMOVE(bfr, n) { \
(bfr)->m_off += (n); \
}
#define KB_HEADADJ(bfr, n) { \
(bfr)->m_len += (n); \
(bfr)->m_off -= (n); \
}
#define KB_TAILADJ(bfr, n) { \
(bfr)->m_len += (n); \
}
#define KB_TAILALIGN(bfr, n) { \
(bfr)->m_len = (n); \
if (M_HASCL(bfr)) { \
if ((bfr)->m_cltype == MCL_STATIC) \
(bfr)->m_off = (int)(((mtod((bfr), int) \
& ~(MCLBYTES - 1)) + MCLBYTES - (n)) \
& ~(sizeof(long) - 1)) - (int)(bfr); \
/* Out of luck for loaned buffers */ \
} else \
(bfr)->m_off = (MMAXOFF - (n)) & ~(sizeof(long) - 1); \
}
#define KB_HEADROOM(bfr, n) { \
if (M_HASCL(bfr)) { \
if ((bfr)->m_cltype == MCL_STATIC) \
(n) = mtod((bfr), int) & (MCLBYTES - 1); \
else \
(n) = 0; \
} else \
(n) = (bfr)->m_off - MMINOFF; \
}
#define KB_TAILROOM(bfr, n) { \
if (M_HASCL(bfr)) { \
if ((bfr)->m_cltype == MCL_STATIC) \
(n) = MCLBYTES - ((mtod((bfr), int) + (bfr)->m_len) \
& (MCLBYTES - 1)); \
else \
(n) = 0; \
} else \
(n) = MMAXOFF - ((bfr)->m_off + (bfr)->m_len); \
}
#define KB_PLENGET(bfr, n) { \
struct mbuf *zz; \
for ((n) = 0, zz = (bfr); zz; zz = zz->m_next) \
(n) += zz->m_len; \
}
#define KB_PLENSET(bfr, n) { \
}
#define KB_PLENADJ(bfr, n) { \
}
#endif /* ! BSD >= 199103 */
#endif /* defined(BSD) */
/*
* Kernel time
*
@ -452,16 +294,8 @@ typedef struct mbuf KBuffer;
* KT_TIME(t) Sets t to the current time.
*
*/
#if (defined(BSD) && (BSD >= 199306))
typedef void KTimeout_ret;
#else
typedef int KTimeout_ret;
#endif
#if (defined(BSD) && (BSD >= 199103))
#define KT_TIME(t) microtime(&t)
#else
#define KT_TIME(t) ((t) = time)
#endif
#endif /* _KERNEL */
@ -486,16 +320,4 @@ typedef int KTimeout_ret;
#define MIN(a,b) min((a),(b))
#endif
#if (!(defined(BSD) && (BSD >= 199306)))
#ifndef __BIT_TYPES_DEFINED__
#define __BIT_TYPES_DEFINED__
typedef char int8_t;
typedef unsigned char u_int8_t;
typedef short int16_t;
typedef unsigned short u_int16_t;
typedef int int32_t;
typedef unsigned int u_int32_t;
#endif
#endif
#endif /* _NETATM_PORT_H */

View File

@ -663,11 +663,7 @@ spansarp_input(clp, m)
* If source IP address is from unspecified or broadcast addresses,
* don't bother updating arp table, but answer possible requests
*/
#if (defined(BSD) && (BSD >= 199306))
if (in_broadcast(in_src, &inp->inf_nif->nif_if))
#else
if (in_broadcast(in_src))
#endif
goto chkop;
/*

View File

@ -419,11 +419,7 @@ uniarp_validate_ip(uip, ip, origin)
* Can't be multicast or broadcast address
*/
if (IN_MULTICAST(ntohl(ip->s_addr)) ||
#if (defined(BSD) && (BSD >= 199306))
in_broadcast(*ip, &uip->uip_ipnif->inf_nif->nif_if))
#else
in_broadcast(*ip))
#endif
return (1);
/*