diff options
Diffstat (limited to 'lanbrowsing/lisa')
-rw-r--r-- | lanbrowsing/lisa/addressvalidator.cpp | 42 | ||||
-rw-r--r-- | lanbrowsing/lisa/addressvalidator.h | 4 | ||||
-rw-r--r-- | lanbrowsing/lisa/client.cpp | 8 | ||||
-rw-r--r-- | lanbrowsing/lisa/client.h | 2 | ||||
-rw-r--r-- | lanbrowsing/lisa/main.cpp | 4 | ||||
-rw-r--r-- | lanbrowsing/lisa/netmanager.cpp | 12 | ||||
-rw-r--r-- | lanbrowsing/lisa/netscanner.cpp | 12 | ||||
-rw-r--r-- | lanbrowsing/lisa/strictmain.cpp | 4 |
8 files changed, 44 insertions, 44 deletions
diff --git a/lanbrowsing/lisa/addressvalidator.cpp b/lanbrowsing/lisa/addressvalidator.cpp index 70207ece..aa292806 100644 --- a/lanbrowsing/lisa/addressvalidator.cpp +++ b/lanbrowsing/lisa/addressvalidator.cpp @@ -33,7 +33,7 @@ using namespace std; AddressValidator::AddressValidator(const MyString& addressSpecs) //this is 127.0.0.0 :localhostNet(htonl(0x7f000000)) -//with tqmask 255.255.255.0 +//with mask 255.255.255.0 ,localhostMask(htonl(0xffffff00)) { clearSpecs(); @@ -44,7 +44,7 @@ AddressValidator::AddressValidator(const MyString& addressSpecs) AddressValidator::AddressValidator() //this is 127.0.0.0 :localhostNet(htonl(0x7f000000)) - //with tqmask 255.255.255.0 + //with mask 255.255.255.0 ,localhostMask(htonl(0xffffff00)) { clearSpecs(); @@ -115,11 +115,11 @@ void AddressValidator::setValidAddresses(MyString addressSpecs) pos=nextPart.find('/'); MyString netStr=nextPart.left(pos); MyString maskStr=nextPart.mid(pos+1); - int tqmask=inet_addr(maskStr.data()); - int net= (inet_addr(netStr.data()) & tqmask); - dcerr<<"setValidAddresses: net/tqmask: " - <<std::ios::hex<<net<<"/"<<tqmask<<std::ios::dec<<std::endl; - addSpec(NETMASK_SPEC,net,tqmask); + int mask=inet_addr(maskStr.data()); + int net= (inet_addr(netStr.data()) & mask); + dcerr<<"setValidAddresses: net/mask: " + <<std::ios::hex<<net<<"/"<<mask<<std::ios::dec<<std::endl; + addSpec(NETMASK_SPEC,net,mask); } } } @@ -130,19 +130,19 @@ void AddressValidator::clearSpecs() for (int i=0; i<MAX_SPECS; i++) { specs[i].address=0; - specs[i].tqmask=0; + specs[i].mask=0; specs[i].typeOfSpec=NO_SPEC; } } -void AddressValidator::addSpec(int type, int address, int tqmask) +void AddressValidator::addSpec(int type, int address, int mask) { for (int i=0; i<MAX_SPECS; i++) { if (specs[i].typeOfSpec==NO_SPEC) { specs[i].address=address; - specs[i].tqmask=tqmask; + specs[i].mask=mask; specs[i].typeOfSpec=type; return; } @@ -155,7 +155,7 @@ int AddressValidator::isValid(int addressNBO) <<std::ios::hex<<addressNBO<<std::ios::dec<<std::endl; //localhost is always allowed dcerr<<"isValid() local net: "<< - std::ios::hex<<localhostNet<<" tqmask: "<<localhostMask<<" AND: "<<(addressNBO & + std::ios::hex<<localhostNet<<" mask: "<<localhostMask<<" AND: "<<(addressNBO & localhostMask)<<std::ios::dec<<std::endl; if ((addressNBO & localhostMask) == localhostNet) return 1; @@ -183,17 +183,17 @@ int AddressValidator::isValid(int addressNBO) else if (specs[i].typeOfSpec==NETMASK_SPEC) { dcerr<<"isValid: ANDing "<< - std::ios::hex<<(addressNBO & specs[i].tqmask)<<" "<< + std::ios::hex<<(addressNBO & specs[i].mask)<<" "<< specs[i].address<<std::ios::dec<<std::endl; - if ((addressNBO & specs[i].tqmask) == specs[i].address) + if ((addressNBO & specs[i].mask) == specs[i].address) { - dcerr<<"isValid: net/tqmask"<<std::endl; + dcerr<<"isValid: net/mask"<<std::endl; return 1; } } else if (specs[i].typeOfSpec==RANGE_SPEC) { - if ((ntohl(addressNBO)>=specs[i].address) && (ntohl(addressNBO)<=specs[i].tqmask)) + if ((ntohl(addressNBO)>=specs[i].address) && (ntohl(addressNBO)<=specs[i].mask)) { dcerr<<"isValid: range"<<std::endl; return 1; @@ -202,19 +202,19 @@ int AddressValidator::isValid(int addressNBO) else if (specs[i].typeOfSpec==MULTIRANGE_SPEC) { unsigned int addr=ntohl(addressNBO); - dcerr<<"isValid ntohl="<<hex<<addr<<" addr: "<<specs[i].address<<" ma: "<<specs[i].tqmask<<dec<<std::endl; - unsigned int tqmask=0x000000ff; + dcerr<<"isValid ntohl="<<hex<<addr<<" addr: "<<specs[i].address<<" ma: "<<specs[i].mask<<dec<<std::endl; + unsigned int mask=0x000000ff; int failure=0; for (int j=0; j<4; j++) { - dcerr<<"isValid "<<hex<<"tqmask="<<tqmask<<" addr="<<(addr&tqmask)<<" addr="<<(specs[i].address & tqmask)<<" ma="<<(specs[i].tqmask&tqmask)<<std::endl; - if (((addr & tqmask) < (specs[i].address & tqmask)) - || ((addr & tqmask) > (specs[i].tqmask & tqmask))) + dcerr<<"isValid "<<hex<<"mask="<<mask<<" addr="<<(addr&mask)<<" addr="<<(specs[i].address & mask)<<" ma="<<(specs[i].mask&mask)<<std::endl; + if (((addr & mask) < (specs[i].address & mask)) + || ((addr & mask) > (specs[i].mask & mask))) { failure=1; break; } - tqmask=tqmask<<8; + mask=mask<<8; } dcerr<<"isValid: multirange"<<std::endl; if (!failure) diff --git a/lanbrowsing/lisa/addressvalidator.h b/lanbrowsing/lisa/addressvalidator.h index c2c332ab..6f1c723e 100644 --- a/lanbrowsing/lisa/addressvalidator.h +++ b/lanbrowsing/lisa/addressvalidator.h @@ -29,7 +29,7 @@ struct AddressSpec { int address; - int tqmask; + int mask; int typeOfSpec; }; @@ -48,7 +48,7 @@ class AddressValidator int localhostNet; int localhostMask; MyString allowedHosts; - void addSpec(int type, int address, int tqmask=0); + void addSpec(int type, int address, int mask=0); AddressSpec specs[MAX_SPECS]; }; diff --git a/lanbrowsing/lisa/client.cpp b/lanbrowsing/lisa/client.cpp index 92b62dc5..21069a17 100644 --- a/lanbrowsing/lisa/client.cpp +++ b/lanbrowsing/lisa/client.cpp @@ -34,8 +34,8 @@ #define dcerr if (LISA_DEBUG==1) std::cerr<<"Client::" -Client::Client(NetManager* tqparent, int socketFD, int closeOnDelete) -:parentServer(tqparent) +Client::Client(NetManager* parent, int socketFD, int closeOnDelete) +:parentServer(parent) ,m_fd(socketFD) ,m_done(0) ,m_closeOnDelete(closeOnDelete) @@ -79,13 +79,13 @@ int Client::tryToGetInfo() /* int pid=fork(); if (pid==-1) { - //tqparent + //parent dcerr<<"NetScanner::scan: error occurred"<<std::endl; return 1; } else if (pid!=0) { - //tqparent + //parent return 1; };*/ //child diff --git a/lanbrowsing/lisa/client.h b/lanbrowsing/lisa/client.h index b6311235..efcf5f86 100644 --- a/lanbrowsing/lisa/client.h +++ b/lanbrowsing/lisa/client.h @@ -23,7 +23,7 @@ class NetManager; class Client { public: - Client(NetManager* tqparent, int socketFD, int closeOnDelete=1); + Client(NetManager* parent, int socketFD, int closeOnDelete=1); Client(); Client(const Client& c); ~Client(); diff --git a/lanbrowsing/lisa/main.cpp b/lanbrowsing/lisa/main.cpp index e75fa0c1..7de59389 100644 --- a/lanbrowsing/lisa/main.cpp +++ b/lanbrowsing/lisa/main.cpp @@ -225,11 +225,11 @@ int main(int argc, char** argv) } } - //fork and let the tqparent exit + //fork and let the parent exit pid_t pid=fork(); if (pid>0) { - //this is the tqparent + //this is the parent exit(0); } else if (pid<0) diff --git a/lanbrowsing/lisa/netmanager.cpp b/lanbrowsing/lisa/netmanager.cpp index 46002ed1..e652ce97 100644 --- a/lanbrowsing/lisa/netmanager.cpp +++ b/lanbrowsing/lisa/netmanager.cpp @@ -142,11 +142,11 @@ void NetManager::configure(Config& config) MyString netAddressStr=tmp.left(tmp.find('/')); tmp=tmp.mid(tmp.find('/')+1); tmp=tmp.left(tmp.find(';')); - mdcerr<<"NetManager::readConfig: broadcastNet "<<netAddressStr<<" with tqmask "<<tmp<<std::endl; + mdcerr<<"NetManager::readConfig: broadcastNet "<<netAddressStr<<" with mask "<<tmp<<std::endl; int netMask=inet_addr(tmp.c_str()); int netAddress=inet_addr(netAddressStr.c_str()); m_broadcastAddress= netAddress | (~netMask); - mdcerr<<"NetManager::readConfig: net "<<std::ios::hex<<netAddress<<" with tqmask "<<netMask<<" gives "<<m_broadcastAddress<<std::endl; + mdcerr<<"NetManager::readConfig: net "<<std::ios::hex<<netAddress<<" with mask "<<netMask<<" gives "<<m_broadcastAddress<<std::endl; //maybe this way we can avoid that all servers on the net send //their requests synchronously, since now the refreshtime isn't @@ -602,7 +602,7 @@ void NetManager::scan() } else if (pid!=0) { - //tqparent + //parent ::close(fileDescr[1]); m_pipeFD=fileDescr[0]; m_childPid=pid; @@ -617,7 +617,7 @@ void NetManager::scan() doScan(); //in the child we don't have to call setServerServer() //since this opens the listening socket, what has to be done - //in the tqparent process + //in the parent process m_serverServer=1; } else @@ -629,7 +629,7 @@ void NetManager::scan() doScan(); //in the child we don't have to call setServerServer() //since this opens the listening socket, what has to be done - //in the tqparent process + //in the parent process m_serverServer=1; } else @@ -639,7 +639,7 @@ void NetManager::scan() m_serverServer=0; } } - mdcerr<<" NetScanner::scan: sending information to tqparent process"<<std::endl; + mdcerr<<" NetScanner::scan: sending information to parent process"<<std::endl; writeDataToFD(fileDescr[1],m_serverServer); mdcerr<<" NetScanner::scan: closed FD: "<<::close(fileDescr[1])<<std::endl; mdcerr<<" NetScanner::scan: exiting now"<<std::endl; diff --git a/lanbrowsing/lisa/netscanner.cpp b/lanbrowsing/lisa/netscanner.cpp index 5486c506..acf0515c 100644 --- a/lanbrowsing/lisa/netscanner.cpp +++ b/lanbrowsing/lisa/netscanner.cpp @@ -189,15 +189,15 @@ struct in_addr NetScanner::getIPfromArray(unsigned int index) { if (tmp.contains('/')) { - //mdcerr<<"net/tqmask combination detected"<<std::endl; + //mdcerr<<"net/mask combination detected"<<std::endl; MyString netStr(tmp.left(tmp.find("/"))); MyString maskStr(tmp.mid(tmp.find("/")+1)); - unsigned int tqmask(IPAddress(maskStr).asInt()); - unsigned int net(IPAddress(netStr).asInt()&tqmask); - if ((~tqmask)<indexLeft) + unsigned int mask(IPAddress(maskStr).asInt()); + unsigned int net(IPAddress(netStr).asInt()&mask); + if ((~mask)<indexLeft) { - indexLeft=indexLeft-(~tqmask+1); - tmpIndex+=(~tqmask)+1; + indexLeft=indexLeft-(~mask+1); + tmpIndex+=(~mask)+1; //mdcerr<<"i: "<<tmpIndex<<" left: "<<indexLeft<<std::endl; } else diff --git a/lanbrowsing/lisa/strictmain.cpp b/lanbrowsing/lisa/strictmain.cpp index 829c8f5d..a948d6df 100644 --- a/lanbrowsing/lisa/strictmain.cpp +++ b/lanbrowsing/lisa/strictmain.cpp @@ -203,11 +203,11 @@ int main(int argc, char** argv) } } - //fork and let the tqparent exit + //fork and let the parent exit pid_t pid=fork(); if (pid>0) { - //this is the tqparent + //this is the parent exit(0); } else if (pid<0) |