Configure EDNS behavior. *edns*, an ``int``, is the EDNS level to use. Specifying ``None``, ``False``, or ``-1`` means "do not use EDNS", and in this case the other parameters are ignored. Specifying ``True`` is equivalent to specifying 0, i.e. "use EDNS0".
(
self,
edns: int | bool | None = 0,
ednsflags: int = 0,
payload: int = dns.message.DEFAULT_EDNS_PAYLOAD,
options: List[dns.edns.Option] | None = None,
)
| 1142 | self.keyalgorithm = algorithm |
| 1143 | |
| 1144 | def use_edns( |
| 1145 | self, |
| 1146 | edns: int | bool | None = 0, |
| 1147 | ednsflags: int = 0, |
| 1148 | payload: int = dns.message.DEFAULT_EDNS_PAYLOAD, |
| 1149 | options: List[dns.edns.Option] | None = None, |
| 1150 | ) -> None: |
| 1151 | """Configure EDNS behavior. |
| 1152 | |
| 1153 | *edns*, an ``int``, is the EDNS level to use. Specifying |
| 1154 | ``None``, ``False``, or ``-1`` means "do not use EDNS", and in this case |
| 1155 | the other parameters are ignored. Specifying ``True`` is |
| 1156 | equivalent to specifying 0, i.e. "use EDNS0". |
| 1157 | |
| 1158 | *ednsflags*, an ``int``, the EDNS flag values. |
| 1159 | |
| 1160 | *payload*, an ``int``, is the EDNS sender's payload field, which is the |
| 1161 | maximum size of UDP datagram the sender can handle. I.e. how big |
| 1162 | a response to this message can be. |
| 1163 | |
| 1164 | *options*, a list of ``dns.edns.Option`` objects or ``None``, the EDNS |
| 1165 | options. |
| 1166 | """ |
| 1167 | |
| 1168 | if edns is None or edns is False: |
| 1169 | edns = -1 |
| 1170 | elif edns is True: |
| 1171 | edns = 0 |
| 1172 | self.edns = edns |
| 1173 | self.ednsflags = ednsflags |
| 1174 | self.payload = payload |
| 1175 | self.ednsoptions = options |
| 1176 | |
| 1177 | def set_flags(self, flags: int) -> None: |
| 1178 | """Overrides the default flags with your own. |
no outgoing calls
no test coverage detected