From 1d02345a24f6e439545c0752e4dfcb54b8a23537 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Tue, 21 Sep 2004 01:41:55 -0400 Subject: a bit more cleaning of the network header wrappers. base/inet.hh: add functions to the various headers to grab the most common encapsulated protocols. This could easily get out of hand, but we're just worrying about tcp, udp, and ip for now. add common functions size(), bytes(), and payload() to all wrappers. size() gets the header size bytes() returns a uint8_t * to the beginning of the header payload() returns a uint8_t * to the beginning of the payload. dev/etherpkt.cc: dev/etherpkt.hh: don't cache pointers to headers. It's probably not worth the hassle. --HG-- extra : convert_revision : ba9df85ac019b8a48233042dde79fb9da9546410 --- dev/etherpkt.cc | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'dev/etherpkt.cc') diff --git a/dev/etherpkt.cc b/dev/etherpkt.cc index 292fe7faf..273b8ee64 100644 --- a/dev/etherpkt.cc +++ b/dev/etherpkt.cc @@ -33,29 +33,6 @@ using namespace std; -void -PacketData::doext() -{ - _eth = 0; - _ip = 0; - _tcp = 0; - _udp = 0; - - if (!data) - return; - - _eth = data; - if (eth()->type() == ETH_TYPE_IP) { - _ip = eth()->payload(); - - if (ip()->proto() == IP_PROTO_TCP) - _tcp = ip()->payload(); - - if (ip()->proto() == IP_PROTO_UDP) - _udp = ip()->payload(); - } -} - void PacketData::serialize(ostream &os) { -- cgit v1.2.3