GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - sunwxg/goshark

BranchesTags
Open more actions menu

Latest commit

 

History

60 Commits
60 Commits

Folders and files

NameName
Last commit message
Last commit date
example1
example1
 
 
example2
example2
 
 
example3
example3
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
2.pcap
2.pcap
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
example_test.go
example_test.go
 
 
goshark.go
goshark.go
 
 
goshark_test.go
goshark_test.go
 
 

Repository files navigation

goshark

Build Status GoDoc

Package goshark use tshark to decode IP packet and create data struct to analyse packet.

Dependency

  • tshark

Examples

file := "2.pcap"
d := goshark.NewDecoder()
if err := d.DecodeStart(file); err != nil {
    log.Println("Decode start fail:", err)
    return
}
defer d.DecodeEnd()

f, err := d.NextPacket()
if err != nil {
    log.Println("Get packet fail:", err)
    return
}

key := "igmp.maddr"
value, ok := f.Iskey(key)
if ok {
    fmt.Printf("key: %s\nvalue: %s\n", key, value)
}

Output:

key: igmp.maddr
value: 224.0.0.251

About

No description, website, or topics provided.

Resources

Readme
MIT license
Activity

Stars

17 stars

Watchers

1 watching

Forks

4 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.