wiretap

package module
v0.0.0-...-d5e41a0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2014 License: ISC Imports: 3 Imported by: 0

README

wiretap

cgo bindings for wireshark's wiretap library

  • status: incomplete -- contributions welcome!
  • license: isc

Installation

Archlinux:

  $ pacman -S wireshark-cli
  $ go get github.com/tmc/wiretap

Debian/Ubuntu:

  $ apt-get install libwiretap-dev
  $ go get github.com/tmc/wiretap

MacOS:

  $ brew install wireshark --with-headers
  $ go get github.com/tmc/wiretap

Documentation

Overview

Package wiretap is a go binding to libwiretap.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotRegularFile            = Error{Code: C.WTAP_ERR_NOT_REGULAR_FILE}
	ErrRandomOpenPipe            = Error{Code: C.WTAP_ERR_RANDOM_OPEN_PIPE}
	ErrFileUnknownFormat         = Error{Code: C.WTAP_ERR_FILE_UNKNOWN_FORMAT}
	ErrUnsupported               = Error{Code: C.WTAP_ERR_UNSUPPORTED}
	ErrCantWriteToPipe           = Error{Code: C.WTAP_ERR_CANT_WRITE_TO_PIPE}
	ErrCantOpen                  = Error{Code: C.WTAP_ERR_CANT_OPEN}
	ErrUnsupportedFileType       = Error{Code: C.WTAP_ERR_UNSUPPORTED_FILE_TYPE}
	ErrUnsupportedEncap          = Error{Code: C.WTAP_ERR_UNSUPPORTED_ENCAP}
	ErrEncapPerPacketUnsupported = Error{Code: C.WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED}
	ErrCantClose                 = Error{Code: C.WTAP_ERR_CANT_CLOSE}
	ErrCantRead                  = Error{Code: C.WTAP_ERR_CANT_READ}
	ErrShortRead                 = Error{Code: C.WTAP_ERR_SHORT_READ}
	ErrBadFile                   = Error{Code: C.WTAP_ERR_BAD_FILE}
	ErrShortWrite                = Error{Code: C.WTAP_ERR_SHORT_WRITE}
	ErrUncTruncated              = Error{Code: C.WTAP_ERR_UNC_TRUNCATED}
	ErrUncOverflow               = Error{Code: C.WTAP_ERR_UNC_OVERFLOW}
	ErrUncBadOffset              = Error{Code: C.WTAP_ERR_UNC_BAD_OFFSET}
	ErrRandomOpenStdin           = Error{Code: C.WTAP_ERR_RANDOM_OPEN_STDIN}
	ErrCompressionNotSupported   = Error{Code: C.WTAP_ERR_COMPRESSION_NOT_SUPPORTED}
	ErrCantSeek                  = Error{Code: C.WTAP_ERR_CANT_SEEK}
	ErrCantSeekCompressed        = Error{Code: C.WTAP_ERR_CANT_SEEK_COMPRESSED}
	ErrDecompress                = Error{Code: C.WTAP_ERR_DECOMPRESS}
	ErrInternal                  = Error{Code: C.WTAP_ERR_INTERNAL}
	ErrUnknown                   = errors.New("unknown errror")
)

Functions

This section is empty.

Types

type EncapsulationType

type EncapsulationType int

func NewEncapsulationTypeFromString

func NewEncapsulationTypeFromString(encap string) (EncapsulationType, error)

func (EncapsulationType) ShortString

func (et EncapsulationType) ShortString() string

func (EncapsulationType) String

func (et EncapsulationType) String() string

type Error

type Error struct {
	Code int
}

func (Error) Error

func (e Error) Error() string

func (Error) Message

func (e Error) Message() string

type Handle

type Handle struct {
	// contains filtered or unexported fields
}

func OpenOffline

func OpenOffline(fileName string) (*Handle, error)

func (Handle) Close

func (h Handle) Close()

func (Handle) FDClose

func (h Handle) FDClose()

func (Handle) FileSize

func (h Handle) FileSize() int

func (Handle) FileType

func (h Handle) FileType() int

func (Handle) IsCompressed

func (h Handle) IsCompressed() bool

func (Handle) PacketHeader

func (h Handle) PacketHeader() (*PacketHeader, error)

func (Handle) SequentialClose

func (h Handle) SequentialClose()

func (Handle) SnapLen

func (h Handle) SnapLen() int

type PacketHeader

type PacketHeader struct {
	// contains filtered or unexported fields
}

func (*PacketHeader) Encapsulation

func (p *PacketHeader) Encapsulation() EncapsulationType

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL