|
43 | 43 | from pcapkit.const.hip.ecdsa_curve import ECDSACurve as Enum_ECDSACurve |
44 | 44 | from pcapkit.const.hip.ecdsa_low_curve import ECDSALowCurve as Enum_ECDSALowCurve |
45 | 45 | from pcapkit.const.hip.eddsa_curve import EdDSACurve as Enum_EdDSACurve |
| 46 | +from pcapkit.const.hip.esp_transform_suite import ESPTransformSuite as Enum_ESPTransformSuite |
46 | 47 | from pcapkit.const.hip.group import Group as Enum_Group |
47 | 48 | from pcapkit.const.hip.hi_algorithm import HIAlgorithm as Enum_HIAlgorithm |
48 | 49 | from pcapkit.const.hip.hit_suite import HITSuite as Enum_HITSuite |
| 50 | +from pcapkit.const.hip.nat_traversal import NATTraversal as Enum_NATTraversal |
49 | 51 | from pcapkit.const.hip.notify_message import NotifyMessage as Enum_NotifyMessage |
50 | 52 | from pcapkit.const.hip.packet import Packet as Enum_Packet |
51 | 53 | from pcapkit.const.hip.parameter import Parameter as Enum_Parameter |
| 54 | +from pcapkit.const.hip.registration import Registration as Enum_Registration |
52 | 55 | from pcapkit.const.hip.registration_failure import RegistrationFailure as Enum_RegistrationFailure |
| 56 | +from pcapkit.const.hip.suite import Suite as Enum_Suite |
| 57 | +from pcapkit.const.hip.transport import Transport as Enum_Transport |
53 | 58 | from pcapkit.const.reg.transtype import TransType as Enum_TransType |
54 | 59 | from pcapkit.corekit.fields.ipaddress import parse_ip_address |
55 | 60 | from pcapkit.corekit.multidict import OrderedMultiDict |
|
216 | 221 | from mypy_extensions import DefaultArg, KwArg, NamedArg |
217 | 222 | from typing_extensions import Literal, NotRequired |
218 | 223 |
|
219 | | - from pcapkit.const.hip.esp_transform_suite import ESPTransformSuite as Enum_ESPTransformSuite |
220 | | - from pcapkit.const.hip.nat_traversal import NATTraversal as Enum_NATTraversal |
221 | | - from pcapkit.const.hip.registration import Registration as Enum_Registration |
222 | | - from pcapkit.const.hip.suite import Suite as Enum_Suite |
223 | | - from pcapkit.const.hip.transport import Transport as Enum_Transport |
224 | 224 | from pcapkit.corekit.protochain import ProtoChain |
225 | 225 | from pcapkit.protocols.protocol import ProtocolBase |
226 | 226 | from pcapkit.protocols.schema.internet.hip import Parameter as Schema_Parameter |
@@ -3893,6 +3893,13 @@ def _make_param_dh_group_list(self, code: 'Enum_Parameter', param: 'Optional[Dat |
3893 | 3893 | if groups is None: |
3894 | 3894 | groups = [] |
3895 | 3895 |
|
| 3896 | + # NOTE: ``group`` is a loop variable rather than an argument of this |
| 3897 | + # maker, so ``_make_index`` has no argument default to infer the |
| 3898 | + # namespace of a :obj:`str` member name from; name it here rather than |
| 3899 | + # leave the name unresolvable (#2394). |
| 3900 | + if group_namespace is None: |
| 3901 | + group_namespace = Enum_Group |
| 3902 | + |
3896 | 3903 | group_id = [] |
3897 | 3904 | for group in groups: |
3898 | 3905 | group_id.append(self._make_index(group, group_default, namespace=group_namespace, # type: ignore[arg-type] |
@@ -3986,6 +3993,13 @@ def _make_param_hip_transform(self, code: 'Enum_Parameter', param: 'Optional[Dat |
3986 | 3993 | if suites is None: |
3987 | 3994 | suites = [] |
3988 | 3995 |
|
| 3996 | + # NOTE: ``suite`` is a loop variable rather than an argument of this |
| 3997 | + # maker, so ``_make_index`` has no argument default to infer the |
| 3998 | + # namespace of a :obj:`str` member name from; name it here rather than |
| 3999 | + # leave the name unresolvable (#2394). |
| 4000 | + if suite_namespace is None: |
| 4001 | + suite_namespace = Enum_Suite |
| 4002 | + |
3989 | 4003 | suite_id = [] |
3990 | 4004 | for suite in suites: |
3991 | 4005 | suite_id.append(self._make_index(suite, suite_default, namespace=suite_namespace, # type: ignore[arg-type] |
@@ -4032,6 +4046,13 @@ def _make_param_hip_cipher(self, code: 'Enum_Parameter', param: 'Optional[Data_H |
4032 | 4046 | if ciphers is None: |
4033 | 4047 | ciphers = [] |
4034 | 4048 |
|
| 4049 | + # NOTE: ``cipher`` is a loop variable rather than an argument of this |
| 4050 | + # maker, so ``_make_index`` has no argument default to infer the |
| 4051 | + # namespace of a :obj:`str` member name from; name it here rather than |
| 4052 | + # leave the name unresolvable (#2394). |
| 4053 | + if cipher_namespace is None: |
| 4054 | + cipher_namespace = Enum_Cipher |
| 4055 | + |
4035 | 4056 | cipher_id = [] |
4036 | 4057 | for cipher in ciphers: |
4037 | 4058 | cipher_id.append(self._make_index(cipher, cipher_default, namespace=cipher_namespace, # type: ignore[arg-type] |
@@ -4076,6 +4097,13 @@ def _make_param_nat_traversal_mode(self, code: 'Enum_Parameter', param: 'Optiona |
4076 | 4097 | if modes is None: |
4077 | 4098 | modes = [] |
4078 | 4099 |
|
| 4100 | + # NOTE: ``mode`` is a loop variable rather than an argument of this |
| 4101 | + # maker, so ``_make_index`` has no argument default to infer the |
| 4102 | + # namespace of a :obj:`str` member name from; name it here rather than |
| 4103 | + # leave the name unresolvable (#2394). |
| 4104 | + if mode_namespace is None: |
| 4105 | + mode_namespace = Enum_NATTraversal |
| 4106 | + |
4079 | 4107 | mode_id = [] |
4080 | 4108 | for mode in modes: |
4081 | 4109 | mode_id.append(self._make_index(mode, mode_default, namespace=mode_namespace, # type: ignore[arg-type] |
@@ -4343,6 +4371,13 @@ def _make_param_hit_suite_list(self, code: 'Enum_Parameter', param: 'Optional[Da |
4343 | 4371 | if suites is None: |
4344 | 4372 | suites = [] |
4345 | 4373 |
|
| 4374 | + # NOTE: ``suite`` is a loop variable rather than an argument of this |
| 4375 | + # maker, so ``_make_index`` has no argument default to infer the |
| 4376 | + # namespace of a :obj:`str` member name from; name it here rather than |
| 4377 | + # leave the name unresolvable (#2394). |
| 4378 | + if suite_namespace is None: |
| 4379 | + suite_namespace = Enum_HITSuite |
| 4380 | + |
4346 | 4381 | suite_id = [] |
4347 | 4382 | for suite in suites: |
4348 | 4383 | suite_id.append(self._make_index(suite, suite_default, namespace=suite_namespace, # type: ignore[arg-type] |
@@ -4546,6 +4581,13 @@ def _make_param_reg_info(self, code: 'Enum_Parameter', param: 'Optional[Data_Reg |
4546 | 4581 | if reg_info is None: |
4547 | 4582 | reg_info = [] |
4548 | 4583 |
|
| 4584 | + # NOTE: ``reg`` is a loop variable rather than an argument of this |
| 4585 | + # maker, so ``_make_index`` has no argument default to infer the |
| 4586 | + # namespace of a :obj:`str` member name from; name it here rather than |
| 4587 | + # leave the name unresolvable (#2394). |
| 4588 | + if reg_info_namespace is None: |
| 4589 | + reg_info_namespace = Enum_Registration |
| 4590 | + |
4549 | 4591 | reg_type = [] |
4550 | 4592 | for reg in reg_info: |
4551 | 4593 | reg_type.append(self._make_index(reg, reg_info_default, namespace=reg_info_namespace, # type: ignore[arg-type] |
@@ -4610,6 +4652,13 @@ def _make_param_reg_request(self, code: 'Enum_Parameter', param: 'Optional[Data_ |
4610 | 4652 | if reg_request is None: |
4611 | 4653 | reg_request = [] |
4612 | 4654 |
|
| 4655 | + # NOTE: ``reg`` is a loop variable rather than an argument of this |
| 4656 | + # maker, so ``_make_index`` has no argument default to infer the |
| 4657 | + # namespace of a :obj:`str` member name from; name it here rather than |
| 4658 | + # leave the name unresolvable (#2394). |
| 4659 | + if reg_request_namespace is None: |
| 4660 | + reg_request_namespace = Enum_Registration |
| 4661 | + |
4613 | 4662 | reg_type = [] |
4614 | 4663 | for reg in reg_request: |
4615 | 4664 | reg_type.append(self._make_index(reg, reg_request_default, namespace=reg_request_namespace, # type: ignore[arg-type] |
@@ -4672,6 +4721,13 @@ def _make_param_reg_response(self, code: 'Enum_Parameter', param: 'Optional[Data |
4672 | 4721 | if reg_response is None: |
4673 | 4722 | reg_response = [] |
4674 | 4723 |
|
| 4724 | + # NOTE: ``reg`` is a loop variable rather than an argument of this |
| 4725 | + # maker, so ``_make_index`` has no argument default to infer the |
| 4726 | + # namespace of a :obj:`str` member name from; name it here rather than |
| 4727 | + # leave the name unresolvable (#2394). |
| 4728 | + if reg_response_namespace is None: |
| 4729 | + reg_response_namespace = Enum_Registration |
| 4730 | + |
4675 | 4731 | reg_type = [] |
4676 | 4732 | for reg in reg_response: |
4677 | 4733 | reg_type.append(self._make_index(reg, reg_response_default, namespace=reg_response_namespace, # type: ignore[arg-type] |
@@ -4733,6 +4789,15 @@ def _make_param_reg_failed(self, code: 'Enum_Parameter', param: 'Optional[Data_R |
4733 | 4789 | if reg_failed is None: |
4734 | 4790 | reg_failed = [] |
4735 | 4791 |
|
| 4792 | + # NOTE: ``reg`` is a loop variable rather than an argument of this |
| 4793 | + # maker, so ``_make_index`` has no argument default to infer the |
| 4794 | + # namespace of a :obj:`str` member name from; name it here rather than |
| 4795 | + # leave the name unresolvable (#2394). ``failure_type`` above is a |
| 4796 | + # scalar whose own default is an enumeration member, so it has been |
| 4797 | + # resolving a member name by inference all along. |
| 4798 | + if reg_failed_namespace is None: |
| 4799 | + reg_failed_namespace = Enum_Registration |
| 4800 | + |
4736 | 4801 | reg_type = [] |
4737 | 4802 | for reg in reg_failed: |
4738 | 4803 | reg_type.append(self._make_index(reg, reg_failed_default, namespace=reg_failed_namespace, # type: ignore[arg-type] |
@@ -4854,6 +4919,14 @@ def _make_param_transport_format_list(self, code: 'Enum_Parameter', param: 'Opti |
4854 | 4919 | if formats is None: |
4855 | 4920 | formats = [] |
4856 | 4921 |
|
| 4922 | + # NOTE: ``tf`` is a loop variable rather than an argument of this |
| 4923 | + # maker, so ``_make_index`` has no argument default to infer the |
| 4924 | + # namespace of a :obj:`str` member name from; name it here rather than |
| 4925 | + # leave the name unresolvable (#2394). A transport format is a |
| 4926 | + # parameter code, so the namespace is ``Enum_Parameter`` itself. |
| 4927 | + if format_namespace is None: |
| 4928 | + format_namespace = Enum_Parameter |
| 4929 | + |
4857 | 4930 | tf_type = [] |
4858 | 4931 | for tf in formats: |
4859 | 4932 | tf_type.append(self._make_index(tf, format_default, namespace=format_namespace, # type: ignore[arg-type] |
@@ -4898,6 +4971,13 @@ def _make_param_esp_transform(self, code: 'Enum_Parameter', param: 'Optional[Dat |
4898 | 4971 | if suites is None: |
4899 | 4972 | suites = [] |
4900 | 4973 |
|
| 4974 | + # NOTE: ``suite`` is a loop variable rather than an argument of this |
| 4975 | + # maker, so ``_make_index`` has no argument default to infer the |
| 4976 | + # namespace of a :obj:`str` member name from; name it here rather than |
| 4977 | + # leave the name unresolvable (#2394). |
| 4978 | + if suite_namespace is None: |
| 4979 | + suite_namespace = Enum_ESPTransformSuite |
| 4980 | + |
4901 | 4981 | suite_id = [] |
4902 | 4982 | for suite in suites: |
4903 | 4983 | suite_id.append(self._make_index(suite, suite_default, namespace=suite_namespace, # type: ignore[arg-type] |
@@ -5228,6 +5308,13 @@ def _make_param_hip_transport_mode(self, code: 'Enum_Parameter', param: 'Optiona |
5228 | 5308 | if modes is None: |
5229 | 5309 | modes = [] |
5230 | 5310 |
|
| 5311 | + # NOTE: ``mode`` is a loop variable rather than an argument of this |
| 5312 | + # maker, so ``_make_index`` has no argument default to infer the |
| 5313 | + # namespace of a :obj:`str` member name from; name it here rather than |
| 5314 | + # leave the name unresolvable (#2394). |
| 5315 | + if mode_namespace is None: |
| 5316 | + mode_namespace = Enum_Transport |
| 5317 | + |
5231 | 5318 | mode_id = [] |
5232 | 5319 | for mode in modes: |
5233 | 5320 | mode_id.append(self._make_index(mode, mode_default, namespace=mode_namespace, # type: ignore[arg-type] |
|
0 commit comments