linux/include/net/dn.h

232 lines
6.9 KiB
C
Raw Normal View History

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 14:07:57 +00:00
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _NET_DN_H
#define _NET_DN_H
#include <linux/dn.h>
#include <net/sock.h>
#include <net/flow.h>
#include <asm/byteorder.h>
#include <asm/unaligned.h>
struct dn_scp /* Session Control Port */
{
unsigned char state;
#define DN_O 1 /* Open */
#define DN_CR 2 /* Connect Receive */
#define DN_DR 3 /* Disconnect Reject */
#define DN_DRC 4 /* Discon. Rej. Complete*/
#define DN_CC 5 /* Connect Confirm */
#define DN_CI 6 /* Connect Initiate */
#define DN_NR 7 /* No resources */
#define DN_NC 8 /* No communication */
#define DN_CD 9 /* Connect Delivery */
#define DN_RJ 10 /* Rejected */
#define DN_RUN 11 /* Running */
#define DN_DI 12 /* Disconnect Initiate */
#define DN_DIC 13 /* Disconnect Complete */
#define DN_DN 14 /* Disconnect Notificat */
#define DN_CL 15 /* Closed */
#define DN_CN 16 /* Closed Notification */
__le16 addrloc;
__le16 addrrem;
__u16 numdat;
__u16 numoth;
__u16 numoth_rcv;
__u16 numdat_rcv;
__u16 ackxmt_dat;
__u16 ackxmt_oth;
__u16 ackrcv_dat;
__u16 ackrcv_oth;
__u8 flowrem_sw;
__u8 flowloc_sw;
#define DN_SEND 2
#define DN_DONTSEND 1
#define DN_NOCHANGE 0
__u16 flowrem_dat;
__u16 flowrem_oth;
__u16 flowloc_dat;
__u16 flowloc_oth;
__u8 services_rem;
__u8 services_loc;
__u8 info_rem;
__u8 info_loc;
__u16 segsize_rem;
__u16 segsize_loc;
__u8 nonagle;
__u8 multi_ireq;
__u8 accept_mode;
unsigned long seg_total; /* Running total of current segment */
struct optdata_dn conndata_in;
struct optdata_dn conndata_out;
struct optdata_dn discdata_in;
struct optdata_dn discdata_out;
struct accessdata_dn accessdata;
struct sockaddr_dn addr; /* Local address */
struct sockaddr_dn peer; /* Remote address */
/*
* In this case the RTT estimation is not specified in the
* docs, nor is any back off algorithm. Here we follow well
* known tcp algorithms with a few small variations.
*
* snd_window: Max number of packets we send before we wait for
* an ack to come back. This will become part of a
* more complicated scheme when we support flow
* control.
*
* nsp_srtt: Round-Trip-Time (x8) in jiffies. This is a rolling
* average.
* nsp_rttvar: Round-Trip-Time-Varience (x4) in jiffies. This is the
* varience of the smoothed average (but calculated in
* a simpler way than for normal statistical varience
* calculations).
*
* nsp_rxtshift: Backoff counter. Value is zero normally, each time
* a packet is lost is increases by one until an ack
* is received. Its used to index an array of backoff
* multipliers.
*/
#define NSP_MIN_WINDOW 1
#define NSP_MAX_WINDOW (0x07fe)
unsigned long max_window;
unsigned long snd_window;
#define NSP_INITIAL_SRTT (HZ)
unsigned long nsp_srtt;
#define NSP_INITIAL_RTTVAR (HZ*3)
unsigned long nsp_rttvar;
#define NSP_MAXRXTSHIFT 12
unsigned long nsp_rxtshift;
/*
* Output queues, one for data, one for otherdata/linkservice
*/
struct sk_buff_head data_xmit_queue;
struct sk_buff_head other_xmit_queue;
/*
* Input queue for other data
*/
struct sk_buff_head other_receive_queue;
int other_report;
/*
* Stuff to do with the slow timer
*/
unsigned long stamp; /* time of last transmit */
unsigned long persist;
int (*persist_fxn)(struct sock *sk);
unsigned long keepalive;
void (*keepalive_fxn)(struct sock *sk);
};
static inline struct dn_scp *DN_SK(struct sock *sk)
{
return (struct dn_scp *)(sk + 1);
}
/*
* src,dst : Source and Destination DECnet addresses
* hops : Number of hops through the network
* dst_port, src_port : NSP port numbers
* services, info : Useful data extracted from conninit messages
* rt_flags : Routing flags byte
* nsp_flags : NSP layer flags byte
* segsize : Size of segment
* segnum : Number, for data, otherdata and linkservice
* xmit_count : Number of times we've transmitted this skb
* stamp : Time stamp of most recent transmission, used in RTT calculations
* iif: Input interface number
*
* As a general policy, this structure keeps all addresses in network
* byte order, and all else in host byte order. Thus dst, src, dst_port
* and src_port are in network order. All else is in host order.
*
*/
#define DN_SKB_CB(skb) ((struct dn_skb_cb *)(skb)->cb)
struct dn_skb_cb {
__le16 dst;
__le16 src;
__u16 hops;
__le16 dst_port;
__le16 src_port;
__u8 services;
__u8 info;
__u8 rt_flags;
__u8 nsp_flags;
__u16 segsize;
__u16 segnum;
__u16 xmit_count;
unsigned long stamp;
int iif;
};
static inline __le16 dn_eth2dn(unsigned char *ethaddr)
{
return get_unaligned((__le16 *)(ethaddr + 4));
}
static inline __le16 dn_saddr2dn(struct sockaddr_dn *saddr)
{
return *(__le16 *)saddr->sdn_nodeaddr;
}
static inline void dn_dn2eth(unsigned char *ethaddr, __le16 addr)
{
__u16 a = le16_to_cpu(addr);
ethaddr[0] = 0xAA;
ethaddr[1] = 0x00;
ethaddr[2] = 0x04;
ethaddr[3] = 0x00;
ethaddr[4] = (__u8)(a & 0xff);
ethaddr[5] = (__u8)(a >> 8);
}
static inline void dn_sk_ports_copy(struct flowidn *fld, struct dn_scp *scp)
{
fld->fld_sport = scp->addrloc;
fld->fld_dport = scp->addrrem;
}
unsigned int dn_mss_from_pmtu(struct net_device *dev, int mtu);
void dn_register_sysctl(void);
void dn_unregister_sysctl(void);
#define DN_MENUVER_ACC 0x01
#define DN_MENUVER_USR 0x02
#define DN_MENUVER_PRX 0x04
#define DN_MENUVER_UIC 0x08
struct sock *dn_sklist_find_listener(struct sockaddr_dn *addr);
struct sock *dn_find_by_skb(struct sk_buff *skb);
#define DN_ASCBUF_LEN 9
char *dn_addr2asc(__u16, char *);
int dn_destroy_timer(struct sock *sk);
int dn_sockaddr2username(struct sockaddr_dn *addr, unsigned char *buf,
unsigned char type);
int dn_username2sockaddr(unsigned char *data, int len, struct sockaddr_dn *addr,
unsigned char *type);
void dn_start_slow_timer(struct sock *sk);
void dn_stop_slow_timer(struct sock *sk);
extern __le16 decnet_address;
extern int decnet_debug_level;
extern int decnet_time_wait;
extern int decnet_dn_count;
extern int decnet_di_count;
extern int decnet_dr_count;
extern int decnet_no_fc_max_cwnd;
extern long sysctl_decnet_mem[3];
extern int sysctl_decnet_wmem[3];
extern int sysctl_decnet_rmem[3];
#endif /* _NET_DN_H */