|
|
|
@ -63,8 +63,8 @@ extern "C" {
|
|
|
|
|
|
|
|
|
|
extern const char* programName;
|
|
|
|
|
|
|
|
|
|
KNetStatsView::KNetStatsView(KNetStats* tqparent, const TQString& interface)
|
|
|
|
|
: KSystemTray(tqparent, 0), mSysDevPath("/sys/class/net/"+interface+"/"), mInterface(interface) {
|
|
|
|
|
KNetStatsView::KNetStatsView(KNetStats* parent, const TQString& interface)
|
|
|
|
|
: KSystemTray(parent, 0), mSysDevPath("/sys/class/net/"+interface+"/"), mInterface(interface) {
|
|
|
|
|
mFdSock = 0;
|
|
|
|
|
mFirstUpdate = true;
|
|
|
|
|
mMaxSpeedAge = 0;
|
|
|
|
@ -82,7 +82,7 @@ KNetStatsView::KNetStatsView(KNetStats* tqparent, const TQString& interface)
|
|
|
|
|
strcpy(mDevInfo.ifr_name, mInterface.latin1());
|
|
|
|
|
|
|
|
|
|
setTextFormat(TQt::PlainText);
|
|
|
|
|
mContextMenu = tqparent->contextMenu();
|
|
|
|
|
mContextMenu = parent->contextMenu();
|
|
|
|
|
show();
|
|
|
|
|
|
|
|
|
|
// Timer
|
|
|
|
@ -366,12 +366,12 @@ TQString KNetStatsView::getIp() {
|
|
|
|
|
return inet_ntoa(sin.sin_addr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TQString KNetStatsView::getNettqmask() {
|
|
|
|
|
TQString KNetStatsView::getNetmask() {
|
|
|
|
|
if (mFdSock == -1 && !openFdSocket())
|
|
|
|
|
return "";
|
|
|
|
|
ioctl(mFdSock, SIOCGIFNETMASK, &mDevInfo);
|
|
|
|
|
sockaddr_in tqmask = ((sockaddr_in&)mDevInfo.ifr_netmask);
|
|
|
|
|
return inet_ntoa(tqmask.sin_addr);
|
|
|
|
|
sockaddr_in mask = ((sockaddr_in&)mDevInfo.ifr_netmask);
|
|
|
|
|
return inet_ntoa(mask.sin_addr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KNetStatsView::readOptions( const TQString& name, KNetStatsView::Options* opts, bool defaultVisibility ) {
|
|
|
|
|