Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * These are the public elements of the Linux kernel X.25 implementation. |
| 3 | * |
| 4 | * History |
| 5 | * mar/20/00 Daniela Squassoni Disabling/enabling of facilities |
| 6 | * negotiation. |
Shaun Pereira | cb65d50 | 2005-06-22 22:15:01 -0700 | [diff] [blame] | 7 | * apr/02/05 Shaun Pereira Selective sub address matching with |
| 8 | * call user data |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #ifndef X25_KERNEL_H |
| 12 | #define X25_KERNEL_H |
| 13 | |
Shaun Pereira | a64b7b9 | 2006-03-22 00:01:31 -0800 | [diff] [blame] | 14 | #include <linux/types.h> |
Ben Hutchings | bcb949b | 2011-08-24 18:43:55 +0000 | [diff] [blame] | 15 | #include <linux/socket.h> |
Shaun Pereira | a64b7b9 | 2006-03-22 00:01:31 -0800 | [diff] [blame] | 16 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | #define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0) |
| 18 | #define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1) |
| 19 | #define SIOCX25GFACILITIES (SIOCPROTOPRIVATE + 2) |
| 20 | #define SIOCX25SFACILITIES (SIOCPROTOPRIVATE + 3) |
| 21 | #define SIOCX25GCALLUSERDATA (SIOCPROTOPRIVATE + 4) |
| 22 | #define SIOCX25SCALLUSERDATA (SIOCPROTOPRIVATE + 5) |
| 23 | #define SIOCX25GCAUSEDIAG (SIOCPROTOPRIVATE + 6) |
Shaun Pereira | cb65d50 | 2005-06-22 22:15:01 -0700 | [diff] [blame] | 24 | #define SIOCX25SCUDMATCHLEN (SIOCPROTOPRIVATE + 7) |
Shaun Pereira | ebc3f64 | 2005-06-22 22:16:17 -0700 | [diff] [blame] | 25 | #define SIOCX25CALLACCPTAPPRV (SIOCPROTOPRIVATE + 8) |
| 26 | #define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9) |
Shaun Pereira | a64b7b9 | 2006-03-22 00:01:31 -0800 | [diff] [blame] | 27 | #define SIOCX25GDTEFACILITIES (SIOCPROTOPRIVATE + 10) |
| 28 | #define SIOCX25SDTEFACILITIES (SIOCPROTOPRIVATE + 11) |
Andrew Hendry | 386e50c | 2009-11-18 23:30:41 -0800 | [diff] [blame] | 29 | #define SIOCX25SCAUSEDIAG (SIOCPROTOPRIVATE + 12) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | |
| 31 | /* |
| 32 | * Values for {get,set}sockopt. |
| 33 | */ |
| 34 | #define X25_QBITINCL 1 |
| 35 | |
| 36 | /* |
| 37 | * X.25 Packet Size values. |
| 38 | */ |
| 39 | #define X25_PS16 4 |
| 40 | #define X25_PS32 5 |
| 41 | #define X25_PS64 6 |
| 42 | #define X25_PS128 7 |
| 43 | #define X25_PS256 8 |
| 44 | #define X25_PS512 9 |
| 45 | #define X25_PS1024 10 |
| 46 | #define X25_PS2048 11 |
| 47 | #define X25_PS4096 12 |
| 48 | |
| 49 | /* |
| 50 | * An X.121 address, it is held as ASCII text, null terminated, up to 15 |
| 51 | * digits and a null terminator. |
| 52 | */ |
| 53 | struct x25_address { |
| 54 | char x25_addr[16]; |
| 55 | }; |
| 56 | |
| 57 | /* |
| 58 | * Linux X.25 Address structure, used for bind, and connect mostly. |
| 59 | */ |
| 60 | struct sockaddr_x25 { |
Ben Hutchings | bcb949b | 2011-08-24 18:43:55 +0000 | [diff] [blame] | 61 | __kernel_sa_family_t sx25_family; /* Must be AF_X25 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | struct x25_address sx25_addr; /* X.121 Address */ |
| 63 | }; |
| 64 | |
| 65 | /* |
| 66 | * DTE/DCE subscription options. |
| 67 | * |
| 68 | * As this is missing lots of options, user should expect major |
| 69 | * changes of this structure in 2.5.x which might break compatibilty. |
| 70 | * The somewhat ugly dimension 200-sizeof() is needed to maintain |
| 71 | * backward compatibility. |
| 72 | */ |
| 73 | struct x25_subscrip_struct { |
| 74 | char device[200-sizeof(unsigned long)]; |
| 75 | unsigned long global_facil_mask; /* 0 to disable negotiation */ |
| 76 | unsigned int extended; |
| 77 | }; |
| 78 | |
| 79 | /* values for above global_facil_mask */ |
| 80 | |
| 81 | #define X25_MASK_REVERSE 0x01 |
| 82 | #define X25_MASK_THROUGHPUT 0x02 |
| 83 | #define X25_MASK_PACKET_SIZE 0x04 |
| 84 | #define X25_MASK_WINDOW_SIZE 0x08 |
| 85 | |
Shaun Pereira | a64b7b9 | 2006-03-22 00:01:31 -0800 | [diff] [blame] | 86 | #define X25_MASK_CALLING_AE 0x10 |
| 87 | #define X25_MASK_CALLED_AE 0x20 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 88 | |
| 89 | |
| 90 | /* |
| 91 | * Routing table control structure. |
| 92 | */ |
| 93 | struct x25_route_struct { |
| 94 | struct x25_address address; |
| 95 | unsigned int sigdigits; |
| 96 | char device[200]; |
| 97 | }; |
| 98 | |
| 99 | /* |
| 100 | * Facilities structure. |
| 101 | */ |
| 102 | struct x25_facilities { |
| 103 | unsigned int winsize_in, winsize_out; |
| 104 | unsigned int pacsize_in, pacsize_out; |
| 105 | unsigned int throughput; |
| 106 | unsigned int reverse; |
| 107 | }; |
| 108 | |
| 109 | /* |
Shaun Pereira | a64b7b9 | 2006-03-22 00:01:31 -0800 | [diff] [blame] | 110 | * ITU DTE facilities |
| 111 | * Only the called and calling address |
| 112 | * extension are currently implemented. |
| 113 | * The rest are in place to avoid the struct |
| 114 | * changing size if someone needs them later |
| 115 | */ |
| 116 | |
| 117 | struct x25_dte_facilities { |
| 118 | __u16 delay_cumul; |
| 119 | __u16 delay_target; |
| 120 | __u16 delay_max; |
| 121 | __u8 min_throughput; |
| 122 | __u8 expedited; |
| 123 | __u8 calling_len; |
| 124 | __u8 called_len; |
| 125 | __u8 calling_ae[20]; |
| 126 | __u8 called_ae[20]; |
| 127 | }; |
| 128 | |
| 129 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 130 | * Call User Data structure. |
| 131 | */ |
| 132 | struct x25_calluserdata { |
| 133 | unsigned int cudlength; |
| 134 | unsigned char cuddata[128]; |
| 135 | }; |
| 136 | |
| 137 | /* |
| 138 | * Call clearing Cause and Diagnostic structure. |
| 139 | */ |
| 140 | struct x25_causediag { |
| 141 | unsigned char cause; |
| 142 | unsigned char diagnostic; |
| 143 | }; |
| 144 | |
Shaun Pereira | cb65d50 | 2005-06-22 22:15:01 -0700 | [diff] [blame] | 145 | /* |
| 146 | * Further optional call user data match length selection |
| 147 | */ |
| 148 | struct x25_subaddr { |
| 149 | unsigned int cudmatchlength; |
| 150 | }; |
| 151 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 152 | #endif |