Solstice X.25 9.2 Developer's Guide

Chapter 7 Network Layer ioctls

This chapter describes the Network Layer ioctls alphabetically. Refer to the tables below for functional groupings of Network Layer ioctls. Use the ioctls in this chapter to communicate with the Solstice X.25 software. To communicate with the network, for example to initiate calls, use the NLI commands described in Chapter 6, NLI Commands and Structures.


Note -

Note that some ioctls allow changes to be made to connections that may currently be in use--potentially disrupting users.


The header files used by the NLI ioctls are contained in the /usr/include/netx25 directory.

7.1 ioctls Functional Grouping

These ioctls are related to NUI mapping. The NUI mapping table maps Network User Identifiers to particular facilities. The ioctls described in this section let you operate on NUI mappings. Note that any changes you make could disrupt other users. For this reason you require root access to use the ioctls that let you change the current settings.

Table 7-1 NUI mapping icotls

ioctl 

description 

access level 

N_nuidel

delete specified NUI mapping 

root only 

N_nuiget

read specified NUI mapping 

unrestricted 

N_nuimget

read all NUI mappings 

unrestricted 

N_nuiput

store a set of NUI mappings 

root only 

N_nuireset

delete all NUI mappings 

root only 

These ioctls operate on a per multiplexor basis:

Table 7-2 Multiplexor ioctls

ioctl 

description 

access level 

N_getstats

read X.25 multiplexor statistics 

unrestricted 

N_zerostats

reset X.25 multiplexor statistics to zero 

root only 

These ioctls operate on a per virtual circuit basis:

Table 7-3 Virtual circuit ioctls

ioctl 

description 

access level 

N_getoneVCstats

get status and statistics for VC associated with current stream 

unrestricted 

N_getpvcmap

get default packet and window sizes 

unrestricted 

N_getVCstats

get per VC statistics 

unrestricted 

N_getVCstatus

get per VC state and statistics 

unrestricted 

N_putpvcmap

change per VC packet and window sizes 

unrestricted 

These ioctls start and stop packet level tracing:

Table 7-4 Packet level tracing ioctls

ioctl 

description 

access level 

N_traceon

start packet level tracing 

root only 

N_traceoff

stop packet level tracing 

root only 

These ioctls manage the X.25 routing table. Using them may override values set using x25tool. The ioctls are:

Table 7-5 Routing ioctls

ioctl 

description 

access level 

N_X25_ADD_ROUTE

add a new route or update an existing route. 

root only 

N_X25_FLUSH_ROUTE

clear all entries from table. 

root only 

N_X25_GET_ROUTE

obtain routing information for specified address 

unrestricted 

N_GET_NEXT_ROUTE

obtain routing information for the next route in the table 

unrestricted 

N_RM_ROUTE

remove the specified route 

root only 

These ioctls operate on a link:

Table 7-6 Link ioctls

Header 

Header 

Header 

N_getlinkstats

retreive per link statistics 

unrestricted 

N_linkconfig

configure wlcfg database for a link

unrestricted 

N_linkent

configure a newly linked driver 

unrestricted 

N_linkread

read the wlcfg database

unrestricted 

7.2 N_getlinkstats--Retrieve Per-Link Statistics

Retrieve statistics for a particular link.

Associated Structure

The following structure is associated with this ioctl:

struct perlinkstats {
        uint32_t linkid;                   /* link id (ppa)           */
        int      network_state;                 /* Network State           */
        uint32_t mon_array[link_mon_size]; /* L3perlinkmonarray       */
};

The members of the perlinkstats structure are:

Table 7-7 perlinkstats fields

Member 

Description 

linkid

the number of the link. 

network_state

a code defining the network state. The codes are as follows: 

1 Connecting to DXE  

2 Connected resolving DXE  

3 Random wait started  

4 Connected and resolved DXE  

5 DTE RESTART REQUEST  

6 Waiting link disc reply  

7 Buffer to enter WtgRES

8 Buffer to enter L3restarting

9 Buffer to enter L_disconnect

10 Registration request 

mon_array

the array containing the statistics. mon_array is defined in the file x25_control.h.

N_getnliversion

read current NLI version Read which version of the Network Layer Interface is supported by the X.25 multiplexor. Solstice X.25 supports version 3. 

Associated Structure

The following structure is associated with this ioctl:

struct nliformat {
     unsigned char  version;    /* NLI version number */
 };

The members of the nliformat structure are:

Table 7-8 nliformat fields

Member 

Description 

version

the version of NLI supported by the X.25 multiplexor. 

7.3 N_getoneVCstats --Retrieve Per-Virtual-Circuit Statistics

This ioctl is used to retrieve per-virtual circuit state and statistics for the virtual circuit associated with the stream on which the ioctl is made.

Associated Structure

The vcinfo structure is shown below:

struct vcinfo {
        struct xaddrf     rem_addr;     /* = called for outward calls */
        /* = caller for inward calls  */
        uint32_t     xu_ident;     /* link id                    */
        uint32_t     process_id;   /* effective user id          */
        unsigned short    lci;          /* Logical Channel Identifier */
        unsigned char     xstate;       /* VC state                   */
        unsigned char     xtag;         /* VC check record            */
        unsigned char     ampvc;        /* =1 if a PVC                */
        unsigned char     call_direction;
        /* in=0, out=1                */
        unsigned char     domain;       /* was in 8.0, not in R7. Put it back */
        int                perVC_stats[perVCmon_size];
}; 

The members of the vcinfo structure are:

Table 7-9 vcinfo structure fields

Member 

Description 

rem_addr

The called address if its an outgoing call, or the calling address for incoming calls. 

xu_ident

The link identifier. 

process_id

The relevant user id. 

lci

The logical channel identifier. 

xstate

The VC state. 

xtag

The VC check record. 

ampvc

Set to 1 if this is a PVC. 

call_direction

0 indicates in incoming call, 1 an outgoing call. 

perVC_stats

An array containing the per-virtual circuit statistics. The array is defined in the x25_control.h file.

7.4 N_getpvcmap--Get PVC Default Packet/Window Sizes

This ioctl is used to read the default packet and window sizes of active PVCs.

Associated Structure

The following structure is associated with this ioctl:

struct pvcmapf {
   struct pvcconff entries[MAX_PVC_ENTS]; /* Data buffer           */
   int             first_ent;             /* Where to start search   */
   unsigned char   num_ent;               /* Number entries returned */
 };

The members of the pvcmapf structure are:

Table 7-10 getpvcmap fields

Member 

Description 

entries

Contains the structure for the returned mapping entries.  

first_ent

Informs the X.25 multiplexor where to start or restart the table read. It should initially be set to 0, to indicate starting at the beginning of the table. On return, it points to the next entry.  

num_ent

Indicate the number of mapping entries returned in the entries member. It should be set to 0 before making the ioctl. 

7.5 N_getstats--Get X.25 Multiplexor Statistics

This ioctl is used to read the statistics counts for the X.25 multiplexor since network start-up or since they were last reset by an N_zerostats ioctl (see below). Statistics are maintained an a multiplexor basis--separate link statistics are not available.

Associated Structure

