summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSan Mehat <san@google.com>2009-12-24 07:17:09 -0800
committerSan Mehat <san@google.com>2009-12-24 07:20:36 -0800
commitd674413ff460afe1da049e54bb7a489132799749 (patch)
tree9cae3b4cd2a9fdef54b4d1994741ae9b459eca5c
parent3528f6ba2769abb09ae0a27a9336b96ab0a97225 (diff)
downloadsystem_core-d674413ff460afe1da049e54bb7a489132799749.zip
system_core-d674413ff460afe1da049e54bb7a489132799749.tar.gz
system_core-d674413ff460afe1da049e54bb7a489132799749.tar.bz2
sysutils: Add dump() to NetlinkEvent
Signed-off-by: San Mehat <san@google.com>
-rw-r--r--include/sysutils/NetlinkEvent.h2
-rw-r--r--libsysutils/src/NetlinkEvent.cpp10
2 files changed, 12 insertions, 0 deletions
diff --git a/include/sysutils/NetlinkEvent.h b/include/sysutils/NetlinkEvent.h
index 95e83a3..b329b09 100644
--- a/include/sysutils/NetlinkEvent.h
+++ b/include/sysutils/NetlinkEvent.h
@@ -39,6 +39,8 @@ public:
const char *getSubsystem() { return mSubsystem; }
int getAction() { return mAction; }
+
+ void dump();
};
#endif
diff --git a/libsysutils/src/NetlinkEvent.cpp b/libsysutils/src/NetlinkEvent.cpp
index 5f959a7..1550d83 100644
--- a/libsysutils/src/NetlinkEvent.cpp
+++ b/libsysutils/src/NetlinkEvent.cpp
@@ -46,6 +46,16 @@ NetlinkEvent::~NetlinkEvent() {
}
}
+void NetlinkEvent::dump() {
+ int i;
+
+ for (i = 0; i < NL_PARAMS_MAX; i++) {
+ if (!mParams[i])
+ break;
+ LOGD("NL param '%s'\n", mParams[i]);
+ }
+}
+
bool NetlinkEvent::decode(char *buffer, int size) {
char *s = buffer;
char *end;