OpenSS7
SS7 for the
Common Man
© Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved.
Last modified: Mon, 28 Apr 2008 16:47:03 GMT
Home TopIndex FirstPrev Next LastMore Download Info FAQ Mail  Home -> Documentation -> Man Pages -> Manual Page
Quick Links

Download

SCTP

SIGTRAN

SS7

Hardware

STREAMS

Asterisk

Related

Package

Manual

FAQ

Man Pages

Applications

SS7 Stack

ISDN Stack

SIGTRAN Stack

VoIP Stack

MG Stack

SS7/ISDN Devices

IP Transport

Embedded Systems

OS

Documentation

FAQ

SIGTRAN

Design

Conformance

Performance

References

Man Pages

Manuals

Papers

Home

Overview

Status

Documentation

Resources

About

News

Description: Manual Page

Keywords: ss7 ss7/ip ss7 over ip ss7 mtp ss7 sccp ss7 tcap sigtran mtp sccp tcap openss7 acb56 linux telephony pstn linux telephony linux nebs linux compactpci


MI_COPYOUT

Section: The OpenSS7 Project DDI/DKI (9)
Updated: Wed, 16 Aug 2017 06:30:48 GMT
Index Return to Main Contents

NAME

mi_copyout - copy data from a user buffer

SYNOPSIS

#define _MPS_SOURCE
#include <sys/stream.h>
#include <sys/ddi.h>
#include <sys/mpsddi.h>

void mi_copyout(queue_t *q, mblk_t *mp);

ARGUMENTS

q

the current write-side queue whose qi_putp(9) or qi_srvp(9) procedure within which mi_copyout() is being called.
mp
a pointer to the message block that contains the M_IOCTL(9) or M_IOCDATA(9) message being processed. This is the message that was passed to the write-side qi_putp(9) or qi_srvp(9) procedure within which mi_copyout() is invoked. mi_copyout_alloc(9) must be used to allocate the message blocks into which the data to be copied out is placed.

INTERFACE

MPS®-specific DDI.

DESCRIPTION

mi_copyout() is one of a set of helper functions that supports both TRANSPARENT and I_STR(7) input-output controls (see ioctl(2s) and streamio(7)). These helper functions include: mi_copyin(9), mi_copyout(9), mi_copyout_alloc(9), mi_copy_done(9), MI_COPY_CASE(9), mi_copy_set_rval(9) and mi_copy_state(9).

mi_copyout() is used to copy data from the kernel to user-space. When a driver or module qi_putp(9) or qi_srvp(9) procedure receives a M_IOCTL(9) or M_IOCDATA(9) message, and there is data to be copied out to user-space, the mi_copyout_alloc(9) function is used to add data to the message pointed to by mp and then the mi_copyout() function is called to invoke the M_COPYOUT(9) message upstream.

If called after the last copy in or copy out operation and no copy out allocations were generated with mi_copyout_alloc(9) or remain after previous mi_copyout() calls, then mi_copyout() will close the input output control operation as though mi_copy_done(9) was called like: mi_copy_done(q, mp, cp->cp_rval).

When mi_copyout() is called for a non-transparent I_STR(7) operation, the input-output control operation is completed and an M_IOCACK(9) message issued upstream. If a copyout operation was previously specified with a call to mi_copyout_alloc(9), an implicit copyout operation is included by setting the ioc_count member of the iocblk(9) structure to the size of the copyout operation.

If it is desired that the return value returned on an I_STR(7) operation be other than zero, the mi_copy_set_rval(9) utility can be used to set the return value before mi_copyout(9) is called.

USAGE

mi_copyout() is used in conjunction with mi_copyout_alloc(9) to copy data out to the user in the last stage of an input-output control operation. mp can either represent a M_IOCTL(9) I_STR(7)-based input-output control, or a TRANSPARENT input-output control that did not require any data to be copied in, or an M_IOCDATA(9) message from a previous copyin or copyout operation.

RETURN

mi_copyout() returns void.

ERRORS

mi_copyout() fails when passed invalid pointers. When mi_copyout() fails, it panics the kernel.

If mi_copyout() suffers an internal failure, it will close the input-output control operation with a suitable error code. The error codes returned by mi_copyout() to the ioctl(2s) operation in errno(3), are as follows:

[EPROTO]
mi_copyout() was passed an invalid argument, or the passed in message block was of an invalid format.
[ENOSR]
mi_copyout(), or the stream head, could not allocate a STREAMS resource to complete the operation.
[ENOMEM]
mi_copyout(), or the stream head, could not allocate memory to complete the operation.
[ENOBUFS]
mi_copyout(), or the stream head, could not allocate a buffer to complete the operation.

EXAMPLE

See mi_copyin(9) and mi_copyout(9) for examples of the usage of mi_copyout().

CONTEXT

mi_copyout() can be called from any context; however, it is normally called from the STREAMS driver or module write-side queue qi_putp(9) or qi_srvp(9) procedure.

MP-STREAMS

mi_copyout() is MP-safe; however, it is the responsibility of the caller to ensure exclusive access to the passed in message blocks. This is normally the case when the function is called from the STREAMS driver or module write-side queue qi_putp(9) or qi_srvp(9) procedure.

NOTICES

mi_copyout() is an MPS®-specific function: _MPS_SOURCE, _AIX_SOURCE or _MAC_SOURCE must be defined before including DDI/DKI include files to expose this symbol. The OpenSS7 Project must also have been compiled with CONFIG_STREAMS_COMPAT_MPS, CONFIG_STREAMS_COMPAT_MPS_MODULE, CONFIG_STREAMS_COMPAT_AIX, CONFIG_STREAMS_COMPAT_AIX_MODULE, CONFIG_STREAMS_COMPAT_MAC or CONFIG_STREAMS_COMPAT_MAC_MODULE defined.

IMPLEMENTATION

If mi_copyout () is called incorrectly, it will abort the input-output control operation and send an M_IOCNAK(9) message in response with error number [EPROTO]. Otherwise, an M_COPYOUT(9) message is formulated and sent upstream.

SEE ALSO

mi_copy_done(9), mi_copyin(9), mi_copyout_alloc(9), mi_copy_set_rval(9), mi_copy_state(9), MI_COPY_CASE(9), mpscompat(9), aixcompat(9), maccompat(9), STREAMS(9).

BUGS

mi_copyout() has no known bugs.

COMPATIBILITY

mi_copyout() is compatible with MPS®, AIX®, MacOT®, and Solaris®, with the following portability considerations:

---
mi_copyout() is an MPS®-specific function and should not be used by portable STREAMS drivers and modules. The more common message utility functions should be used in its stead.
---
mi_copyout() is provided for source level compatibility with MPS® for the purpose of porting MPS® drivers to Linux. Because internal structures and definitions for The OpenSS7 Project[1] differ from that of MPS®, binaries are incompatible.
---
mi_copyout() only provides functionality comparable to MPS® for use by STREAMS drivers and modules. Any and all functionality provided by mi_copyout() in support of non-STREAMS devices are not supported.

See mpscompat(9), aixcompat(9), maccompat(9), and STREAMS(9) for additional compatibility considerations.

CONFORMANCE

MPS® DDI documentation, MacOT® DDI documentation[2, 3], AIX® documentation[4].

HISTORY

mi_copyout() first appeared in MPS®. mi_copyout() is a Mentat, Inc. function that goes all the way back to the pre-OSF/1 Mentat implementations. mi_copyout() appears in MacOT®[3] and AIX®[4]. An undocumented version of mi_copyout() appears in Solaris®.

REFERENCES

[1]
TCI, Transaction Component Interface (TCI) Specification, Revision 0.9.2, Draft 2, July 15, 2007, (Edmonton, Alberta), TheOpenSS7Project, OpenSS7Corporation. Distributed with package strss7-0.9.2. <http://www.openss7.org/docs/tci.pdf>
[2]
Mac OS 9, Open Transport Reference, 2003, (Cupertino, California), Apple Computer, Inc., Apple. <http://developer.apple.com/macros/opentransport/>
[3]
Revision 1.5d2, Open Transport Module Developer Note, June 18, 1996, (Cupertino, California), Apple Computer, Inc., Apple. <http://developer.apple.com/macos/opentransport/>
[4]
AIX® 5L Version 5.1, AIX Communications Programming Concepts, 2001, (Boulder, Colorado), Internatonal Business Machines Corp., IBM. <http://publibn.boulder.ibm.com/>

TRADEMARKS

OpenSS7tm
is a trademark of OpenSS7 Corporation.
Linux®
is a registered trademark of Linus Torvalds.
UNIX®
is a registered trademark of The Open Group.
Solaris®
is a registered trademark of Sun Microsystems.

Other trademarks are the property of their respective owners.

IDENTIFICATION

The OpenSS7 Project: Package OpenSS7 version 0.9.2 released Wed, 16 Aug 2017 06:30:48 GMT.

Copyright©1997-2008OpenSS7 Corp.
All Rights Reserved.
(See roff source for permission notice.)



Index

NAME
SYNOPSIS
ARGUMENTS
INTERFACE
DESCRIPTION
USAGE
RETURN
ERRORS
EXAMPLE
CONTEXT
MP-STREAMS
NOTICES
IMPLEMENTATION
SEE ALSO
BUGS
COMPATIBILITY
CONFORMANCE
HISTORY
REFERENCES
TRADEMARKS
IDENTIFICATION

This document was created by man2html, using the manual pages.
Time: 06:30:48 GMT, August 16, 2017
OpenSS7
SS7 for the
Common Man
Home TopIndex FirstPrev Next LastMore Download Info FAQ Mail  Home -> Documentation -> Man Pages -> Manual Page
Last modified: Mon, 28 Apr 2008 16:47:03 GMT
© Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved.