func ListContains(lst []string, needle string) bool {
	for _, entry := range lst {
		if entry == needle {
			return true
		}
	}
	return false
}
ListContains checks if a needle exists in the given list.
package common
import (
	"fmt"
	"net"
	"strings"
)
func BroadcastAddr(n *net.IPNet) net.IP {
	var broadcast net.IP
	if len(n.IP) == 4 {
		broadcast = net.ParseIP("0.0.0.0").To4()
	} else {
		broadcast = net.ParseIP("::")
	}
	for i := 0; i < len(n.IP); i++ {
		broadcast[i] = n.IP[i] | ^n.Mask[i]
	}
	return broadcast
}
func IncreaseIP(ip net.IP) {
	for j := len(ip) - 1; j >= 0; j-- {
		ip[j]++
		if ip[j] > 0 {
			break
		}
	}
}
func IsIPv6(address string) bool {
	ip := net.ParseIP(address)
	if ip == nil {
		return false
	}
	return ip.To4() == nil
}
func ParseStringList(lst string) []string {
	tokens := strings.Split(lst, ",")
	validatedTokens := make([]string, 0, len(tokens))
	for i := range tokens {
		tokens[i] = strings.TrimSpace(tokens[i])
		if tokens[i] != "" {
			validatedTokens = append(validatedTokens, tokens[i])
		}
	}
	return validatedTokens
}
func ListToString(lst []string) string {
	return strings.Join(lst, ", ")
}