| 1 | /// ----------------------------------------*- mode: C++; -*--
|
---|
| 2 | /// @file assocdata_uds.h
|
---|
| 3 | /// association data for Unix Domain transport connnections
|
---|
| 4 | /// -- AssocData structure to store data of a signaling associaton
|
---|
| 5 | /// -- i.e., a socket-based signaling transport connection
|
---|
| 6 | //
|
---|
| 7 | /// ----------------------------------------------------------
|
---|
| 8 | /// $Id: assocdata_uds.h 2872 2008-02-18 10:58:03Z bless $
|
---|
| 9 | /// $HeadURL: https://svn.ipv6.tm.uka.de/nsis/protlib/trunk/include/assocdata_uds.h $
|
---|
| 10 | // ===========================================================
|
---|
| 11 | //
|
---|
| 12 | // Copyright (C) 2005-2007, all rights reserved by
|
---|
| 13 | // - Institute of Telematics, Universitaet Karlsruhe (TH)
|
---|
| 14 | //
|
---|
| 15 | // More information and contact:
|
---|
| 16 | // https://projekte.tm.uka.de/trac/NSIS
|
---|
| 17 | //
|
---|
| 18 | // This program is free software; you can redistribute it and/or modify
|
---|
| 19 | // it under the terms of the GNU General Public License as published by
|
---|
| 20 | // the Free Software Foundation; version 2 of the License
|
---|
| 21 | //
|
---|
| 22 | // This program is distributed in the hope that it will be useful,
|
---|
| 23 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 24 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 25 | // GNU General Public License for more details.
|
---|
| 26 | //
|
---|
| 27 | // You should have received a copy of the GNU General Public License along
|
---|
| 28 | // with this program; if not, write to the Free Software Foundation, Inc.,
|
---|
| 29 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
---|
| 30 | //
|
---|
| 31 | // ===========================================================
|
---|
| 32 |
|
---|
| 33 | #ifndef ASSOC_DATA_UDS_H
|
---|
| 34 | #define ASSOC_DATA_UDS_H
|
---|
| 35 |
|
---|
| 36 | #include "address.h"
|
---|
| 37 |
|
---|
| 38 |
|
---|
| 39 | namespace protlib {
|
---|
| 40 |
|
---|
| 41 | /** @ingroup transport
|
---|
| 42 | * @{
|
---|
| 43 | */
|
---|
| 44 |
|
---|
| 45 | typedef int socketfd_t; ///< socket type interface
|
---|
| 46 | typedef unsigned int associd_t; /// SCTP lib interface
|
---|
| 47 |
|
---|
| 48 | /// association data, used to keep all necessary information
|
---|
| 49 | /// (socket, peer address, shutdown, touched) about a single connection
|
---|
| 50 | struct AssocDataUDS {
|
---|
| 51 | AssocDataUDS(socketfd_t socketfd,
|
---|
| 52 | const udsaddress& peeraddress,
|
---|
| 53 | const udsaddress& ownaddress):
|
---|
| 54 | socketfd(socketfd),
|
---|
| 55 | assoc(0),
|
---|
| 56 | peer(peeraddress),
|
---|
| 57 | ownaddr(ownaddress),
|
---|
| 58 | thread_ID(0),
|
---|
| 59 | num_of_out_streams(0),
|
---|
| 60 | shutdown(false),
|
---|
| 61 | touched(true)
|
---|
| 62 | {};
|
---|
| 63 |
|
---|
| 64 | AssocDataUDS(associd_t ass, const udsaddress& ap, const udsaddress& oa, uint32 streams)
|
---|
| 65 | : socketfd(0),
|
---|
| 66 | assoc(ass),
|
---|
| 67 | peer(ap),
|
---|
| 68 | ownaddr(oa),
|
---|
| 69 | thread_ID(0),
|
---|
| 70 | num_of_out_streams(streams),
|
---|
| 71 | shutdown(false),
|
---|
| 72 | touched(true)
|
---|
| 73 | {};
|
---|
| 74 |
|
---|
| 75 | const socketfd_t socketfd; ///< socket of signaling transport connection
|
---|
| 76 | const associd_t assoc; ///< required for SCTP
|
---|
| 77 |
|
---|
| 78 | const udsaddress peer; ///< address of the signaling peer
|
---|
| 79 | const udsaddress ownaddr; ///< own endpoint address of the signaling connection
|
---|
| 80 |
|
---|
| 81 | pthread_t thread_ID; ///< related receiver thread
|
---|
| 82 |
|
---|
| 83 | const uint32 num_of_out_streams; ///< required for SCTP
|
---|
| 84 |
|
---|
| 85 | // shutdown: connection is being shutdown, shutdown
|
---|
| 86 | // is not complete yet
|
---|
| 87 | bool shutdown;
|
---|
| 88 | // this is required for a second changce algorithm when cleaning up unused connections
|
---|
| 89 | bool touched;
|
---|
| 90 | }; // end AssocDataUDS
|
---|
| 91 |
|
---|
| 92 | //@}
|
---|
| 93 |
|
---|
| 94 | } // end namespace protlib
|
---|
| 95 | #endif
|
---|