lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

February 2024

  • 1 participants
  • 1748 discussions
[M] Change in pysim[master]: saip: profile processing; merging with templates
by laforge 19 Feb '24

19 Feb '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/35733?usp=email ) Change subject: saip: profile processing; merging with templates ...................................................................... saip: profile processing; merging with templates Introduce code that makes use of the information from pySim.esim.saip.templates to build a complete representation of a file by merging the template with the ProfileElement decribing the file. This happens within the class pySim.esim.saip.File, whose instances are created from ProfileElement + Template. Change-Id: Ib1674920e488ade9597cb039e4e2047dcbc7864e --- M pySim/esim/saip/__init__.py M pySim/esim/saip/validation.py 2 files changed, 173 insertions(+), 0 deletions(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py index 7bb2172..fb064a1 100644 --- a/pySim/esim/saip/__init__.py +++ b/pySim/esim/saip/__init__.py @@ -16,16 +16,117 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import abc +import io from typing import Tuple, List, Optional, Dict, Union import asn1tools from pySim.utils import bertlv_parse_tag, bertlv_parse_len +from pySim.ts_102_221 import FileDescriptor +from pySim.construct import build_construct from pySim.esim import compile_asn1_subdir +import pySim.esim.saip.templates as templates asn1 = compile_asn1_subdir('saip') +class File: + """Internal representation of a file in a profile filesystem.""" + def __init__(self, pename: str, l: Optional[List[Tuple]] = None, template: Optional[templates.FileTemplate] = None): + self.pe_name = pename + self.template = template + self.fileDescriptor = {} + self.stream = None + # apply some defaults from profile + if self.template: + self.from_template(self.template) + print("after template: %s" % repr(self)) + if l: + self.from_tuples(l) + + def from_template(self, template: templates.FileTemplate): + """Determine defaults for file based on given FileTemplate.""" + fdb_dec = {} + self.rec_len = None + if template.fid: + self.fileDescriptor['fileID'] = template.fid.to_bytes(2, 'big') + if template.sfi: + self.fileDescriptor['shortEFID'] = bytes([template.sfi]) + if template.arr: + self.fileDescriptor['securityAttributesReferenced'] = bytes([template.arr]) + # All the files defined in the templates shall have, by default, shareable/not-shareable bit in the file descriptor set to "shareable". + fdb_dec['shareable'] = True + if template.file_type in ['LF', 'CY']: + fdb_dec['file_type'] = 'working_ef' + if template.rec_len: + self.record_len = template.rec_len + if template.nb_rec and template.rec_len: + self.fileDescriptor['efFileSize'] = (template.nb_rec * template.rec_len).to_bytes(2, 'big') # FIXME + if template.file_type == 'LF': + fdb_dec['structure'] = 'linear_fixed' + elif template.file_type == 'CY': + fdb_dec['structure'] = 'cyclic' + elif template.file_type in ['TR', 'BT']: + fdb_dec['file_type'] = 'working_ef' + if template.file_size: + self.fileDescriptor['efFileSize'] = template.file_size.to_bytes(2, 'big') # FIXME + if template.file_type == 'BT': + fdb_dec['structure'] = 'ber_tlv' + elif template.file_type == 'TR': + fdb_dec['structure'] = 'transparent' + elif template.file_type in ['MF', 'DF', 'ADF']: + fdb_dec['file_type'] = 'df' + fdb_dec['structure'] = 'no_info_given' + # build file descriptor based on above input data + fd_dict = {'file_descriptor_byte': fdb_dec} + if self.rec_len: + fd_dict['record_len'] = self.rec_len + self.fileDescriptor['fileDescriptor'] = build_construct(FileDescriptor._construct, fd_dict) + # FIXME: default_val + # FIXME: high_update + # FIXME: params? + + def from_tuples(self, l:List[Tuple]): + """Parse a list of fileDescriptor, fillFileContent, fillFileOffset tuples into this instance.""" + def get_fileDescriptor(l:List[Tuple]): + for k, v in l: + if k == 'fileDescriptor': + return v + fd = get_fileDescriptor(l) + if not fd: + raise ValueError("No fileDescriptor found") + self.fileDescriptor.update(dict(fd)) + self.stream = self.linearize_file_content(l) + + def to_tuples(self) -> List[Tuple]: + """Generate a list of fileDescriptor, fillFileContent, fillFileOffset tuples into this instance.""" + raise NotImplementedError + + @staticmethod + def linearize_file_content(l: List[Tuple]) -> Optional[io.BytesIO]: + """linearize a list of fillFileContent + fillFileOffset tuples.""" + stream = io.BytesIO() + for k, v in l: + if k == 'doNotCreate': + return None + if k == 'fileDescriptor': + pass + elif k == 'fillFileOffset': + stream.write(b'\xff' * v) + elif k == 'fillFileContent': + stream.write(v) + else: + return ValueError("Unknown key '%s' in tuple list" % k) + return stream + + def __str__(self) -> str: + return "File(%s)" % self.pe_name + + def __repr__(self) -> str: + return "File(%s): %s" % (self.pe_name, self.fileDescriptor) + class ProfileElement: + FILE_BEARING = ['mf', 'cd', 'telecom', 'usim', 'opt-usim', 'isim', 'opt-isim', 'phonebook', 'gsm-access', + 'csim', 'opt-csim', 'eap', 'df-5gs', 'df-saip', 'df-snpn', 'df-5gprose', 'iot', 'opt-iot'] def _fixup_sqnInit_dec(self) -> None: """asn1tools has a bug when working with SEQUENCE OF that have DEFAULT values. Let's work around this.""" @@ -59,6 +160,29 @@ # work around asn1tools bug regarding DEFAULT for a SEQUENCE OF self._fixup_sqnInit_dec() + @property + def header_name(self) -> str: + # unneccessarry compliaction by inconsistent naming :( + if self.type.startswith('opt-'): + return self.type.replace('-','') + '-header' + else: + return self.type + '-header' + + @property + def header(self): + return self.decoded.get(self.header_name, None) + + @property + def templateID(self): + return self.decoded.get('templateID', None) + + @property + def files(self): + """Return dict of decoded 'File' ASN.1 items.""" + if not self.type in self.FILE_BEARING: + return {} + return {k:v for (k,v) in self.decoded.items() if k not in ['templateID', self.header_name]} + @classmethod def from_der(cls, der: bytes) -> 'ProfileElement': """Construct an instance from given raw, DER encoded bytes.""" diff --git a/pySim/esim/saip/validation.py b/pySim/esim/saip/validation.py index 2acc413..acf1864 100644 --- a/pySim/esim/saip/validation.py +++ b/pySim/esim/saip/validation.py @@ -94,3 +94,36 @@ raise ProfileError('profile-a-x25519 mandatory, but no usim or isim') if 'profile-a-p256' in m_svcs and not not ('usim' in m_svcs or 'isim' in m_svcs): raise ProfileError('profile-a-p256 mandatory, but no usim or isim') + +FileChoiceList = List[Tuple] + +class FileError(ProfileError): + pass + +class FileConstraintChecker: + def check(self, l: FileChoiceList): + for name in dir(self): + if name.startswith('check_'): + method = getattr(self, name) + method(l) + +class FileCheckBasicStructure(FileConstraintChecker): + def check_seqence(self, l: FileChoiceList): + by_type = {} + for k, v in l: + if k in by_type: + by_type[k].append(v) + else: + by_type[k] = [v] + if 'doNotCreate' in by_type: + if len(l) != 1: + raise FileError("doNotCreate must be the only element") + if 'fileDescriptor' in by_type: + if len(by_type['fileDescriptor']) != 1: + raise FileError("fileDescriptor must be the only element") + if l[0][0] != 'fileDescriptor': + raise FileError("fileDescriptor must be the first element") + + def check_forbidden(self, l: FileChoiceList): + """Perform checks for forbidden parameters as described in Section 8.3.3.""" + -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35733?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ib1674920e488ade9597cb039e4e2047dcbc7864e Gerrit-Change-Number: 35733 Gerrit-PatchSet: 4 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
[S] Change in pysim[master]: saip: improve docstrings
by laforge 19 Feb '24

19 Feb '24
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/36013?usp=email ) Change subject: saip: improve docstrings ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/36013?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I0ca82a434e0bde3dc1b304dfc179d568588631c6 Gerrit-Change-Number: 36013 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Mon, 19 Feb 2024 11:02:12 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in pysim[master]: pylint: esim/saip/validation.py
by laforge 19 Feb '24

19 Feb '24
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/36012?usp=email ) Change subject: pylint: esim/saip/validation.py ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/36012?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Idcc9871d6a7068e8aedbd8cd81f4156918af5e50 Gerrit-Change-Number: 36012 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Mon, 19 Feb 2024 11:02:10 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in pysim[master]: pylint: esim/saip/__init__.py
by laforge 19 Feb '24

19 Feb '24
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/36011?usp=email ) Change subject: pylint: esim/saip/__init__.py ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/36011?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I12ef46c847d197fb0c01e624818aeac14eb99e31 Gerrit-Change-Number: 36011 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Mon, 19 Feb 2024 11:02:07 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in pysim[master]: saip: profile processing; merging with templates
by laforge 19 Feb '24

19 Feb '24
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/35733?usp=email ) Change subject: saip: profile processing; merging with templates ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35733?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ib1674920e488ade9597cb039e4e2047dcbc7864e Gerrit-Change-Number: 35733 Gerrit-PatchSet: 4 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Mon, 19 Feb 2024 11:02:05 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in pysim[master]: utils: Add function to verify Luhn check digits and to sanitize ICCIDs
by laforge 19 Feb '24

19 Feb '24
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/36009?usp=email ) Change subject: utils: Add function to verify Luhn check digits and to sanitize ICCIDs ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/36009?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I7812420cf97984dd834fca6a38c5e5ae113243cb Gerrit-Change-Number: 36009 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Mon, 19 Feb 2024 11:01:49 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in docker-playground[master]: ttcn3-ggsn-test/fragment.config: add NET_NS, VETH
by osmith 19 Feb '24

19 Feb '24
osmith has submitted this change. ( https://gerrit.osmocom.org/c/docker-playground/+/35992?usp=email ) Change subject: ttcn3-ggsn-test/fragment.config: add NET_NS, VETH ...................................................................... ttcn3-ggsn-test/fragment.config: add NET_NS, VETH Build the kernel with NET_NS and VETH, so libgtpnl's qemu tests can download the kernel and use it. Related: OS#1952 Related: libgtpnl Ibf75514b866fffb11e90529e4705f126b23d7415 Change-Id: I6e893b64718f853b8595de36c090a1326db34419 --- M ttcn3-ggsn-test/fragment.config 1 file changed, 19 insertions(+), 0 deletions(-) Approvals: fixeria: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/ttcn3-ggsn-test/fragment.config b/ttcn3-ggsn-test/fragment.config index 8a72dc2..b5a07b5 100644 --- a/ttcn3-ggsn-test/fragment.config +++ b/ttcn3-ggsn-test/fragment.config @@ -266,3 +266,8 @@ CONFIG_X86_HV_CALLBACK_VECTOR=y # CONFIG_X86_X2APIC is not set # CONFIG_XEN is not set + +# For libgtpnl's qemu tests +CONFIG_NAMESPACES=y +CONFIG_NET_NS=y +CONFIG_VETH=y -- To view, visit https://gerrit.osmocom.org/c/docker-playground/+/35992?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-Change-Id: I6e893b64718f853b8595de36c090a1326db34419 Gerrit-Change-Number: 35992 Gerrit-PatchSet: 2 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in docker-playground[master]: ttcn3-ggsn-test/fragment.config: add NET_NS, VETH
by fixeria 19 Feb '24

19 Feb '24
Attention is currently required from: dexter, lynxis lazus, osmith. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/docker-playground/+/35992?usp=email ) Change subject: ttcn3-ggsn-test/fragment.config: add NET_NS, VETH ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/docker-playground/+/35992?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-Change-Id: I6e893b64718f853b8595de36c090a1326db34419 Gerrit-Change-Number: 35992 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Mon, 19 Feb 2024 09:39:16 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in libgtpnl[master]: gtp-link: allow to specify listener address
by osmith 19 Feb '24

19 Feb '24
osmith has submitted this change. ( https://gerrit.osmocom.org/c/libgtpnl/+/35997?usp=email ) Change subject: gtp-link: allow to specify listener address ...................................................................... gtp-link: allow to specify listener address gtp-link add <device> <family> [--sgsn] [<address>] Allow to specify listener address, if not specified use ANY_ADDRESS. Change-Id: I7a9b64393fd68d58c2c158c0e85c0470be007f63 --- M tools/gtp-link.c 1 file changed, 67 insertions(+), 14 deletions(-) Approvals: pespin: Looks good to me, but someone else must approve osmith: Looks good to me, approved Jenkins Builder: Verified lynxis lazus: Looks good to me, but someone else must approve diff --git a/tools/gtp-link.c b/tools/gtp-link.c index 325a45f..0881f15 100644 --- a/tools/gtp-link.c +++ b/tools/gtp-link.c @@ -39,6 +39,7 @@ #include <linux/if_link.h> #include <libgtpnl/gtpnl.h> +#include <errno.h> struct gtp_server_sock { int family; @@ -55,20 +56,26 @@ struct sockaddr_in6 in6; } fd2; } sockaddr; + union { + struct in_addr v4; + struct in6_addr v6; + } addr; }; -static void setup_sockaddr_in(struct sockaddr_in *sockaddr, uint16_t port) +static void setup_sockaddr_in(struct sockaddr_in *sockaddr, struct in_addr *in, + uint16_t port) { sockaddr->sin_family = AF_INET; sockaddr->sin_port = htons(port); - sockaddr->sin_addr.s_addr = INADDR_ANY; + sockaddr->sin_addr = *in; } -static void setup_sockaddr_in6(struct sockaddr_in6 *sockaddr, uint16_t port) +static void setup_sockaddr_in6(struct sockaddr_in6 *sockaddr, struct in6_addr *in6, + uint16_t port) { sockaddr->sin6_family = AF_INET6; sockaddr->sin6_port = htons(port); - sockaddr->sin6_addr = in6addr_any; + sockaddr->sin6_addr = *in6; } static int setup_socket(struct gtp_server_sock *gtp_sock, int family) @@ -80,8 +87,6 @@ if (fd1 < 0 || fd2 < 0) return -1; - memset(gtp_sock, 0, sizeof(*gtp_sock)); - gtp_sock->family = family; gtp_sock->fd1 = fd1; gtp_sock->fd2 = fd2; @@ -89,13 +94,17 @@ switch (family) { case AF_INET: gtp_sock->len = sizeof(struct sockaddr_in); - setup_sockaddr_in(&gtp_sock->sockaddr.fd1.in, 3386); - setup_sockaddr_in(&gtp_sock->sockaddr.fd2.in, 2152); + setup_sockaddr_in(&gtp_sock->sockaddr.fd1.in, + &gtp_sock->addr.v4, 3386); + setup_sockaddr_in(&gtp_sock->sockaddr.fd2.in, + &gtp_sock->addr.v4, 2152); break; case AF_INET6: gtp_sock->len = sizeof(struct sockaddr_in6); - setup_sockaddr_in6(&gtp_sock->sockaddr.fd1.in6, 3386); - setup_sockaddr_in6(&gtp_sock->sockaddr.fd2.in6, 2152); + setup_sockaddr_in6(&gtp_sock->sockaddr.fd1.in6, + &gtp_sock->addr.v6, 3386); + setup_sockaddr_in6(&gtp_sock->sockaddr.fd2.in6, + &gtp_sock->addr.v6, 2152); if (setsockopt(fd1, IPPROTO_IPV6, IPV6_V6ONLY, &one, sizeof(one)) < 0) perror("setsockopt IPV6_V6ONLY: "); if (setsockopt(fd2, IPPROTO_IPV6, IPV6_V6ONLY, &one, sizeof(one)) < 0) @@ -111,9 +120,12 @@ char buf[MNL_SOCKET_BUFFER_SIZE]; struct gtp_server_sock gtp_sock; int ret, sgsn_mode = 0, family; + const char *addr = NULL; + + memset(&gtp_sock, 0, sizeof(gtp_sock)); if (argc < 3) { - printf("Usage: %s add <device> <family> [--sgsn]\n", argv[0]); + printf("Usage: %s add <device> <family> [--sgsn] [<address>]\n", argv[0]); printf(" %s del <device>\n", argv[0]); exit(EXIT_FAILURE); } @@ -126,12 +138,23 @@ return 0; } else if (!strcmp(argv[1], "add")) { if (argc < 4) { - printf("Usage: %s add <device> <family> [--sgsn]\n", argv[0]); + printf("Usage: %s add <device> <family> [--sgsn] [<address>]\n", argv[0]); exit(EXIT_FAILURE); } - if (argc == 5 && !strcmp(argv[4], "--sgsn")) - sgsn_mode = 1; + if (argc == 5) { + if (!strcmp(argv[4], "--sgsn")) + sgsn_mode = 1; + else + addr = argv[4]; + } + + if (argc == 6) { + if (!strcmp(argv[4], "--sgsn")) + sgsn_mode = 1; + + addr = argv[5]; + } } if (!strcmp(argv[3], "ip")) @@ -144,6 +167,23 @@ exit(EXIT_FAILURE); } + if (addr) { + if (!inet_pton(family, addr, &gtp_sock.addr)) { + fprintf(stderr, "invalid listener address: %s\n", + strerror(errno)); + exit(EXIT_FAILURE); + } + } else { + switch (family) { + case AF_INET: + gtp_sock.addr.v4.s_addr = INADDR_ANY; + break; + case AF_INET6: + gtp_sock.addr.v6 = in6addr_any; + break; + } + } + if (setup_socket(&gtp_sock, family) < 0) { perror("socket"); exit(EXIT_FAILURE); -- To view, visit https://gerrit.osmocom.org/c/libgtpnl/+/35997?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libgtpnl Gerrit-Branch: master Gerrit-Change-Id: I7a9b64393fd68d58c2c158c0e85c0470be007f63 Gerrit-Change-Number: 35997 Gerrit-PatchSet: 3 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in libgtpnl[master]: gtp-link: allow to specify listener address
by osmith 19 Feb '24

19 Feb '24
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/libgtpnl/+/35997?usp=email ) Change subject: gtp-link: allow to specify listener address ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libgtpnl/+/35997?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libgtpnl Gerrit-Branch: master Gerrit-Change-Id: I7a9b64393fd68d58c2c158c0e85c0470be007f63 Gerrit-Change-Number: 35997 Gerrit-PatchSet: 3 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Mon, 19 Feb 2024 08:12:11 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • ...
  • 175
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.