Browse Source

Locking down licensing.

Got some final licensing advice from an uber-open-sourcer, and updated licensing
information accordingly across the board.

Also, fixed issue with loopback INET6, where different unix distros have
different PF_INET6 values (wtf?).
Graeme Connell 7 years ago
parent
commit
771575758d

+ 2 - 2
LICENSE

@@ -1,5 +1,5 @@
 Copyright (c) 2012 Google, Inc. All rights reserved.
-Copyright (c) 2009-2012 Andreas Krennmair. All rights reserved.
+Copyright (c) 2009-2011 Andreas Krennmair. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
@@ -11,7 +11,7 @@ notice, this list of conditions and the following disclaimer.
 copyright notice, this list of conditions and the following disclaimer
 in the documentation and/or other materials provided with the
 distribution.
-   * Neither the name of Google, Inc. nor the names of its
+   * Neither the name of Andreas Krennmair, Google, nor the names of its
 contributors may be used to endorse or promote products derived from
 this software without specific prior written permission.
 

+ 4 - 0
base.go

@@ -1,4 +1,8 @@
 // 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.
 
 package gopacket
 

+ 4 - 0
benchmark_test.go

@@ -1,4 +1,8 @@
 // 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.
 
 package gopacket
 

+ 4 - 0
decode.go

@@ -1,4 +1,8 @@
 // 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.
 
 package gopacket
 

+ 4 - 0
doc.go

