License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 17:07:57 +03:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2005-04-17 02:20:36 +04:00
|
|
|
/*
|
|
|
|
* Declarations of X.25 Packet Layer type objects.
|
|
|
|
*
|
|
|
|
* History
|
|
|
|
* nov/17/96 Jonathan Naylor Initial version.
|
|
|
|
* mar/20/00 Daniela Squassoni Disabling/enabling of facilities
|
|
|
|
* negotiation.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _X25_H
|
|
|
|
#define _X25_H
|
|
|
|
#include <linux/x25.h>
|
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.
percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.
http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.
* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.
* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.
The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.
2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.
3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.
4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.
5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.
6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).
* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig
8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.
Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-24 11:04:11 +03:00
|
|
|
#include <linux/slab.h>
|
2017-07-04 15:53:19 +03:00
|
|
|
#include <linux/refcount.h>
|
2005-04-17 02:20:36 +04:00
|
|
|
#include <net/sock.h>
|
|
|
|
|
|
|
|
#define X25_ADDR_LEN 16
|
|
|
|
|
|
|
|
#define X25_MAX_L2_LEN 18 /* 802.2 LLC */
|
|
|
|
|
|
|
|
#define X25_STD_MIN_LEN 3
|
|
|
|
#define X25_EXT_MIN_LEN 4
|
|
|
|
|
|
|
|
#define X25_GFI_SEQ_MASK 0x30
|
|
|
|
#define X25_GFI_STDSEQ 0x10
|
|
|
|
#define X25_GFI_EXTSEQ 0x20
|
|
|
|
|
|
|
|
#define X25_Q_BIT 0x80
|
|
|
|
#define X25_D_BIT 0x40
|
|
|
|
#define X25_STD_M_BIT 0x10
|
|
|
|
#define X25_EXT_M_BIT 0x01
|
|
|
|
|
|
|
|
#define X25_CALL_REQUEST 0x0B
|
|
|
|
#define X25_CALL_ACCEPTED 0x0F
|
|
|
|
#define X25_CLEAR_REQUEST 0x13
|
|
|
|
#define X25_CLEAR_CONFIRMATION 0x17
|
|
|
|
#define X25_DATA 0x00
|
|
|
|
#define X25_INTERRUPT 0x23
|
|
|
|
#define X25_INTERRUPT_CONFIRMATION 0x27
|
|
|
|
#define X25_RR 0x01
|
|
|
|
#define X25_RNR 0x05
|
|
|
|
#define X25_REJ 0x09
|
|
|
|
#define X25_RESET_REQUEST 0x1B
|
|
|
|
#define X25_RESET_CONFIRMATION 0x1F
|
|
|
|
#define X25_REGISTRATION_REQUEST 0xF3
|
|
|
|
#define X25_REGISTRATION_CONFIRMATION 0xF7
|
|
|
|
#define X25_RESTART_REQUEST 0xFB
|
|
|
|
#define X25_RESTART_CONFIRMATION 0xFF
|
|
|
|
#define X25_DIAGNOSTIC 0xF1
|
|
|
|
#define X25_ILLEGAL 0xFD
|
|
|
|
|
|
|
|
/* Define the various conditions that may exist */
|
|
|
|
|
|
|
|
#define X25_COND_ACK_PENDING 0x01
|
|
|
|
#define X25_COND_OWN_RX_BUSY 0x02
|
|
|
|
#define X25_COND_PEER_RX_BUSY 0x04
|
|
|
|
|
|
|
|
/* Define Link State constants. */
|
|
|
|
enum {
|
|
|
|
X25_STATE_0, /* Ready */
|
|
|
|
X25_STATE_1, /* Awaiting Call Accepted */
|
|
|
|
X25_STATE_2, /* Awaiting Clear Confirmation */
|
|
|
|
X25_STATE_3, /* Data Transfer */
|
|
|
|
X25_STATE_4 /* Awaiting Reset Confirmation */
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
X25_LINK_STATE_0,
|
|
|
|
X25_LINK_STATE_1,
|
|
|
|
X25_LINK_STATE_2,
|
|
|
|
X25_LINK_STATE_3
|
|
|
|
};
|
|
|
|
|
|
|
|
#define X25_DEFAULT_T20 (180 * HZ) /* Default T20 value */
|
|
|
|
#define X25_DEFAULT_T21 (200 * HZ) /* Default T21 value */
|
|
|
|
#define X25_DEFAULT_T22 (180 * HZ) /* Default T22 value */
|
|
|
|
#define X25_DEFAULT_T23 (180 * HZ) /* Default T23 value */
|
|
|
|
#define X25_DEFAULT_T2 (3 * HZ) /* Default ack holdback value */
|
|
|
|
|
|
|
|
#define X25_DEFAULT_WINDOW_SIZE 2 /* Default Window Size */
|
|
|
|
#define X25_DEFAULT_PACKET_SIZE X25_PS128 /* Default Packet Size */
|
|
|
|
#define X25_DEFAULT_THROUGHPUT 0x0A /* Deafult Throughput */
|
|
|
|
#define X25_DEFAULT_REVERSE 0x00 /* Default Reverse Charging */
|
|
|
|
|
|
|
|
#define X25_SMODULUS 8
|
|
|
|
#define X25_EMODULUS 128
|
|
|
|
|
|
|
|
/*
|
|
|
|
* X.25 Facilities constants.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define X25_FAC_CLASS_MASK 0xC0
|
|
|
|
|
|
|
|
#define X25_FAC_CLASS_A 0x00
|
|
|
|
#define X25_FAC_CLASS_B 0x40
|
|
|
|
#define X25_FAC_CLASS_C 0x80
|
|
|
|
#define X25_FAC_CLASS_D 0xC0
|
|
|
|
|
[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 09:16:17 +04:00
|
|
|
#define X25_FAC_REVERSE 0x01 /* also fast select */
|
2005-04-17 02:20:36 +04:00
|
|
|
#define X25_FAC_THROUGHPUT 0x02
|
|
|
|
#define X25_FAC_PACKET_SIZE 0x42
|
|
|
|
#define X25_FAC_WINDOW_SIZE 0x43
|
|
|
|
|
[X25]: allow ITU-T DTE facilities for x25
Allows use of the optional user facility to insert ITU-T
(http://www.itu.int/ITU-T/) specified DTE facilities in call set-up x25
packets. This feature is optional; no facilities will be added if the ioctl
is not used, and call setup packet remains the same as before.
If the ioctls provided by the patch are used, then a facility marker will be
added to the x25 packet header so that the called dte address extension
facility can be differentiated from other types of facilities (as described in
the ITU-T X.25 recommendation) that are also allowed in the x25 packet header.
Facility markers are made up of two octets, and may be present in the x25
packet headers of call-request, incoming call, call accepted, clear request,
and clear indication packets. The first of the two octets represents the
facility code field and is set to zero by this patch. The second octet of the
marker represents the facility parameter field and is set to 0x0F because the
marker will be inserted before ITU-T type DTE facilities.
Since according to ITU-T X.25 Recommendation X.25(10/96)- 7.1 "All networks
will support the facility markers with a facility parameter field set to all
ones or to 00001111", therefore this patch should work with all x.25 networks.
While there are many ITU-T DTE facilities, this patch implements only the
called and calling address extension, with placeholders in the
x25_dte_facilities structure for the rest of the facilities.
Testing:
This patch was tested using a cisco xot router connected on its serial ports
to an X.25 network, and on its lan ports to a host running an xotd daemon.
It is also possible to test this patch using an xotd daemon and an x25tap
patch, where the xotd daemons work back-to-back without actually using an x.25
network. See www.fyonne.net for details on how to do this.
Signed-off-by: Shaun Pereira <spereira@tusc.com.au>
Acked-by: Andrew Hendry <ahendry@tusc.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-22 11:01:31 +03:00
|
|
|
#define X25_MAX_FAC_LEN 60
|
2005-04-17 02:20:36 +04:00
|
|
|
#define X25_MAX_CUD_LEN 128
|
|
|
|
|
[X25]: allow ITU-T DTE facilities for x25
Allows use of the optional user facility to insert ITU-T
(http://www.itu.int/ITU-T/) specified DTE facilities in call set-up x25
packets. This feature is optional; no facilities will be added if the ioctl
is not used, and call setup packet remains the same as before.
If the ioctls provided by the patch are used, then a facility marker will be
added to the x25 packet header so that the called dte address extension
facility can be differentiated from other types of facilities (as described in
the ITU-T X.25 recommendation) that are also allowed in the x25 packet header.
Facility markers are made up of two octets, and may be present in the x25
packet headers of call-request, incoming call, call accepted, clear request,
and clear indication packets. The first of the two octets represents the
facility code field and is set to zero by this patch. The second octet of the
marker represents the facility parameter field and is set to 0x0F because the
marker will be inserted before ITU-T type DTE facilities.
Since according to ITU-T X.25 Recommendation X.25(10/96)- 7.1 "All networks
will support the facility markers with a facility parameter field set to all
ones or to 00001111", therefore this patch should work with all x.25 networks.
While there are many ITU-T DTE facilities, this patch implements only the
called and calling address extension, with placeholders in the
x25_dte_facilities structure for the rest of the facilities.
Testing:
This patch was tested using a cisco xot router connected on its serial ports
to an X.25 network, and on its lan ports to a host running an xotd daemon.
It is also possible to test this patch using an xotd daemon and an x25tap
patch, where the xotd daemons work back-to-back without actually using an x.25
network. See www.fyonne.net for details on how to do this.
Signed-off-by: Shaun Pereira <spereira@tusc.com.au>
Acked-by: Andrew Hendry <ahendry@tusc.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-22 11:01:31 +03:00
|
|
|
#define X25_FAC_CALLING_AE 0xCB
|
|
|
|
#define X25_FAC_CALLED_AE 0xC9
|
|
|
|
|
|
|
|
#define X25_MARKER 0x00
|
|
|
|
#define X25_DTE_SERVICES 0x0F
|
|
|
|
#define X25_MAX_AE_LEN 40 /* Max num of semi-octets in AE - OSI Nw */
|
|
|
|
#define X25_MAX_DTE_FACIL_LEN 21 /* Max length of DTE facility params */
|
|
|
|
|
2010-05-17 02:59:41 +04:00
|
|
|
/* Bitset in x25_sock->flags for misc flags */
|
|
|
|
#define X25_Q_BIT_FLAG 0
|
2010-05-17 03:00:02 +04:00
|
|
|
#define X25_INTERRUPT_FLAG 1
|
2010-05-17 03:00:27 +04:00
|
|
|
#define X25_ACCPT_APPRV_FLAG 2
|
2010-05-17 02:59:41 +04:00
|
|
|
|
2005-04-17 02:20:36 +04:00
|
|
|
/**
|
|
|
|
* struct x25_route - x25 routing entry
|
|
|
|
* @node - entry in x25_list_lock
|
|
|
|
* @address - Start of address range
|
|
|
|
* @sigdigits - Number of sig digits
|
|
|
|
* @dev - More than one for MLP
|
|
|
|
* @refcnt - reference counter
|
|
|
|
*/
|
|
|
|
struct x25_route {
|
|
|
|
struct list_head node;
|
|
|
|
struct x25_address address;
|
|
|
|
unsigned int sigdigits;
|
|
|
|
struct net_device *dev;
|
2017-07-04 15:53:19 +03:00
|
|
|
refcount_t refcnt;
|
2005-04-17 02:20:36 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct x25_neigh {
|
|
|
|
struct list_head node;
|
|
|
|
struct net_device *dev;
|
|
|
|
unsigned int state;
|
|
|
|
unsigned int extended;
|
|
|
|
struct sk_buff_head queue;
|
|
|
|
unsigned long t20;
|
|
|
|
struct timer_list t20timer;
|
|
|
|
unsigned long global_facil_mask;
|
2017-07-04 15:53:20 +03:00
|
|
|
refcount_t refcnt;
|
2005-04-17 02:20:36 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct x25_sock {
|
|
|
|
struct sock sk;
|
|
|
|
struct x25_address source_addr, dest_addr;
|
|
|
|
struct x25_neigh *neighbour;
|
[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 09:15:01 +04:00
|
|
|
unsigned int lci, cudmatchlength;
|
2010-05-17 03:00:27 +04:00
|
|
|
unsigned char state, condition;
|
2005-04-17 02:20:36 +04:00
|
|
|
unsigned short vs, vr, va, vl;
|
|
|
|
unsigned long t2, t21, t22, t23;
|
|
|
|
unsigned short fraglen;
|
2010-05-17 02:59:41 +04:00
|
|
|
unsigned long flags;
|
2005-04-17 02:20:36 +04:00
|
|
|
struct sk_buff_head ack_queue;
|
|
|
|
struct sk_buff_head fragment_queue;
|
|
|
|
struct sk_buff_head interrupt_in_queue;
|
|
|
|
struct sk_buff_head interrupt_out_queue;
|
|
|
|
struct timer_list timer;
|
|
|
|
struct x25_causediag causediag;
|
|
|
|
struct x25_facilities facilities;
|
[X25]: allow ITU-T DTE facilities for x25
Allows use of the optional user facility to insert ITU-T
(http://www.itu.int/ITU-T/) specified DTE facilities in call set-up x25
packets. This feature is optional; no facilities will be added if the ioctl
is not used, and call setup packet remains the same as before.
If the ioctls provided by the patch are used, then a facility marker will be
added to the x25 packet header so that the called dte address extension
facility can be differentiated from other types of facilities (as described in
the ITU-T X.25 recommendation) that are also allowed in the x25 packet header.
Facility markers are made up of two octets, and may be present in the x25
packet headers of call-request, incoming call, call accepted, clear request,
and clear indication packets. The first of the two octets represents the
facility code field and is set to zero by this patch. The second octet of the
marker represents the facility parameter field and is set to 0x0F because the
marker will be inserted before ITU-T type DTE facilities.
Since according to ITU-T X.25 Recommendation X.25(10/96)- 7.1 "All networks
will support the facility markers with a facility parameter field set to all
ones or to 00001111", therefore this patch should work with all x.25 networks.
While there are many ITU-T DTE facilities, this patch implements only the
called and calling address extension, with placeholders in the
x25_dte_facilities structure for the rest of the facilities.
Testing:
This patch was tested using a cisco xot router connected on its serial ports
to an X.25 network, and on its lan ports to a host running an xotd daemon.
It is also possible to test this patch using an xotd daemon and an x25tap
patch, where the xotd daemons work back-to-back without actually using an x.25
network. See www.fyonne.net for details on how to do this.
Signed-off-by: Shaun Pereira <spereira@tusc.com.au>
Acked-by: Andrew Hendry <ahendry@tusc.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-22 11:01:31 +03:00
|
|
|
struct x25_dte_facilities dte_facilities;
|
2005-04-17 02:20:36 +04:00
|
|
|
struct x25_calluserdata calluserdata;
|
|
|
|
unsigned long vc_facil_mask; /* inc_call facilities mask */
|
|
|
|
};
|
|
|
|
|
2007-02-09 00:34:02 +03:00
|
|
|
struct x25_forward {
|
|
|
|
struct list_head node;
|
|
|
|
unsigned int lci;
|
|
|
|
struct net_device *dev1;
|
|
|
|
struct net_device *dev2;
|
|
|
|
atomic_t refcnt;
|
|
|
|
};
|
|
|
|
|
2005-04-17 02:20:36 +04:00
|
|
|
static inline struct x25_sock *x25_sk(const struct sock *sk)
|
|
|
|
{
|
|
|
|
return (struct x25_sock *)sk;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* af_x25.c */
|
|
|
|
extern int sysctl_x25_restart_request_timeout;
|
|
|
|
extern int sysctl_x25_call_request_timeout;
|
|
|
|
extern int sysctl_x25_reset_request_timeout;
|
|
|
|
extern int sysctl_x25_clear_request_timeout;
|
|
|
|
extern int sysctl_x25_ack_holdback_timeout;
|
2007-02-09 00:34:36 +03:00
|
|
|
extern int sysctl_x25_forward;
|
2005-04-17 02:20:36 +04:00
|
|
|
|
2013-09-23 22:33:49 +04:00
|
|
|
int x25_parse_address_block(struct sk_buff *skb,
|
|
|
|
struct x25_address *called_addr,
|
|
|
|
struct x25_address *calling_addr);
|
|
|
|
|
|
|
|
int x25_addr_ntoa(unsigned char *, struct x25_address *, struct x25_address *);
|
|
|
|
int x25_addr_aton(unsigned char *, struct x25_address *, struct x25_address *);
|
|
|
|
struct sock *x25_find_socket(unsigned int, struct x25_neigh *);
|
|
|
|
void x25_destroy_socket_from_timer(struct sock *);
|
|
|
|
int x25_rx_call_request(struct sk_buff *, struct x25_neigh *, unsigned int);
|
|
|
|
void x25_kill_by_neigh(struct x25_neigh *);
|
2005-04-17 02:20:36 +04:00
|
|
|
|
|
|
|
/* x25_dev.c */
|
2013-09-23 22:33:49 +04:00
|
|
|
void x25_send_frame(struct sk_buff *, struct x25_neigh *);
|
|
|
|
int x25_lapb_receive_frame(struct sk_buff *, struct net_device *,
|
|
|
|
struct packet_type *, struct net_device *);
|
|
|
|
void x25_establish_link(struct x25_neigh *);
|
|
|
|
void x25_terminate_link(struct x25_neigh *);
|
2005-04-17 02:20:36 +04:00
|
|
|
|
|
|
|
/* x25_facilities.c */
|
2013-09-23 22:33:49 +04:00
|
|
|
int x25_parse_facilities(struct sk_buff *, struct x25_facilities *,
|
|
|
|
struct x25_dte_facilities *, unsigned long *);
|
|
|
|
int x25_create_facilities(unsigned char *, struct x25_facilities *,
|
|
|
|
struct x25_dte_facilities *, unsigned long);
|
|
|
|
int x25_negotiate_facilities(struct sk_buff *, struct sock *,
|
|
|
|
struct x25_facilities *,
|
|
|
|
struct x25_dte_facilities *);
|
|
|
|
void x25_limit_facilities(struct x25_facilities *, struct x25_neigh *);
|
2005-04-17 02:20:36 +04:00
|
|
|
|
2007-02-09 00:34:02 +03:00
|
|
|
/* x25_forward.c */
|
2013-09-23 22:33:49 +04:00
|
|
|
void x25_clear_forward_by_lci(unsigned int lci);
|
|
|
|
void x25_clear_forward_by_dev(struct net_device *);
|
|
|
|
int x25_forward_data(int, struct x25_neigh *, struct sk_buff *);
|
|
|
|
int x25_forward_call(struct x25_address *, struct x25_neigh *, struct sk_buff *,
|
|
|
|
int);
|
2007-02-09 00:34:02 +03:00
|
|
|
|
2005-04-17 02:20:36 +04:00
|
|
|
/* x25_in.c */
|
2013-09-23 22:33:49 +04:00
|
|
|
int x25_process_rx_frame(struct sock *, struct sk_buff *);
|
|
|
|
int x25_backlog_rcv(struct sock *, struct sk_buff *);
|
2005-04-17 02:20:36 +04:00
|
|
|
|
|
|
|
/* x25_link.c */
|
2013-09-23 22:33:49 +04:00
|
|
|
void x25_link_control(struct sk_buff *, struct x25_neigh *, unsigned short);
|
|
|
|
void x25_link_device_up(struct net_device *);
|
|
|
|
void x25_link_device_down(struct net_device *);
|
|
|
|
void x25_link_established(struct x25_neigh *);
|
|
|
|
void x25_link_terminated(struct x25_neigh *);
|
|
|
|
void x25_transmit_clear_request(struct x25_neigh *, unsigned int,
|
|
|
|
unsigned char);
|
|
|
|
void x25_transmit_link(struct sk_buff *, struct x25_neigh *);
|
|
|
|
int x25_subscr_ioctl(unsigned int, void __user *);
|
|
|
|
struct x25_neigh *x25_get_neigh(struct net_device *);
|
|
|
|
void x25_link_free(void);
|
2005-04-17 02:20:36 +04:00
|
|
|
|
|
|
|
/* x25_neigh.c */
|
|
|
|
static __inline__ void x25_neigh_hold(struct x25_neigh *nb)
|
|
|
|
{
|
2017-07-04 15:53:20 +03:00
|
|
|
refcount_inc(&nb->refcnt);
|
2005-04-17 02:20:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static __inline__ void x25_neigh_put(struct x25_neigh *nb)
|
|
|
|
{
|
2017-07-04 15:53:20 +03:00
|
|
|
if (refcount_dec_and_test(&nb->refcnt))
|
2005-04-17 02:20:36 +04:00
|
|
|
kfree(nb);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* x25_out.c */
|
2013-09-23 22:33:49 +04:00
|
|
|
int x25_output(struct sock *, struct sk_buff *);
|
|
|
|
void x25_kick(struct sock *);
|
|
|
|
void x25_enquiry_response(struct sock *);
|
2005-04-17 02:20:36 +04:00
|
|
|
|
|
|
|
/* x25_route.c */
|
2013-09-23 22:33:49 +04:00
|
|
|
struct x25_route *x25_get_route(struct x25_address *addr);
|
|
|
|
struct net_device *x25_dev_get(char *);
|
|
|
|
void x25_route_device_down(struct net_device *dev);
|
|
|
|
int x25_route_ioctl(unsigned int, void __user *);
|
|
|
|
void x25_route_free(void);
|
2005-04-17 02:20:36 +04:00
|
|
|
|
|
|
|
static __inline__ void x25_route_hold(struct x25_route *rt)
|
|
|
|
{
|
2017-07-04 15:53:19 +03:00
|
|
|
refcount_inc(&rt->refcnt);
|
2005-04-17 02:20:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static __inline__ void x25_route_put(struct x25_route *rt)
|
|
|
|
{
|
2017-07-04 15:53:19 +03:00
|
|
|
if (refcount_dec_and_test(&rt->refcnt))
|
2005-04-17 02:20:36 +04:00
|
|
|
kfree(rt);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* x25_subr.c */
|
2013-09-23 22:33:49 +04:00
|
|
|
void x25_clear_queues(struct sock *);
|
|
|
|
void x25_frames_acked(struct sock *, unsigned short);
|
|
|
|
void x25_requeue_frames(struct sock *);
|
|
|
|
int x25_validate_nr(struct sock *, unsigned short);
|
|
|
|
void x25_write_internal(struct sock *, int);
|
|
|
|
int x25_decode(struct sock *, struct sk_buff *, int *, int *, int *, int *,
|
|
|
|
int *);
|
|
|
|
void x25_disconnect(struct sock *, int, unsigned char, unsigned char);
|
2005-04-17 02:20:36 +04:00
|
|
|
|
|
|
|
/* x25_timer.c */
|
2013-09-23 22:33:49 +04:00
|
|
|
void x25_init_timers(struct sock *sk);
|
|
|
|
void x25_start_heartbeat(struct sock *);
|
|
|
|
void x25_start_t2timer(struct sock *);
|
|
|
|
void x25_start_t21timer(struct sock *);
|
|
|
|
void x25_start_t22timer(struct sock *);
|
|
|
|
void x25_start_t23timer(struct sock *);
|
|
|
|
void x25_stop_heartbeat(struct sock *);
|
|
|
|
void x25_stop_timer(struct sock *);
|
|
|
|
unsigned long x25_display_timer(struct sock *);
|
|
|
|
void x25_check_rbuf(struct sock *);
|
2005-04-17 02:20:36 +04:00
|
|
|
|
|
|
|
/* sysctl_net_x25.c */
|
2009-11-24 18:15:26 +03:00
|
|
|
#ifdef CONFIG_SYSCTL
|
2017-05-17 07:05:07 +03:00
|
|
|
int x25_register_sysctl(void);
|
2013-09-23 22:33:49 +04:00
|
|
|
void x25_unregister_sysctl(void);
|
2009-11-24 18:15:26 +03:00
|
|
|
#else
|
2017-05-17 07:05:07 +03:00
|
|
|
static inline int x25_register_sysctl(void) { return 0; };
|
2009-11-24 18:15:26 +03:00
|
|
|
static inline void x25_unregister_sysctl(void) {};
|
|
|
|
#endif /* CONFIG_SYSCTL */
|
|
|
|
|
2005-04-17 02:20:36 +04:00
|
|
|
struct x25_skb_cb {
|
2012-04-15 09:58:06 +04:00
|
|
|
unsigned int flags;
|
2005-04-17 02:20:36 +04:00
|
|
|
};
|
|
|
|
#define X25_SKB_CB(s) ((struct x25_skb_cb *) ((s)->cb))
|
|
|
|
|
|
|
|
extern struct hlist_head x25_list;
|
|
|
|
extern rwlock_t x25_list_lock;
|
|
|
|
extern struct list_head x25_route_list;
|
|
|
|
extern rwlock_t x25_route_list_lock;
|
2007-02-09 00:34:02 +03:00
|
|
|
extern struct list_head x25_forward_list;
|
|
|
|
extern rwlock_t x25_forward_list_lock;
|
2010-11-25 05:18:15 +03:00
|
|
|
extern struct list_head x25_neigh_list;
|
|
|
|
extern rwlock_t x25_neigh_list_lock;
|
2005-04-17 02:20:36 +04:00
|
|
|
|
2013-09-23 22:33:49 +04:00
|
|
|
int x25_proc_init(void);
|
|
|
|
void x25_proc_exit(void);
|
2005-04-17 02:20:36 +04:00
|
|
|
#endif
|