summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/lancard/lancardrun.h
blob: 8dbd1b11555b602f7a7bd60bd5541e56296fd20c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef LANCARDRUN_H
#define LANCARDRUN_H

#include <asdevice.h>
#include <qregexp.h>
#include "lancarddata.h"

class LanCardRun  : public AsDevice {

public :

      LanCardRun( ANetNodeInstance * NNI, 
                  LanCardData & Data ) : AsDevice( NNI ),
                                         Pat( "eth[0-9]" )
        { }

      virtual long count( void )
        { return 2; }
      virtual QString genNic( long nr )
        { QString S; return S.sprintf( "eth%ld", nr ); }

      virtual AsDevice * device( void ) 
        { return (AsDevice *)this; }

      virtual AsDevice * asDevice( void ) 
        { return (AsDevice *)this; }

protected :

      void detectState( NodeCollection * NC );
      bool setState( NodeCollection * NC, Action_t A );
      bool canSetState( State_t Curr, Action_t A );

      bool handlesInterface( const QString & I );

private :

      InterfaceInfo * getInterface( void );
      QRegExp Pat;

};
#endif