Wide Area Network Interface (WAN)
Description: OpenSS7 Project Manual Pages Operating System
WAN
Section: Wide Area Network (WAN) (7)
Updated: 2008-10-31
Index
Return to Main Contents
NAME
WAN, wan
- Spider Wide Area Network (WAN) Interface
SYNOPSIS
#include <errno.h>
#include <sys/types.h>
#include <sys/stropts.h>
#include <stdint.h>
#include <netx25/wan_proto.h>
#include <netx25/wan_control.h>
#include <sys/snet/wan_proto.h>
#include <sys/snet/wan_control.h>
DESCRIPTION
The Spider Wide Area Newtork (WAN) interface[1, 2],
is a service primitive interface to the WAN driver layer developed by Spider
Systems, Ltd. (now part of Emerson Power) for use by applications in
controlling WAN drivers, interface hardware and protocol software. The
service primitive interface was widely used on VxWorks, other embedded RTOS,
AIXlink/X.25[3],
Sun Microsystems SunLink starting with version 8.0 and Solstice X.25[4],
HP-UX X.25[5],
IRIS SX.25[6],
PT X.25[7],
SBE X.25[8],
RadiSys WAN[9],
and other mainstream UNIX operating systems and embedded systems for
communications.
The interface is not provided as a programming library, as is XTI, but as
defined service primitives to be exchanged with the WAN driver using standard
STREAMS
getpmsg(2s)
and
putpmsg(2s)
system calls. Although a user level library could be easily constructed from
these service primitives, in the same way that XTI was built from TPI, it does
not seem to have happened and applications appear to have wound up using the
WAN interface directly.
OpenSS7 X.25 Networking
and other OpenSS7 applications, drivers and modules provide primarily a
Communications Device Interface (CDI)[10],
cdi(7),
for devices at this level; however, a compatibility module,
s_wan(4),
is provided to convert between CDI and the SpiderWAN interface for the
purposes of porting SpiderWAN compatible applications, drivers and modules to
Linux.
PRIMITIVES
Declarations of structures and symbolic constants necessary for this service
interface are contained in the
/usr/include/strx25/sys/wan_proto.h
header file.
The SpiderWAN (source) compatible service primitive interface is as follows:
The WAN_primitives union, a union containing all of the WAN primitives,
is formatted as follows:
union WAN_primitives {
uint8_t wan_type;
struct wan_sid wsid;
struct wan_reg wreg;
struct wan_ctl wctl;
struct wan_msg wmsg;
};
- wan_type
- The type of the strucutre contained in the union. This field can have values:
WAN_SID, WAN_REG, WAN_CTL, or WAN_DAT.
- wsid
- The structure of the primitive when wan_type is WAN_SID.
- wreg
- The structure of the primitive when wan_type is WAN_REG.
- wctl
- The structure of the primitive when wan_type is WAN_CTL.
- wmsg
- The structure of the primitive when wan_type is WAN_DAT.
These primtive types are described in detail in the subsections that follow.
WAN_SID
Requests that the WAN driver assign the specified subnetwork identifier to the
Stream and associate the Stream with the underlying device identified by the
subnetwork identifier.
This primitive is equivalent to the
CD_ATTACH_REQ(7)
primitive of the
cdi(7).
struct wan_sid {
uint8_t wan_type;
uint8_t wan_spare[3];
uint32_t wan_snid;
};
- wan_type
- Always WAN_SID.
- wan_spare
- Spare bytes for alignment, ignored by responder and set to zero by initiator.
- wan_snid
- Conveys the subnetwork identifier.
Equivalent to the Physical Point of Attachment (PPA) of the WAN interface.
Should an error condition occur, an
M_ERROR(9)
message is sent upstream with an appropriate error code, resulting in the
failure of all system calls on the Stream until closed.
The WAN_SID primitive may fail when:
- [ENODEV]
- The specified wan_snid is unknown or invalid.
- [EINVAL]
- The M_PROTO(9) message block is of an incorrect length for the
primitive.
- [EEXIST]
- The wan_snid specified is in use by another Stream.
- [ERANGE]
- The wan_snid member contains invalid information.
- [EBUSY]
- The a physical channel referenced by the wan_snid is in use by another
Stream.
- [ENOSR]
- The s_wan module, or underlying CDI driver lacks the STREAMS resources
necessary to satisfy the request.
- [EIO]
- The WAN_SID primitive was issued from an incorrect state for the
subnetwork entity.
- [ENXIO]
- The underlying device driver has encountered a fatal error.
WAN_REG
Registers the subnetwork identifier specified in the wan_snid field of
the primitive. Once a subnetwork entity has been registered, it cannot be
tuned or otherwise altered unless disabled with W_DISABLE. This
primitive is used by management applications to place subnetwork entities into
service.
struct wan_reg {
uint8_t wan_type;
uint8_t wan_spare[3];
uint32_t wan_snid;
};
- wan_type
- Always WAN_REG.
- wan_spare
- Spare bytes for alignment, ignored by responder and set to zero by initiator.
- wan_snid
- Conveys the subnetwork identifier.
Should an error condition occur, an
M_ERROR(9)
message is sent upstream with an appropriate error code, resulting in the
failure of all system calls on the Stream until closed.
The WAN_REG primitive may fail when:
- [ENODEV]
- The specified wan_snid is unknown or invalid.
- [EINVAL]
- The M_PROTO(9) message block is of an incorrect length for the
primitive.
- [EXDEV]
- There exists a hardware configuraiton errorr for the specified wan_snid.
- [EBUSY]
- The a physical channel referenced by the wan_snid is alread activated.
- [EIO]
- The WAN_REG primitive was issued from an incorrect state for the
subnetwork entity.
- [ENXIO]
- The underlying device driver has encountered a fatal error.
- [ENOMEM]
- There was insufficient memory immediately available to register the subnetwork
entity.
- [E2BIG]
- The maximum receive buffer size is too small to hold the largest frame
required by the device.
WAN_CTL
The primitive class consists of four primitives used to enable or disable the
WAN interface. These primitives are equivalent to the
CD_ENABLE_REQ(7),
CD_ENABLE_CON(7),
CD_DISABLE_REQ(7),
CD_DISABLE_CON(7)
and
CD_ERROR_IND(7)
primitives of the
cdi(7).
The
M_PROTO(9)
message block is structured as follows:
struct wan_ctl {
uint8_t wan_type;
uint8_t wan_command;
uint8_t wan_remtype;
uint8_t wan_remsize;
uint8_t wan_remaddr[20];
uint8_t wan_status;
uint8_t wan_diag;
};
- wan_type
- Always WAN_CTL.
- wan_command
- Conveys the WAN command. This may be one of the following values:
-
- WC_CONNECT
- This command is valid when sent from the WAN user to the WAN provider; or from
the WAN provider to the WAN user.
-
When sent from the WAN user, the primitive corresponds to the
CD_ENABLE_REQ(7)
primitive of the
cdi(7).
When sent from the WAN provider, the primitive
has no corresponding primitive in the
cdi(7).
Fields wan_remtype, wan_remsize and wan_remaddr are
significant, wan_status and wan_diag are ignored.
- WC_CONCNF
- This command is valid when sent from the WAN provider to the WAN user; or from
the WAN user to the WAN provider.
-
When sent from the WAN provider, the primitive corresponds to the
CD_ENABLE_CON(7)
primitive of the
cdi(7).
When sent from the WAN user, the primitive has no corresponding primitive in
the
cdi(7).
Fields wan_status and wan_diag are significant, wan_remtype,
wan_remsize and wan_remaddr are ignored.
- WC_DISC
- This command is valid when sent from the WAN user to the WAN provider; or from
the WAN provider to the WAN user.
-
When sent from the WAN user to the WAN provider, the primitive corresponds to
the
CD_DISABLE_REQ(7)
primtiive of the
cdi(7).
When sent from the WAN provider to the WAN user, the primitive corresponds to
the
CD_ERROR_IND(7)
primitive of the
cdi(7).
All fields are ignored.
- WC_DISCCNF
- This command is valid when sent from the WAN provider to the WAN user; or from
the WAN user to the WAN provider.
-
When sent from the WAN provider to the WAN user, this primitive corresponds to
the
CD_DISABLE_CON(7)
primitive of the
cdi(7).
When sent from the WAN user to the WAN provider, this primitive has no
corresponding primitive in the
cdi(7).
Fields wan_status and wan_diag are significant, wan_remtype,
wan_remsize and wan_remaddr are ignored.
- wan_remtype
- When significant, conveys the type of the remote address. This field may have
one of the following values:
-
- WAN_TYPE_ASC
- The remote address contained in the wan_remaddr field consists of ASCII
characters and the length field, wan_remsize, conveys the length of the
ASCII address in characters (octets).
- WAN_TYPE_BCD
- The remote address contained in the wan_remaddr field consists of BCD
encoded digits and the length field, wan_remsize, conveys the length of
the BCD address in digits (semi-octets).
This field is only significant in the WAN_CONNECT primitive.
- wan_remsize
- When significant, conveys the size of the remote address field,
wan_remaddr, in digits. Depending on the value of the wan_remtype
field, this may either be octets or semi-octets.
This field is only significant in the WAN_CONNECT primitive.
- wan_remaddr
- When significant, conveys the remote address. The address contained in this
field is either represented as ASCII digits or BCD encoded digits, depending on
the value of the wan_remtype field.
This field is only significant in the WAN_CONNECT primitive.
- wan_status
- When significant, provides the status for the WC_CONCNF or
WC_DISCCNF command. This field can have one of the following values:
-
- WAN_FAIL
- The preceding WC_CONNECT or WC_DISC command was unsuccessful. The
link remains disconnected or connected as the case may be.
- WAN_SUCCESS
- The preceding WC_CONNECT or WC_DISC command was successful. The
link moves to the connected or disconnected state as the case may be.
This field is only significant in the WC_CONCNF and WC_DISCCNF
primitives.
- wan_diag
- When significant and the status field is WAN_FAIL, provides diagnostic
information concerning the failure.
This field is only significant in the WC_CONCNF and WC_DISCCNF
primitives when failure is indicated.
Should an error condition occur, an
M_ERROR(9)
message is sent upstream with an appropriate error code, resulting in the
failure of all system calls on the Stream until closed.
The WAN_CTL primitive may fail when:
-
- [EINVAL]
-
- The M_PROTO(9) message block is of an incorrect length for the
primitive, or the wan_command is invalid.
- [ENXIO]
- The underlying device driver has encountered a fatal error.
- [EIO]
- The WAN_CTL primitive was issued from an incorrect state for the
subnetwork entity.
- [E2BIG]
- The maximum receive buffer size is too small to hold the largest frame
required by the device.
WAN_DAT
This primitive class provides two primitives for the transfer of data across
the service interface. Attached
M_DATA(9)
message blocks contain user data.
These primitives are equivalent to the
CD_UNITDATA_REQ(7) and CD_UNITDATA_IND(7)
primitives of the
cdi(7).
The
M_PROTO(9)
message block is structured as follows:
struct wan_msg {
uint8_t wan_type;
uint8_t wan_command;
};
- wan_type
- Always WAN_DAT.
- wan_command
- Conveys the WAN command. This may be one of the following values:
-
- WC_TX
- Specifies that the user data in the associated
M_DATA(9)
message block consists of data for transmission.
This primitive is equivalent to the
CD_UNITDATA_REQ(7)
primitive of the
cdi(7).
This primitive is issued by the WAN interface user.
- WC_RX
- Indicates that the user data in the associated
M_DATA(9)
message block consists of received data.
This primitive is equivalent to the
CD_UNITDATA_IND(7)
primitive of the
cdi(7).
This primitive is issued by the WAN interface provider.
Should an error condition occur, an
M_ERROR(9)
message is sent upstream with an appropriate error code, resulting in the
failure of all system calls on the Stream until closed.
The WAN_DAT primitive may fail when:
-
- [EINVAL]
-
- The M_PROTO(9) message block is of an incorrect length for the
primitive.
- [ENXIO]
- The underlying device driver has encountered a fatal error.
- [EIO]
- The WAN_DAT primitive was issued from an incorrect state for the
subnetwork entity.
- [E2BIG]
- The maximum receive buffer size is too small to hold the largest frame
required by the device.
WAN_NOTIFY
This primitive coresponds to the
CD_MODEM_SIG_IND(7)
and
CD_ERROR_IND(7)
primitives of the
cdi(7).
struct wan_nty {
uint8_t wan_type;
uint8_t wan_spare[3];
uint32_t wan_snid;
uint32_t wan_eventstat;
uint32_t wan_reserved[2];
};
- wan_type
- Always WAN_NOTIFY.
- wan_spare
- Spare bytes for alignment, ignored by responder and set to zero by initiator.
- wan_snid
- Conveys the subnetwork identifier.
Equivalent to the Physical Point of Attachment (PPA) of the WAN interface.
- wan_eventstat
- This member contains one of the following bit masks:
-
- W_RECEIVE_BUFFER_OVFL
- W_FRAMING_ERROR
- W_TIMEOUT
- W_HD_OVERRUN
- W_ATTACHED_DEV_INACT
- W_ATTACHED_DEV_ACTIVE
- W_FCS_ERR
- W_CTS_ON
- W_CTS_OFF
- W_DCD_ON
- W_DCD_OFF
- W_DSR_ON
- W_DSR_OFF
- W_RI_ON
- W_RI_OFF
- W_PARITY_ERROR
- W_BREAK_DETECTED
- W_SHORT_FRAME
- W_TX_UNDERRUN
- W_ABORT
- W_RCL_NOTZERO
- W_BSC_PAD_ERR
- W_CTS_UNDERRUN
- wan_reserved
- Reserved for future use.
STRUCTURES
The /usr/include/strx25/sys/wan_control.h header file defines a
number of structures, pointers to which are used as aguments to input-output
controls. These structures fall into four classes, identified by the value of
the first byte of the structure, as follows:
- WAN_STATS
- A wan_stioc structure that identifies the subnetwork and contains the
state and statistics associated with the subnetwork.
Used with the W_ZEROSTATS and W_GETSTATS input-output controls.
- WAN_TUNE
- A wan_tnioc structure that identifies the subnetwork and contains the
tunable parameters associated with the subnetwork.
Used with the W_SETTUNE and W_GETTUNE input-output controls.
- WAN_MAP
- A wanmapgf, wanmappf, of wanmapdf structure that identifies
the mapping entries, mapping entry or subnetwork, respectively.
Used with the W_GETWANMAP, W_PUTWANMAP and W_DELWANMAP
input-output controls, respectively.
- WAN_PLAIN
- A wan_hdioc structure that identifiers the subnetwork.
Used with the W_STATUS, W_ENABLE and W_DISABLE input-output
controls.
- WAN_SETSIG
- A wan_setsigf structure that identifies the subnetwork and contains the
setting for leads associated with the subnetwork.
Used with the W_SETSIG and W_GETSIG input-output controls.
These structures are described in detail in the subsections that follow.
WAN_STATS
The value of WAN_STATS in the w_type field of the structure
pointed to by the input-output control argument specifies that the pointed-to
structure is a wan_stioc structure. This structure is used by the
W_ZEROSTATS and W_GETSTATS input-output controls.
The wan_stioc structure is formatted as follows:
struct wan_stioc {
uint8_t w_type;
uint8_t w_state;
uint8_t w_spare[2];
uint32_t w_snid;
hdlcstats_t hdlc_stats;
};
The wan_stioc structure contains the following members:
- w_type
- Specifies the type of the structure associated with the input-output control.
Always WAN_STATS.
- w_state
- Returns the state of the subnetwork entity. This member may have one of the
following values:
-
- HDLC_IDLE
- The raw HDLC connection is idle.
- HDLC_ESTB
- The raw HDLC connection is established.
- HDLC_DISABLED
- The raw HDLC connection is disabled.
- HDLC_CONN
- The raw HDLC connection is connecting.
- HDLC_DISC
- The raw HDLC connection is disconnecting.
- w_spare
- Spare bytes for alignment: set to zero (0) by issuer and ignored by responder.
- w_snid
- Specifies the subnetwork identifier. Equivalent to the CDI Physical Point of
Attachment (PPA).
- hldc_stats
- Contains the hdlcstats_t structure described below.
The hdlcstats_t structure is formatted as follows:
typedef struct hstats {
uint32_t hc_txgood;
uint32_t hc_txurun;
uint32_t hc_rxgood;
uint32_t hc_rxorun;
uint32_t hc_rxcrc;
uint32_t hc_rxnobuf;
uint32_t hc_rxnflow;
uint32_t hc_rxoflow;
uint32_t hc_rxabort;
uint32_t hc_intframes;
} hdlcstats_t;
The hdlcstats_t structure contains the following members, each
reflecting a count since the last reset:
- hc_txgood
- Number of good frames transmitted.
- hc_txurun
- Number of transmitter underruns.
- hc_rxgood
- Number of good frames received.
- hc_rxorun
- Number of receiver overruns.
- hc_rxcrc
- Number of receiver CRC or framing errors.
- hc_rxnobuf
- Number of receive buffer overflows.
- hc_rxnflow
- Number of received frames with no flow control.
- hc_rxoflow
- Number of receiver buffer overflows.
- hc_rxabort
- Number of received aborts.
- hc_intframes
- Number of frames failed to be transmitted by the loss of modem signals or other phsyical medium error.
WAN_TUNE
The value of WAN_TUNE in the w_type field of the structure pointed
to by the input-output control argument specifies that the pointed-to
structure is a wan_tnioc structure. This structure is used by the
W_SETTUNE and W_GETTUNE input-output controls.
The wan_tnioc structure is formatted as follows:
struct wan_tnioc {
uint8_t w_type;
uint8_t w_spare[3];
uint32_t w_snid;
wantune_t wan_tune;
};
The wan_tnioc structure contains the following members:
- w_type
- Specifies the type of the structure associated with the input-output control.
Always WAN_TUNE.
- w_spare
- Spare bytes for alignment: set to zero (0) by issuer and ignored by responder.
- w_snid
- Specifies the subnetwork identifier. Equivalent to the CDI Physical Point of
Attachment (PPA).
- wan_tune
- Contains the wantune_t structure described below.
The wantune_t structure is formatted as follows:
typedef struct {
uint16_t WAN_options;
uint16_t WAN_pad;
struct WAN_hddef WAN_hd;
} wantune_t;
The wantune_t structure contains the following members:
- WAN_options
- Specifies a number of WAN options associated with the device. This member is
a bitwise OR of zero or more of the following values:
-
- TRANSLATE
- When set, indicates that a translation using the WAN remote address to
interface address mapping function is to be performed.
- WAN_pad
- Padding for alignment, set to zero by issuer and ignored by responder.
- WAN_hd
- Contains the WAN_hddef structure described below.
The WAN_hddef structure is formatted as follows:
struct WAN_hddef {
uint32_t WAN_baud;
uint16_t WAN_maxframe;
uint16_t WAN_interface;
union {
uint16_t WAN_cptype;
struct WAN_x21 WAN_x21def;
struct WAN_v25 WAN_v25def;
} WAN_cpdef;
};
The WAN_hddef structure contains the following members:
- WAN_baud
- Conveys the transmission rate in bits per second.
- WAN_maxframe
- Conveys the maximum frame size in octets.
- WAN_interface
- This member specifies the WAN interface. It can assume one of the following
values:
-
- WAN_X21
- The interface is an X.21 interface.
- WAN_V28
- The interface is an V.28 interface.
- WAN_V35
- The interface is an V.35 interface.
- WAN_V36
- The interface is an V.36 interface.
- WAN_RS232
- The interface is an RS-232 interface.
- WAN_RS422
- The interface is an RS-422 interface.
- WAN_T1E1
- The interface is a G.703/G.704 interface.
- WAN_ATM
- The interface is an ATM interface.
- WAN_cpdef
- This member defines a number of alternate call procedural definitions
described by a union. The union contains the following members:
-
- WAN_cptype
- Specifies the type of the call procedural definitions.
Always WAN_NONE, WAN_X21P, or WAN_V25bis.
When WAN_cptype is WAN_NONE, only this member of the union is
significant.
- WAN_x21def
- When WAN_cptype is WAN_X21P, this member of the union is
significant.
This member contains the WAN_x21 structure described below.
- WAN_v25def
- When WAN_cptype is WAN_V25bis, this member of the union is
significant.
This member contains the WAN_v25 structure described below.
The WAN_x21 structure is formatted as follows:
struct WAN_x21 {
uint16_t WAN_cptype;
uint16_t T1;
uint16_t T2;
uint16_t T3A;
uint16_t T4B;
uint16_t T5;
uint16_t T6;
};
The WAN_x21 structure contains the following members:
- WAN_cptype
- Specifies the type of the call procedural definitions.
Always WAN_X21P.
- T1
- The timeout for the call request state in deciseconds.
- T2
- The timeout for the EOS to data transfer in deciseconds.
- T3A
- The timeout for call progress signals in deciseconds.
- T4B
- The timeout for DCE provided information in deciseconds.
- T5
- The timeout for DTE clear request in deciseconds.
- T6
- The timeout for DTE clear confirm state in deciseconds.
The WAN_v25 structure is formatted as follows:
struct WAN_v25 {
uint16_t WAN_cptype;
uint16_t callreq;
};
The WAN_v25 structure contains the following members:
- WAN_cptype
- Specifies the type of the call procedural definitions.
Always WAN_V25bis.
- callreq
- Contains the abort time (in deciseconds) for the call request command if the
network does not support CFI.
WAN_MAP
The value of WAN_MAP in the w_type field of the structure pointed
to by the input-output control argument specifies that the pointed-to
structure is a wanmapgf, wanmappf or wanmapdf structure.
These structures are used by the W_GETWANMAP, W_PUTWANMAP and
W_DELWANMAP input-output controls, respectively.
The wanmapgf structure is formatted as follows:
struct wanmapgf {
uint8_t w_type;
uint8_t w_spare[3];
uint32_t w_snid;
wanget_t wan_ents;
};
The wanmapgf structure contains the following members:
- w_type
- Specifies the type of the structure associated with the input-output control.
Always WAN_MAP.
- w_spare
- Spare bytes for alignment: set to zero (0) by issuer and ignored by responder.
- w_snid
- Specifies the subnetwork identifier. Equivalent to the CDI Physical Point of
Attachment (PPA).
- wan_ents
- Contains the wanget_t structure described below.
The wanget_t structure is formatted as follows:
typedef struct {
uint16_t first_ent;
uint16_t num_ent;
wanmap_t entries[0];
} wanget_t;
The wanget_t structure contains the following members:
- first_ent
- Specifies the index of the first entry in the entries member.
- num_ent
- Specifies the number of entries in the entries member.
- entries
- Contains num_ent entries of wanmap_t structures. The
wanmap_t structure is described below.
The wanmappf structure is formatted as follows:
struct wanmappf {
uint8_t w_type;
uint8_t w_spare[3];
uint32_t w_snid;
wanmap_t wan_ent;
};
The wanmappf structure contains the following members:
- w_type
- Specifies the type of the structure associated with the input-output control.
Always WAN_MAP.
- w_spare
- Spare bytes for alignment: set to zero (0) by issuer and ignored by responder.
- w_snid
- Specifies the subnetwork identifier. Equivalent to the CDI Physical Point of
Attachment (PPA).
- wan_ent
- Contains the wanmap_t structure described below.
The wanmap_t structure is formatted as follows:
typedef struct {
uint8_t remsize;
uint8_t remaddr[20];
uint8_t infsize;
uint8_t infaddr[30];
} wanmap_t;
The wanmap_t structure contains the following members:
- remsize
- Conveys the size of the remote address in octets.
- remaddr
- Contains the remote address, significant to remsize octets.
- infsize
- Conveys the size of the interface address in octets.
- infaddr
- Contains the interface address, significant to infsize octets.
The wanmapdf structure is formatted as follows:
struct wanmapdf {
uint8_t w_type;
uint8_t w_spare[3];
uint32_t w_snid;
};
The wanmapdf structure contains the following members:
- w_type
- Specifies the type of the structure associated with the input-output control.
Always WAN_MAP.
- w_spare
- Spare bytes for alignment: set to zero (0) by issuer and ignored by responder.
- w_snid
- Specifies the subnetwork identifier. Equivalent to the CDI Physical Point of
Attachment (PPA).
WAN_PLAIN
The value of WAN_PLAIN in the w_type field of the structure
pointed to by the input-output control argument specifies that the pointed-to
structure is a wan_hdioc structure. This structure is used by the
W_STATUS, W_ENABLE and W_DISABLE input-output controls.
The wan_hdioc structure is formatted as follows:
struct wan_hdioc {
uint8_t w_type;
uint8_t w_spare[3];
uint32_t w_snid;
};
The wan_hdioc structure contains the following members:
- w_type
- Specifies the type of the structure associated with the input-output control.
Always WAN_PLAIN.
- w_spare
- Spare bytes for alignment: set to zero (0) by issuer and ignored by responder.
- w_snid
- Specifies the subnetwork identifier. Equivalent to the CDI Physical Point of
Attachment (PPA).
WAN_SETSIG
The value of WAN_SETSIG in the w_type field of the structure
pointed to by the input-output control argument specifies that the pointed-to
structure is a wan_setsigf structure. This structure is used by the
W_SETSIG and W_GETSIG input-output controls.
The wan_setsigf structure is formatted a follows:
struct wan_setsigf {
uint8_t w_type;
uint8_t w_spare[3];
uint32_t w_snid;
wan_setsig_t wan_setsig;
};
The wan_setsigf structure containst the following members:
- w_type
- Specifies the type of the structure associated with the input-output control.
Always WAN_SETSIG.
- w_spare
- Spare bytes for alignment: set to zero (0) by issuer and ignored by responder.
- w_snid
- Specifies the subnetwork identifier. Equivalent to the CDI Physical Point of
Attachment (PPA).
- wan_setsig
- Contains the wan_setsig_t structure described below.
The wan_setsig_t structure is formatted as follows:
typedef struct {
uint8_t w_ctrlsignal;
uint8_t w_reserved[3];
} wan_setsig_t;
The wan_setsig_t structure contains the following members:
- w_ctrlsignal
- Contains the control signals. This can be a bitwise OR of zero or more of the
following:
-
- W_RTS_HIGH
- Set or indicate RTS high, (or X.21 C signal).
- W_DTR_HIGH
- Set or indicate DTR high.
- W_DCD_HIGH
- Indicate DCD high.
- W_DSR_HIGH
- Indicate DSR high.
- W_CTS_HIGH
- Indicate CTS high, (or X.21 I signal).
- W_RI_HIGH
- Indicate RI high.
- W_RTS_LOW
- Set RTS low.
- W_DTR_LOW
- Set DTR low.
- w_reserved
- Reserved field: set to zero (0) by issuer and ignored by responder.
IOCTLS
The /usr/include/strx25/sys/wan_control.h header file defines a
number of input-output controls, as follows:
- W_ZEROSTATS
- Zeroes the statistics associated with a subnetwork entity and collects the
statistics and state of the subnetwork prior to reset.
- W_GETSTATS
- Retrieves the statistisc associated with a subnetwork entity.
- W_SETTUNE
- Sets the tunable parameters associated with a subnetwork entity.
- W_GETTUNE
- Retrieves the tunable parameters associated with a subnetwork entity.
- W_PUTWANMAP
- Puts a remote address to interface address mapping entry.
- W_GETWANMAP
- Gets a block of remote address to interface address mapping entries.
- W_DELWANMAP
- Deletes all remote address to interface address mapping entries associated
with a subnetwork entity.
- W_STATUS
- Retrieve the status of a subnetwork entity.
- W_ENABLE
- Enables a subnetwork entity for data transfer.
- W_DISABLE
- Disables a subnetwork entity from data transfer.
These input-output controls are described in detail in the subsections that
follow.
W_ZEROSTATS
This input-output control takes an argument that is a pointer to a
wan_stioc structure.
It requests that the WAN driver reset the statistics associated with the
w_snid contained in the passed-in structure. The WAN driver is to reset
the the statistics, returning the statistics and state immediately before
reset in the hdlc_stats and w_state members of the provided
structure.
When successful, the input-output control operation returns zero (0).
In addition to the errors that may be returned by
ioctl(2)
and
streamio(7),
errors that may be returned by this input-output control are as follows:
- [ENODEV]
- The specified w_snid is unknown or invalid.
- [EINVAL]
- The size of the structure corresponding to the passed-in argument is incorrect
for the input-output control and w_type specified.
- [ENXIO]
- The underlying device has encountered a fatal error.
W_GETSTATS
This input-output control takes an argument that is a pointer to a
wan_stioc structure.
It requests that the WAN driver retrieve the statistics associated with the
w_snid contained in the passed-in structure. The WAN driver is to
retrieve the current statistics and state, returning them in hte
hdlc_stats and
w_state members of the provided structure.
When successful, the input-output control operation returns zero (0).
In addition to the errors that may be returned by
ioctl(2)
and
streamio(7),
errors that may be returned by this input-output control are as follows:
- [ENODEV]
- The specified w_snid is unknown or invalid.
- [EINVAL]
- The size of the structure corresponding to the passed-in argument is incorrect
for the input-output control and w_type specified.
- [ENXIO]
- The underlying device has encountered a fatal error.
W_SETTUNE
This input-output control takes an argument that is a pointer to a
wan_tnioc structure.
It requests that the WAN driver set the tunable parameters from the passed-in
structure for the
w_snid contained in that structure. The WAN driver is
to set the tunables, returning any negotiated values in the provided structure.
When successful, the input-output control operation returns zero (0).
In addition to the errors that may be returned by
ioctl(2)
and
streamio(7),
errors that may be returned by this input-output control are as follows:
- [ENODEV]
- The specified w_snid is unknown or invalid.
- [EINVAL]
- The size of the structure corresponding to the passed-in argument is incorrect
for the input-output control and w_type specified.
- [ENXIO]
- The underlying device has encountered a fatal error.
- [E2BIG]
- The specified WAN_maxframe is of insufficient size to hold the maximum
sized frame necessary for proper operation of the protocol.
- [ENOMEM]
- The WAN driver cannot allocate single message buffers of size
WAN_maxframe.
- [EIO]
- The interace is an a wrong state. For example, the tuning input-output
control was issued after the interface was already registered with the
WAN_REG primitive.
- [EXDEV]
- The WAN_interface does not match the capabilities or mode of the
hardware.
W_GETTUNE
This input-output control takes an argument that is a pointer to a
wan_tnioc structure.
It requests that the WAN driver get the tunable parameters associated with the
w_snid contained in the passed-in structure. The WAN driver is to
retrieve the tunable parameters and return them in the provided structure.
When successful, the input-output control operation returns zero (0).
In addition to the errors that may be returned by
ioctl(2)
and
streamio(7),
errors that may be returned by this input-output control are as follows:
- [ENODEV]
- The specified w_snid is unknown or invalid.
- [EINVAL]
- The size of the structure corresponding to the passed-in argument is incorrect
for the input-output control and w_type specified.
- [ENXIO]
- The underlying device has encountered a fatal error.
W_PUTWANMAP
This input-output control takes an argumnt that is a pointer to a
wanmappf structure.
It requests that the WAN driver add a remote address to interface address
mapping entry associated to the specified subnetwork identifier, w_snid.
When successful, the input-output control operation returns zero (0).
In addition to the errors that may be returned by
ioctl(2)
and
streamio(7),
errors that may be returned by this input-output control are as follows:
- [ENODEV]
- The specified w_snid is unknown or invalid.
- [EINVAL]
- The size of the structure corresponding to the passed-in argument is incorrect
for the input-output control and w_type specified.
- [ENXIO]
- The underlying device has encountered a fatal error.
W_GETWANMAP
This input-output control takes an argumnt that is a pointer to a
wanmapgf structure.
It requests that the WAN driver retrieve a block of remote address to
interface address mapping entries associated with the specified subnetwork
identifier, w_snid.
When successful, the input-output control operation returns zero (0).
In addition to the errors that may be returned by
ioctl(2)
and
streamio(7),
errors that may be returned by this input-output control are as follows:
- [ENODEV]
- The specified w_snid is unknown or invalid.
- [EINVAL]
- The size of the structure corresponding to the passed-in argument is incorrect
for the input-output control and w_type specified.
- [ENXIO]
- The underlying device has encountered a fatal error.
W_DELWANMAP
This input-output control takes an argumnt that is a pointer to a
wanmapdf structure.
It requests that the WAN driver delete all remote address to interface address
mapping entries associated with the specified subnetwork identifier,
w_snid.
When successful, the input-output control operation returns zero (0).
In addition to the errors that may be returned by
ioctl(2)
and
streamio(7),
errors that may be returned by this input-output control are as follows:
- [ENODEV]
- The specified w_snid is unknown or invalid.
- [EINVAL]
- The size of the structure corresponding to the passed-in argument is incorrect
for the input-output control and w_type specified.
- [ENXIO]
- The underlying device has encountered a fatal error.
W_STATUS
This input-output control takes an argument that is a pointer to a
wan_hdioc structure.
It requests that the WAN driver return the status of the w_snid
contained in the passed-in structure.
When successful, the input-output control operation returns zero (0) when the
associated w_snid is disabled, and one (1) when the associated
w_snid is enabled.
In addition to the errors that may be returned by
ioctl(2)
and
streamio(7),
errors that may be returned by this input-output control are as follows:
- [ENODEV]
- The specified w_snid is unknown or invalid.
- [EINVAL]
- The size of the structure corresponding to the passed-in argument is incorrect
for the input-output control and w_type specified.
- [ENXIO]
- The underlying device has encountered a fatal error.
W_ENABLE
This input-output control takes an argument that is a pointer to a
wan_hdioc structure.
It request that the WAN driver enable data transfer for the w_snid
contained in the passed-in structure.
When successful, the input-output control operation returns zero (0).
In addition to the errors that may be returned by
ioctl(2)
and
streamio(7),
errors that may be returned by this input-output control are as follows:
- [ENODEV]
- The specified w_snid is unknown or invalid.
- [EINVAL]
- The size of the structure corresponding to the passed-in argument is incorrect
for the input-output control and w_type specified.
- [ENXIO]
- The underlying device has encountered a fatal error.
- [EIO]
- The interface is in the wrong state.
W_DISABLE
This input-output control takes an argument that is a pointer to a
wan_hdioc structure.
It request that the WAN driver disable data transfer for the w_snid
contained in the passed-in structure.
When successful, the input-output control operation returns zero (0).
In addition to the errors that may be returned by
ioctl(2)
and
streamio(7),
errors that may be returned by this input-output control are as follows:
- [ENODEV]
- The specified w_snid is unknown or invalid.
- [EINVAL]
- The size of the structure corresponding to the passed-in argument is incorrect
for the input-output control and w_type specified.
- [ENXIO]
- The underlying device has encountered a fatal error.
- [EIO]
- The interface is in the wrong state.
W_SETSIG
This input-output control takes an argumnet that is a pointer to a
wan_setsigf structure.
It request that the WAN driver set the signals as specified.
This input-output control is equivalent to the
CD_MODEM_SIG_REQ(7)
primitive of
cdi(7).
When successful, the input-output control operation returns zero (0).
In addition to the errors that may be returned by
ioctl(2)
and
streamio(7),
errors that may be returned by this input-output control are as follows:
- [ENODEV]
- The specified w_snid is unknown or invalid.
- [EINVAL]
- The size of the structure corresponding to the passed-in argument is incorrect
for the input-output control and w_type specified.
- [ENXIO]
- The underlying device has encountered a fatal error.
- [EIO]
- The interface is in the wrong state.
W_GETSIG
This input-output control takes an argumnet that is a pointer to a
wan_setsigf structure.
It request that the WAN driver retrieve the current signals.
This input-output control is equivalent to the
CD_MODEM_SIG_POLL(7)
primitive of
cdi(7).
When successful, the input-output control operation returns zero (0).
In addition to the errors that may be returned by
ioctl(2)
and
streamio(7),
errors that may be returned by this input-output control are as follows:
- [ENODEV]
- The specified w_snid is unknown or invalid.
- [EINVAL]
- The size of the structure corresponding to the passed-in argument is incorrect
for the input-output control and w_type specified.
- [ENXIO]
- The underlying device has encountered a fatal error.
- [EIO]
- The interface is in the wrong state.
NOTICES
The Spider Wide Area Network (WAN) interface is a proprietary interface
without a formal standard (although its widespread use makes it an
ipso facto standard). The Communications Device Interface (CDI)[10],
cdi(7),
should be used in its stead.
BUGS
The
OpenSS7 X.25 Networking
implementation of the WAN interface has no known bugs.
SEE ALSO
getpmsg(2s),
putpmsg(2s),
wan(4),
s_cdi(4),
cdi(7),
STREAMS(9).
COMPATIBILITY
The
WAN
interface is compatible with SpiderWAN[1, 2],
and implementations based on SpiderWAN, such as
AIXlink/X.25[3],
HP-UX X.25[5],
IRIS SX.25[6],
Solstice X.25[4],
PT X.25[7],
SBE X.25[8],
RadiSys WAN[9],
and others, with the following portability considerations:
- ---
- Many implementations of SpiderWAN used under license have deviated from binary
compatibility with the original interface specifications, both in the form and
style of primitives and in the form of input-output controls supported[1, 2].
-
Many implementations also provide their own extensions to the interface which
are incompatible with all other implementations. May of these extensions are
purportedly in support of vendor-specific hardware, or systems.
OpenSS7 X.25 Networking
attempts to maintain source compatibilty with the core features provided
by most implementations, but compatibility with all features of all
implementations is not possible.
Your mileage may vary.
- ---
- OpenSS7 X.25 Networking
provides a core source compatible implementations of the SpiderWAN
interface for the purposes of porting legacy WAN applications, drivers and
modules to Linux with a minimal porting effort.
While source compatibility with core features is attempted, binary
compatibility is not attempted. Any binary compatibility experienced could be
broken in a subsequent release.
-
New applications should use the Communications Device Interface (CDI)[10],
cdi(7),
instead.
- ---
- For the wan_tnioc wan_tune member of type wantune_t:
ARTIC[9]
reversed the order of the WAN_baud and WAN_maxframe members
(presumably for 32-bit alignment); but, also added device specific
WAN_phy_if, WAN_loopback and WAN_split_chn members before
the union.
PT X.25[7]
renames the WAN_interface field to WAN_auto_enabled and gives the
field a different meaning.
Solstice X.25[11]
sets the type of the WAN_baud field to int instead of
uint32_t.
-
OpenSS7 X.25 Networking
does not accomodate any of these implementation-dependent changes.
For additional compatibility considerations, see
wan(4),
s_wan(4),
s_cdi(4),
cdi(7),
STREAMS(9).
CONFORMANCE
This interface conforms in its core features to the WAN interface as
documented in
AIXlink/X.25[3],
HP-UX X.25[5],
IRIS SX.25[6],
Solstice X.25[4],
PT X.25[7],
SBE X.25[8],
RadiSys WAN[9],
documentation.
HISTORY
The Wide Area Network interface first appeared in Spider[1, 2].
REFERENCES
- [1]
- SpiderX25,
SpiderX25 WAN Implementations Guide, Release 8.0, (Edinburgh), Spider Systems, Ltd., Spider.
- [2]
- SpiderISDN,
SpiderISDN WAN Implementations Guide, Release 4.0, (Edinburgh), Shiva Corporation, Spider.
- [3]
- AIXlink/X.25,
AIXlink/X.25 Version 2.1 for AIX: Guide and Reference, Eigth Edition, September 2005, (Boulder, Colorado), Internatonal Business Machines Corp., IBM.
[SC23-2520-07]
<http://publibn.boulder.ibm.com/>
- [4]
- Solstice® X.25,
Solstice® X.25 9.2 Programming Guide, October 1999, (Palo Alto, California), Sun Microsystems, Inc., Sun.
[Part No: 806-1235-10]
<http://docs-pdf.sun.com/>
- [5]
- HP-UX® 11i v2,
HP-UX 11i v2 Documentation, 2001, (Palo Alto, California), Hewlett-Packard Company, HP.
<http://docs.hp.com/>
- [6]
- IRIX® SX.25,
SX.25 NLI Programming's Guide, 1994, (Mountainview, California), Silicon Graphics, Inc., SGI Technical Publications.
[Doc. No: 007-2268-002]
<http://techpubs.sgi.com/>
- [7]
- PT X.25,
X.25 Protocol User's Manual, 2007, (Rochester, New York), Performance Technologies Inc., PT.
- [8]
- SBE X.25,
SBE X.25 Protocol Manual, 2003, SBE, SBE.
- [9]
- RadiSys WAN,
ARTIC STREAMS Support WAN Driver Interface Reference, Release 1.7, June 2004, (Hillsboro, OR), RadiSys Corporation, RadiSys.
[Doc No: 007-01232-0003]
<http://www.radisys.com/>
- [10]
- CDI,
OpenSS7 CAE Specification: Communications Device Interface (CDI) Specification, Revision 0.9.2, Draft 2, July 15, 2007, (Edmonton, Canada), B. Bidulock, OpenSS7 Corporation.
Distributed with package strxns-0.9.2.
<http://www.openss7.org/specs/cdi.pdf>
- [11]
- Solstice® X.25,
Solstice X.25 9.2 Developer's Guide, October 1999, (Palo Alto, California), Sun Microsystems, Inc., Sun.
[Part No: 806-1235-10]
<http://docs-pdf.sun.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
-
OpenSS7 X.25 Networking: Package strx25 version 0.9.2.1 released 2008-10-31.
Copyright©1997-2008OpenSS7 Corp.
All Rights Reserved.
(See roff source for permission notice.)
Index
- NAME
- SYNOPSIS
- DESCRIPTION
- PRIMITIVES
- WAN_SID
- WAN_REG
- WAN_CTL
- WAN_DAT
- WAN_NOTIFY
- STRUCTURES
- WAN_STATS
- WAN_TUNE
- WAN_MAP
- WAN_PLAIN
- WAN_SETSIG
- IOCTLS
- W_ZEROSTATS
- W_GETSTATS
- W_SETTUNE
- W_GETTUNE
- W_PUTWANMAP
- W_GETWANMAP
- W_DELWANMAP
- W_STATUS
- W_ENABLE
- W_DISABLE
- W_SETSIG
- W_GETSIG
- NOTICES
- BUGS
- SEE ALSO
- COMPATIBILITY
- CONFORMANCE
- HISTORY
- REFERENCES
- TRADEMARKS
- IDENTIFICATION
This document was created by
man2html,
using the manual pages.
Time: 09:36:02 GMT, December 12, 2024