1 // 2 // Copyright (C) 2011 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 17 #ifndef SHILL_NET_RTNL_LISTENER_H_ 18 #define SHILL_NET_RTNL_LISTENER_H_ 19 20 #include <base/callback.h> 21 22 #include "shill/net/shill_export.h" 23 24 namespace shill { 25 26 class RTNLHandler; 27 class RTNLMessage; 28 29 class SHILL_EXPORT RTNLListener { 30 public: 31 RTNLListener(int listen_flags, 32 const base::Callback<void(const RTNLMessage&)>& callback); 33 RTNLListener(int listen_flags, 34 const base::Callback<void(const RTNLMessage&)>& callback, 35 RTNLHandler *rtnl_handler); 36 ~RTNLListener(); 37 38 void NotifyEvent(int type, const RTNLMessage& msg); 39 40 private: 41 int listen_flags_; 42 base::Callback<void(const RTNLMessage&)> callback_; 43 RTNLHandler *rtnl_handler_; 44 45 DISALLOW_COPY_AND_ASSIGN(RTNLListener); 46 }; 47 48 } // namespace shill 49 50 #endif // SHILL_NET_RTNL_LISTENER_H_ 51