summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMike J. Chen <mjchen@google.com>2011-06-23 14:55:28 -0700
committerMike J. Chen <mjchen@google.com>2011-06-23 18:59:45 -0700
commitec16b9d47cacb0d873ee0ff80c919f49215c0005 (patch)
tree001ba2be28407e94c0e295890764387a94404cec /include
parent9661a3aecd39cca95bd07253c52b99521409c147 (diff)
downloadsystem_core-ec16b9d47cacb0d873ee0ff80c919f49215c0005.zip
system_core-ec16b9d47cacb0d873ee0ff80c919f49215c0005.tar.gz
system_core-ec16b9d47cacb0d873ee0ff80c919f49215c0005.tar.bz2
Revert "Revert "Add NETLINK_ROUTE processing to the netlink client code, so that Ethernet""
This reverts commit 1d504eeb50d980c222572629383bb76315f32ca0. Conflicts: libsysutils/src/NetlinkEvent.cpp Bring back the changes from Stan Chesnutt regarding adding NETLINK_ROUTE processing. The original commit message description was: Add NETLINK_ROUTE processing to the netlink client code, so that Ethernet physical-layer up/down events can be tracked. Upper layers will use these events to enable/disable Ethernet connectivity. The original change was reverted due to an incompatiblity with Motorola's ril.so binary. I'll submit a patch to workaround that incompatiblity separately. Change-Id: I4e97ac98833b10543e654c63ecae3b9b8c7db44f Signed-off-by: Mike J. Chen <mjchen@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/sysutils/NetlinkEvent.h8
-rw-r--r--include/sysutils/NetlinkListener.h6
2 files changed, 12 insertions, 2 deletions
diff --git a/include/sysutils/NetlinkEvent.h b/include/sysutils/NetlinkEvent.h
index b329b09..1ee9849 100644
--- a/include/sysutils/NetlinkEvent.h
+++ b/include/sysutils/NetlinkEvent.h
@@ -30,17 +30,23 @@ public:
const static int NlActionAdd;
const static int NlActionRemove;
const static int NlActionChange;
+ const static int NlActionLinkDown;
+ const static int NlActionLinkUp;
NetlinkEvent();
virtual ~NetlinkEvent();
- bool decode(char *buffer, int size);
+ bool decode(char *buffer, int size, int format);
const char *findParam(const char *paramName);
const char *getSubsystem() { return mSubsystem; }
int getAction() { return mAction; }
void dump();
+
+ protected:
+ bool parseBinaryNetlinkMessage(char *buffer, int size);
+ bool parseAsciiNetlinkMessage(char *buffer, int size);
};
#endif
diff --git a/include/sysutils/NetlinkListener.h b/include/sysutils/NetlinkListener.h
index 2880046..1cf5f9f 100644
--- a/include/sysutils/NetlinkListener.h
+++ b/include/sysutils/NetlinkListener.h
@@ -22,9 +22,13 @@ class NetlinkEvent;
class NetlinkListener : public SocketListener {
char mBuffer[64 * 1024];
+ int mFormat;
public:
- NetlinkListener(int socket);
+ static const int NETLINK_FORMAT_ASCII = 0;
+ static const int NETLINK_FORMAT_BINARY = 1;
+
+ NetlinkListener(int socket, int format);
virtual ~NetlinkListener() {}
protected: