From 4febfc2fe344143e968830e2ed4001a22049996c Mon Sep 17 00:00:00 2001
From: tho <tho@wiback.org>
Date: Fri, 29 Feb 2008 15:11:20 +0000
Subject: [PATCH] added some const's to the NetdeviceController

---
 Socket/NetdeviceController.cc |  7 +++++++
 Socket/NetdeviceController.hh | 14 +++++++-------
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/Socket/NetdeviceController.cc b/Socket/NetdeviceController.cc
index a11c494d0..b93998c04 100644
--- a/Socket/NetdeviceController.cc
+++ b/Socket/NetdeviceController.cc
@@ -52,6 +52,7 @@ prefix_ senf::NetdeviceController::NetdeviceController(int interface_index)
 }
 
 prefix_ std::string senf::NetdeviceController::interfaceName()
+    const
 {
     struct ifreq ifr;
     ifrName( ifr);
@@ -59,6 +60,7 @@ prefix_ std::string senf::NetdeviceController::interfaceName()
 }
 
 prefix_ senf::MACAddress senf::NetdeviceController::hardwareAddress()
+    const
 {
     struct ifreq ifr;
     ifrName( ifr);
@@ -67,6 +69,7 @@ prefix_ senf::MACAddress senf::NetdeviceController::hardwareAddress()
 }
 
 prefix_ int senf::NetdeviceController::mtu()
+    const
 {
     struct ifreq ifr;
     ifrName( ifr);
@@ -75,6 +78,7 @@ prefix_ int senf::NetdeviceController::mtu()
 }
 
 prefix_ void senf::NetdeviceController::mtu(int new_mtu)
+    const
 {
     struct ifreq ifr;
     ifrName( ifr);
@@ -83,6 +87,7 @@ prefix_ void senf::NetdeviceController::mtu(int new_mtu)
 }
 
 prefix_ int senf::NetdeviceController::interfaceIndex()
+    const
 {
     return ifindex_;
 }
@@ -100,6 +105,7 @@ prefix_ void senf::NetdeviceController::openSocket()
 }
 
 prefix_ void senf::NetdeviceController::ifrName(ifreq& ifr)
+    const
 {
     ::memset( &ifr, 0, sizeof(ifr));
     ifr.ifr_ifindex = ifindex_;
@@ -109,6 +115,7 @@ prefix_ void senf::NetdeviceController::ifrName(ifreq& ifr)
 
 
 prefix_ void senf::NetdeviceController::doIoctl(ifreq& ifr, int request)
+    const
 {
     if ( ::ioctl( sockfd_, request, &ifr ) < 0 )
         throw SystemException();
diff --git a/Socket/NetdeviceController.hh b/Socket/NetdeviceController.hh
index 1db865561..dbc5ce615 100644
--- a/Socket/NetdeviceController.hh
+++ b/Socket/NetdeviceController.hh
@@ -50,16 +50,16 @@ namespace senf {
         NetdeviceController(int interface_index);
         virtual ~NetdeviceController();
         
-        MACAddress hardwareAddress();
-        std::string interfaceName();
-        int interfaceIndex(); ///< return the interface index of the interface
-        int mtu();
-        void mtu(int new_mtu);
+        MACAddress hardwareAddress() const;
+        std::string interfaceName() const;
+        int interfaceIndex() const; ///< return the interface index of the interface
+        int mtu() const;
+        void mtu(int new_mtu) const;
     
     private:
         void openSocket();
-        void doIoctl(ifreq& ifr, int request);
-        void ifrName(ifreq& ifr);
+        void doIoctl(ifreq& ifr, int request) const;
+        void ifrName(ifreq& ifr) const;
         int sockfd_;
         int ifindex_;
     };
-- 
GitLab