Explorar el Código

Replace license boilerplate with SPDX tags

SPDX tags are recognised in several projects, including the Linux
kernel, as a valid marker for denoting the license for the files.
Let's use it, instead of having the full paragraph in every file.
Quentin Monnet hace 2 años
padre
commit
9a1fdc9fc6

+ 1 - 5
examples/disassemble.rs

@@ -1,9 +1,5 @@
+// SPDX-License-Identifier: (Apache-2.0 OR MIT)
 // Copyright 2017 6WIND S.A. <quentin.monnet@6wind.com>
-//
-// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or
-// the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be
-// copied, modified, or distributed except according to those terms.
-
 
 extern crate rbpf;
 use rbpf::disassembler;

+ 1 - 4
examples/load_elf.rs

@@ -1,8 +1,5 @@
+// SPDX-License-Identifier: (Apache-2.0 OR MIT)
 // Copyright 2016 6WIND S.A. <quentin.monnet@6wind.com>
-//
-// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or
-// the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be
-// copied, modified, or distributed except according to those terms.
 
 #![cfg_attr(feature = "cargo-clippy", allow(clippy::unreadable_literal))]
 

+ 1 - 6
examples/load_elf__block_a_port.c

@@ -1,10 +1,5 @@
+// SPDX-License-Identifier: (APACHE-2.0 OR MIT)
 // Copyright 2016 6WIND S.A. <quentin.monnet@6wind.com>
-//
-// Licensed under the Apache License, Version 2.0
-// <http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <http://opensource.org/licenses/MIT>, at your option. This file may not be
-// copied, modified, or distributed except according to those terms.
-
 
 // Block TCP packets on source or destination port 0x9999.
 

+ 1 - 5
examples/to_json.rs

@@ -1,9 +1,5 @@
+// SPDX-License-Identifier: (Apache-2.0 OR MIT)
 // Copyright 2017 6WIND S.A. <quentin.monnet@6wind.com>
-//
-// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or
-// the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be
-// copied, modified, or distributed except according to those terms.
-
 
 #[macro_use]
 extern crate json;

+ 1 - 5
examples/uptime.rs

@@ -1,9 +1,5 @@
+// SPDX-License-Identifier: (Apache-2.0 OR MIT)
 // Copyright 2017 6WIND S.A. <quentin.monnet@6wind.com>
-//
-// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or
-// the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be
-// copied, modified, or distributed except according to those terms.
-
 
 extern crate rbpf;
 use rbpf::helpers;

+ 1 - 5
src/asm_parser.rs

@@ -1,9 +1,5 @@
+// SPDX-License-Identifier: (Apache-2.0 OR MIT)
 // Copyright 2017 Rich Lane <lanerl@gmail.com>
-//
-// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or
-// the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be
-// copied, modified, or distributed except according to those terms.
-
 
 // Rust-doc comments were left in the module, but it is no longer publicly exposed from the root
 // file of the crate. Do not expect to find those comments in the documentation of the crate.

+ 1 - 5
src/assembler.rs

@@ -1,9 +1,5 @@
+// SPDX-License-Identifier: (Apache-2.0 OR MIT)
 // Copyright 2017 Rich Lane <lanerl@gmail.com>
-//
-// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or
-// the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be
-// copied, modified, or distributed except according to those terms.
-
 
 //! This module translates eBPF assembly language to binary.
 

+ 1 - 5
src/disassembler.rs

@@ -1,9 +1,5 @@
+// SPDX-License-Identifier: (Apache-2.0 OR MIT)
 // Copyright 2017 6WIND S.A. <quentin.monnet@6wind.com>
-//
-// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or
-// the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be
-// copied, modified, or distributed except according to those terms.
-
 
 //! Functions in this module are used to handle eBPF programs with a higher level representation,
 //! for example to disassemble the code into a human-readable format.

+ 1 - 5
src/ebpf.rs

@@ -1,9 +1,5 @@
+// SPDX-License-Identifier: (Apache-2.0 OR MIT)
 // Copyright 2016 6WIND S.A. <quentin.monnet@6wind.com>
-//
-// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or
-// the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be
-// copied, modified, or distributed except according to those terms.
-
 
 //! This module contains all the definitions related to eBPF, and some functions permitting to
 //! manipulate eBPF instructions.

+ 1 - 5
src/helpers.rs

@@ -1,12 +1,8 @@
+// SPDX-License-Identifier: (Apache-2.0 OR MIT)
 // Copyright 2015 Big Switch Networks, Inc
 //      (Algorithms for uBPF helpers, originally in C)
 // Copyright 2016 6WIND S.A. <quentin.monnet@6wind.com>
 //      (Translation to Rust, other helpers)
-//
-// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or
-// the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be
-// copied, modified, or distributed except according to those terms.
-
 
 //! This module implements some built-in helpers that can be called from within an eBPF program.
 //!

+ 1 - 4
src/insn_builder.rs

@@ -1,8 +1,5 @@
+// SPDX-License-Identifier: (Apache-2.0 OR MIT)
 // Copyright 2017 Alex Dukhno <alex.dukhno@icloud.com>
-//
-// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or
-// the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be
-// copied, modified, or distributed except according to those terms.
 
 //! Module provides API to create eBPF programs by Rust programming language
 

+ 1 - 5
src/jit.rs

@@ -1,13 +1,9 @@
+// SPDX-License-Identifier: (Apache-2.0 OR MIT)
 // Derived from uBPF <https://github.com/iovisor/ubpf>
 // Copyright 2015 Big Switch Networks, Inc
 //      (uBPF: JIT algorithm, originally in C)
 // Copyright 2016 6WIND S.A. <quentin.monnet@6wind.com>
 //      (Translation to Rust, MetaBuff addition)
