diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/e1_input.c | 2 | ||||
-rw-r--r-- | src/e1_input_vty.c | 3 | ||||
-rw-r--r-- | src/init.c | 2 | ||||
-rw-r--r-- | src/input/dahdi.c | 2 | ||||
-rw-r--r-- | src/input/ipa.c | 48 | ||||
-rw-r--r-- | src/input/ipaccess.c | 13 | ||||
-rw-r--r-- | src/input/lapd.c | 2 | ||||
-rw-r--r-- | src/input/lapd_pcap.c | 2 | ||||
-rw-r--r-- | src/input/misdn.c | 2 | ||||
-rw-r--r-- | src/input/rs232.c | 2 | ||||
-rw-r--r-- | src/input/unixsocket.c | 7 | ||||
-rw-r--r-- | src/ipa_proxy.c | 1 | ||||
-rw-r--r-- | src/subchan_demux.c | 2 | ||||
-rw-r--r-- | src/trau/osmo_ortp.c | 9 | ||||
-rw-r--r-- | src/trau_frame.c | 2 |
16 files changed, 67 insertions, 34 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 7395d17..ab42d38 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html ABIS_LIBVERSION=6:0:0 -TRAU_LIBVERSION=2:0:0 +TRAU_LIBVERSION=3:0:1 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) AM_CFLAGS= -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS) diff --git a/src/e1_input.c b/src/e1_input.c index 3cf810f..29ba440 100644 --- a/src/e1_input.c +++ b/src/e1_input.c @@ -4,6 +4,8 @@ * * All Rights Reserved * + * SPDX-License-Identifier: AGPL-3.0+ + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation; either version 3 of the License, or diff --git a/src/e1_input_vty.c b/src/e1_input_vty.c index 9d69586..0e4575f 100644 --- a/src/e1_input_vty.c +++ b/src/e1_input_vty.c @@ -2,6 +2,8 @@ /* (C) 2011 by Harald Welte <laforge@gnumonks.org> * All Rights Reserved * + * SPDX-License-Identifier: AGPL-3.0+ + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation; either version 3 of the License, or @@ -380,7 +382,6 @@ int e1inp_vty_init(void) install_element(CONFIG_NODE, &cfg_e1inp_cmd); install_node(&e1inp_node, e1inp_config_write); - vty_install_default(L_E1INP_NODE); install_element(L_E1INP_NODE, &cfg_e1_line_driver_cmd); install_element(L_E1INP_NODE, &cfg_e1_line_port_cmd); install_element(L_E1INP_NODE, &cfg_e1_line_socket_cmd); @@ -1,6 +1,8 @@ /* (C) 2011 by Harald Welte <laforge@gnumonks.org> * All Rights Reserved * + * SPDX-License-Identifier: AGPL-3.0+ + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation; either version 3 of the License, or diff --git a/src/input/dahdi.c b/src/input/dahdi.c index 911f862..47276a7 100644 --- a/src/input/dahdi.c +++ b/src/input/dahdi.c @@ -6,6 +6,8 @@ * * All Rights Reserved * + * SPDX-License-Identifier: GPL-2.0+ + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/src/input/ipa.c b/src/input/ipa.c index ce155ce..fc1ca50 100644 --- a/src/input/ipa.c +++ b/src/input/ipa.c @@ -23,6 +23,8 @@ #include <osmocom/abis/ipa.h> +#define LOGIPA(link, level, fmt, args...) LOGP(DLINP, level, "%s:%u " fmt, link->addr, link->port, ## args) + void ipa_msg_push_header(struct msgb *msg, uint8_t proto) { struct ipaccess_head *hh; @@ -51,20 +53,20 @@ static void ipa_client_read(struct ipa_client_conn *link) struct msgb *msg; int ret; - LOGP(DLINP, LOGL_DEBUG, "message received\n"); + LOGIPA(link, LOGL_DEBUG, "message received\n"); ret = ipa_msg_recv_buffered(ofd->fd, &msg, &link->pending_msg); if (ret < 0) { if (ret == -EAGAIN) return; if (ret == -EPIPE || ret == -ECONNRESET) - LOGP(DLINP, LOGL_ERROR, "lost connection with server\n"); + LOGIPA(link, LOGL_ERROR, "lost connection with server\n"); ipa_client_conn_close(link); if (link->updown_cb) link->updown_cb(link, 0); return; } else if (ret == 0) { - LOGP(DLINP, LOGL_ERROR, "connection closed with server\n"); + LOGIPA(link, LOGL_ERROR, "connection closed with server\n"); ipa_client_conn_close(link); if (link->updown_cb) link->updown_cb(link, 0); @@ -87,7 +89,7 @@ static int ipa_client_write_default_cb(struct ipa_client_conn *link) struct llist_head *lh; int ret; - LOGP(DLINP, LOGL_DEBUG, "sending data\n"); + LOGIPA(link, LOGL_DEBUG, "sending data\n"); if (llist_empty(&link->tx_queue)) { ofd->when &= ~BSC_FD_WRITE; @@ -104,7 +106,7 @@ static int ipa_client_write_default_cb(struct ipa_client_conn *link) if (link->updown_cb) link->updown_cb(link, 0); } - LOGP(DLINP, LOGL_ERROR, "error to send\n"); + LOGIPA(link, LOGL_ERROR, "error to send\n"); } msgb_free(msg); return 0; @@ -126,18 +128,18 @@ static int ipa_client_fd_cb(struct osmo_fd *ofd, unsigned int what) return 0; } ofd->when &= ~BSC_FD_WRITE; - LOGP(DLINP, LOGL_NOTICE, "connection done.\n"); + LOGIPA(link, LOGL_NOTICE, "connection done\n"); link->state = IPA_CLIENT_LINK_STATE_CONNECTED; if (link->updown_cb) link->updown_cb(link, 1); break; case IPA_CLIENT_LINK_STATE_CONNECTED: if (what & BSC_FD_READ) { - LOGP(DLINP, LOGL_DEBUG, "connected read\n"); + LOGIPA(link, LOGL_DEBUG, "connected read\n"); ipa_client_read(link); } if (what & BSC_FD_WRITE) { - LOGP(DLINP, LOGL_DEBUG, "connected write\n"); + LOGIPA(link, LOGL_DEBUG, "connected write\n"); ipa_client_write(link); } break; @@ -335,18 +337,18 @@ static void ipa_server_conn_read(struct ipa_server_conn *conn) struct msgb *msg; int ret; - LOGP(DLINP, LOGL_DEBUG, "message received\n"); + LOGIPA(conn, LOGL_DEBUG, "message received\n"); ret = ipa_msg_recv_buffered(ofd->fd, &msg, &conn->pending_msg); if (ret < 0) { if (ret == -EAGAIN) return; if (ret == -EPIPE || ret == -ECONNRESET) - LOGP(DLINP, LOGL_ERROR, "lost connection with server\n"); + LOGIPA(conn, LOGL_ERROR, "lost connection with server\n"); ipa_server_conn_destroy(conn); return; } else if (ret == 0) { - LOGP(DLINP, LOGL_ERROR, "connection closed with server\n"); + LOGIPA(conn, LOGL_ERROR, "connection closed with server\n"); ipa_server_conn_destroy(conn); return; } @@ -358,24 +360,20 @@ static void ipa_server_conn_read(struct ipa_server_conn *conn) static void ipa_server_conn_write(struct ipa_server_conn *conn) { - struct osmo_fd *ofd = &conn->ofd; struct msgb *msg; - struct llist_head *lh; int ret; - LOGP(DLINP, LOGL_DEBUG, "sending data\n"); + LOGIPA(conn, LOGL_DEBUG, "sending data\n"); + msg = msgb_dequeue(&conn->tx_queue); - if (llist_empty(&conn->tx_queue)) { - ofd->when &= ~BSC_FD_WRITE; + if (!msg) { + conn->ofd.when &= ~BSC_FD_WRITE; return; } - lh = conn->tx_queue.next; - llist_del(lh); - msg = llist_entry(lh, struct msgb, list); ret = send(conn->ofd.fd, msg->data, msg->len, 0); if (ret < 0) { - LOGP(DLINP, LOGL_ERROR, "error to send\n"); + LOGIPA(conn, LOGL_ERROR, "error to send\n"); } msgb_free(msg); } @@ -454,7 +452,7 @@ int ipa_server_conn_ccm(struct ipa_server_conn *conn, struct msgb *msg) break; default: /* Error */ - LOGP(DLINP, LOGL_ERROR, "Unexpected return from " + LOGIPA(conn, LOGL_ERROR, "Unexpected return from " "ipa_ccm_rcvmsg_base: %d\n", rc); goto err; } @@ -464,18 +462,18 @@ int ipa_server_conn_ccm(struct ipa_server_conn *conn, struct msgb *msg) rc = ipa_ccm_idtag_parse(&tlvp, (uint8_t *)msg->l2h + 2, msgb_l2len(msg)-2); if (rc < 0) { - LOGP(DLINP, LOGL_ERROR, "IPA CCM RESPonse with " + LOGIPA(conn, LOGL_ERROR, "IPA CCM RESPonse with " "malformed TLVs\n"); goto err; } if (!TLVP_PRESENT(&tlvp, IPAC_IDTAG_UNIT)) { - LOGP(DLINP, LOGL_ERROR, "IPA CCM RESP without " + LOGIPA(conn, LOGL_ERROR, "IPA CCM RESP without " "unit ID\n"); goto err; } len = TLVP_LEN(&tlvp, IPAC_IDTAG_UNIT); if (len < 1) { - LOGP(DLINP, LOGL_ERROR, "IPA CCM RESP with short" + LOGIPA(conn, LOGL_ERROR, "IPA CCM RESP with short" "unit ID\n"); goto err; } @@ -489,7 +487,7 @@ int ipa_server_conn_ccm(struct ipa_server_conn *conn, struct msgb *msg) goto err; break; default: - LOGP(DLINP, LOGL_ERROR, "Unknown IPA message type\n"); + LOGIPA(conn, LOGL_ERROR, "Unknown IPA message type\n"); break; } return 0; diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c index 63ee167..9a80d8e 100644 --- a/src/input/ipaccess.c +++ b/src/input/ipaccess.c @@ -6,6 +6,8 @@ * * All Rights Reserved * + * SPDX-License-Identifier: AGPL-3.0+ + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation; either version 3 of the License, or @@ -192,7 +194,11 @@ static int ipaccess_rcvmsg(struct e1inp_line *line, struct msgb *msg, newbfd = &ts->driver.ipaccess.fd; /* get rid of our old temporary bfd */ - memcpy(newbfd, bfd, sizeof(*newbfd)); + memcpy(&newbfd->list, &bfd->list, sizeof(newbfd->list)); + newbfd->fd = bfd->fd; + newbfd->when |= bfd->when; /* preserve 'newbfd->when' flags potentially set by sign_link_up() */ + newbfd->cb = bfd->cb; + newbfd->data = bfd->data; newbfd->priv_nr = E1INP_SIGN_RSL + unit_data.trx_id; osmo_fd_unregister(bfd); bfd->fd = -1; @@ -569,7 +575,7 @@ err_line: #define IPA_STRING_MAX 64 static struct msgb * -ipa_bts_id_resp(struct ipaccess_unit *dev, uint8_t *data, int len, int trx_nr) +ipa_bts_id_resp(const struct ipaccess_unit *dev, uint8_t *data, int len, int trx_nr) { struct msgb *nmsg; char str[IPA_STRING_MAX]; @@ -702,7 +708,8 @@ int ipaccess_bts_handle_ccm(struct ipa_client_conn *link, if (link->ofd->priv_nr >= E1INP_SIGN_RSL) trx_nr = link->ofd->priv_nr - E1INP_SIGN_RSL; - LOGP(DLINP, LOGL_NOTICE, "received ID get\n"); + LOGP(DLINP, LOGL_NOTICE, "received ID get from %u/%u/%u\n", + dev->site_id, dev->bts_id, dev->trx_id); rmsg = ipa_bts_id_resp(dev, data + 1, len - 1, trx_nr); ret = ipa_send(link->ofd->fd, rmsg->data, rmsg->len); if (ret != rmsg->len) { diff --git a/src/input/lapd.c b/src/input/lapd.c index 4b5077b..a72a19b 100644 --- a/src/input/lapd.c +++ b/src/input/lapd.c @@ -8,6 +8,8 @@ * * All Rights Reserved * + * SPDX-License-Identifier: GPL-2.0+ + * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/src/input/lapd_pcap.c b/src/input/lapd_pcap.c index 7374694..77d4971 100644 --- a/src/input/lapd_pcap.c +++ b/src/input/lapd_pcap.c @@ -5,6 +5,8 @@ * Author: Harald Welte <laforge@gnumonks.org> * Pablo Neira Ayuso <pablo@gnumonks.org> * + * SPDX-License-Identifier: AGPL-3.0+ + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation; either version 3 of the License, or diff --git a/src/input/misdn.c b/src/input/misdn.c index 347b7bf..bdca9d5 100644 --- a/src/input/misdn.c +++ b/src/input/misdn.c @@ -5,6 +5,8 @@ * * All Rights Reserved * + * SPDX-License-Identifier: AGPL-3.0+ + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation; either version 3 of the License, or diff --git a/src/input/rs232.c b/src/input/rs232.c index 9da01a3..c801ab2 100644 --- a/src/input/rs232.c +++ b/src/input/rs232.c @@ -7,6 +7,8 @@ * Authors: Harald Welte <laforge@gnumonks.org> * Pablo Neira Ayuso <pablo@gnumonks.org> * + * SPDX-License-Identifier: AGPL-3.0+ + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation; either version 3 of the License, or diff --git a/src/input/unixsocket.c b/src/input/unixsocket.c index 63bd796..c49928d 100644 --- a/src/input/unixsocket.c +++ b/src/input/unixsocket.c @@ -1,12 +1,13 @@ /* OpenBSC Abis receive lapd over a unix socket */ -/* (C) 2016 by sysmocom s.f.m.c. GmbH - * +/* (C) 2016 by sysmocom - s.f.m.c. GmbH * Author: Alexander Couzens <lynxis@fe80.eu> * Based on other e1_input drivers. * * All Rights Reserved * + * SPDX-License-Identifier: GPL-2.0+ + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -232,7 +233,7 @@ static int unixsocket_line_update(struct e1inp_line *line) int i; if (line->sock_path) - strcpy(sock_path, line->sock_path); + osmo_strlcpy(sock_path, line->sock_path, PATH_MAX); else sprintf(sock_path, "%s%d", UNIXSOCKET_SOCK_PATH_DEFAULT, line->num); diff --git a/src/ipa_proxy.c b/src/ipa_proxy.c index 6053bb8..94f48dc 100644 --- a/src/ipa_proxy.c +++ b/src/ipa_proxy.c @@ -652,7 +652,6 @@ void ipa_proxy_vty_init(void) install_element(CONFIG_NODE, &ipa_cfg_cmd); install_node(&ipa_node, ipa_cfg_write); - vty_install_default(L_IPA_NODE); install_element(L_IPA_NODE, &ipa_instance_cfg_add_cmd); install_element(L_IPA_NODE, &ipa_route_cfg_add_cmd); } diff --git a/src/subchan_demux.c b/src/subchan_demux.c index 238056c..d15c4b8 100644 --- a/src/subchan_demux.c +++ b/src/subchan_demux.c @@ -3,6 +3,8 @@ /* (C) 2009 by Harald Welte <laforge@gnumonks.org> * All Rights Reserved * + * SPDX-License-Identifier: AGPL-3.0+ + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation; either version 3 of the License, or diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c index c49a23d..8ea05e4 100644 --- a/src/trau/osmo_ortp.c +++ b/src/trau/osmo_ortp.c @@ -2,6 +2,8 @@ * (C) 2011 by On-Waves e.h.f * All Rights Reserved * + * SPDX-License-Identifier: GPL-2.0+ + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -653,3 +655,10 @@ void osmo_rtp_socket_stats(struct osmo_rtp_socket *rs, if (jitter) *last_jitter = jitter->jitter; } + +void osmo_rtp_set_source_desc(struct osmo_rtp_socket *rs, const char *cname, + const char *name, const char *email, const char *phone, + const char *loc, const char *tool, const char *note) +{ + rtp_session_set_source_description(rs->sess, cname, name, email, phone, loc, tool, note); +} diff --git a/src/trau_frame.c b/src/trau_frame.c index 2f5a003..717bc32 100644 --- a/src/trau_frame.c +++ b/src/trau_frame.c @@ -3,6 +3,8 @@ /* (C) 2009 by Harald Welte <laforge@gnumonks.org> * All Rights Reserved * + * SPDX-License-Identifier: AGPL-3.0+ + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation; either version 3 of the License, or |