blob: b329b0923bde24bbbeb1958a8efe69474e91f11c [file] [log] [blame]
San Mehat168415b2009-05-06 11:14:21 -07001/*
2 * Copyright (C) 2008 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#ifndef _NETLINKEVENT_H
17#define _NETLINKEVENT_H
18
19#define NL_PARAMS_MAX 32
20
21class NetlinkEvent {
22 int mSeq;
23 char *mPath;
24 int mAction;
25 char *mSubsystem;
26 char *mParams[NL_PARAMS_MAX];
27
28public:
29 const static int NlActionUnknown;
30 const static int NlActionAdd;
31 const static int NlActionRemove;
32 const static int NlActionChange;
33
34 NetlinkEvent();
35 virtual ~NetlinkEvent();
36
Wink Saville1d504ee2011-01-09 12:22:57 -080037 bool decode(char *buffer, int size);
San Mehat168415b2009-05-06 11:14:21 -070038 const char *findParam(const char *paramName);
39
40 const char *getSubsystem() { return mSubsystem; }
41 int getAction() { return mAction; }
San Mehatd6744132009-12-24 07:17:09 -080042
43 void dump();
San Mehat168415b2009-05-06 11:14:21 -070044};
45
46#endif