Ignore:
Timestamp:
Oct 15, 2012, 7:17:04 PM (12 years ago)
Author:
Michael Tänzer
Message:

Clean up NetworkChangeDetection

Location:
source/ariba/communication/networkinfo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/communication/networkinfo/NetworkChangeDetection.cpp

    r8569 r10767  
    3838
    3939#include "NetworkChangeDetection.h"
     40
     41#include <string>
     42#include <algorithm>
     43#include <cerrno>
     44#include <string.h>
     45#include <sys/types.h>
     46#include <unistd.h>
     47#include <boost/bind.hpp>
     48#include <sys/socket.h>
     49
     50extern "C" {
     51        #include <linux/netlink.h>
     52        #include <linux/rtnetlink.h>
     53}
     54
     55#include "ariba/utility/system/SystemQueue.h"
     56
     57using std::find;
     58using ariba::utility::SystemQueue;
     59using ariba::utility::SystemEventType;
    4060
    4161namespace ariba {
     
    123143        if( obj->routingSocket < 0 ){
    124144                logging_error("could not connect to routing socket: " +
    125                                         string(strerror(errno)));
     145                                        std::string(strerror(errno)));
    126146                return;
    127147        }
     
    155175        if( ret < 0 ){
    156176                close( obj->routingSocket );
    157                 logging_error( "could not bind routing socket: " + string(strerror(errno)) );
     177                logging_error( "could not bind routing socket: " + std::string(strerror(errno)) );
    158178                return;
    159179        }
     
    185205                        // all others are some kind of error
    186206                        logging_error( "could not read from routing socket: " +
    187                                                         string(strerror(errno)) );
     207                                                        std::string(strerror(errno)) );
    188208                        break;
    189209                }
  • source/ariba/communication/networkinfo/NetworkChangeDetection.h

    r8569 r10767  
    4040#define __NETWORK_CHANGE_DETECTION_H
    4141
    42 #include <cerrno>
    43 #include <csignal>
     42// Forward declarations
     43struct nlmsghdr;
     44
    4445#include <vector>
    45 #include <algorithm>
    46 #include <string>
    47 #include <net/if.h>
    48 #include <arpa/inet.h>
    49 #include <linux/types.h>
    50 #include <linux/netlink.h>
    51 #include <linux/rtnetlink.h>
    52 #include <sys/types.h>
    53 #include <sys/socket.h>
    54 #include <sys/ioctl.h>
    55 #include <boost/thread/mutex.hpp>
    5646#include <boost/thread/thread.hpp>
    57 #include <boost/utility.hpp>
    58 #include <boost/bind.hpp>
    59 #include "ariba/communication/networkinfo/NetworkChangeInterface.h"
    60 #include "ariba/communication/networkinfo/NetworkInformation.h"
    61 #include "ariba/utility/system/SystemQueue.h"
     47
     48#include "NetworkInformation.h"
     49#include "NetworkChangeInterface.h"
    6250#include "ariba/utility/logging/Logging.h"
    63 
    64 using std::string;
    65 using std::vector;
    66 using std::find;
    67 using ariba::utility::SystemQueue;
    68 using ariba::utility::SystemEvent;
    69 using ariba::utility::SystemEventType;
    70 using ariba::utility::SystemEventListener;
    71 using ariba::communication::NetworkInformation;
     51#include "ariba/utility/system/SystemEventListener.h"
    7252
    7353namespace ariba {
    7454namespace communication {
     55
     56using ariba::utility::SystemEvent;
     57using ariba::utility::SystemEventListener;
    7558
    7659class NetworkChangeDetection : public SystemEventListener {
     
    8770
    8871private:
    89         typedef vector<NetworkChangeInterface*> RegistrationList;
     72        typedef std::vector<NetworkChangeInterface*> RegistrationList;
    9073        RegistrationList registrations;
    9174
Note: See TracChangeset for help on using the changeset viewer.