/*
+ * $Id: ddp_output.c,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
#include <sys/types.h>
#include <sys/param.h>
#include <sys/mbuf.h>
#ifndef BSD4_4
struct mbuf *m0;
int len;
-#endif BSD4_4
+#endif /* ! BSD4_4 */
struct ifnet *ifp;
struct at_ifaddr *aa = NULL;
struct ddpehdr *deh;
#ifdef BSD4_4
M_PREPEND( m, sizeof( struct ddpehdr ), M_WAIT );
-#else BSD4_4
+#else /* BSD4_4 */
for ( len = 0, m0 = m; m; m = m->m_next ) {
len += m->m_len;
}
return( ENOBUFS );
}
m->m_next = m0;
-#endif BSD4_4
+#endif /* BSD4_4 */
#ifndef BSD4_4
# define align(a) (((a)+3)&0xfc)
m->m_off = MMINOFF + align( SZ_ELAPHDR );
m->m_len = sizeof( struct ddpehdr );
-#endif BSD4_4
+#endif /* ! BSD4_4 */
deh = mtod( m, struct ddpehdr *);
deh->deh_pad = 0;
#ifdef BSD4_4
deh->deh_len = m->m_pkthdr.len;
-#else BSD4_4
+#else /* BSD4_4 */
deh->deh_len = len + sizeof( struct ddpehdr );
-#endif BSD4_4
+#endif /* BSD4_4 */
deh->deh_dnet = ddp->ddp_fsat.sat_addr.s_net;
deh->deh_dnode = ddp->ddp_fsat.sat_addr.s_node;
if ( ro->ro_rt && ( ifp = ro->ro_rt->rt_ifp )) {
#ifdef BSD4_4
net = satosat( ro->ro_rt->rt_gateway )->sat_addr.s_net;
-#else BSD4_4
+#else /* BSD4_4 */
net = satosat( &ro->ro_rt->rt_gateway )->sat_addr.s_net;
-#endif BSD4_4
+#endif /* BSD4_4 */
for ( aa = at_ifaddr; aa; aa = aa->aa_next ) {
if ( aa->aa_ifp == ifp &&
ntohs( net ) >= ntohs( aa->aa_firstnet ) &&
if ( m == NULL ) {
return( ENOBUFS );
}
-#else BSD4_4
+#else /* BSD4_4 */
m->m_off -= SZ_ELAPHDR;
m->m_len += SZ_ELAPHDR;
-#endif BSD4_4
-# endif notdef
+#endif /* BSD4_4 */
+# endif /* notdef */
MGET( m0, M_WAIT, MT_HEADER );
if ( m0 == 0 ) {
} else {
#ifdef BSD4_4
elh->el_dnode = satosat( ro->ro_rt->rt_gateway )->sat_addr.s_node;
-#else BSD4_4
+#else /* BSD4_4 */
elh->el_dnode = satosat( &ro->ro_rt->rt_gateway )->sat_addr.s_node;
-#endif BSD4_4
+#endif /* BSD4_4 */
}
}
} else {
#ifdef BSD4_4
gate = *satosat( ro->ro_rt->rt_gateway );
-#else BSD4_4
+#else /* BSD4_4 */
gate = *satosat( &ro->ro_rt->rt_gateway );
-#endif BSD4_4
+#endif /* BSD4_4 */
}
ro->ro_rt->rt_use++;
#ifdef notdef
m->m_off += SZ_ELAPHDR;
m->m_len -= SZ_ELAPHDR;
-#endif notdef
+#endif /* notdef */
ddp_input( m, ifp, (struct elaphdr *)NULL, 2 );
return( 0 );
}
-#endif ultrix
+#endif /* ultrix */
#ifdef _IBMR2
/*
bcopy( &eh, (*(struct sockaddr *)&gate).sa_data,
sizeof( (*(struct sockaddr *)&gate).sa_data ));
}
-#endif _IBMR2
+#endif /* _IBMR2 */
return((*ifp->if_output)( ifp, m, &gate ));
}