summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Graf <tgr@deb.localdomain>2007-12-18 13:06:48 +0100
committerThomas Graf <tgr@deb.localdomain>2007-12-18 13:06:48 +0100
commit680c54fd4616649763a50b122df6cff53b9e62bd (patch)
tree505a0c4b0ff9bdcb90d8efb0be6ef3bad1621684 /src
parent3c56ed5787481a06703ffb25561df3dd56b447bd (diff)
downloadandroid_external_libnl-680c54fd4616649763a50b122df6cff53b9e62bd.tar.gz
android_external_libnl-680c54fd4616649763a50b122df6cff53b9e62bd.tar.bz2
android_external_libnl-680c54fd4616649763a50b122df6cff53b9e62bd.zip
Support defining the default callback handler with an environment variable
Diffstat (limited to 'src')
-rw-r--r--src/utils.c30
1 files changed, 1 insertions, 29 deletions
diff --git a/src/utils.c b/src/utils.c
index b3a11a1..b43758a 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -13,37 +13,9 @@
#include <stdlib.h>
-static struct nl_cb *nltool_cb;
-
int nltool_init(int argc, char *argv[])
{
- char *nlcb = getenv("NLCB");
- int cbset = NL_CB_VERBOSE;
-
- if (nlcb) {
- if (!strcasecmp(nlcb, "default"))
- cbset = NL_CB_DEFAULT;
- else if (!strcasecmp(nlcb, "verbose"))
- cbset = NL_CB_VERBOSE;
- else if (!strcasecmp(nlcb, "debug"))
- cbset = NL_CB_DEBUG;
- else {
- fprintf(stderr, "Unknown value for NLCB, valid values: "
- "{default | verbose | debug}\n");
- goto errout;
- }
- }
-
- nltool_cb = nl_cb_alloc(cbset);
- if (nltool_cb == NULL) {
- fprintf(stderr, "Cannot allocate callback handle\n");
- goto errout;
- }
-
return 0;
-
-errout:
- return -1;
}
int nltool_connect(struct nl_handle *nlh, int protocol)
@@ -60,7 +32,7 @@ int nltool_connect(struct nl_handle *nlh, int protocol)
struct nl_handle *nltool_alloc_handle(void)
{
- return nl_handle_alloc_cb(nltool_cb);
+ return nl_handle_alloc();
}
struct nl_addr *nltool_addr_parse(const char *str)