Versions in this module Expand all Collapse all v1 v1.0.1 Apr 4, 2020 Changes in this version + const DLT_ARCNET + const DLT_AX25 + const DLT_CHAOS + const DLT_EN10MB + const DLT_EN3MB + const DLT_FDDI + const DLT_IEEE802 + const DLT_NULL + const DLT_PPP + const DLT_PRONET + const DLT_SLIP + const ERRBUF_SIZE + const FMESQUITA_TCPDUMP_MAGIC + const IP_ICMP + const IP_INIP + const IP_TCP + const IP_UDP + const KUZNETZOV_TCPDUMP_MAGIC + const LINKTYPE_ARCNET + const LINKTYPE_ARCNET_BSD + const LINKTYPE_ARCNET_LINUX + const LINKTYPE_ATM_RFC1483 + const LINKTYPE_AX25 + const LINKTYPE_CHAOS + const LINKTYPE_C_HDLC + const LINKTYPE_ETHERNET + const LINKTYPE_EXP_ETHERNET + const LINKTYPE_FDDI + const LINKTYPE_FRELAY + const LINKTYPE_IEEE802_11 + const LINKTYPE_IEEE802_11_RADIO + const LINKTYPE_IP_OVER_FC + const LINKTYPE_LINUX_IRDA + const LINKTYPE_LINUX_LAPD + const LINKTYPE_LINUX_SLL + const LINKTYPE_LOOP + const LINKTYPE_LTALK + const LINKTYPE_NULL + const LINKTYPE_PFLOG + const LINKTYPE_PPP + const LINKTYPE_PPP_ETHER + const LINKTYPE_PPP_HDLC + const LINKTYPE_PRISM_HEADER + const LINKTYPE_PRONET + const LINKTYPE_RAW + const LINKTYPE_SLIP + const LINKTYPE_SUNATM + const LINKTYPE_TOKEN_RING + const NAVTEL_TCPDUMP_MAGIC + const NSEC_TCPDUMP_MAGIC + const TCPDUMP_MAGIC + const TCP_ACK + const TCP_CWR + const TCP_ECE + const TCP_FIN + const TCP_NS + const TCP_PSH + const TCP_RST + const TCP_SYN + const TCP_URG + const TYPE_ARP + const TYPE_IP + const TYPE_IP6 + var GoVersion = "1.0.1" + func DatalinkValueToDescription(dlt int) string + func DatalinkValueToName(dlt int) string + func Version() string + type Arphdr struct + Addrtype uint16 + DestHwAddress []byte + DestProtAddress []byte + HwAddressSize uint8 + Operation uint16 + ProtAddressSize uint8 + Protocol uint16 + SourceHwAddress []byte + SourceProtAddress []byte + func (arp *Arphdr) String() (s string) + type FileHeader struct + LinkType uint32 + MagicNumber uint32 + SigFigs uint32 + SnapLen uint32 + TimeZone int32 + VersionMajor uint16 + VersionMinor uint16 + type IFAddress struct + IP net.IP + Netmask net.IPMask + type Icmphdr struct + Checksum uint16 + Code uint8 + Data []byte + Id uint16 + Seq uint16 + Type uint8 + func (icmp *Icmphdr) String(hdr addrHdr) string + func (icmp *Icmphdr) TypeString() (result string) + type Interface struct + Addresses []IFAddress + Description string + Name string + func FindAllDevs() (ifs []Interface, err error) + type Ip6hdr struct + DestIp []byte + FlowLabel uint32 + HopLimit uint8 + Length uint16 + NextHeader uint8 + SrcIp []byte + TrafficClass uint8 + Version uint8 + func (ip6 *Ip6hdr) DestAddr() string + func (ip6 *Ip6hdr) Len() int + func (ip6 *Ip6hdr) SrcAddr() string + type Iphdr struct + Checksum uint16 + DestIp []byte + Flags uint8 + FragOffset uint16 + Id uint16 + Ihl uint8 + Length uint16 + Protocol uint8 + SrcIp []byte + Tos uint8 + Ttl uint8 + Version uint8 + func (ip *Iphdr) DestAddr() string + func (ip *Iphdr) Len() int + func (ip *Iphdr) SrcAddr() string + type Packet struct + Caplen uint32 + Data []byte + DestMac uint64 + Headers []interface{} + Len uint32 + Payload []byte + SrcMac uint64 + Time time.Time + Type int + func (p *Packet) Decode() error + func (p *Packet) String() string + type PacketTime struct + Sec int32 + Usec int32 + type Pcap struct + func Create(device string) (handle *Pcap, err error) + func OpenLive(device string, snaplen int32, promisc bool, timeout_ms int32) (handle *Pcap, err error) + func OpenOffline(file string) (handle *Pcap, err error) + func (p *Pcap) Activate() error + func (p *Pcap) Close() + func (p *Pcap) Datalink() int + func (p *Pcap) DumpOpen(ofile *string) (dumper *PcapDumper, err error) + func (p *Pcap) Geterror() error + func (p *Pcap) Getstats() (stat *Stat, err error) + func (p *Pcap) Inject(data []byte) (err error) + func (p *Pcap) Next() (pkt *Packet) + func (p *Pcap) NextEx() (pkt *Packet, result int32) + func (p *Pcap) PcapDump(dumper *PcapDumper, pkthdr_ptr *C.struct_pcap_pkthdr, buf_ptr *C.u_char) + func (p *Pcap) PcapDumpClose(dumper *PcapDumper) + func (p *Pcap) PcapDumpFlush(dumper *PcapDumper) error + func (p *Pcap) PcapLoop(pktnum int, dumper *PcapDumper) (result int32, err error) + func (p *Pcap) SetBufferSize(sz int32) error + func (p *Pcap) SetDataLink(dlt int) error + func (p *Pcap) SetDirection(direction string) (err error) + func (p *Pcap) SetFilter(expr string) (err error) + func (p *Pcap) SetPromisc(promisc bool) error + func (p *Pcap) SetReadTimeout(toMs int32) error + func (p *Pcap) SetSnapLen(s int32) error + type PcapDumper struct + type Reader struct + Header FileHeader + func NewReader(reader io.Reader) (*Reader, error) + func (r *Reader) Next() *Packet + type Stat struct + PacketsDropped uint32 + PacketsIfDropped uint32 + PacketsReceived uint32 + type Tcphdr struct + Ack uint32 + Checksum uint16 + Data []byte + DataOffset uint8 + DestPort uint16 + Flags uint16 + Seq uint32 + SrcPort uint16 + Urgent uint16 + Window uint16 + func (tcp *Tcphdr) FlagsString() string + func (tcp *Tcphdr) String(hdr addrHdr) string + type Udphdr struct + Checksum uint16 + DestPort uint16 + Length uint16 + SrcPort uint16 + func (udp *Udphdr) String(hdr addrHdr) string + type Writer struct + func NewWriter(writer io.Writer, header *FileHeader) (*Writer, error) + func (w *Writer) Write(pkt *Packet) error