Used by the x25_call and x25_call_accept subroutines to pass facilities information.
#define X25FLG_RPOA 0x00000001 #define X25FLG_PSIZ 0x00000002 #define X25FLG_WSIZ 0x00000004 #define X25FLG_TCLS 0x00000008 #define X25FLG_REV_CHRG 0x00000010 #define X25FLG_FASTSEL 0x000000 20 #define X25FLG_FASTSEL_RSP 0x00000040 #define X25FLG_CUG 0x00000080 #define X25FLG_OA_CUG 0x0 0000100 #define X25FLG_BI_CUG 0x0 0000200 #define X25FLG_NUI_DATA 0x00000400 #define X25FLG_CI_SEG_CNT 0x00000800 #define X25FLG_CI_MON_UNT 0x00001000 #define X25FLG_CI_CALL_DUR 0x00002000 #define X25FLG_CI_REQUEST 0x00004000 #define X25FLG_CLAMN 0x00008000 #define X25FLG_CALL_REDR 0x00010000 #define X25FLG_TRAN_DEL 0x00020000 #define X25FLG_CALLING_ADDR_EXT 0x00040000 #define X25FLG_CALLED_ADDR_EXT 0x00080000 #define X25FLG_MIN_TCLS 0x00100000 #define X25FLG_END_TO_END_DEL 0x00200000 #define X25FLG_EXP_DATA 0x00400000 #define X25FLG_FACEXT 0x0 0800000
struct cb_fac_struct
{
u_long flags ;
unsigned fac_ext_len;
u_char *fac_ext; /*
for non-X.25 facilities */
u_char psiz_clg;
u_char psiz_cld;
u_char wsiz_clg;
u_char wsiz_cld;
u_char tcls_clg;
u_char tcls_cld;
unsigned rpoa_id_len;
ushort *rpoa_id;
ushort cug_id;
unsigned nui_data_len;
u_char *nui_data;
unsigned ci_seg_cnt_len;
u_char *ci_seg_cnt;
unsigned ci_mon_unt_len;
u_char *ci_mon_unt;
unsigned ci_cal_dur_len;
u_char *ci_cal_dur;
u_char call_redr_addr[X25_MAX_ASCII_ADDRESS_LENGTH];
u_char call_redr_reason;
short tran_del;
u_char calling_addr_ext_use;
char calling_addr_ext[X25_MAX_EXT_ADDR_DIGITS+1];
u_char called_addr_ext_use;
char called_addr_ext[X25_MAX_EXT_ADDR_DIGITS+1];
u_char clamn;
u_char min_tcls_clg;
u_char min_tcls_cld;
unsigned end_to_end_del_len;
ushort end_to_end_del[3];
};
Note: The example shows how to code the cb_fac_struct structure.
| X25FLG_RPOA | Recognized private operating agency selection required (rpoa_id). |
| X25FLG_PSIZ | Packet size selection (psiz_clg, psiz_cld). |
| X25FLG_WSIZ | Window size selection (wsiz_clg, wsiz_cld). |
| X25FLG_TCLS | Throughput class required (tcls_clg, tcls_cld). |
| X25FLG_REV_CHRG | Reverse Charge required (no corresponding field). |
| X25FLG_FASTSEL | Fast select (no corresponding field). |
| X25FLG_FASTSEL_RSP | Indicates whether a restricted response is required when the X25FLG_FASTSEL flag is also requested (no corresponding field). |
| X25FLG_CUG | Closed user group selection required (cug_id). |
| X25FLG_OA_CUG | Closed user group with outgoing access (basic format) selection required (cug_id). |
| X25FLG_BI_CUG | Bilateral closed user group selection required (cug_id). |
| X25FLG_NUI_DATA | Network user identification (nui_data). |
| X25FLG_CI_SEG_CNT | Charging information: segment count (ci_seg_cnt). |
| X25FLG_CI_MON_UNT | Charging information: monetary unit (ci_mon_unt). |
| X25FLG_CI_CAL_DUR | Charging information: call duration (ci_cal_dur). |
| X25FLG_CI_REQUEST | Charging information is required (no corresponding field). |
| X25FLG_CLAMN | Called line address modified notification (clamn). |
| X25FLG_CALL_REDR | Call redirection notification (call_redr_addr, call_redr_reason). |
| X25FLG_TRAN_DEL | Transit delay selection and notification (tran_del). |
| X25FLG_CALLING_ADDR_EXT | Calling address extension (calling_addr_ext_use, calling_addr_ext). |
| X25FLG_CALLED_ADDR_EXT | Called address extension (called_addr_ext_use, called_addr_ext). |
| X25FLG_MIN_TCLS | Quality of service negotiation: minimum throughput class (min_tcls_clg, min_tcls_cld). |
| X25FLG_END_TO_END_DEL | Quality of service negotiation: end-to-end transit delay (end_to_end_del). |
| X25FLG_EXP_DATA | Expedited data negotiation (no corresponding field). |
| X25FLG_FACEXT | Facilities extension: for all other facilities, including national options (fac_ext). |
The meanings of the structure fields are as follows, but the lengths associated with individual pointer fields are not explained:
| psiz_cld | Requested size for packets transmitted from the called DTE. Supported values are the same as for the psiz_clg field. |
| wsiz_clg | Requested size for the window for packets transmitted by the calling DTE. Values range from 0x01 to 0x07 inclusive. |
| wsiz_cld | Requested size for the window for packets to be transmitted by the called DTE. Values range from 0x01 to 0x07 inclusive. |
| tcls_clg | Throughput class requested for data to be sent by the calling DTE. Supported values are: |
| tcls_cld | Throughput class request for data sent from the called DTE. Supported values are the same as for the tcls_clg field. |
| rpoa_id | Indicates the requested RPOA (Requested Private Operating Agency) transit network. Each element of the array is an RPOA identifier. |
| cug_id | Indicates the identifier of a closed user group (CUG). Used for all modes of CUG and also for bilateral CUGs. |
| nui_data | Network user identification data in a format specified by the network administrator. |
| ci_seg_cnt | Charging information: segment count data. |
| ci_mon_unt | Charging information: monetary unit data. |
| ci_cal_dur | Charging information: call-duration data. |
| call_redr_addr | The address to which the call has been redirected. The address is stored in ASCIIZ format. |
| call_redr_reason | Contains reason for call redirection. |
| tran_del | Transit delay in milliseconds. |
| calling_addr_ext_use | Indicates the use of the calling address extension. |
| calling_addr_ext | Up to 40 digits containing the calling address extension. The address extension is stored in ASCIIZ format. The values for the extended calling and called address flags are:
#DEFINE X25_FAC_ADDR_EXT_USE_ENTIRE_OSI_NSAP(0) #DEFINE X25_FAC_ADDR_EXT_USE_PARTIAL_OSI_NSAP(1) #DEFINE X25_FAC_ADDR_EXT_USE_NON_OSI(2) |
| called_addr_ext_use | Indicates the use of the called address extension. |
| called_addr_ext | Up to 40 digits containing the called address extension. The address extension is stored in ASCIIZ format. See the calling_addr_ext field for values. |
| clamn | Called line address modified notification. Contains the reason for redirection. |
| min_tcls_clg | Throughput class requested for data to be sent by the calling DTE. Supported values are: |
| min_tcls_cld | Throughput class request for data sent from the called DTE. Supported values are the same as for the min_tcls_clg field. |
| end_to_end_del | Specifies cumulative requested end-to-end and maximum-acceptable transit delays. Requested end-to-end and maximum-acceptable values are optional. |
This is a simple example of the use of the cb_fac_struct structure:
/*
&
*/
struct cb_call_struct cb_call;
struct cb_fac_struct fac_struct;
u_char facilities_extension[10],facilities_extension[8];
ushort rpoa_ext_id[3] = {7,8,9};
char extended_calling_addr[]= "1234567890"; /* extension */
/* Initialize flags
*/
fac_struct.flags = 0;
/* Use of RPOAE
*/
fac_struct.rpoa_id = rpoa_ext_id;
fac_struct.rpoa_id_len = 3;
fac_struct.flags |= X25FLG_RPOA;
/* Use of extended addressing
*/
fac_struct.calling_addr_ext = extended_calling_addr;
fac_struct.flags |= X25FLG_CALLING_ADDR_EXT;
/* Use of extended facilities
*/
facilities_extension[0] = 0x00; /*
start of a Facility Marker */
facilities_extension[1] = 0x00; /*
non_X25 facility supported */
/* by
calling DTE
*/
facilities_extension[2] = 0x55; /*
a facility
*/
facilities_extension[3] = 0x66; /*
a facility
*/facilities_extension[4] = 0x00;
/* start of a Facility Marker */
facilities_extension[5] = 0xFF; /*
non_X25 facility supported */
/* by
called DTE
*/
facilities_extension[6] = 0x88; /*
a facility
*/
facilities_extension[7] = 0x99; /*
a facility
*/
strcpy(fac_struct.fac_ext, facilities_extension);
fac_struct.fac_ext_len = 8;
fac_struct.flags |= X25FLG_FACEXT;
/*****************************************************************/
/* In this example a cb_call structure
is initialized
*/
/* with a cb_fac structure.
*/
/*****************************************************************/
cb_call.cb_fac = &fac_struct;
cb_call.flags = X25FLG_CB_FAC;
The x25sdefs.h file.
The cb_call_struct structure, cb_clear_struct structure.