Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

utils.h File Reference

#include <stdio.h>
#include <ostream>

Go to the source code of this file.

Compounds

class  MessageId
class  MessageTracer

Defines

#define EV   ev.disable_tracing?ev:ev
#define MAX_LINE   100

Functions

char * fgetline (FILE *fp)
std::ostream & operator<< (std::ostream &out, const MessageId &m)


Define Documentation

#define EV   ev.disable_tracing?ev:ev
 

Definition at line 32 of file utils.h.

Referenced by EtherMAC::beginSendFrames(), MACRelayUnitBase::getPortForAddress(), MACRelayUnitBase::handleAndDispatchFrame(), EtherMAC::handleAutoconfigMessage(), EtherLLC::handleDeregisterSAP(), EtherMAC::handleEndBackoffPeriod(), EtherMAC::handleEndIFGPeriod(), EtherMAC::handleEndJammingPeriod(), EtherMAC::handleEndPausePeriod(), EtherMAC::handleEndRxPeriod(), EtherMAC::handleEndTxPeriod(), MACRelayUnitPP::handleIncomingFrame(), EtherMAC::handleMessage(), EtherHub::handleMessage(), EtherBus::handleMessage(), EtherAppSrv::handleMessage(), EtherLLC::handleRegisterSAP(), EtherMAC::handleRetransmission(), EtherLLC::handleSendPause(), EtherEncap::handleSendPause(), MACRelayUnitPP::initialize(), EtherMAC::initialize(), EtherHub::initialize(), EtherBus::initialize(), MACRelayUnitBase::printAddressTable(), EtherMAC::printParameters(), EtherMAC::printState(), MACRelayUnitPP::processFrame(), EtherLLC::processFrameFromMAC(), EtherEncap::processFrameFromMAC(), EtherMAC::processFrameFromUpperLayer(), EtherMAC::processMsgFromNetwork(), EtherLLC::processPacketFromHigherLayer(), EtherEncap::processPacketFromHigherLayer(), EtherMAC::processPauseCommand(), EtherMAC::processReceivedDataFrame(), EtherAppCli::receivePacket(), EtherAppSrv::registerDSAP(), EtherAppCli::registerDSAP(), MACRelayUnitBase::removeAgedEntriesFromTable(), MACRelayUnitBase::removeOldestTableEntry(), EtherAppCli::sendPacket(), MACRelayUnitBase::sendPauseFrame(), EtherMAC::startAutoconfig(), EtherMAC::startFrameTransmission(), and MACRelayUnitBase::updateTableWithAddress().

#define MAX_LINE   100
 

Definition at line 36 of file utils.h.

Referenced by fgetline().


Function Documentation

char* fgetline FILE *    fp
 

Definition at line 23 of file utils.cc.

References MAX_LINE.

Referenced by MACRelayUnitBase::readAddressTable().

00024 {
00025     // alloc buffer and read a line
00026     char *line = new char[MAX_LINE];
00027     if (fgets(line,MAX_LINE,fp)==NULL)
00028         return NULL;
00029 
00030     // chop CR/LF
00031     line[MAX_LINE-1] = '\0';
00032     int len = strlen(line);
00033     while (len>0 && (line[len-1]=='\n' || line[len-1]=='\r'))
00034         line[--len]='\0';
00035 
00036     return line;
00037 }

std::ostream& operator<< std::ostream &    out,
const MessageId   m
[inline]
 

Definition at line 87 of file utils.h.

References MessageId::id, MessageId::parentId, and MessageId::treeId.

00088 {
00089     out << "Id:" << m.id << " TreeId: " << m.treeId << " ParentId:" << m.parentId; return out;
00090 }


Generated on Sat May 15 20:30:44 2004 for Ethernet by doxygen1.2.17