Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Modem Class Reference

#include </home/clem/local/src/opie/noncore/settings/networksettings/ppp/modem.h>

Collaboration diagram for Modem:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Auth { PAP = 1, CHAP }

Signals

void charWaiting (unsigned char)

Public Member Functions

 Modem (PPPData *)
 ~Modem ()
const QString getDevice ()
void setDevice (const QString dev)
void save ()
bool opentty ()
bool closetty ()
bool hangup ()
bool writeChar (unsigned char)
bool writeLine (const char *)
bool dataMode () const
void setDataMode (bool set)
const QString modemMessage ()
speed_t modemspeed ()
void notify (const QObject *, const char *)
void stop ()
void flush ()
int lockdevice ()
void unlockdevice ()
bool setSecret (int, const char *, const char *)
bool removeSecret (int)
void killPPPDaemon ()
int pppdExitStatus ()
bool execPPPDaemon (const QString &arguments)
int openResolv (int flags)
bool setHostname (const QString &name)
QString pppDevice () const
void setPPPDevice (const QString &)
pid_t pppPID () const
void setPPPDPid (pid_t)

Static Public Member Functions

static QString parseModemSpeed (const QString &)

Public Attributes

int lastStatus

Private Types

enum  { MaxPathLen = 30, MaxStrLen = 40, MaxArgs = 100 }
enum  { Original = 0x100, New = 0x200, Old = 0x400 }

Private Slots

void startNotifier ()
void stopNotifier ()
void readtty (int)
void slotModemDebug (int)

Private Member Functions

const char * authFile (Auth method, int version=Original)
bool createAuthFile (Auth method, const char *username, const char *password)
bool removeAuthFile (Auth method)
bool execpppd (const char *arguments)
bool killpppd ()
void parseargs (char *buf, char **args)
void escape_to_command_mode ()
int openLockfile (QString, int)

Private Attributes

enum Modem:: { ... }  Version
QString device
QString lockfile
int modemfd
int pppdPid
int _pppdExitStatus
QSocketNotifier * sn
QSocketNotifier * m_modemDebug
bool data_mode
QString errmsg
termios initial_tty
termios tty
bool modem_is_locked
PPPData_pppdata
int m_pppdLOG [2]
QString m_pppdDev

Member Enumeration Documentation

anonymous enum [private]
 

Enumeration values:
MaxPathLen 
MaxStrLen 
MaxArgs 

Definition at line 99 of file modem.h.

anonymous enum [private]
 

Enumeration values:
Original 
New 
Old 

Definition at line 100 of file modem.h.

enum Modem::Auth
 

Enumeration values:
PAP 
CHAP 

Definition at line 85 of file modem.h.


Constructor & Destructor Documentation

Modem::Modem PPPData  ) 
 

Definition at line 97 of file modem.cpp.

References _pppdata, _pppdExitStatus, data_mode, device, lockfile, m_modemDebug, modem_is_locked, modemfd, pppdPid, and sn.

Modem::~Modem  ) 
 

Definition at line 111 of file modem.cpp.


Member Function Documentation

const char * Modem::authFile Auth  method,
int  version = Original
[private]
 

Definition at line 695 of file modem.cpp.

References CHAP, CHAP_AUTH_FILE, New, Old, Original, PAP, and PAP_AUTH_FILE.

Referenced by createAuthFile(), and removeAuthFile().

void Modem::charWaiting unsigned  char  )  [signal]
 

Referenced by notify(), readtty(), and stop().

bool Modem::closetty  ) 
 

Definition at line 260 of file modem.cpp.

References errmsg, initial_tty, modemfd, stop(), and tr.

Referenced by ModemTransfer::ati_done(), ModemTransfer::cancelbutton(), and hangup().

bool Modem::createAuthFile Auth  method,
const char *  username,
const char *  password
[private]
 

Definition at line 721 of file modem.cpp.

References authFile(), MaxStrLen, MY_ASSERT, New, and Old.

Referenced by setSecret().

bool Modem::dataMode  )  const [inline]
 

Definition at line 59 of file modem.h.

References data_mode.

void Modem::escape_to_command_mode  )  [private]
 

Definition at line 452 of file modem.cpp.

References _pppdata, data_mode, QCString::length(), PPPData::modemEscapeGuardTime(), PPPData::modemEscapeStr(), modemfd, and write().

Referenced by hangup().

bool Modem::execpppd const char *  arguments  )  [private]
 

Definition at line 875 of file modem.cpp.

References _pppdExitStatus, buf, checkForInterface(), QString::fromLatin1(), m_modemDebug, m_pppdDev, m_pppdLOG, MAX_CMDLEN, MaxArgs, modemfd, odebug, oendl, parseargs(), pppdPath(), pppdPid, slotModemDebug(), and strlcpy.