The N_getstats structure associated with this ioctl is an integer array of size mon_size, defined in the file x25_control.h. Entries and meanings include the following:

Table 7-11 N_getstats structure

Entry 

Description 

cll_in_g

Calls received and indicated 

caa_in_gc

Call established for outgoing 

caa_out_g

Call established for incoming 

ed_in_g

Interrupts received 

ed_out_g

Interrupts sent 

rnr_in_g

Receiver not ready received 

rnr_out_g

Receiver not ready sent 

rr_in_g

Receiver ready rvcd 

rr_out_g

Receiver ready sent 

rst_in_g

Resets received 

rst_out_g

Resets sent 

rsc_in_g

Restart confirms received 

rsc_out_g

Restart confirms sent 

clr_in_g

Clears received 

clr_out_g

Clears sent 

clc_in_g

Clear confirms received 

clc_out_g

Clear confirms sent 

cll_coll_g

Call collision count (not rjc) 

cll_uabort_g

Calls aborted by user b4 sent 

rjc_buflow_g

Calls rejd no buffs b4 sent 

rjc_coll_g

Calls rejd - collision DCE mode 

rjc_failNRS_g

Calls rejd negative NRS resp 

rjc_lstate_g

Calls rejd link disconnecting 

rjc_nochnl_g

Calls rejd no lcns left 

rjc_nouser_g

In call but no user on NSAP 

rjc_remote_g

Call rejd by remote responder 

rjc_u_g

Call rejd by NS user 

dg_in_g

DIAG packets in 

dg_out_g

DIAG packets out 

p4_ferr_g

Format errors in P4 

rem_perr_g

Remote protocol errors 

res_ferr_g

Restart format errors 

res_in_g

Restarts received (inc DTE/DXE) 

res_out_g

Restarts sent (inc DTE/DXE) 

vcs_labort_g

Circuits aborted via link event 

r23exp_g

Circuits hung by r23 expiry 

l2conin_g

Link level connect established 

l2conok_g

LLC connections accepted 

l2conrej_g

LLC connections rejd 

l2refusal_g

LLC connect requests refused 

l2lzap_g

Oper requests to kill link 

l2r20exp_g

R20 retransmission expiry 

l2dxeexp_g

DXE/connect expiry 

l2dxebuf_g

DXE resolv abort - no buffers 

l2noconfig_g

No config base - error 

xiffnerror_g

Upper i/f bad M_PROTO type 

xintdisc_g

Internal disconnect events 

xifaborts_g

Interface abort_vc called 

PVCusergone_g

Count of non-user interactions 

max_opens_g

highest no. simul. opens so far 

vcs_est_g

VCs established since reset 

bytes_in_g

Total data bytes received 

bytes_out_g

Total data bytes sent 

dt_in_g

Count of data packets sent 

dt_out_g

Count of data packets received 

res_conf_in_g

Restart Confirms received 

res_conf_out_g

Restart Confirms sent 

reg_in_g

Registration requests received 

reg_out_g

Registration requests sent 

reg_conf_in_g

Registration confirms received 

reg_conf_out_g

Registration confirms sent 

l2r28exp_g

R28 retransmission expiry 

7.6 N_getVCstats--Get Per-Virtual-Circuit Statistics

This ioctl is used to retrieve per-virtual circuit state and statistics, for all virtual circuits currently active over all configured links.

Associated Structure

The vcstatsf structure, defined in x25_control.h, takes this format:

struct vcstatsf {
         int first_ent;          /* Where to start search   */
         unsigned char num_ent   /* Number entries returned */
         struct pervcinfo vc;    /* Data buffer, extendable by*/
                                 /* malloc overlay*/
 };

The members of the vcstatsf structure are:

Table 7-12 vcstatsf fields

Member 

Description 

first_ent

Informs the X.25 multiplexor where to start or restart the table read. On return, it is set to point the next entry. 

num_ent

Indicates the number of virtual circuit entries returned in the vc member.

vc

This is either a single pervcinfo structure or an array of pervcinfo structures, of size MAX_VC_ENTRIES, each containing the state and statistics of an individual virtual circuit.

If a single pervcinfo structure is used, and num_ent is not 0, and statistics are returned of the virtual circuit specified in the lci member of the pervcinfo structure, with a link identifier specified using xu_ident.

If a single pervcinfo structure is used, and num_ent is 0, the number of open virtual circuits is returned in first_ent.

If an array of pervcinfo structures is used, and num_ent is set to 0, statistics are returned for the Logical Channel Number set using the lci member.

If an array of pervcinfo structures is used, and num_ent is set to 1, statistics are returned for all virtual circuits on the link specified using xu_ident.

If an array of pervcinfo structures is used, and num_ent is set to MAX_VC_ENTRIES, statistics are returned for all virtual circuits on all links.

The contents of the pervcinfo structure are:

struct pervcinfo {
        struct xaddrf     rem_addr;     /* = called for outward calls */
        /* = caller for inward calls  */
        uint32_t     xu_ident;     /* link id                    */
        uint32_t     process_id;   /* effective user id          */
        unsigned short    lci;          /* Logical Channel Identifier */
        unsigned char     xstate;       /* VC state                   */
        unsigned char     xtag;         /* VC check record            */
        unsigned char     ampvc;        /* =1 if a PVC                */
        unsigned char     call_direction;
        /* DIRECTION_xxx (see mib)    */
        unsigned char     domain;       /* was in 8.0, not in R7. Put it back */
        uint32_t     perVC_stats[perVCstat_size];
        /* Per-VC statistics array    */
        /*
         * move these to the end, so that the first bit of the struct is
         * identical to the 8.0 one
        */
        unsigned char     vctype;       /* what _is_ this? */
        struct xaddrf     loc_addr;     /* = caller for outward calls */
        /* = called for inward calls  */
        uint32_t     start_time;   /* time the VC was created */
};
 

xstate contains the state of the VC. Possible states and meanings are:

Table 7-13 xstate summary

Entry 

Description 

Idle

Record is not in use 

AskingNRS

CR is being validated by NRS 

P1

VC state is READY 

P2

VC in DTE CALL REQUEST 

P3

VC in DXE INCOMING CALL 

P5

VC in CALL COLLISION 

DataTransfer

