442 /*
443 * GLOBAL DATA STRUCTURES AND VARIABLES
444 * -----------------------------------
445 */
446
447 /*
448 * Table representing database of all options managed by T_SVR4_OPTMGMT_REQ
449 * For now, we only manage the SO_RECVUCRED option but we also have
450 * harmless dummy options to make things work with some common code we access.
451 */
452 opdes_t tl_opt_arr[] = {
453 /* The SO_TYPE is needed for the hack below */
454 {
455 SO_TYPE,
456 SOL_SOCKET,
457 OA_R,
458 OA_R,
459 OP_NP,
460 0,
461 sizeof (t_scalar_t),
462 0
463 },
464 {
465 SO_RECVUCRED,
466 SOL_SOCKET,
467 OA_RW,
468 OA_RW,
469 OP_NP,
470 0,
471 sizeof (int),
472 0
473 }
474 };
475
476 /*
477 * Table of all supported levels
478 * Note: Some levels (e.g. XTI_GENERIC) may be valid but may not have
479 * any supported options so we need this info separately.
480 *
481 * This is needed only for topmost tpi providers.
482 */
483 optlevel_t tl_valid_levels_arr[] = {
484 XTI_GENERIC,
485 SOL_SOCKET,
486 TL_PROT_LEVEL
487 };
488
489 #define TL_VALID_LEVELS_CNT A_CNT(tl_valid_levels_arr)
490 /*
491 * Current upper bound on the amount of space needed to return all options.
492 * Additional options with data size of sizeof(long) are handled automatically.
731 &tl_rinit, /* st_rdinit */
732 &tl_winit, /* st_wrinit */
733 NULL, /* st_muxrinit */
734 NULL /* st_muxwrinit */
735 };
736
737 DDI_DEFINE_STREAM_OPS(tl_devops, nulldev, nulldev, tl_attach, tl_detach,
738 nulldev, tl_info, D_MP, &tlinfo, ddi_quiesce_not_supported);
739
740 static struct modldrv modldrv = {
741 &mod_driverops, /* Type of module -- pseudo driver here */
742 "TPI Local Transport (tl)",
743 &tl_devops, /* driver ops */
744 };
745
746 /*
747 * Module linkage information for the kernel.
748 */
749 static struct modlinkage modlinkage = {
750 MODREV_1,
751 &modldrv,
752 NULL
753 };
754
755 /*
756 * Templates for response to info request
757 * Check sanity of unlimited connect data etc.
758 */
759
760 #define TL_CLTS_PROVIDER_FLAG (XPG4_1|SENDZERO)
761 #define TL_COTS_PROVIDER_FLAG (XPG4_1|SENDZERO)
762
763 static struct T_info_ack tl_cots_info_ack =
764 {
765 T_INFO_ACK, /* PRIM_type -always T_INFO_ACK */
766 T_INFINITE, /* TSDU size */
767 T_INFINITE, /* ETSDU size */
768 T_INFINITE, /* CDATA_size */
769 T_INFINITE, /* DDATA_size */
770 T_INFINITE, /* ADDR_size */
771 T_INFINITE, /* OPT_size */
772 0, /* TIDU_size - fill at run time */
|
442 /*
443 * GLOBAL DATA STRUCTURES AND VARIABLES
444 * -----------------------------------
445 */
446
447 /*
448 * Table representing database of all options managed by T_SVR4_OPTMGMT_REQ
449 * For now, we only manage the SO_RECVUCRED option but we also have
450 * harmless dummy options to make things work with some common code we access.
451 */
452 opdes_t tl_opt_arr[] = {
453 /* The SO_TYPE is needed for the hack below */
454 {
455 SO_TYPE,
456 SOL_SOCKET,
457 OA_R,
458 OA_R,
459 OP_NP,
460 0,
461 sizeof (t_scalar_t),
462 { 0 }
463 },
464 {
465 SO_RECVUCRED,
466 SOL_SOCKET,
467 OA_RW,
468 OA_RW,
469 OP_NP,
470 0,
471 sizeof (int),
472 { 0 }
473 }
474 };
475
476 /*
477 * Table of all supported levels
478 * Note: Some levels (e.g. XTI_GENERIC) may be valid but may not have
479 * any supported options so we need this info separately.
480 *
481 * This is needed only for topmost tpi providers.
482 */
483 optlevel_t tl_valid_levels_arr[] = {
484 XTI_GENERIC,
485 SOL_SOCKET,
486 TL_PROT_LEVEL
487 };
488
489 #define TL_VALID_LEVELS_CNT A_CNT(tl_valid_levels_arr)
490 /*
491 * Current upper bound on the amount of space needed to return all options.
492 * Additional options with data size of sizeof(long) are handled automatically.
731 &tl_rinit, /* st_rdinit */
732 &tl_winit, /* st_wrinit */
733 NULL, /* st_muxrinit */
734 NULL /* st_muxwrinit */
735 };
736
737 DDI_DEFINE_STREAM_OPS(tl_devops, nulldev, nulldev, tl_attach, tl_detach,
738 nulldev, tl_info, D_MP, &tlinfo, ddi_quiesce_not_supported);
739
740 static struct modldrv modldrv = {
741 &mod_driverops, /* Type of module -- pseudo driver here */
742 "TPI Local Transport (tl)",
743 &tl_devops, /* driver ops */
744 };
745
746 /*
747 * Module linkage information for the kernel.
748 */
749 static struct modlinkage modlinkage = {
750 MODREV_1,
751 { &modldrv, NULL }
752 };
753
754 /*
755 * Templates for response to info request
756 * Check sanity of unlimited connect data etc.
757 */
758
759 #define TL_CLTS_PROVIDER_FLAG (XPG4_1|SENDZERO)
760 #define TL_COTS_PROVIDER_FLAG (XPG4_1|SENDZERO)
761
762 static struct T_info_ack tl_cots_info_ack =
763 {
764 T_INFO_ACK, /* PRIM_type -always T_INFO_ACK */
765 T_INFINITE, /* TSDU size */
766 T_INFINITE, /* ETSDU size */
767 T_INFINITE, /* CDATA_size */
768 T_INFINITE, /* DDATA_size */
769 T_INFINITE, /* ADDR_size */
770 T_INFINITE, /* OPT_size */
771 0, /* TIDU_size - fill at run time */
|