This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.
Neels Hofmeyr nhofmeyr at sysmocom.deHi osmo_sock experts, I'm currently looking at making the osmo-hnbgw interface addresses configurable, an I came across a detail. This is not really pressing, but while I'm at it I might as well cover all of the addresses. So far I see in osmo-iuh's hnbgw.c the local address osmo-hnbgw uses to accept Iuh connections from a 3G cell, and the remote addresses of IuCS and IuPS, each passed to osmo_sock_init(): 3G cell -------> 1.2.3.4 OSMO-HNBGW IuPS-local? -------> 10.9.8.7 OSMO-SGSN So we tell one socket to listen on local 1.2.3.4 for Iuh. We tell another to send IuPS to 10.9.8.7. But how would I tell the IuPS to use a given local interface 1.2.3.5 to contact the SGSN's address? Would I bind() to a given local IP address and connect() to the remote one? I must admit that the details are not 100% clear to me. AFAIK it can be important to set a local IP address and port to send from. So if there's something I don't understand yet I would appreciate a hint. Anyway, in osmo_sock_init, I see: if ((flags & (OSMO_SOCK_F_BIND | OSMO_SOCK_F_CONNECT)) == (OSMO_SOCK_F_BIND | OSMO_SOCK_F_CONNECT)) { fprintf(stderr, "invalid: both bind and connect flags set:" " %s:%u\n", host, port); return -EINVAL; } Should we have another osmo_sock_init that can set up a socket like this code I found somewhere at sysmocom to define both ends of a connection? fd = socket(AF_INET, SOCK_DGRAM, 0); if (fd < 0) { printf("socket() failed: %s\n", strerror(errno)); return -1; } memset(&bindaddr, 0, sizeof(bindaddr)); bindaddr.sin_family = AF_INET; bindaddr.sin_port = htons(lport); rc = inet_pton(AF_INET, baddr, &(bindaddr.sin_addr)); if (rc != 1) { printf("inet_pton() failed with %i: %s\n", rc, strerror(errno)); return -1; } rc = bind(fd, (struct sockaddr *)&bindaddr, sizeof(bindaddr)); if (rc < 0) { printf("bind() failed: %s\n", strerror(errno)); return -1; } memset(&destaddr, 0, sizeof(destaddr)); destaddr.sin_family = AF_INET; destaddr.sin_port = htons(dport); rc = inet_pton(AF_INET, dest, &(destaddr.sin_addr)); if (rc != 1) { printf("inet_pton() failed with %i: %s\n", rc, strerror(errno)); return -1; } rc = connect(fd, (const struct sockaddr *)&destaddr, sizeof(destaddr)); if (rc < 0) { printf("connect() failed: %s\n", strerror(errno)); return -1; } rc = send(fd, buf, len, 0); if (rc != len) { printf("send() failed\n"); return -1; } Thanks, ~Neels -- - Neels Hofmeyr <nhofmeyr at sysmocom.de> http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Alt-Moabit 93 * 10559 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Geschäftsführer / Managing Directors: Harald Welte -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.osmocom.org/pipermail/openbsc/attachments/20161013/5570f016/attachment.bin>