VC in P4 (see xflags 

DXEbusy

VC in P4, DXE sent RNR 

D2

VC in DTE RESET REQUEST 

D2pending

Wanting buffer for RESET 

WtgRCU

Waiting U RSC to int.err. 

WtgRCN

Waiting X.25 RSC for user 

WtgRCNpending

Buffer reqd to enter state 

P4pending

Buffer reqd for X.25 RSC 

pRESUonly

Buffer for user rst only 

RESUonly

User only being reset 

pDTransfer

Buffer for RSC to user 

WRCUpending

Buffer reqd internal RST 

DXErpending

Buffer reqd RST indication 

DXEresetting

Waiting U RSC to X.25 RI 

P6

VC in DTE CLEAR REQUEST 

P6pending

Wanting buffer for CLEAR 

WUcpending

Buffer reqd DI no netconn 

WUNcpending

Buffer reqd internal DI 

DXEcpending

Buffer reqd CLR REQ->User 

DXEcfpending

Buffer reqd CLC to User 

perVC_stats contains statistics counts, as follows:

Table 7-14 perVC_stats summary

Entry 

Description 

cll_in_v

Calls received and indicated 

cll_out_v

Calls sent 

caa_in_v

Call established for outgoing 

caa_out_v

Call established for incoming 

dt_in_v

Data packets received 

dt_out_v

Data packets sent 

ed_in_v

Interrupts received 

ed_out_v

Interrupts sent 

rnr_in_v

Receiver not ready received 

rnr_out_v

Receiver not ready sent 

rr_in_v

Receiver ready rvcd 

rr_out_v

Receiver ready sent 

rst_in_v

Resets received 

rst_out_v

Resets sent 

rsc_in_v

Restart confirms received 

rsc_out_v

Restart confirms sent 

clr_in_v

Clears received 

clr_out_v

Clears sent 

clc_in_v

Clear confirms received 

clc_out_v

Clear confirms sent 

7.7 N_getVCstatus--Get Per-Virtual-Circuit Statistics


Note -

This ioctl has been superceded by the N_getVCstats ioctl. It is retained for backward compatibility with Solstice X.25 8.x. When writing new applications, use N_getVCstats.


This ioctl is used to retrieve per-virtual circuit state and statistics, for all virtual circuits currently active over all configured links.

Associated Structure

The vcstatusf structure takes this format:

struct vcstatusf {    
   struct vcinfo       vcs[MAX_VC_ENTS];  /* Data buffer      */
   int                 first_ent;         /* Where to start search */
   unsigned char       num_ent;           /* Number entries returned */
 };

The members of the vcstatusf structure are:

Table 7-15 vcstatusf fields

Member 

Description 

vcs

An array of vcinfo structures, each of which contains the state and statistics for an individual virtual circuit.

first_ent

Informs the X.25 multiplexor where to start or restart the table read. It should initially be set to 0, to indicate starting at the beginning of the table. On return, it will be set to point to the next entry to be retrieved.  

num_ent

Indicates the number of virtual circuit entries returned in the vcs member. It should be set to 0 before making the ioctl.

The contents of the vcinfo structure are:

struct vcinfo {
        struct xaddrf     rem_addr;     /* = called for outward calls */
        /* = caller for inward calls  */
        uint32_t     xu_ident;     /* link id                    */
        uint32_t     process_id;   /* effective user id          */
        unsigned short    lci;          /* Logical Channel Identifier */
        unsigned char     xstate;       /* VC state                   */
        unsigned char     xtag;         /* VC check record            */
        unsigned char     ampvc;        /* =1 if a PVC                */
        unsigned char     call_direction;
        /* in=0, out=1                */
        unsigned char     domain;       /* was in 8.0, not in R7. Put it back */
        int                perVC_stats[perVCmon_size];
}; 

The xstate member contains the state of the VC. Possible states and meanings are:

Table 7-16 xstate summary

Entry 

Description 

Idle

Record is not in use 

AskingNRS

CR is being validated by NRS 

P1

VC state is READY 

P2

VC in DTE CALL REQUEST 

P3

VC in DXE INCOMING CALL 

P5

VC in CALL COLLISION 

DataTransfer

VC in P4 (see xflags 

DXEbusy

VC in P4, DXE sent RNR 

D2

VC in DTE RESET REQUEST 

D2pending

Wanting buffer for RESET 

WtgRCU

Waiting U RSC to int.err. 

WtgRCN

Waiting X.25 RSC for user 

WtgRCNpending

Buffer reqd to enter state 

P4pending

Buffer reqd for X.25 RSC 

pRESUonly

Buffer for user rst only 

RESUonly

User only being reset 

pDTransfer

Buffer for RSC to user 

WRCUpending

Buffer reqd internal RST 

DXErpending

Buffer reqd RST indication 

DXEresetting

Waiting U RSC to X.25 RI 

P6

VC in DTE CLEAR REQUEST 

P6pending

Wanting buffer for CLEAR 

WUcpending

Buffer reqd DI no netconn 

WUNcpending

Buffer reqd internal DI 

DXEcpending

Buffer reqd CLR REQ->User 

DXEcfpending

Buffer reqd CLC to User 

The perVC_stats member contains statistics. Entries are statistics counts, as follows:

Table 7-17 perVC_stats summary

Entry 

Description 

cll_in_v

Calls received and indicated 

cll_out_v

Calls sent 

caa_in_v

Call established for outgoing 

caa_out_v

Call established for incoming 

dt_in_v

Data packets received 

dt_out_v

Data packets sent 

ed_in_v

Interrupts received

ed_out_v

Interrupts sent 

rnr_in_v

Receiver not ready received 

rnr_out_v

Receiver not ready sent 

rr_in_v

Receiver ready rvcd 

rr_out_v

Receiver ready sent 

rst_in_v

Resets received 

rst_out_v

Resets sent 

rsc_in_v

Restart confirms received 

rsc_out_v

Restart confirms sent 

clr_in_v

Clears received 

clr_out_v

Clears sent 

clc_in_v

Clear confirms received 

clc_out_v

Clear confirms sent 

7.8 N_linkconfig--Configure the wlcfg Database

This ioctl is used to configure the wlcfg database for a link. The wlcfg database appropriate to a link is carried as the M_DATA part of the ioctl N_linkconfig. The U_LINK_ID member of the wlcfg structure specifies the link to be configured. The wlcfg database structure is defined in the /usr/include/netx25/x25_control.h file.


Note -

This ioctl affects currently open connections and could therefore disrupt users significantly. For this reason it can only be used by root.


The wlcfg database structure contains the members described below:

U_LINK_ID

The upper level link identifier which is quoted by upper level software in the xaddrf address structure to specify which link a call is to be sent on. It is also used to identify which link an incoming call arrived on.

NET_MODE

This determines the characteristics of the network protocol Possible values are:

Table 7-18 NET_MODE values

String 

Value 

Network, X.25 Type, or Country 

X25_LLC

X.25(84/88)/LLC2 

X25_88

X.25(88) 

X25_84

X.25(84) 

X25_80

X.25(80) 

GNS

UK 

AUSTPAC

Australia 

DATAPAC

Canada 

DDN

USA 

TELENET

USA 

TRANSPAC

10 

France 

TYMNET

11 

USA 

DATEX_P

12 

Germany 

DDX_P

13 

Japan 

VENUS_P

14 

Japan 

ACCUNET

15 

USA 

ITAPAC

16 

Italy 

DATAPAK

17 

Sweden 

DATANET

18 

Holland 

DCS

19 

Belgium 

TELEPAC

20 

Switzerland 

F_DATAPAC

21 

Finland 

FINPAC

22 

Finland 

PACNET

23 

New Zealand 

LUXPAC

24 

Luxembourg 

X25_Circuit

25 

dialup call 

X25_VSN

This determines the version of the X.25 protocol used over the network. Allowed values are:

Setting NET_MODE to X25_LLC overrides an X.25 (80) value.

L3PLPMODE

Indicates whether the link is DTE or DCE. Allowed values are:

LPC to HPC

Logical channel range assigned to PVCs.

LIC to HIC

Logical channel range assigned to one way incoming logical channels.

LTC to HTC

Logical channel range assigned to two-way logical channels.

LOC to HOC

Logical channel range assigned to one-way outgoing logical channels.


Note -

In a DTE/DTE environment, one of the interacting pairs views these ranges as a DCE, for example, LIC to HIC are viewed as one-way outgoing. HxC = LxC = 0 denotes no channels in that grouping.


NPCchannels, NICchannels, NTCchannels, NOCchannels and Nochnls

The number of logical channels assigned. This is calculated from the logical channel ranges and can only be changed only by altering these ranges.

THISGFI

0x10 indicates Modulo 8. 0x20 indicates Modulo 128 sequence numbering operates on the network.

LOCMAXPKTSIZE

The maximum acceptable size of local to remote data packets, expressed as a power of 2.

REMMAXPKTSIZE

The maximum acceptable size of remote to local data packets expressed as a power of 2.

LOCDEFPKTSIZE

The default local-to-remote packet size expressed as a power of 2.

REMDEFPKTSIZE

The default remote-to-local packet size on a particular link, expressed as a power of 2.

LOCMAXWSIZE

The maximum acceptable local to remote X.25 window size.

REMMAXWSIZE

The maximum acceptable remote to local X.25 window size.

LOCDEFWSIZE

The local-to-remote default window size.

REMDEFWSIZE

The remote-to-local default window size.

MAXNSDULEN

The default maximum length beyond which concatenation is stopped and the data currently held is passed to the NS-user. This parameter can be overridden on a per-circuit basis using the nsdulimit parameter on N-CONNECT requests and N-CONNECT responses.

ACKDELAY

The maximum delay in ticks (0.1 second units) over which a pending acknowledgement will be withheld. The default value is 5, the permitted range 1--32000.

T20value

The length of DTE timer T20, the Restart Request Response Timer, in ticks (0.1 second units). The default value is 1800. The permitted range is 0--32000.

T21value

The length of DTE timer T21, the Call Request Response Timer, in ticks (0.1 second units). The default value is 2000. The permitted range is 0--32000.

T22value

The length of DTE timer T22, the Reset Request Response Timer, in ticks (0.1 second units). The default value is 1800. The permitted range is 0--32000.

T23value

The length of DTE timer T20, the Clear Request Response Timer, in ticks (0.1 second units). The default value is 1800. The permitted range is 0--32000.

Tvalue

The maximum time over which acknowledgments of data received from the remote transmitter will be withheld. After this timer expires any withheld acknowledgments are carried by a Receive Not Ready (RNR) packet. This timer ensures that non-receipt of acknowledgment by the remote transmitter does not cause resets within the virtual circuit. This timer does not cause transmission of window status every Tvalue ticks (0.1 second units). The default value is 750. The permitted range is 0--32000.

T25value

The length of DTE timer T25, the Window Rotation Timer, in ticks (0.1 second units). The default value is 1500, as specified in ISO 8208. The permitted range is 0--32000.

The code may be configured to be lenient in the case of flow control inhibition (see Section 11.2 of ISO 8208). That is, a decision has to be made in order to cater for the case when the remote station does not rotate the window fast enough to prevent expiration of T25. ISO 8208 recommends strongly that high level protocols be used to effect recovery, to achieve this, set T25 to either zero (implying infinite) or a very large value.

The timer Tvalue, should be set to a value approximately half T25value, in order to prevent the remote PLP from resetting on T25 expiration. The timer ACKDELAY should be approximately 0.5 seconds, although this recommendation may change after evaluation and experience is gained.

Finally, the idlevalue timer may be set according to how quickly the LAN administration wishes the resource to be reclaimed, while connectvalue should be about three times the T20 value.

Note also that ISO 8208 recommends that the retry values R20, R22 and R23 should never be set to zero in order to cater for the possibility of collisions (see footnote to Figure 6, ISO 8208).

T26value

The length of DTE timer T26, the Interrupt Response Timer, in ticks (0.1 second units). The default value is 1800. The permitted range is 0--32000.

T28value

The length of DTE timer T28, the Registration Request Timer, in ticks (0.1 second units). The default value is 1800. The permitted range is 0--32000.

idlevalue

The number of ticks (0.1 second units) over which a link-level connection associated with no connections is maintained. This timer is meaningful on a LAN or on a dial-up WAN connection. The default value is 600. The permitted range is 0--32000.

connectvalue

The number of ticks (0.1 second units) over which the DTE/DCE resolution phase must be complete. On expiration of this timer, the link connection is disconnected and all pending connections are aborted. The default value is 2000. The permitted range is 0--32000.

R20value

The DTE Restart Request Retransmission Count. The default value is 1. The permitted range is 1--255.

R22value

The DTE Restart Request Retransmission Count. The default value is 1. The permitted range is 1--255.

R23value

The DTE Restart Request Retransmission Count. The default value is 1. The permitted range is 1--255.

localdelay and accessdelay

In milliseconds, the values of the transit delay attributed to internal processing and the effect of the line transmission rate. These values are used to check whether any maximum acceptable end-to-end transit delay specified in an N-CONNECT request or an N-CONNECT indication is in fact available.

locmaxthclass

The maximum value of the throughput class quality of service parameter in the local-to-remote direction which is supported. According to ISO 8208 this parameter is bounded in the range 3 and <= 12 corresponding to a range 75 to 48000 bits/second.

remmaxthclass

The maximum value of the throughput class quality of service parameter in the remote-to-local direction which is supported. According to ISO 8208 this parameter is bounded in the range 3 and <= 12 corresponding to a range 75 to 48000 bits/second.

locdefthclass

In some PSDNs, for example, TELENET, negotiation of throughput class is constrained to be towards a configured default throughput class. In such cases the flag thclass_neg_to_def (see below) is non-zero and locdefthclass is the default for the local-to-remote direction. In other PSDNs, locdefthclass should be set equal to the value of locmaxthclass (see above).

Note that locmaxthclass must be greater than or equal to locdefthclass.

remdefthclass

In some PSDNs, for example, TELENET, negotiation of throughput class is constrained to be towards a configured default throughput class. In such cases the flag thclass_neg_to_def is non-zero and remdefthclass is the default for the remote-to-local direction. In other PSDNs, set remdefthclass equal to the value of remmaxthclass (see above).

Note that remmaxthclass must be greater than or equal to remdefthclass.

locminthclass

According to ISO 8208, the throughput class parameter must be greater than or equal to 3 and less than or equal to 12. Some PSDNs may provide a different mapping, in which case locminthclass is the minimum value in the local-to-remote direction. Note that locmaxthclass must be less than or equal to locdefthclass which must be greater than or equal to locminthclass.

remminthclass

According to ISO 8208, the throughput class parameter is defined in the range 3 and 12. Some PSDNs may provide a different mapping, in which case remminthclass is the minimum value in the remote-to-local direction. Note that remmaxthclass must be greater than or equal to remdefthclass which must be greater than or equal to remminthclass.

CUG_CONTROL

This member controls Closed User Group actions in two ways. Firstly, it describes the type, if any, of Closed User Group facilities subscribed to. This is used to choose the appropriate encoding for any closed user group facilities in N-CONNECT requests. Secondly, it specifies the action to be taken if the Closed User Group optional facility is present in an incoming call. It is a bit map where the bits have the following meanings:

Table 7-19 bit map summary

Bit 

Description 

subscription to CUGs with no Outgoing or Incoming Access 

subscription to Preferential CUG 

subscription to CUGs with Outgoing Access  

subscription to CUGs with Incoming Access (For Information Only) 

subscription to Basic Format CUGs 

subscription to Extended format CUGs 

reject incoming calls containing any Closed User Group facility 

reserved 

Bits 0 and 2 are mutually exclusive as are bits 4 and 5.

SUB_MODES

This member is a bit map, which contains information on the various subscription options for a particular PSDN link. The entries mean:

Table 7-20 SUB_MODES summary

Entry 

Description 

SUB_EXTENDED

Subscribe to extended call packets. This permits the use of extended CALL REQUEST and CALL ACCEPT packets.

BAR_EXTENDED

Treat incoming extended call packets as a procedure error.The use of extended call packets allows window and packet size negotiation. Not setting the BAR_EXTENDED member permits the use of extended INCOMING CALL and CALL CONFIRM packets.

SUB_FSELECT

Subscribe to fast select with no restriction on response. This permits the use of fast select on INCOMING CALL packets.

SUB_FSRRESP

Subscribe to fast select with restriction on response. This permits the use of fast select with restricted response on INCOMING CALL packets.

SUB_REVCHARGE

Subscribe to reverse charging. This permits the use of reverse charges on INCOMING CALL packets.

SUB_LOC_CHG_PREV

Subscribe to local charging prevention. If set, this member has two effects. It prevents the use of reverse charges on INCOMING CALL packets regardless of the setting of SUB_REVCHARGE, and any CALL REQUEST packet will have the reverse charges facility automatically inserted.

SUB_TOA_NPI_FMT

Subscribe to using TOA/NPI address format. This specifies that all call set-up and clearing packets transmitted will always use the TOA/NPI address format.

BAR_TOA_NPI_FMT

Treat incoming TOA/NPI address formats as a procedure error. The BAR_TOA_NPI_FMT entry if set specifies that any call set-up and clearing packets received employing the TOA/NPI address format will be treated as a procedure error.

BAR_CALL_X32_REG

Refuse to accept incoming calls while X.32 registration is incomplete. 

SUB_NUI_OVERRIDE

Subscribe to NUI override.The SUB_NUI_OVERRIDE entry if set specifies that when an NUI is provided in a CALL REQUEST, then any associated subscription time options override the facilities which apply to the interface, for the duration of that particular call.

BAR_INCALL

Bar incoming calls.

BAR_OUTCALL

Bar outgoing calls.

Some PSDNs require certain procedures to be followed which are not standard for all X.25 networks. The structure psdn_local contains the flags used to tune the actions of the X.25 driver to the requirements of the particular network to which the configuration refers. The entries and values taken by the psdn_local structure are described below.

PSDN_MODES

This is used to tune the various options for a particular PSDN link. It is a bit map in which the various entries when set imply:

Table 7-21 PSDN Modes

Mode 

Description 

ACC_NODIAG

Allow the omission of the diagnostic byte in incoming RESTART, CLEAR and RESET INDICATION.

USE_DIAG

Use diagnostic packets.  

CCITT_CLEAR_LEN

Restrict the length of a CLEAR INDICATION to 5 bytes and a CLEAR CONFIRM to 3 bytes.  

BAR_DIAG

Disallow diagnostic packets. 

DISC_NZ_DIAG

Discard diagnostic packets on a non-zero LCN. 

ACC_HEX_ADD

Allow DTE addresses to contain hexadecimal digits. 

BAR_NONPRIV_LISTEN

Disallow a non-privileged user (that is, one without superuser privilege) from listening for incoming calls.  

INTL_PRIO

Prioritize international calls. 

DATAPAC_PRIORITY

Use DATAPAC (1976) priority rules. 

ISO_8882_MODE

Use strict ISO8882 conformance. 

X121_MAC_OUT

Keep X.121 address in call packets to LAN. 

X121_MAC_IN

Put X.121 address in call packets from LAN. 

The BAR_DIAG and DISC_NZ_DIAG entries specify the treatment of incoming diagnostic packets. When BAR_DIAG is set, incoming diagnostic packets are handled as follows. If USE_DIAG is set, and the link is configured as a DCE, then a diagnostic packet is sent to the DTE. Otherwise, the incoming diagnostic packet is simply discarded. When DISC_NZ_DIAG is set, diagnostic packets will be discarded when received on non-zero logical channel numbers. If ACC_HEX_ADD is set, DTE addresses are not restricted to containing only BCD digits.

intl_addr_recogn

The main use of this feature is in conjunction with the intl_prioritised member discussed below. Possible values are:

Table 7-22 Intl_addr_recogn summary

Value 

Description 

International calls are not distinguished. 

The DNIC of the called DTE address is examined and compared to that held in psdn_local members dnic1 and dnic2. A mismatch implies an international call.

International calls are distinguished by having a "1" prefix on the called DTE address; for example, DATAPAC has this feature. 

International calls are distinguished by having a "0" prefix on the called DTE address. 

dnic1, dnic2

The first four BCD digits of the DNIC and is only used when intl_addr_recogn has the value one.

intl_prioritised

This determines whether some prioritization method is to be used for international calls, and is used in conjunction with prty_encode_control and prty_pkt_forced_value.

intl_prioritised has two values: zero implying no priority, while non-zero implies an attempt to prioritize according to ptry_encode_control.

intl_addr_recogn has the value one.

prty_encode_control

This describes how the priority request is to be encoded for this PSDN. Values are:

Table 7-23 prty_encode_control values

Value 

Description 

The priority is encoded according to section 3.3.3 of Annex G, Blue Book Volume VIII, Fascicle VIII.3 (CCITT, 1988). 

Encode the priority request using the DATAPAC Priority Bit (1976 version).

Encode the priority request using the DATAPAC Traffic Class (1980 version which uses the Calling Network facility marker).

prty_pkt_forced_value

If this entry is non-zero then it implies that all priority call requests and incoming calls should have the associated packet size parameter forced to this value (note that the actual packet size is two to the power of this parameter; for example, 7 implies 128 byte packets). A zero value implies no special action on packet size is required.

src_addr_control

This provides the means to override or set the calling address in outgoing call requests for this PSDN. It takes the following values:

Table 7-24 src_addr_control values

Value 

Description 

No special action. Calling DTE addresses are encoded as and if provided by the network service user. 

Force omission of the calling DTE address, even if the network service user supplied one. 

If the network service user does not supply a DTE address, use the configured DTE address (local_address) for this PSDN (which can, of course, be NULL).

Force the calling DTE address to that contained in local_address, even if the network service user supplied one.

dbit_control

This member specifies the action to be taken:

Actions which may be specified during the call setup phase are:

Actions which may be specified during the data transfer phase are:

thclass_neg_to_def

This accommodates certain network procedures which dictate that negotiation of throughput class must be towards the default value (for example, TELENET), the default value being configured into the member defthclass. A non-zero value in this member requests use of this option, zero implies non-use.

thclass_type

This provides the means by which throughput class encodings can be used to assign window and packet sizes (according to the arrays thclass_wmap and thclass_pmap described below). It should be noted that some implementations of X.25 do not use the X.25 packet and window negotiation but instead rely on mapping the throughput class to these parameters (see thclass_type 1,2 and 3). Thclass_type should be used on such PSDNs. Note also that the values of locmaxthclass and remmaxthclass may have an effect on what is achieved through the mapping.

The values assigned to thclass_type to indicate the mapping are:

Table 7-25 thclass_type values

Value 

Description 

No special action is to be taken on throughput class. 

Use only the low nibble of the throughput class parameter to map window and packet size for both directions and encode the high nibble as zero. Note that the window and packet sizes are intended to be asserted by the throughput class parameter. 

Use only the high nibble of the throughput class parameter to map window and packet size for both directions and encode the low nibble as zero. Note that the window and packet sizes are intended to be asserted by the throughput class parameter. 

Use both nibbles of the throughput class to map window and packet size for the appropriate directions. Note that the window and packet sizes are intended to be asserted by the throughput class parameter. 

Values 1, 2 and 3 are intended for use on non-standard X.25 PSDN implementations. Note the following.

For the special values 1 and 2:

For the value 3, window and packet sizes can be negotiated by the network service user only through the throughput class parameter. Negotiations through the flow negotiation parameters when subscribing to the extended facility option are overridden. However, as for values 1 and 2, this value is intended only for cases where this is the only means of negotiating window and packet sizes.

Since window and packet sizes can be mapped using these three values without the use of window and packet negotiation facilities, it is important that the map (thclass_wmap and thclass_pmap) is correct for the PSDN, in order to ensure that both called and calling parties agree on the values associated with a particular throughput class.

thclass_wmap, thclass_pmap

The mapping between the value of the throughput class (a number 0 to 15) and a window and packet parameter. Zero in this table indicates that the currently set or default value be used.

local_address

Holds the local DTE address for this X.25 link in a byte array, local_address.lsap_add, with an associated length byte local_address.lsap_len.

7.9 N_linkent--Configure a Newly Linked Driver

This ioctl is sent downstream by the x25netd process to configure a newly linked driver below the X.25 multiplexor. It supplies the parameters necessary to identify the link via the identifier and to register the mode of the lower driver.


Note -

This ioctl is only used when X.25 is initializing. As it affects currently open connections and could therefore disrupt users significantly, it can only be used by root. It should not be used by user applications, as it may be withdrawn from future versions of Solstice X.25.


7.10 N_linkmode--Alter the Characteristics of a Link

This ioctl is used to read or change the SUB_MODES Member of a particular wlcfg database appropriate to a link. This configuration ioctl is used to alter characteristics of a link's operation, for example, to temporarily bar incoming calls.


Note -

This ioctl affects currently open connections and could therefore disrupt users significantly. For this reason it can only be used by root.


Associated Structure

The parameters are carried as the M_DATA part of the N_linkmode ioctl as follows:

struct linkoptformat {
        uint32_t   U_LINK_ID;
        unsigned short  newSUB_MODES;
        unsigned char   rd_wr;
};

The members of the linkoptformat structure are:

Table 7-26 linkoptformat fields

Member 

Description 

newSUB_MODE

This is the new SUB_MODES value in a write ioctl or the current value in a read ioctl.

U_LINK_ID

This identifies the particular link and must match one of the wlcfg database entries.

rd_wr

This determines read or write mode. A value of zero indicates read while non-zero indicates write. 

In the case of read, the same structure is returned with the current value of SUB_MODES for the link.

7.11 N_linkread --Read the wlcfg Database

This ioctl is used to extract the wlcfg database for a link in a running system for examination. The wlcfg database is returned within the M_DATA part of the N_linkread ioctl. Make sure that there is enough space in the data area to receive the copy of the structure.

Refer to "7.8 N_linkconfig--Configure the wlcfg Database" for a complete list of the fields contained in the wlcfg database structure.

7.12 N_nuidel--Delete Specified NUI Mapping

This ioctl deletes the mapping for a specified Network User Identifier (NUI).


Note -

This ioctl can disrupt other users significantly. For this reason it can only be used by root.


Associated Structure

The following structure is associated with this ioctl:

struct nui_del {
     char    prim_class;          /* Always NUI_MSG             */
     char    op;                  /* Always NUI_DEL             */
     struct  nuiformat  nuid;     /* NUI  to delete             */
 };

The members of the nui_del structure are:

Table 7-27 nui_del fields

Member 

Description 

prim_class

The value of this member is always NUI_MSG.

op

The value of this member is always NUI_DEL.

nuid

The Network User Identifier of the entry to be deleted 

7.13 N_nuiget--Read the Mapping for a Specified NUI

This ioctl is used to read the mapping for a specified Network User Identifier (NUI).

Associated Structure

The following structure is associated with this ioctl:

struct nui_get {
         char            prim_class;     /* Always NUI_MSG               */
         char            op;             /* Always NUI_GET               */
         struct nuiformat        nuid;           /* NUI to get           */
         struct facformat        nuifacility;    /* NUI facilities       */

The members of the nui_get structure are:

Table 7-28 nui_get fields

Member 

Description 

prim_class

The value of this member is always NUI_MSG.

op

The value of this member is always NUI_DEL.

nuid

The Network User Identifier of the entry you want to read. 

nuifacility

The NUI facilities associated with the entry you want to read. 

7.14 N_nuimget--Read all Existing NUI Mappings

This ioctl is used to read all existing mappings for Network User Identifiers (NUI).

Associated Structure

The following structure is associated with this ioctl:

struct nui_mget {    
   unsigned int first_ent;          /* First entry required    */
   unsigned int last_ent;           /* Last entry required     */
   unsigned int num_ent;            /* No of entries required  */
   char         buf[MGET_NBUFSIZE]; /* Data Buffer             */
 };

The members of the nui_mget structure are:

Table 7-29 Members of the nui_mget structure

Member 

Description 

buf

Contains the structure for the returned mapping entries. 

first_ent

Informs the X.25 multiplexor where to start or restart the table read. It should initially be set to 0, to indicate starting at the beginning of the table.  

num_ent

Indicates the number of mapping entries returned in the buf member.

last_ent

Set on return to point past the last entry returned (that is, a subsequent N_nuimget ioctl should have first_ent set to the value returned here).

7.15 N_nuiput--Store a set of NUIs

This ioctl is used to store a set of Network User Identifiers (NUIs) and associated facilities mappings within the X.25 multiplexor. It is used in conjunction with the NUI override facility option.


Note -

This ioctl affects currently open connections and could therefore disrupt users significantly. For this reason it can only be used by root.


Associated Structure

The following structures are associated with this ioctl:

struct nui_put {
         char    prim_class;     /* Always NUI_MSG                       */
         char    op;             /* Always NUI_ENT                       */
         struct nuiformat       nuid;           /* NUI                  */
        struct facformat      nuifacility;    /* NUI facilities    */
 };

The members of the nui_put structure are:

Table 7-30 nui_put fields

Member 

Description 

prim_class

This is always set to NUI_MSG.

op

This is always set to NUI_ENT.

nuid

The Network User Identifier of the entry you want to store. This is stored in the nuiformat structure.

nuifacility

Any relevant NUI facilities. These are stored in the facformat structure.

The nuiformat structure looks like this:

#define NUIMAXSIZE	64
 #define NUIFACMAXSIZE	32
 struct nuiformat {
   unsigned char nui_len;
   unsigned char nui_string[NUIMAXSIZE]; /* Network User Identifier */
 };

The members of the nuiformat structure are

Table 7-31 nuiformat fields

Member 

Description 

nui_len

The length of the NUI. 

nui_string

The NUI itself. 

The facformat structure looks like this:

struct facformat {
   unsigned short SUB_MODES;	/* Mode tuning bits for net */
   unsigned char  LOCDEFPKTSIZE;	/* Local default pkt size */
   unsigned char  REMDEFPKTSIZE;	/* Local default pkt size */
   unsigned char  LOCDEFWSIZE;	/* Local default window size */
   unsigned char  REMDEFWSIZE;	/* Local default window size */
   unsigned char  locdefthclass;	/* Local default value         */
   unsigned char  remdefthclass;	/* Remote default value        */
   unsigned char  CUG_CONTROL;	/* CUG facilities */
 };

The members of the facformat structure are:

Table 7-32 facformat fields

Member 

Description 

SUB_MODES

The subscription options for a PSDN link. Possible values and meanings are: 

SUB_EXTENDED

Subscribe to extended call packets.This allows for packet and window size negotiation.

BAR_EXTENDED

Treat incoming extended call packets as a procedure error. 

SUB_FSELECT

Subscribe to fast select with no restriction on response. This applies to INCOMING CALL packets.

SUB_FSRRESP

Subscribe to fast select with restriction on response. This applies to INCOMING CALL packets.

SUB_REVCHARGE

Subscribe to reverse charging. This applies to INCOMING CALL packets.

SUB_LOC_CHG_PREV

Subscribe to local charging prevention. This overrides the setting of SUB_REVCHARGE.

SUB_TOA_NPI_FMT

Subscribe to using TOA/NPI address format.

BAR_TOA_NPI_FMT

Treat incoming TOA/NPI address formats as a procedure error. 

SUB_NUI_OVERRIDE

Subscribe to NUI override. This specifies that when an NUI is provided in a CALL REQUEST, any associated subscription time options override the facilities which apply to the interface, for the duration of that particular call.

BAR_INCALL

Bar incoming calls.

BAR_OUTCALL

Bar outgoing calls.

LOCDEFPKTSIZE

Local default packets size 

REMDEFPKTSIZE

Remote default packet size 

LOCDEFWSIZE

Local default window size 

REMDEFWSIZE

Remote default window size 

locdefthclass

Local default value 

remdefthclass

Remote default value 

CUG_CONTROL

CUG facilities 

7.16 N_nuireset --Delete all Existing NUI Mappings

This ioctl is used to delete all existing mappings for Network User Identifiers (NUIs).


Note -

This ioctl can disrupt other users significantly. For this reason it can only be used by root.


Associated Structure

The following structure is associated with this ioctl:

struct nui_reset {
         char            prim_class;     /* Always NUI_MSG       */
         char            op;             /* Always NUI_RESET     */
 };

The members of the nui_reset structure are:

Table 7-33 nui_reset fields

Member 

Description 

prim_class

The value of this member is always NUI_MSG.

op

The value of this member is always NUI_DEL.

7.17 N_putpvcmap--Change PVC Packet and Window Sizes

This ioctl is used to change the packet and window sizes of a PVC from the defaults configured for the link that the PVC is active on.


Note -

This ioctl can disrupt other users significantly. For this reason it can only be used by root.


Associated Structure

The following structure is associated with this ioctl:

struct pvcconff {
        uint32_t     link_id;      /* Link #           */
        unsigned short    lci;          /* Logical channel  */
        unsigned char     locpacket;    /* Loc packet size  */
        unsigned char     rempacket;    /* Rem packet size  */
        unsigned char     locwsize;     /* Loc window size  */
        unsigned char     remwsize;     /* Rem window size  */
};
The members of the pvcconff structure are:

Table 7-34 pvcconf fields

Member 

Description 

link_id

The identifier of the PVC you want to change 

lci

The logical channel identifier. 

locpacket

The local packet size to use. 

rempacket

The remote packet size to use 

locwsize

The local window size. 

remwsize

The remote window size. 

7.18 N_traceoff ioctl--Cancel N_traceon

This ioctl is used to cancel a previously issued N_traceon ioctl.


Note -

This ioctl affects currently open connections and could therefore disrupt users significantly. For this reason it can only be used by root.


7.19 N_traceon --Turn on Packet Level Tracing

This ioctl turns on packet level tracing for a particular link or all configured links. Each incoming and outgoing X.25 packet will be sent up the stream on which the N_traceon ioctl was made.


Note -

This ioctl can have a serious impact on security. For this reason it can only be used by root.


Associated Structures

The following structures are associated with this ioctl:

struct trc_regioc {
    uint8     all_links;                /* Trace on all links           */
    uint8     spare[3];                 /* for alignment                */
    uint32    linkid;                   /* Link                         */
    uint8     level;                    /* Level of tracing required    */
    uint8     spare2[3];                /* for alignment                */
    uint32    active[MAX_LINKS+1];      /* tracing actively on          */
};

The members of the trc_regioc structure are:

Table 7-35 trc_regioc fields

Member 

value 

all_links

Returns the linkids of all links for which tracing was activated in the active array.

linkid

Specify tracing for a particular link. 

level

The level of tracing required. 

active

Indicates that tracing is currently active. 

Each X.25 packet is preceded by a trc_ctl structure:

/*
    Types of tracing message
*/
#define TR_CTL       100            /* Basic                   */
#define TR_LLC2_DAT  101            /* Basic + LLC2 parameters */
#define TR_LAPB_DAT  TR_CTL         /* Basic for now           */
#define TR_MLP_DAT   TR_CTL         /* Basic for now           */
#define TR_X25_DAT   TR_CTL         /* Basic for now           */
#define TR_DLPI      102            /* type used for tracing DLPI primitives */

/*
    Format for control part of trace messages
*/
struct trc_ctl {
    uint8           trc_prim;    /* Trace msg identifier     */
    uint8           trc_mid;     /* Id of protocol module    */
    uint16          trc_spare;   /* for alignment            */
    uint32          trc_linkid;  /* Link Id                  */
    uint8           trc_rcv;     /* Message tx or rx         */
    uint8           trc_spare2[3]; /* for alignment          */
    uint32          trc_time;    /* Time stamp               */
    uint16          trc_seq;     /* Message seq number       */
};
Table 7-36 trc_ctrl fields

Member 

Description 

trc_prim

Always set to TR_X25_DAT.

trc_mid

Always set to the module ID of the X.25 multiplexor (200). 

trc_linkid 

The link identifier 

trc_rcv 

Message receive or rx 

trc_time 

Time stamp 

trc_seq 

Message seq number 

7.20 N_X25_ADD_ROUTE--Set Fields of X25_ROUTE Structure

Sets the fields in the X25_ROUTE structure to the desired values.


Note -

This ioctl can disrupt other users significantly. For this reason it can only be used by root.


Associated Structure

The x25_route_s data structure takes the following form:

typedef struct x25_route_s {
        uint32_t        index;          /* used for reading next route */
        u_char          r_type;
#define R_NONE          0
#define R_X121_HOST     1
#define R_X121_PREFIX   2
#define R_AEF_HOST      3
#define R_AEF_PREFIX    4
#define R_AEF_SOURCE    5
        CONN_ADR        x121;
        u_char          pid_len;
#define MAX_PID_LEN     4
        u_char          pid[MAX_PID_LEN];
        AEF             aef;
        int             linkid;
        X25_MACADDR     mac;
        int             use_count;
        char            pstn_number[16];
} X25_ROUTE;
Example
#include <sys/strupts.h>
 struct strioctl ioc ;
 int          fd ;
 X25_ROUTE      r;

 fd = open("/dev/x25", O,RDW);
  /*prepare route*/
           initialize

 io.ic_cmd = N_X25_ADD_ROUTE;
 io.ic_timeout = 0; /*system default : 15 secs */
 io.ic_len = sizeof(X25_ROUTE);
 io.ic_dp = (char *)&r;

 if (ioctl (fd, I_STR, &ioc) <0) {
                  perror(" xxxioctl");
      }
 }

7.21 N_X25_FLUSH_ROUTES--Flush all Routes

Flushes all routes out of X25_ROUTE structure.


Note -

This ioctl can disrupt other users significantly. For this reason it can only be used by root.


Associated Structure

The x25_route_s data structure takes the following form:

typedef struct x25_route_s {
        uint32_t        index;          /* used for reading next route */
        u_char          r_type;
#define R_NONE          0
#define R_X121_HOST     1
#define R_X121_PREFIX   2
#define R_AEF_HOST      3
#define R_AEF_PREFIX    4
#define R_AEF_SOURCE    5
        CONN_ADR        x121;
        u_char          pid_len;
#define MAX_PID_LEN     4
        u_char          pid[MAX_PID_LEN];
        AEF             aef;
        int             linkid;
        X25_MACADDR     mac;
        int             use_count;
        char            pstn_number[16];
} X25_ROUTE;
Example
#include <sys/strupts.h>
 struct strioctl ioc ;
 int          fd ;
 X25_ROUTE      r;

 fd = open("/dev/x25", O,RDW);
  /*prepare route*/
           initialize

  io.ic_cmd = N_X25_FLUSH_ROUTES;
        io.ic_timout = 0;
        io.ic_len = 0;
        io.ic_dp = (char *)NULL;


        if (ioctl(x25s, I_STR, &ioc))
                perror("ioctl(X25_FLUSH_ROUTES)");
      }
 }

