summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/lancard/lancard_NN.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/lancard/lancard_NN.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/lancard/lancard_NN.cpp19
1 files changed, 1 insertions, 18 deletions
diff --git a/noncore/settings/networksettings2/lancard/lancard_NN.cpp b/noncore/settings/networksettings2/lancard/lancard_NN.cpp
index fce3d29..520516c 100644
--- a/noncore/settings/networksettings2/lancard/lancard_NN.cpp
+++ b/noncore/settings/networksettings2/lancard/lancard_NN.cpp
@@ -1,33 +1,29 @@
1#include "lancard_NN.h" 1#include "lancard_NN.h"
2#include "lancard_NNI.h" 2#include "lancard_NNI.h"
3 3
4#ifndef MYPLUGIN
5
6#include "netnodeinterface.h" 4#include "netnodeinterface.h"
7 5
8#endif
9
10static const char * LanCardNeeds[] = 6static const char * LanCardNeeds[] =
11 { 0 7 { 0
12 }; 8 };
13 9
14static const char * LanCardProvides[] = 10static const char * LanCardProvides[] =
15 { "device", 11 { "device",
16 0 12 0
17 }; 13 };
18 14
19/** 15/**
20 * Constructor, find all of the possible interfaces 16 * Constructor, find all of the possible interfaces
21 */ 17 */
22LanCardNetNode::LanCardNetNode() : ANetNode(tr("LAN card")), NICMACAddresses() { 18LanCardNetNode::LanCardNetNode() : ANetNode(tr("LAN card")), NICMACAddresses() {
23 InstanceCount = 2; 19 InstanceCount = 2;
24} 20}
25 21
26/** 22/**
27 * Delete any interfaces that we own. 23 * Delete any interfaces that we own.
28 */ 24 */
29LanCardNetNode::~LanCardNetNode(){ 25LanCardNetNode::~LanCardNetNode(){
30} 26}
31 27
32const QString LanCardNetNode::nodeDescription(){ 28const QString LanCardNetNode::nodeDescription(){
33 return tr("\ 29 return tr("\
@@ -55,38 +51,25 @@ QString LanCardNetNode::genNic( long nr ) {
55 return S.sprintf( "eth%ld", nr ); 51 return S.sprintf( "eth%ld", nr );
56} 52}
57 53
58void LanCardNetNode::setSpecificAttribute( QString & A, QString & V ) { 54void LanCardNetNode::setSpecificAttribute( QString & A, QString & V ) {
59 if( A == "interfacecount" ) { 55 if( A == "interfacecount" ) {
60 InstanceCount = V.toLong(); 56 InstanceCount = V.toLong();
61 } else if ( A == "macaddress" ) { 57 } else if ( A == "macaddress" ) {
62 NICMACAddresses.append( V ); 58 NICMACAddresses.append( V );
63 } 59 }
64} 60}
65 61
66void LanCardNetNode::saveSpecificAttribute( QTextStream & TS) { 62void LanCardNetNode::saveSpecificAttribute( QTextStream & TS) {
67 TS << "interfacecount=" 63 TS << "interfacecount="
68 << InstanceCount 64 << InstanceCount
69 << endl; 65 << endl;
70 for( QStringList::Iterator it = NICMACAddresses.begin(); 66 for( QStringList::Iterator it = NICMACAddresses.begin();
71 it != NICMACAddresses.end(); 67 it != NICMACAddresses.end();
72 ++it ) { 68 ++it ) {
73 TS << "macaddress=" 69 TS << "macaddress="
74 << (*it) 70 << (*it)
75 << endl; 71 << endl;
76 } 72 }
77} 73}
78 74
79#ifdef MYPLUGIN 75OPIE_NS2_PLUGIN( NetNodeInterface_T<LanCardNetNode> )
80
81extern "C" {
82void create_plugin( QList<ANetNode> & PNN ) {
83 PNN.append( new LanCardNetNode() );
84}
85
86#else
87
88OPIE_NS2_PLUGIN( NetNodeInterface<LanCardNetNode> )
89
90#endif
91
92}