~ubuntu-branches/ubuntu/precise/knemo/precise

« back to all changes in this revision

Viewing changes to src/knemod/backends/sysbackend.h

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2010-01-06 17:16:51 UTC
  • mfrom: (1.1.9 upstream) (2.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20100106171651-ff58ryfnav4l1zbm
Tags: 0.6.0-1
* New upstream release 
  - Fixes "FTBFS: sysbackend.cpp:362: error: 'KILO' was not declared in
  this scope" (Closes: #560496)
  - Fixes "context menu does not appear" (Closes: #504791)
* Add Build-Depends: libnl-dev - Linux netlink sockets library

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* This file is part of KNemo
2
 
   Copyright (C) 2006 Percy Leonhardt <percy@eris23.de>
3
 
   Copyright (C) 2009 John Stamp <jstamp@users.sourceforge.net>
4
 
 
5
 
   KNemo is free software; you can redistribute it and/or modify
6
 
   it under the terms of the GNU Library General Public License as
7
 
   published by the Free Software Foundation; either version 2 of
8
 
   the License, or (at your option) any later version.
9
 
 
10
 
   KNemo is distributed in the hope that it will be useful,
11
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
   GNU Library General Public License for more details.
14
 
 
15
 
   You should have received a copy of the GNU Library General Public License
16
 
   along with this library; see the file COPYING.LIB.  If not, write to
17
 
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
 
   Boston, MA 02110-1301, USA.
19
 
*/
20
 
 
21
 
#ifndef SYSBACKEND_H
22
 
#define SYSBACKEND_H
23
 
 
24
 
#include "backendbase.h"
25
 
#ifdef HAVE_LIBIW
26
 
#include <iwlib.h>
27
 
#endif
28
 
 
29
 
/**
30
 
 * The sys backend uses the sys filesystem available in 2.6
31
 
 * kernels. It reads all necessary information from the files
32
 
 * and folders located at /sys and parses their output.
33
 
 * It then triggers the interface monitor to look for changes
34
 
 * in the state of the interface.
35
 
 *
36
 
 * @short Update the information of the interfaces via sys filesystem
37
 
 * @author Percy Leonhardt <percy@eris23.de>
38
 
 */
39
 
 
40
 
class SysBackend : public BackendBase
41
 
{
42
 
public:
43
 
    SysBackend(QHash<QString, Interface *>& interfaces );
44
 
    virtual ~SysBackend();
45
 
 
46
 
    static BackendBase* createInstance( QHash<QString, Interface *>& interfaces );
47
 
 
48
 
    void update();
49
 
    QString getDefaultRouteIface();
50
 
 
51
 
private:
52
 
    bool readNumberFromFile( const QString& fileName, unsigned int& value );
53
 
    bool readStringFromFile( const QString& fileName, QString& string );
54
 
    void updateWirelessData( int fd, const QString& ifName, WirelessData& data );
55
 
    void updateInterfaceData( const QString& ifName, InterfaceData& data, int type );
56
 
#ifdef HAVE_LIBIW
57
 
    void updateWirelessEncData( int fd, const QString& ifName, const iw_range& range, WirelessData& data );
58
 
#endif
59
 
 
60
 
};
61
 
 
62
 
#endif // SYSBACKEND_H