pypcapkit 1.0.3.post1__cp39-none-any.whl → 1.1.0__cp39-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pcapkit/__init__.py +1 -1
- pcapkit/const/pcapng/option_type.py +1 -1
- pcapkit/const/reg/apptype.py +19017 -19017
- pcapkit/corekit/fields/collections.py +14 -14
- pcapkit/corekit/fields/field.py +33 -8
- pcapkit/corekit/fields/ipaddress.py +0 -1
- pcapkit/corekit/fields/misc.py +14 -19
- pcapkit/corekit/fields/numbers.py +2 -3
- pcapkit/corekit/fields/strings.py +2 -3
- pcapkit/corekit/infoclass.py +59 -6
- pcapkit/corekit/protochain.py +8 -1
- pcapkit/foundation/registry/protocols.py +108 -16
- pcapkit/protocols/data/__init__.py +4 -4
- pcapkit/protocols/data/internet/__init__.py +4 -4
- pcapkit/protocols/data/internet/mh.py +8 -6
- pcapkit/protocols/data/transport/__init__.py +4 -4
- pcapkit/protocols/data/transport/tcp.py +4 -4
- pcapkit/protocols/internet/mh.py +21 -21
- pcapkit/protocols/protocol.py +3 -2
- pcapkit/protocols/schema/__init__.py +4 -4
- pcapkit/protocols/schema/application/httpv2.py +17 -33
- pcapkit/protocols/schema/internet/__init__.py +4 -4
- pcapkit/protocols/schema/internet/hip.py +62 -111
- pcapkit/protocols/schema/internet/hopopt.py +46 -48
- pcapkit/protocols/schema/internet/ipv4.py +36 -41
- pcapkit/protocols/schema/internet/ipv6_opts.py +48 -52
- pcapkit/protocols/schema/internet/ipv6_route.py +12 -21
- pcapkit/protocols/schema/internet/mh.py +57 -86
- pcapkit/protocols/schema/misc/pcapng.py +182 -193
- pcapkit/protocols/schema/schema.py +252 -53
- pcapkit/protocols/schema/transport/__init__.py +4 -4
- pcapkit/protocols/schema/transport/tcp.py +54 -81
- pcapkit/protocols/transport/tcp.py +14 -14
- pcapkit/vendor/pcapng/option_type.py +26 -2
- pcapkit/vendor/reg/apptype.py +32 -5
- {pypcapkit-1.0.3.post1.dist-info → pypcapkit-1.1.0.dist-info}/METADATA +1 -1
- {pypcapkit-1.0.3.post1.dist-info → pypcapkit-1.1.0.dist-info}/RECORD +41 -41
- {pypcapkit-1.0.3.post1.dist-info → pypcapkit-1.1.0.dist-info}/LICENSE +0 -0
- {pypcapkit-1.0.3.post1.dist-info → pypcapkit-1.1.0.dist-info}/WHEEL +0 -0
- {pypcapkit-1.0.3.post1.dist-info → pypcapkit-1.1.0.dist-info}/entry_points.txt +0 -0
- {pypcapkit-1.0.3.post1.dist-info → pypcapkit-1.1.0.dist-info}/top_level.txt +0 -0
@@ -2,7 +2,6 @@
|
|
2
2
|
# mypy: disable-error-code=assignment
|
3
3
|
"""header schema for mobility header"""
|
4
4
|
|
5
|
-
import collections
|
6
5
|
import datetime
|
7
6
|
import math
|
8
7
|
from typing import TYPE_CHECKING
|
@@ -60,7 +59,7 @@ from pcapkit.corekit.fields.misc import (ConditionalField, ForwardMatchField, Pa
|
|
60
59
|
from pcapkit.corekit.fields.numbers import (EnumField, UInt8Field, UInt16Field, UInt32Field,
|
61
60
|
UInt64Field)
|
62
61
|
from pcapkit.corekit.fields.strings import BitField, BytesField, PaddingField, StringField
|
63
|
-
from pcapkit.protocols.schema.schema import Schema, schema_final
|
62
|
+
from pcapkit.protocols.schema.schema import EnumSchema, Schema, schema_final
|
64
63
|
from pcapkit.utilities.logging import SPHINX_TYPE_CHECKING
|
65
64
|
|
66
65
|
__all__ = [
|
@@ -72,8 +71,8 @@ __all__ = [
|
|
72
71
|
'BindingErrorMessage',
|
73
72
|
|
74
73
|
'Option',
|
75
|
-
'UnassignedOption', 'PadOption', '
|
76
|
-
'NonceIndicesOption', '
|
74
|
+
'UnassignedOption', 'PadOption', 'BindingRefreshAdviceOption', 'AlternateCareofAddressOption',
|
75
|
+
'NonceIndicesOption', 'AuthorizationDataOption', 'MobileNetworkPrefixOption',
|
77
76
|
'LinkLayerAddressOption', 'MNIDOption', 'AuthOption', 'MesgIDOption', 'CGAParametersRequestOption',
|
78
77
|
'CGAParametersOption', 'SignatureOption', 'PermanentHomeKeygenTokenOption', 'CareofTestInitOption',
|
79
78
|
'CareofTestOption',
|
@@ -87,7 +86,7 @@ __all__ = [
|
|
87
86
|
if TYPE_CHECKING:
|
88
87
|
from datetime import datetime as dt_type
|
89
88
|
from ipaddress import IPv6Address
|
90
|
-
from typing import Any
|
89
|
+
from typing import Any
|
91
90
|
|
92
91
|
from pcapkit.corekit.fields.field import _Field as Field
|
93
92
|
from pcapkit.protocols.protocol import Protocol
|
@@ -120,29 +119,6 @@ if SPHINX_TYPE_CHECKING:
|
|
120
119
|
K: 'int'
|
121
120
|
|
122
121
|
|
123
|
-
def mh_opt_registry() -> 'DefaultDict[Enum_Option | int, Type[Option]]':
|
124
|
-
"""Registry for MH type-specific message :attr:`~Packet.options`."""
|
125
|
-
return collections.defaultdict(lambda: UnassignedOption, {
|
126
|
-
Enum_Option.Pad1: PadOption,
|
127
|
-
Enum_Option.PadN: PadOption,
|
128
|
-
Enum_Option.Binding_Refresh_Advice: BindingAuthorizationDataOption,
|
129
|
-
Enum_Option.Alternate_Care_of_Address: AlternateCareofAddressOption,
|
130
|
-
Enum_Option.Nonce_Indices: NonceIndicesOption,
|
131
|
-
Enum_Option.Authorization_Data: BindingAuthorizationDataOption,
|
132
|
-
Enum_Option.Mobile_Network_Prefix_Option: MobileNetworkPrefixOption,
|
133
|
-
Enum_Option.Mobility_Header_Link_Layer_Address_option: LinkLayerAddressOption,
|
134
|
-
Enum_Option.MN_ID_OPTION_TYPE: MNIDOption,
|
135
|
-
Enum_Option.AUTH_OPTION_TYPE: AuthOption,
|
136
|
-
Enum_Option.MESG_ID_OPTION_TYPE: MesgIDOption,
|
137
|
-
Enum_Option.CGA_Parameters_Request: CGAParametersRequestOption,
|
138
|
-
Enum_Option.CGA_Parameters: CGAParametersOption,
|
139
|
-
Enum_Option.Signature: SignatureOption,
|
140
|
-
Enum_Option.Permanent_Home_Keygen_Token: PermanentHomeKeygenTokenOption,
|
141
|
-
Enum_Option.Care_of_Test_Init: CareofTestInitOption,
|
142
|
-
Enum_Option.Care_of_Test: CareofTestOption,
|
143
|
-
})
|
144
|
-
|
145
|
-
|
146
122
|
def mh_data_selector(pkt: 'dict[str, Any]') -> 'Field':
|
147
123
|
"""Selector function for :attr:`MH.data` field.
|
148
124
|
|
@@ -151,30 +127,14 @@ def mh_data_selector(pkt: 'dict[str, Any]') -> 'Field':
|
|
151
127
|
|
152
128
|
Returns:
|
153
129
|
Returns a :class:`~pcapkit.corekit.fields.misc.SchemaField`
|
154
|
-
wrapped :class:`~pcapkit.protocols.schema.
|
130
|
+
wrapped :class:`~pcapkit.protocols.schema.internet.mh.Packet`
|
155
131
|
subclass instance.
|
156
132
|
|
157
133
|
"""
|
158
134
|
type = pkt['type'] # type: Enum_Packet
|
159
135
|
length = pkt['length'] * 8 + 2
|
160
|
-
|
161
|
-
|
162
|
-
return SchemaField(length=length, schema=BindingRefreshRequestMessage)
|
163
|
-
if type == Enum_Packet.Home_Test_Init:
|
164
|
-
return SchemaField(length=length, schema=HomeTestInitMessage)
|
165
|
-
if type == Enum_Packet.Care_of_Test_Init:
|
166
|
-
return SchemaField(length=length, schema=CareofTestInitMessage)
|
167
|
-
if type == Enum_Packet.Home_Test:
|
168
|
-
return SchemaField(length=length, schema=HomeTestMessage)
|
169
|
-
if type == Enum_Packet.Care_of_Test:
|
170
|
-
return SchemaField(length=length, schema=CareofTestMessage)
|
171
|
-
if type == Enum_Packet.Binding_Update:
|
172
|
-
return SchemaField(length=length, schema=BindingUpdateMessage)
|
173
|
-
if type == Enum_Packet.Binding_Acknowledgement:
|
174
|
-
return SchemaField(length=length, schema=BindingAcknowledgementMessage)
|
175
|
-
if type == Enum_Packet.Binding_Error:
|
176
|
-
return SchemaField(length=length, schema=BindingErrorMessage)
|
177
|
-
return SchemaField(length=length, schema=UnknownMessage)
|
136
|
+
schema = Packet.registry[type]
|
137
|
+
return SchemaField(length=length, schema=schema)
|
178
138
|
|
179
139
|
|
180
140
|
def mn_id_selector(pkt: 'dict[str, Any]') -> 'Field':
|
@@ -220,9 +180,11 @@ class MH(Schema):
|
|
220
180
|
chksum: 'bytes', data: 'Packet | bytes', payload: 'bytes | Protocol | Schema') -> 'None': ...
|
221
181
|
|
222
182
|
|
223
|
-
class Option(
|
183
|
+
class Option(EnumSchema[Enum_Option]):
|
224
184
|
"""Header schema for MH options."""
|
225
185
|
|
186
|
+
__default__ = lambda: UnassignedOption
|
187
|
+
|
226
188
|
#: Option type.
|
227
189
|
type: 'Enum_Option' = EnumField(length=1, namespace=Enum_Option)
|
228
190
|
#: Option length (excl. type and length fields), conditional in case of
|
@@ -260,7 +222,8 @@ class UnassignedOption(Option):
|
|
260
222
|
|
261
223
|
|
262
224
|
@schema_final
|
263
|
-
class PadOption(Option
|
225
|
+
class PadOption(Option, code=[Enum_Option.Pad1,
|
226
|
+
Enum_Option.PadN]):
|
264
227
|
"""Header schema for MH padding options."""
|
265
228
|
|
266
229
|
#: Option data.
|
@@ -271,7 +234,7 @@ class PadOption(Option):
|
|
271
234
|
|
272
235
|
|
273
236
|
@schema_final
|
274
|
-
class
|
237
|
+
class BindingRefreshAdviceOption(Option, code=Enum_Option.Binding_Refresh_Advice):
|
275
238
|
"""Header schema for MH binding refresh advice options."""
|
276
239
|
|
277
240
|
#: Refresh interval.
|
@@ -282,7 +245,7 @@ class BindRefreshAdviceOption(Option):
|
|
282
245
|
|
283
246
|
|
284
247
|
@schema_final
|
285
|
-
class AlternateCareofAddressOption(Option):
|
248
|
+
class AlternateCareofAddressOption(Option, code=Enum_Option.Alternate_Care_of_Address):
|
286
249
|
"""Header schema for MH alternate care-of address options."""
|
287
250
|
|
288
251
|
#: Alternate care-of address.
|
@@ -293,7 +256,7 @@ class AlternateCareofAddressOption(Option):
|
|
293
256
|
|
294
257
|
|
295
258
|
@schema_final
|
296
|
-
class NonceIndicesOption(Option):
|
259
|
+
class NonceIndicesOption(Option, code=Enum_Option.Nonce_Indices):
|
297
260
|
"""Header schema for MH nonce indices options."""
|
298
261
|
|
299
262
|
#: Home nonce index.
|
@@ -306,7 +269,7 @@ class NonceIndicesOption(Option):
|
|
306
269
|
|
307
270
|
|
308
271
|
@schema_final
|
309
|
-
class
|
272
|
+
class AuthorizationDataOption(Option, code=Enum_Option.Authorization_Data):
|
310
273
|
"""Header schema for MH binding authorization data options."""
|
311
274
|
|
312
275
|
#: Authenticator.
|
@@ -317,7 +280,7 @@ class BindingAuthorizationDataOption(Option):
|
|
317
280
|
|
318
281
|
|
319
282
|
@schema_final
|
320
|
-
class MobileNetworkPrefixOption(Option):
|
283
|
+
class MobileNetworkPrefixOption(Option, code=Enum_Option.Mobile_Network_Prefix_Option):
|
321
284
|
"""Header schema for MH mobile network prefix options."""
|
322
285
|
|
323
286
|
#: Reserved.
|
@@ -332,7 +295,7 @@ class MobileNetworkPrefixOption(Option):
|
|
332
295
|
|
333
296
|
|
334
297
|
@schema_final
|
335
|
-
class LinkLayerAddressOption(Option):
|
298
|
+
class LinkLayerAddressOption(Option, code=Enum_Option.Mobility_Header_Link_Layer_Address_option):
|
336
299
|
"""Header schema for MH link-layer address (MH-LLA) options."""
|
337
300
|
|
338
301
|
#: Option code.
|
@@ -345,7 +308,7 @@ class LinkLayerAddressOption(Option):
|
|
345
308
|
|
346
309
|
|
347
310
|
@schema_final
|
348
|
-
class MNIDOption(Option):
|
311
|
+
class MNIDOption(Option, code=Enum_Option.MN_ID_OPTION_TYPE):
|
349
312
|
"""Header schema for MH mobile node identifier (MNID) options."""
|
350
313
|
|
351
314
|
#: Subtype.
|
@@ -358,7 +321,7 @@ class MNIDOption(Option):
|
|
358
321
|
|
359
322
|
|
360
323
|
@schema_final
|
361
|
-
class AuthOption(Option):
|
324
|
+
class AuthOption(Option, code=Enum_Option.AUTH_OPTION_TYPE):
|
362
325
|
"""Header schema for Mobility Message Authentication options."""
|
363
326
|
|
364
327
|
#: Subtype.
|
@@ -373,7 +336,7 @@ class AuthOption(Option):
|
|
373
336
|
|
374
337
|
|
375
338
|
@schema_final
|
376
|
-
class MesgIDOption(Option):
|
339
|
+
class MesgIDOption(Option, code=Enum_Option.MESG_ID_OPTION_TYPE):
|
377
340
|
"""Header schema for Mobility Message Replay Protection options."""
|
378
341
|
|
379
342
|
#: Timestamp (seconds since January 1st, 1970, c.f., :rfc:`1305`).
|
@@ -410,16 +373,18 @@ class MesgIDOption(Option):
|
|
410
373
|
|
411
374
|
|
412
375
|
@schema_final
|
413
|
-
class CGAParametersRequestOption(Option):
|
376
|
+
class CGAParametersRequestOption(Option, code=Enum_Option.CGA_Parameters_Request):
|
414
377
|
"""Header schema for CGA Parameters Request options."""
|
415
378
|
|
416
379
|
if TYPE_CHECKING:
|
417
380
|
def __init__(self, type: 'Enum_Option', length: 'int') -> 'None': ...
|
418
381
|
|
419
382
|
|
420
|
-
class CGAExtension(
|
383
|
+
class CGAExtension(EnumSchema[Enum_CGAExtension]):
|
421
384
|
"""Header schema for CGA extensions."""
|
422
385
|
|
386
|
+
__default__ = lambda: UnknownExtension
|
387
|
+
|
423
388
|
#: Extension type.
|
424
389
|
type: 'Enum_CGAExtension' = EnumField(length=2, namespace=Enum_CGAExtension)
|
425
390
|
#: Extension data length.
|
@@ -438,7 +403,7 @@ class UnknownExtension(CGAExtension):
|
|
438
403
|
|
439
404
|
|
440
405
|
@schema_final
|
441
|
-
class MultiPrefixExtension(CGAExtension):
|
406
|
+
class MultiPrefixExtension(CGAExtension, code=Enum_CGAExtension.Multi_Prefix):
|
442
407
|
"""Header schema for Multi-Prefix CGA extensions."""
|
443
408
|
|
444
409
|
#: Flags.
|
@@ -476,9 +441,7 @@ class CGAParameter(Schema):
|
|
476
441
|
length=lambda pkt: pkt['length'] - 25 - len(pkt['public_key']),
|
477
442
|
base_schema=CGAExtension,
|
478
443
|
type_name='type',
|
479
|
-
registry=
|
480
|
-
Enum_CGAExtension.Multi_Prefix: MultiPrefixExtension,
|
481
|
-
}),
|
444
|
+
registry=CGAExtension.registry,
|
482
445
|
eool=None,
|
483
446
|
)
|
484
447
|
|
@@ -488,7 +451,7 @@ class CGAParameter(Schema):
|
|
488
451
|
|
489
452
|
|
490
453
|
@schema_final
|
491
|
-
class CGAParametersOption(Option):
|
454
|
+
class CGAParametersOption(Option, code=Enum_Option.CGA_Parameters):
|
492
455
|
"""Header schema for CGA Parameters options."""
|
493
456
|
|
494
457
|
#: CGA parameters, c.f., :rfc:`3972`.
|
@@ -502,7 +465,7 @@ class CGAParametersOption(Option):
|
|
502
465
|
|
503
466
|
|
504
467
|
@schema_final
|
505
|
-
class SignatureOption(Option):
|
468
|
+
class SignatureOption(Option, code=Enum_Option.Signature):
|
506
469
|
"""Header schema for MH Signature options."""
|
507
470
|
|
508
471
|
#: Signature.
|
@@ -513,7 +476,7 @@ class SignatureOption(Option):
|
|
513
476
|
|
514
477
|
|
515
478
|
@schema_final
|
516
|
-
class PermanentHomeKeygenTokenOption(Option):
|
479
|
+
class PermanentHomeKeygenTokenOption(Option, code=Enum_Option.Permanent_Home_Keygen_Token):
|
517
480
|
"""Header schema for Permanent Home Keygen Token options."""
|
518
481
|
|
519
482
|
#: Permanent home keygen token.
|
@@ -524,7 +487,7 @@ class PermanentHomeKeygenTokenOption(Option):
|
|
524
487
|
|
525
488
|
|
526
489
|
@schema_final
|
527
|
-
class CareofTestInitOption(Option):
|
490
|
+
class CareofTestInitOption(Option, code=Enum_Option.Care_of_Test_Init):
|
528
491
|
"""Header schema for MH Care-of Test Init options."""
|
529
492
|
|
530
493
|
if TYPE_CHECKING:
|
@@ -532,7 +495,7 @@ class CareofTestInitOption(Option):
|
|
532
495
|
|
533
496
|
|
534
497
|
@schema_final
|
535
|
-
class CareofTestOption(Option):
|
498
|
+
class CareofTestOption(Option, code=Enum_Option.Care_of_Test):
|
536
499
|
"""Header schema for MH Care-of Test options."""
|
537
500
|
|
538
501
|
#: Care-of keygen token.
|
@@ -542,9 +505,14 @@ class CareofTestOption(Option):
|
|
542
505
|
def __init__(self, type: 'Enum_Option', length: 'int', token: 'bytes') -> 'None': ...
|
543
506
|
|
544
507
|
|
545
|
-
|
508
|
+
# TODO: Implement other options.
|
509
|
+
|
510
|
+
|
511
|
+
class Packet(EnumSchema[Enum_Packet]):
|
546
512
|
"""Header schema for MH packet data."""
|
547
513
|
|
514
|
+
__default__ = lambda: UnknownMessage
|
515
|
+
|
548
516
|
|
549
517
|
@schema_final
|
550
518
|
class UnknownMessage(Packet):
|
@@ -558,7 +526,7 @@ class UnknownMessage(Packet):
|
|
558
526
|
|
559
527
|
|
560
528
|
@schema_final
|
561
|
-
class BindingRefreshRequestMessage(Packet):
|
529
|
+
class BindingRefreshRequestMessage(Packet, code=Enum_Packet.Binding_Refresh_Request):
|
562
530
|
"""Header schema for MH Binding Refresh Request (BRR) message."""
|
563
531
|
|
564
532
|
#: Reserved.
|
@@ -568,7 +536,7 @@ class BindingRefreshRequestMessage(Packet):
|
|
568
536
|
length=lambda pkt: pkt['__length__'],
|
569
537
|
base_schema=Option,
|
570
538
|
type_name='type',
|
571
|
-
registry=
|
539
|
+
registry=Option.registry,
|
572
540
|
eool=None,
|
573
541
|
)
|
574
542
|
|
@@ -577,7 +545,7 @@ class BindingRefreshRequestMessage(Packet):
|
|
577
545
|
|
578
546
|
|
579
547
|
@schema_final
|
580
|
-
class HomeTestInitMessage(Packet):
|
548
|
+
class HomeTestInitMessage(Packet, code=Enum_Packet.Home_Test_Init):
|
581
549
|
"""Header schema for MH Home Test Init (HoTI) message."""
|
582
550
|
|
583
551
|
#: Reserved.
|
@@ -589,7 +557,7 @@ class HomeTestInitMessage(Packet):
|
|
589
557
|
length=lambda pkt: pkt['__length__'],
|
590
558
|
base_schema=Option,
|
591
559
|
type_name='type',
|
592
|
-
registry=
|
560
|
+
registry=Option.registry,
|
593
561
|
eool=None,
|
594
562
|
)
|
595
563
|
|
@@ -598,7 +566,7 @@ class HomeTestInitMessage(Packet):
|
|
598
566
|
|
599
567
|
|
600
568
|
@schema_final
|
601
|
-
class CareofTestInitMessage(Packet):
|
569
|
+
class CareofTestInitMessage(Packet, code=Enum_Packet.Care_of_Test_Init):
|
602
570
|
"""Header schema for MH Care-of Test Init (CoTI) messages."""
|
603
571
|
|
604
572
|
#: Reserved.
|
@@ -610,7 +578,7 @@ class CareofTestInitMessage(Packet):
|
|
610
578
|
length=lambda pkt: pkt['__length__'],
|
611
579
|
base_schema=Option,
|
612
580
|
type_name='type',
|
613
|
-
registry=
|
581
|
+
registry=Option.registry,
|
614
582
|
eool=None,
|
615
583
|
)
|
616
584
|
|
@@ -619,7 +587,7 @@ class CareofTestInitMessage(Packet):
|
|
619
587
|
|
620
588
|
|
621
589
|
@schema_final
|
622
|
-
class HomeTestMessage(Packet):
|
590
|
+
class HomeTestMessage(Packet, code=Enum_Packet.Home_Test):
|
623
591
|
"""Header schema for MH Home Test (HoT) message."""
|
624
592
|
|
625
593
|
#: Home nonce index.
|
@@ -633,7 +601,7 @@ class HomeTestMessage(Packet):
|
|
633
601
|
length=lambda pkt: pkt['__length__'],
|
634
602
|
base_schema=Option,
|
635
603
|
type_name='type',
|
636
|
-
registry=
|
604
|
+
registry=Option.registry,
|
637
605
|
eool=None,
|
638
606
|
)
|
639
607
|
|
@@ -643,7 +611,7 @@ class HomeTestMessage(Packet):
|
|
643
611
|
|
644
612
|
|
645
613
|
@schema_final
|
646
|
-
class CareofTestMessage(Packet):
|
614
|
+
class CareofTestMessage(Packet, code=Enum_Packet.Care_of_Test):
|
647
615
|
"""Header schema for MH Care-of Test (CoT) message."""
|
648
616
|
|
649
617
|
#: Care-of nonce index.
|
@@ -657,7 +625,7 @@ class CareofTestMessage(Packet):
|
|
657
625
|
length=lambda pkt: pkt['__length__'],
|
658
626
|
base_schema=Option,
|
659
627
|
type_name='type',
|
660
|
-
registry=
|
628
|
+
registry=Option.registry,
|
661
629
|
eool=None,
|
662
630
|
)
|
663
631
|
|
@@ -667,7 +635,7 @@ class CareofTestMessage(Packet):
|
|
667
635
|
|
668
636
|
|
669
637
|
@schema_final
|
670
|
-
class BindingUpdateMessage(Packet):
|
638
|
+
class BindingUpdateMessage(Packet, code=Enum_Packet.Binding_Update):
|
671
639
|
"""Header schema for MH Binding Update (BU) messages."""
|
672
640
|
|
673
641
|
#: Sequence number.
|
@@ -686,7 +654,7 @@ class BindingUpdateMessage(Packet):
|
|
686
654
|
length=lambda pkt: pkt['__length__'],
|
687
655
|
base_schema=Option,
|
688
656
|
type_name='type',
|
689
|
-
registry=
|
657
|
+
registry=Option.registry,
|
690
658
|
eool=None,
|
691
659
|
)
|
692
660
|
|
@@ -696,7 +664,7 @@ class BindingUpdateMessage(Packet):
|
|
696
664
|
|
697
665
|
|
698
666
|
@schema_final
|
699
|
-
class BindingAcknowledgementMessage(Packet):
|
667
|
+
class BindingAcknowledgementMessage(Packet, code=Enum_Packet.Binding_Acknowledgement):
|
700
668
|
"""Header schema for MH Binding Acknowledgement (BA) messages."""
|
701
669
|
|
702
670
|
#: Status.
|
@@ -714,7 +682,7 @@ class BindingAcknowledgementMessage(Packet):
|
|
714
682
|
length=lambda pkt: pkt['__length__'],
|
715
683
|
base_schema=Option,
|
716
684
|
type_name='type',
|
717
|
-
registry=
|
685
|
+
registry=Option.registry,
|
718
686
|
eool=None,
|
719
687
|
)
|
720
688
|
|
@@ -724,7 +692,7 @@ class BindingAcknowledgementMessage(Packet):
|
|
724
692
|
|
725
693
|
|
726
694
|
@schema_final
|
727
|
-
class BindingErrorMessage(Packet):
|
695
|
+
class BindingErrorMessage(Packet, code=Enum_Packet.Binding_Error):
|
728
696
|
"""Header schema for MH Binding Error (BE) messages."""
|
729
697
|
|
730
698
|
#: Status.
|
@@ -738,10 +706,13 @@ class BindingErrorMessage(Packet):
|
|
738
706
|
length=lambda pkt: pkt['__length__'],
|
739
707
|
base_schema=Option,
|
740
708
|
type_name='type',
|
741
|
-
registry=
|
709
|
+
registry=Option.registry,
|
742
710
|
eool=None,
|
743
711
|
)
|
744
712
|
|
745
713
|
if TYPE_CHECKING:
|
746
714
|
def __init__(self, status: 'Enum_BindingError', home: 'IPv6Address | str | int | bytes',
|
747
715
|
options: 'list[Option | bytes]') -> 'None': ...
|
716
|
+
|
717
|
+
|
718
|
+
# TODO: Implement other message types.
|