7.22 N_X25_GET_ROUTE--Obtain Routing Information

Obtains the routing information for a given destination address.

Associated Structure

The x25_route_s data structure takes the following form:

typedef struct x25_route_s {
        uint32_t        index;          /* used for reading next route */
        u_char          r_type;
#define R_NONE          0
#define R_X121_HOST     1
#define R_X121_PREFIX   2
#define R_AEF_HOST      3
#define R_AEF_PREFIX    4
#define R_AEF_SOURCE    5
        CONN_ADR        x121;
        u_char          pid_len;
#define MAX_PID_LEN     4
        u_char          pid[MAX_PID_LEN];
        AEF             aef;
        int             linkid;
        X25_MACADDR     mac;
        int             use_count;
        char            pstn_number[16];
} X25_ROUTE;
Example
#include <sys/strupts.h>
 struct strioctl ioc ;
 int          fd ;
 X25_ROUTE      r;

 fd = open("/dev/x25", O,RDW);
  /*prepare route*/
           initialize

 io.ic_cmd = N_X25_GET_ROUTE;
 io.ic_timeout = 0; /*system default : 15 secs */
 io.ic_len = sizeof(X25_ROUTE);
 io.ic_dp = (char *)&r;

 if (ioctl (fd, I_STR, &ioc) <0) {
                  perror(" xxxioctl");
      }
 }

