aboutsummaryrefslogtreecommitdiffstats
path: root/src/datagram.c
AgeCommit message (Collapse)AuthorFilesLines
2017-11-13Add SPDX-License-Identifier + Copyright statementsHarald Welte1-0/+20
Change-Id: I43bb1c4a889421907a1a08eb29c96f2330ab00ec
2017-10-27some more Doxygen header text for datagram, osmux and stream moduleHarald Welte1-0/+5
Change-Id: Ied83e6b117a420d734a88e3aff925a874c3dd520
2017-10-13cosmetic: print textual error from recv()Max1-1/+1
Change-Id: Ic9557c6519b44b5985daf7d2d14ec063790441fb
2017-10-13cosmetic: relax UDP length checkMax1-2/+2
Previously recv() returning 0 for UDP socket was considered as error although it's legitimate return value for empty UDP packets. Relax the error check to avoid confusing error messages. The function behavior is the same: * msg is not altered while receiving 0-length UDP packet * return value is 0 The only result of the relaxed error check is the absense of error log message for 0-length UDP packet. Change-Id: I32e5fcbf5ed92cc923660ac59e6a37fd3f0703a7 Fixes: OS#2219
2017-04-29misc: Call the variable ctx like in all other placesHolger Hans Peter Freyther1-8/+8
We couldn't figure out what "crx" as supposed to mean and assume it is a typo. Fix the code and call it ctx, this is fixing the API documentation as well. Change-Id: I27ed1178fdbbcf3fc0e1070dc19b4ecf9a327a04
2017-04-10stream/datagram: Ensure reliable close/destroyHarald Welte1-1/+10
* when using osmo_*_destroy(), always call *_close() internally to make sure we don't free memory holding references to sockets that are still open * when closing the socket, always make sure to set the fd to -1 in all cases, to avoid attempts to avoid later close() on a new file using the same fd number as the socket closed previously. Change-Id: I29c37da6e8f5be8ab030e68952a8f92add146821
2017-04-10stream/datagram: Consistently use osmo_talloc_replace_string()Harald Welte1-10/+4
during osmo_*_set_addr(), we must make sure to talloc_free() any old address before copying in the new address. Not all functions did this, and those that did implemented it manually. Let's use osmo_talloc_replace_string() which is exactly intended for this case. Change-Id: Ie1b140a160c66e8b62c745174865d5ba525cb2c2
2017-04-10stream+datagram: Allow local bind + connect for client socketsHarald Welte1-3/+26
This uses the new osmo_sock_init2() features introduced in libosmocore Change-Id Idab124bcca47872f55311a82d6818aed590965e6 to bind *and* connect a given socket during creation. Change-Id: I013f4cc10b26d332d52d231f252bb0f03df8c54b
2017-04-08Add minimal doxygen documentation for stream + datagram modulesHarald Welte1-0/+110
We should have doxygen documentation for all libosmo-* APIs. libosmo-netif is currently devoid of any API docs. Let's start with the stream and datagram socket related functions. Change-Id: I589a5e60d9df2b8a65fbaf68f80e3ae0039d8c2a
2015-02-25Fix the compilation on FreeBSD.Nikola Kolev1-0/+1
2012-10-21dgram: add osmo_dgram_get_dataPablo Neira Ayuso1-0/+5
2012-08-15src: shorter names for datagram socketsPablo Neira Ayuso1-91/+90
%s/_conn_/_/g %s/_conn//g %s/_server_/_tx_/g %s/_client_/_rx_/g %s/_SERVER_/_TX_/g %s/_CLIENT_/_RX_/g %s/_RECONFIG/_RECONF/g
2012-02-23datagram: minor cleanupPablo Neira Ayuso1-6/+5
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2011-10-17datagram: add osmo_dgram_conn_recvPablo Neira Ayuso1-28/+24
We provide osmo_dgram_conn_recv(...) which allows you to take control on the message allocation and receival process. Instead of hiding this details inside the datagram infrastructure. Providing more control to clients of this code means more flexibility.
2011-10-17datagram: reconfiguration is only required if address and port changePablo Neira Ayuso1-2/+0
We allow to change the callback and data pointers in runtime safely without the need to reconfig.
2011-10-14datagram: use LOGL_DEBUG in osmo_dgram_server_conn_readPablo Neira Ayuso1-1/+1
This removes spamming message that is currently displayed with LOGL_NOTICE loglevel.
2011-10-14datagram: change prototype of osmo_dgram_conn_set_read_cbPablo Neira Ayuso1-2/+17
This patch changes the prototype of osmo_dgram_conn_set_read_cb. Now it takes one callback to a generic struct osmo_dgram_conn instead of osmo_dgram_server_conn. This is useful in case that you want to reply to one message using the datagram socket (without this change is not possible).
2011-10-09datagram: support calling dgram_*_open() multiple times for reconfigurationsPablo Neira Ayuso1-0/+32
This patch allows you to call dgram_*_open(..) as many times as you want to trigger reconfigurations.
2011-10-09datagram: add osmo_ prefix to all functionsPablo Neira Ayuso1-68/+73
Modify examples as well to use the new API.
2011-10-05add generic datagram socket infrastructure and examplesPablo Neira Ayuso1-0/+354
This patch adds new datagram socket infrastructure and it reworks the previous examples (now it's LAPD over datagram).