2005-04-16 18:20:36 -04:00
|
|
|
/*
|
|
|
|
* These are the public elements of the Linux kernel X.25 implementation.
|
|
|
|
*
|
|
|
|
* History
|
|
|
|
* mar/20/00 Daniela Squassoni Disabling/enabling of facilities
|
|
|
|
* negotiation.
|
[X25]: Selective sub-address matching with call user data.
From: Shaun Pereira <spereira@tusc.com.au>
This is the first (independent of the second) patch of two that I am
working on with x25 on linux (tested with xot on a cisco router). Details
are as follows.
Current state of module:
A server using the current implementation (2.6.11.7) of the x25 module will
accept a call request/ incoming call packet at the listening x.25 address,
from all callers to that address, as long as NO call user data is present
in the packet header.
If the server needs to choose to accept a particular call request/ incoming
call packet arriving at its listening x25 address, then the kernel has to
allow a match of call user data present in the call request packet with its
own. This is required when multiple servers listen at the same x25 address
and device interface. The kernel currently matches ALL call user data, if
present.
Current Changes:
This patch is a follow up to the patch submitted previously by Andrew
Hendry, and allows the user to selectively control the number of octets of
call user data in the call request packet, that the kernel will match. By
default no call user data is matched, even if call user data is present.
To allow call user data matching, a cudmatchlength > 0 has to be passed
into the kernel after which the passed number of octets will be matched.
Otherwise the kernel behavior is exactly as the original implementation.
This patch also ensures that as is normally the case, no call user data
will be present in the Call accepted / call connected packet sent back to
the caller
Future Changes on next patch:
There are cases however when call user data may be present in the call
accepted packet. According to the X.25 recommendation (ITU-T 10/96)
section 5.2.3.2 call user data may be present in the call accepted packet
provided the fast select facility is used. My next patch will include this
fast select utility and the ability to send up to 128 octets call user data
in the call accepted packet provided the fast select facility is used. I
am currently testing this, again with xot on linux and cisco.
Signed-off-by: Shaun Pereira <spereira@tusc.com.au>
(With a fix from Alexey Dobriyan <adobriyan@gmail.com>)
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2005-06-23 01:15:01 -04:00
|
|
|
* apr/02/05 Shaun Pereira Selective sub address matching with
|
|
|
|
* call user data
|
2005-04-16 18:20:36 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef X25_KERNEL_H
|
|
|
|
#define X25_KERNEL_H
|
|
|
|
|
|
|
|
#define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0)
|
|
|
|
#define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1)
|
|
|
|
#define SIOCX25GFACILITIES (SIOCPROTOPRIVATE + 2)
|
|
|
|
#define SIOCX25SFACILITIES (SIOCPROTOPRIVATE + 3)
|
|
|
|
#define SIOCX25GCALLUSERDATA (SIOCPROTOPRIVATE + 4)
|
|
|
|
#define SIOCX25SCALLUSERDATA (SIOCPROTOPRIVATE + 5)
|
|
|
|
#define SIOCX25GCAUSEDIAG (SIOCPROTOPRIVATE + 6)
|
[X25]: Selective sub-address matching with call user data.
From: Shaun Pereira <spereira@tusc.com.au>
This is the first (independent of the second) patch of two that I am
working on with x25 on linux (tested with xot on a cisco router). Details
are as follows.
Current state of module:
A server using the current implementation (2.6.11.7) of the x25 module will
accept a call request/ incoming call packet at the listening x.25 address,
from all callers to that address, as long as NO call user data is present
in the packet header.
If the server needs to choose to accept a particular call request/ incoming
call packet arriving at its listening x25 address, then the kernel has to
allow a match of call user data present in the call request packet with its
own. This is required when multiple servers listen at the same x25 address
and device interface. The kernel currently matches ALL call user data, if
present.
Current Changes:
This patch is a follow up to the patch submitted previously by Andrew
Hendry, and allows the user to selectively control the number of octets of
call user data in the call request packet, that the kernel will match. By
default no call user data is matched, even if call user data is present.
To allow call user data matching, a cudmatchlength > 0 has to be passed
into the kernel after which the passed number of octets will be matched.
Otherwise the kernel behavior is exactly as the original implementation.
This patch also ensures that as is normally the case, no call user data
will be present in the Call accepted / call connected packet sent back to
the caller
Future Changes on next patch:
There are cases however when call user data may be present in the call
accepted packet. According to the X.25 recommendation (ITU-T 10/96)
section 5.2.3.2 call user data may be present in the call accepted packet
provided the fast select facility is used. My next patch will include this
fast select utility and the ability to send up to 128 octets call user data
in the call accepted packet provided the fast select facility is used. I
am currently testing this, again with xot on linux and cisco.
Signed-off-by: Shaun Pereira <spereira@tusc.com.au>
(With a fix from Alexey Dobriyan <adobriyan@gmail.com>)
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2005-06-23 01:15:01 -04:00
|
|
|
#define SIOCX25SCUDMATCHLEN (SIOCPROTOPRIVATE + 7)
|
[X25]: Fast select with no restriction on response
This patch is a follow up to patch 1 regarding "Selective Sub Address
matching with call user data". It allows use of the Fast-Select-Acceptance
optional user facility for X.25.
This patch just implements fast select with no restriction on response
(NRR). What this means (according to ITU-T Recomendation 10/96 section
6.16) is that if in an incoming call packet, the relevant facility bits are
set for fast-select-NRR, then the called DTE can issue a direct response to
the incoming packet using a call-accepted packet that contains
call-user-data. This patch allows such a response.
The called DTE can also respond with a clear-request packet that contains
call-user-data. However, this feature is currently not implemented by the
patch.
How is Fast Select Acceptance used?
By default, the system does not allow fast select acceptance (as before).
To enable a response to fast select acceptance,
After a listen socket in created and bound as follows
socket(AF_X25, SOCK_SEQPACKET, 0);
bind(call_soc, (struct sockaddr *)&locl_addr, sizeof(locl_addr));
but before a listen system call is made, the following ioctl should be used.
ioctl(call_soc,SIOCX25CALLACCPTAPPRV);
Now the listen system call can be made
listen(call_soc, 4);
After this, an incoming-call packet will be accepted, but no call-accepted
packet will be sent back until the following system call is made on the socket
that accepts the call
ioctl(vc_soc,SIOCX25SENDCALLACCPT);
The network (or cisco xot router used for testing here) will allow the
application server's call-user-data in the call-accepted packet,
provided the call-request was made with Fast-select NRR.
Signed-off-by: Shaun Pereira <spereira@tusc.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2005-06-23 01:16:17 -04:00
|
|
|
#define SIOCX25CALLACCPTAPPRV (SIOCPROTOPRIVATE + 8)
|
|
|
|
#define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9)
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Values for {get,set}sockopt.
|
|
|
|
*/
|
|
|
|
#define X25_QBITINCL 1
|
|
|
|
|
|
|
|
/*
|
|
|
|
* X.25 Packet Size values.
|
|
|
|
*/
|
|
|
|
#define X25_PS16 4
|
|
|
|
#define X25_PS32 5
|
|
|
|
#define X25_PS64 6
|
|
|
|
#define X25_PS128 7
|
|
|
|
#define X25_PS256 8
|
|
|
|
#define X25_PS512 9
|
|
|
|
#define X25_PS1024 10
|
|
|
|
#define X25_PS2048 11
|
|
|
|
#define X25_PS4096 12
|
|
|
|
|
|
|
|
/*
|
|
|
|
* An X.121 address, it is held as ASCII text, null terminated, up to 15
|
|
|
|
* digits and a null terminator.
|
|
|
|
*/
|
|
|
|
struct x25_address {
|
|
|
|
char x25_addr[16];
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Linux X.25 Address structure, used for bind, and connect mostly.
|
|
|
|
*/
|
|
|
|
struct sockaddr_x25 {
|
|
|
|
sa_family_t sx25_family; /* Must be AF_X25 */
|
|
|
|
struct x25_address sx25_addr; /* X.121 Address */
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* DTE/DCE subscription options.
|
|
|
|
*
|
|
|
|
* As this is missing lots of options, user should expect major
|
|
|
|
* changes of this structure in 2.5.x which might break compatibilty.
|
|
|
|
* The somewhat ugly dimension 200-sizeof() is needed to maintain
|
|
|
|
* backward compatibility.
|
|
|
|
*/
|
|
|
|
struct x25_subscrip_struct {
|
|
|
|
char device[200-sizeof(unsigned long)];
|
|
|
|
unsigned long global_facil_mask; /* 0 to disable negotiation */
|
|
|
|
unsigned int extended;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* values for above global_facil_mask */
|
|
|
|
|
|
|
|
#define X25_MASK_REVERSE 0x01
|
|
|
|
#define X25_MASK_THROUGHPUT 0x02
|
|
|
|
#define X25_MASK_PACKET_SIZE 0x04
|
|
|
|
#define X25_MASK_WINDOW_SIZE 0x08
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Routing table control structure.
|
|
|
|
*/
|
|
|
|
struct x25_route_struct {
|
|
|
|
struct x25_address address;
|
|
|
|
unsigned int sigdigits;
|
|
|
|
char device[200];
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Facilities structure.
|
|
|
|
*/
|
|
|
|
struct x25_facilities {
|
|
|
|
unsigned int winsize_in, winsize_out;
|
|
|
|
unsigned int pacsize_in, pacsize_out;
|
|
|
|
unsigned int throughput;
|
|
|
|
unsigned int reverse;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Call User Data structure.
|
|
|
|
*/
|
|
|
|
struct x25_calluserdata {
|
|
|
|
unsigned int cudlength;
|
|
|
|
unsigned char cuddata[128];
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Call clearing Cause and Diagnostic structure.
|
|
|
|
*/
|
|
|
|
struct x25_causediag {
|
|
|
|
unsigned char cause;
|
|
|
|
unsigned char diagnostic;
|
|
|
|
};
|
|
|
|
|
[X25]: Selective sub-address matching with call user data.
From: Shaun Pereira <spereira@tusc.com.au>
This is the first (independent of the second) patch of two that I am
working on with x25 on linux (tested with xot on a cisco router). Details
are as follows.
Current state of module:
A server using the current implementation (2.6.11.7) of the x25 module will
accept a call request/ incoming call packet at the listening x.25 address,
from all callers to that address, as long as NO call user data is present
in the packet header.
If the server needs to choose to accept a particular call request/ incoming
call packet arriving at its listening x25 address, then the kernel has to
allow a match of call user data present in the call request packet with its
own. This is required when multiple servers listen at the same x25 address
and device interface. The kernel currently matches ALL call user data, if
present.
Current Changes:
This patch is a follow up to the patch submitted previously by Andrew
Hendry, and allows the user to selectively control the number of octets of
call user data in the call request packet, that the kernel will match. By
default no call user data is matched, even if call user data is present.
To allow call user data matching, a cudmatchlength > 0 has to be passed
into the kernel after which the passed number of octets will be matched.
Otherwise the kernel behavior is exactly as the original implementation.
This patch also ensures that as is normally the case, no call user data
will be present in the Call accepted / call connected packet sent back to
the caller
Future Changes on next patch:
There are cases however when call user data may be present in the call
accepted packet. According to the X.25 recommendation (ITU-T 10/96)
section 5.2.3.2 call user data may be present in the call accepted packet
provided the fast select facility is used. My next patch will include this
fast select utility and the ability to send up to 128 octets call user data
in the call accepted packet provided the fast select facility is used. I
am currently testing this, again with xot on linux and cisco.
Signed-off-by: Shaun Pereira <spereira@tusc.com.au>
(With a fix from Alexey Dobriyan <adobriyan@gmail.com>)
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2005-06-23 01:15:01 -04:00
|
|
|
/*
|
|
|
|
* Further optional call user data match length selection
|
|
|
|
*/
|
|
|
|
struct x25_subaddr {
|
|
|
|
unsigned int cudmatchlength;
|
|
|
|
};
|
|
|
|
|
2005-04-16 18:20:36 -04:00
|
|
|
#endif
|