path: root/openbsc/src/osmo-bsc_nat
diff options
authorNeels Hofmeyr <>2015-10-12 11:57:33 +0200
committerHolger Hans Peter Freyther <>2015-11-02 12:56:40 +0100
commitd48f057328cfb82b192d935325eb5af1162c0ecc (patch)
treee8e91969b6b2c5186b77572973fc222e35275c54 /openbsc/src/osmo-bsc_nat
parentfe60cfb1d63d1c3b61c12eee78308f7985c66c1d (diff)
libcommon: soak up three static functions.
Add new kitchen sink openbsc/utils.h and libcommon/utils.c to make three so far static functions public (so I can use them in the upcoming OAP code). A place to put them could have been the gprs_utils.h, but all general functions in there have a gprs_ prefix, and todo markings to move them away. All other libcommon headers are too specific, so I opened up this kitchen sink header. Replace the implementation of encode_big_endian() with a call to osmo_store64be_ext(). See comments. Apply the change in Makefiles and C files.
Diffstat (limited to 'openbsc/src/osmo-bsc_nat')
1 files changed, 1 insertions, 11 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c
index 56c6286..18343dd 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c
@@ -47,6 +47,7 @@
#include <openbsc/abis_nm.h>
#include <openbsc/socket.h>
#include <openbsc/vty.h>
+#include <openbsc/utils.h>
#include <osmocom/ctrl/control_cmd.h>
#include <osmocom/ctrl/control_if.h>
@@ -987,17 +988,6 @@ static void ipaccess_close_bsc(void *data)
-/* Wishful thinking to generate a constant time compare */
-static int constant_time_cmp(const uint8_t *exp, const uint8_t *rel, const int count)
- int x = 0, i;
- for (i = 0; i < count; ++i)
- x |= exp[i] ^ rel[i];
- return x != 0;
static int verify_key(struct bsc_connection *conn, struct bsc_config *conf, const uint8_t *key, const int keylen)
struct osmo_auth_vector vec;