blob: a1aaba6ee1b498caa5573c8a45d63e324b19f709 [file] [log] [blame]
Paul Stewarta3c56f92011-05-26 07:08:52 -07001// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef SHILL_RTNL_LISTENER_
6#define SHILL_RTNL_LISTENER_
7
Eric Shienbrood3e20a232012-02-16 11:35:56 -05008#include <base/callback.h>
Paul Stewarta3c56f92011-05-26 07:08:52 -07009
Paul Stewarta3c56f92011-05-26 07:08:52 -070010namespace shill {
11
Chris Masone2aa97072011-08-09 17:35:08 -070012class RTNLMessage;
13
Paul Stewarta3c56f92011-05-26 07:08:52 -070014class RTNLListener {
15 public:
Chris Masone2aa97072011-08-09 17:35:08 -070016 RTNLListener(int listen_flags,
Eric Shienbrood3e20a232012-02-16 11:35:56 -050017 const base::Callback<void(const RTNLMessage &)> &callback);
Paul Stewarta3c56f92011-05-26 07:08:52 -070018 ~RTNLListener();
Darin Petkovca432fc2011-07-08 15:56:57 -070019
Chris Masone2aa97072011-08-09 17:35:08 -070020 void NotifyEvent(int type, const RTNLMessage &msg);
Darin Petkovca432fc2011-07-08 15:56:57 -070021
Paul Stewarta3c56f92011-05-26 07:08:52 -070022 private:
23 int listen_flags_;
Eric Shienbrood3e20a232012-02-16 11:35:56 -050024 base::Callback<void(const RTNLMessage &)> callback_;
Darin Petkovca432fc2011-07-08 15:56:57 -070025
Paul Stewarta3c56f92011-05-26 07:08:52 -070026 DISALLOW_COPY_AND_ASSIGN(RTNLListener);
27};
28
29} // namespace shill
30
31#endif // SHILL_RTNL_LISTENER_