4 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
5 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
6 // Stefan Bund <stefan.bund@fokus.fraunhofer.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief GenericSockAddr public header */
26 /** \defgroup addr_group Socket Addressing
28 To support the core socket functionality we need a collection of classing providing addressing
29 for the different protocols.
31 Every Address Implementation used with the standard policy classes Has to have a set of minimum
32 members. These members are documented in GenericSockAddr. However, these members are \e neither
33 abstract \e nor virtual and other address classes do \e not inherit from GenericSockAddr. The
34 address classes are not usable polymorphically for performance reasons.
36 The interface defined above forces the implementation to be directly based on the corresponding
37 sockaddr data structures provided by the BSD socket API. These structures however are wrapped
38 into more flexible and more easy to use classes. Using the sockaddr representation increases the
39 performance since any intermediarre conversions are skipped.
42 #ifndef HH_GenericSockAddr_
43 #define HH_GenericSockAddr_ 1
46 #include <sys/socket.h>
48 //#include "GenericSockAddr.mpp"
49 ///////////////////////////////hh.p////////////////////////////////////////
53 /// \addtogroup addr_group
56 /** \brief Generic protocol-independant socket address
58 This address type does not depend on the protocol of the socket. It does nowever not support
59 any protocol specific API, so access to the address is very limited.
66 /// \name Generic Address Interface
69 struct sockaddr * sockaddr_p(); ///< Return a pointer to sockaddr structure
70 /**< The exact structure pointed to depends on the address
71 family. The data pointed to must be \e mutable. The
72 value must be changeable and any change of the value
73 through this pointer must be reflected in the visible
75 \returns non-const (!) pointer to sockaddr structure */
76 struct sockaddr const * sockaddr_p() const; ///< Return a pointer to sockaddr structure
77 /**< This member is like sockaddr_p(), however it does not
78 allow changing the address.
79 \returns const pointer to sockaddr structure */
80 unsigned sockaddr_len() const; ///< Return size of address
81 /**< This member return the size of the socket address
82 structure as returned by sockaddr_p() in bytes.
83 \returns size of respective sockaddr structure in bytes
88 struct ::sockaddr_storage addr_;
94 ///////////////////////////////hh.e////////////////////////////////////////
95 #include "GenericSockAddr.cci"
96 //#include "GenericSockAddr.ct"
97 //#include "GenericSockAddr.cti"
98 //#include "GenericSockAddr.mpp"
105 // c-file-style: "senf"
106 // indent-tabs-mode: nil
107 // ispell-local-dictionary: "american"