Referenced by execPPPDaemon().

bool Modem::execPPPDaemon const QString arguments  ) 
 

Definition at line 1022 of file modem.cpp.

References _pppdata, execpppd(), and PPPData::setpppdRunning().

void Modem::flush  ) 
 

Definition at line 333 of file modem.cpp.

References modemfd.

Referenced by ModemTransfer::init().

const QString Modem::getDevice  )  [inline]
 

Definition at line 49 of file modem.h.

References device.

bool Modem::hangup  ) 
 

Definition at line 387 of file modem.cpp.

References _pppdata, alarm_handler(), closetty(), data_mode, errmsg, escape_to_command_mode(), jmp_buffer, modemfd, PPPData::modemHangupStr(), PPPData::modemInitDelay(), modemspeed(), tr, and writeLine().

Referenced by ModemTransfer::cancelbutton(), and ModemTransfer::init().

bool Modem::killpppd  )  [private]
 

Definition at line 964 of file modem.cpp.

References m_modemDebug, odebug, oendl, and pppdPid.

Referenced by killPPPDaemon().

void Modem::killPPPDaemon  ) 
 

Definition at line 1031 of file modem.cpp.

References _pppdata, killpppd(), and PPPData::setpppdRunning().

int Modem::lockdevice  ) 
 

Definition at line 579 of file modem.cpp.

References _pppdata, QFile::encodeName(), LOCK_DIR, lockfile, match(), modem_is_locked, PPPData::modemDevice(), PPPData::modemLockFile(), odebug, oendl, openLockfile(), and write().

Referenced by ModemTransfer::init().

const QString Modem::modemMessage  ) 
 

Definition at line 473 of file modem.cpp.

References errmsg.

Referenced by ModemTransfer::init().

speed_t Modem::modemspeed  ) 
 

Definition at line 116 of file modem.cpp.

References _pppdata, i, and PPPData::speed().

Referenced by hangup(), and opentty().

void Modem::notify const QObject *  ,
const char * 
 

Definition at line 296 of file modem.cpp.

References charWaiting(), and startNotifier().

Referenced by ModemTransfer::init().

int Modem::openLockfile QString  ,
int 
[private]
 

Definition at line 652 of file modem.cpp.

References device, DEVNULL, QString::findRev(), QString::latin1(), QString::length(), LOCK_DIR, QString::null, odebug, oendl, and QString::right().

Referenced by lockdevice().

int Modem::openResolv int  flags  ) 
 

Definition at line 1042 of file modem.cpp.

References _PATH_RESCONF, DEVNULL, odebug, and oendl.

bool Modem::opentty  ) 
 

Definition at line 165 of file modem.cpp.

References _pppdata, device, errmsg, flags, PPPData::flowcontrol(), PPPData::FlowHardware, PPPData::FlowNone, initial_tty, PPPData::modemDevice(), modemfd, modemspeed(), odebug, oendl, tr, and tty.

Referenced by ModemTransfer::init().

void Modem::parseargs char *  buf,
char **  args
[private]
 

Definition at line 982 of file modem.cpp.

References MaxArgs.

Referenced by execpppd().

QString Modem::parseModemSpeed const QString  )  [static]
 

Definition at line 478 of file modem.cpp.

References i, QString::latin1(), len, match(), QRegExp::match(), QString::mid(), odebug, oendl, QString::setNum(), QString::sprintf(), QString::toInt(), and tr.

QString Modem::pppDevice  )  const
 

Definition at line 1057 of file modem.cpp.

References m_pppdDev.

int Modem::pppdExitStatus  ) 
 

Definition at line 1037 of file modem.cpp.

References _pppdExitStatus.

pid_t Modem::pppPID  )  const
 

Definition at line 1063 of file modem.cpp.

References pppdPid.

void Modem::readtty int   )  [private, slot]
 

Definition at line 280 of file modem.cpp.

References charWaiting(), i, len, and modemfd.

Referenced by startNotifier().

bool Modem::removeAuthFile Auth  method  )  [private]
 

Definition at line 778 of file modem.cpp.

References authFile(), and Old.

Referenced by removeSecret().

bool Modem::removeSecret int   ) 
 

Definition at line 817 of file modem.cpp.

References AUTH_CHAP, AUTH_PAP, CHAP, PAP, and removeAuthFile().

void Modem::save  ) 
 

void Modem::setDataMode bool  set  )  [inline]
 

Definition at line 60 of file modem.h.

References data_mode.

void Modem::setDevice const QString  dev  )  [inline]
 

Definition at line 50 of file modem.h.

References device.

bool Modem::setHostname const QString name  ) 
 

Definition at line 1052 of file modem.cpp.

References QString::length().

void Modem::setPPPDevice const QString  ) 
 

Definition at line 1060 of file modem.cpp.

References m_pppdDev.