7.23 N_X25_GET_NEXT_ROUTE--Get Next Routing Entry

Obtains routing information for the next entry in the routing table. When there are no routes left, error will be -1, and errno will be set to ENOENT.

Associated Structure

The x25_route_s data structure takes the following form:

typedef struct x25_route_s {
        uint32_t        index;          /* used for reading next route */
        u_char          r_type;
#define R_NONE          0
#define R_X121_HOST     1
#define R_X121_PREFIX   2
#define R_AEF_HOST      3
#define R_AEF_PREFIX    4
#define R_AEF_SOURCE    5
        CONN_ADR        x121;
        u_char          pid_len;
#define MAX_PID_LEN     4
        u_char          pid[MAX_PID_LEN];
        AEF             aef;
        int             linkid;
        X25_MACADDR     mac;
        int             use_count;
        char            pstn_number[16];
} X25_ROUTE;
Example
#include <sys/strupts.h>
 struct strioctl ioc ;
 int          fd ;
 X25_ROUTE      r;

 fd = open("/dev/x25", O,RDW);
  /*prepare route*/
           initialize

 io.ic_cmd = N_X25_GET_NEXT_ROUTE;
 io.ic_timeout = 0; /*system default : 15 secs */
 io.ic_len = sizeof(X25_ROUTE);
 io.ic_dp = (char *)&r;

 if (ioctl (fd, I_STR, &ioc) <0) {
                  perror(" xxxioctl");
      }
 }

