laforge has submitted this change. ( https://gerrit.osmocom.org/c/mncc-python/+/36322?usp=email )
(
3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: Adjust mncc_sock.py to MNCC v7 introducing sockaddr_storage
......................................................................
Adjust mncc_sock.py to MNCC v7 introducing sockaddr_storage
It seems that 4 years ago in 2020 we merged Change-Id
Iab17f09380d7cd914cf85746b794c6c04ec7de43 to add MNCCv7 support, but
never actually tested mncc_sock.py ever since, as it still tries to
unconditionally access the 'ip' and 'port' members of the message,
which no longer exist due to the introduction of sockaddr_storage.
Working with sockaddr_storage is a bit nasty as it contains
double-underscores in the __ss_padding member, which means ctypes/python
will make it a private member that we cannot access. Work around this
with a small sed-script that removes the underscores from the
clang2py-generated python source code.
Change-Id: I3aa267a866ffaa54e7d71c19231adc78d3831169
---
M mncc.py
M mncc_sock.py
M regen-mncc-py.sh
3 files changed, 55 insertions(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, approved; Verified
pespin: Looks good to me, but someone else must approve
fixeria: Looks good to me, but someone else must approve
diff --git a/mncc.py b/mncc.py
index 94ace48..627ef38 100644
--- a/mncc.py
+++ b/mncc.py
@@ -589,7 +589,7 @@
struct_sockaddr_storage._pack_ = 1 # source:False
struct_sockaddr_storage._fields_ = [
('ss_family', ctypes.c_uint16),
- ('__ss_padding', ctypes.c_char * 118),
+ ('ss_padding', ctypes.c_char * 118),
('__ss_align', ctypes.c_uint64),
]
diff --git a/mncc_sock.py b/mncc_sock.py
index 79e2346..8918c3a 100644
--- a/mncc_sock.py
+++ b/mncc_sock.py
@@ -65,7 +65,39 @@
else:
return "(???)"
+def pad(x, l):
+ if len(x) < l:
+ return x + (l - len(x)) * b'\x00'
+ else:
+ return x
+
class mncc_rtp_msg(mncc.struct_gsm_mncc_rtp, mncc_msg_common):
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ # we have to do this here to make sure our setters below are used
+ if 'ip' in kwargs:
+ self.ip = kwargs['ip']
+ if 'port' in kwargs:
+ self.port = kwargs['port']
+
+ @property
+ def ip(self):
+ assert self.addr.ss_family == 2
+ return int.from_bytes(self.addr.ss_padding[2:6], 'big')
+ @ip.setter
+ def ip(self, val):
+ self.addr.ss_family = 2
+ val = pad(self.addr.ss_padding[:2], 2) + val.to_bytes(4, 'big') + self.addr.ss_padding[6:]
+ self.addr.ss_padding = val
+
+ @property
+ def port(self):
+ return int.from_bytes(self.addr.ss_padding[:2], 'big')
+ @port.setter
+ def port(self, val):
+ self.addr.ss_family = 2
+ self.addr.ss_padding = val.to_bytes(2, 'big') + self.addr.ss_padding[2:]
+
def __str__(self):
return 'mncc_rtp_msg(type=0x%04x, callref=%u, ip=%x, port=%u)' % (self.msg_type, self.callref, self.ip, self.port)
def __unicode__(self):
diff --git a/regen-mncc-py.sh b/regen-mncc-py.sh
index 08a92f1..4f9e3f3 100755
--- a/regen-mncc-py.sh
+++ b/regen-mncc-py.sh
@@ -4,3 +4,4 @@
echo
clang2py -k ems -o mncc.py mncc.h
+sed -e 's/__ss_padding/ss_padding/' -i mncc.py
--
To view, visit https://gerrit.osmocom.org/c/mncc-python/+/36322?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: mncc-python
Gerrit-Branch: master
Gerrit-Change-Id: I3aa267a866ffaa54e7d71c19231adc78d3831169
Gerrit-Change-Number: 36322
Gerrit-PatchSet: 4
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: laforge.
Hello fixeria, jolly,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/mncc-python/+/36321?usp=email
to look at the new patch set (#5).
The following approvals got outdated and were removed:
Verified+1 by laforge
The change is no longer submittable: Verified is unsatisfied now.
Change subject: Update MNCC with LLC+HLC support
......................................................................
Update MNCC with LLC+HLC support
... as introduced in osmo-msc Change-Id I15f5afcf069ee6c1c4641108ceacc837bee311b5
Change-Id: Ic318656b778ed1ce115d8e60b0dce4ef75ed0a2c
---
M mncc.h
M mncc.py
2 files changed, 80 insertions(+), 20 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/mncc-python refs/changes/21/36321/5
--
To view, visit https://gerrit.osmocom.org/c/mncc-python/+/36321?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: mncc-python
Gerrit-Branch: master
Gerrit-Change-Id: Ic318656b778ed1ce115d8e60b0dce4ef75ed0a2c
Gerrit-Change-Number: 36321
Gerrit-PatchSet: 5
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newpatchset
Attention is currently required from: laforge, osmith.
Hello fixeria, osmith, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/mncc-python/+/36319?usp=email
to look at the new patch set (#5).
The following approvals got outdated and were removed:
Verified+1 by laforge
The change is no longer submittable: Verified is unsatisfied now.
Change subject: port over ctypeslib2
......................................................................
port over ctypeslib2
After many years without ctypeslib maintenance, there's finally a
ctypeslib2 for python3.x
Instead of the crude gcc2xml hack it uses libclang to generate python
directly from the C.
Change-Id: I9efd56623ebeabef4317356a05484a620a3a91cc
---
M gsm_call_fsm.py
M mncc.h
M mncc.py
M mncc_sock.py
M regen-mncc-py.sh
5 files changed, 634 insertions(+), 1,726 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/mncc-python refs/changes/19/36319/5
--
To view, visit https://gerrit.osmocom.org/c/mncc-python/+/36319?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: mncc-python
Gerrit-Branch: master
Gerrit-Change-Id: I9efd56623ebeabef4317356a05484a620a3a91cc
Gerrit-Change-Number: 36319
Gerrit-PatchSet: 5
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newpatchset
Attention is currently required from: laforge, osmith.
Hello fixeria, osmith, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/mncc-python/+/36320?usp=email
to look at the new patch set (#5).
The following approvals got outdated and were removed:
Verified+1 by laforge
The change is no longer submittable: Verified is unsatisfied now.
Change subject: update to MNCC V8 support
......................................................................
update to MNCC V8 support
This updates the mncc.h to V8 with GCR support, as introduced
in Change-ID I705c860e51637b4537cad65a330ecbaaca96dd5b of osmo-msc
Change-Id: Ia27956e42c6c2f494d59b89f42345462c86b10d2
---
M mncc.h
M mncc.py
2 files changed, 37 insertions(+), 18 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/mncc-python refs/changes/20/36320/5
--
To view, visit https://gerrit.osmocom.org/c/mncc-python/+/36320?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: mncc-python
Gerrit-Branch: master
Gerrit-Change-Id: Ia27956e42c6c2f494d59b89f42345462c86b10d2
Gerrit-Change-Number: 36320
Gerrit-PatchSet: 5
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newpatchset
Attention is currently required from: laforge.
Hello fixeria, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/mncc-python/+/36322?usp=email
to look at the new patch set (#4).
The following approvals got outdated and were removed:
Verified+1 by laforge
The change is no longer submittable: Verified is unsatisfied now.
Change subject: Adjust mncc_sock.py to MNCC v7 introducing sockaddr_storage
......................................................................
Adjust mncc_sock.py to MNCC v7 introducing sockaddr_storage
It seems that 4 years ago in 2020 we merged Change-Id
Iab17f09380d7cd914cf85746b794c6c04ec7de43 to add MNCCv7 support, but
never actually tested mncc_sock.py ever since, as it still tries to
unconditionally access the 'ip' and 'port' members of the message,
which no longer exist due to the introduction of sockaddr_storage.
Working with sockaddr_storage is a bit nasty as it contains
double-underscores in the __ss_padding member, which means ctypes/python
will make it a private member that we cannot access. Work around this
with a small sed-script that removes the underscores from the
clang2py-generated python source code.
Change-Id: I3aa267a866ffaa54e7d71c19231adc78d3831169
---
M mncc.py
M mncc_sock.py
M regen-mncc-py.sh
3 files changed, 55 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/mncc-python refs/changes/22/36322/4
--
To view, visit https://gerrit.osmocom.org/c/mncc-python/+/36322?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: mncc-python
Gerrit-Branch: master
Gerrit-Change-Id: I3aa267a866ffaa54e7d71c19231adc78d3831169
Gerrit-Change-Number: 36322
Gerrit-PatchSet: 4
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newpatchset