diff options
author | Max <msuraev@sysmocom.de> | 2019-02-04 14:55:37 +0100 |
---|---|---|
committer | Max <msuraev@sysmocom.de> | 2019-02-05 16:25:20 +0000 |
commit | 732652b5b7f4fe02ecfff5f33b67db6392b02617 (patch) | |
tree | d8ca95a8cdcb1aa538fe58d2b574fa4861fc4aad /include/osmocom/netif/stream.h | |
parent | a93bb2ca34a0b201c35a67445bb5b254ce5a3c5a (diff) |
Add socket name functions to stream client/server
Add functions to get the description of a server link or client
connection which examine data on corresponding socket.
Those functions use static buffers and intended for single use in
log/printf statements as illustarted by corresponding example changes.
Change-Id: If9a8e211da85956781479862a63c4fc6e53ed6be
Diffstat (limited to 'include/osmocom/netif/stream.h')
-rw-r--r-- | include/osmocom/netif/stream.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/osmocom/netif/stream.h b/include/osmocom/netif/stream.h index 969d42f..3044511 100644 --- a/include/osmocom/netif/stream.h +++ b/include/osmocom/netif/stream.h @@ -27,6 +27,7 @@ void osmo_stream_srv_link_set_proto(struct osmo_stream_srv_link *link, uint16_t void osmo_stream_srv_link_set_accept_cb(struct osmo_stream_srv_link *link, int (*accept_cb)(struct osmo_stream_srv_link *link, int fd)); void osmo_stream_srv_link_set_data(struct osmo_stream_srv_link *link, void *data); void *osmo_stream_srv_link_get_data(struct osmo_stream_srv_link *link); +char *osmo_stream_srv_link_get_sockname(const struct osmo_stream_srv_link *link); struct osmo_fd *osmo_stream_srv_link_get_ofd(struct osmo_stream_srv_link *link); int osmo_stream_srv_link_open(struct osmo_stream_srv_link *link); @@ -60,6 +61,7 @@ void osmo_stream_cli_set_local_port(struct osmo_stream_cli *cli, uint16_t port); void osmo_stream_cli_set_data(struct osmo_stream_cli *cli, void *data); void osmo_stream_cli_set_reconnect_timeout(struct osmo_stream_cli *cli, int timeout); void *osmo_stream_cli_get_data(struct osmo_stream_cli *cli); +char *osmo_stream_cli_get_sockname(const struct osmo_stream_cli *cli); struct osmo_fd *osmo_stream_cli_get_ofd(struct osmo_stream_cli *cli); void osmo_stream_cli_set_connect_cb(struct osmo_stream_cli *cli, int (*connect_cb)(struct osmo_stream_cli *cli)); void osmo_stream_cli_set_read_cb(struct osmo_stream_cli *cli, int (*read_cb)(struct osmo_stream_cli *cli)); |