Projects
osmocom:master
libosmo-netif
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 88
View file
libosmo-netif.spec
Changed
@@ -14,13 +14,13 @@ Name: libosmo-netif Requires: osmocom-master -Version: 1.4.0.32.c17d +Version: 1.4.0.35.6987 Release: 0 Summary: Osmocom library for muxed audio License: GPL-2.0-or-later Group: Productivity/Telephony/Utilities URL: https://osmocom.org/projects/libosmo-netif -Source: libosmo-netif_1.4.0.32.c17d.tar.xz +Source: libosmo-netif_1.4.0.35.6987.tar.xz Source1: rpmlintrc BuildRequires: automake BuildRequires: libtool >= 2
View file
commit_69878f30fa81c2570d52bc4a05604563d75848c1.txt
Added
View file
commit_c17dc5f55926ef88acb096f6af4356ff4b9dfb3f.txt
Deleted
View file
libosmo-netif_1.4.0.32.c17d.dsc -> libosmo-netif_1.4.0.35.6987.dsc
Changed
@@ -2,7 +2,7 @@ Source: libosmo-netif Binary: libosmonetif11, libosmo-netif-dev, libosmo-netif-doc, libosmo-netif-dbg Architecture: any all -Version: 1.4.0.32.c17d +Version: 1.4.0.35.6987 Maintainer: Osmocom team <openbsc@lists.osmocom.org> Homepage: https://projects.osmocom.org/projects/libosmo-netif Standards-Version: 3.9.6 @@ -15,8 +15,8 @@ libosmo-netif-doc deb doc optional arch=all libosmonetif11 deb libs optional arch=any Checksums-Sha1: - 10c9815e7b79eb4403891e9c2d15f39ba45b2f3f 191460 libosmo-netif_1.4.0.32.c17d.tar.xz + 59cf77756c8aa96e1836dd29f87fd5294559e9cc 191228 libosmo-netif_1.4.0.35.6987.tar.xz Checksums-Sha256: - 008c3f568bad7c15bcd5e4f65ce321f21ac913780ff2f479d1d0972780494e6f 191460 libosmo-netif_1.4.0.32.c17d.tar.xz + f2fc058c92cf0a5b894e6113e688567f6ae4dccbb4747b59650a91a4725c9018 191228 libosmo-netif_1.4.0.35.6987.tar.xz Files: - e9886750964d37b4af09d1772000dfc0 191460 libosmo-netif_1.4.0.32.c17d.tar.xz + 53c73e16dc925c335ca980a1af714b3f 191228 libosmo-netif_1.4.0.35.6987.tar.xz
View file
libosmo-netif_1.4.0.32.c17d.tar.xz/.tarball-version -> libosmo-netif_1.4.0.35.6987.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -1.4.0.32-c17d +1.4.0.35-6987
View file
libosmo-netif_1.4.0.32.c17d.tar.xz/TODO-RELEASE -> libosmo-netif_1.4.0.35.6987.tar.xz/TODO-RELEASE
Changed
@@ -13,3 +13,5 @@ libosmocore >1.9.0 use osmo_iofd_get_ioops() libosmo-netif added osmo_stream_srv_get_sockname() libosmo-netif update-dependency libosmocore > 1.9.0 required for I89eb519b22d21011d61a7855b2364bc3c295df82 +libosmo-netif ADD osmo_stream_srv_link_get_name(), osmo_stream_srv_get_name(), osmo_stream_cli_get_name() +libosmo-netif ADD osmo_prim_srv_link_set_name(), osmo_prim_srv_set_name() \ No newline at end of file
View file
libosmo-netif_1.4.0.32.c17d.tar.xz/debian/changelog -> libosmo-netif_1.4.0.35.6987.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -libosmo-netif (1.4.0.32.c17d) unstable; urgency=medium +libosmo-netif (1.4.0.35.6987) unstable; urgency=medium * Automatically generated changelog entry for building the Osmocom master feed - -- Osmocom OBS scripts <info@osmocom.org> Tue, 12 Mar 2024 17:36:11 +0000 + -- Osmocom OBS scripts <info@osmocom.org> Wed, 13 Mar 2024 12:01:32 +0000 libosmo-netif (1.4.0) unstable; urgency=medium
View file
libosmo-netif_1.4.0.32.c17d.tar.xz/include/osmocom/netif/prim.h -> libosmo-netif_1.4.0.35.6987.tar.xz/include/osmocom/netif/prim.h
Changed
@@ -45,6 +45,7 @@ struct osmo_prim_srv_link *osmo_prim_srv_link_alloc(void *ctx); void osmo_prim_srv_link_free(struct osmo_prim_srv_link *prim_link); +void osmo_prim_srv_link_set_name(struct osmo_prim_srv_link *prim_link, const char *name); int osmo_prim_srv_link_set_addr(struct osmo_prim_srv_link *prim_link, const char *path); const char *osmo_prim_srv_link_get_addr(struct osmo_prim_srv_link *prim_link); void osmo_prim_srv_link_set_priv(struct osmo_prim_srv_link *prim_link, void *priv); @@ -59,6 +60,7 @@ int osmo_prim_srv_send(struct osmo_prim_srv *prim_srv, struct msgb *msg); struct osmo_prim_srv_link *osmo_prim_srv_get_link(struct osmo_prim_srv *prims_srv); +void osmo_prim_srv_set_name(struct osmo_prim_srv *prim_srv, const char *name); void osmo_prim_srv_set_priv(struct osmo_prim_srv *prim_srv, void *priv); void *osmo_prim_srv_get_priv(const struct osmo_prim_srv *prim_srv); void osmo_prim_srv_close(struct osmo_prim_srv *prim_srv);
View file
libosmo-netif_1.4.0.32.c17d.tar.xz/include/osmocom/netif/stream.h -> libosmo-netif_1.4.0.35.6987.tar.xz/include/osmocom/netif/stream.h
Changed
@@ -26,6 +26,7 @@ void osmo_stream_srv_link_destroy(struct osmo_stream_srv_link *link); void osmo_stream_srv_link_set_name(struct osmo_stream_srv_link *link, const char *name); +const char *osmo_stream_srv_link_get_name(const struct osmo_stream_srv_link *link); void osmo_stream_srv_link_set_nodelay(struct osmo_stream_srv_link *link, bool nodelay); void osmo_stream_srv_link_set_addr(struct osmo_stream_srv_link *link, const char *addr); int osmo_stream_srv_link_set_addrs(struct osmo_stream_srv_link *link, const char **addr, size_t addrcnt); @@ -60,6 +61,7 @@ struct osmo_stream_srv *osmo_stream_srv_create(void *ctx, struct osmo_stream_srv_link *link, int fd, int (*read_cb)(struct osmo_stream_srv *conn), int (*closed_cb)(struct osmo_stream_srv *conn), void *data); struct osmo_stream_srv *osmo_stream_srv_create2(void *ctx, struct osmo_stream_srv_link *link, int fd, void *data); void osmo_stream_srv_set_name(struct osmo_stream_srv *conn, const char *name); +const char *osmo_stream_srv_get_name(const struct osmo_stream_srv *conn); void osmo_stream_srv_set_read_cb(struct osmo_stream_srv *conn, int (*read_cb)(struct osmo_stream_srv *conn, struct msgb *msg)); void osmo_stream_srv_set_closed_cb(struct osmo_stream_srv *conn, int (*closed_cb)(struct osmo_stream_srv *conn)); void *osmo_stream_srv_get_data(struct osmo_stream_srv *conn); @@ -84,6 +86,7 @@ struct osmo_stream_cli; void osmo_stream_cli_set_name(struct osmo_stream_cli *cli, const char *name); +const char *osmo_stream_cli_get_name(const struct osmo_stream_cli *cli); void osmo_stream_cli_set_nodelay(struct osmo_stream_cli *cli, bool nodelay); void osmo_stream_cli_set_addr(struct osmo_stream_cli *cli, const char *addr); int osmo_stream_cli_set_addrs(struct osmo_stream_cli *cli, const char **addr, size_t addrcnt);
View file
libosmo-netif_1.4.0.32.c17d.tar.xz/src/prim.c -> libosmo-netif_1.4.0.35.6987.tar.xz/src/prim.c
Changed
@@ -320,6 +320,11 @@ talloc_free(prim_srv); } +void osmo_prim_srv_set_name(struct osmo_prim_srv *prim_srv, const char *name) +{ + osmo_stream_srv_set_name(prim_srv->stream, name); +} + struct osmo_prim_srv_link *osmo_prim_srv_get_link(struct osmo_prim_srv *prim_srv) { return prim_srv->link; @@ -395,6 +400,11 @@ talloc_free(prim_link); } +void osmo_prim_srv_link_set_name(struct osmo_prim_srv_link *prim_link, const char *name) +{ + osmo_stream_srv_link_set_name(prim_link->stream, name); +} + int osmo_prim_srv_link_set_addr(struct osmo_prim_srv_link *prim_link, const char *path) { osmo_talloc_replace_string(prim_link, &prim_link->addr, path);
View file
libosmo-netif_1.4.0.32.c17d.tar.xz/src/stream_cli.c -> libosmo-netif_1.4.0.35.6987.tar.xz/src/stream_cli.c
Changed
@@ -528,6 +528,15 @@ osmo_iofd_set_name(cli->iofd, name); } +/*! \brief Retrieve name previously set on the cli object (see osmo_stream_cli_set_name()) + * \paramin cli stream_cli whose name is to be retrieved + * \returns The name to be set on cli; NULL if never set + */ +const char *osmo_stream_cli_get_name(const struct osmo_stream_cli *cli) +{ + return cli->name; +} + /*! \brief Set the remote address to which we connect * \paramin cli Stream Client to modify * \paramin addr Remote IP address
View file
libosmo-netif_1.4.0.32.c17d.tar.xz/src/stream_srv.c -> libosmo-netif_1.4.0.35.6987.tar.xz/src/stream_srv.c
Changed
@@ -28,6 +28,7 @@ #include <time.h> #include <sys/fcntl.h> #include <sys/socket.h> +#include <sys/un.h> #include <sys/ioctl.h> #include <arpa/inet.h> #include <netinet/in.h> @@ -206,6 +207,15 @@ osmo_talloc_replace_string(link, &link->name, name); } +/*! \brief Retrieve name previously set on the srv_link object (see osmo_stream_srv_link_set_name()) + * \paramin link server link whose name is to be retrieved + * \returns The name to be set on link; NULL if never set + */ +const char *osmo_stream_srv_link_get_name(const struct osmo_stream_srv_link *link) +{ + return link->name; +} + /*! \brief Set the NODELAY socket option to avoid Nagle-like behavior * Setting this to nodelay=true will automatically set the NODELAY * socket option on any socket established via this server link, before @@ -339,30 +349,57 @@ } /* Similar to osmo_sock_multiaddr_get_name_buf(), but aimed at listening sockets (only local part): */ -static char *get_local_sockname_buf(char *buf, size_t buf_len, int fd, int proto) +static char *get_local_sockname_buf(char *buf, size_t buf_len, const struct osmo_stream_srv_link *link) { - char hostbufOSMO_STREAM_MAX_ADDRSINET6_ADDRSTRLEN; - size_t num_hostbuf = ARRAY_SIZE(hostbuf); - char portbuf6; struct osmo_strbuf sb = { .buf = buf, .len = buf_len }; - bool need_more_bufs; int rc; - rc = osmo_sock_multiaddr_get_ip_and_port(fd, proto, &hostbuf00, - &num_hostbuf, sizeof(hostbuf0), - portbuf, sizeof(portbuf), true); - if (rc < 0) - return NULL; - - need_more_bufs = num_hostbuf > ARRAY_SIZE(hostbuf); - if (need_more_bufs) - num_hostbuf = ARRAY_SIZE(hostbuf); - OSMO_STRBUF_APPEND(sb, osmo_multiaddr_ip_and_port_snprintf, - &hostbuf00, num_hostbuf, sizeof(hostbuf0), portbuf); - if (need_more_bufs) - OSMO_STRBUF_PRINTF(sb, "<need-more-bufs!>"); + if (buf_len > 0) + buf0 = '\0'; - return buf; + switch (link->sk_domain) { + case AF_UNSPEC: + /* we assume INET(6) by default upon link creation: */ + case AF_INET: + case AF_INET6: + { + char hostbufOSMO_STREAM_MAX_ADDRSINET6_ADDRSTRLEN; + size_t num_hostbuf = ARRAY_SIZE(hostbuf); + char portbuf6; + bool need_more_bufs; + rc = osmo_sock_multiaddr_get_ip_and_port(link->ofd.fd, link->proto, &hostbuf00, + &num_hostbuf, sizeof(hostbuf0), + portbuf, sizeof(portbuf), true); + if (rc < 0) + return NULL; + need_more_bufs = num_hostbuf > ARRAY_SIZE(hostbuf); + if (need_more_bufs) + num_hostbuf = ARRAY_SIZE(hostbuf); + OSMO_STRBUF_APPEND(sb, osmo_multiaddr_ip_and_port_snprintf, + &hostbuf00, num_hostbuf, sizeof(hostbuf0), portbuf); + if (need_more_bufs) + OSMO_STRBUF_PRINTF(sb, "<need-more-bufs!>"); + return buf; + } + case AF_UNIX: + { + struct osmo_sockaddr osa; + struct sockaddr_un *sun; + socklen_t len = sizeof(osa.u.sas); + rc = getsockname(link->ofd.fd, &osa.u.sa, &len); + if (rc < 0) { + OSMO_STRBUF_PRINTF(sb, "<error-in-getsockname>"); + return buf; + } + /* Make sure sun_path is NULL terminated: */ + sun = (struct sockaddr_un *)&osa.u.sa; + sun->sun_pathsizeof(sun->sun_path) - 1 = '\0'; + OSMO_STRBUF_PRINTF(sb, "%s", sun->sun_path); + return buf; + } + default: + return NULL; + } } /*! \brief Get description of the stream server link e. g. 127.0.0.1:1234 @@ -372,7 +409,7 @@ { static char bufsizeof(link->sockname); - if (!get_local_sockname_buf(buf, sizeof(buf), link->ofd.fd, link->proto)) + if (!get_local_sockname_buf(buf, sizeof(buf), link)) return NULL; return buf; } @@ -463,7 +500,7 @@ return -EIO; } - get_local_sockname_buf(link->sockname, sizeof(link->sockname), link->ofd.fd, link->proto); + get_local_sockname_buf(link->sockname, sizeof(link->sockname), link); return 0; } @@ -837,6 +874,15 @@ osmo_iofd_set_name(conn->iofd, name); } +/*! \brief Retrieve name previously set on the srv object (see osmo_stream_srv_set_name()) + * \paramin conn server whose name is to be retrieved + * \returns The name to be set on conn; NULL if never set + */ +const char *osmo_stream_srv_get_name(const struct osmo_stream_srv *conn) +{ + return conn->name; +} + /*! \brief Set the call-back function when data was read from the stream server socket * Only for osmo_stream_srv created with osmo_stream_srv_create2() * \paramin conn Stream Server to modify
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.