void Modem::setPPPDPid pid_t   ) 
 

Definition at line 1066 of file modem.cpp.

References _pppdExitStatus, modemfd, odebug, oendl, and pppdPid.

bool Modem::setSecret int  ,
const char *  ,
const char * 
 

Definition at line 794 of file modem.cpp.

References AUTH_CHAP, AUTH_PAP, AUTH_PAPCHAP, CHAP, createAuthFile(), and PAP.

void Modem::slotModemDebug int   )  [private, slot]
 

Definition at line 1072 of file modem.cpp.

References buf, QString::fromLatin1(), len, m_pppdDev, and QString::simplifyWhiteSpace().

Referenced by execpppd().

void Modem::startNotifier  )  [private, slot]
 

Definition at line 308 of file modem.cpp.

References modemfd, odebug, oendl, readtty(), and sn.

Referenced by notify().

void Modem::stop  ) 
 

Definition at line 302 of file modem.cpp.

References charWaiting(), and stopNotifier().

Referenced by ModemTransfer::cancelbutton(), and closetty().

void Modem::stopNotifier  )  [private, slot]
 

Definition at line 322 of file modem.cpp.

References odebug, oendl, and sn.

Referenced by stop().

void Modem::unlockdevice  ) 
 

Definition at line 641 of file modem.cpp.

References lockfile, modem_is_locked, modemfd, odebug, and oendl.

Referenced by ModemTransfer::ati_done(), ModemTransfer::cancelbutton(), and ModemTransfer::init().

bool Modem::writeChar unsigned  char  ) 
 

Definition at line 339 of file modem.cpp.

References modemfd, oendl, oerr, s, and write().

bool Modem::writeLine const char *   ) 
 

Definition at line 353 of file modem.cpp.

References _pppdata, PPPData::EndCR, PPPData::EndCRLF, PPPData::EndLF, PPPData::enter(), l, len, modemfd, oendl, oerr, and write().

Referenced by ModemTransfer::do_script(), hangup(), and ModemTransfer::init().


Member Data Documentation

PPPData* Modem::_pppdata [private]
 

Definition at line 124 of file modem.h.

Referenced by escape_to_command_mode(), execPPPDaemon(), hangup(), killPPPDaemon(), lockdevice(), Modem(), modemspeed(), opentty(), and writeLine().

int Modem::_pppdExitStatus [private]
 

Definition at line 116 of file modem.h.

Referenced by execpppd(), Modem(), pppdExitStatus(), and setPPPDPid().

bool Modem::data_mode [private]
 

Definition at line 119 of file modem.h.

Referenced by dataMode(), escape_to_command_mode(), hangup(), Modem(), and setDataMode().

QString Modem::device [private]
 

Definition at line 112 of file modem.h.

Referenced by getDevice(), Modem(), openLockfile(), opentty(), and setDevice().

QString Modem::errmsg [private]
 

Definition at line 120 of file modem.h.

Referenced by closetty(), hangup(), modemMessage(), and opentty().

struct termios Modem::initial_tty [private]
 

Definition at line 121 of file modem.h.

Referenced by closetty(), and opentty().

int Modem::lastStatus
 

Definition at line 87 of file modem.h.

QString Modem::lockfile [private]
 

Definition at line 113 of file modem.h.

Referenced by lockdevice(), Modem(), and unlockdevice().

QSocketNotifier* Modem::m_modemDebug [private]
 

Definition at line 118 of file modem.h.

Referenced by execpppd(), killpppd(), and Modem().

QString Modem::m_pppdDev [private]
 

Definition at line 126 of file modem.h.

Referenced by execpppd(), pppDevice(), setPPPDevice(), and slotModemDebug().

int Modem::m_pppdLOG[2] [private]
 

Definition at line 125 of file modem.h.

Referenced by execpppd().

bool Modem::modem_is_locked [private]
 

Definition at line 123 of file modem.h.

Referenced by lockdevice(), Modem(), and unlockdevice().

int Modem::modemfd [private]
 

Definition at line 114 of file modem.h.

Referenced by closetty(), escape_to_command_mode(), execpppd(), flush(), hangup(), Modem(), opentty(), readtty(), setPPPDPid(), startNotifier(), unlockdevice(), writeChar(), and writeLine().

int Modem::pppdPid [private]
 

Definition at line 115 of file modem.h.

Referenced by execpppd(), killpppd(), Modem(), pppPID(), and setPPPDPid().

QSocketNotifier* Modem::sn [private]
 

Definition at line 117 of file modem.h.

Referenced by Modem(), startNotifier(), and stopNotifier().

struct termios Modem::tty [private]
 

Definition at line 122 of file modem.h.

Referenced by opentty().

enum { ... } Modem::Version [private]
 


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:40:29 2005 for OPIE by  doxygen 1.4.2