IPCCREATE(2)
Series 300 and 800 Only
NAME
ipccreate() − creates a call socket
SYNOPSIS
#include<sys/ns_ipc.h>
void ipccreate (socketkind,protocol,flags,opt,calldesc,result);
ns_int_t socketkind,protocol,*flags,*calldesc, *result;
short int opt[];
DESCRIPTION
ipccreate is used to create a call socket or "telephone" which will be used by subsequent NetIPC calls to establish a virtual circuit connection between two or more processes. When invoked successfully, ipccreate returns a call socket descriptor, or "telephone number," that refers to the newly-created call socket.
A process may own a maximum of 60 descriptors. ipccreate will return an error if a process attempts to exceed this limit. This limit includes file descriptors as well as socket descriptors. These descriptors may reference sockets and/or files inherited by or otherwise opened by the process.
The NSO_PROTOCOL_ADDRESS option (code 128) can be used to create a call socket with a specific protocol address. If this protocol address is known by the process’s peer, the peer process can call ipcdest with this address (in ipcdest’s protoaddr parameter) so that it may obtain a destination descriptor that references this call socket.
This routine can be linked into a program by giving the -lnsipc option to cc(1) or ld(1).
PARAMETERS
socketkind (input parameter) Indicates the type of socket to be created. Must be NS_CALL or 3 to indicate a call socket. Other values are reserved for future use.
protocol (input parameter) Indicates the protocol module that the calling process wishes to access. Can be NSP_TCP or 4 to indicate Transmission Control Protocol (TCP). If zero (0) is specified, NetIPC will choose the best protocol to support the referenced socket type. (TCP will always be chosen for call sockets.) Other values are reserved for future use.
flags (input parameter) This parameter is reserved for future use. All bits must be clear (not set). Refer to the NetIPC programmer’s manual for your system for a complete description of this parameter.
opt (input parameter) See below. Refer to the NetIPC programmer’s manual for your system for a complete description of this parameter.
calldesc (output parameter) Call socket descriptor. Refers to the newly-created call socket.
result (output parameter) The returned error code; zero or NSR_NO_ERROR if no error. See "Diagnostics" below for more information.
OPT PARAMETER
NSO_MAX_CONN_REQ_BACK
( optioncode = 6) ( datalength = 2) A two-byte integer that specifies the maximum number of unreceived connection requests that may be queued to a call socket. If this value is not specified, the default maximum will be used. Default: One request. Range: 1 to 20. (NOTE: A queue limit of one may be too few if many processes attempt to initiate connections to the call socket simultaneously. If this occurs, some connection requests may be automatically rejected.)
NSO_PROTOCOL_ADDRESS
( optioncode = 128) ( datalength = 2) A two-byte integer that specifies a TCP protocol address to be used by the newly-created call socket. If this option is not specified, or if zero is specified, NetIPC will dynamically allocate an address. You must have super-user capability to request protocol addresses less than 1024. Recommended Range: 30767 to 32767.
RETURNS
None. Errors are returned in the result parameter.
AUTHOR
HP
SEE ALSO
DIAGNOSTICS
[NSR_NO_ERROR] The call was successful.
[NSR_xxxx] Refer to the errors listed in the NetIPC programmer’s manual for your system.
Hewlett-Packard Company — May 11, 2021