diff options
author | Oliver Smith <osmith@sysmocom.de> | 2019-04-08 15:00:43 +0200 |
---|---|---|
committer | Oliver Smith <osmith@sysmocom.de> | 2019-04-08 15:12:49 +0200 |
commit | f7d3251d9ac4ba29fc2cebc55106c2400d8a9423 (patch) | |
tree | f4175c6e58566af3193eff14ca6e0577a5ae7ae2 | |
parent | 3cf87fe22cf53178ddd4f7e5c4be67ca8c4bc8bd (diff) |
Cosmetic: gsup_route_find: comment addr, addrlen
Describe the addr, addrlen parameters in gsup_route_find() and (more
commonly used) osmo_gsup_addr_send(). Without this description, it is
easy to get the parameters wrong and have routes not being found, as
shown with debug prints like these:
gsup_route_find: addr, addrlen: "MSC-13-37-00-00-00-00", 21
gsup_route_find: comparing with: "MSC-13-37-00-00-00-00\0", 22
Change-Id: Ib79878970bd07caac6eb921af8ae95403b90a4cb
-rw-r--r-- | src/gsup_router.c | 8 | ||||
-rw-r--r-- | src/gsup_send.c | 9 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/gsup_router.c b/src/gsup_router.c index 16ea202..4fedd38 100644 --- a/src/gsup_router.c +++ b/src/gsup_router.c @@ -33,7 +33,13 @@ struct gsup_route { struct osmo_gsup_conn *conn; }; -/* find a route for the given address */ +/*! Find a route for the given address. + * \param[in] gs gsup server + * \param[in] addr IPA name of the client (SGSN, MSC/VLR). Although this is passed like a blob, together with the + * length, it must be nul-terminated! This is for legacy reasons, see the discussion here: + * https://gerrit.osmocom.org/#/c/osmo-hlr/+/13048/ + * \param[in] addrlen length of addr, *including the nul-byte* (strlen(addr) + 1). + */ struct osmo_gsup_conn *gsup_route_find(struct osmo_gsup_server *gs, const uint8_t *addr, size_t addrlen) { diff --git a/src/gsup_send.c b/src/gsup_send.c index b2c4e02..889cf63 100644 --- a/src/gsup_send.c +++ b/src/gsup_send.c @@ -26,7 +26,14 @@ #include <osmocom/core/logging.h> -/* Send a msgb to a given address using routing */ +/*! Send a msgb to a given address using routing. + * \param[in] gs gsup server + * \param[in] addr IPA name of the client (SGSN, MSC/VLR). Although this is passed like a blob, together with the + * length, it must be nul-terminated! This is for legacy reasons, see the discussion here: + * https://gerrit.osmocom.org/#/c/osmo-hlr/+/13048/ + * \param[in] addrlen length of addr, *including the nul-byte* (strlen(addr) + 1). + * \param[in] msg message buffer + */ int osmo_gsup_addr_send(struct osmo_gsup_server *gs, const uint8_t *addr, size_t addrlen, struct msgb *msg) |