mac.h File Reference

#include <assert.h>
#include "bi-connector.h"
#include "packet.h"
#include "ip.h"
#include "route.h"
#include "ll.h"
#include "phy.h"
#include "marshall.h"
#include "channel.h"

Include dependency graph for mac.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  hdr_mac
class  Mac
class  MacHandlerResume
class  MacHandlerSend
class  Tap

Defines

#define BCAST_ADDR   -1
#define EF_COLLISION   2
#define ETHER_ADDR(x)   (GET4BYTE(x))
#define ETHER_ADDR_LEN   6
#define ETHER_FCS_LEN   4
#define ETHER_TYPE_LEN   2
#define ETHERTYPE_ARP   0x0806
#define ETHERTYPE_IP   0x0800
#define MAC_BROADCAST   ((u_int32_t) 0xffffffff)
#define MAC_HDR_LEN   64
#define ZERO   0.00000

Enumerations

enum  MacFrameType {
  MF_BEACON = 0x0008, MF_CONTROL = 0x0010, MF_SLOTS = 0x001a, MF_RTS = 0x001b,
  MF_CTS = 0x001c, MF_ACK = 0x001d, MF_CF_END = 0x001e, MF_POLL = 0x001f,
  MF_DATA = 0x0020, MF_DATA_ACK = 0x0021
}
enum  MacState {
  MAC_IDLE = 0x0000, MAC_POLLING = 0x0001, MAC_RECV = 0x0010, MAC_SEND = 0x0100,
  MAC_RTS = 0x0200, MAC_CTS = 0x0400, MAC_ACK = 0x0800, MAC_COLL = 0x1000
}


Define Documentation

#define BCAST_ADDR   -1
 

Definition at line 71 of file mac.h.

Referenced by MacClassifier::recv(), and Mac802_3::recv_complete().

#define EF_COLLISION   2
 

Definition at line 60 of file mac.h.

#define ETHER_ADDR  )     (GET4BYTE(x))
 

Definition at line 66 of file mac.h.

Referenced by Mac802_11::check_pktTx(), CMUTrace::format_mac(), MacTdma::hdr_dst(), Mac802_11::hdr_dst(), MacTdma::hdr_src(), Mac802_11::hdr_src(), MacTdma::makePreamble(), p802_15_4hdr_dst(), p802_15_4hdr_src(), p802_15_4macDA(), p802_15_4macSA(), Mac802_11::recv_timer(), Mac802_11::recvDATA(), MacTdma::recvHandler(), Mac802_11::recvRTS(), Mac802_11::RetransmitDATA(), MacTdma::send(), Mac802_11::sendDATA(), MacTdma::sendDown(), Mac802_11::trace_event(), MacTdma::trace_pkt(), and Mac802_11::trace_pkt().

#define ETHER_ADDR_LEN   6
 

Definition at line 73 of file mac.h.

#define ETHER_FCS_LEN   4
 

Definition at line 75 of file mac.h.

Referenced by PHY_MIB::getHdrLen11().

#define ETHER_TYPE_LEN   2
 

Definition at line 74 of file mac.h.

#define ETHERTYPE_ARP   0x0806
 

Definition at line 78 of file mac.h.

Referenced by ArpAgent::ArpAgent(), ARPTable::arpinput(), and ARPTable::arprequest().

#define ETHERTYPE_IP   0x0800
 

Definition at line 77 of file mac.h.

Referenced by ArpAgent::ArpAgent(), ARPTable::arprequest(), SatLL::sendDown(), HDLC::sendDown(), and LL::sendDown().

#define MAC_BROADCAST   ((u_int32_t) 0xffffffff)
 

Definition at line 70 of file mac.h.

Referenced by ARPTable::arprequest(), DiffusionRate::BcastNeg(), Mac802_11::check_pktTx(), SMAC::checkToSend(), DiffusionRate::consider_new(), DiffusionRate::consider_old(), SMAC::drop_DATA(), UnslottedAlohaMac::end_of_contention(), DiffusionRate::FwdOriginal(), DiffusionRate::FwdSubsample(), SMAC::handleCounterTimer(), SMAC::handleDATA(), DiffusionRate::InterestHandle(), DiffusionProb::InterestPropagate(), OmniMcastAgent::MACprepare(), FloodingAgent::MACprepare(), DiffusionAgent::MACprepare(), Phy802_15_4::recv(), Mac802_11::recvDATA(), MacTdma::recvHandler(), MacSimple::recvHandler(), Phy802_15_4::recvOverHandler(), Mac802_11::RetransmitDATA(), Mac802_11::sendDATA(), SatLL::sendDown(), HDLC::sendDown(), MacTdma::sendDown(), LL::sendDown(), DiffusionProb::SendInhibit(), SMAC::sendMsg(), DiffusionProb::SendNegReinf(), Mac802_11::sendRTS(), UnslottedAlohaMac::sendUp(), SatMac::sendUp(), Mac::sendUp(), and MacTdma::slotHandler().

#define MAC_HDR_LEN   64
 

Definition at line 68 of file mac.h.

Referenced by SMAC::sendACK(), Mac802_11::sendACK(), SMAC::sendCTS(), Mac802_11::sendCTS(), SMAC::sendRTS(), Mac802_11::sendRTS(), and Mac::txtime().

#define ZERO   0.00000
 

Definition at line 54 of file mac.h.

Referenced by TwoStateErrorModel::corruptPkt().


Enumeration Type Documentation

enum MacFrameType
 

Enumerator:
MF_BEACON 
MF_CONTROL 
MF_SLOTS 
MF_RTS 
MF_CTS 
MF_ACK 
MF_CF_END 
MF_POLL 
MF_DATA 
MF_DATA_ACK 

Definition at line 91 of file mac.h.

00091                   {
00092     MF_BEACON   = 0x0008, // beaconing
00093     MF_CONTROL  = 0x0010, // used as mask for control frame
00094     MF_SLOTS    = 0x001a, // announce slots open for contention
00095     MF_RTS      = 0x001b, // request to send
00096     MF_CTS      = 0x001c, // clear to send, grant
00097     MF_ACK      = 0x001d, // acknowledgement
00098     MF_CF_END   = 0x001e, // contention free period end
00099     MF_POLL     = 0x001f, // polling
00100     MF_DATA     = 0x0020, // also used as mask for data frame
00101     MF_DATA_ACK = 0x0021  // ack for data frames
00102 };

enum MacState
 

Enumerator:
MAC_IDLE 
MAC_POLLING 
MAC_RECV 
MAC_SEND 
MAC_RTS 
MAC_CTS 
MAC_ACK 
MAC_COLL 

Definition at line 80 of file mac.h.

00080               {
00081     MAC_IDLE    = 0x0000,
00082     MAC_POLLING = 0x0001,
00083     MAC_RECV    = 0x0010,
00084     MAC_SEND    = 0x0100,
00085     MAC_RTS     = 0x0200,
00086     MAC_CTS     = 0x0400,
00087     MAC_ACK     = 0x0800,
00088     MAC_COLL    = 0x1000
00089 };


Generated on Tue Mar 6 16:54:48 2007 for ns2 Network Simulator 2.29 by  doxygen 1.4.6