| OpenSS7 SS7 for the Common Man | © Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved. Last modified: Sat, 01 Nov 2008 10:42:37 GMT | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Manpage of SOCKSYSDescription: Manual PageKeywords: 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 compactpciSOCKSYSSection: OpenSS7 STREAMS Sockets Devices (4)Updated: 2008-10-31 Index Return to Main Contents NAMEsocksys - socket systems driverSYNOPSIS#include <sys/sockets.h> int fd = open(``/dev/socksys'', flags); DESCRIPTIONThe socksys driver is a STREAMS(4) based pseudo-driver which provides a set of I/O controls that provide socket compatible interface to STREAMS(4) drivers based on the Transport Provider Interface[1] (see tpi(7)). USAGEsocksys is not normally opened by a user program: it is opened by the libsocket(3) library as part of the socket(3) or socketpair(3) library calls. Also, none of the input-output controls provided by the driver (with the exception of a few of the sockio(7) input-output controls) are meant to be directly invoked by the user. In particular, the SIOCSOCKSYS input-output control is intended to be used only by the libsocket(3) library to emulate the socket(3) and socketpair(3) system calls. When the user invokes the socket(3) or socketpair(3) library call, the libsocket(3) library opens the /dev/socksys driver and invokes the SO_SOCKET or SO_SOCKPAIR command. This transforms the open file descriptor into the requested socket using the kernel mapping of socket family, type and protocol into transport provider Stream. The opened transport provider Stream is transformed into a sockfs(5) socket. Subsequent sockets API calls made on the file descriptor directly invoke the associated system calls on the sockfs(5) file descriptor. Internal to the kernel, socksys socket procedures are invoked that translate the socket operations into tpi(7) messages that are exchaged with the underlying Stream. The remaining input-output controls are provided for backward compatibility to previous library implementations only. In particular, a application compiled against the less capable LiS libsocket(3) must have access to the other SIOCSOCKSYS commands to emulate system calls. See sockmod(4) for more information in this regard. IOCTLSThese ioctls can be accessed using ioctl(2):
SIOCSHIWAT
SIOCGHIWATGets the high water mark. arg is a pointer to an integer that will return the high water mark as an integer number of octets. SIOCSLOWATSets the low water mark. arg is an integer number of octets. SIOCGLOWATGets the low water mark. arg is a pointer to an integer that will return the low water mark as an integer number of octets. SIOCATMARKThis performs the same function as the I_ATMARK command described under streamio(7s). This control returns true when all the urgent data has been already received by the user program. arg is a pointer to an integer that will return the integer test result. SIOCSPGRP or FIOCSPGRPSets the process group id for the socket. arg is an integer gid_t process number. SIOCGPGRP or FIOCGPRGPGets the process group id for the socket. arg is a pointer to an integer to hold the gid_t result. FIONREAD or TIOCINQReturns the amount of queued unread data on the read queue. arg is a pointer to an integer that will hold the result in octets. TIOCOUTQReturns the amount of queue unsent data on the write queue. arg is a pointer to an integer that will hold the result in octets. FIONBIOSIOCPROTOSet a protocol. arg is a pointer to a socknewproto structure formatted as follows:
struct socknewproto {
int family; /* address family */
int type; /* socket type */
int proto; /* protocol number */
dev_t dev; /* real device (must be clone) */
int flags; /* protosw flags */
};
See soconfig(8) for additional information. SIOCGETNAMEGets the name associated with the socket. arg is a pointer to a sockaddr structure that will hold the returned address. SIOCGETPEERGets the peer name associated with the socket. arg is a pointer to a sockaddr structure that will hold the returned address. SIOCXPROTOEmpty the socksys protocol table. arg is ignored. See soconfig(8) for additional information. SIOCSOCKSYSThis I/O control provided by the socksys driver is intended to be used by the socket(3) library and should normally be accessed by that library. arg is a pointer to a socksysreq structure that is formatted as follows:
struct socksysreq {
long args[7]; /* arguments */
};
The socksys socket commands above implement the socket(7) calls on Transport Provider Interface (tpi(7)) based STREAMS(4). These socket calls are made accessible on both STREAMS(4) and the Linux NET4 socket(7) implementation simultaneously by including the libsocket(3) library when compiling as follows:
The only socksys command that is used by the libsocket(3) library is the socket(3) system call. This call is made on an already opened STREAMS(4) file descriptor. When the Linux NET4 implementation of the socket is to be opened, the socksys driver transforms the character special device file descriptor into a socket file descriptor and performs the equivalent of a sock_create() on the requested socket. This has the effect of providing a wrapper around the Linux socket(2) system call, without affecting any other socket(7) system calls. NOTICESThe socksys driver is a pseudo-driver in the sense that when the SIOCSOCKSYS IO control is executed with the SO_SOCKET command, it converts the STREAMS(4) file descriptor from a character special device associated with a stream head, to a socket(7) file descriptor internal to the kernel. All subsequent socket(7) system calls are interfaced directly by the Linux kernel socket code and internally invokes the socket(7) functions also accessible with the SIOCSOCKSYS IO control. This technique ensures that the socket(7) interface is compatible with all Linux system calls. NOTICESWhen writing or converting a tpi(7) driver for use with the socksys driver, there are several considerations that must be made in the design and implementation of the tpi(7) driver, as follows: ADDRESS FORMAT
OPTIONS
IOCTLS
ERROR HANDLING
MISCELLANEOUSSEE ALSOBUGSCOMPATIBILITY/dev/socksys is compatible with UnixWare®, Solaris® and LiS[3] with the following exceptions:
CONFORMANCESVID[4], XID[5], XNS 5.2[6], SUSv2[7], SUSv3/POSIX[8], HISTORYsocksys first appeared in SVR 4[9]. REFERENCES
TRADEMARKS
Other trademarks are the property of their respective owners. IDENTIFICATION
Copyright©1997-2008OpenSS7 Corp.
All Rights Reserved.
Index
This document was created by man2html, using the manual pages. Time: 21:27:13 GMT, May 19, 2013 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| OpenSS7 SS7 for the Common Man |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Last modified: Sat, 01 Nov 2008 10:42:37 GMT © Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||