Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ bind(2w) — DECnet WAN Support 3.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

socket(2w)

close(2w)

bind(2w)  —  System Calls

NAME

bind − Bind a WDD Line name to a socket

SYNTAX

 
#include <sys/types.h>
#include <sys/socket.h>
#include <wdd/wandd_proto.h>
#include <wdd/wda_var.h>

bind (s, name, namelen)
int s;
struct sockaddr_wda name;
int namelen;
 

DESCRIPTION

The bind() system call binds a Line name to a socket. This system call reserves the line for exclusive use by one client. Thus, no other client will be able to use the line until a close() system call is issued on that socket. This system call initializes the line and enables it for data transfer.

All parameters must be defined in the bind() system call.

The bind system call allows the following parameters to be set:

Protocol Framing Type
specifies the type of framing the device adds to data before transmitting it and the type of framing the device assumes is added to received data. The permissible framing type options are provided in the DEC WAN Device Drivers for Digital UNIX Application Programmer’s Guide.  There is no default value. 

Error Check Type
specifies the type of checksum the device uses when framing data to be transmitted, and when checking received data. The permissible options for the error check type are provided in the DEC WAN Device Drivers for Digital UNIX Application Programmer’s Guide.  There is no default value. 

Receive Buffer Size
specifies the maximum allowable size for received data packets.  The value to be specified should range between 64 and 8192 bytes. However, it is recommended that a maximum value no higher than 4096 is used due to the limitations of the 16 bit CRC.  The default value is device dependent and selected if a value of 0 is specified.

Idle Mode specifies if the line should remain ’marked’ as being idle when the line is in an idle state, or if it should transmit the flag character. 

Station Type
specifies if this is a primary or secondary station. On multi-drop (multi-point) WANs, one station controls access to the WAN. This station is referred to as the primary station.  All other stations controlled by the primary station are referred to as secondary stations.  Set this parameter to true if this end of the link is the primary station and false if it is a secondary station. 

Flag Count (Synch Count)
specifies the number of synchronising characters (either flags or marks) to be transmitted between frames.

Station Address
specifies the station address. Address 2 is used only in extended addressing mode.

Line Name
The Modem Connect Line name identifying which line on which device is to be used (null terminated string).  The name specified must correspond to that set up by the Network Manager.  The Modem Connect Line must be enabled prior to performing the bind() system call.
 

ARGUMENTS

Input Arguments

s specifies the value returned by the socket() system call

name specifies the sockaddr_wda structure containing the name of the Modem Connect Line which the socket is to be bound to, and the parameters mentioned above. 

namelen specifies the size of the sockaddr_wda data structure. 
 

RETURN VALUE

The return value is 0 if the call is successful. Otherwise, -1 is returned and the global variable errno is set to indicate the error.
 

DIAGNOSTICS

[ENODEV] The Modem Connect line does not exist

[EISCONN] Successful bind() call already made by this socket

[EADDRNOTAVAIL] Another WDA socket has already made a successful bind() system call to the requested line

[ECONNREFUSED] Device microcode is not loaded

[EADDRINUSE] Line in use by another user

[ENOMEM] Couldn’t allocate memory

[EINVAL] Invalid argument, for example, receive buffer size is greater than the maximum. 

[ENODEV] Line entity does not exist

[ENOBUFS] No memory available for device command packets

[EINPROGRESS] Controller not yet ready

SEE ALSO

socket(2w), close(2w)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026