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 For all standard BSD socket protocols we base the address classes on the corresponding \c
32 sockaddr structures, wrapped into appropriate C++ adapters. These Address classes are based on
33 GenericSockAddr, the corresponding addressing policy is defined in GenericAddressingPolicy.
35 You are however not limit to BSD type socket address classes as long as you implement the
36 corresponding addressing policy.
39 #ifndef HH_GenericSockAddr_
40 #define HH_GenericSockAddr_ 1
43 #include <sys/socket.h>
45 //#include "GenericSockAddr.mpp"
46 ///////////////////////////////hh.p////////////////////////////////////////
50 /// \addtogroup addr_group
53 /** \brief Generic protocol-independant socket address
55 This address type does not depend on the protocol of the socket. It does nowever not support
56 any protocol specific API, so access to the address is very limited.
63 /// \name Generic Address Interface
66 struct sockaddr * sockaddr_p(); ///< Return a pointer to sockaddr structure
67 /**< The exact structure pointed to depends on the address
68 family. The data pointed to must be \e mutable. The
69 value must be changeable and any change of the value
70 through this pointer must be reflected in the visible
72 \returns non-const (!) pointer to sockaddr structure */
73 struct sockaddr const * sockaddr_p() const; ///< Return a pointer to sockaddr structure
74 /**< This member is like sockaddr_p(), however it does not
75 allow changing the address.
76 \returns const pointer to sockaddr structure */
77 unsigned sockaddr_len() const; ///< Return size of address
78 /**< This member return the size of the socket address
79 structure as returned by sockaddr_p() in bytes.
80 \returns size of respective sockaddr structure in bytes
85 struct ::sockaddr_storage addr_;
91 ///////////////////////////////hh.e////////////////////////////////////////
92 #include "GenericSockAddr.cci"
93 //#include "GenericSockAddr.ct"
94 //#include "GenericSockAddr.cti"
95 //#include "GenericSockAddr.mpp"
102 // c-file-style: "senf"
103 // indent-tabs-mode: nil
104 // ispell-local-dictionary: "american"
105 // compile-command: "scons -u test"
106 // comment-column: 40