Print this page
3882 remove xmod & friends
@@ -16,11 +16,10 @@
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
-/* ONC_PLUS EXTRACT START */
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -29,11 +28,10 @@
/*
* Transport Interface Library cooperating module - issue 2
*/
-/* ONC_PLUS EXTRACT END */
#include <sys/param.h>
#include <sys/types.h>
#include <sys/stream.h>
#include <sys/stropts.h>
#include <sys/strsubr.h>
@@ -193,13 +191,11 @@
#define COTS 0x0008 /* connection-oriented transport */
#define CONNWAIT 0x0010 /* waiting for connect confirmation */
#define LOCORDREL 0x0020 /* local end has orderly released */
#define REMORDREL 0x0040 /* remote end had orderly released */
#define NAMEPROC 0x0080 /* processing a NAME ioctl */
-/* ONC_PLUS EXTRACT START */
#define DO_MYNAME 0x0100 /* timod handles TI_GETMYNAME */
-/* ONC_PLUS EXTRACT END */
#define DO_PEERNAME 0x0200 /* timod handles TI_GETPEERNAME */
#define TI_CAP_RECVD 0x0400 /* TI_CAPABILITY received */
#define CAP_WANTS_INFO 0x0800 /* TI_CAPABILITY has TC1_INFO set */
#define WAIT_IOCINFOACK 0x1000 /* T_INFO_REQ generated from ioctl */
#define WAIT_CONNRESACK 0x2000 /* waiting for T_OK_ACK to T_CONN_RES */
@@ -311,24 +307,18 @@
int dotilog = 0;
#define TIMOD_ID 3
-/* ONC_PLUS EXTRACT START */
static int timodopen(queue_t *, dev_t *, int, int, cred_t *);
-/* ONC_PLUS EXTRACT END */
static int timodclose(queue_t *, int, cred_t *);
static void timodwput(queue_t *, mblk_t *);
static void timodrput(queue_t *, mblk_t *);
-/* ONC_PLUS EXTRACT START */
static void timodrsrv(queue_t *);
-/* ONC_PLUS EXTRACT END */
static void timodwsrv(queue_t *);
-/* ONC_PLUS EXTRACT START */
static int timodrproc(queue_t *, mblk_t *);
static int timodwproc(queue_t *, mblk_t *);
-/* ONC_PLUS EXTRACT END */
/* stream data structure definitions */
static struct module_info timod_info =
{TIMOD_ID, "timod", 0, INFPSZ, 512, 128};
@@ -350,11 +340,10 @@
&timod_info,
NULL
};
static struct streamtab timinfo = { &timodrinit, &timodwinit, NULL, NULL };
-/* ONC_PLUS EXTRACT START */
/*
* timodopen - open routine gets called when the module gets pushed
* onto the stream.
*/
/*ARGSUSED*/
@@ -486,11 +475,10 @@
tp->tim_wbufcid = 0;
}
enableok(q);
qenable(q);
}
-/* ONC_PLUS EXTRACT END */
/*
* timodclose - This routine gets called when the module gets popped
* off of the stream.
*/
@@ -635,11 +623,10 @@
(void) timodrproc(q, mp);
break;
}
}
-/* ONC_PLUS EXTRACT START */
/*
* timodrsrv - Module read queue service procedure. This is called when
* messages are placed on an empty queue, when high priority
* messages are placed on the queue, and when flow control
* restrictions subside. This code used to be included in a
@@ -650,11 +637,10 @@
*/
/*ARGSUSED*/
static void
timodrsrv(queue_t *q)
{
-/* ONC_PLUS EXTRACT END */
mblk_t *mp;
struct tim_tim *tp;
ASSERT(q != NULL);
@@ -669,11 +655,10 @@
* messages.
*/
return;
}
}
-/* ONC_PLUS EXTRACT START */
}
/*
* Perform common processing when a T_CAPABILITY_ACK or T_INFO_ACK
* arrive. Set the queue properties and adjust the tim_flags according
@@ -699,15 +684,13 @@
union T_primitives *pptr;
struct tim_tim *tp;
struct iocblk *iocbp;
mblk_t *nbp;
size_t blen;
-/* ONC_PLUS EXTRACT END */
tp = (struct tim_tim *)q->q_ptr;
-/* ONC_PLUS EXTRACT START */
switch (mp->b_datap->db_type) {
default:
putnext(q, mp);
break;
@@ -784,18 +767,15 @@
}
pptr = (union T_primitives *)mp->b_rptr;
switch (pptr->type) {
default:
-/* ONC_PLUS EXTRACT END */
if (auditing)
audit_sock(T_UNITDATA_IND, q, mp, TIMOD_ID);
-/* ONC_PLUS EXTRACT START */
putnext(q, mp);
break;
-/* ONC_PLUS EXTRACT END */
case T_ERROR_ACK:
/* Restore db_type - recover() might have changed it */
mp->b_datap->db_type = M_PCPROTO;
if (blen < sizeof (struct T_error_ack)) {
@@ -901,11 +881,10 @@
}
tim_send_reply(q, mp, tp, pptr->ok_ack.CORRECT_prim);
break;
-/* ONC_PLUS EXTRACT START */
case T_BIND_ACK: {
struct T_bind_ack *ackp =
(struct T_bind_ack *)mp->b_rptr;
/* Restore db_type - recover() might have changed it */
@@ -965,11 +944,10 @@
tp->tim_flags &= ~(WAITIOCACK | WAIT_IOCINFOACK |
TI_CAP_RECVD | CAP_WANTS_INFO);
break;
}
-/* ONC_PLUS EXTRACT END */
case T_OPTMGMT_ACK:
tilog("timodrproc: Got T_OPTMGMT_ACK\n", 0);
/* Restore db_type - recover() might have change it */
@@ -1198,11 +1176,10 @@
case T_ADDR_ACK:
tilog("timodrproc: Got T_ADDR_ACK\n", 0);
tim_send_reply(q, mp, tp, T_ADDR_REQ);
break;
-/* ONC_PLUS EXTRACT START */
case T_CONN_IND: {
struct T_conn_ind *tcip =
(struct T_conn_ind *)mp->b_rptr;
tilog("timodrproc: Got T_CONN_IND\n", 0);
@@ -1217,19 +1194,16 @@
tim_recover(q, mp,
(t_scalar_t)sizeof (mblk_t));
return (1);
}
}
-/* ONC_PLUS EXTRACT END */
if (auditing)
audit_sock(T_CONN_IND, q, mp, TIMOD_ID);
-/* ONC_PLUS EXTRACT START */
putnext(q, mp);
break;
}
-/* ONC_PLUS EXTRACT END */
case T_CONN_CON:
mutex_enter(&tp->tim_mutex);
if (tp->tim_peercred != NULL)
crfree(tp->tim_peercred);
tp->tim_peercred = msg_getcred(mp, &tp->tim_cpid);
@@ -1338,11 +1312,10 @@
}
break;
}
break;
-/* ONC_PLUS EXTRACT START */
case M_FLUSH:
tilog("timodrproc: Got M_FLUSH\n", 0);
if (*mp->b_rptr & FLUSHR) {
@@ -1351,11 +1324,10 @@
else
flushq(q, FLUSHDATA);
}
putnext(q, mp);
break;
-/* ONC_PLUS EXTRACT END */
case M_IOCACK:
iocbp = (struct iocblk *)mp->b_rptr;
tilog("timodrproc: Got M_IOCACK\n", 0);
@@ -1427,11 +1399,10 @@
}
}
putnext(q, mp);
break;
-/* ONC_PLUS EXTRACT START */
case M_IOCNAK:
tilog("timodrproc: Got M_IOCNAK\n", 0);
iocbp = (struct iocblk *)mp->b_rptr;
@@ -1460,17 +1431,15 @@
break;
}
}
putnext(q, mp);
break;
-/* ONC_PLUS EXTRACT END */
}
return (0);
}
-/* ONC_PLUS EXTRACT START */
/*
* timodwput - Module write put procedure. This is called from
* the module, driver, or stream head upstream/downstream.
* Handles M_FLUSH, M_DATA and some M_PROTO (T_DATA_REQ,
* and T_UNITDATA_REQ) messages. All others are queued to
@@ -1488,11 +1457,10 @@
* Enqueue normal-priority messages if our queue already
* holds some messages for deferred processing but don't
* enqueue those M_IOCTLs which will result in an
* M_PCPROTO (ie, high priority) message being created.
*/
-/* ONC_PLUS EXTRACT END */
if (q->q_first != 0 && mp->b_datap->db_type < QPCTL) {
if (mp->b_datap->db_type == M_IOCTL) {
iocbp = (struct iocblk *)mp->b_rptr;
switch (iocbp->ioc_cmd) {
default:
@@ -1507,11 +1475,10 @@
} else {
(void) putq(q, mp);
return;
}
}
-/* ONC_PLUS EXTRACT START */
/*
* Inline processing of data (to avoid additional procedure call).
* Rest is handled in timodwproc.
*/
@@ -1536,11 +1503,10 @@
break;
case M_PROTO:
case M_PCPROTO:
pptr = (union T_primitives *)mp->b_rptr;
switch (pptr->type) {
-/* ONC_PLUS EXTRACT END */
case T_UNITDATA_REQ:
tp = (struct tim_tim *)q->q_ptr;
ASSERT(tp);
if (tp->tim_flags & CLTS) {
mblk_t *tmp;
@@ -1569,11 +1535,10 @@
default:
(void) timodwproc(q, mp);
break;
}
break;
-/* ONC_PLUS EXTRACT START */
default:
(void) timodwproc(q, mp);
break;
}
}
@@ -1625,11 +1590,10 @@
switch (mp->b_datap->db_type) {
default:
putnext(q, mp);
break;
-/* ONC_PLUS EXTRACT END */
case M_DATA:
if (tp->tim_flags & CLTS) {
if ((tmp = tim_filladdr(q, mp, B_TRUE)) == NULL) {
return (1);
@@ -1642,11 +1606,10 @@
return (1);
}
putnext(q, mp);
break;
-/* ONC_PLUS EXTRACT START */
case M_IOCTL:
iocbp = (struct iocblk *)mp->b_rptr;
TILOG("timodwproc: Got M_IOCTL(%d)\n", iocbp->ioc_cmd);
@@ -1667,11 +1630,10 @@
/* Called from timodwsrv() and messages on queue */
if (!(q->q_flag & QWANTR))
tim_ioctl_retry(q);
return (1);
}
-/* ONC_PLUS EXTRACT END */
switch (iocbp->ioc_cmd) {
default:
putnext(q, mp);
break;
@@ -1917,11 +1879,10 @@
break;
}
}
break;
-/* ONC_PLUS EXTRACT START */
case TI_GETMYNAME:
tilog("timodwproc: Got TI_GETMYNAME\n", 0);
if (tp->tim_provinfo->tpi_myname == PI_YES) {
@@ -1987,11 +1948,10 @@
(void) putbq(q, mp);
return (1);
}
putnext(q, mp);
break;
-/* ONC_PLUS EXTRACT END */
case T_UNITDATA_REQ:
if (tp->tim_flags & CLTS) {
tmp = tim_filladdr(q, mp, B_TRUE);
if (tmp == NULL) {
@@ -2007,11 +1967,10 @@
return (1);
}
putnext(q, mp);
break;
-/* ONC_PLUS EXTRACT START */
case T_CONN_REQ: {
struct T_conn_req *reqp = (struct T_conn_req *)
mp->b_rptr;
void *p;
@@ -2053,14 +2012,12 @@
bcopy(p, tp->tim_peername, tp->tim_peerlen);
mutex_exit(&tp->tim_mutex);
}
if (tp->tim_flags & COTS)
tp->tim_flags |= CONNWAIT;
-/* ONC_PLUS EXTRACT END */
if (auditing)
audit_sock(T_CONN_REQ, q, mp, TIMOD_ID);
-/* ONC_PLUS EXTRACT START */
putnext(q, mp);
break;
}
case O_T_CONN_RES:
@@ -2117,11 +2074,10 @@
cresout:
putnext(q, mp);
break;
}
-/* ONC_PLUS EXTRACT END */
case T_DISCON_REQ: {
struct T_discon_req *disp;
struct T_conn_ind *conp;
mblk_t *pmp = NULL;
@@ -2173,11 +2129,10 @@
* provides T_CAPABILITY_REQ or not and we may utilise
* this knowledge here.
*/
putnext(q, mp);
break;
-/* ONC_PLUS EXTRACT START */
}
break;
case M_FLUSH:
tilog("timodwproc: Got M_FLUSH\n", 0);
@@ -2444,11 +2399,10 @@
break;
}
return (ret);
}
-/* ONC_PLUS EXTRACT END */
/*
* Fill in the address of a connectionless data packet if a connect
* had been done on this endpoint.
*/
@@ -2578,11 +2532,10 @@
}
}
return (tp);
}
-/* ONC_PLUS EXTRACT START */
static void
tim_recover(queue_t *q, mblk_t *mp, t_scalar_t size)
{
struct tim_tim *tp;
bufcall_id_t bid;
@@ -2689,11 +2642,10 @@
} while (rq != NULL);
releasestr(q);
return (0); /* no expdata on read queues */
}
-/* ONC_PLUS EXTRACT END */
static void
tim_tcap_timer(void *q_ptr)
{
queue_t *q = (queue_t *)q_ptr;
struct tim_tim *tp = (struct tim_tim *)q->q_ptr;