Popularity
2.3
Growing
Activity
0.0
Stable
21
2
5

Programming language: Go
License: MIT License
Tags: Networking    

golibwireshark alternatives and similar packages

Based on the "Networking" category.
Alternatively, view golibwireshark alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of golibwireshark or a related project?

Add another 'Networking' Package

README

golibwireshark

GoDoc

Package golibwireshark use libwireshark library to decode pcap file and analyse dissection data.

This package can only be used in OS linux with CPU x86_64. If you want to use it on other CPU structure, you need compile library in libs folder from source code.

Dependencies

  • libwireshark library (version 1.12.8)

  • libglib2.0

Install

  • ubuntu ``` apt-get install libglib2.0-dev go get github.com/sunwxg/golibwireshark

cd $GOPATH/src/github.com/sunwxg/golibwireshark cat libs/libwireshark.{00,01,02,03} > libs/libwireshark.so chmod 775 libs/libwireshark.so

go build go test

### Examples
```go
file := "1.pcap"
outfile := "o.pcap"
key := "ip.addr"

err := golibwireshark.Init(file, outfile)
if err != nil {
    fmt.Printf("open file failed\n")
    return
}
defer golibwireshark.Clean()

var p golibwireshark.Packet

for {
    p.GetPacket()
    if p.Edt == nil {
        break
    }

    if _, ok := p.IsKey(key); ok {
        p.WriteToFile()
    }

    p.FreePacket()
}