1*6f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2607ca46eSDavid Howells /* 3607ca46eSDavid Howells * These are the public elements of the Linux kernel X.25 implementation. 4607ca46eSDavid Howells * 5607ca46eSDavid Howells * History 6607ca46eSDavid Howells * mar/20/00 Daniela Squassoni Disabling/enabling of facilities 7607ca46eSDavid Howells * negotiation. 8607ca46eSDavid Howells * apr/02/05 Shaun Pereira Selective sub address matching with 9607ca46eSDavid Howells * call user data 10607ca46eSDavid Howells */ 11607ca46eSDavid Howells 12607ca46eSDavid Howells #ifndef X25_KERNEL_H 13607ca46eSDavid Howells #define X25_KERNEL_H 14607ca46eSDavid Howells 15607ca46eSDavid Howells #include <linux/types.h> 16607ca46eSDavid Howells #include <linux/socket.h> 17607ca46eSDavid Howells 18607ca46eSDavid Howells #define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0) 19607ca46eSDavid Howells #define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1) 20607ca46eSDavid Howells #define SIOCX25GFACILITIES (SIOCPROTOPRIVATE + 2) 21607ca46eSDavid Howells #define SIOCX25SFACILITIES (SIOCPROTOPRIVATE + 3) 22607ca46eSDavid Howells #define SIOCX25GCALLUSERDATA (SIOCPROTOPRIVATE + 4) 23607ca46eSDavid Howells #define SIOCX25SCALLUSERDATA (SIOCPROTOPRIVATE + 5) 24607ca46eSDavid Howells #define SIOCX25GCAUSEDIAG (SIOCPROTOPRIVATE + 6) 25607ca46eSDavid Howells #define SIOCX25SCUDMATCHLEN (SIOCPROTOPRIVATE + 7) 26607ca46eSDavid Howells #define SIOCX25CALLACCPTAPPRV (SIOCPROTOPRIVATE + 8) 27607ca46eSDavid Howells #define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9) 28607ca46eSDavid Howells #define SIOCX25GDTEFACILITIES (SIOCPROTOPRIVATE + 10) 29607ca46eSDavid Howells #define SIOCX25SDTEFACILITIES (SIOCPROTOPRIVATE + 11) 30607ca46eSDavid Howells #define SIOCX25SCAUSEDIAG (SIOCPROTOPRIVATE + 12) 31607ca46eSDavid Howells 32607ca46eSDavid Howells /* 33607ca46eSDavid Howells * Values for {get,set}sockopt. 34607ca46eSDavid Howells */ 35607ca46eSDavid Howells #define X25_QBITINCL 1 36607ca46eSDavid Howells 37607ca46eSDavid Howells /* 38607ca46eSDavid Howells * X.25 Packet Size values. 39607ca46eSDavid Howells */ 40607ca46eSDavid Howells #define X25_PS16 4 41607ca46eSDavid Howells #define X25_PS32 5 42607ca46eSDavid Howells #define X25_PS64 6 43607ca46eSDavid Howells #define X25_PS128 7 44607ca46eSDavid Howells #define X25_PS256 8 45607ca46eSDavid Howells #define X25_PS512 9 46607ca46eSDavid Howells #define X25_PS1024 10 47607ca46eSDavid Howells #define X25_PS2048 11 48607ca46eSDavid Howells #define X25_PS4096 12 49607ca46eSDavid Howells 50607ca46eSDavid Howells /* 51607ca46eSDavid Howells * An X.121 address, it is held as ASCII text, null terminated, up to 15 52607ca46eSDavid Howells * digits and a null terminator. 53607ca46eSDavid Howells */ 54607ca46eSDavid Howells struct x25_address { 55607ca46eSDavid Howells char x25_addr[16]; 56607ca46eSDavid Howells }; 57607ca46eSDavid Howells 58607ca46eSDavid Howells /* 59607ca46eSDavid Howells * Linux X.25 Address structure, used for bind, and connect mostly. 60607ca46eSDavid Howells */ 61607ca46eSDavid Howells struct sockaddr_x25 { 62607ca46eSDavid Howells __kernel_sa_family_t sx25_family; /* Must be AF_X25 */ 63607ca46eSDavid Howells struct x25_address sx25_addr; /* X.121 Address */ 64607ca46eSDavid Howells }; 65607ca46eSDavid Howells 66607ca46eSDavid Howells /* 67607ca46eSDavid Howells * DTE/DCE subscription options. 68607ca46eSDavid Howells * 69607ca46eSDavid Howells * As this is missing lots of options, user should expect major 70607ca46eSDavid Howells * changes of this structure in 2.5.x which might break compatibilty. 71607ca46eSDavid Howells * The somewhat ugly dimension 200-sizeof() is needed to maintain 72607ca46eSDavid Howells * backward compatibility. 73607ca46eSDavid Howells */ 74607ca46eSDavid Howells struct x25_subscrip_struct { 75607ca46eSDavid Howells char device[200-sizeof(unsigned long)]; 76607ca46eSDavid Howells unsigned long global_facil_mask; /* 0 to disable negotiation */ 77607ca46eSDavid Howells unsigned int extended; 78607ca46eSDavid Howells }; 79607ca46eSDavid Howells 80607ca46eSDavid Howells /* values for above global_facil_mask */ 81607ca46eSDavid Howells 82607ca46eSDavid Howells #define X25_MASK_REVERSE 0x01 83607ca46eSDavid Howells #define X25_MASK_THROUGHPUT 0x02 84607ca46eSDavid Howells #define X25_MASK_PACKET_SIZE 0x04 85607ca46eSDavid Howells #define X25_MASK_WINDOW_SIZE 0x08 86607ca46eSDavid Howells 87607ca46eSDavid Howells #define X25_MASK_CALLING_AE 0x10 88607ca46eSDavid Howells #define X25_MASK_CALLED_AE 0x20 89607ca46eSDavid Howells 90607ca46eSDavid Howells 91607ca46eSDavid Howells /* 92607ca46eSDavid Howells * Routing table control structure. 93607ca46eSDavid Howells */ 94607ca46eSDavid Howells struct x25_route_struct { 95607ca46eSDavid Howells struct x25_address address; 96607ca46eSDavid Howells unsigned int sigdigits; 97607ca46eSDavid Howells char device[200]; 98607ca46eSDavid Howells }; 99607ca46eSDavid Howells 100607ca46eSDavid Howells /* 101607ca46eSDavid Howells * Facilities structure. 102607ca46eSDavid Howells */ 103607ca46eSDavid Howells struct x25_facilities { 104607ca46eSDavid Howells unsigned int winsize_in, winsize_out; 105607ca46eSDavid Howells unsigned int pacsize_in, pacsize_out; 106607ca46eSDavid Howells unsigned int throughput; 107607ca46eSDavid Howells unsigned int reverse; 108607ca46eSDavid Howells }; 109607ca46eSDavid Howells 110607ca46eSDavid Howells /* 111607ca46eSDavid Howells * ITU DTE facilities 112607ca46eSDavid Howells * Only the called and calling address 113607ca46eSDavid Howells * extension are currently implemented. 114607ca46eSDavid Howells * The rest are in place to avoid the struct 115607ca46eSDavid Howells * changing size if someone needs them later 116607ca46eSDavid Howells */ 117607ca46eSDavid Howells 118607ca46eSDavid Howells struct x25_dte_facilities { 119607ca46eSDavid Howells __u16 delay_cumul; 120607ca46eSDavid Howells __u16 delay_target; 121607ca46eSDavid Howells __u16 delay_max; 122607ca46eSDavid Howells __u8 min_throughput; 123607ca46eSDavid Howells __u8 expedited; 124607ca46eSDavid Howells __u8 calling_len; 125607ca46eSDavid Howells __u8 called_len; 126607ca46eSDavid Howells __u8 calling_ae[20]; 127607ca46eSDavid Howells __u8 called_ae[20]; 128607ca46eSDavid Howells }; 129607ca46eSDavid Howells 130607ca46eSDavid Howells /* 131607ca46eSDavid Howells * Call User Data structure. 132607ca46eSDavid Howells */ 133607ca46eSDavid Howells struct x25_calluserdata { 134607ca46eSDavid Howells unsigned int cudlength; 135607ca46eSDavid Howells unsigned char cuddata[128]; 136607ca46eSDavid Howells }; 137607ca46eSDavid Howells 138607ca46eSDavid Howells /* 139607ca46eSDavid Howells * Call clearing Cause and Diagnostic structure. 140607ca46eSDavid Howells */ 141607ca46eSDavid Howells struct x25_causediag { 142607ca46eSDavid Howells unsigned char cause; 143607ca46eSDavid Howells unsigned char diagnostic; 144607ca46eSDavid Howells }; 145607ca46eSDavid Howells 146607ca46eSDavid Howells /* 147607ca46eSDavid Howells * Further optional call user data match length selection 148607ca46eSDavid Howells */ 149607ca46eSDavid Howells struct x25_subaddr { 150607ca46eSDavid Howells unsigned int cudmatchlength; 151607ca46eSDavid Howells }; 152607ca46eSDavid Howells 153607ca46eSDavid Howells #endif 154