Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 /*
0003  * These are the public elements of the Linux kernel X.25 implementation.
0004  *
0005  *  History
0006  *  mar/20/00   Daniela Squassoni Disabling/enabling of facilities 
0007  *                    negotiation.
0008  *  apr/02/05   Shaun Pereira Selective sub address matching with
0009  *                  call user data
0010  */
0011 
0012 #ifndef X25_KERNEL_H
0013 #define X25_KERNEL_H
0014 
0015 #include <linux/types.h>
0016 #include <linux/socket.h>
0017 
0018 #define SIOCX25GSUBSCRIP    (SIOCPROTOPRIVATE + 0)
0019 #define SIOCX25SSUBSCRIP    (SIOCPROTOPRIVATE + 1)
0020 #define SIOCX25GFACILITIES  (SIOCPROTOPRIVATE + 2)
0021 #define SIOCX25SFACILITIES  (SIOCPROTOPRIVATE + 3)
0022 #define SIOCX25GCALLUSERDATA    (SIOCPROTOPRIVATE + 4)
0023 #define SIOCX25SCALLUSERDATA    (SIOCPROTOPRIVATE + 5)
0024 #define SIOCX25GCAUSEDIAG   (SIOCPROTOPRIVATE + 6)
0025 #define SIOCX25SCUDMATCHLEN (SIOCPROTOPRIVATE + 7)
0026 #define SIOCX25CALLACCPTAPPRV   (SIOCPROTOPRIVATE + 8)
0027 #define SIOCX25SENDCALLACCPT    (SIOCPROTOPRIVATE + 9)
0028 #define SIOCX25GDTEFACILITIES (SIOCPROTOPRIVATE + 10)
0029 #define SIOCX25SDTEFACILITIES (SIOCPROTOPRIVATE + 11)
0030 #define SIOCX25SCAUSEDIAG   (SIOCPROTOPRIVATE + 12)
0031 
0032 /*
0033  *  Values for {get,set}sockopt.
0034  */
0035 #define X25_QBITINCL        1
0036 
0037 /*
0038  *  X.25 Packet Size values.
0039  */
0040 #define X25_PS16        4
0041 #define X25_PS32        5
0042 #define X25_PS64        6
0043 #define X25_PS128       7
0044 #define X25_PS256       8
0045 #define X25_PS512       9
0046 #define X25_PS1024      10
0047 #define X25_PS2048      11
0048 #define X25_PS4096      12
0049 
0050 /*
0051  * An X.121 address, it is held as ASCII text, null terminated, up to 15
0052  * digits and a null terminator.
0053  */
0054 struct x25_address {
0055     char x25_addr[16];
0056 };
0057 
0058 /*
0059  *  Linux X.25 Address structure, used for bind, and connect mostly.
0060  */
0061 struct sockaddr_x25 {
0062     __kernel_sa_family_t sx25_family;   /* Must be AF_X25 */
0063     struct x25_address sx25_addr;       /* X.121 Address */
0064 };
0065 
0066 /*
0067  *  DTE/DCE subscription options.
0068  *
0069  *      As this is missing lots of options, user should expect major
0070  *  changes of this structure in 2.5.x which might break compatibilty.
0071  *      The somewhat ugly dimension 200-sizeof() is needed to maintain
0072  *  backward compatibility.
0073  */
0074 struct x25_subscrip_struct {
0075     char device[200-sizeof(unsigned long)];
0076     unsigned long   global_facil_mask;  /* 0 to disable negotiation */
0077     unsigned int    extended;
0078 };
0079 
0080 /* values for above global_facil_mask */
0081 
0082 #define X25_MASK_REVERSE    0x01    
0083 #define X25_MASK_THROUGHPUT 0x02
0084 #define X25_MASK_PACKET_SIZE    0x04
0085 #define X25_MASK_WINDOW_SIZE    0x08
0086 
0087 #define X25_MASK_CALLING_AE 0x10
0088 #define X25_MASK_CALLED_AE 0x20
0089 
0090 
0091 /*
0092  *  Routing table control structure.
0093  */
0094 struct x25_route_struct {
0095     struct x25_address address;
0096     unsigned int       sigdigits;
0097     char           device[200];
0098 };
0099 
0100 /*
0101  *  Facilities structure.
0102  */
0103 struct x25_facilities {
0104     unsigned int    winsize_in, winsize_out;
0105     unsigned int    pacsize_in, pacsize_out;
0106     unsigned int    throughput;
0107     unsigned int    reverse;
0108 };
0109 
0110 /*
0111 * ITU DTE facilities
0112 * Only the called and calling address
0113 * extension are currently implemented.
0114 * The rest are in place to avoid the struct
0115 * changing size if someone needs them later
0116 */
0117 
0118 struct x25_dte_facilities {
0119     __u16 delay_cumul;
0120     __u16 delay_target;
0121     __u16 delay_max;
0122     __u8 min_throughput;
0123     __u8 expedited;
0124     __u8 calling_len;
0125     __u8 called_len;
0126     __u8 calling_ae[20];
0127     __u8 called_ae[20];
0128 };
0129 
0130 /*
0131  *  Call User Data structure.
0132  */
0133 struct x25_calluserdata {
0134     unsigned int    cudlength;
0135     unsigned char   cuddata[128];
0136 };
0137 
0138 /*
0139  *  Call clearing Cause and Diagnostic structure.
0140  */
0141 struct x25_causediag {
0142     unsigned char   cause;
0143     unsigned char   diagnostic;
0144 };
0145 
0146 /*
0147  *  Further optional call user data match length selection
0148  */
0149 struct x25_subaddr {
0150     unsigned int cudmatchlength;
0151 };
0152 
0153 #endif