code stringlengths 10 1.34M | language stringclasses 1
value |
|---|---|
// 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 ast
import "code.google.com/p/rog-go/exp/go/token"
// ----------------------------------------------------------------------------
// Export filtering... | 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 ast
import "fmt"
// A Visitor's Visit method is invoked for each node encountered by Walk.
// If the result visitor w is not nil, Walk visits each of ... | 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.
// This file implements scopes and the objects they contain.
package ast
import (
"bytes"
"code.google.com/p/rog-go/exp/go/token"
"fmt"
)
// A Scope maint... | 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 printer implements printing of AST nodes.
package printer
import (
"bytes"
"code.google.com/p/rog-go/exp/go/ast"
"code.google.com/p/rog-go/exp/go... | 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.
// This file implements printing of AST nodes; specifically
// expressions, statements, declarations, and files. It uses
// the print functionality implemented ... | Go |
// The deepcopy package implements deep copying of arbitrary
// data structures, making sure that self references and shared pointers
// are preserved.
package deepcopy
import (
"fmt"
"reflect"
"sync"
"unsafe"
)
// basic copy algorithm:
// 1) recursively scan object, building up a list of all allocated
// memory ... | Go |
// The event package demonstrates use of the callback package
// to call Go functions from a non-Go-created thread.
// The C "window" API is intended to represent a conventional
// C API which invokes callbacks from a thread it has created itself.
// The event package layers a Go callback on top of that.
package event
... | Go |
// Looper is an example package demonstrating use of the callback
// package. When a new Looper type is made, a new pthread is
// created which continually loops calling the callback function
// until it returns false.
package looper
//#include <pthread.h>
//#include <unistd.h>
//#define nil ((void*)0)
//typedef struc... | Go |
// Copied with small adaptations from the reflect package in the
// Go source tree.
// 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.
// The deepdiff package implements a version of reflect.DeepEquals that
// ... | Go |
package reverse
import (
"bufio"
"errors"
"io"
)
const maxBufSize = 64 * 1024
// Scanner presents the same interface as bufio.Scanner
// except it scans tokens in reverse from the end of
// a file instead of forwards from the beginning.
//
// It may not work correctly if the split function can return an
// error ... | Go |
package canvas
import (
"code.google.com/p/freetype-go/freetype/raster"
"fmt"
"image"
"image/color"
"image/draw"
)
// A RasterItem is a low level canvas object that
// can be used to build higher level primitives.
// It implements Item, and will calculate
// (and remember) its bounding box on request.
//
// Othe... | Go |
package canvas
import (
"image"
"image/draw"
"sync"
)
// A Background is the base layer on which other
// objects can be layered. It implements the Backing
// interface and displays a single object only.
type Background struct {
lock sync.Mutex
r image.Rectangle // overall rectangle (always origin 0, ... | Go |
package canvas
import (
"code.google.com/p/freetype-go/freetype/raster"
"code.google.com/p/rog-go/values"
"code.google.com/p/x-go-binding/ui"
"image"
"image/color"
"image/draw"
"math"
)
// Box creates a rectangular image of the given size, filled with the given colour,
// with a border-size border of colour bo... | Go |
// The canvas package provides some a facility
// for managing independently updating objects
// inside a graphics window.
//
// The principal type is Canvas, which displays a
// z-ordered set of objects. New objects may be added,
// deleted and change their appearance: the Canvas
// manages any necessary re-drawing.
... | Go |
package canvas
import (
"code.google.com/p/freetype-go/freetype"
"code.google.com/p/freetype-go/freetype/raster"
"code.google.com/p/freetype-go/freetype/truetype"
"code.google.com/p/rog-go/values"
"image"
"image/draw"
)
const (
dpi = 72
gamma = 1
)
type TextItem struct {
*freetype.Context
Text string
Pt... | Go |
package canvas
import (
"code.google.com/p/x-go-binding/ui"
"image"
"image/color"
"image/draw"
)
// A MoveableItem is an item that may be
// moved by calling SetCentre, where the
// centre is the central point of the item's
// bounding box.
//
type MoveableItem interface {
Item
SetCentre(p image.Point)
}
type ... | Go |
package canvas
import (
"code.google.com/p/freetype-go/freetype/raster"
"image"
)
// A ellipse object represents an ellipse centered in cr
// with radiuses ra and rb
type Ellipse struct {
Item
raster RasterItem
backing Backing
cr raster.Point
ra, rb raster.Fix32
width raster.Fix32
pts pointVec
}... | 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 g9pc
import "code.google.com/p/rog-go/go9p/g9p"
// Removes the file associated with the Fid. Returns nil if the
// operation is successful.
func (cln... | 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.
// The srv package provides definitions and functions used to implement
// a 9P2000 file client.
package g9pc
import (
"code.google.com/p/rog-go/go9p/g9p"
"... | 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 g9pc
import (
"code.google.com/p/rog-go/go9p/g9p"
"strings"
)
// Opens the file associated with the fid. Returns nil if
// the operation is success... | 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 g9pc
import "code.google.com/p/rog-go/go9p/g9p"
// Returns the metadata for the file associated with the Fid, or an Error.
func (clnt *Client) Stat(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 g9pc
import "code.google.com/p/rog-go/go9p/g9p"
// Write up to len(data) bytes starting from offset. Returns the
// number of bytes written, or an Er... | 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 g9pc
var m2id = [...]uint8{
0, 1, 0, 2, 0, 1, 0, 3,
0, 1, 0, 2, 0, 1, 0, 4,
0, 1, 0, 2, 0, 1, 0, 3,
0, 1, 0, 2, 0, 1, 0, 5,
0, 1, 0, 2, 0, 1, 0, ... | 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 g9pc
import "code.google.com/p/rog-go/go9p/g9p"
// Clunks a fid. Returns nil if successful.
func (clnt *Client) Clunk(fid *Fid) (err error) {
if fid... | 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 g9pc
import "code.google.com/p/rog-go/go9p/g9p"
// Reads count bytes starting from offset from the file associated with the fid.
// Returns a slice w... | 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 g9pc
import (
"code.google.com/p/rog-go/go9p/g9p"
"net"
)
// Creates an authentication fid for the specified user. Returns the fid, if
// successfu... | 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 g9pc
import (
"code.google.com/p/rog-go/go9p/g9p"
"strings"
"syscall"
)
// Starting from the file associated with fid, walks all wnames in
// sequ... | Go |
package main
import (
"code.google.com/p/rog-go/go9p/g9p"
"code.google.com/p/rog-go/go9p/g9pc"
"flag"
"fmt"
"log"
"os"
)
var debuglevel = flag.Int("d", 0, "debuglevel")
var addr = flag.String("addr", "127.0.0.1:5640", "network address")
func main() {
var user g9p.User
var err error
var c *g9pc.Client
var f... | Go |
package main
import (
"code.google.com/p/rog-go/go9p/g9p"
"code.google.com/p/rog-go/go9p/g9pc"
"flag"
"fmt"
"io"
"log"
"os"
)
var debuglevel = flag.Int("d", 0, "debuglevel")
var addr = flag.String("addr", "127.0.0.1:5640", "network address")
func main() {
var m int
var user g9p.User
var file *g9pc.File
f... | Go |
package main
// An interactive client for 9P servers.
import (
"bufio"
"code.google.com/p/rog-go/go9p/g9p"
"code.google.com/p/rog-go/go9p/g9pc"
"code.google.com/p/rog-go/go9p/g9plog"
"flag"
"fmt"
"io"
"log"
"net/http"
"os"
"path"
"strings"
)
var addr = flag.String("addr", "127.0.0.1:5640", "network addre... | Go |
package main
import (
"code.google.com/p/rog-go/go9p/g9p"
"code.google.com/p/rog-go/go9p/g9pc"
"flag"
"fmt"
"log"
"os"
)
var debuglevel = flag.Int("d", 0, "debuglevel")
var addr = flag.String("addr", "127.0.0.1:5640", "network address")
func main() {
var n int
var user g9p.User
var file *g9pc.File
flag.Pa... | 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 g9p
import (
"fmt"
"syscall"
)
// Creates a Fcall value from the on-the-wire representation. If
// dotu is true, reads 9P2000.u messages. Returns t... | 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 g9p
// Logger is a common interface that allows clients and servers
// to see all 9p messages in transit, for debugging, for
// instance.
type Logger ... | 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 g9p
import "fmt"
func permToString(perm uint32) string {
ret := ""
if perm&DMDIR != 0 {
ret += "d"
}
if perm&DMAPPEND != 0 {
ret += "a"
}
... | 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.
// The p9 package g9provides the definitions and functions used to implement
// the 9P2000 protocol.
package g9p
import "syscall"
// 9P2000 message types
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 g9p
// Create a Tversion message in the specified Fcall.
func PackTversion(fc *Fcall, msize uint32, version string) error {
size := 4 + 2 + len(versi... | 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 g9p
import "sync"
var once sync.Once
type osUser struct {
uid int
}
type osUsers struct {
users map[int]*osUser
groups map[int]*osGroup
sync.M... | Go |
package g9plog
import (
"code.google.com/p/rog-go/go9p/g9p"
"container/list"
"fmt"
"net/http"
"sync"
)
type httpStats struct {
mu sync.Mutex
conns list.List
maxId int
}
const (
Packets = 1 << iota
)
type Logger struct {
mu sync.Mutex
history list.List
maxHist int
isClient bool
flags int
... | Go |
package typeapply
import (
"reflect"
"sync"
)
var (
typeMutex sync.Mutex
// tmap stores a map for every target type (the
// argument type of the function passed to Do).
// For each target type, we use this to cache
// information about how to traverse values
// of all types that have been passed to Do
// (a... | Go |
package plan9
import (
"fmt"
"io"
"strconv"
)
type ProtocolError string
func (e ProtocolError) Error() string {
return string(e)
}
const (
STATMAX = 65535
)
type Dir struct {
Type uint16
Dev uint32
Qid Qid
Mode Perm
Atime uint32
Mtime uint32
Length uint64
Name string
Uid string
Gid ... | Go |
package client
import (
"fmt"
"io"
"log"
"os"
"sync"
plan9 "code.google.com/p/rog-go/new9p"
)
type Error string
func (e Error) Error() string { return string(e) }
type Conn struct {
rwc io.ReadWriteCloser
err error
tagmap map[uint16]chan *plan9.Fcall
freetag map[uint16]bool
freefid map[uint32]b... | Go |
package client
import (
"code.google.com/p/rog-go/new9p/seq"
"container/list"
"io"
"log"
"sync"
)
type readResult struct {
buf []byte
err error
}
type streamReader struct {
c chan readResult
reply chan bool
buf []byte
done bool
}
func (cr *streamReader) Read(buf []byte) (int, error) {
if cr.done ... | Go |
package client
import (
"net"
"os"
)
func Dial(network, addr string) (*Conn, error) {
c, err := net.Dial(network, addr)
if err != nil {
return nil, err
}
return NewConn(c)
}
func DialService(service string) (*Conn, error) {
ns := os.Getenv("NAMESPACE")
if ns == "" {
return nil, Error("unknown name space"... | Go |
package client
import (
"errors"
"fmt"
"io"
"io/ioutil"
"os"
"runtime"
"strings"
"sync"
//"log"
"bytes"
plan9 "code.google.com/p/rog-go/new9p"
)
func getuser() string { return os.Getenv("USER") }
type Fid struct {
c *Conn
qid plan9.Qid
fid uint32
mode uint8
flags uint8 // fOpen | fAlloc... | Go |
package client
import (
plan9 "code.google.com/p/rog-go/new9p"
"code.google.com/p/rog-go/new9p/seq"
"errors"
"fmt"
"io"
"strings"
)
type Ns struct {
Root *NsFile
Dot *NsFile
}
type NsFile struct {
offset int64
f seq.File
}
type nsResultType bool
type OpResults []seq.Result
func (OpResults) Rtype() ... | Go |
package client
import (
"errors"
plan9 "code.google.com/p/rog-go/new9p"
)
type Fsys struct {
Root *Fid
}
func (c *Conn) Auth(uname, aname string) (*Fid, error) {
afid, err := c.getfid()
if err != nil {
return nil, err
}
afid.flags |= fPending
tx := &plan9.Fcall{Type: plan9.Tauth, Afid: afid.fid, Uname: un... | Go |
package client
import (
"errors"
"fmt"
//"log"
plan9 "code.google.com/p/rog-go/new9p"
"code.google.com/p/rog-go/new9p/seq"
"container/list"
)
func (fid *Fid) File() seq.File {
return (*file9p)(fid)
}
type file9p Fid
type filesys9p Conn
type seq9p struct {
c *Conn
tag uint16
err error
// access to the r... | Go |
package plan9
const (
VERSION9P = "9P2000"
MAXWELEM = 16
OREAD = 0
OWRITE = 1
ORDWR = 2
OEXEC = 3
OTRUNC = 16
OCEXEC = 32
ORCLOSE = 64
ODIRECT = 128
ONONBLOCK = 256
OEXCL = 0x1000
OLOCK = 0x2000
OAPPEND = 0x4000
AEXIST = 0
AEXEC = 1
AWRITE = 2
AREAD = 4
QTDIR... | Go |
package main
import (
"fmt"
"io"
"os"
"code.google.com/p/goplan9/plan9"
"code.google.com/p/goplan9/plan9/client"
)
func main() {
fsys, err := client.MountService("acme")
if err != nil {
panic(err)
}
fid, err := fsys.Open("index", plan9.OREAD)
if err != nil {
panic(err)
}
fid.Write([]byte("hello, wo... | Go |
package main
// An interactive client for 9P servers.
import (
"bufio"
g9p "code.google.com/p/rog-go/new9p"
g9pc "code.google.com/p/rog-go/new9p/client"
"code.google.com/p/rog-go/new9p/seq"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"path"
"strconv"
"strings"
)
var addr = flag.String("addr", "127.0.0.1:56... | Go |
package main
import (
g9p "code.google.com/p/rog-go/new9p"
g9pc "code.google.com/p/rog-go/new9p/client"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"os"
)
var old = flag.Bool("old", false, "use old 9p operations")
var fs *g9pc.Fsys
var ns *g9pc.Ns
var sum = make(chan int64)
func main() {
log.SetOutput(nullWriter{})... | Go |
package plan9
import (
"fmt"
"io"
)
const (
IOHDRSIZE = 24
)
type Fcall struct {
Type uint8
Tag uint16
Fid uint32 // All T messages except Tversion, Tflush, Tbegin and Tend
Msize uint32 // Tversion, Rversion
Version string // Tversion, Rversion
Oldtag uint16 // Tflush
Ename string ... | Go |
package plan9
func gbit8(b []byte) (uint8, []byte) {
return uint8(b[0]), b[1:]
}
func gbool(b []byte) (bool, []byte) {
return b[0] != 0, b[1:]
}
func gbit16(b []byte) (uint16, []byte) {
return uint16(b[0]) | uint16(b[1])<<8, b[2:]
}
func gbit32(b []byte) (uint32, []byte) {
return uint32(b[0]) | uint32(b[1])<<8 ... | Go |
package seq
import (
"bytes"
"fmt"
"log"
"runtime"
"sync"
)
type mainSeq struct {
mu sync.Mutex
newRequest chan<- seqRequest
newSeq <-chan Sequence
newFs chan<- FileSys
currSeq Sequence
shutdown bool
done chan error
reentrantCheck chan bool
}
type Sequencer struct {
error ... | Go |
package seq
import (
plan9 "code.google.com/p/rog-go/new9p"
"errors"
)
type Req interface {
Ttype() interface{}
}
type Result interface {
Rtype() interface{}
}
type CompositeReq interface {
Req
Do(seq *Sequencer, f File) error // executes action. must result in one result.
}
type BasicReq interface {
Req
b... | 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 2013 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
// headerDictionary is the dictionary sent to the zlib compressor/decompressor.
var headerDictionary = []byte{
0x00, 0x00, 0x00, 0x07, 0x6f, 0x70... | 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 the SPDY protocol (currently SPDY/3), described in
// http://www.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3.
package spdy
... | 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
// as specified in RFC 6455.
package websocket
import (
"bufio"
"crypto/tls"
... | 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, config *Co... | 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/http"
"net/url"
)
// DialError is an error that occurs while dialling a websocket server... | Go |
// Copyright 2013 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 ipv6
import "syscall"
const sysSizeofMTUInfo = 0x20
type sysMTUInfo struct {
Addr syscall.RawSockadd... | Go |
// Copyright 2013 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 ipv6
import (
"net"
"syscall"
)
// RFC 3493 options
const (
// See /usr/include/linux/in6.h.
sysSockoptUnicastHopLimit = 0x10
sysSockoptMulti... | Go |
// Copyright 2013 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 dragonfly plan9 solaris
package ipv6
type sysICMPFilter struct {
// TODO(mikio): Implement this
}
func (f *sysICMPFilter) set(typ ICMPType, block... | Go |
// Copyright 2013 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 dragonfly plan9 solaris
package ipv6
func (c *genericOpt) sysfd() (int, error) {
// TODO(mikio): Implement this
return 0, errOpNoSupport
}
func ... | Go |
// Copyright 2013 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 dragonfly plan9 solaris
package ipv6
func setControlMessage(fd int, opt *rawOpt, cf ControlFlags, on bool) error {
// TODO(mikio): Implement this
... | Go |
// Copyright 2013 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
package ipv6
import (
"os"
"unsafe"
)
func ipv6ReceiveTrafficClass(fd int) (bool, error) {
return false, errOpNoSupport
}
func setIPv6R... | Go |
// Copyright 2013 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 ipv6
import (
"net"
"syscall"
)
// MulticastHopLimit returns the hop limit field value for o... | Go |
// Copyright 2013 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 ipv6
import (
"net"
"syscall"
)
// RFC 3493 options
const (
// See ws2tcpip.h.
sysSockoptUnicastHopLimit = 0x4
sysSockoptMulticastHopLimit =... | Go |
// Copyright 2013 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 freebsd netbsd openbsd
package ipv6
import (
"net"
"syscall"
)
// RFC 3493 options
const (
// See /usr/include/netinet6/in6.h.
sysSockoptUnica... | Go |
// Copyright 2013 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 ipv6
import (
"net"
"syscall"
)
// RFC 2292 options
const (
// See /usr/include/netinet6/in6.h.
sysSockopt2292HopLimit = 0x14
sysSockopt2292Pa... | Go |
// Copyright 2013 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,amd64 linux,arm netbsd openbsd
package ipv6
import (
"syscall"
"unsafe"
)
func getsockopt(fd int, level, name int, v uintpt... | Go |
// Copyright 2013 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 dragonfly plan9 solaris
package ipv6
import "net"
// MulticastHopLimit returns the hop limit field value for outgoing
// multicast packets.
func (... | Go |
// Copyright 2013 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 ipv6
import (
"errors"
"net"
)
var errOpNoSupport = errors.New("operation not supported")
func boolint(b bool) int {
if b {
return 1
}
return... | Go |
// Copyright 2013 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 ipv6
import (
"os"
"unsafe"
)
func setIPv6Checksum(fd int, on bool, offset int) error {
if !on {
offset... | Go |
// Copyright 2013 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 ipv6
import (
"net"
"syscall"
"time"
)
// A Conn represents a network endpoint that uses IPv6 transport.
// It allows to set basic IP-level socket... | Go |
// Copyright 2013 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 go1.2
package ipv6
import "syscall"
func socketcallnosplit4(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno)
func init() {
socketc... | Go |
// Copyright 2013 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 go1.1,!go1.2
package ipv6
import "syscall"
func socketcallnosplit7(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno)
func init() {
... | Go |
// Copyright 2013 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 dragonfly plan9 solaris
package ipv6
func ipv6PathMTU(fd int) (int, error) {
// TODO(mikio): Implement this
return 0, errOpNoSupport
}
| Go |
// Copyright 2013 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
// This program generates internet protocol constatns and tables by
// reading IANA protocol registries.
//
// Usage:
// go run gen.go > iana... | Go |
// Copyright 2013 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 ipv6
import (
"net"
"os"
"syscall"
"unsafe"
)
func ipv6TrafficClass(fd syscall.Handle) (int, error) {
// TODO(mikio): Implement this
return 0, ... | Go |
// Copyright 2013 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 !plan9,!windows
package ipv6
import (
"net"
"syscall"
)
// ReadFrom reads a payload of the received IPv6 datagram, from the
// endpoint c, copyi... | Go |
// Copyright 2013 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 ipv6
import (
"errors"
"fmt"
"net"
"sync"
)
var (
errMissingAddress = errors.New("missing address")
errInvalidConnType = errors.New("invalid c... | Go |
// Copyright 2013 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 ipv6
import (
"os"
"unsafe"
)
func setIPv6Checksum(fd int, on bool, offset int) error {
if !on {
offset = -1
}
v := int32(offset)
return os.N... | Go |
// Copyright 2013 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 freebsd linux netbsd openbsd
package ipv6
import (
"net"
"os"
"syscall"
"unsafe"
)
const pktinfo = FlagDst | FlagInterface
func setControlMes... | Go |
// Copyright 2013 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 ipv6
import "syscall"
func setControlMessage(fd syscall.Handle, opt *rawOpt, cf ControlFlags, on bool) error {
// TODO(mikio): Implement this
retur... | Go |
// Copyright 2013 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 ipv6
import (
"net"
"reflect"
)
func (c *genericOpt) sysfd() (int, error) {
switch p := c.Conn.(typ... | Go |
// Copyright 2013 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 ipv6
type sysICMPFilter struct {
Filt [8]uint32
}
func (f *sysICMPFilter) set(typ ICMPType, block bool) {
... | 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.
// This code is a duplicate of syscall/syscall_linux_386.go with small
// modifications.
package ipv6
import (
"syscall"
"unsafe"
)
// On x86 Linux, all th... | Go |
// Copyright 2013 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 dragonfly plan9 solaris
package ipv6
// TrafficClass returns the traffic class field value for outgoing
// packets.
func (c *genericOpt) TrafficCla... | Go |
// Copyright 2013 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
package ipv6
import (
"net"
"os"
"syscall"
"unsafe"
)
const pktinfo = FlagDst | FlagInterface
func setControlMessage(fd int, opt *rawO... | Go |
// Copyright 2013 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 ipv6
import "syscall"
func ipv6ReceiveTrafficClass(fd syscall.Handle) (bool, error) {
// TODO(mikio): Implement this
return false, syscall.EWINDOWS... | Go |
// Copyright 2013 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 ipv6
import (
"net"
"reflect"
"syscall"
)
func (c *genericOpt) sysfd() (syscall.Handle, error) {
switch p := c.Conn.(type) {
case *net.TCPConn, ... | Go |
// Copyright 2013 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 ipv6
import "net"
// A payloadHandler represents the IPv6 datagram payload handler.
type payloadHandler struct {
net.PacketConn
rawOpt
}
func (c *... | Go |
// Copyright 2013 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 ipv6
type sysSockoptLen uint32
const (
sysSizeofPacketInfo = 0x14
sysSizeofMulticastReq = 0x14
sysSizeofICMPFilter = 0x20
)
type sysPacketInf... | Go |
// Copyright 2013 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 plan9 windows
package ipv6
import (
"net"
"syscall"
)
// ReadFrom reads a payload of the received IPv6 datagram, from the
// endpoint c, copying... | Go |
// Copyright 2013 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 ipv6
type sysICMPFilter struct {
Data [8]uint32
}
func (f *sysICMPFilter) set(typ ICMPType, block bool) {
if block {
f.Data[typ>>5] |= 1 << (uint... | Go |
// Copyright 2013 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 ipv6
type sysICMPFilter struct {
// TODO(mikio): Implement this
}
func (f *sysICMPFilter) set(typ ICMPType, block bool) {
// TODO(mikio): Implement... | Go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.