X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FMainpage.dox;h=5bff312639bb653722c405a8dd7c4e7178e6012f;hb=90b6130cd03023e18bf35a5f38b3df4381e1868b;hp=f5416601f96483ab6af6cdb1fb1d1cd605095219;hpb=32573fc81844083b2aa02d3d224e4cb327de0d9d;p=senf.git diff --git a/Packets/Mainpage.dox b/Packets/Mainpage.dox index f541660..5bff312 100644 --- a/Packets/Mainpage.dox +++ b/Packets/Mainpage.dox @@ -1,3 +1,25 @@ +// $Id$ +// +// Copyright (C) 2007 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + /** \mainpage The SENF Packet Library \section arch Overall Architecture @@ -35,7 +57,7 @@ \code senf::EthernetPacket eth (senf::EthernetPacket::create()); - senf::IpV4Packet ip (senf::IpV4Packet ::createAfter(ethernet)); + senf::IPv4Packet ip (senf::IPv4Packet ::createAfter(eth)); senf::UDPPacket udp (senf::UDPPacket ::createAfter(ip)); senf::DataPacket payload (senf::DataPacket ::createAfter(udp, std::string("Hello, world!"))); @@ -57,12 +79,12 @@ udp->source() = 2000u; udp->destination() = 2001u; ip->ttl() = 255u; - ip->source() = senf::INet4Address("192.168.0.1"); // (*) - ip->destination() = senf::INet4Address("192.168.0.2"); // (*) - eth->source() = senf::MACAddress("00:11:22:33:44:55"); - eth->destination() = senf::MACAddress("00:11:22:33:44:66"); + ip->source() = senf::INet4Address::from_string("192.168.0.1"); + ip->destination() = senf::INet4Address::from_string("192.168.0.2"); + eth->source() = senf::MACAddress::from_string("00:11:22:33:44:55"); + eth->destination() = senf::MACAddress::from_string("00:11:22:33:44:66"); - eth.finalize(); // (*) + eth.finalize(); \endcode As seen above, packet fields are accessed using the -> operator whereas other packet @@ -80,7 +102,7 @@ \code eth.next() == ip; // true - eth.next().is(); // true + eth.next().is(); // true eth.next().next() == udp; // true eth.next().is(); // false eth.next() == udp; // true @@ -88,7 +110,7 @@ udp.next(); // throws InvalidPacketChainException udp.next(senf::nothrow); // a senf::Packet testing as false udp.findNext == udp; // true - udp.first() == ip; // true + udp.first() == ip; // true udp.prev() == ip; // true udp.prev() == eth // true