LjhAUMEM
2026-05-29 17:44:06 +08:00
committed by GitHub
parent 66a8100737
commit 2b42699623
5 changed files with 520 additions and 525 deletions
+10 -7
View File
@@ -6,6 +6,7 @@ import (
"encoding/hex"
"encoding/json"
"math"
"net/netip"
"net/url"
"os"
"regexp"
@@ -1901,18 +1902,20 @@ func (c *Xdns) Build() (proto.Message, error) {
}
type Xicmp struct {
ListenIp string `json:"listenIp"`
Id uint16 `json:"id"`
DGRAM bool `json:"dgram"`
IPs []string `json:"ips"`
}
func (c *Xicmp) Build() (proto.Message, error) {
config := &xicmp.Config{
Ip: c.ListenIp,
Id: int32(c.Id),
for _, ip := range c.IPs {
if _, err := netip.ParseAddr(ip); err != nil {
return nil, err
}
}
if config.Ip == "" {
config.Ip = "0.0.0.0"
config := &xicmp.Config{
DGRAM: c.DGRAM,
IPs: c.IPs,
}
return config, nil