# -*- Mode: Python; -*- # /* # * Copyright (c) 2005,2006,2007 INRIA # * Copyright (c) 2009 INESC Porto # * # * This program is free software; you can redistribute it and/or modify # * it under the terms of the GNU General Public License version 2 as # * published by the Free Software Foundation; # * # * This program is distributed in the hope that it will be useful, # * but WITHOUT ANY WARRANTY; without even the implied warranty of # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # * GNU General Public License for more details. # * # * You should have received a copy of the GNU General Public License # * along with this program; if not, write to the Free Software # * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # * # * Authors: Mathieu Lacage # * Gustavo Carneiro # */ import sys import ns.applications import ns.core import ns.internet import ns.mobility import ns.network import ns.point_to_point import ns.wifi # void # DevTxTrace (std::string context, Ptr p, Mac48Address address) # { # std::cout << " TX to=" << address << " p: " << *p << std::endl; # } # void # DevRxTrace(std::string context, Ptr p, Mac48Address address) # { # std::cout << " RX from=" << address << " p: " << *p << std::endl; # } # void # PhyRxOkTrace(std::string context, Ptr packet, double snr, WifiMode mode, enum WifiPreamble preamble) # { # std::cout << "PHYRXOK mode=" << mode << " snr=" << snr << " " << *packet << std::endl; # } # void # PhyRxErrorTrace(std::string context, Ptr packet, double snr) # { # std::cout << "PHYRXERROR snr=" << snr << " " << *packet << std::endl; # } # void # PhyTxTrace(std::string context, Ptr packet, WifiMode mode, WifiPreamble preamble, uint8_t txPower) # { # std::cout << "PHYTX mode=" << mode << " " << *packet << std::endl; # } # void # PhyStateTrace(std::string context, Time start, Time duration, enum WifiPhy::State state) # { # std::cout << " state="; # switch(state) { # case WifiPhy::TX: # std::cout << "tx "; # break; # case WifiPhy::SYNC: # std::cout << "sync "; # break; # case WifiPhy::CCA_BUSY: # std::cout << "cca-busy"; # break; # case WifiPhy::IDLE: # std::cout << "idle "; # break; # } # std::cout << " start="<