Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added C.pcap_set_rfmon in pcap.go #23

Open
wants to merge 71 commits into
base: master
Choose a base branch
from

Conversation

pressure679
Copy link

After line 504, func (p *InactiveHandle) SetPromisc(promisc bool) error I added a function from libpcap to set handle in "radio frequency monitor mode". - Here's the code:

// SetRFMon sets handle to be in radio frequency monitor.
// (capture packets indepenedently from network)
func (p *InactiveHandle) SetRFMon(monitor bool) error {
var mon C.int
if monitor {
mon = 1
}
if status := C.pcap_set_rfmon(p.cptr, mon); status < 0 {
return statusError(status)
}
return nil
}

This is my first pull request, might be wrong way to do it.

abh and others added 30 commits September 23, 2012 16:40
(though it doesn't seem to work)
(this makes it work on my mac; I've no idea what it really does)
Make tcpdump tool work
Fix caplen field in io.go writer.Write()
Fixing example convention typo
- Checks if IP Header length is valid
- Checks that TCP Data Offset is valid
- Checks if payload is long enough to decode upper layer
Easy DoS with malicious packets
Code submitted by: Anoop K
 - pcap_create
 - pcap_activate
 - pcap_set_buffer_size
 - pcap_set_promisc
 - pcap_timeout
 - pcap_set_snaplen
khiro and others added 30 commits February 25, 2014 16:24
Delted return in PcapDump, PcapDumpClose
Fixed return value name and error handling in PcapDumpFlush
Added pcap dump functions which save packets as pcap file
Changed FindAllDevs to return error object instead of string.
Fix FindAllDevs error handling in tcpdump sample
Tcphdr Data Member not written
Show what '-X' means.
Small change to usage printout
add protection for invalid header
- e.g. 'identifier "_Ctype_struct_pcap_stat" may conflict with
  identifiers generated by cgo' and 'Sprintf call needs 2 args but has 3
  args'
- also adds a 'break' in tests since pcap Next() seems to ignore read
  timeout on my system after all packets have been read (Linux)
  - the-tcpdump-group/libpcap#550
Fix compile errors on later go versions
Signed-off-by: Miek Gieben <[email protected]>
Signed-off-by: Miek Gieben <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.