From e5b4c70418d7d42071b14eeb3b87713564077a57 Mon Sep 17 00:00:00 2001 From: Graeme Connell Date: Fri, 20 Dec 2013 10:47:00 -0700 Subject: [PATCH] Fix copyrights, add copyright check to gc, changelog update. --- CHANGELOG | 8 ++++++++ examples/arpscan/arpscan.go | 6 ++++++ gc | 14 +++++++++++--- layers/bytediff.go | 7 +++++++ layers/bytediff_test.go | 7 +++++++ layers/tcpip.go | 7 +++++++ 6 files changed, 46 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1e1b331..572dd64 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -18,6 +18,14 @@ gopacket@googlegroups.com mailing list. ==Changes== +===v1.0.3 20131220 Write/Fix/Move example code + +Commit: +https://code.google.com/p/gopacket/source/detail?r=26e14693245d21d9dfb69381803f373a44dcbab6 + +Wrote arp scanning example to show basic packet generation and sending. Fixed tcp assembly +example to not hang forever. Moved all example binaries into examples subdirectory. + ===v1.0.2 20131202 Serialization bugfixes for IPv4/TCP Commit: diff --git a/examples/arpscan/arpscan.go b/examples/arpscan/arpscan.go index a268b75..eabe7e9 100644 --- a/examples/arpscan/arpscan.go +++ b/examples/arpscan/arpscan.go @@ -1,3 +1,9 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + // arpscan implements ARP scanning of all interfaces' local networks using // gopacket and its subpackages. This example shows, among other things: // * Generating and sending packet data diff --git a/gc b/gc index da9dc20..1f60773 100755 --- a/gc +++ b/gc @@ -56,11 +56,19 @@ if [ "$#" -eq "0" ]; then Usage fi +cd $(dirname $0) + +# Check for copyright notices. +for filename in $(find ./ -type f -name '*.go'); do + if ! head -n 1 "$filename" | grep -q Copyright; then + echo "File '$filename' may not have copyright notice" + exit 1 + fi +done + set -e set -x -cd $(dirname $0) - if [ ! -z "$GEN" ]; then pushd macs go run gen.go | gofmt > valid_mac_prefixes.go @@ -70,7 +78,7 @@ if [ ! -z "$GEN" ]; then popd fi -# First, make sure everything is formatted, compiles, and tests pass. +# Make sure everything is formatted, compiles, and tests pass. go fmt ./... go test -i ./... 2>/dev/null >/dev/null || true go test diff --git a/layers/bytediff.go b/layers/bytediff.go index e01490c..680d77d 100644 --- a/layers/bytediff.go +++ b/layers/bytediff.go @@ -1,3 +1,10 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// Copyright 2009-2011 Andreas Krennmair. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + package layers // bytediff provides a simple diff utility for looking at differences in byte diff --git a/layers/bytediff_test.go b/layers/bytediff_test.go index 128c1e0..6e8d720 100644 --- a/layers/bytediff_test.go +++ b/layers/bytediff_test.go @@ -1,3 +1,10 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// Copyright 2009-2011 Andreas Krennmair. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + package layers import ( diff --git a/layers/tcpip.go b/layers/tcpip.go index 5c94587..a66a75d 100644 --- a/layers/tcpip.go +++ b/layers/tcpip.go @@ -1,3 +1,10 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// Copyright 2009-2011 Andreas Krennmair. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + package layers import (