Compare Revisions

The credentials to download the source code are:
 Username: svnusers
 Password: svnusers

Ignore whitespace Rev 3325 → Rev 3326

/branches/STF525/ccsrc/Protocols/Pcap/pcap_linux_layer.cc
85,7 → 85,7
it = _params.find(params::mac_src);
if (it != _params.end()) { // Use online capture
mac_src = it->second;
}else{
} else{
// detect MAC address of NIC
struct ifreq ifr;
memset(&ifr, 0, sizeof(ifr));
97,7 → 97,7
*_bin2hex(buf, sizeof(buf), ifr.ifr_hwaddr.sa_data, 6) = 0;
mac_src = buf;
loggers::get_instance().user("pcap_layer::pcap_layer: local MAC is %s", mac_src.c_str());
_params.[params::mac_src] = mac_src;
_params[params::mac_src] = mac_src;
}
}
 
104,19 → 104,22
// Accept ITS broadcasted messages
std::string mac_bc;
it = _params.find(params::mac_bc);
if (it != _params.end() && !it->second.empty())
mac_bc = it->second;
else
mac_bc = "ffffffffffff";
if (it != _params.end() && !it->second.empty()) {
mac_bc = it->second;
} else {
mac_bc = "ffffffffffff";
}
 
if(mac_bc == mac_src || mac_src.empty())
if ((mac_bc == mac_src) || mac_src.empty()) {
filter = "ether dst " + mac_bc;
else
filter = "( ether dst " + mac_bc + " or ether dst " + mac_src + " )";
} else {
filter = "( ether dst " + mac_bc + " or ether dst " + mac_src + " )";
}
 
if(! mac_src.empty())
if (!mac_src.empty()) {
// Reject ITS messages sent by this component
filter += " and not ether src " + mac_src;
}
 
// Add user defined filter
it = _params.find(std::string("filter"));