t_krcvudat.c revision 22eb7cb54d8a6bcf6fe2674cb4b1f0cf2d85cfb6
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
* The Regents of the University of California
* All Rights Reserved
*
* University Acknowledgment- Portions of this document are derived from
* software developed by the University of California, Berkeley, and its
* contributors.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Kernel TLI-like function to read a datagram off of a
* transport endpoints stream head.
*
* Returns:
* 0 On success or positive error code.
* On sucess, type is set to:
* T_DATA If normal data has been received
* T_UDERR If an error indication has been received,
* in which case uderr contains the unitdata
* error number.
* T_ERROR
*/
#include <sys/sysmacros.h>
int
{
int len;
union T_primitives *pptr;
int error;
int flag;
return (EINVAL);
error = 0;
}
/*
* XXX Grabbing a mutex to do an atomic operation seems pointless
*/
return (error);
/*
* Got something
*/
case M_PROTO:
/* LINTED pointer alignment */
case T_UNITDATA_IND:
/*
* check everything for consistency
*/
if (hdrsz < TUNITDATAINDSZ ||
break;
}
/*
* okay, so now we copy them
*/
/*
* we assume that the client knows how to deal
* with a set of linked mblks, so all we do is
* make a pass and remove any that are zero
* length.
*/
while (mp) {
KTLILOG(2,
"t_krcvudata: zero length block\n",
0);
if (nbp)
else
} else {
}
}
#ifdef KTLIDEBUG
{
while (tp) {
} else
}
}
#endif /* KTLIDEBUG */
/*
* now just point the users mblk
* pointer to what we received.
*/
break;
}
KTLILOG(1,
"t_krcvudata: pullupmsg failed\n", 0);
break;
}
} else {
KTLILOG(2,
"t_krcvudata: 0 length data message\n", 0);
}
break;
case T_UDERROR_IND:
/*
* check everything for consistency
*/
if (hdrsz < TUDERRORINDSZ ||
break;
}
break;
}
/*
* okay, so now we copy them
*/
break;
default:
KTLILOG(1,
"t_krcvudata: Unknown transport primitive %d\n",
break;
}
break;
case M_FLUSH:
break;
default:
break;
}
return (error);
}