sing-box/include/dhcp_stub.go

21 lines
672 B
Go
Raw Normal View History

2023-02-08 08:28:52 +00:00
//go:build !with_dhcp
package include
import (
2024-12-02 15:17:01 +00:00
"context"
"github.com/sagernet/sing-box/adapter"
C "github.com/sagernet/sing-box/constant"
"github.com/sagernet/sing-box/dns"
"github.com/sagernet/sing-box/log"
"github.com/sagernet/sing-box/option"
2023-02-08 08:28:52 +00:00
E "github.com/sagernet/sing/common/exceptions"
)
2024-12-02 15:17:01 +00:00
func registerDHCPTransport(registry *dns.TransportRegistry) {
dns.RegisterTransport[option.DHCPDNSServerOptions](registry, C.DNSTypeDHCP, func(ctx context.Context, logger log.ContextLogger, tag string, options option.DHCPDNSServerOptions) (adapter.DNSTransport, error) {
2023-02-08 08:28:52 +00:00
return nil, E.New(`DHCP is not included in this build, rebuild with -tags with_dhcp`)
})
}