code
stringlengths
10
1.34M
language
stringclasses
1 value
// Copyright 2012 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 code snippets included in "The Go image/draw package." package main import ( "image" "image/color" "image/draw" ) func main() { ...
Go
// Copyright 2012 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" "image" ) func main() { p := image.Point{2, 1} fmt.Println("X is", p.X, "Y is", p.Y) }
Go
// Copyright 2012 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 ( "encoding/json" "log" "reflect" ) type FamilyMember struct { Name string Age int Parents []string } // STOP OMIT func Dec...
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 code snippets included in "Error Handling and Go." package main import ( "net/http" "text/template" ) type appError struct { Err...
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" "encoding/gob" "fmt" "log" ) type P struct { X, Y, Z int Name string } type Q struct { X, Y *int32 Name string } fu...
Go
// Copyright 2012 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" "image" ) func main() { m0 := image.NewRGBA(image.Rect(0, 0, 8, 5)) m1 := m0.SubImage(image.Rect(1, 2, 5, 5)).(*image.RGBA) f...
Go
// Copyright 2012 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 query type Conn string func (c Conn) DoQuery(query string) Result { return Result("result") } type Result string func Query(conns []Conn, query stri...
Go
// Copyright 2012 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 print // #include <stdio.h> // #include <stdlib.h> import "C" import "unsafe" func Print(s string) { cs := C.CString(s) defer C.free(unsafe.Pointer(c...
Go
// Copyright 2012 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 ( "encoding/json" "log" "reflect" ) type Message struct { Name string Body string Time int64 } // STOP OMIT func Encode() { 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. /* Generating random text: a Markov chain algorithm Based on the program presented in the "Design and Implementation" chapter of The Practice of Programming (...
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 ( "fmt" "math/rand" ) const ( win = 100 // The winning score in a game of Pig gamesPerSeries = 10 // The number of games p...
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" "net/http" "time" ) const ( numPollers = 2 // number of Poller goroutines to launch pollInterval = 60 * ...
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 spdy import ( "compress/zlib" "encoding/binary" "io" "net/http" "strings" ) func (frame *SynStreamFrame) read(h ControlFrameHeader, f *Framer) er...
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 spdy import ( "encoding/binary" "io" "net/http" "strings" ) func (frame *SynStreamFrame) write(f *Framer) error { return f.writeSynStreamFrame(fr...
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 spdy implements SPDY protocol which is described in // draft-mbelshe-httpbis-spdy-00. // // http://tools.ietf.org/html/draft-mbelshe-httpbis-spdy-00 ...
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 websocket // This file implements a protocol of Hixie draft version 75 and 76 // (draft 76 equals to hybi 00) import ( "bufio" "bytes" "crypto/md5"...
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 websocket implements a client and server for the WebSocket protocol. // The protocol is defined at http://tools.ietf.org/html/draft-ietf-hybi-thewebs...
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 websocket // This file implements a protocol of hybi draft. // http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17 import ( "bufio" "...
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 websocket import ( "bufio" "fmt" "io" "net/http" ) func newServerConn(rwc io.ReadWriteCloser, buf *bufio.ReadWriter, req *http.Request) (conn *Con...
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 websocket import ( "bufio" "crypto/tls" "io" "net" "net/url" ) // DialError is an error that occurs while dialling a websocket server. type DialE...
Go
// Copyright 2012 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 idna // This file implements the Punycode algorithm from RFC 3492. import ( "fmt" "math" "strings" "unicode/utf8" ) // These parameter values are...
Go
// Copyright 2012 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 idna implements IDNA2008 (Internationalized Domain Names for // Applications), defined in RFC 5890, RFC 5891, RFC 5892, RFC 5893 and // RFC 5894. pac...
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 dict implements the Dictionary Server Protocol // as defined in RFC 2229. package dict import ( "net/textproto" "strconv" "strings" ) // A Clie...
Go
// Copyright 2012 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 ipv4 import ( "syscall" ) func ipv4HeaderPrepend(fd int) (bool, error) { // TODO(mikio): Implement this return false, syscall.EPLAN9 } func setIP...
Go
// Copyright 2012 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 ipv4 import ( "errors" "fmt" "net" "runtime" "syscall" "unsafe" ) var ( errMissingAddress = errors.New("missing address") errMissingHeader ...
Go
// Copyright 2012 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 ipv4 import ( "syscall" ) func (c *genericOpt) sysfd() (int, error) { // TODO(mikio): Implement this return 0, syscall.EPLAN9 } func (c *dgramOpt...
Go
// Copyright 2012 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. // +build darwin freebsd linux netbsd openbsd windows package ipv4 import ( "net" "syscall" ) // MulticastTTL returns the time-to-live field value for out...
Go
// Copyright 2012 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 ipv4 import ( "errors" "net" ) var ( errNoSuchInterface = errors.New("no such interface") errNoSuchMulticastInterface = errors.New("no s...
Go
// Copyright 2012 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 ipv4 import ( "net" "syscall" "time" ) // A Conn represents a network endpoint that uses the IPv4 transport. // It is used to control basic IP-lev...
Go
// Copyright 2012 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 ipv4 import ( "net" "os" "syscall" "unsafe" ) // Linux provides a convenient path control option IP_PKTINFO that // contains IP_SENDSRCADDR, IP_R...
Go
// Copyright 2012 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 ipv4 import ( "net" "syscall" ) func (c *dgramOpt) MulticastTTL() (int, error) { // TODO(mikio): Implement this return 0, syscall.EPLAN9 } func ...
Go
// Copyright 2012 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 ipv4 import ( "syscall" ) func setControlMessage(fd int, opt *rawOpt, cf ControlFlags, on bool) error { // TODO(mikio): Implement this return sysc...
Go
// Copyright 2012 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. // +build darwin freebsd linux netbsd openbsd windows package ipv4 import ( "bytes" "net" "syscall" ) func setSyscallIPMreq(mreq *syscall.IPMreq, ifi *ne...
Go
// Copyright 2012 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 ipv4 import ( "net" "os" "syscall" ) func ipv4ReceiveTOS(fd int) (bool, error) { v, err := syscall.GetsockoptInt(fd, syscall.IPPROTO_IP, syscall....
Go
// Copyright 2012 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. // +build darwin freebsd linux netbsd openbsd package ipv4 import ( "os" "syscall" ) func ipv4TOS(fd int) (int, error) { v, err := syscall.GetsockoptInt(...
Go
// Copyright 2012 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 ipv4 import ( "fmt" "net" "sync" ) type rawOpt struct { mu sync.Mutex cflags ControlFlags } func (o *rawOpt) lock() { o...
Go
// Copyright 2012 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. // +build darwin freebsd netbsd openbsd package ipv4 import ( "net" "os" "syscall" ) func ipv4MulticastTTL(fd int) (int, error) { v, err := syscall.Gets...
Go
// Copyright 2012 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. // +build darwin freebsd linux netbsd openbsd package ipv4 import ( "net" "reflect" ) func (c *genericOpt) sysfd() (int, error) { switch p := c.c.(type) ...
Go
// Copyright 2012 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. // +build darwin freebsd netbsd openbsd package ipv4 import ( "net" "os" "syscall" "unsafe" ) func setControlMessage(fd int, opt *rawOpt, cf ControlFlag...
Go
// Copyright 2012 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 ipv4 import ( "net" "reflect" "syscall" ) func (c *genericOpt) sysfd() (syscall.Handle, error) { switch p := c.c.(type) { case *net.TCPConn, *ne...
Go
// Copyright 2012 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 ipv4 import ( "net" "syscall" ) // A payloadHandler represents the IPv4 datagram payload handler. type payloadHandler struct { c net.PacketConn r...
Go
// Copyright 2012 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 ipv4 import ( "net" "syscall" ) // A packetHandler represents the IPv4 datagram handler. type packetHandler struct { c *net.IPConn rawOpt } func...
Go
// Copyright 2012 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 ipv4 import ( "os" "syscall" ) func ipv4SendSourceAddress(fd int) (bool, error) { v, err := syscall.GetsockoptInt(fd, syscall.IPPROTO_IP, syscall....
Go
// Copyright 2012 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 ipv4 import ( "syscall" ) func setControlMessage(fd syscall.Handle, opt *rawOpt, cf ControlFlags, on bool) error { // TODO(mikio): Implement this ...
Go
// Copyright 2012 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 ipv4 implements IP-level socket options for the Internet // Protocol version 4. // // The package provides IP-level socket options that allow // man...
Go
// Copyright 2012 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. // +build darwin freebsd linux netbsd openbsd windows package ipv4 import ( "syscall" ) // TOS returns the type-of-service field value for outgoing packets...
Go
// Copyright 2012 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 ipv4 import ( "syscall" ) func (c *genericOpt) TOS() (int, error) { // TODO(mikio): Implement this return 0, syscall.EPLAN9 } func (c *genericOpt...
Go
// Copyright 2012 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 ipv4 import ( "net" "os" "syscall" "unsafe" ) // Please refer to the online manual; // http://msdn.microsoft.com/en-us/library/windows/desktop/ms...
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 proxy import ( "errors" "io" "net" "strconv" ) // SOCKS5 returns a Dialer that makes SOCKSv5 connections to the given address // with an optional ...
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 proxy provides support for a variety of protocols to proxy network // data. package proxy import ( "errors" "net" "net/url" "os" ) // A Dialer ...
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 proxy import ( "net" ) type direct struct{} // Direct is a direct proxy: one that makes network connections directly. var Direct = direct{} func (d...
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 proxy import ( "net" "strings" ) // A PerHost directs connections to a default Dailer unless the hostname // requested matches one of a number of ex...
Go
// Copyright 2012 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. // +build ignore package main // This program generates table.go and table_test.go. // Invoke as: // // go run gen.go -version "xxx" >table.go // go run...
Go
// Copyright 2012 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 publicsuffix provides a public suffix list based on data from // http://publicsuffix.org/. A public suffix is one under which Internet users // can d...
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 pcapgo provides some native PCAP support, not requiring // C libpcap to be installed. package pcapgo import ( "co...
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 linux package afpacket import ( "reflect" "time" "unsafe" ) // #include <linux/if_packet.h> import "C" // Our...
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 linux // Package afpacket provides Go bindings for MMap'd AF_PACKET socket reading. package afpacket // Couldn't h...
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 linux package afpacket import ( "fmt" "time" ) // #include <linux/if_packet.h> // #include <sys/socket.h> impor...
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. // // 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. package layers // Created by gen.go, don't edit manually // Generated at 2014-09-09 10:09:28.309114133 -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
// 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 2014 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 ( "bytes" "code.google.com/p/gopacket" "encoding/binary" "fmt" ) // align calculates the number of...
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" ) // 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" ) // EtherIP is the struct for storing RFC 3378 Eth...
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" ) // MPLS is the MPLS packet header. type...
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. // 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, 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" "fmt" ) // EthernetCTPFunction is the function cod...
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" ) // 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 ( "fmt" "strconv" "code.google.com/p/gopacket" ) // TCPPort is a port in a TCP layer. type TCPPort...
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. // +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. // 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 2014 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" "fmt" "net" ) type DNSClass uint16 con...
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. // 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. // 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" "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" "encoding/binary" ) // LLC is the layer used for 802.2 Logical Link C...
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 ( "encoding/binary" "errors" "code.google.com/p/gopacket" ) type PFDirection uint8 const ( PFDir...
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" ) type EAPCode uint8 type EAPType uint8 con...
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" "hash/crc32" ) // SCTP contains information...
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. // // 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. // // 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 ( "encoding/binary" "errors" "fmt" "net" "code.google.com/p/gopacket" ) type LinuxSLLPacketType ...
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" ) type RUDP struct { BaseLayer SYN, ACK, E...
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. // // 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. The layers package contains decode implementations 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. // 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" ) // BaseLayer is a convenience struct which implements the LayerData ...
Go
// Copyright 2014 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" ) type USBEventType uint8 const ( USBEventTypeSub...
Go