@@ -12,21 +12,26 @@ pub enum TransportType {
1212 /// UDP is used by default. If the request packet would be too large, send
1313 /// a TCP packet instead; if a UDP _response_ packet is truncated, try
1414 /// again with TCP.
15- Automatic ,
15+ /// Takes an 'Option<u16>' for diffrent ports None uses the protocol default port
16+ Automatic ( Option < u16 > ) ,
1617
1718 /// Send packets over UDP only.
1819 /// If the request packet is too large or the response packet is
1920 /// truncated, fail with an error.
20- UDP ,
21+ /// Takes an 'Option<u16>' for diffrent ports None uses the protocol default port
22+ UDP ( Option < u16 > ) ,
2123
2224 /// Send packets over TCP only.
23- TCP ,
25+ /// Takes an 'Option<u16>' for diffrent ports None uses the protocol default port
26+ TCP ( Option < u16 > ) ,
2427
2528 /// Send encrypted DNS-over-TLS packets.
26- TLS ,
29+ /// Takes an 'Option<u16>' for diffrent ports None uses the protocol default port
30+ TLS ( Option < u16 > ) ,
2731
2832 /// Send encrypted DNS-over-HTTPS packets.
29- HTTPS ,
33+ /// Takes an 'Option<u16>' for diffrent ports None uses the protocol default port
34+ HTTPS ( Option < u16 > ) ,
3035}
3136
3237impl TransportType {
@@ -36,11 +41,11 @@ impl TransportType {
3641 /// stringified address for the others.
3742 pub fn make_transport ( self , param : String ) -> Box < dyn Transport > {
3843 match self {
39- Self :: Automatic => Box :: new ( AutoTransport :: new ( param) ) ,
40- Self :: UDP => Box :: new ( UdpTransport :: new ( param) ) ,
41- Self :: TCP => Box :: new ( TcpTransport :: new ( param) ) ,
42- Self :: TLS => Box :: new ( TlsTransport :: new ( param) ) ,
43- Self :: HTTPS => Box :: new ( HttpsTransport :: new ( param) ) ,
44+ Self :: Automatic ( p ) => Box :: new ( AutoTransport :: new ( param, p ) ) ,
45+ Self :: UDP ( p ) => Box :: new ( UdpTransport :: new ( param, p ) ) ,
46+ Self :: TCP ( p ) => Box :: new ( TcpTransport :: new ( param, p ) ) ,
47+ Self :: TLS ( p ) => Box :: new ( TlsTransport :: new ( param, p ) ) ,
48+ Self :: HTTPS ( p ) => Box :: new ( HttpsTransport :: new ( param, p ) ) ,
4449 }
4550 }
4651}
0 commit comments