mobile: introduce JPN and ANSI variants of MTP3 in SIGTRAN
This commit is contained in:
parent
a6b98e9b52
commit
4949c3d5df
|
@ -582,15 +582,18 @@ MTP3SubServInd_dict = {
|
|||
MTP3ServInd_dict = {
|
||||
0 : 'Signalling network management messages',
|
||||
1 : 'Signalling network testing and maintenance messages',
|
||||
2 : 'Signaling Network Testing and Maintenance Special Messages (ANSI)',
|
||||
3 : 'Signalling Connection Control Part',
|
||||
4 : 'Telephone User Part',
|
||||
5 : 'ISDN User Part',
|
||||
6 : 'DUP (call and circuit-related messages)',
|
||||
7 : 'DUP (facility registration and cancellation)',
|
||||
8 : 'Reserved for MTP Testing User Part',
|
||||
9 : 'Broadband ISDN User Part',
|
||||
10: 'Satellite ISDN User Part',
|
||||
}
|
||||
|
||||
|
||||
class MTP3(Envelope):
|
||||
# ITU-T Q.2210, peer-to-peer info of user parts
|
||||
|
||||
|
@ -608,6 +611,9 @@ class MTP3(Envelope):
|
|||
Uint16('OPC', trans=True)
|
||||
)
|
||||
|
||||
# additional class attribute for the size in bytes
|
||||
_SZ = 5
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
Envelope.__init__(self, *args, **kwargs)
|
||||
self[9].set_valauto( lambda: self[3].get_val() + (self[5].get_val()<<8))
|
||||
|
@ -630,3 +636,37 @@ class MTP3(Envelope):
|
|||
if vals:
|
||||
Envelope.set_val(self, vals)
|
||||
|
||||
|
||||
class MTP3_JPN(Envelope):
|
||||
# MTP3 Japanese variant : DPC / OPC are on 16 bits and SLS is on 8 bits
|
||||
|
||||
_GEN = (
|
||||
Uint('SubServiceInd', bl=2, dic=MTP3SubServInd_dict),
|
||||
Uint('SubServiceSpare', bl=2),
|
||||
Uint('ServiceInd', bl=4, dic=MTP3ServInd_dict),
|
||||
Uint16('DPC'),
|
||||
Uint16('OPC'),
|
||||
Uint('SLSSpare', bl=4),
|
||||
Uint('SLS', bl=4)
|
||||
)
|
||||
|
||||
# additional class attribute for the size in bytes
|
||||
_SZ = 6
|
||||
|
||||
|
||||
class MTP3_ANSI(Envelope):
|
||||
# MTP3 ANSI T1.111.1 variant
|
||||
# Seems Chinese variant format has the same layout (with priority being spare)
|
||||
|
||||
_GEN = (
|
||||
Uint('SubServiceInd', bl=2, dic=MTP3SubServInd_dict),
|
||||
Uint('SubServicePriority', bl=2),
|
||||
Uint('ServiceInd', bl=4, dic=MTP3ServInd_dict),
|
||||
Uint24('DPC'),
|
||||
Uint24('OPC'),
|
||||
Uint8('SLS')
|
||||
)
|
||||
|
||||
# additional class attribute for the size in bytes
|
||||
_SZ = 8
|
||||
|
||||
|
|
Loading…
Reference in New Issue