if (am->m_off > MMAXOFF || am->m_len < 28) {
am = m_pullup(am, 28);
USERPRI;
- if (!am) return (struct mbuf *)0;
+ if (!am) return NULL;
}
hdr = (mtod(am, struct ip *))->ip_hl;
if (hdr > 5) {
if (am->m_len < (8 + (hdr<<2))) {
am = m_pullup(am, 8+(hdr<<2));
USERPRI;
- if (!am) return (struct mbuf *)0;
+ if (!am) return NULL;
}
ti = mtod(am, struct ip *); /* recompute, since m_pullup allocates new mbuf */
tu = (struct udphdr *)(((char *)ti) + (hdr<<2)); /* skip ip hdr */
for(tsp=ports, i=0; i<MAXRXPORTS;i++) {
if (*tsp++ == port) {
/* checksum the packet */
- ip_stripoptions(ti, (struct mbuf *) 0); /* get rid of anything we don't need */
+ ip_stripoptions(ti, NULL); /* get rid of anything we don't need */
/* deliver packet to rx */
taddr.sin_family = AF_INET; /* compute source address */
taddr.sin_port = tu->uh_sport;
this packet is bad */
m_freem(am);
USERPRI;
- return((struct mbuf *)0);
+ return(NULL);
}
}
/*
}
else m_freem(am);
USERPRI;
- return((struct mbuf *)0);
+ return(NULL);
}
}
}
return code;
}
USERPRI;
- return((struct mbuf *)0);
+ return(NULL);
}
#endif /* ! RXK_LISTENER_ENV */
/* steal decl from sgi_65 */
-int
-osi_NetSend(asocket, addr, dvec, nvec, asize, istack)
- register struct socket *asocket;
- struct iovec *dvec;
- int nvec;
- register afs_int32 asize;
- struct sockaddr_in *addr;
- int istack;
+int osi_NetSend(register struct socket *asocket, struct sockaddr_in *addr,
+ struct iovec *dvec, int nvec, register afs_int32 asize, int istack)
{
struct uio uio;
MBLKP bp;
/* pattern from IRIX */
#if defined(RXK_LISTENER_ENV)
-int osi_NetReceive(struct socket *so, struct sockaddr_in *from,
- struct iovec *iov, int iovcnt, int *lengthp)
-{
+int osi_NetReceive(osi_socket so, struct sockaddr_in *addr, struct iovec *dvec,
+ int nvecs, int *alength)
+{
int code;
struct uio tuio;
struct iovec tmpvec[RX_MAXWVECS+2];
int flags = 0;
MBLKP bp, sp;
- if (iovcnt > RX_MAXWVECS+2) {
- osi_Panic("Too many (%d) iovecs passed to osi_NetReceive\n", iovcnt);
+ if (nvecs > RX_MAXWVECS+2) {
+ osi_Panic("Too many (%d) iovecs passed to osi_NetReceive\n", nvecs);
}
- memcpy(tmpvec, (char*)iov, iovcnt/*(RX_MAXWVECS+1)*/ * sizeof(struct iovec));
+ memcpy(tmpvec, (char*)dvec, nvecs/*(RX_MAXWVECS+1)*/ * sizeof(struct iovec));
tuio.uio_iov = tmpvec;
- tuio.uio_iovcnt = iovcnt;
+ tuio.uio_iovcnt = nvecs;
tuio.uio_fpflags = 0;
tuio.uio_offset = 0;
tuio.uio_seg = UIOSEG_KERNEL;
- tuio.uio_resid = *lengthp;
+ tuio.uio_resid = *alength;
code = soreceive(so, &bp, &tuio, &flags, &sp, (MBLKPP)NULL);
if (!code) {
- *lengthp = *lengthp - tuio.uio_resid;
+ *alength = *alength - tuio.uio_resid;
if (bp) {
- memcpy((char*)from, (char*)bp->b_rptr, sizeof(struct sockaddr_in));
+ memcpy((char*)addr, (char*)bp->b_rptr, sizeof(struct sockaddr_in));
} else {
code = -1;
}