summaryrefslogtreecommitdiff
path: root/src/dev/etherpkt.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/dev/etherpkt.hh')
-rw-r--r--src/dev/etherpkt.hh15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/dev/etherpkt.hh b/src/dev/etherpkt.hh
index acda9fb47..0d8998b1d 100644
--- a/src/dev/etherpkt.hh
+++ b/src/dev/etherpkt.hh
@@ -71,8 +71,23 @@ class EthPacketData
~EthPacketData() { if (data) delete [] data; }
public:
+ /**
+ * This function pulls out the MAC source and destination addresses from
+ * the packet data and stores them in the caller specified buffers.
+ *
+ * @param src_addr The buffer to store the source MAC address.
+ * @param dst_addr The buffer to store the destination MAC address.
+ * @param length This is an inout parameter. The caller stores in this
+ * the size of the address buffers. On return, this will contain the
+ * actual address size stored in the buffers. (We assume that source
+ * address size is equal to that of the destination address.)
+ */
+ void packAddress(uint8_t *src_addr, uint8_t *dst_addr, unsigned &length);
+
void serialize(const std::string &base, CheckpointOut &cp) const;
void unserialize(const std::string &base, CheckpointIn &cp);
+
+ unsigned size() const { return length; }
};
typedef std::shared_ptr<EthPacketData> EthPacketPtr;