EtherLLC.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2003 Andras Varga; CTIE, Monash University, Australia
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public License
00015  * along with this program; if not, see <http://www.gnu.org/licenses/>.
00016 */
00017 
00018 #ifndef __INET_ETHERLLC_H
00019 #define __INET_ETHERLLC_H
00020 
00021 #include "Ethernet.h"
00022 #include "EtherFrame_m.h"
00023 
00024 
00028 class INET_API EtherLLC : public cSimpleModule
00029 {
00030   protected:
00031     int seqNum;
00032     std::map<int,int> dsapToPort;  // DSAP registration table
00033 
00034     // statistics
00035     long dsapsRegistered;       // number DSAPs (higher layers) registered
00036     long totalFromHigherLayer;  // total number of packets received from higher layer
00037     long totalFromMAC;          // total number of frames received from MAC
00038     long totalPassedUp;         // total number of packets passed up to higher layer
00039     long droppedUnknownDSAP;    // frames dropped because no such DSAP was registered here
00040 
00041   protected:
00042     virtual void initialize();
00043     virtual void handleMessage(cMessage *msg);
00044     virtual void finish();
00045 
00046     virtual void processPacketFromHigherLayer(cPacket *msg);
00047     virtual void processFrameFromMAC(EtherFrameWithLLC *msg);
00048     virtual void handleRegisterSAP(cMessage *msg);
00049     virtual void handleDeregisterSAP(cMessage *msg);
00050     virtual void handleSendPause(cMessage *msg);
00051     virtual int findPortForSAP(int sap);
00052 
00053     // utility function
00054     virtual void updateDisplayString();
00055 };
00056 
00057 #endif
00058 
00059