00001 /* 00002 * EthernetFrame.cpp 00003 * 00004 * Created on: Mar 28, 2014 00005 * Author: cwioro 00006 */ 00007 00008 #include "EthernetFrame.h" 00009 #include "defines.h" 00010 00011 EthernetFrame::EthernetFrame() { 00012 // TODO Auto-generated constructor stub 00013 this->eh_h_.eh_protocol_id = htons(ETH_TYPE); 00014 memcpy(this->eh_h_.eh_dest, bcast_mac,ETH_ALEN); 00015 00016 } 00017 00018 EthernetFrame::~EthernetFrame() { 00019 // TODO Auto-generated destructor stub 00020 } 00021 00022 int EthernetFrame::GetCrc32(const std::string& s) { 00023 boost::crc_32_type result; 00024 result.process_bytes(s.data(), s.length()); 00025 return result.checksum(); 00026 } 00027