func GetAllDevices() ([]*pcap.Interface, error) {
	ds, err := pcap.FindAllDevs()
	if err != nil {
		return nil, err
	}
	var is []*pcap.Interface
	for _, d := range ds {
		if len(d.Addresses) > 0 {
			is = append(is, &d)
		}
	}
	return is, nil
}
GetAllDevices get all network interface
package utils
import (
	"fmt"
	"net"
	"os"
	"strconv"
	"strings"
	"time"
	"github.com/google/gopacket/layers"
	"github.com/google/gopacket/pcap"
	"github.com/google/gopacket/pcapgo"
)
func FileIsExist(f string) bool {
	if _, err := os.Stat(f); err != nil {
		if os.IsNotExist(err) {
			return false
		}
		return false
	}
	return true
}
func GetIPs(v string) ([]string, error) {
	if v == "" {
		return nil, nil
	}
	ips := strings.Split(v, ",")
	for _, ip := range ips {
		if len(ip) != 0 {
			if net.ParseIP(ip) == nil {
				return nil, fmt.Errorf("IP %s is illegal", ip)
			}
		}
	}
	return ips, nil
}
func GetPorts(v string) ([]string, error) {
	if v == "" {
		return nil, nil
	}
	ports := strings.Split(v, ",")
	for _, port := range ports {
		if len(port) != 0 {
			p, err := strconv.Atoi(port)
			if err != nil || p < 0 || p > 65535 {
				return nil, fmt.Errorf("Port %s is illegal", port)
			}
		}
	}
	return ports, nil
}