// $Id$
//
// Copyright (C) 2006
-// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
-// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
-// Stefan Bund <stefan.bund@fokus.fraunhofer.de>
+// 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
// Custom includes
#include <sys/socket.h>
#include <netpacket/packet.h>
-#include "Socket/SocketPolicy.hh"
-#include "Socket/FileHandle.hh"
-#include "Socket/Protocols/GenericAddressingPolicy.hh"
+#include "../../../Socket/SocketPolicy.hh"
+#include "../../../Socket/FileHandle.hh"
+#include "../../../Socket/Protocols/GenericAddressingPolicy.hh"
#include "MACAddress.hh"
//#include "LLAddressing.mpp"
class only allows changing those fields which need to be changed. The other fields are
read-only. They are filled by the operating system when receiving a packet
+ \nosubgrouping
*/
class LLSocketAddress
{
public:
/** \brief Valid pkttype() values
- These are the possible values returned by arptype()
+ These are the possible values returned by pkttype()
*/
enum PktType { Undefined = 0
, Host = PACKET_HOST /**< Packet destined for this host */
, Outgoing = PACKET_OUTGOING /**< Packet sent out from this host */
};
+ ///////////////////////////////////////////////////////////////////////////
+ ///\name Structors and default members
+ ///@{
+
LLSocketAddress(); ///< Create empty address
explicit LLSocketAddress(unsigned proto, std::string const & iface="");
///< Create address for \c bind()
/**< This constructs an LLSocketAddress valid for calling
PacketSocketHandle::bind() with.
- \param[in] prot Protocol (Ethertype) to listen for
+ \param[in] proto Protocol (Ethertype) to listen for
\param[in] iface Interface name to bind to */
explicit LLSocketAddress(std::string const &iface);
///< Create address for \c bind()
\param addr Address to send data to
\param iface Interface to send packet from */
+ ///@}
+ ///////////////////////////////////////////////////////////////////////////
+
void clear(); ///< Clear the address
unsigned protocol() const; ///< Return address protocol (ethertype)
// changing those members, which are sensible to be changed.
void address(MACAddress const & addr); ///< Change address
- void interface(std::string iface); ///< Change interface
+ void interface(std::string const & iface); ///< Change interface
void protocol(unsigned prot); ///< Change protocol
///\name Generic SocketAddress interface
struct ::sockaddr_ll addr_;
};
- /** \brief Signal invalid link local address syntax
- \related LLSocketAddress
- */
- struct InvalidLLSocketAddressException : public std::exception
- { char const * what() const throw() { return "invalid ll address"; } };
-
/// @}
/// \addtogroup policy_impl_group
};
/// @}
+
+ /** \brief Write link layer address
+ \related LLSocketAddress
+ */
+ std::ostream & operator<<(std::ostream & os, LLSocketAddress const & llAddr);
}
///////////////////////////////hh.e////////////////////////////////////////