-//
-// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or
-// the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be
-// copied, modified, or distributed except according to those terms.
-
 
 use std;
 use std::mem;

+ 1 - 5
src/lib.rs

@@ -1,13 +1,9 @@
+// SPDX-License-Identifier: (Apache-2.0 OR MIT)
 // Derived from uBPF <https://github.com/iovisor/ubpf>
 // Copyright 2015 Big Switch Networks, Inc
 //      (uBPF: VM architecture, parts of the interpreter, originally in C)
 // Copyright 2016 6WIND S.A. <quentin.monnet@6wind.com>
 //      (Translation to Rust, MetaBuff/multiple classes addition, hashmaps for helpers)
-//
-// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or
-// the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be
-// copied, modified, or distributed except according to those terms.
-
 
 //! Virtual machine and JIT compiler for eBPF programs.
 #![doc(html_logo_url = "https://raw.githubusercontent.com/qmonnet/rbpf/master/misc/rbpf.png",

+ 1 - 5
src/verifier.rs

@@ -1,13 +1,9 @@
+// SPDX-License-Identifier: (Apache-2.0 OR MIT)
 // Derived from uBPF <https://github.com/iovisor/ubpf>
 // Copyright 2015 Big Switch Networks, Inc
 //      (uBPF: safety checks, originally in C)
 // Copyright 2016 6WIND S.A. <quentin.monnet@6wind.com>
 //      (Translation to Rust)
-//
-// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or
-// the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be
-// copied, modified, or distributed except according to those terms.
-
 
 // This “verifier” performs simple checks when the eBPF program is loaded into the VM (before it is
 // interpreted or JIT-compiled). It has nothing to do with the much more elaborated verifier inside

+ 1 - 4
tests/assembler.rs

@@ -1,8 +1,5 @@
+// SPDX-License-Identifier: (Apache-2.0 OR MIT)
 // Copyright 2017 Rich Lane <lanerl@gmail.com>
-//
-// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or
-// the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be
-// copied, modified, or distributed except according to those terms.
 
 #![cfg_attr(feature = "cargo-clippy", allow(clippy::unreadable_literal))]
 

+ 1 - 5
tests/common.rs

@@ -1,11 +1,7 @@
+// SPDX-License-Identifier: (Apache-2.0 OR MIT)
 // Converted from the tests for uBPF <https://github.com/iovisor/ubpf>
 // Copyright 2015 Big Switch Networks, Inc
 // Copyright 2016 6WIND S.A. <quentin.monnet@6wind.com>
-//
-// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or
-// the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be
-// copied, modified, or distributed except according to those terms.
-
 
 // Assembly code and data for tcp_sack testcases.
 

+ 1 - 5
tests/disassembler.rs

@@ -1,11 +1,7 @@
+// SPDX-License-Identifier: (Apache-2.0 OR MIT)
 // Copyright 2017 Jan-Erik Rediger <badboy@archlinux.us>
 //
 // Adopted from tests in `tests/assembler.rs`
-//
-// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or
-// the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be
-// copied, modified, or distributed except according to those terms.
-
 
 extern crate rbpf;
 mod common;

+ 1 - 4
tests/misc.rs

@@ -1,8 +1,5 @@
+// SPDX-License-Identifier: (Apache-2.0 OR MIT)
 // Copyright 2016 6WIND S.A. <quentin.monnet@6wind.com>
-//
-// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or
-// the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be
-// copied, modified, or distributed except according to those terms.
 
 // There are unused mut warnings due to unsafe code.
 #![allow(unused_mut)]

+ 1 - 5
tests/ubpf_jit_x86_64.rs

@@ -1,11 +1,7 @@
+// SPDX-License-Identifier: (Apache-2.0 OR MIT)
 // Converted from the tests for uBPF <https://github.com/iovisor/ubpf>
 // Copyright 2015 Big Switch Networks, Inc
 // Copyright 2016 6WIND S.A. <quentin.monnet@6wind.com>
-//
-// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or
-// the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be
-// copied, modified, or distributed except according to those terms.
-
 
 // The tests contained in this file are extracted from the unit tests of uBPF software. Each test
 // in this file has a name in the form `test_jit_<name>`, and corresponds to the (human-readable)

+ 1 - 6
tests/ubpf_verifier.rs

@@ -1,11 +1,7 @@
+// SPDX-License-Identifier: (Apache-2.0 OR MIT)
 // Converted from the tests for uBPF <https://github.com/iovisor/ubpf>
 // Copyright 2015 Big Switch Networks, Inc
 // Copyright 2016 6WIND S.A. <quentin.monnet@6wind.com>
-//
-// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or
-// the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be
-// copied, modified, or distributed except according to those terms.
-
 
 // The tests contained in this file are extracted from the unit tests of uBPF software. Each test
 // in this file has a name in the form `test_verifier_<name>`, and corresponds to the
@@ -20,7 +16,6 @@
 
 // These are unit tests for the eBPF “verifier”.
 
-
 extern crate rbpf;
 
 use rbpf::assembler::assemble;

+ 1 - 5
tests/ubpf_vm.rs

@@ -1,11 +1,7 @@
+// SPDX-License-Identifier: (Apache-2.0 OR MIT)
 // Converted from the tests for uBPF <https://github.com/iovisor/ubpf>
 // Copyright 2015 Big Switch Networks, Inc
 // Copyright 2016 6WIND S.A. <quentin.monnet@6wind.com>
-//
-// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or
-// the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be
-// copied, modified, or distributed except according to those terms.
-
 
 // The tests contained in this file are extracted from the unit tests of uBPF software. Each test
 // in this file has a name in the form `test_vm_<name>`, and corresponds to the (human-readable)