7.24 N_X25_RM_ROUTE--Remove Route From X25_ROUTE

Removes the route for a given destination address.


Note -

This ioctl can disrupt other users significantly. For this reason it can only be used by root.


Associated Structure

The x25_route_s data structure takes the following form:

typedef struct x25_route_s {
        uint32_t        index;          /* used for reading next route */
        u_char          r_type;
#define R_NONE          0
#define R_X121_HOST     1
#define R_X121_PREFIX   2
#define R_AEF_HOST      3
#define R_AEF_PREFIX    4
#define R_AEF_SOURCE    5
        CONN_ADR        x121;
        u_char          pid_len;
#define MAX_PID_LEN     4
        u_char          pid[MAX_PID_LEN];
        AEF             aef;
        int             linkid;
        X25_MACADDR     mac;
        int             use_count;
        char            pstn_number[16];
} X25_ROUTE;
Example
#include <sys/strupts.h>
 struct strioctl ioc ;
 int          fd ;
 X25_ROUTE      r;

 fd = open("/dev/x25", O,RDW);
  /*prepare route*/
           initialize

 io.ic_cmd = N_X25_RM_ROUTE;
 io.ic_timeout = 0; /*system default : 15 secs */
 io.ic_len = sizeof(X25_ROUTE);
 io.ic_dp = (char *)&r;

 if (ioctl (fd, I_STR, &ioc) <0) {
                  perror(" xxxioctl");
      }
 }

7.25 N_zerostats--Reset X.25 Multiplexor Statistics Count

This ioctl is used to reset the statistics counts for the X.25 multiplexor.


Note -

This ioctl affects currently open connections and could therefore disrupt users significantly. For this reason it can only be used by root.