@@ -1,4 +1,8 @@
 // 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.
 
 /*
 Package gopacket provides packet decoding for the Go language.

+ 4 - 0
flows.go

@@ -1,4 +1,8 @@
 // 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.
 
 package gopacket
 

+ 4 - 0
gen.go

@@ -1,4 +1,8 @@
 // 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.
 
 // +build ignore
 

+ 4 - 0
layerclass.go

@@ -1,4 +1,8 @@
 // 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.
 
 package gopacket
 

+ 5 - 1
layers/arp.go

@@ -1,5 +1,9 @@
 // Copyright 2012 Google, Inc. All rights reserved.
-// Copyright 2009-2012 Andreas Krennmair. 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
 

+ 6 - 0
layers/base.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.
+
 package layers
 
 import (

+ 4 - 0
layers/base_test.go

@@ -1,4 +1,8 @@
 // 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.
 
 // This file contains some test helper functions.
 

+ 4 - 0
layers/cdp.go

@@ -1,4 +1,8 @@
 // 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.
 
 package layers
 

+ 4 - 0
layers/ctp.go

@@ -1,4 +1,8 @@
 // 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.
 
 package layers
 

+ 5 - 1
layers/decode_test.go

@@ -1,5 +1,9 @@
 // Copyright 2012, Google, Inc. All rights reserved.
-// Copyright 2009-2012 Andreas Krennmair. 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
 

+ 4 - 0
layers/doc.go

@@ -1,4 +1,8 @@
 // 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.
 
 /*
 Package layers provides decoding layers for many common protocols.

+ 5 - 1
layers/dot1q.go

@@ -1,5 +1,9 @@
 // Copyright 2012 Google, Inc. All rights reserved.
-// Copyright 2009-2012 Andreas Krennmair. 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
 

+ 4 - 0
layers/eap.go

@@ -1,4 +1,8 @@
 // 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.
 
 package layers
 

+ 4 - 0
layers/eapol.go

@@ -1,4 +1,8 @@
 // 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.
 
 package layers
 

+ 6 - 0
layers/endpoints.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.
+
 package layers
 
 import (

+ 9 - 3
layers/enums.go

@@ -1,5 +1,9 @@
 // Copyright 2012 Google, Inc. All rights reserved.
-// Copyright 2009-2012 Andreas Krennmair. 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
 
@@ -362,6 +366,8 @@ func init() {
 	EAPOLTypeMetadata[EAPOLTypeEAP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeEAP), Name: "EAP"}
 
 	ProtocolFamilyMetadata[ProtocolFamilyIPv4] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv4), Name: "IPv4"}
-	ProtocolFamilyMetadata[ProtocolFamilyIPv6] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6), Name: "IPv6"}
-	ProtocolFamilyMetadata[ProtocolFamilyPPP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodePPP), Name: "PPP"}
+	ProtocolFamilyMetadata[ProtocolFamilyIPv6BSD] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6), Name: "IPv6"}
+	ProtocolFamilyMetadata[ProtocolFamilyIPv6FreeBSD] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6), Name: "IPv6"}
+	ProtocolFamilyMetadata[ProtocolFamilyIPv6Darwin] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6), Name: "IPv6"}
+	ProtocolFamilyMetadata[ProtocolFamilyIPv6Linux] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6), Name: "IPv6"}
 }

+ 4 - 0
layers/etherip.go

@@ -1,4 +1,8 @@
 // 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.
 
 package layers
 

+ 5 - 1
layers/ethernet.go

@@ -1,5 +1,9 @@
 // Copyright 2012 Google, Inc. All rights reserved.
-// Copyright 2009-2012 Andreas Krennmair. 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
 

+ 4 - 0
layers/fddi.go

@@ -1,4 +1,8 @@
 // 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.
 
 package layers
 

+ 4 - 0
layers/gen.go

@@ -1,4 +1,8 @@
 // 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.
 
 // +build ignore
 

+ 4 - 0
layers/gre.go

@@ -1,4 +1,8 @@
 // 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.
 
 package layers
 

+ 4 - 0
layers/iana_ports.go

@@ -1,4 +1,8 @@
 // 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.
 
 package layers
 

+ 5 - 1
layers/icmp.go

@@ -1,5 +1,9 @@
 // Copyright 2012 Google, Inc. All rights reserved.
-// Copyright 2009-2012 Andreas Krennmair. 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
 

+ 5 - 1
layers/ip4.go

@@ -1,5 +1,9 @@
 // Copyright 2012 Google, Inc. All rights reserved.
-// Copyright 2009-2012 Andreas Krennmair. 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
 

+ 5 - 1
layers/ip6.go

@@ -1,5 +1,9 @@
 // Copyright 2012 Google, Inc. All rights reserved.
-// Copyright 2009-2012 Andreas Krennmair. 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
 

+ 4 - 0
layers/ipsec.go

@@ -1,4 +1,8 @@
 // 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.
 
 package layers
 

+ 4 - 0
layers/ipsec_test.go

@@ -1,4 +1,8 @@
 // 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.
 
 package layers
 

+ 4 - 0
layers/layertypes.go

@@ -1,4 +1,8 @@
 // Copyright 2012 Google, gopacket.LayerTypeMetadata{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.
 
 package layers
 

+ 4 - 0
layers/llc.go

@@ -1,4 +1,8 @@
 // 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.
 
 package layers
 

+ 4 - 0
layers/loopback.go

@@ -1,4 +1,8 @@
 // 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.
 
 package layers
 

+ 4 - 0
layers/mpls.go

@@ -1,4 +1,8 @@
 // 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.
 
 package layers
 

+ 4 - 0
layers/ports.go

@@ -1,4 +1,8 @@
 // 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.
 
 package layers
 

+ 4 - 0
layers/ppp.go

@@ -1,4 +1,8 @@
 // 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.
 
 package layers
 

+ 4 - 0
layers/pppoe.go

@@ -1,4 +1,8 @@
 // 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.
 
 package layers
 

+ 4 - 0
layers/rudp.go

@@ -1,4 +1,8 @@
 // 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.
 
 package layers
 

+ 4 - 0
layers/sctp.go

@@ -1,4 +1,8 @@
 // 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.
 
 package layers
 

+ 10 - 2
layers/socket_h.go

@@ -1,4 +1,8 @@
 // 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.
 
 package layers
 
@@ -7,6 +11,10 @@ import "C"
 
 const (
 	ProtocolFamilyIPv4 ProtocolFamily = C.PF_INET
-	ProtocolFamilyIPv6 ProtocolFamily = C.PF_INET6
-	ProtocolFamilyPPP  ProtocolFamily = C.PF_PPP
+	// BSDs use different values for INET6... glory be.  These values taken from
+	// tcpdump 4.3.0.
+	ProtocolFamilyIPv6BSD     ProtocolFamily = 24
+	ProtocolFamilyIPv6FreeBSD ProtocolFamily = 28
+	ProtocolFamilyIPv6Darwin  ProtocolFamily = 30
+	ProtocolFamilyIPv6Linux   ProtocolFamily = 10
 )

+ 5 - 1
layers/tcp.go

@@ -1,5 +1,9 @@
 // Copyright 2012 Google, Inc. All rights reserved.
-// Copyright 2009-2012 Andreas Krennmair. 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
 

+ 5 - 1
layers/udp.go

@@ -1,5 +1,9 @@
 // Copyright 2012 Google, Inc. All rights reserved.
-// Copyright 2009-2012 Andreas Krennmair. 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
 

+ 5 - 1
layers/udplite.go

@@ -1,5 +1,9 @@
 // Copyright 2012 Google, Inc. All rights reserved.
-// Copyright 2009-2012 Andreas Krennmair. 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
 

+ 4 - 0
layertype.go

@@ -1,4 +1,8 @@
 // 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.
 
 package gopacket
 

+ 6 - 2
packet.go

@@ -1,4 +1,8 @@
 // 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.
 
 package gopacket
 
@@ -381,7 +385,7 @@ func NewPacket(data []byte, firstLayerDecoder Decoder, options DecodeOptions) Pa
 
 // PacketDataSource is an interface for some source of packet data.  Users may
 // create their own implementations, or use the existing implementations in
-// gopacket/pcap (libpcap, allows reading from live interfaces or from 
+// gopacket/pcap (libpcap, allows reading from live interfaces or from
 // pcap files) or gopacket/pfring (PF_RING, allows reading from live
 // interfaces).
 type PacketDataSource interface {
@@ -438,7 +442,7 @@ type PacketSource struct {
 	DecodeOptions
 }
 
-// NewPacketSource creates a packet data source.  
+// NewPacketSource creates a packet data source.
 func NewPacketSource(source PacketDataSource, decoder Decoder) *PacketSource {
 	return &PacketSource{
 		source:  source,

+ 4 - 0
pcap/benchmark.go

@@ -1,4 +1,8 @@
 // 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.
 
 // +build ignore
 

+ 4 - 0
pcap/doc.go

@@ -1,4 +1,8 @@
 // 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.
 
 /*
 Package pcap allows users of gopacket to read packets off the wire or from

+ 5 - 1
pcap/pcap.go

@@ -1,5 +1,9 @@
 // Copyright 2012 Google, Inc. All rights reserved.
-// Copyright 2009-2012 Andreas Krennmair. 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 pcap
 

+ 4 - 0
pcap/pcap_test.go

@@ -1,4 +1,8 @@
 // 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.
 
 package pcap
 

+ 4 - 0
pcap/tcpdump.go

@@ -1,4 +1,8 @@
 // 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.
 
 // +build ignore
 

+ 4 - 0
pfring/doc.go

@@ -1,4 +1,8 @@
 // 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.
 
 /* Package pfring wraps the PF_RING C library for Go.
 

+ 5 - 1
pfring/pfring.go

@@ -1,5 +1,9 @@
 // Copyright 2012 Google, Inc. All rights reserved.
-// Copyright 2009-2012 Andreas Krennmair. 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 pfring
 

+ 4 - 0
pfring/simple.go

@@ -1,4 +1,8 @@
 // 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.
 
 // +build ignore
 

+ 4 - 0
valid_mac_prefixes.go

@@ -1,4 +1,8 @@
 // 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.
 
 package gopacket