diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2015-12-02 15:43:10 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2015-12-03 11:47:12 +0100 |
commit | 996ec1d73150366fa105b7d42ba8003fb018fcf8 (patch) | |
tree | e28855041a38c61e5d437d40202e017e5145a10e /openbsc/tests/gtphub/gtphub_test.c | |
parent | 18d304961249c7815cf3a78ebd1697a4efd9ab42 (diff) |
gtphub: wrap gtphub_write() for test suite.
Sponsored-by: On-Waves ehi
Diffstat (limited to 'openbsc/tests/gtphub/gtphub_test.c')
-rw-r--r-- | openbsc/tests/gtphub/gtphub_test.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/openbsc/tests/gtphub/gtphub_test.c b/openbsc/tests/gtphub/gtphub_test.c index 0d93e5a0e..0992d7972 100644 --- a/openbsc/tests/gtphub/gtphub_test.c +++ b/openbsc/tests/gtphub/gtphub_test.c @@ -508,6 +508,24 @@ int __wrap_gtphub_ares_init(struct gtphub *hub) return 0; } +/* override, requires '-Wl,--wrap=gtphub_write' */ +int __real_gtphub_write(const struct osmo_fd *to, + const struct osmo_sockaddr *to_addr, + const uint8_t *buf, size_t buf_len); + +int __wrap_gtphub_write(const struct osmo_fd *to, + const struct osmo_sockaddr *to_addr, + const uint8_t *buf, size_t buf_len) +{ + printf("Out-of-band gtphub_write(%d):\n" + "to %s\n" + "%s\n", + (int)buf_len, + osmo_sockaddr_to_str(to_addr), + osmo_hexdump(buf, buf_len)); + return 0; +} + #define buf_len 1024 static uint8_t buf[buf_len]; static uint8_t *reply_buf; |