struct hdr_mac {
MacFrameType ftype_; // frame type
int macSA_; // source MAC address
int macDA_; // destination MAC address
u_int16_t hdr_type_; // mac_hdr type
double txtime_; // transmission time
double sstime_; // slot start time
int padding_;
inline void set(MacFrameType ft, int sa, int da=-1) {
ftype_ = ft;
macSA_ = sa;
if (da != -1) macDA_ = da;
}
struct hdr_ip {
/* common to IPv{4,6} */
ns_addr_t src_;
ns_addr_t dst_;
int ttl_;
/* Monarch extn */
// u_int16_t sport_;
// u_int16_t dport_;
/* IPv6 */
int fid_; /* flow id */
int prio_;
static int offset_;
inline static int& offset() { return offset_; }
inline static hdr_ip* access(const Packet* p) {
return (hdr_ip*) p->access(offset_);
}