Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

documentation and slightly shorter

  • Loading branch information...
commit 877c3224ef3de50ba94710dce01e7cd8dc166fc8 1 parent f657fe2
@miekg miekg authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 pcap.go
View
4 pcap.go
@@ -42,6 +42,7 @@ type IFAddress struct {
// TODO: add broadcast + PtP dst ?
}
+// Openlive opens a device and returns a *Pcap handler
func Openlive(device string, snaplen int32, promisc bool, timeout_ms int32) (handle *Pcap, err string) {
var buf *C.char
buf = (*C.char)(C.calloc(ERRBUF_SIZE, 1))
@@ -49,8 +50,6 @@ func Openlive(device string, snaplen int32, promisc bool, timeout_ms int32) (han
var pro int32
if promisc {
pro = 1
- } else {
- pro = 0
}
dev := C.CString(device)
@@ -67,6 +66,7 @@ func Openlive(device string, snaplen int32, promisc bool, timeout_ms int32) (han
return
}
+// Openoffline
func Openoffline(file string) (handle *Pcap, err string) {
var buf *C.char
buf = (*C.char)(C.calloc(ERRBUF_SIZE, 1))
Please sign in to comment.
Something went wrong with that request. Please try again.