code
stringlengths
10
1.34M
language
stringclasses
1 value
// $G $D/$F.go // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main // No newline at the end of this comment.
Go
// errchk $G -e $D/$F.go // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Pass 2 label errors. package main var x int func f() { L1: for { if x == 0 { break L1 } if x == 1 { continue L1 ...
Go
// $G $F.go && $L $F.$A && ./$A.out // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "fmt" "strconv" ) const count = 100 func P(a []string) string { s := "{" for i := 0; i < len(a...
Go
// $G $F.go && $L $F.$A && ./$A.out // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Correct short declarations and redeclarations. package main func f1() int { return 1 } func f2() (f...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Generate primes up to 100 using channels, checking the results. // This sieve consists of a linear chain of divisibil...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Issue 2075 // A bug in select corrupts channel queues of failed cases // if there are multiple waiters on those chan...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // make a lot of goroutines, threaded together. // tear them down cleanly. package main import ( "os" "strconv" ) f...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Verify that unbuffered channels act as pure fifos. package main import "os" const N = 10 func AsynchFifo() { ch ...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Tests verifying the semantics of the select statement // for basic empty/non-empty cases. package main import "time...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Power series package // A power series is a channel, along which flow rational // coefficients. A denominator of zer...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Verify channel operations that test for blocking // Use several sizes and types of operands package main import "ru...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Generate primes up to 100 using channels, checking the results. // This sieve is Eratosthenesque and only considers o...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Test select when discarding a value. package main import "runtime" func recv1(c <-chan int) { <-c } func recv2(...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Test various parsing cases that are a little // different now that send is a statement, not a expression. package m...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out package main func f() *int { println("BUG: called f") return new(int) } func main() { var x struct { a int } c := make(chan int, 1) c1 := make(chan int) c <- 42 select { case *f() = <-c1: // nothing case x.a = <-c: if x.a != 42 { println("BUG:", x.a) } } }...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main var counter uint var shift uint func GetValue() uint { counter++ return 1 << shift } func Send(a, b ch...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import "runtime" func sender(c chan int, n int) { for i := 0; i < n; i++ { c <- 1 } } func receiver...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Making channels of a zero-sized type should not panic. package main func main() { _ = make(chan [0]byte) _ = make...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This test is designed to flush out the case where two cases of a select can // both end up running. See http://codere...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out >tmp.go && // $G tmp.go && $L tmp.$A && ./$A.out || echo BUG: select5 // rm -f tmp.go // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Generate test of channel opera...
Go
// errchk $G -e $D/$F.go // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main var ( cr <-chan int cs chan<- int c chan int ) func main() { cr = c // ok cs = c // ok c = cr // ERROR "illeg...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Power series package // A power series is a channel, along which flow rational // coefficients. A denominator of zer...
Go
// $G $F.go && $L $F.$A && ./$A.out // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main func assertequal(is, shouldbe int, msg string) { if is != shouldbe { print("assertion fail", msg, "\n") ...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import "unsafe" func use(bool) {} func stringptr(s string) uintptr { return *(*uintptr)(unsafe.Pointer(&...
Go
// $G $F.go && $L $F.$A && ./$A.out // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main type T struct { i int f float64 s string next *T } type R struct { num int } func itor(a int)...
Go
// $G $D/ddd2.go && $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import "./ddd2" func main() { if x := ddd.Sum(1, 2, 3); x != 6 { println("ddd.Sum 6"...
Go
// errchk $G -e $D/$F.go // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main var m map[int][3]int func f() [3]int func fp() *[3]int var mp map[int]*[3]int var ( _ = [3]int{1, 2, 3}[:] // ERRO...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // trivial malloc test package main import ( "flag" "fmt" "runtime" ) var chatty = flag.Bool("v", false, "chatty")...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG wrong result // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main func main() { var x int = 1 if x != 1 { print("found ", x, ", expected 1\n") ...
Go
// errchk $G -e $F.go // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main const ( // check that surrogate pair elements are invalid // (d800-dbff, dc00-dfff). _ = '\ud7ff' // ok _ = '\ud800' /...
Go
// $G $F.go && $L $F.$A && ./$A.out // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import "os" const ( Bool = iota Int Float String Struct Chan Array Map Func Last ) type S struct ...
Go
// $G $F.go && $L $F.$A && ./$A.out // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main func main() { print("hello, world\n") }
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import "fmt" type T int func (t T) String() string { return fmt.Sprintf("T%d", int(t)) } const ( A T =...
Go
// $G $D/$F.go // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import "unsafe" type T struct { X int } var t T func isUintptr(uintptr) {} func main() { isUintptr(unsafe.Sizeof(t)) isUin...
Go
// errchk $G $D/$F.go // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main type T struct { a int } type P *T type P1 *T func (p P) val() int { return 1 } // ERROR "receiver.* pointer|invalid poi...
Go
// $G $D/$F.go // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // No newline at the end of this file. package main
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Test that basic operations on named types are valid // and preserve the type. package main type Array [10]byte typ...
Go
// $G $F.go && $L $F.$A && ./$A.out // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main var a = []int{1, 2} var b = [5]int{1, 2, 3} var c = []int{1} var d = [...]int{1, 2, 3} func main() { if len...
Go
// true # used by import3 // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package p var C1 chan <- chan int = (chan<- (chan int))(nil) var C2 chan (<- chan int) = (chan (<-chan int))(nil) var C3 <- chan c...
Go
// errchk $G $D/$F.go // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main var notmain func() func main() { var x = &main // ERROR "address of|invalid" main = notmain // ERROR "assign to|invalid...
Go
// errchk $G $F.go // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main type t1 int type t2 int type t3 int func f1(*t2, x t3) // ERROR "named" func f2(t1, *t2, x t3) // ERROR "named" func f3() (x ...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import "unsafe" // Having a big address space means that indexing // at a 256 MB offset from a nil point...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This used to crash because the scheduler // tried to kick off a new scheduling thread for f // when time.Nanoseconds ...
Go
// $G $F.go && $L $F.$A && ./$A.out // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "fmt" "time" ) type T struct { i int } type IN interface{} func main() { var i *int var f *f...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Test run-time behavior of escape analysis-related optimizations. package main func main() { test1() } func test1...
Go
// $G $D/import2.go && $G $D/$F.go // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Check that all the types from import2.go made it // intact and with the same meaning, by assigning to or using them. pa...
Go
// $G $F.go && $L $F.$A && ./$A.out arg1 arg2 // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import "os" func main() { if len(os.Args) != 3 { panic("argc") } if os.Args[1] != "arg1" { ...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Control over logging from the XMPP library. package xmpp var ( // If any of these are non-nil when NewClient() is called, // they will be used to log me...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package xmpp import ( "encoding/xml" "fmt" ) // This file contains support for roster management, RFC 3921, Section 7. var rosterExt Extension = Extension...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( xmpp ".." "crypto/tls" "encoding/xml" "flag" "fmt" "log" "os" "strings" ) type StdLogger struct { } func (s *StdLogger) Log(v ...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file contains the three layers of processing for the // communication with the server: transport (where TLS happens), XML // (where strings are convert...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This package implements a simple XMPP client according to RFCs 3920 // and 3921, plus the various XEPs at http://xmpp.org/protocols/. package xmpp import (...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package xmpp // This file contains data structures. import ( "bytes" "encoding/xml" "flag" "fmt" // BUG(cjyar): We should use stringprep // "code.googl...
Go
package manip_exec import ( "fmt" "go/ast" "go/format" "go/parser" "go/token" "math/rand" "os" "os/exec" "path/filepath" "resbuilder" "strconv" "strings" "time" ) //Specifies if the manipulation should be random or sequential const ( RAND = iota SEQ ) //Specifies the position in the args array const (...
Go
package errchk_manip import ( "fmt" "go/ast" "strings" "manip_exec" ) type ErrManipulator struct { } var astNodes = make([]ast.Node, 0) func (m ErrManipulator) ManipulateAST(f ast.Node, index int) (manip_exec.ManiRes, error) { astNodes = make([]ast.Node, 0) //This has to be reset as well // Walk through th...
Go
package resbuilder import "fmt" //Raw Results struct type TestRawCapture struct { Start string RunString string TestName string Middle string PassFail string TimeTook string FailString string Passed bool } //Raw Results manipulator func ResultBuilder(raw []byte) []TestRawCapture { var r...
Go
package boolean_manip import ( "fmt" "go/ast" "go/token" "manip_exec" ) type BoolManipulator struct { } var astNodes = make([]ast.Node, 0) func (m BoolManipulator) ManipulateAST(f ast.Node, index int) (manip_exec.ManiRes, error) { astNodes = make([]ast.Node, 0) //This has to be reset as well // Walk throug...
Go
package arthm_manip import ( "fmt" "go/ast" "go/token" "manip_exec" ) type ArthmManipulator struct { } var astNodes = make([]ast.Node, 0) func (m ArthmManipulator) ManipulateAST(f ast.Node, index int) (manip_exec.ManiRes, error) { astNodes = make([]ast.Node, 0) //This has to be reset as well // Walk throu...
Go
package varnam_manip import ( "fmt" "go/ast" "manip_exec" ) type VarManipulator struct { } var astNodes []ast.Node var Idents []*ast.Ident func (m VarManipulator) ManipulateAST(f ast.Node, index int) (manip_exec.ManiRes, error) { astNodes = make([]ast.Node, 0) //This has to be reset as well Idents = make([]*...
Go
package calculator func Calc(x, y, op int) int { switch op { case 1: return add(x, y) case 2: return subtract(x, y) case 3: return multiply(x, y) case 4: return divide(x, y) case 5: return modulus(x, y) case 6: return greater(x, y) case 7: return lesser(x, y) case 8: return greaterEQ(x, y) ca...
Go
package main import ( "flag" "fmt" //"html/template" "net/http" "os" "path/filepath" "strings" //"strconv" ) type Page struct { Title string Randseq string Iterations string FalsePos string File1 string File2 string //PACKAGENAME string } type ResultsPage struct { Title string Ta...
Go
package main import ( "arthm_manip" "boolean_manip" "errchk_manip" "flag" "fmt" "manip_exec" "os/exec" "strconv" "varnam_manip" ) const ( PACKAGE_NAME = iota RANDSEQ ITERATIONS ) var Executor = &manip_exec.Manip_Exec{make([]manip_exec.Manipulator, 0), make([]int, 10)} func main() { flag.Parse() args ...
Go
/* * jQuery File Upload Plugin GAE Go Example 1.2.1 * https://github.com/blueimp/jQuery-File-Upload * * Copyright 2011, Sebastian Tschan * https://blueimp.net * * Licensed under the MIT license: * http://www.opensource.org/licenses/MIT */ package app import ( "appengine" "appengine/blobstore" "appengine/m...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package resize import ( "image" "image/ycbcr" ) // Resize returns a scaled copy of the image slice r of m. // The returned image has width w and height h. f...
Go
/* * jQuery File Upload Plugin GAE Go Example 2.1 * https://github.com/blueimp/jQuery-File-Upload * * Copyright 2011, Sebastian Tschan * https://blueimp.net * * Licensed under the MIT license: * http://www.opensource.org/licenses/MIT */ package app import ( "appengine" "appengine/blobstore" "appengine/ima...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package goplay import ( "appengine" "appengine/urlfetch" "fmt" "http" "io" "os" ) const runUrl = "http://golang.org/compile?output=json" func init() {...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package pic import ( "bytes" "encoding/base64" "image" "image/png" "fmt" ) func Show(f func(int, int) [][]uint8) { const ( dx = 256 dy = 256 ) da...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package tree import ( "fmt" "rand" ) // A Tree is a binary tree with integer values. type Tree struct { Left *Tree Value int Right *Tree } // New retu...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "log" "json" "http" ) func init() { http.HandleFunc("/compile", Compile) } type Response struct { Output string `json:"output"` ...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "bytes" "exec" "flag" "fmt" "go/build" "http" "io/ioutil" "log" "os" "path/filepath" "runtime" "strconv" "strings" "sync" ...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package wc import "fmt" // Test runs a test suite against f. func Test(f func(string) map[string]int) { ok := true for _, c := range testCases { got := f...
Go
// 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 import ( "fmt" "strconv" ) // LayerType is a unique identifier for each type of layer. This enumeration ...
Go
// 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 ( "fmt" "strconv" ) // TCPPort is a port in a TCP layer. type TCPPort uint16 // UDPPort is a port i...
Go
// 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 ( "code.google.com/p/gopacket" "encodi...
Go
// 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 ( "code.google.com/p/gopacket" "encoding/binary" "fmt" ) // Loopback contains the header for loopba...
Go
// 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 ( "code.google.com/p/gopacket" "errors...
Go
// 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 ( "code.google.com/p/gopacket" "encoding/binary" "fmt" ) // EthernetCTPFunction is the function cod...
Go
// 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 ( "code.google.com/p/gopacket" "encoding/binary" ) // PPPoE is the layer for PPPoE encapsulation hea...
Go
// 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 ( "code.google.com/p/gopacket" "encodi...
Go
// 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 ( "code.google.com/p/gopacket" "encodi...
Go
// 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 ( "code.google.com/p/gopacket" "encoding/binary" "fmt" ) // LLDPTLVType is the type of each TLV val...
Go
// 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 ( "code.google.com/p/gopacket" "net" ) // FDDI contains the header for FDDI frames. type FDDI struct...
Go
// 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 ( "code.google.com/p/gopacket" "encoding/binary" ) // GRE is a Generic Routing Encapsulation header....
Go
// 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 ( "code.google.com/p/gopacket" ) // EAPOL defines an EAP over LAN (802.1x) layer. type EAPOL struct {...
Go
// 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. // Enum types courtesy of... // http://anonsvn.wireshark.org/wireshark/trunk/epan/dissectors/packet-ndp.c package layers imp...
Go
// 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 ( "code.google.com/p/gopacket" "encoding/binary" ) // EtherIP is the struct for storing RFC 3378 Eth...
Go
// 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 import ( "code.google.com/p/gopacket" ) var ( LayerTypeARP =...
Go
// 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 ( "code.google.com/p/gopacket" "encoding/binary" "errors" ) // PFLog provides the layer for 'pf' pa...
Go
// 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 ( "code.google.com/p/gopacket" "encodi...
Go
// 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 ( "code.google.com/p/gopacket" "encoding/binary" ) // IPSecAH is the authentication header for IPv4/...
Go
// 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 ( "code.google.com/p/gopacket" "encoding/binary" "net" "strconv" ) var ( // We use two different ...
Go
// 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 ( "code.google.com/p/gopacket" ) // BaseLayer is a convenience struct which implements the LayerData ...
Go
// 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 // This binary pulls known ports from IANA, and uses them to populate // iana_ports.go's TCPPortNames and UD...
Go
// 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 ( "code.google.com/p/gopacket" "encoding/binary" ) // LLC is the layer used for 802.2 Logical Link C...
Go
// 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 ( "code.google.com/p/gopacket" "fmt" )...
Go
// 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 ( "code.google.com/p/gopacket" "encodi...
Go
// 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. // Enum types courtesy of... // http://search.cpan.org/~mchapman/Net-CDP-0.09/lib/Net/CDP.pm // https://code.google.com/p/...
Go
// 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 ( "code.google.com/p/gopacket" "encodi...
Go
// Copyright 2012 Google, Inc. All rights reserved. package layers // Created by gen.go, don't edit manually // Generated at 2014-04-26 21:11:27.326615724 -0600 MDT // Fetched from "http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xml" // TCPPortNames contains the port names for ...
Go
// 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 ( "code.google.com/p/gopacket" "encoding/binary" "errors" ) // PPP is the layer for PPP encapsulati...
Go