Print this page
3882 remove xmod & friends
*** 16,26 ****
* 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 */
--- 16,25 ----
*** 29,39 ****
/*
* 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>
--- 28,37 ----
*** 193,205 ****
#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 */
--- 191,201 ----
*** 311,334 ****
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};
--- 307,324 ----
*** 350,360 ****
&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*/
--- 340,349 ----
*** 486,496 ****
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.
*/
--- 475,484 ----
*** 635,645 ****
(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
--- 623,632 ----
*** 650,660 ****
*/
/*ARGSUSED*/
static void
timodrsrv(queue_t *q)
{
- /* ONC_PLUS EXTRACT END */
mblk_t *mp;
struct tim_tim *tp;
ASSERT(q != NULL);
--- 637,646 ----
*** 669,679 ****
* 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
--- 655,664 ----
*** 699,713 ****
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;
--- 684,696 ----
*** 784,801 ****
}
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)) {
--- 767,781 ----
*** 901,911 ****
}
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 */
--- 881,890 ----
*** 965,975 ****
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 */
--- 944,953 ----
*** 1198,1208 ****
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);
--- 1176,1185 ----
*** 1217,1235 ****
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);
--- 1194,1209 ----
*** 1338,1348 ****
}
break;
}
break;
- /* ONC_PLUS EXTRACT START */
case M_FLUSH:
tilog("timodrproc: Got M_FLUSH\n", 0);
if (*mp->b_rptr & FLUSHR) {
--- 1312,1321 ----
*** 1351,1361 ****
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);
--- 1324,1333 ----
*** 1427,1437 ****
}
}
putnext(q, mp);
break;
- /* ONC_PLUS EXTRACT START */
case M_IOCNAK:
tilog("timodrproc: Got M_IOCNAK\n", 0);
iocbp = (struct iocblk *)mp->b_rptr;
--- 1399,1408 ----
*** 1460,1476 ****
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
--- 1431,1445 ----
*** 1488,1498 ****
* 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:
--- 1457,1466 ----
*** 1507,1517 ****
} else {
(void) putq(q, mp);
return;
}
}
- /* ONC_PLUS EXTRACT START */
/*
* Inline processing of data (to avoid additional procedure call).
* Rest is handled in timodwproc.
*/
--- 1475,1484 ----
*** 1536,1546 ****
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;
--- 1503,1512 ----
*** 1569,1579 ****
default:
(void) timodwproc(q, mp);
break;
}
break;
- /* ONC_PLUS EXTRACT START */
default:
(void) timodwproc(q, mp);
break;
}
}
--- 1535,1544 ----
*** 1625,1635 ****
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);
--- 1590,1599 ----
*** 1642,1652 ****
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);
--- 1606,1615 ----
*** 1667,1677 ****
/* 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;
--- 1630,1639 ----
*** 1917,1927 ****
break;
}
}
break;
- /* ONC_PLUS EXTRACT START */
case TI_GETMYNAME:
tilog("timodwproc: Got TI_GETMYNAME\n", 0);
if (tp->tim_provinfo->tpi_myname == PI_YES) {
--- 1879,1888 ----
*** 1987,1997 ****
(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) {
--- 1948,1957 ----
*** 2007,2017 ****
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;
--- 1967,1976 ----
*** 2053,2066 ****
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:
--- 2012,2023 ----
*** 2117,2127 ****
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;
--- 2074,2083 ----
*** 2173,2183 ****
* 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);
--- 2129,2138 ----
*** 2444,2454 ****
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.
*/
--- 2399,2408 ----
*** 2578,2588 ****
}
}
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;
--- 2532,2541 ----
*** 2689,2699 ****
} 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;
--- 2642,2651 ----