Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Overview of functions

&pagelevel(3)&pagelevel

The following overview of the SOCKETS(BS2000) interface functions collects several functions together into task-oriented groups.

The three columns on the right, “INET”, “INET6”, and “ISO”, indicate the address family (AF_INET, AF_INET6, AF_ISO) in which the function involved is supported.

Setting up and shutting down connections on sockets

Function

Description

See

INET

INET6

ISO

socket()

Create socket

"socket() - create socket"

x

x

x

bind()

Assign a name to a socket

"bind() - assign a socket a name"

x

x

x

connect()

Initiate communication on a socket
(e.g. by a client)

"connect() - initiate a connection on a socket"

x

x

x

listen()

Test socket for pending connections
(e.g. by a server)

"listen() - test a socket for pending connections"

x

x

x

accept()

Accept connection on a socket
(e.g. by a server)

"accept() - accept a connection on a socket"

x

x

x

shutdown()

Shut down connection in read and/or write direction

"shutdown() - terminate full-duplex connection"

x

x


soc_close()

Close socket

"soc_close() (close) - close socket"

x

x

x

Transferring data between two sockets

Function

Description

See

INET

INET6

ISO

soc_read(),
soc_readv()

Receive a message from a socket via an established connection

"soc_read(), soc_readv() (read, readv) - receive a message from a socket"

x

x

x

recv()

Receive a message from a socket via an established connection

"recv(), recvfrom() - receive a message from a socket"

x

x

x

recvfrom()

Receive a message from a socket

"recv(), recvfrom() - receive a message from a socket"

x

x

x

recvmsg()

Receive a message from a socket.
AF_ISO: Receive messages (user data or connection data) via an established connection

"recvmsg() - receive a message from a socket"

x

x

x

send()

Send a message from socket to socket via an established connection

"send(), sendto() - send a message from socket to socket"

x

x

x

sendto()

Send a message from socket to socket

"send(), sendto() - send a message from socket to socket"

x

x

x

sendmsg()

Send a message from socket to socket.
AF_ISO: Send messages (user data or connection data) via an established connection

"sendmsg() - send a message from socket to socket"

x

x

x

soc_write(),
soc_writev()

Send a message from socket to socket via an established connection

"soc_write(), soc_writev() (write, writev) - send a message from socket to socket"

x

x

x

select()

Multiplex input/output

"select() - multiplex input/output"

x

x

x

soc_poll()

Multiplex input/output

"soc_poll() - multiplex input/output"

x

x

x

Transmitting data from/to the socket buffer

Function

Description

See

INET

INET6

ISO

soc_getc()

Get character from socket buffer

"soc_getc() (getc) - get character from input buffer"

x

x


soc_gets()

Get string from socket buffer

"soc_gets() (gets) - get string from input buffer"

x

x


soc_putc()

Put character in socket buffer

"soc_putc() (putc) - put character in output buffer"

x

x


soc_puts()

Put string in socket buffer

"soc_puts() (puts) - put string in output buffer"

x

x


soc_flush()

Flush socket buffer

"soc_flush () (flush) - flush data from output buffer"

x

x


Receiving information about sockets

Function

Description

See

INET

INET6

ISO

getdtablesize()

Get size of descriptor table

"getdtablesize() - get size of descriptor table"

x

x

x

getsockopt()

Get socket options

"getsockopt(), setsockopt() - get and set socket options"

x

x

x

setsockopt()

Set socket options

"getsockopt(), setsockopt() - get and set socket options"

x

x

x

getpeername()

Get name of communications partner

"getpeername() - get the remote address of the socket connection"

x

x

x

getsockname()

Get name of socket

"getsockname() - get local address of the socket connection"

x

x

x

Testing configuration values

Function

Description

See

INET

INET6

ISO

getaddrinfo()

Get IP address and port number corresponding to a host and/or service name

"getaddrinfo() - get information about host names, host addresses and services regardless of protocol"

x

x


gai_strerror()

Get description of a getaddrinfo() error code

"gai_strerror() - output text for the error code of getaddrinfo()"

x

x


getbcamhost()

Get name of BCAM host

"getbcamhost() - get BCAM host name"



x

gethostname()

Get socket host name of current host

"gethostname() - get the name of the current host"

x

x

x

gethostbyaddr()

Get host name belonging to an IPv4 address

"gethostbyaddr(), gethostbyname() - get information about host names and addresses"

x



gethostbyname()

Get IPv4 address belonging to a host name

"gethostbyaddr(), gethostbyname() - get information about host names and addresses"

x



getipnodebyaddr()

Get host name belonging to an IPv4 or IPv6 address

"getipnodebyaddr(), getipnodebyname() - get information about host names and addresses"

x

x


getipnodebyname()

Get IPv4 or IPv6 address belonging to a host name

"getipnodebyaddr(), getipnodebyname() - get information about host names and addresses"

x

x


getnameinfo()

Get host and service name corresponding to IP address and port number

"getnameinfo() - get the name of the communications partner"

x

x


getservbyport()

Get name of a service

"getservbyname(), getservbyport() - get information about services"

x

x


getservbyname()

Get port number of a service

"getservbyname(), getservbyport() - get information about services"

x

x


getprotobyname()

Get number of a protocol

"getprotobyname() - get the number of the protocol"

x

x


if_nameindex()

List with interface names and index of local host

"if_nameindex() - list of interface names with the associated interface indexes"

x

x


Manipulating Internet address

Function

Description

See

INET

INET6

ISO

inet_addr()

Convert character string from dotted notation to integer value (Internet address)

"inet_addr(), inet_lnaof(), inet_makeaddr(), inet_netof(), inet_network(), inet_ntoa() - manipulate IPv4 Internet address"

x



inet_network()

Convert character string from dotted notation to integer value (subnetwork section)

"inet_addr(), inet_lnaof(), inet_makeaddr(), inet_netof(), inet_network(), inet_ntoa() - manipulate IPv4 Internet address"

x



inet_makeaddr()

Create Internet address from subnetwork section and subnetwork local address section

"inet_addr(), inet_lnaof(), inet_makeaddr(), inet_netof(), inet_network(), inet_ntoa() - manipulate IPv4 Internet address"

x



inet_lnaof()

Extract local network address in byte order of host from Internet host address

"inet_addr(), inet_lnaof(), inet_makeaddr(), inet_netof(), inet_network(), inet_ntoa() - manipulate IPv4 Internet address"

x



inet_netof()

Extract network number in byte order of host from Internet host address

"inet_addr(), inet_lnaof(), inet_makeaddr(), inet_netof(), inet_network(), inet_ntoa() - manipulate IPv4 Internet address"

x



inet_ntoa()

Convert Internet host address into a string conforming to normal Internet dotted notation

"inet_addr(), inet_lnaof(), inet_makeaddr(), inet_netof(), inet_network(), inet_ntoa() - manipulate IPv4 Internet address"

x



inet_pton()

Converts

  • an IPv4 address in decimal dotted notation or

  • and IPv6 address in hexadecimal colon notation

to the corresponding binary address.

"inet_ntop(), inet_pton() - manipulate Internet addresses"

x

x


inet_ntop()

Converts a binary IPv4 or IPv6 address to the corresponding

  • IPv4 address in decimal dotted notation or

  • IPv6 address in hexadecimal colon notation.

"inet_ntop(), inet_pton() - manipulate Internet addresses"

x

x


Utility functions

Function

Description

See

INET

INET6

ISO

freeaddrinfo()

Release memory area for addrinfo structure requested by the getaddrinfo() function.

"freeaddrinfo() - release memory for addrinfo structure"

x

x


freehostent()

Release memory area for hostent structure requested by the getipnodebyaddr() and getipnodebyname() functions.

"freehostent() - release memory for hostent structure"

x

x


if_freenameindex()

Release memory area for array with if_nameindex() structure(s) requested by the if_nameindex() function.

"if_freenameindex() - release the dynamic storage occupied with if_nameindex()"

x

x


htonl()

32 bit fields
convert from host to network byte order

"Byte order macros - convert byte order"

x



htons()

16 bit fields
convert from host to network byte order

"Byte order macros - convert byte order"

x

x


if_indextoname()

Determine name corresponding to the index

"if_indextoname() - convert interface index to interface name"

x

x


if_nametoindex()

Determine name corresponding to the index

"if_nametoindex() - convert interface name to interface index"

x

x


ntohl()

32 bit fields
convert from network to host byte order

"Byte order macros - convert byte order"

x



ntohs()

16 bit fields
convert from network to host byte order

"Byte order macros - convert byte order"

x

x


Control functions

Function

Description

See

INET

INET6

ISO

soc_ioctl()

Control sockets

"soc_ioctl() (ioctl) - control sockets"

x

x

x

soc_wake()

Awaken a task waiting with select() or soc_poll()

"soc_wake() - awaken a task waiting with select() or soc-poll()"

x

x

x

Test macros for AF_INET6

The following test macros are defined in <netinet.in.h>:

Macro

Test

IN6_IS_ADDR_UNSPECIFIED

address = 0 ?

IN6_IS_ADDR_LOOPBACK

address = loopback ?

IN6_IS_ADDR_LINKLOCAL

address = IPv6 - LINKLOCAL ?

IN6_IS_ADDR_SITELOCAL

address = IPv6 - SITELOCAL ?

IN6_ADDR_V4COMPAT

address = IPv4-compatible ?

IN6_ADDR_V4MAPPED

address = IPv4-mapped

IN6_ARE_ADDR_EQUAL

address1 = address2 ?