func DatalinkValueToDescription(dlt int) string { desc := C.pcap_datalink_val_to_description(C.int(dlt)) if nil != desc { return C.GoString(desc) } return "" }
func DatalinkDesc(dlt int) (ret string) { desc := C.pcap_datalink_val_to_description(C.int(dlt)) if desc != nil { ret = C.GoString(desc) } return }
func DatalinkValueToDescription(dlt int) error { desc := C.pcap_datalink_val_to_description(C.int(dlt)) if nil != desc { return errors.New(C.GoString(desc)) } return nil }
// Obtains a list of all possible data link types supported for an interface. func (p *Handle) ListDataLinks() (datalinks []Datalink, err error) { var dlt_buf *C.int n := int(C.pcap_list_datalinks(p.cptr, &dlt_buf)) if -1 == n { return nil, p.Error() } defer C.pcap_free_datalinks(dlt_buf) datalinks = make([]Datalink, n) dltArray := (*[100]C.int)(unsafe.Pointer(dlt_buf)) for i := 0; i < n; i++ { expr := C.pcap_datalink_val_to_name((*dltArray)[i]) datalinks[i].Name = C.GoString(expr) expr = C.pcap_datalink_val_to_description((*dltArray)[i]) datalinks[i].Description = C.GoString(expr) } return datalinks, nil }
func DatalinkValueToDescription(dlt int) string { if desc := C.pcap_datalink_val_to_description(C.int(dlt)); desc != nil { return C.GoString(desc) } return "" }