+// $Id$
+//
+// Copyright (C) 2007
+// Fraunhofer Institute for Open Communication Systems (FOKUS)
+// Competence Center NETwork research (NET), St. Augustin, GERMANY
+// Stefan Bund <g0dil@berlios.de>
+//
+// 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
\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!")));
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 <tt>-></tt> operator whereas other packet
\code
eth.next() == ip; // true
- eth.next().is<IpV4Packet>(); // true
+ eth.next().is<IPv4Packet>(); // true
eth.next().next() == udp; // true
eth.next().is<UDPPacket>(); // false
eth.next<UDPPacket>() == udp; // true
udp.next<UDPPacket>(); // throws InvalidPacketChainException
udp.next<UDPPacket>(senf::nothrow); // a senf::Packet testing as false
udp.findNext<UDPPacket()> == udp; // true
- udp.first<IpV4Packet>() == ip; // true
+ udp.first<IPv4Packet>() == ip; // true
udp.prev() == ip; // true
udp.prev<EthernetPacket>() == eth // true
default protocols: Ethernet, Ip, TCP, UDP
\li <a href="../../MPEGDVBBundle/doc/html/index.html">MPEGDVBBundle</a>: MPEG and DVB
protocols
+
+ There are two ways to link with a bundle
+
+ \li If you only work with known packets which you explicitly reference you may just link with
+ the corresponding library.
+ \li If you need to parse unknown packets and want those to be parsed as complete as possible
+ without explicitly referencing the packet type, you will need to link against the combined
+ object file built for every bundle. This way, all packets defined in the bundle will be
+ included whether they are explicitly referenced or not (and they will all automatically be
+ registered).
*/
\f