Core/external : Reinstate ACE 5.8.1 (tested and building)

--HG--
branch : trunk
This commit is contained in:
click
2010-08-16 11:23:20 +02:00
parent b4bef54b7a
commit 29c2520506
95 changed files with 6406 additions and 587 deletions
+38 -64
View File
@@ -1,4 +1,4 @@
// $Id: ACE.cpp 88193 2009-12-16 09:14:06Z mcorino $
// $Id: ACE.cpp 91066 2010-07-12 11:05:04Z johnnyw $
#include "ace/ACE.h"
@@ -40,7 +40,7 @@ extern "C" int maxFiles;
ACE_RCSID (ace,
ACE,
"$Id: ACE.cpp 88193 2009-12-16 09:14:06Z mcorino $")
"$Id: ACE.cpp 91066 2010-07-12 11:05:04Z johnnyw $")
// Open versioned namespace, if enabled by the user.
@@ -658,8 +658,7 @@ ACE::recv_n_i (ACE_HANDLE handle,
errno == EWOULDBLOCK)
{
// Wait upto <timeout> for the blocking to subside.
int rtn = ACE::handle_read_ready (handle,
timeout);
int const rtn = ACE::handle_read_ready (handle, timeout);
// Did select() succeed?
if (rtn != -1)
@@ -720,8 +719,7 @@ ACE::t_rcv_n_i (ACE_HANDLE handle,
if (errno == EWOULDBLOCK)
{
// Wait for the blocking to subside.
int result = ACE::handle_read_ready (handle,
0);
int const result = ACE::handle_read_ready (handle, 0);
// Did select() succeed?
if (result != -1)
@@ -778,8 +776,7 @@ ACE::t_rcv_n_i (ACE_HANDLE handle,
errno == EWOULDBLOCK)
{
// Wait upto <timeout> for the blocking to subside.
int rtn = ACE::handle_read_ready (handle,
timeout);
int const rtn = ACE::handle_read_ready (handle, timeout);
// Did select() succeed?
if (rtn != -1)
@@ -839,8 +836,7 @@ ACE::recv_n_i (ACE_HANDLE handle,
if (errno == EWOULDBLOCK)
{
// Wait for the blocking to subside.
int result = ACE::handle_read_ready (handle,
0);
int const result = ACE::handle_read_ready (handle, 0);
// Did select() succeed?
if (result != -1)
@@ -895,8 +891,7 @@ ACE::recv_n_i (ACE_HANDLE handle,
errno == EWOULDBLOCK)
{
// Wait upto <timeout> for the blocking to subside.
int rtn = ACE::handle_read_ready (handle,
timeout);
int const rtn = ACE::handle_read_ready (handle, timeout);
// Did select() succeed?
if (rtn != -1)
@@ -934,8 +929,8 @@ ssize_t
ACE::recv (ACE_HANDLE handle, size_t n, ...)
{
va_list argp;
int total_tuples = static_cast<int> (n / 2);
iovec *iovp;
int const total_tuples = static_cast<int> (n / 2);
iovec *iovp = 0;
#if defined (ACE_HAS_ALLOCA)
iovp = (iovec *) alloca (total_tuples * sizeof (iovec));
#else
@@ -952,7 +947,7 @@ ACE::recv (ACE_HANDLE handle, size_t n, ...)
iovp[i].iov_len = va_arg (argp, int);
}
ssize_t result = ACE_OS::recvv (handle, iovp, total_tuples);
ssize_t const result = ACE_OS::recvv (handle, iovp, total_tuples);
#if !defined (ACE_HAS_ALLOCA)
delete [] iovp;
#endif /* !defined (ACE_HAS_ALLOCA) */
@@ -992,14 +987,10 @@ ACE::recvv_n_i (ACE_HANDLE handle,
size_t &bytes_transferred = bt == 0 ? temp : *bt;
bytes_transferred = 0;
for (int s = 0;
s < iovcnt;
)
for (int s = 0; s < iovcnt; )
{
// Try to transfer as much of the remaining data as possible.
ssize_t n = ACE_OS::recvv (handle,
iov + s,
iovcnt - s);
ssize_t n = ACE_OS::recvv (handle, iov + s, iovcnt - s);
// Check EOF.
if (n == 0)
return 0;
@@ -1011,8 +1002,7 @@ ACE::recvv_n_i (ACE_HANDLE handle,
if (errno == EWOULDBLOCK)
{
// Wait for the blocking to subside.
int result = ACE::handle_read_ready (handle,
0);
int const result = ACE::handle_read_ready (handle, 0);
// Did select() succeed?
if (result != -1)
@@ -1060,28 +1050,21 @@ ACE::recvv_n_i (ACE_HANDLE handle,
int val = 0;
ACE::record_and_set_non_blocking_mode (handle, val);
for (int s = 0;
s < iovcnt;
)
for (int s = 0; s < iovcnt; )
{
// Try to transfer as much of the remaining data as possible.
// Since the socket is in non-blocking mode, this call will not
// block.
ssize_t n = ACE_OS::recvv (handle,
iov + s,
iovcnt - s);
ssize_t n = ACE_OS::recvv (handle, iov + s, iovcnt - s);
// Check for errors.
if (n == 0 ||
n == -1)
if (n == 0 || n == -1)
{
// Check for possible blocking.
if (n == -1 &&
errno == EWOULDBLOCK)
if (n == -1 && errno == EWOULDBLOCK)
{
// Wait upto <timeout> for the blocking to subside.
int rtn = ACE::handle_read_ready (handle,
timeout);
int const rtn = ACE::handle_read_ready (handle, timeout);
// Did select() succeed?
if (rtn != -1)
@@ -1242,7 +1225,8 @@ ACE::send (ACE_HANDLE handle,
return -1;
else
{
ssize_t bytes_transferred = ACE_OS::send (handle, (const char *) buf, n, flags);
ssize_t const bytes_transferred =
ACE_OS::send (handle, (const char *) buf, n, flags);
ACE::restore_non_blocking_mode (handle, val);
return bytes_transferred;
}
@@ -1267,7 +1251,8 @@ ACE::t_snd (ACE_HANDLE handle,
return -1;
else
{
ssize_t bytes_transferred = ACE_OS::t_snd (handle, (const char *) buf, n, flags);
ssize_t const bytes_transferred =
ACE_OS::t_snd (handle, (const char *) buf, n, flags);
ACE::restore_non_blocking_mode (handle, val);
return bytes_transferred;
}
@@ -1291,7 +1276,7 @@ ACE::send (ACE_HANDLE handle,
return -1;
else
{
ssize_t bytes_transferred = ACE::send_i (handle, buf, n);
ssize_t const bytes_transferred = ACE::send_i (handle, buf, n);
ACE::restore_non_blocking_mode (handle, val);
return bytes_transferred;
}
@@ -1313,7 +1298,8 @@ ACE::sendmsg (ACE_HANDLE handle,
return -1;
else
{
ssize_t bytes_transferred = ACE_OS::sendmsg (handle, msg, flags);
ssize_t const bytes_transferred =
ACE_OS::sendmsg (handle, msg, flags);
ACE::restore_non_blocking_mode (handle, val);
return bytes_transferred;
}
@@ -1338,7 +1324,7 @@ ACE::sendto (ACE_HANDLE handle,
return -1;
else
{
ssize_t bytes_transferred =
ssize_t const bytes_transferred =
ACE_OS::sendto (handle, buf, len, flags, addr, addrlen);
ACE::restore_non_blocking_mode (handle, val);
return bytes_transferred;
@@ -1381,8 +1367,7 @@ ACE::send_n_i (ACE_HANDLE handle,
#endif /* ACE_WIN32 */
{
// Wait for the blocking to subside.
int result = ACE::handle_write_ready (handle,
0);
int const result = ACE::handle_write_ready (handle, 0);
// Did select() succeed?
if (result != -1)
@@ -1435,12 +1420,10 @@ ACE::send_n_i (ACE_HANDLE handle,
n == -1)
{
// Check for possible blocking.
if (n == -1 &&
(errno == EWOULDBLOCK || errno == ENOBUFS))
if (n == -1 && (errno == EWOULDBLOCK || errno == ENOBUFS))
{
// Wait upto <timeout> for the blocking to subside.
int rtn = ACE::handle_write_ready (handle,
timeout);
int const rtn = ACE::handle_write_ready (handle, timeout);
// Did select() succeed?
if (rtn != -1)
@@ -1505,8 +1488,7 @@ ACE::t_snd_n_i (ACE_HANDLE handle,
if (errno == EWOULDBLOCK || errno == ENOBUFS)
{
// Wait for the blocking to subside.
int result = ACE::handle_write_ready (handle,
0);
int const result = ACE::handle_write_ready (handle, 0);
// Did select() succeed?
if (result != -1)
@@ -1563,8 +1545,7 @@ ACE::t_snd_n_i (ACE_HANDLE handle,
errno == EWOULDBLOCK || errno == ENOBUFS)
{
// Wait upto <timeout> for the blocking to subside.
int rtn = ACE::handle_write_ready (handle,
timeout);
int const rtn = ACE::handle_write_ready (handle, timeout);
// Did select() succeed?
if (rtn != -1)
@@ -1625,8 +1606,7 @@ ACE::send_n_i (ACE_HANDLE handle,
if (errno == EWOULDBLOCK || errno == ENOBUFS)
{
// Wait for the blocking to subside.
int result = ACE::handle_write_ready (handle,
0);
int const result = ACE::handle_write_ready (handle, 0);
// Did select() succeed?
if (result != -1)
@@ -1681,8 +1661,7 @@ ACE::send_n_i (ACE_HANDLE handle,
(errno == EWOULDBLOCK || errno == ENOBUFS))
{
// Wait upto <timeout> for the blocking to subside.
int rtn = ACE::handle_write_ready (handle,
timeout);
int const rtn = ACE::handle_write_ready (handle, timeout);
// Did select() succeed?
if (rtn != -1)
@@ -1788,9 +1767,8 @@ ACE::sendv_n_i (ACE_HANDLE handle,
)
{
// Try to transfer as much of the remaining data as possible.
ssize_t n = ACE_OS::sendv (handle,
iov + s,
iovcnt - s);
ssize_t n = ACE_OS::sendv (handle, iov + s, iovcnt - s);
// Check EOF.
if (n == 0)
return 0;
@@ -1802,8 +1780,7 @@ ACE::sendv_n_i (ACE_HANDLE handle,
if (errno == EWOULDBLOCK || errno == ENOBUFS)
{
// Wait for the blocking to subside.
int result = ACE::handle_write_ready (handle,
0);
int const result = ACE::handle_write_ready (handle, 0);
// Did select() succeed?
if (result != -1)
@@ -1860,9 +1837,7 @@ ACE::sendv_n_i (ACE_HANDLE handle,
// Try to transfer as much of the remaining data as possible.
// Since the socket is in non-blocking mode, this call will not
// block.
ssize_t n = ACE_OS::sendv (handle,
iov + s,
iovcnt - s);
ssize_t n = ACE_OS::sendv (handle, iov + s, iovcnt - s);
// Check for errors.
if (n == 0 ||
@@ -1873,8 +1848,7 @@ ACE::sendv_n_i (ACE_HANDLE handle,
(errno == EWOULDBLOCK || errno == ENOBUFS))
{
// Wait upto <timeout> for the blocking to subside.
int rtn = ACE::handle_write_ready (handle,
timeout);
int const rtn = ACE::handle_write_ready (handle, timeout);
// Did select() succeed?
if (rtn != -1)
+5 -10
View File
@@ -4,7 +4,7 @@
/**
* @file Activation_Queue.h
*
* $Id: Activation_Queue.h 80826 2008-03-04 14:51:23Z wotte $
* $Id: Activation_Queue.h 91066 2010-07-12 11:05:04Z johnnyw $
*
* @author Andres Kruse <[email protected]>
* @author Douglas C. Schmidt <[email protected]>
@@ -23,6 +23,7 @@
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "ace/Message_Queue.h"
#include "ace/Copy_Disabled.h"
#include "ace/Condition_Thread_Mutex.h"
/// Define to be compatible with the terminology in the POSA2 book!
@@ -35,7 +36,8 @@ class ACE_Method_Request;
/**
* @class ACE_Activation_Queue
*
* @brief Reifies a method into a request. Subclasses typically
* @brief
* Reifies a method into a request. Subclasses typically
* represent necessary state and behavior.
*
* Maintains a priority-ordered queue of ACE_Method_Request objects.
@@ -47,10 +49,9 @@ class ACE_Method_Request;
*
* @sa ACE_Method_Request
*/
class ACE_Export ACE_Activation_Queue
class ACE_Export ACE_Activation_Queue : private ACE_Copy_Disabled
{
public:
// = Initialization and termination methods.
/// Constructor.
/**
* Initializes a new activation queue.
@@ -139,12 +140,6 @@ public:
/// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;
private:
// = Prevent copying and assignment.
ACE_Activation_Queue (const ACE_Activation_Queue &);
void operator= (const ACE_Activation_Queue &);
protected:
/// Stores the Method_Requests.
+2 -2
View File
@@ -4,7 +4,7 @@
/**
* @file Active_Map_Manager.h
*
* $Id: Active_Map_Manager.h 83956 2008-12-03 07:57:38Z johnnyw $
* $Id: Active_Map_Manager.h 91066 2010-07-12 11:05:04Z johnnyw $
*
* @author Irfan Pyarali
*/
@@ -95,7 +95,7 @@ private:
/// Slot index in the active map.
ACE_UINT32 slot_index_;
/// Slot generation number of <slot_index_> slot in the active map.
/// Slot generation number of @c slot_index_ slot in the active map.
ACE_UINT32 slot_generation_;
};
+2 -2
View File
@@ -4,7 +4,7 @@
/**
* @file Basic_Types.h
*
* $Id: Basic_Types.h 87392 2009-11-07 09:32:06Z johnnyw $
* $Id: Basic_Types.h 91161 2010-07-21 18:25:12Z schmidt $
*
* @author David L. Levine
*
@@ -712,7 +712,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL
# if defined (PRId8)
# define ACE_INT8_FORMAT_SPECIFIER ACE_TEXT ("%") ACE_TEXT (PRId8)
# else
# define ACE_INT8_FORMAT_SPECIFIER ACE_TEXT (ACE_INT8_FORMAT_SPECIFIER)
# define ACE_INT8_FORMAT_SPECIFIER ACE_TEXT (ACE_INT8_FORMAT_SPECIFIER_ASCII)
# endif /* defined (PRId8) */
#endif /* ACE_INT8_FORMAT_SPECIFIER */
+7 -6
View File
@@ -4,7 +4,7 @@
/**
* @file Cached_Connect_Strategy_T.h
*
* $Id: Cached_Connect_Strategy_T.h 82771 2008-09-17 18:47:48Z johnnyw $
* $Id: Cached_Connect_Strategy_T.h 91077 2010-07-13 14:33:08Z johnnyw $
*
* @author Kirthika Parameswaran <[email protected]>
*/
@@ -116,12 +116,12 @@ protected:
/// Add to cache (non-locking version).
virtual int cache_i (const void *recycling_act);
/// Get/Set <recycle_state> (non-locking version).
/// Get/Set recycle_state (non-locking version).
virtual int recycle_state_i (const void *recycling_act,
ACE_Recyclable_State new_state);
virtual ACE_Recyclable_State recycle_state_i (const void *recycling_act) const;
/// Cleanup hint and reset <*act_holder> to zero if <act_holder != 0>.
/// Cleanup hint and reset @c *act_holder to zero if @a act_holder != 0.
virtual int cleanup_hint_i (const void *recycling_act,
void **act_holder);
@@ -184,13 +184,14 @@ protected:
/**
* @class ACE_Bounded_Cached_Connect_Strategy
*
* @brief A connection strategy which caches connections to peers
* @brief
* A connection strategy which caches connections to peers
* (represented by SVC_HANDLER instances), thereby allowing
* subsequent re-use of unused, but available, connections.
* This strategy should be used when the cache is bounded by
* maximum size.
*
* <Bounded_Cached_Connect_Strategy> is intended to be used as a
* Bounded_Cached_Connect_Strategy is intended to be used as a
* plug-in connection strategy for ACE_Strategy_Connector.
* It's added value is re-use of established connections and
* tweaking the role of the cache as per the caching strategy.
@@ -244,7 +245,7 @@ protected:
protected:
/// max items in the cache, used as a bound for the creation of svc_handlers.
/// Max items in the cache, used as a bound for the creation of svc_handlers.
size_t max_size_;
};
+7 -7
View File
@@ -4,7 +4,7 @@
/**
* @file Capabilities.h
*
* $Id: Capabilities.h 80826 2008-03-04 14:51:23Z wotte $
* $Id: Capabilities.h 91077 2010-07-13 14:33:08Z johnnyw $
*
* @author Arturo Montes <[email protected]>
*/
@@ -124,16 +124,17 @@ protected:
/**
* @class ACE_Capabilities
*
* @brief This class implement the ACE Capabilities.
* @brief
* This class implement the ACE Capabilities.
*
* This is a container class for ACE Capabilities
* values. Currently exist three different capability values:
* <ACE_IntCapEntry> (integer), <ACE_BoolCapEntry> (bool) and
* <ACE_StringCapEntry> (String). An ACE_Capabilities is a
* unordered set of pair = (<String>, <ACE_CapEntry> *). Where
* ACE_IntCapEntry (integer), ACE_BoolCapEntry (bool) and
* ACE_StringCapEntry (String). An ACE_Capabilities is a
* unordered set of pair = (String, ACE_CapEntry *). Where
* the first component is the name of capability and the second
* component is a pointer to the capability value container. A
* <FILE> is a container for ACE_Capabilities, the
* FILE is a container for ACE_Capabilities, the
* ACE_Capabilities has a name in the file, as a termcap file.
*/
class ACE_Export ACE_Capabilities
@@ -188,7 +189,6 @@ private:
/// This is the set of ACE_CapEntry.
CAPABILITIES_MAP caps_;
};
#if defined (ACE_IS_SPLITTING)
+6 -6
View File
@@ -4,7 +4,7 @@
/**
* @file Connector.h
*
* $Id: Connector.h 89510 2010-03-17 12:21:14Z vzykov $
* $Id: Connector.h 91058 2010-07-12 08:20:09Z johnnyw $
*
* @author Douglas C. Schmidt <[email protected]>
*/
@@ -424,7 +424,7 @@ public:
SUPER;
/**
* Initialize a connector. @a flags indicates how <SVC_HANDLER>'s
* Initialize a connector. @a flags indicates how SVC_HANDLER's
* should be initialized prior to being activated. Right now, the
* only flag that is processed is ACE_NONBLOCK, which enabled
* non-blocking I/O on the SVC_HANDLER when it is opened.
@@ -535,21 +535,21 @@ protected:
/// Creation strategy for an Connector.
CREATION_STRATEGY *creation_strategy_;
/// true if Connector created the creation strategy and thus should
/// True if Connector created the creation strategy and thus should
/// delete it, else false.
bool delete_creation_strategy_;
/// Connect strategy for a Connector.
CONNECT_STRATEGY *connect_strategy_;
/// true if Connector created the connect strategy and thus should
/// True if Connector created the connect strategy and thus should
/// delete it, else false.
bool delete_connect_strategy_;
/// Concurrency strategy for an <Connector>.
/// Concurrency strategy for a Connector.
CONCURRENCY_STRATEGY *concurrency_strategy_;
/// true if Connector created the concurrency strategy and thus should
/// True if Connector created the concurrency strategy and thus should
/// delete it, else false.
bool delete_concurrency_strategy_;
};
+3 -3
View File
@@ -4,7 +4,7 @@
/**
* @file DLL.h
*
* $Id: DLL.h 80826 2008-03-04 14:51:23Z wotte $
* $Id: DLL.h 91064 2010-07-12 10:11:24Z johnnyw $
*
* @author Kirthika Parameswaran <[email protected]>
*/
@@ -151,12 +151,12 @@ public:
* Return the handle to the caller. If @a become_owner is non-0 then
* caller assumes ownership of the handle and the ACE_DLL object
* won't call close() when it goes out of scope, even if
* <close_handle_on_destruction> is set.
* @c close_handle_on_destruction is set.
*/
ACE_SHLIB_HANDLE get_handle (int become_owner = 0) const;
/// Set the handle for the DLL object. By default, the close()
//operation on / the object will be invoked before it is destroyed.
/// operation on / the object will be invoked before it is destroyed.
int set_handle (ACE_SHLIB_HANDLE handle,
bool close_handle_on_destruction = true);
+8 -8
View File
@@ -1,4 +1,4 @@
// $Id: DLL_Manager.cpp 86478 2009-08-13 07:15:05Z johnnyw $
// $Id: DLL_Manager.cpp 90712 2010-06-18 20:01:29Z shuston $
#include "ace/DLL_Manager.h"
@@ -61,7 +61,7 @@ ACE_DLL_Handle::open (const ACE_TCHAR *dll_name,
{
if (ACE::debug ())
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("(%P|%t) DLL_Handle::open: error, ")
ACE_TEXT ("ACE (%P|%t) DLL_Handle::open: error, ")
ACE_TEXT ("tried to reopen %s with name %s\n"),
this->dll_name_,
dll_name));
@@ -370,7 +370,7 @@ ACE_DLL_Handle::get_handle (int become_owner)
if (ACE::debug ())
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("ACE (%P|%t) ACE_DLL_Handle::get_handle: ")
ACE_TEXT ("ACE (%P|%t) DLL_Handle::get_handle: ")
ACE_TEXT ("post call: handle %s, refcount %d\n"),
this->handle_ == ACE_SHLIB_INVALID_HANDLE ?
ACE_TEXT ("invalid") : ACE_TEXT ("valid"),
@@ -537,7 +537,7 @@ ACE_DLL_Manager::ACE_DLL_Manager (int size)
if (this->open (size) != 0 && ACE::debug ())
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("ACE_DLL_Manager ctor failed to allocate ")
ACE_TEXT ("ACE (%P|%t) DLL_Manager ctor failed to allocate ")
ACE_TEXT ("handle_vector_.\n")));
}
@@ -547,7 +547,7 @@ ACE_DLL_Manager::~ACE_DLL_Manager (void)
if (this->close () != 0 && ACE::debug ())
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("ACE_DLL_Manager dtor failed to close ")
ACE_TEXT ("ACE (%P|%t) DLL_Manager dtor failed to close ")
ACE_TEXT ("properly.\n")));
}
@@ -583,7 +583,7 @@ ACE_DLL_Manager::open_dll (const ACE_TCHAR *dll_name,
// Error while opening dll. Free temp handle
if (ACE::debug ())
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("ACE_DLL_Manager::open_dll: Could not ")
ACE_TEXT ("ACE (%P|%t) DLL_Manager::open_dll: Could not ")
ACE_TEXT ("open dll %s.\n"),
dll_name));
@@ -766,7 +766,7 @@ ACE_DLL_Manager::unload_dll (ACE_DLL_Handle *dll_handle, int force_unload)
{
if (ACE::debug ())
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("ACE_DLL_Manager::unload error.\n")));
ACE_TEXT ("ACE (%P|%t) DLL_Manager::unload error.\n")));
return -1;
}
@@ -775,7 +775,7 @@ ACE_DLL_Manager::unload_dll (ACE_DLL_Handle *dll_handle, int force_unload)
{
if (ACE::debug ())
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("ACE_DLL_Manager::unload_dll called with ")
ACE_TEXT ("ACE (%P|%t) DLL_Manager::unload_dll called with ")
ACE_TEXT ("null pointer.\n")));
return -1;
+16 -16
View File
@@ -4,7 +4,7 @@
/**
* @file DLL_Manager.h
*
* $Id: DLL_Manager.h 80826 2008-03-04 14:51:23Z wotte $
* $Id: DLL_Manager.h 91064 2010-07-12 10:11:24Z johnnyw $
*
* @author Don Hinton <dhinton@ieee.org>
*/
@@ -45,7 +45,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
* on some platforms. It is refcounted and managed by
* ACE_DLL_Manager, so there will only be a single instance of this
* class for each dll loaded, no matter how many instances of ACE_DLL
* an application has open. Operations <open>, <close>, and <symbol>
* an application has open. Operations open(), close(), and symbol()
* have been implemented to help opening/closing and extracting symbol
* information from a DLL, respectively.
*
@@ -69,11 +69,11 @@ public:
/**
* This method opens and dynamically links @a dll_name. The default
* mode is <RTLD_LAZY>, which loads identifier symbols but not the
* mode is @c RTLD_LAZY, which loads identifier symbols but not the
* symbols for functions, which are loaded dynamically on-demand.
* Other supported modes include: <RTLD_NOW>, which performs all
* Other supported modes include: @c RTLD_NOW, which performs all
* necessary relocations when @a dll_name is first loaded and
* <RTLD_GLOBAL>, which makes symbols available for relocation
* @c RTLD_GLOBAL, which makes symbols available for relocation
* processing of any other DLLs. Returns -1 on failure and 0 on
* success.
*/
@@ -110,20 +110,20 @@ private:
/// to the caller.
auto_ptr <ACE_TString> error (void);
// Builds array of DLL names to try to dlopen, based on platform
// and configured DLL prefixes/suffixes.
// Returns the array of names to try in try_names.
/// Builds array of DLL names to try to dlopen, based on platform
/// and configured DLL prefixes/suffixes.
/// Returns the array of names to try in try_names.
void get_dll_names (const ACE_TCHAR *dll_name,
ACE_Array<ACE_TString> &try_names);
// Disallow copying and assignment since we don't handle them.
/// Disallow copying and assignment since we don't handle them.
ACE_DLL_Handle (const ACE_DLL_Handle &);
void operator= (const ACE_DLL_Handle &);
private:
// Keep track of how many ACE_DLL objects have a reference to this
// dll.
/// Keep track of how many ACE_DLL objects have a reference to this
/// dll.
sig_atomic_t refcount_;
/// Name of the shared library.
@@ -218,16 +218,16 @@ protected:
/// Destructor.
~ACE_DLL_Manager (void);
// Allocate handle_vector_.
/// Allocate handle_vector_.
int open (int size);
// Close all open dlls and deallocate memory.
/// Close all open dlls and deallocate memory.
int close (void);
// Find dll in handle_vector_.
/// Find dll in handle_vector_.
ACE_DLL_Handle *find_dll (const ACE_TCHAR *dll_name) const;
// Applies strategy for unloading dll.
/// Applies strategy for unloading dll.
int unload_dll (ACE_DLL_Handle *dll_handle, int force_unload = 0);
private:
@@ -235,7 +235,7 @@ private:
/// Close the singleton instance.
static void close_singleton (void);
// Disallow copying and assignment since we don't handle these.
/// Disallow copying and assignment since we don't handle these.
ACE_DLL_Manager (const ACE_DLL_Manager &);
void operator= (const ACE_DLL_Manager &);
+1 -51
View File
@@ -4,7 +4,7 @@
/**
* @file Dev_Poll_Reactor.h
*
* $Id: Dev_Poll_Reactor.h 90177 2010-05-19 11:44:22Z vzykov $
* $Id: Dev_Poll_Reactor.h 91066 2010-07-12 11:05:04Z johnnyw $
*
* @c /dev/poll (or Linux @c sys_epoll) based Reactor implementation.
*
@@ -54,52 +54,6 @@ class ACE_Sig_Handler;
class ACE_Dev_Poll_Reactor;
// ---------------------------------------------------------------------
#if 0
/**
* @class ACE_Dev_Poll_Ready_Set
*
* @brief Class that contains the list of "ready" file descriptors.
*
* This class points to an array of pollfd structures corresponding to
* "ready" file descriptors, such as those corresponding to event
* handlers that request an additional callback after being initially
* dispatched (i.e. return a value greater than zero).
* @par
* The idea is to store the "ready" set in an existing area of memory
* that already contains pollfd instances. Doing so is safe since the
* "ready" set is dispatched before polling for additional events,
* thus avoiding being potentially overwritten during the event poll.
* @par
* When the "ready" set is dispatched, all that needs to be done is to
* iterate over the contents of the array. There is no need to "walk"
* the array in search of ready file descriptors since the array by
* design only contains ready file descriptors. As such, this
* implementation of a ready set is much more efficient in the
* presence of a large number of file descriptors in terms of both
* time and space than the one used in the Select_Reactor, for
* example.
*/
class ACE_Dev_Poll_Ready_Set
{
public:
/// Constructor.
ACE_Dev_Poll_Ready_Set (void);
public:
/// The array containing the pollfd structures corresponding to the
/// "ready" file descriptors.
struct pollfd *pfds;
/// The number of "ready" file descriptors in the above array.
int nfds;
};
#endif /* 0 */
// ---------------------------------------------------------------------
/**
@@ -1050,10 +1004,6 @@ protected:
*/
ACE_HANDLE poll_fd_;
/// Track HANDLES we are interested in for various events that must
/// be dispatched *without* polling.
/// ACE_Dev_Poll_Ready_Set ready_set_;
#if defined (ACE_HAS_EVENT_POLL)
/// Event structure to be filled by epoll_wait. epoll_wait() only gets
/// one event at a time and we rely on it's internals for fairness.
+1 -13
View File
@@ -1,6 +1,5 @@
// -*- C++ -*-
//
// $Id: Dev_Poll_Reactor.inl 90177 2010-05-19 11:44:22Z vzykov $
// $Id: Dev_Poll_Reactor.inl 91066 2010-07-12 11:05:04Z johnnyw $
#include "ace/Log_Msg.h"
@@ -20,17 +19,6 @@ ACE_Dev_Poll_Reactor::Event_Tuple::Event_Tuple (ACE_Event_Handler *eh,
// ---------------------------------------------------------------------
#if 0
ACE_INLINE
ACE_Dev_Poll_Ready_Set::ACE_Dev_Poll_Ready_Set (void)
: pfds (0),
nfds (0)
{
}
#endif /* 0 */
// ---------------------------------------------------------------------
ACE_INLINE size_t
ACE_Dev_Poll_Reactor::Handler_Repository::size (void) const
{
+14 -14
View File
@@ -4,7 +4,7 @@
/**
* @file Dirent.h
*
* $Id: Dirent.h 84316 2009-02-03 19:46:05Z johnnyw $
* $Id: Dirent.h 91064 2010-07-12 10:11:24Z johnnyw $
*
* Define a portable C++ interface to ACE_OS_Dirent directory-entry
* manipulation.
@@ -59,21 +59,21 @@ public:
* refers, and positions the directory stream at the next entry,
* except on read-only filesystems. It returns a NULL pointer upon
* reaching the end of the directory stream, or upon detecting an
* invalid location in the directory. <readdir> shall not return
* invalid location in the directory. @c read() shall not return
* directory entries containing empty names. It is unspecified
* whether entries are returned for dot or dot-dot. The pointer
* returned by <readdir> points to data that may be overwritten by
* another call to <readdir> on the same directory stream. This
* data shall not be overwritten by another call to <readdir> on a
* different directory stream. <readdir> may buffer several
* directory entries per actual read operation; <readdir> marks for
* returned by @c read() points to data that may be overwritten by
* another call to @c read() on the same directory stream. This
* data shall not be overwritten by another call to @c read() on a
* different directory stream. @c read() may buffer several
* directory entries per actual read operation; @c read() marks for
* update the st_atime field of the directory each time the
* directory is actually read.
*/
ACE_DIRENT *read (void);
/**
* Has the equivalent functionality as <readdir> except that an
* Has the equivalent functionality as @c read() except that an
* @a entry and @a result buffer must be supplied by the caller to
* store the result.
*/
@@ -86,15 +86,15 @@ public:
long tell (void);
/**
* Sets the position of the next <readdir> operation on the
* Sets the position of the next @c read() operation on the
* directory stream. The new position reverts to the position
* associated with the directory stream at the time the <telldir>
* associated with the directory stream at the time the @c tell()
* operation that provides loc was performed. Values returned by
* <telldir> are good only for the lifetime of the <ACE_DIR> pointer from
* @c tell() are good only for the lifetime of the ACE_DIR pointer from
* which they are derived. If the directory is closed and then
* reopened, the <telldir> value may be invalidated due to
* reopened, the @c telldir() value may be invalidated due to
* undetected directory compaction. It is safe to use a previous
* <telldir> value immediately after a call to <opendir> and before
* @c telldir() value immediately after a call to @c opendir() and before
* any calls to readdir.
*/
void seek (long loc);
@@ -103,7 +103,7 @@ public:
* Resets the position of the directory stream to the beginning of
* the directory. It also causes the directory stream to refer to
* the current state of the corresponding directory, as a call to
* <opendir> would.
* @c opendir() would.
*/
void rewind (void);
+3 -2
View File
@@ -4,7 +4,7 @@
/**
* @file Dump_T.h
*
* $Id: Dump_T.h 80826 2008-03-04 14:51:23Z wotte $
* $Id: Dump_T.h 91064 2010-07-12 10:11:24Z johnnyw $
*
* @author Doug Schmidt
*/
@@ -26,7 +26,8 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
/**
* @class ACE_Dumpable_Adapter
*
* @brief This class inherits the interface of the abstract ACE_Dumpable
* @brief
* This class inherits the interface of the abstract ACE_Dumpable
* class and is instantiated with the implementation of the
* concrete component class <class Concrete>.
*
+10 -8
View File
@@ -4,7 +4,7 @@
/**
* @file Event_Handler.h
*
* $Id: Event_Handler.h 86576 2009-08-29 22:42:51Z shuston $
* $Id: Event_Handler.h 91066 2010-07-12 11:05:04Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -38,7 +38,8 @@ typedef unsigned long ACE_Reactor_Mask;
/**
* @class ACE_Event_Handler
*
* @brief Provides an abstract interface for handling various types of
* @brief
* Provides an abstract interface for handling various types of
* I/O, timer, and signal events.
*
* Subclasses read/write input/output on an I/O descriptor,
@@ -94,9 +95,9 @@ public:
// = Get/set priority
// Priorities run from MIN_PRIORITY (which is the "lowest priority")
// to MAX_PRIORITY (which is the "highest priority").
/// Get the priority of the Event_Handler.
/// @note Priorities run from MIN_PRIORITY (which is the "lowest priority")
/// to MAX_PRIORITY (which is the "highest priority").
virtual int priority (void) const;
/// Set the priority of the Event_Handler.
@@ -177,8 +178,8 @@ public:
* non-sockets (such as ACE_STDIN). This is commonly used in
* situations where the Reactor is used to demultiplex read events
* on ACE_STDIN on UNIX. Note that @a event_handler must be a
* subclass of ACE_Event_Handler. If the <get_handle> method of
* this event handler returns <ACE_INVALID_HANDLE> we default to
* subclass of ACE_Event_Handler. If the get_handle() method of
* this event handler returns ACE_INVALID_HANDLE we default to
* reading from ACE_STDIN.
*/
static ACE_THR_FUNC_RETURN read_adapter (void *event_handler);
@@ -193,7 +194,7 @@ public:
ACE_Thread_Manager *thr_mgr,
int flags = THR_DETACHED);
/// Performs the inverse of the <register_stdin_handler> method.
/// Performs the inverse of the register_stdin_handler() method.
static int remove_stdin_handler (ACE_Reactor *reactor,
ACE_Thread_Manager *thr_mgr);
@@ -238,7 +239,8 @@ public:
/**
* @class Reference_Counting_Policy
*
* @brief This policy dictates the reference counting requirements
* @brief
* This policy dictates the reference counting requirements
* for the handler.
*
* This policy allows applications to configure whether it wants the
+2 -2
View File
@@ -4,7 +4,7 @@
/**
* @file File_Lock.h
*
* $Id: File_Lock.h 87213 2009-10-23 13:11:34Z johnnyw $
* $Id: File_Lock.h 91064 2010-07-12 10:11:24Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -69,7 +69,7 @@ public:
/**
* Note, for interface uniformity with other synchronization
* wrappers we include the <acquire> method. This is implemented as
* wrappers we include the acquire() method. This is implemented as
* a write-lock to be on the safe-side...
*/
int acquire (short whence = 0, ACE_OFF_T start = 0, ACE_OFF_T len = 1);
+8 -5
View File
@@ -4,7 +4,7 @@
/**
* @file Filecache.h
*
* $Id: Filecache.h 80826 2008-03-04 14:51:23Z wotte $
* $Id: Filecache.h 91066 2010-07-12 11:05:04Z johnnyw $
*
* @author James Hu
*/
@@ -41,7 +41,8 @@ class ACE_Filecache_Object;
/**
* @class ACE_Filecache_Handle
*
* @brief Abstraction over a real file. This is meant to be the entry
* @brief
* Abstraction over a real file. This is meant to be the entry
* point into the Cached Virtual Filesystem.
*
* This is a cached filesystem implementation based loosely on the
@@ -143,7 +144,7 @@ private:
/// A reference to the low level instance.
ACE_Filecache_Object *file_;
/// A <dup>'d version of the one from <file_>.
/// A dup'd version of the one from file_.
ACE_HANDLE handle_;
int mapit_;
@@ -157,7 +158,8 @@ typedef ACE_Hash_Map_Entry<const ACE_TCHAR *, ACE_Filecache_Object *> ACE_Fileca
/**
* @class ACE_Filecache
*
* @brief A hash table holding the information about entry point into
* @brief
* A hash table holding the information about entry point into
* the Cached Virtual Filesystem. On insertion, the reference
* count is incremented. On destruction, reference count is
* decremented.
@@ -231,7 +233,8 @@ private:
/**
* @class ACE_Filecache_Object
*
* @brief Abstraction over a real file. This is what the Virtual
* @brief
* Abstraction over a real file. This is what the Virtual
* Filesystem contains. This class is not intended for general
* consumption. Please consult a physician before attempting to
* use this class.
+2 -1
View File
@@ -1,11 +1,12 @@
// -*- C++ -*-
//
// $Id: Handle_Gobbler.inl 85911 2009-07-07 05:45:14Z olli $
// $Id: Handle_Gobbler.inl 90388 2010-06-02 15:27:59Z vzykov $
// Since this is only included in Handle_Gobbler.h, these should be
// inline, not ACE_INLINE.
// FUZZ: disable check_for_inline
#include "ace/ACE.h"
#include "ace/OS_NS_unistd.h"
#include "ace/OS_NS_fcntl.h"
+5 -5
View File
@@ -4,7 +4,7 @@
/**
* @file INET_Addr.h
*
* $Id: INET_Addr.h 82789 2008-09-19 14:47:28Z johnnyw $
* $Id: INET_Addr.h 91064 2010-07-12 10:11:24Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -71,15 +71,15 @@ public:
explicit ACE_INET_Addr (u_short port_number,
ACE_UINT32 ip_addr = INADDR_ANY);
/// Uses <getservbyname> to create an ACE_INET_Addr from a
/// <port_name>, the remote @a host_name, and the @a protocol.
/// Uses getservbyname() to create an ACE_INET_Addr from a
/// @a port_name, the remote @a host_name, and the @a protocol.
ACE_INET_Addr (const char port_name[],
const char host_name[],
const char protocol[] = "tcp");
/**
* Uses <getservbyname> to create an ACE_INET_Addr from a
* <port_name>, an Internet @a ip_addr, and the @a protocol. This
* Uses getservbyname() to create an ACE_INET_Addr from a
* @a port_name, an Internet @a ip_addr, and the @a protocol. This
* method assumes that @a ip_addr is in host byte order.
*/
ACE_INET_Addr (const char port_name[],
+4 -4
View File
@@ -4,7 +4,7 @@
/**
* @file Log_Msg_Callback.h
*
* $Id: Log_Msg_Callback.h 80826 2008-03-04 14:51:23Z wotte $
* $Id: Log_Msg_Callback.h 91064 2010-07-12 10:11:24Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -35,7 +35,7 @@ class ACE_Log_Record;
* Log_Msg class and make sure that they turn on the
* ACE_Log_Msg::MSG_CALLBACK flag.
*
* Your <log> routine is called with an instance of
* Your log() routine is called with an instance of
* ACE_Log_Record. From this class, you can get the log
* message, the verbose log message, message type, message
* priority, and so on.
@@ -43,9 +43,9 @@ class ACE_Log_Record;
* Remember that there is one Log_Msg object per thread.
* Therefore, you may need to register your callback object with
* many ACE_Log_Msg objects (and have the correct
* synchronization in the <log> method) or have a separate
* synchronization in the log() method) or have a separate
* callback object per Log_Msg object. Moreover,
* <ACE_Log_Msg_Callbacks> are not inherited when a new thread
* ACE_Log_Msg_Callbacks are not inherited when a new thread
* is spawned because it might have been allocated off of the
* stack of the original thread, in which case all hell would
* break loose... Therefore, you'll need to reset these in each
+2 -1
View File
@@ -4,7 +4,7 @@
/**
* @file Log_Msg_UNIX_Syslog.h
*
* $Id: Log_Msg_UNIX_Syslog.h 80826 2008-03-04 14:51:23Z wotte $
* $Id: Log_Msg_UNIX_Syslog.h 90388 2010-06-02 15:27:59Z vzykov $
*
* @author Jerry D. De Master <jdemaster@rite-solutions.com>
*/
@@ -23,6 +23,7 @@
#if !defined (ACE_LACKS_UNIX_SYSLOG)
#include "ace/Log_Msg_Backend.h"
#include "ace/Basic_Types.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+32 -27
View File
@@ -4,7 +4,7 @@
/**
* @file Log_Record.h
*
* $Id: Log_Record.h 85236 2009-05-01 11:43:56Z johnnyw $
* $Id: Log_Record.h 91064 2010-07-12 10:11:24Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -56,7 +56,7 @@ public:
// = Initialization
/**
* Create a <Log_Record> and set its priority, time stamp, and
* Create a Log_Record and set its priority, time stamp, and
* process id.
*/
ACE_Log_Record (void);
@@ -72,7 +72,7 @@ public:
/// Write the contents of the logging record to the appropriate
/// <FILE> if the corresponding type is enabled.
/// FILE if the corresponding type is enabled.
int print (const ACE_TCHAR host_name[],
u_long verbose_flag,
#if !defined (ACE_HAS_WINCE)
@@ -101,62 +101,67 @@ public:
static const ACE_TCHAR *priority_name (ACE_Log_Priority p);
/// IMPORTANT: @a name must be a statically allocated const ACE_TCHAR*
static void priority_name (ACE_Log_Priority p,
const ACE_TCHAR *name);
static void priority_name (ACE_Log_Priority p, const ACE_TCHAR *name);
// = Marshall/demarshall
/// Encode the @c Log_Record for transmission on the network.
/// @deprecated The encode() and decode() metods are deprecated; please use
/// the CDR insertion and extraction operators to properly encode and decode
/// ACE_Log_Record objects.
/**
* Encode the @c Log_Record for transmission on the network.
* @deprecated
* The encode() and decode() metods are deprecated; please use
* the CDR insertion and extraction operators to properly encode and decode
* ACE_Log_Record objects.
*/
void encode (void);
/// Decode the @c Log_Record received from the network.
/// @deprecated The encode() and decode() metods are deprecated; please use
/// the CDR insertion and extraction operators to properly encode and decode
/// ACE_Log_Record objects.
/**
* Decode the @c Log_Record received from the network.
* @deprecated
* The encode() and decode() metods are deprecated; please use
* the CDR insertion and extraction operators to properly encode and decode
* ACE_Log_Record objects.
*/
void decode (void);
// = Set/get methods
/// Get the type of the <Log_Record>.
/// Get the type of the Log_Record.
ACE_UINT32 type (void) const;
/// Set the type of the <Log_Record>.
/// Set the type of the Log_Record.
void type (ACE_UINT32);
/**
* Get the priority of the <Log_Record> <type_>. This is computed
* Get the priority of the Log_Record <type_>. This is computed
* as the base 2 logarithm of <type_> (which must be a power of 2,
* as defined by the enums in <ACE_Log_Priority>).
* as defined by the enums in ACE_Log_Priority).
*/
u_long priority (void) const;
/// Set the priority of the <Log_Record> <type_> (which must be a
/// power of 2, as defined by the enums in <ACE_Log_Priority>).
/// Set the priority of the Log_Record <type_> (which must be a
/// power of 2, as defined by the enums in ACE_Log_Priority).
void priority (u_long num);
/// Get the total length of the <Log_Record>, which includes the
/// Get the total length of the Log_Record, which includes the
/// size of the various data member fields.
long length (void) const;
/// Set the total length of the <Log_Record>, which needs to account for
/// Set the total length of the Log_Record, which needs to account for
/// the size of the various data member fields.
void length (long);
/// Get the time stamp of the <Log_Record>.
/// Get the time stamp of the Log_Record.
ACE_Time_Value time_stamp (void) const;
/// Set the time stamp of the <Log_Record>.
/// Set the time stamp of the Log_Record.
void time_stamp (const ACE_Time_Value &ts);
/// Get the process id of the <Log_Record>.
/// Get the process id of the Log_Record.
long pid (void) const;
/// Set the process id of the <Log_Record>.
/// Set the process id of the Log_Record.
void pid (long);
/// Get the message data of the <Log_Record>.
/// Get the message data of the Log_Record.
const ACE_TCHAR *msg_data (void) const;
/// Set the message data of the record. If @a data is longer than the
@@ -164,7 +169,7 @@ public:
/// fit. If such a reallocation faisl, this method returns -1, else 0.
int msg_data (const ACE_TCHAR *data);
/// Get the size of the message data of the <Log_Record>, including
/// Get the size of the message data of the Log_Record, including
/// a byte for the NUL.
size_t msg_data_len (void) const;
+11 -2
View File
@@ -1,8 +1,9 @@
// $Id: Logging_Strategy.cpp 89512 2010-03-17 14:42:24Z vzykov $
// $Id: Logging_Strategy.cpp 90712 2010-06-18 20:01:29Z shuston $
#include "ace/Logging_Strategy.h"
#include "ace/Service_Config.h"
#include "ace/ACE.h"
#include "ace/ACE_export.h"
#include "ace/Get_Opt.h"
// FUZZ: disable check_for_streams_include
@@ -17,7 +18,7 @@
ACE_RCSID (ace,
Logging_Strategy,
"$Id: Logging_Strategy.cpp 89512 2010-03-17 14:42:24Z vzykov $")
"$Id: Logging_Strategy.cpp 90712 2010-06-18 20:01:29Z shuston $")
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -603,3 +604,11 @@ ACE_STATIC_SVC_DEFINE (ACE_Logging_Strategy,
0)
ACE_FACTORY_DEFINE (ACE, ACE_Logging_Strategy)
// _get_dll_unload_policy() prevents ACE from being unloaded and having its
// framework components run down if/when the Logging Strategy is unloaded.
extern "C" ACE_Export int
_get_dll_unload_policy()
{
return ACE_DLL_UNLOAD_POLICY_LAZY;
}
+9 -8
View File
@@ -4,7 +4,7 @@
/**
* @file Logging_Strategy.h
*
* $Id: Logging_Strategy.h 89512 2010-03-17 14:42:24Z vzykov $
* $Id: Logging_Strategy.h 91064 2010-07-12 10:11:24Z johnnyw $
*
* @author Prashant Jain <pjain@cs.wustl.edu>
* @author Orlando Ribeiro <oribeiro@inescporto.pt>
@@ -30,7 +30,8 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
/**
* @class ACE_Logging_Strategy
*
* @brief This class provides a way to dynamically configure the ACE logging
* @brief
* This class provides a way to dynamically configure the ACE logging
* mechanism at run time as well as enable the mechanisms for limiting
* log file size and log file backup/rotation capability.
*
@@ -170,16 +171,16 @@ protected:
/// Program name to be used for %n format specifier.
ACE_TCHAR *program_name_;
/// If non-0 then wipeout the logfile, otherwise append to it.
/// Default value is 0.
/// If true then wipeout the logfile, otherwise append to it.
/// Default value is false.
bool wipeout_logfile_;
/// If non-0 we have a maximum number of log files we can write.
/// Default value is 0, i.e., no maximum number.
/// If true we have a maximum number of log files we can write.
/// Default value is false, i.e., no maximum number.
bool fixed_number_;
/// If non-0 we order the files as we rotate them. Default value
/// is 0, i.e., we do not rotate files by default.
/// If true we order the files as we rotate them. Default value
/// is false, i.e., we do not rotate files by default.
bool order_files_;
/// This tells us in what file we last wrote. It will be increased
+2 -2
View File
@@ -4,7 +4,7 @@
/**
* @file Malloc_Base.h
*
* $Id: Malloc_Base.h 80826 2008-03-04 14:51:23Z wotte $
* $Id: Malloc_Base.h 91058 2010-07-12 08:20:09Z johnnyw $
*
* @author Doug Schmidt and Irfan Pyarali
*/
@@ -73,7 +73,7 @@ public:
size_type elem_size,
char initial_value = '\0') = 0;
/// Free <ptr> (must have been allocated by <ACE_Allocator::malloc>).
/// Free @a ptr (must have been allocated by ACE_Allocator::malloc()).
virtual void free (void *ptr) = 0;
/// Remove any resources associated with this memory manager.
+3 -3
View File
@@ -4,7 +4,7 @@
/**
* @file Manual_Event.h
*
* $Id: Manual_Event.h 80826 2008-03-04 14:51:23Z wotte $
* $Id: Manual_Event.h 91066 2010-07-12 11:05:04Z johnnyw $
*
* Moved from Synch.h.
*
@@ -39,14 +39,14 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Export ACE_Manual_Event : public ACE_Event
{
public:
/// constructor which will create manual event
/// Constructor which will create manual event
ACE_Manual_Event (int initial_state = 0,
int type = USYNC_THREAD,
const char *name = 0,
void *arg = 0);
#if defined (ACE_HAS_WCHAR)
/// constructor which will create manual event (wchar_t version)
/// Constructor which will create manual event (wchar_t version)
ACE_Manual_Event (int initial_state,
int type,
const wchar_t *name,
+9 -8
View File
@@ -4,7 +4,7 @@
/**
* @file Map_Manager.h
*
* $Id: Map_Manager.h 80826 2008-03-04 14:51:23Z wotte $
* $Id: Map_Manager.h 91066 2010-07-12 11:05:04Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -111,10 +111,11 @@ class ACE_Map_Reverse_Iterator;
/**
* @class ACE_Map_Manager
*
* @brief Define a map abstraction that associates <EXT_ID>s with
* <INT_ID>s.
* @brief
* Define a map abstraction that associates EXT_IDs with
* INT_IDs.
*
* The <EXT_ID> must support <operator==>. This constraint can
* The EXT_ID must support @c operator==. This constraint can
* be alleviated via template specialization, as shown in the
* $ACE_ROOT/tests/Conn_Test.cpp test.
* This class uses an ACE_Allocator to allocate memory. The
@@ -122,7 +123,7 @@ class ACE_Map_Reverse_Iterator;
* ACE_Allocator with a persistable memory pool.
* This implementation of a map uses an array, which is searched
* linearly. For more efficient searching you should use the
* <ACE_Hash_Map_Manager>.
* ACE_Hash_Map_Manager.
*/
template <class EXT_ID, class INT_ID, class ACE_LOCK>
class ACE_Map_Manager
@@ -195,7 +196,7 @@ public:
/**
* Reassociate @a ext_id with @a int_id. If @a ext_id is not in the
* map then behaves just like <bind>. Otherwise, store the old
* map then behaves just like bind(). Otherwise, store the old
* values of @a int_id into the "out" parameter and rebind the new
* parameters.
* @retval 0 If a new entry is bound successfully.
@@ -261,12 +262,12 @@ public:
size_t total_size (void) const;
/**
* Returns a reference to the underlying <ACE_LOCK>. This makes it
* Returns a reference to the underlying ACE_LOCK. This makes it
* possible to acquire the lock explicitly, which can be useful in
* some cases if you instantiate the ACE_Atomic_Op with an
* ACE_Recursive_Mutex or ACE_Process_Mutex, or if you need to
* guard the state of an iterator.
* @note The right name would be <lock>, but HP/C++ will choke on that!
* @note The right name would be lock, but HP/C++ will choke on that!
*/
ACE_LOCK &mutex (void);
+10 -13
View File
@@ -4,7 +4,7 @@
/**
* @file Mem_Map.h
*
* $Id: Mem_Map.h 80826 2008-03-04 14:51:23Z wotte $
* $Id: Mem_Map.h 91066 2010-07-12 11:05:04Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -22,6 +22,7 @@
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "ace/Global_Macros.h"
#include "ace/Copy_Disabled.h"
#include "ace/os_include/sys/os_mman.h"
#include "ace/os_include/os_limits.h"
#include "ace/os_include/os_fcntl.h"
@@ -37,7 +38,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
* This class works with both the mmap(2) UNIX system and the
* Win32 family of memory mapping system calls.
*/
class ACE_Export ACE_Mem_Map
class ACE_Export ACE_Mem_Map : private ACE_Copy_Disabled
{
public:
// = Initialization and termination methods.
@@ -128,38 +129,38 @@ public:
/// file.
size_t size (void) const;
/// Unmap the region starting at <base_addr_>.
/// Unmap the region starting at base_addr_.
int unmap (ssize_t len = -1);
/// Unmap the region starting at <addr_>.
/// Unmap the region starting at addr_.
int unmap (void *addr, ssize_t len);
/**
* Sync @a len bytes of the memory region to the backing store
* starting at <base_addr_>. If @a len == -1 then sync the whole
* starting at base_addr_. If @a len == -1 then sync the whole
* region.
*/
int sync (size_t len, int flags = MS_SYNC);
/**
* Sync the whole memory region to the backing store
* starting at <base_addr_>.
* starting at base_addr_.
*/
int sync (int flags = MS_SYNC);
/// Sync @a len bytes of the memory region to the backing store
/// starting at <addr_>.
/// starting at addr_.
int sync (void *addr, size_t len, int flags = MS_SYNC);
/**
* Change the protection of the pages of the mapped region to @a prot
* starting at <base_addr_> up to @a len bytes.
* starting at base_addr_ up to @a len bytes.
*/
int protect (size_t len, int prot = PROT_RDWR);
/**
* Change the protection of all the pages of the mapped region to @a prot
* starting at <base_addr_>.
* starting at base_addr_.
*/
int protect (int prot = PROT_RDWR);
@@ -197,10 +198,6 @@ private:
ACE_OFF_T offset = 0,
LPSECURITY_ATTRIBUTES sa = 0);
// = Disallow copying and assignment.
ACE_Mem_Map (const ACE_Mem_Map &);
void operator = (const ACE_Mem_Map &);
private:
/// Base address of the memory-mapped file.
+3 -3
View File
@@ -4,7 +4,7 @@
/**
* @file Message_Block.h
*
* $Id: Message_Block.h 86825 2009-09-28 17:45:23Z johnnyw $
* $Id: Message_Block.h 91066 2010-07-12 11:05:04Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -241,8 +241,8 @@ public:
/**
* Delete all the resources held in the message.
*
* Note that <release()> is designed to release the continuation
* chain; the destructor is not. See <release()> for details.
* @note Note that release() is designed to release the continuation
* chain; the destructor is not. See release() for details.
*/
virtual ~ACE_Message_Block (void);
+4 -4
View File
@@ -1,4 +1,4 @@
// $Id: Message_Queue_T.cpp 88560 2010-01-15 05:02:05Z schmidt $
// $Id: Message_Queue_T.cpp 91016 2010-07-06 11:29:50Z johnnyw $
#ifndef ACE_MESSAGE_QUEUE_T_CPP
#define ACE_MESSAGE_QUEUE_T_CPP
@@ -60,13 +60,13 @@ ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::message_length (size_t ne
}
template <class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL>
ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::ACE_Message_Queue_Ex (size_t hwm,
size_t lwm,
ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::ACE_Message_Queue_Ex (size_t high_water_mark,
size_t low_water_mark,
ACE_Notification_Strategy *ns)
{
ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::ACE_Message_Queue_Ex");
if (this->queue_.open (hwm, lwm, ns) == -1)
if (this->queue_.open (high_water_mark, low_water_mark, ns) == -1)
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("ACE_Message_Queue_Ex")));
}
+3 -7
View File
@@ -4,7 +4,7 @@
/**
* @file OS_Log_Msg_Attributes.h
*
* $Id: OS_Log_Msg_Attributes.h 83729 2008-11-13 15:32:36Z mitza $
* $Id: OS_Log_Msg_Attributes.h 91066 2010-07-12 11:05:04Z johnnyw $
*
* @author Carlos O'Ryan
*/
@@ -23,6 +23,7 @@
#include /**/ "ace/ACE_export.h"
#include "ace/os_include/os_stdio.h"
#include "ace/iosfwd.h"
#include "ace/Copy_Disabled.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -39,7 +40,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
* The contents of the class must be made available to the OS layer,
* because they are part of the thread descriptor.
*/
class ACE_Export ACE_OS_Log_Msg_Attributes
class ACE_Export ACE_OS_Log_Msg_Attributes : private ACE_Copy_Disabled
{
public:
/// Constructor
@@ -70,11 +71,6 @@ protected:
ACE_SEH_EXCEPT_HANDLER seh_except_selector_;
ACE_SEH_EXCEPT_HANDLER seh_except_handler_;
#endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */
private:
// Prevent copying
ACE_OS_Log_Msg_Attributes (const ACE_OS_Log_Msg_Attributes &);
ACE_OS_Log_Msg_Attributes &operator= (const ACE_OS_Log_Msg_Attributes &);
};
ACE_END_VERSIONED_NAMESPACE_DECL
+3 -3
View File
@@ -4,7 +4,7 @@
/**
* @file OS_NS_Thread.h
*
* $Id: OS_NS_Thread.h 85547 2009-06-07 17:57:11Z johnnyw $
* $Id: OS_NS_Thread.h 91210 2010-07-26 20:31:30Z shuston $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
* @author Jesper S. M|ller<stophph@diku.dk>
@@ -1604,7 +1604,7 @@ namespace ACE_OS {
* defined, this is the thread-id. For linux-threads, when
* ACE_HAS_SCHED_SETAFFINITY defined, it expects a process-id. Since for
* linux-threads a thread is seen as a process, it does the job.
* @param cpu_set_size The size of the cpu_mask
* @param cpu_set_size The size of the cpu_mask, in bytes.
* @param cpu_mask Is a bitmask of CPUs to bind to, e.g value 1 binds the
* thread to the "CPU 0", etc
*/
@@ -1621,7 +1621,7 @@ namespace ACE_OS {
* defined, this is the thread-id. For linux-threads, when
* ACE_HAS_SCHED_SETAFFINITY defined, it expects a process-id. Since for
* linux-threads a thread is seen as a process, it does the job.
* @param cpu_set_size The size of the cpu_mask
* @param cpu_set_size The size of the cpu_mask, in bytes.
* @param cpu_mask Is a bitmask of CPUs to bind to, e.g value 1 binds the
* thread to the "CPU 0", etc
*/
+3 -3
View File
@@ -4,7 +4,7 @@
/**
* @file OS_NS_unistd.h
*
* $Id: OS_NS_unistd.h 84918 2009-03-20 08:07:01Z johnnyw $
* $Id: OS_NS_unistd.h 91066 2010-07-12 11:05:04Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
* @author Jesper S. M|ller<stophph@diku.dk>
@@ -189,12 +189,12 @@ namespace ACE_OS
// should call gethostname()
ACE_NAMESPACE_INLINE_FUNCTION
int hostname (char *name,
int hostname (char name[],
size_t maxnamelen);
#if defined (ACE_HAS_WCHAR)
ACE_NAMESPACE_INLINE_FUNCTION
int hostname (wchar_t *name,
int hostname (wchar_t name[],
size_t maxnamelen);
#endif /* ACE_HAS_WCHAR */
+10 -9
View File
@@ -4,7 +4,7 @@
/**
* @file Object_Manager.h
*
* $Id: Object_Manager.h 84163 2009-01-15 07:57:27Z johnnyw $
* $Id: Object_Manager.h 91066 2010-07-12 11:05:04Z johnnyw $
*
* @author David L. Levine <levine@cs.wustl.edu>
* @author Matthias Kerkhoff
@@ -272,7 +272,7 @@ public:
static int remove_at_exit (void *object);
#if 0 /* not implemented yet */
/// Similar to <at_exit>, except that the cleanup_hook is called
/// Similar to at_exit(), except that the cleanup_hook is called
/// when the current thread exits instead of when the program terminates.
static int at_thread_exit (void *object,
ACE_CLEANUP_FUNC cleanup_hook,
@@ -327,7 +327,8 @@ public:
};
/**
* @deprecated Accesses a default signal set used, for example,
* @deprecated
* Accesses a default signal set used, for example,
* in ACE_Sig_Guard methods.
* Deprecated: use ACE_Object_Manager::default_mask () instead.
*/
@@ -411,10 +412,10 @@ public:
static void *preallocated_array[ACE_PREALLOCATED_ARRAYS];
public:
// Application code should not use these explicitly, so they're
// hidden here. They're public so that the ACE_Object_Manager can
// be constructed/destructed in <main> with
// ACE_HAS_NONSTATIC_OBJECT_MANAGER.
/// Application code should not use these explicitly, so they're
/// hidden here. They're public so that the ACE_Object_Manager can
/// be constructed/destructed in <main> with
/// ACE_HAS_NONSTATIC_OBJECT_MANAGER.
ACE_Object_Manager (void);
~ACE_Object_Manager (void);
@@ -435,7 +436,7 @@ private:
#endif /* ACE_MT_SAFE */
#if defined (ACE_HAS_TSS_EMULATION)
// Main thread's thread-specific storage array.
/// Main thread's thread-specific storage array.
void *ts_storage_[ACE_TSS_Emulation::ACE_TSS_THREAD_KEYS_MAX];
bool ts_storage_initialized_;
#endif /* ACE_HAS_TSS_EMULATION */
@@ -444,7 +445,7 @@ private:
friend class ACE_Object_Manager_Manager;
#endif /* ACE_HAS_NONSTATIC_OBJECT_MANAGER */
// Disallow copying by not implementing the following . . .
/// Disallow copying by not implementing the following . . .
ACE_Object_Manager (const ACE_Object_Manager &);
ACE_Object_Manager &operator= (const ACE_Object_Manager &);
};
+9 -3
View File
@@ -4,7 +4,7 @@
/**
* @file Process.h
*
* $Id: Process.h 87826 2009-11-30 14:02:40Z johnnyw $
* $Id: Process.h 91233 2010-07-29 14:47:16Z shuston $
*
* @author Tim Harrison <harrison@cs.wustl.edu>
*/
@@ -94,8 +94,14 @@ public:
/**
* Set the standard handles of the new process to the respective
* handles. If you want to affect a subset of the handles, make
* sure to set the others to ACE_INVALID_HANDLE. Returns 0 on
* success, -1 on failure.
* sure to set the others to ACE_INVALID_HANDLE.
*
* @note Any handle passed as ACE_INVALID_HANDLE will be changed to
* a duplicate of the current associated handle. For example, passing
* ACE_INVALID_HANDLE for @a std_in will cause ACE_STDIN to be
* duplicated and set in this object.
*
* @return 0 on success, -1 on failure.
*/
int set_handles (ACE_HANDLE std_in,
ACE_HANDLE std_out = ACE_INVALID_HANDLE,
+46
View File
@@ -0,0 +1,46 @@
// -*- C++ -*-
// $Id: ACE_QoS_Export.h 80826 2008-03-04 14:51:23Z wotte $
// Definition for Win32 Export directives.
// This file is generated automatically by
// generate_export_file.pl
// ------------------------------
#if !defined (ACE_QOS_EXPORT_H)
#define ACE_QOS_EXPORT_H
#include /**/ "ace/config-all.h"
#if defined (ACE_AS_STATIC_LIBS)
# if !defined (ACE_QoS_HAS_DLL)
# define ACE_QoS_HAS_DLL 0
# endif /* ! ACE_QoS_HAS_DLL */
#else
# if !defined (ACE_QoS_HAS_DLL)
# define ACE_QoS_HAS_DLL 1
# endif /* ! ACE_QoS_HAS_DLL */
#endif /* ACE_AS_STATIC_LIB */
#if defined (ACE_QoS_HAS_DLL)
# if (ACE_QoS_HAS_DLL == 1)
# if defined (ACE_QoS_BUILD_DLL)
# define ACE_QoS_Export ACE_Proper_Export_Flag
# define ACE_QoS_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
# define ACE_QoS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
# else
# define ACE_QoS_Export ACE_Proper_Import_Flag
# define ACE_QoS_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
# define ACE_QoS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
# endif /* ACE_QoS_BUILD_DLL */
# else
# define ACE_QoS_Export
# define ACE_QoS_SINGLETON_DECLARATION(T)
# define ACE_QoS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
# endif /* ! ACE_QoS_HAS_DLL == 1 */
#else
# define ACE_QoS_Export
# define ACE_QoS_SINGLETON_DECLARATION(T)
# define ACE_QoS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
#endif /* ACE_QoS_HAS_DLL */
#endif /* ACE_QOS_EXPORT_H */
// End of auto generated file.
+165
View File
@@ -0,0 +1,165 @@
// QoS_Decorator.cpp
// $Id: QoS_Decorator.cpp 80826 2008-03-04 14:51:23Z wotte $
#include "QoS_Decorator.h"
ACE_RCSID(ace, QoS_Decorator, "$Id: QoS_Decorator.cpp 80826 2008-03-04 14:51:23Z wotte $")
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_QOS_DECORATOR)
// Constructor.
ACE_QoS_Decorator_Base::ACE_QoS_Decorator_Base (void)
{}
// Constructor.
ACE_QoS_Decorator_Base::ACE_QoS_Decorator_Base (ACE_Event_Handler
*event_handler)
: event_handler_ (event_handler)
{
}
// Destructor.
ACE_QoS_Decorator_Base::~ACE_QoS_Decorator_Base (void)
{
}
// Forward the call to ACE_Event_Handler component.
ACE_HANDLE
ACE_QoS_Decorator_Base::get_handle (void) const
{
return this->event_handler_->get_handle ();
}
// Forward the call to ACE_Event_Handler component.
int
ACE_QoS_Decorator_Base::handle_input (ACE_HANDLE fd)
{
return this->event_handler_->handle_input (fd);
}
// Forward the call to ACE_Event_Handler component.
int
ACE_QoS_Decorator_Base::handle_qos (ACE_HANDLE fd)
{
return this->event_handler_->handle_qos (fd);
}
// Constructor.
ACE_QoS_Decorator::ACE_QoS_Decorator (void)
{}
// Constructor.
ACE_QoS_Decorator::ACE_QoS_Decorator (ACE_Event_Handler *event_handler,
ACE_QoS_Session *qos_session,
ACE_Reactor *reactor)
: qos_session_ (qos_session),
reactor_ (reactor)
{
ACE_NEW (this->decorator_base_,
ACE_QoS_Decorator_Base (event_handler));
ACE_NEW (this->qos_event_handler_,
ACE_QoS_Event_Handler (this->decorator_base_));
}
// Destructor.
ACE_QoS_Decorator::~ACE_QoS_Decorator (void)
{
delete this->decorator_base_;
delete this->qos_event_handler_;
}
// Implements the undecorated functionality. This is sufficient for
// GQoS. RAPI needs additional QoS decoration. This is done by the
// ACE_QoS_Event_Handler class.
ACE_HANDLE
ACE_QoS_Decorator::get_handle (void) const
{
return this->decorator_base_->get_handle ();
}
// Implements the undecorated functionality. This is sufficient for
// GQoS. RAPI needs additional QoS decoration. This is done by the
// ACE_QoS_Event_Handler class.
int
ACE_QoS_Decorator::handle_input (ACE_HANDLE fd)
{
return this->decorator_base_->handle_input (fd);
}
// Implements the undecorated functionality. This is sufficient for
// GQoS. RAPI needs additional QoS decoration. This is done by the
// ACE_QoS_Event_Handler class.
int
ACE_QoS_Decorator::handle_qos (ACE_HANDLE fd)
{
return this->decorator_base_->handle_qos (fd);
}
// This method registers the RAPI QoS event handler with the reactor
// if the application is using RAPI. Note that it is a no-op for GQoS
// because an extra socket for handling QoS events is not required.
int
ACE_QoS_Decorator::init (void)
{
#if defined (ACE_HAS_RAPI)
// Pass the QoS session to QoS Event Handler.
this->qos_event_handler_->qos_session (this->qos_session_);
// Register the QoS Event Handler with the Reactor.
return this->reactor_->register_handler (this->qos_event_handler_,
ACE_Event_Handler::READ_MASK);
#endif
return 0;
}
// Constructor.
ACE_QoS_Event_Handler::ACE_QoS_Event_Handler (void)
{
}
// Constructor.
ACE_QoS_Event_Handler::ACE_QoS_Event_Handler (ACE_QoS_Decorator_Base
*decorator_base)
: decorator_base_ (decorator_base)
{
}
// Destructor.
ACE_QoS_Event_Handler::~ACE_QoS_Event_Handler (void)
{
}
// Set the QoS session.
void
ACE_QoS_Event_Handler::qos_session (ACE_QoS_Session *qos_session)
{
this->qos_session_ = qos_session;
}
// Returns the RAPI file descriptor for listening to RAPI evnets.
ACE_HANDLE
ACE_QoS_Event_Handler::get_handle (void) const
{
return this->qos_session_->rsvp_events_handle ();
}
// Note, here the handle_input () calls the handle_qos () of the
// Decorator Base which then calls handle_qos () of the
// ACE_Event_Handler component within it. This helps to translate the
// normal read events into qos events in case of RAPI so the
// application using the API is oblivious to the fact that in RAPI,
// QoS events are received on a different socket. This helps to
// maintain a uniform design for the application irrespective of
// whether it is using RAPI or GQoS.
int
ACE_QoS_Event_Handler::handle_input (ACE_HANDLE fd)
{
return this->decorator_base_->handle_qos (fd);
}
ACE_END_VERSIONED_NAMESPACE_DECL
+179
View File
@@ -0,0 +1,179 @@
// -*- C++ -*-
//=============================================================================
/**
* @file QoS_Decorator.h
*
* $Id: QoS_Decorator.h 80826 2008-03-04 14:51:23Z wotte $
*
* @author Vishal Kachroo <vishal@cs.wustl.edu>
*/
//=============================================================================
#ifndef QOS_DECORATOR_H
#define QOS_DECORATOR_H
#include /**/ "ace/pre.h"
#include "ace/Reactor.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "ace/INET_Addr.h"
#include "ace/Event_Handler.h"
#include "SOCK_Dgram_Mcast_QoS.h"
#include "ACE_QoS_Export.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
/**
* @class ACE_QoS_Decorator_Base
*
* @brief This class is the Decorator Pattern Base class for decorating
* ACE_Event_Handler.
*
* It simply forwards the requests for get_handle (),
* handle_input () and handle_qos () to its event_handler_
* component. Concrete decorators for ACE_Event_Handler will use
* this class to access the basic event handler functionality and
* decorate that by their own implementation.
*/
class ACE_QoS_Export ACE_QoS_Decorator_Base : public ACE_Event_Handler
{
public:
// Initialization and termination methods.
/// Constructor.
ACE_QoS_Decorator_Base (void);
/// Constructor.
ACE_QoS_Decorator_Base (ACE_Event_Handler *event_handler);
/// Destructor.
~ACE_QoS_Decorator_Base (void);
/// Forwards the request to its event_handler_ component.
virtual ACE_HANDLE get_handle (void) const;
/// Forwards the request to its event_handler_ component.
virtual int handle_input (ACE_HANDLE fd);
/// Forwards the request to its event_handler_ component.
virtual int handle_qos (ACE_HANDLE fd);
private:
/// The event handler that is decorated by this class.
ACE_Event_Handler *event_handler_;
};
/**
* @class ACE_QoS_Event_Handler
*
* @brief This Handler is registered with the Reactor for QoS events.
*
* Concrete QoS decorator uses this class to receive QoS events
* for RAPI. It hides the application from knowing that it is
* receiving QoS events on a different socket so the application
* doesnt have to be designed differently for RAPI and GQoS.
*/
class ACE_QoS_Export ACE_QoS_Event_Handler : public ACE_Event_Handler
{
/// Destructor.
~ACE_QoS_Event_Handler (void);
/// Returns the RAPI file descriptor for receiving QoS events.
virtual ACE_HANDLE get_handle (void) const;
/// Calls the base class handle_input ().
virtual int handle_input (ACE_HANDLE fd);
/// Sets the QoS session.
void qos_session (ACE_QoS_Session *qos_session);
friend class ACE_QoS_Decorator;
private:
/// Constructor is private because only ACE_QoS_Decorator should
/// create this object.
ACE_QoS_Event_Handler (void);
/// The QoS Decorator passes in its base for this handler to use.
ACE_QoS_Event_Handler (ACE_QoS_Decorator_Base *decorator_base);
/// Used to get to the RAPI file descriptor for QoS Events.
ACE_QoS_Session *qos_session_;
/// Requests on the class are forwarded to this base class;
ACE_QoS_Decorator_Base *decorator_base_;
};
/**
* @class ACE_QoS_Decorator
*
* @brief Concrete QoS Decorator.
*
* Decorates the ACE_Event_Handler to additionally handle QoS
* events uniformly for different QoS mechanisms like RAPI and
* GQoS.
*/
class ACE_QoS_Export ACE_QoS_Decorator : public ACE_QoS_Decorator_Base
{
public:
// Initialization and termination methods.
/// Constructor.
ACE_QoS_Decorator (void);
/// Constructor.
ACE_QoS_Decorator (ACE_Event_Handler *event_handler,
ACE_QoS_Session *qos_session,
ACE_Reactor *reactor = ACE_Reactor::instance ());
/// Destructor.
~ACE_QoS_Decorator (void);
/// Calls the base class get_handle ().
virtual ACE_HANDLE get_handle (void) const;
/// Calls the base class handle_input ().
virtual int handle_input (ACE_HANDLE fd);
/// Calls the base class handle_qos ().
virtual int handle_qos (ACE_HANDLE fd);
/// This method registers the QoS Event Handler with the Reactor
/// to receive RAPI events.
int init (void);
private:
/// Requests on the class are forwarded to this base class;
ACE_QoS_Decorator_Base *decorator_base_;
/// Handles the QoS events and in that sense decorates the usual
/// ACE_Event_Handler.
ACE_QoS_Event_Handler *qos_event_handler_;
/// Passed to the ACE_QoS_Event_Handler for retrieving the RAPI
/// session specific information like rapi_fd.
ACE_QoS_Session *qos_session_;
/// If the application wants to use an instance of Reactor other
/// than the Singleton one.
ACE_Reactor *reactor_;
};
ACE_END_VERSIONED_NAMESPACE_DECL
#include /**/ "ace/post.h"
#endif /* QOS_DECORATOR_H */
+41
View File
@@ -0,0 +1,41 @@
// QoS_Manager.cpp
// $Id: QoS_Manager.cpp 80826 2008-03-04 14:51:23Z wotte $
#include "QoS_Manager.h"
#include "ace/Log_Msg.h"
ACE_RCSID(ace, QoS_Manager, "$Id: QoS_Manager.cpp 80826 2008-03-04 14:51:23Z wotte $")
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_QOS_MANAGER)
ACE_QoS_Manager::ACE_QoS_Manager (void)
{}
ACE_QoS_Manager::~ACE_QoS_Manager (void)
{}
// Adds the given session to the list of session objects joined by
// this socket.
int
ACE_QoS_Manager::join_qos_session (ACE_QoS_Session *qos_session)
{
if (this->qos_session_set ().insert (qos_session) != 0)
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("Error in adding a new session to the ")
ACE_TEXT ("socket session set\n")),
-1);
return 0;
}
// Returns the QoS session set for this socket.
ACE_Unbounded_Set <ACE_QoS_Session *>
ACE_QoS_Manager::qos_session_set (void)
{
return this->qos_session_set_;
}
ACE_END_VERSIONED_NAMESPACE_DECL
+74
View File
@@ -0,0 +1,74 @@
// -*- C++ -*-
//=============================================================================
/**
* @file QoS_Manager.h
*
* $Id: QoS_Manager.h 80826 2008-03-04 14:51:23Z wotte $
*
* @author Vishal Kachroo
*/
//=============================================================================
#ifndef ACE_QOS_MANAGER_H
#define ACE_QOS_MANAGER_H
#include /**/ "ace/pre.h"
#include "ace/Addr.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "ace/IPC_SAP.h"
#include "ace/Containers_T.h"
#include "ACE_QoS_Export.h"
#include "QoS_Session.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
/**
* @class ACE_QoS_Manager
*
* @brief This class manages the QoS sessions associated with ACE_SOCK.
*
* This class provides functions to manage the QoS
* associated with a socket. The idea is to keep the management of
* QoS for a socket separate from the socket itself. Currently, the
* manager is used to manage the QoS session set. It will handle more
* responsibilities in the future.
*/
class ACE_QoS_Export ACE_QoS_Manager
{
public:
/// Default constructor.
ACE_QoS_Manager (void);
/// Default destructor.
~ACE_QoS_Manager (void);
/**
* Join the given QoS session. A socket can join multiple QoS
* sessions. This call adds the given QoS session to the list of
* QoS sessions that the socket has already joined.
*/
int join_qos_session (ACE_QoS_Session *qos_session);
typedef ACE_Unbounded_Set <ACE_QoS_Session *> ACE_QOS_SESSION_SET;
/// Get the QoS session set.
ACE_QOS_SESSION_SET qos_session_set (void);
private:
/// Set of QoS sessions that this socket has joined.
ACE_QOS_SESSION_SET qos_session_set_;
};
ACE_END_VERSIONED_NAMESPACE_DECL
#include /**/ "ace/post.h"
#endif /* ACE_QOS_MANAGER_H */
+183
View File
@@ -0,0 +1,183 @@
/* -*- C++ -*- */
//=============================================================================
/**
* @file QoS_Session.h
*
* $Id: QoS_Session.h 80826 2008-03-04 14:51:23Z wotte $
*
* @author Vishal Kachroo <vishal@cs.wustl.edu>
*/
//=============================================================================
#ifndef ACE_QOS_SESSION_H
#define ACE_QOS_SESSION_H
#include /**/ "ace/pre.h"
#include "ACE_QoS_Export.h"
#include "ace/INET_Addr.h"
#include "ace/OS_QoS.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_SOCK;
class ACE_QoS_Manager;
typedef int ACE_Protocol_ID;
// IPPROTO_UDP or IPPROTO_TCP.
/**
* @class ACE_QoS_Session
*
* @brief A QoS Session object.
*
* This class defines the interface for a QoS Session. It abstracts the
* notion of QoS on different platforms and presents a simple, easy-to-use
* API. Current [RAPI,GQoS] and future implementations will conform to this
* interface.
*/
class ACE_QoS_Export ACE_QoS_Session
{
public:
enum RSVP_Event_Type
{
RSVP_PATH_EVENT,
RSVP_RESV_EVENT,
RSVP_RESV_CONFIRM,
RSVP_RESV_ERROR,
RSVP_PATH_ERROR
};
/// A flag to indicate if this endpoint is a sender or a receiver or
/// both.
enum ACE_End_Point_Type
{
ACE_QOS_SENDER,
ACE_QOS_RECEIVER,
ACE_QOS_BOTH
};
/// to shutup g++.
virtual ~ACE_QoS_Session (void) {};
/// Open a QoS session [dest IP, dest port, Protocol ID].
virtual int open (ACE_INET_Addr dest_addr,
ACE_Protocol_ID protocol_id) = 0;
/// Close the QoS Session.
virtual int close (void) = 0;
/// Returns the QoS in the current session.
virtual ACE_QoS qos (void) const = 0;
/// Set QoS for the current session. The qos manager is used to
/// confirm if this QoS session was subscribed to by the socket.
virtual int qos (ACE_SOCK *socket,
ACE_QoS_Manager *qos_manager,
const ACE_QoS &ace_qos) = 0;
/**
* Sets the QoS for this session object to ace_qos. Does not
* interfere with the QoS in the underlying socket. This call is
* useful to update the QoS object when the underlying socket QoS is
* being set through a mechanism other than the previous qos ()
* method e.g. inside the dgram_mcast.subscribe () where the QoS for
* the socket is set through ACE_OS::join_leaf ().
*/
virtual void qos (const ACE_QoS &ace_qos) = 0;
/**
* This is called from handle_qos () method of the the QoS Event
* Handler. Invoking this method is an indication of a QoS event
* occurring, that may have resulted in a change of QoS for the
* underlying session. This method updates the QoS object associated
* with this session.
*/
virtual int update_qos (void) = 0;
/// Get/Set methods for the flags_.
virtual ACE_End_Point_Type flags (void) const = 0;
virtual void flags (const ACE_End_Point_Type flags) = 0;
/// Get the session id.
virtual int session_id (void) const = 0;
/// Set the session id.
virtual void session_id (const int session_id) = 0;
/// Get the file descriptor on which RSVP events will occur.
virtual ACE_HANDLE rsvp_events_handle (void) = 0;
virtual void rsvp_event_type (RSVP_Event_Type event_type) = 0;
///Set the RAPI event that last occured
virtual RSVP_Event_Type rsvp_event_type (void) = 0;
///Get the RAPI event that last occured
/// Get the destination address for this session.
virtual ACE_INET_Addr dest_addr (void) const = 0;
/// Set the destination address for this session.
virtual void dest_addr (const ACE_INET_Addr &dest_addr) = 0;
/// Get the source port for this session.
virtual u_short source_port (void) const = 0;
/// Set the source port for this session.
virtual void source_port (const u_short &source_port) = 0;
//Set the source host
virtual ACE_INET_Addr* source_addr (void) const = 0;
/// Set the source port for this session.
virtual void source_addr (ACE_INET_Addr* source_addr) = 0;
/**
* Returns the version of the underlying RSVP implementation. Is
* meaningful only when the underlying implementation has
* versioning.
*/
virtual int version (void) = 0;
protected:
/// Source port if this is a Sender session. Used for rapi_sender ().
u_short source_port_;
/// session id for the session.
int session_id_;
/// Destination address for this session.
ACE_INET_Addr dest_addr_;
/// Source address for this session.
ACE_INET_Addr* src_addr_;
/// Is this a TCP or a UDP session.
ACE_Protocol_ID protocol_id_;
/// QoS for this session.
ACE_QoS qos_;
/// Specifies if this is a sending/receiving/both session.
ACE_End_Point_Type flags_;
RSVP_Event_Type rsvp_event_type_;
//Has the last rsvp event that occured
};
ACE_END_VERSIONED_NAMESPACE_DECL
#include /**/ "ace/post.h"
#endif /* ACE_QOS_SESSION_H */
+105
View File
@@ -0,0 +1,105 @@
// QoS_Session_Factory.cpp
// $Id: QoS_Session_Factory.cpp 80826 2008-03-04 14:51:23Z wotte $
#include "QoS_Session_Factory.h"
#include "QoS_Session_Impl.h"
#include "ace/Log_Msg.h"
ACE_RCSID(ace, QoS_Session_Factory, "$Id: QoS_Session_Factory.cpp 80826 2008-03-04 14:51:23Z wotte $")
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_QoS_Session_Factory)
#if defined(ACE_HAS_RAPI)
const enum ACE_QoS_Session_Factory::ACE_QoS_Session_Type
ACE_QoS_Session_Factory::ACE_DEFAULT_QOS_SESSION = ACE_QoS_Session_Factory::ACE_RAPI_SESSION;
#elif defined(ACE_HAS_WINSOCK2_GQOS)
const enum ACE_QoS_Session_Factory::ACE_QoS_Session_Type
ACE_QoS_Session_Factory::ACE_DEFAULT_QOS_SESSION = ACE_QoS_Session_Factory::ACE_GQOS_SESSION;
#else
# error "QoS type not supported. Cannot build."
#endif /* ACE_HAS_RAPI */
ACE_QoS_Session_Factory::ACE_QoS_Session_Factory (void)
{
ACE_TRACE ("ACE_QoS_Session_Factory::ACE_QoS_Session_Factory");
}
ACE_QoS_Session_Factory::~ACE_QoS_Session_Factory (void)
{
ACE_TRACE ("ACE_QoS_Session_Factory::~ACE_QoS_Session_Factory");
}
// Create a QoS session of the given type (RAPI or GQoS).
ACE_QoS_Session *
ACE_QoS_Session_Factory::create_session (ACE_QoS_Session_Type qos_session_type)
{
ACE_QoS_Session * qos_session = 0;
#if defined (ACE_HAS_RAPI)
if (qos_session_type == ACE_RAPI_SESSION)
ACE_NEW_RETURN (qos_session,
ACE_RAPI_Session,
0);
#endif /* ACE_HAS_RAPI */
if (qos_session_type == ACE_GQOS_SESSION)
ACE_NEW_RETURN (qos_session,
ACE_GQoS_Session,
0);
if (this->add_session (qos_session) == -1)
{
delete qos_session;
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("Error in adding session\n")),
0);
}
return qos_session;
}
// Destroy the QoS Session.
int
ACE_QoS_Session_Factory::destroy_session (ACE_QoS_Session *qos_session)
{
if ((qos_session != 0) && (this->remove_session (qos_session) == -1))
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("Error in destroying session\n")),
-1);
return 0;
}
// Add a session to the set of sessions created by this factory. This is a
// private method called by the create_session ().
int
ACE_QoS_Session_Factory::add_session (ACE_QoS_Session *qos_session)
{
if (this->qos_session_set_.insert (qos_session) != 0)
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("Error in adding a new session")
ACE_TEXT ("to the session set\n")),
-1);
return 0;
}
// Remove a session from the set of sessions created by this factory. This is
// a private method called by the destroy_session ().
int
ACE_QoS_Session_Factory::remove_session (ACE_QoS_Session *qos_session)
{
if (this->qos_session_set_.remove (qos_session) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("Error in removing a session")
ACE_TEXT ("from the session set\n")),
-1);
return 0;
}
ACE_END_VERSIONED_NAMESPACE_DECL
+96
View File
@@ -0,0 +1,96 @@
// -*- C++ -*-
//=============================================================================
/**
* @file QoS_Session_Factory.h
*
* $Id: QoS_Session_Factory.h 80826 2008-03-04 14:51:23Z wotte $
*
* @author Vishal Kachroo <vishal@cs.wustl.edu>
*/
//=============================================================================
#ifndef ACE_QOS_SESSION_FACTORY_H
#define ACE_QOS_SESSION_FACTORY_H
#include /**/ "ace/pre.h"
#include "ace/QoS/QoS_Session.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "ace/Containers_T.h"
#include "ACE_QoS_Export.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// Forward declare this, so the factory uses only references to this.
class ACE_QoS_Session;
/**
* @class ACE_QoS_Session_Factory
*
* @brief Concrete factory for the QoS Session objects.
*
* This class manages the life cycle of QoS Session objects. These
* objects are currently either RAPI session objects or GQoS session
* objects. It stores the sessions in an unbounded set.
*/
class ACE_QoS_Export ACE_QoS_Session_Factory
{
public :
// = Initialization and termination methods.
/// Default constructor.
ACE_QoS_Session_Factory (void);
/// Default destructor.
~ACE_QoS_Session_Factory (void);
/// Types of sessions for this factory to manage.
enum ACE_QoS_Session_Type
{
/// ACE_RAPI_SESSION on Unix platforms with RAPI support
ACE_RAPI_SESSION,
/// ACE_GQOS_SESSION on Windows platforms with GQOS support
ACE_GQOS_SESSION
};
/** The default QoS type supported on this platform.
*
* ACE_DEFAULT_QOS_SESSION = ACE_RAPI_SESSION on Unix platforms with RAPI support
* = ACE_GQOS_SESSION on Windows platforms with GQOS support
*/
static const enum ACE_QoS_Session_Type ACE_DEFAULT_QOS_SESSION;
/// Create a QoS session of the given type (RAPI or GQoS).
ACE_QoS_Session * create_session (ACE_QoS_Session_Type qos_session_type = ACE_DEFAULT_QOS_SESSION );
/// Destroy the QoS Session.
int destroy_session (ACE_QoS_Session *qos_session);
private:
/// Used by the create_session () to add new sessions to the
/// set of sessions created by this factory.
int add_session (ACE_QoS_Session *qos_session);
/// Used by the destroy_session () to remove a session from the set
/// of sessions created by this factory.
int remove_session (ACE_QoS_Session *qos_session);
/// Unordered set of QoS Sessions.
typedef ACE_Unbounded_Set <ACE_QoS_Session *> QOS_SESSION_SET;
QOS_SESSION_SET qos_session_set_;
};
ACE_END_VERSIONED_NAMESPACE_DECL
#include /**/ "ace/post.h"
#endif /* ACE_QOS_SESSION_FACTORY_H */
+718
View File
@@ -0,0 +1,718 @@
// QoS_Session_Impl.cpp
// $Id: QoS_Session_Impl.cpp 84565 2009-02-23 08:20:39Z johnnyw $
#include "ace/OS_NS_arpa_inet.h"
#include "ace/SOCK.h"
#include "QoS_Manager.h"
#include "QoS_Session_Impl.h"
#include "ace/Log_Msg.h"
#if !defined (__ACE_INLINE__)
#include "QoS_Session_Impl.inl"
#endif /* __ACE_INLINE__ */
ACE_RCSID(ace, QoS_Session_Impl, "$Id: QoS_Session_Impl.cpp 84565 2009-02-23 08:20:39Z johnnyw $")
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_QoS_Session_Impl)
ACE_END_VERSIONED_NAMESPACE_DECL
#if defined (ACE_HAS_RAPI)
#include "rapi_err.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
int ACE_RAPI_Session::rsvp_error = 0;
// Call back function used by RAPI to report RSVP events. This
// function translates the RAPI QoS parameters into the more generic
// ACE_QoS parameters for the underlying RAPI session.
int
rsvp_callback (rapi_sid_t /* sid */,
rapi_eventinfo_t eventype,
int /* style_id */,
int errcode,
int errvalue,
sockaddr * errnode,
u_char /* errflags */,
int /* filter_spec_no */,
rapi_filter_t * /* filter_spec_list */,
int flow_spec_no,
rapi_flowspec_t *flow_spec_list,
int /* ad_spec_no */,
rapi_adspec_t * /* ad_spec_list */,
void *args
)
{
if (args == 0)
ACE_DEBUG ((LM_DEBUG,
"Argument in the call back function is null\n\n"));
ACE_QoS_Session *qos_session = (ACE_QoS_Session *) args;
qos_flowspecx_t *csxp = 0;
if (!flow_spec_list)
{
ACE_DEBUG ((LM_DEBUG,
"(%N|%l) Null flow_spec_list\n"));
}
else
{
// Extended Legacy format.
csxp = &flow_spec_list->specbody_qosx;
if(!csxp)
{
ACE_ERROR_RETURN ((LM_ERROR,
"(%N|%l) Null csxp\n"),
-1);
}
}
ACE_QoS ace_qos = qos_session->qos ();
switch(eventype)
{
case RAPI_PATH_EVENT:
{
ACE_DEBUG ((LM_DEBUG,
"RSVP PATH Event received\n"
"No. of TSpecs received : %d %d\n",
flow_spec_no, &flow_spec_list->len));
ACE_Flow_Spec *receiving_fs = 0;
if (flow_spec_no != 0)
{
ACE_NEW_RETURN (receiving_fs,
ACE_Flow_Spec,
-1);
ACE_NEW_RETURN (receiving_fs,
ACE_Flow_Spec ((u_long)csxp->xspec_r,
(u_long)csxp->xspec_b,
(u_long)csxp->xspec_p,
0,
csxp->xspec_S,
1,
csxp->xspec_M,
csxp->xspec_m,
25,
0),
-1);
ACE_DEBUG ((LM_DEBUG,
"\nTSpec :\n"
"\t Spec Type = %d\n"
"\t Rate = %f\n"
"\t Bucket = %f\n"
"\t Peak = %f\n"
"\t MPU = %d\n"
"\t MDU = %d\n"
"\t TTL = %d\n",
csxp->spec_type,
csxp->xspec_r,
csxp->xspec_b,
csxp->xspec_p,
csxp->xspec_m,
csxp->xspec_M,
25));
}
// Set the sending flowspec QoS of the given session.
ace_qos.receiving_flowspec (receiving_fs);
qos_session->rsvp_event_type (ACE_QoS_Session::RSVP_PATH_EVENT);
}
break;
case RAPI_RESV_EVENT:
{
ACE_DEBUG ((LM_DEBUG,
"RSVP RESV Event received\n"
"No. of FlowSpecs received : %d\n",
flow_spec_no));
ACE_Flow_Spec *sending_flow = 0;
if (flow_spec_no != 0)
{
ACE_NEW_RETURN (sending_flow,
ACE_Flow_Spec,
-1);
// Choose based on the service type : [QOS_GUARANTEEDX/QOS_CNTR_LOAD].
switch (csxp->spec_type)
{
case QOS_GUARANTEEDX:
// Slack term in MICROSECONDS
sending_flow->delay_variation (csxp->xspec_S);
// @@How does the guaranteed rate parameter map to the ACE_Flow_Spec.
// Note there is no break !!
case QOS_CNTR_LOAD:
// qos_service_type.
sending_flow->service_type (csxp->spec_type);
// Token Bucket Average Rate (B/s)
sending_flow->token_rate ((u_long)csxp->xspec_r);
// Token Bucket Rate (B)
sending_flow->token_bucket_size ((u_long)csxp->xspec_b);
// Peak Data Rate (B/s)
sending_flow->peak_bandwidth ((u_long)csxp->xspec_p);
// Minimum Policed Unit (B)
sending_flow->minimum_policed_size (csxp->xspec_m);
// Max Packet Size (B)
sending_flow->max_sdu_size (csxp->xspec_M);
break;
default:
ACE_ERROR_RETURN ((LM_ERROR,
"(%N|%l) Unknown flowspec type: %u.\n", csxp->spec_type),
-1);
}
}
ace_qos.sending_flowspec (sending_flow);
qos_session->rsvp_event_type (ACE_QoS_Session::RSVP_RESV_EVENT);
}
break;
case RAPI_PATH_ERROR:
{
ACE_DEBUG ((LM_DEBUG,
"PATH ERROR Event received\n"
"Code=%d Val=%d Node= %s\n",
errcode,
errvalue,
ACE_OS::inet_ntoa(((sockaddr_in *)errnode)->sin_addr)));
qos_session->rsvp_event_type (ACE_QoS_Session::RSVP_PATH_ERROR);
}
break;
case RAPI_RESV_ERROR:
{
ACE_DEBUG ((LM_DEBUG,
"RESV ERROR Event received\n"
"Code=%d Val=%d Node= %s\n",
errcode,
errvalue,
ACE_OS::inet_ntoa(((sockaddr_in *)errnode)->sin_addr)));
qos_session->rsvp_event_type (ACE_QoS_Session::RSVP_RESV_ERROR);
}
break;
case RAPI_RESV_CONFIRM:
{
ACE_DEBUG ((LM_DEBUG,
"RESV CONFIRM Event received\n"));
qos_session->rsvp_event_type (ACE_QoS_Session::RSVP_RESV_CONFIRM);
}
break;
default:
ACE_DEBUG ((LM_DEBUG,
"Unknown RSVP Event Received\n"));
break;
}
// Set the updated ACE_QoS for the RSVP callback argument(QoS session).
qos_session->qos (ace_qos);
// @@ what is the meaning of the return value. RAPI docs don't say anything!
return 0;
}
// Constructor.
ACE_RAPI_Session::ACE_RAPI_Session (void)
{
ACE_TRACE ("ACE_RAPI_Session::ACE_RAPI_Session");
//this->source_port (DEFAULT_SOURCE_SENDER_PORT);
ACE_NEW (this->src_addr_,
ACE_INET_Addr ("0"));
}
// Open a RAPI QoS session [dest IP, dest port, Protocol ID].
int
ACE_RAPI_Session::open (ACE_INET_Addr dest_addr,
ACE_Protocol_ID protocol_id)
{
char buf [BUFSIZ];
dest_addr.addr_to_string (buf,
BUFSIZ);
ACE_DEBUG ((LM_DEBUG,
"In RAPI SESSION OPEN %s\n",
buf));
this->dest_addr_ = dest_addr;
this->protocol_id_ = protocol_id;
// Open a RAPI session. Note "this" is being passed as an argument to
// the callback function. The callback function uses this argument to
// update the QoS of this session based on the RSVP event it receives.
if ((this->session_id_ = rapi_session((struct sockaddr *) dest_addr.get_addr (),
protocol_id,
0,
rsvp_callback,
(void *) this,
&rsvp_error)) == NULL_SID)
ACE_ERROR_RETURN ((LM_ERROR,
"rapi_session () call fails. Error\n"),
-1);
else
ACE_DEBUG ((LM_DEBUG,
"rapi_session () call succeeds. "
"Session ID = %d\n",
this->session_id_));
return 0;
}
// Close the RAPI QoS Session.
int
ACE_RAPI_Session::close (void)
{
this->rsvp_error = rapi_release(this->session_id_);
if (rsvp_error == 0)
ACE_ERROR_RETURN ((LM_ERROR,
"Can't release RSVP session:\n\t%s\n",
rapi_errlist[rsvp_error]),
-1);
else
ACE_DEBUG ((LM_DEBUG,
"rapi session with id %d released successfully.\n",
this->session_id_));
return 0;
}
//Get the most recent RSVP event that occured
ACE_QoS_Session::RSVP_Event_Type
ACE_RAPI_Session::rsvp_event_type (void)
{
return this->rsvp_event_type_;
}
//Set the most recent RSVP event that occured
void
ACE_RAPI_Session::rsvp_event_type (ACE_QoS_Session::RSVP_Event_Type event_type)
{
this->rsvp_event_type_ = event_type;
}
int
ACE_RAPI_Session::qos (ACE_SOCK * /* socket */,
ACE_QoS_Manager * /* qos_manager */,
const ACE_QoS &ace_qos)
{
// If sender : call sending_qos ()
// If receiver : call receiving_qos ()
// If both : call sending_qos () and receiving_qos ()
if (this->flags_ != ACE_QOS_RECEIVER)
return this->sending_qos (ace_qos);
if (this->flags_ != ACE_QOS_SENDER)
return this->receiving_qos (ace_qos);
return 0;
}
// Set sending QoS for this RAPI session.
int
ACE_RAPI_Session::sending_qos (const ACE_QoS &ace_qos)
{
ACE_Flow_Spec *sending_flowspec = ace_qos.sending_flowspec ();
if (sending_flowspec == 0)
{
int result = rapi_sender (this->session_id_,
0,
0,
0,
0,
0,
0,
25);
if (result != 0)
ACE_ERROR_RETURN ((LM_ERROR,
"(%N|%l) rapi_sender error %d:\n\tPATH Generation can't be started\n",
result),
-1);
else
ACE_DEBUG ((LM_DEBUG,
"rapi_sender () call succeeds with PATH Tear!\n"));
return 0;
}
rapi_tspec_t *t_spec = this->init_tspec_simplified (*sending_flowspec);
if (t_spec == 0)
ACE_ERROR_RETURN ((LM_ERROR,
"(%N|%l) Error in translating from ACE Flow Spec to"
" RAPI TSpec\n"),
-1);
char buffer[BUFSIZ];
// This formats the t_spec in a visually intuitive char * that can
// be printed.
(void) rapi_fmt_tspec(t_spec, buffer, sizeof(buffer));
ACE_DEBUG ((LM_DEBUG,
"\nSender TSpec : %s\n",
buffer));
// Print out all the fields separately.
ACE_DEBUG ((LM_DEBUG,
"\nTSpec :\n"
"\t Spec Type = %d\n"
"\t Rate = %f\n"
"\t Bucket = %f\n"
"\t Peak = %f\n"
"\t MPU = %d\n"
"\t MDU = %d\n"
"\t TTL = %d\n",
t_spec->tspecbody_qosx.spec_type,
t_spec->tspecbody_qosx.xtspec_r,
t_spec->tspecbody_qosx.xtspec_b,
t_spec->tspecbody_qosx.xtspec_p,
t_spec->tspecbody_qosx.xtspec_m,
t_spec->tspecbody_qosx.xtspec_M,
sending_flowspec->ttl ()));
// This the source sender port.
// ACE_INET_Addr sender_addr (this->source_port ());
ACE_DEBUG ((LM_DEBUG,
"Making the rapi_sender () call\n"));
// Set the Sender TSpec for this QoS session.
int result = rapi_sender(this->session_id_,
0,
(sockaddr *) this->src_addr_->get_addr (),
0,
t_spec,
0,
0,
sending_flowspec->ttl ()) ;
/*
int result = rapi_sender(this->session_id_,
0,
(sockaddr *) sender_addr.get_addr (),
0,
t_spec,
0,
0,
sending_flowspec->ttl ()) ;
*/
if(result!= 0)
ACE_ERROR_RETURN ((LM_ERROR,
"(%N|%l) rapi_sender error %d:\n\tPATH Generation can't be started\n",
result),
-1);
else
ACE_DEBUG ((LM_DEBUG,
"rapi_sender () call succeeds !\n"));
return 0;
}
// Set receiving QoS for this RAPI session.
int
ACE_RAPI_Session::receiving_qos (const ACE_QoS &ace_qos)
{
ACE_Flow_Spec *receiving_flowspec = ace_qos.receiving_flowspec ();
if (receiving_flowspec == 0)
{
if (rapi_reserve(this->session_id_,
0,
// Setting the RAPI_REQ_CONFIRM flag requests confirmation
// of the resevation, by means of a confirmation upcall of
// type RAPI_RESV_CONFIRM.
// (sockaddr *)receiver_addr.get_addr (),
0,
RAPI_RSTYLE_WILDCARD,
// This applies the flowspec to all the senders. Given this,
// @@I am passing the filter_spec to be null, hoping this will work.
0,
0,
0,
0,
// The filter spec is NULL. This should work since the RSTYLE is
// WILDCARD.
0,
0) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"(%N|%l)rapi_reserve () error:\n\tRESV Generation can't be started\n"),
-1);
else
ACE_DEBUG ((LM_DEBUG,
"rapi_reserve () for RESV Tear call succeeds\n"));
return 0;
}
rapi_flowspec_t *flow_spec = init_flowspec_simplified (*receiving_flowspec);
if (flow_spec == 0)
ACE_ERROR_RETURN ((LM_ERROR,
"(%N|%l) Error in translating from ACE Flow Spec to"
" RAPI FlowSpec\n"),
-1);
char buffer[BUFSIZ];
// This formats the flow_spec in a visually intuitive char * that can
// be printed.
(void)rapi_fmt_flowspec(flow_spec, buffer, sizeof(buffer));
ACE_DEBUG ((LM_DEBUG,
"\nReceiver FlowSpec : %s\n",
buffer));
// Print out all the fields separately.
ACE_DEBUG ((LM_DEBUG,
"\nFlowSpec :\n"
"\t Spec Type = %d\n"
"\t Rate = %f\n"
"\t Bucket = %f\n"
"\t Peak = %f\n"
"\t MPU = %d\n"
"\t MDU = %d\n",
flow_spec->specbody_qosx.spec_type,
flow_spec->specbody_qosx.xspec_r,
flow_spec->specbody_qosx.xspec_b,
flow_spec->specbody_qosx.xspec_p,
flow_spec->specbody_qosx.xspec_m,
flow_spec->specbody_qosx.xspec_M));
sockaddr_in Receiver_host;
Receiver_host.sin_addr.s_addr = INADDR_ANY;
// Set the Receiver FlowSpec for this QoS session.
// @@The filter style is hardcoded to WildCard. This can be changed later.
if (rapi_reserve(this->session_id_,
RAPI_REQ_CONFIRM,
// Setting the RAPI_REQ_CONFIRM flag requests confirmation
// of the resevation, by means of a confirmation upcall of
// type RAPI_RESV_CONFIRM.
// (sockaddr *)receiver_addr.get_addr (),
(sockaddr *)&Receiver_host,
RAPI_RSTYLE_WILDCARD,
// This applies the flowspec to all the senders. Given this,
// @@I am passing the filter_spec to be null, hoping this will work.
0,
0,
0,
0,
// The filter spec is NULL. This should work since the RSTYLE is
// WILDCARD.
1,
flow_spec) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"rapi_reserve () error:\n\tRESV Generation can't be started\n"),
-1);
else
ACE_DEBUG ((LM_DEBUG,
"rapi_reserve () call succeeds\n"));
return 0;
}
int
ACE_RAPI_Session::update_qos (void)
{
// Update the session QoS Parameters based on the RSVP Event Received.
if ((rsvp_error = rapi_dispatch ()) != 0)
ACE_ERROR_RETURN ((LM_ERROR,
"Error in rapi_dispatch () : %s\n",
rapi_errlist[rsvp_error]),
-1);
return 0;
}
// Construct a simplified RAPI Sender TSpec object
// from an ACE_Flow_Spec. Note the form of the TSpec is
// simplified as against the full bodied IntServ version.
rapi_tspec_t *
ACE_RAPI_Session::init_tspec_simplified (const ACE_Flow_Spec &flow_spec)
{
rapi_tspec_t *t_spec;
ACE_NEW_RETURN (t_spec,
rapi_tspec_t,
0);
qos_tspecx_t *ctxp = &(t_spec->tspecbody_qosx);
// There may be some type incompatibility here.
// Note the types of the LHS are float32_t, uint32_t etc.
ctxp->spec_type = flow_spec.service_type ();//QOS_TSPEC;
ctxp->xtspec_r = flow_spec.token_rate (); // Token Rate (B/s)
ctxp->xtspec_b = flow_spec.token_bucket_size (); // Token Bucket Depth (B)
ctxp->xtspec_p = flow_spec.peak_bandwidth (); // Peak Data Rate (B/s)
ctxp->xtspec_m = flow_spec.minimum_policed_size (); // Minimum policed unit.
ctxp->xtspec_M = flow_spec.max_sdu_size(); // Maximum SDU size.
t_spec->len = sizeof(rapi_hdr_t) + sizeof(qos_tspecx_t);
t_spec->form = RAPI_TSPECTYPE_Simplified;
return (t_spec);
}
// Construct a simplified RAPI flowspec object from ACE_Flow_Spec.
// Note the form of the FlowSpec is simplified as against the
// full bodied IntServ version.
rapi_flowspec_t *
ACE_RAPI_Session::init_flowspec_simplified(const ACE_Flow_Spec &flow_spec)
{
rapi_flowspec_t *flowsp;
ACE_NEW_RETURN (flowsp,
rapi_flowspec_t,
0);
// Extended Legacy format.
qos_flowspecx_t *csxp = &flowsp->specbody_qosx;
// Choose based on the service type : [QOS_GUARANTEEDX/QOS_CNTR_LOAD].
switch (flow_spec.service_type ())
{
case QOS_GUARANTEEDX:
csxp->xspec_R = 0 ; // Guaranteed Rate B/s. @@How does this map to the
// ACE Flow Spec Parameters.
csxp->xspec_S = flow_spec.delay_variation () ; // Slack term in MICROSECONDS
// Note there is no break !!
case QOS_CNTR_LOAD:
csxp->spec_type = flow_spec.service_type (); // qos_service_type
csxp->xspec_r = flow_spec.token_rate (); // Token Bucket Average Rate (B/s)
csxp->xspec_b = flow_spec.token_bucket_size (); // Token Bucket Rate (B)
csxp->xspec_p = flow_spec.peak_bandwidth (); // Peak Data Rate (B/s)
csxp->xspec_m = flow_spec.minimum_policed_size (); // Minimum Policed Unit (B)
csxp->xspec_M = flow_spec.max_sdu_size(); // Max Packet Size (B)
flowsp->form = RAPI_FLOWSTYPE_Simplified;
break;
default:
ACE_ERROR_RETURN ((LM_ERROR,
"(%N|%l) Unknown flowspec type: %u\n",flow_spec.service_type () ),
0);
}
flowsp->len = sizeof(rapi_flowspec_t);
return flowsp;
}
ACE_END_VERSIONED_NAMESPACE_DECL
#endif /* ACE_HAS_RAPI */
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// This is a GQoS session ID generator.
int ACE_GQoS_Session::GQoS_session_id = 0;
// Constructor.
ACE_GQoS_Session::ACE_GQoS_Session (void)
{
ACE_TRACE ("ACE_GQoS_Session::ACE_GQoS_Session");
}
// Open a GQoS session [dest IP, dest port, Protocol ID].
int
ACE_GQoS_Session::open (ACE_INET_Addr dest_addr,
ACE_Protocol_ID protocol_id)
{
this->dest_addr_ = dest_addr;
this->protocol_id_ = protocol_id;
this->session_id_ = GQoS_session_id++;
return 0;
}
// Close the GQoS Session.
int
ACE_GQoS_Session::close (void)
{
// TBD.
return 0;
}
// Set the QoS for this GQoS session.
int
ACE_GQoS_Session::qos (ACE_SOCK *socket,
ACE_QoS_Manager *qos_manager,
const ACE_QoS &ace_qos)
{
// Confirm if the current session is one of the QoS sessions
// subscribed to by the given socket.
if (qos_manager->qos_session_set ().find (this) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("This QoS session was not subscribed to")
ACE_TEXT (" by the socket\n")),
-1);
// Set the QOS according to the supplied ACE_QoS. The I/O control
// code used under the hood is SIO_SET_QOS.
u_long ret_bytes = 0;
ACE_QoS qos = ace_qos;
if (ACE_OS::ioctl (socket->get_handle (),
ACE_SIO_SET_QOS,
qos,
&ret_bytes) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("Error in Qos set ACE_OS::ioctl() %d\n"),
ret_bytes),
-1);
else
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("Setting QoS with ACE_OS::ioctl () succeeds\n")));
return 0;
}
int
ACE_GQoS_Session::update_qos (void)
{
// WSAIoctl (GET_QOS) call goes here...
return 0;
}
//Get the most recent RSVP event that occured
ACE_QoS_Session::RSVP_Event_Type
ACE_GQoS_Session::rsvp_event_type (void)
{
return this->rsvp_event_type_;
}
//Set the most recent RSVP event that occured
void
ACE_GQoS_Session::rsvp_event_type (ACE_QoS_Session::RSVP_Event_Type event_type)
{
this->rsvp_event_type_ = event_type;
}
ACE_END_VERSIONED_NAMESPACE_DECL
+265
View File
@@ -0,0 +1,265 @@
// -*- C++ -*-
//=============================================================================
/**
* @file QoS_Session_Impl.h
*
* $Id: QoS_Session_Impl.h 80826 2008-03-04 14:51:23Z wotte $
*
* @author Vishal Kachroo <vishal@cs.wustl.edu>
*/
//=============================================================================
#ifndef ACE_QOS_SESSION_IMPL_H
#define ACE_QOS_SESSION_IMPL_H
#include /**/ "ace/pre.h"
#include "ace/QoS/QoS_Session.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
#if defined (ACE_HAS_RAPI)
#include "rapi_lib.h"
#define DEFAULT_SOURCE_SENDER_PORT 10001
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
/**
* @class ACE_RAPI_Session
*
* @brief A RAPI QoS session object.
*
* This class is a RAPI (RSVP API, an implementation of RSVP on UNIX)
* implementation of the ACE_QoS_Session interface.
*/
class ACE_QoS_Export ACE_RAPI_Session : public ACE_QoS_Session
{
public:
/// Default destructor.
~ACE_RAPI_Session (void);
/// Error handling for RSVP callback
static int rsvp_error;
/// Open a RAPI QoS session [dest IP, dest port, Protocol ID].
virtual int open (ACE_INET_Addr dest_addr,
ACE_Protocol_ID protocol_id);
/// Close the RAPI QoS Session.
virtual int close (void);
/// Returns the QoS for this RAPI session.
virtual ACE_QoS qos (void) const;
/// Set QoS for this RAPI session. The socket parameter is used to confirm if
/// this QoS session was subscribed to by the socket.
virtual int qos (ACE_SOCK *socket,
ACE_QoS_Manager *qos_manager,
const ACE_QoS &ace_qos);
/**
* Sets the QoS for this session object to ace_qos. Does not interfere with the
* QoS in the underlying socket. This call is useful to update the QoS object
* when the underlying socket QoS is being set through a mechanism other than
* the previous qos () method e.g. inside the dgram_mcast.subscribe () where the
* QoS for the socket is set through ACE_OS::join_leaf ().
*/
virtual void qos (const ACE_QoS &ace_qos);
/**
* Calls rapi_dispatch () that further triggers the call back function.
* It is a mechanism of updating the QoS for this session asynchronously, as
* RSVP events occur.
*/
virtual int update_qos (void);
/// Get methods for the flags_.
virtual ACE_End_Point_Type flags (void) const;
/// Set methods for the flags_.
virtual void flags (const ACE_End_Point_Type flags);
/// Get the RAPI session id.
virtual int session_id (void) const;
/// Set the RAPI session id.
virtual void session_id (const int session_id);
/// Get the RAPI file descriptor for RSVP events.
virtual ACE_HANDLE rsvp_events_handle (void);
///Set the RAPI event that last occured
virtual void rsvp_event_type (RSVP_Event_Type event_type);
///Get the RAPI event that last occured
virtual RSVP_Event_Type rsvp_event_type (void);
/// Get the destination address for this RAPI session.
virtual ACE_INET_Addr dest_addr (void) const;
/// Set the destination address for this RAPI session.
virtual void dest_addr (const ACE_INET_Addr &dest_addr);
/// Get the source port for this session.
virtual u_short source_port (void) const;
/// Set the source port for this session.
virtual void source_port (const u_short &source_port);
//Set the source host
virtual ACE_INET_Addr* source_addr (void) const;
/// Set the source port for this session.
virtual void source_addr (ACE_INET_Addr* source_addr);
/// RAPI version. Returned value = 100 * major-version + minor-version.
virtual int version ();
/// The factory is a friend so it can create this object through
/// the only private constructor.
friend class ACE_QoS_Session_Factory;
private:
/// Default constuctor. Constructor is defined private so that only
/// the friend factory can instantiate this class.
ACE_RAPI_Session (void);
/// Construct a simplified RAPI Sender TSpec object
/// from an ACE_Flow_Spec object. Used internally by this class.
rapi_tspec_t *init_tspec_simplified (const ACE_Flow_Spec &flow_spec);
/// Construct a simplified RAPI Receiver FlowSpec object
/// from an ACE_Flow_Spec object. Used internally by the class.
rapi_flowspec_t *init_flowspec_simplified(const ACE_Flow_Spec &flow_spec);
/// Set sending QoS for this RAPI session.
int sending_qos (const ACE_QoS &ace_qos);
/// Set receiving QoS for this RAPI session.
int receiving_qos (const ACE_QoS &ace_qos);
};
ACE_END_VERSIONED_NAMESPACE_DECL
#endif /* ACE_HAS_RAPI */
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
/**
* @class ACE_GQoS_Session
*
* @brief A GQoS session object.
*
* This class is a GQoS (Generic QoS, an implementation of RSVP on
* Win2K) implementation of the ACE_QoS_Session interface.
*/
class ACE_QoS_Export ACE_GQoS_Session : public ACE_QoS_Session
{
public:
/// Default destructor.
~ACE_GQoS_Session (void);
/// This is a session ID generator. It does a lot more than expected
/// from an int!.
static int GQoS_session_id;
/// Open a GQoS session [dest IP, dest port, Protocol ID].
virtual int open (ACE_INET_Addr dest_addr,
ACE_Protocol_ID protocol_id);
/// Close the GQoS Session.
virtual int close (void);
/// Returns the QoS for this GQoS session.
virtual ACE_QoS qos (void) const;
/// Set QoS for this GQoS session. The socket parameter is used to confirm if
/// this QoS session was subscribed to by the socket.
virtual int qos (ACE_SOCK *socket,
ACE_QoS_Manager *qos_manager,
const ACE_QoS &ace_qos);
/**
* Sets the QoS for this session object to ace_qos. Does not interfere with the
* QoS in the underlying socket. This call is useful to update the QoS object
* when the underlying socket QoS is being set through a mechanism other than
* the previous qos () method e.g. inside the dgram_mcast.subscribe () where the
* QoS for the socket is set through ACE_OS::join_leaf ().
*/
virtual void qos (const ACE_QoS &ace_qos);
/// Calls the ioctl (ACE_SIO_GET_QOS). It is a mechanism of updating the
/// QoS for this session asynchronously, as RSVP events occur.
virtual int update_qos (void);
/// Get/Set methods for the flags_.
virtual ACE_End_Point_Type flags (void) const;
virtual void flags (const ACE_End_Point_Type flags);
/// Get the destination address for this GQoS session.
virtual ACE_INET_Addr dest_addr (void) const;
/// Set the destination address for this GQoS session.
virtual void dest_addr (const ACE_INET_Addr &dest_addr);
/// Get the source port for this session.
virtual u_short source_port (void) const;
/// Set the source port for this session.
virtual void source_port (const u_short &source_port);
//Set the source host
virtual ACE_INET_Addr* source_addr (void) const;
/// Set the source port for this session.
virtual void source_addr (ACE_INET_Addr* source_addr);
/// Get the GQoS session id.
virtual int session_id (void) const;
/// Set the GQoS session id.
virtual void session_id (const int session_id);
/// Get the file descriptor of the underlying socket.
virtual ACE_HANDLE rsvp_events_handle (void);
virtual void rsvp_event_type (RSVP_Event_Type event_type);
///Set the RAPI event that last occured
virtual RSVP_Event_Type rsvp_event_type (void);
///Get the RAPI event that last occured
/// GQoS version.
virtual int version ();
/// The factory is a friend so it can create this object through
/// the only private constructor.
friend class ACE_QoS_Session_Factory;
private:
/// Default constructor. Constructor is defined private so that only
/// the friend factory can instantiate this class.
ACE_GQoS_Session (void);
};
ACE_END_VERSIONED_NAMESPACE_DECL
#if defined (__ACE_INLINE__)
#include "QoS_Session_Impl.inl"
#endif /* __ACE_INLINE__ */
#include /**/ "ace/post.h"
#endif /* ACE_QOS_SESSION_IMPL_H */
+229
View File
@@ -0,0 +1,229 @@
// -*- C++ -*-
//
// $Id: QoS_Session_Impl.inl 80826 2008-03-04 14:51:23Z wotte $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
#if defined (ACE_HAS_RAPI)
ACE_INLINE
ACE_RAPI_Session::~ACE_RAPI_Session (void)
{
ACE_TRACE ("ACE_RAPI_Session::~ACE_RAPI_Session");
}
// Returns the QoS for this RAPI session.
ACE_INLINE ACE_QoS
ACE_RAPI_Session::qos (void) const
{
return this->qos_;
}
// Overloaded method to set the QoS for this session object. Does not
// interfere with the underlying socket QoS.
ACE_INLINE void
ACE_RAPI_Session::qos (const ACE_QoS &ace_qos)
{
this->qos_ = ace_qos;
}
// Get the RAPI session id.
ACE_INLINE int
ACE_RAPI_Session::session_id (void) const
{
return this->session_id_;
}
// Set the RAPI session id.
ACE_INLINE void
ACE_RAPI_Session::session_id (const int session_id)
{
this->session_id_ = session_id;
}
// Get the RAPI file desciptor for RSVP events.
ACE_INLINE ACE_HANDLE
ACE_RAPI_Session::rsvp_events_handle (void)
{
int rapi_fd = rapi_getfd (this->session_id ());
if (rapi_fd == -1)
{
this->close ();
ACE_ERROR_RETURN ((LM_ERROR,
"Error in rapi_getfd ()\n"),
-1);
}
return rapi_fd;
}
// Get the End Point Type (Sender/Receiver/Both).
ACE_INLINE ACE_QoS_Session::ACE_End_Point_Type
ACE_RAPI_Session::flags (void) const
{
return this->flags_;
}
// Set the End Point Type (Sender/Receiver/Both).
ACE_INLINE void
ACE_RAPI_Session::flags (const ACE_End_Point_Type flags)
{
this->flags_ = flags;
}
// Get the destination address for this RAPI session.
ACE_INLINE ACE_INET_Addr
ACE_RAPI_Session::dest_addr (void) const
{
return this->dest_addr_;
}
// Set the destination address for this RAPI session.
ACE_INLINE void
ACE_RAPI_Session::dest_addr (const ACE_INET_Addr &dest_addr)
{
this->dest_addr_ = dest_addr;
}
// Get the source port for this RAPI session.
ACE_INLINE u_short
ACE_RAPI_Session::source_port (void) const
{
return this->source_port_;
}
// Set the source port for this RAPI session.
ACE_INLINE void
ACE_RAPI_Session::source_port (const u_short &source_port)
{
this->source_port_ = source_port;
}
ACE_INLINE ACE_INET_Addr*
ACE_RAPI_Session::source_addr (void) const
{
return this->src_addr_;
}
ACE_INLINE void
ACE_RAPI_Session::source_addr (ACE_INET_Addr* source_addr)
{
this->src_addr_ = source_addr;
}
// RAPI version. Returned value = 100 * major-version + minor-version.
ACE_INLINE int
ACE_RAPI_Session::version (void)
{
return 0;
}
#endif /* ACE_HAS_RAPI */
ACE_INLINE
ACE_GQoS_Session::~ACE_GQoS_Session (void)
{
ACE_TRACE ("ACE_GQoS_Session::~ACE_GQoS_Session");
}
// Returns the QoS for this GQoS session.
ACE_INLINE ACE_QoS
ACE_GQoS_Session::qos (void) const
{
return this->qos_;
}
// Overloaded method to set the QoS for this session object. Does not
// interfere with the underlying socket QoS.
ACE_INLINE void
ACE_GQoS_Session::qos (const ACE_QoS &ace_qos)
{
this->qos_ = ace_qos;
}
// Get the GQoS session id.
ACE_INLINE int
ACE_GQoS_Session::session_id (void) const
{
return this->session_id_;
}
// Set the GQoS session id.
ACE_INLINE void
ACE_GQoS_Session::session_id (const int session_id)
{
this->session_id_ = session_id;
}
// Get the underlying file desciptor for RSVP events.
// Currently returns 0 because GQoS does not have a special
// descriptor for QoS events.
ACE_INLINE ACE_HANDLE
ACE_GQoS_Session::rsvp_events_handle (void)
{
return 0;
}
// Get the End Point Type (Sender/Receiver/Both).
ACE_INLINE ACE_QoS_Session::ACE_End_Point_Type
ACE_GQoS_Session::flags (void) const
{
return this->flags_;
}
// Set the End Point Type (Sender/Receiver/Both).
ACE_INLINE void
ACE_GQoS_Session::flags (const ACE_End_Point_Type flags)
{
this->flags_ = flags;
}
// Get the destination address for this GQoS session.
ACE_INLINE ACE_INET_Addr
ACE_GQoS_Session::dest_addr (void) const
{
return this->dest_addr_;
}
// Set the destination address for this GQoS session.
ACE_INLINE void
ACE_GQoS_Session::dest_addr (const ACE_INET_Addr &dest_addr)
{
this->dest_addr_ = dest_addr;
}
// Get the source port for this RAPI session.
ACE_INLINE u_short
ACE_GQoS_Session::source_port (void) const
{
return this->source_port_;
}
// Set the source port for this RAPI session.
ACE_INLINE void
ACE_GQoS_Session::source_port (const u_short &source_port)
{
this->source_port_ = source_port;
}
ACE_INLINE ACE_INET_Addr*
ACE_GQoS_Session::source_addr (void) const
{
return this->src_addr_;
}
ACE_INLINE void
ACE_GQoS_Session::source_addr (ACE_INET_Addr* source_addr)
{
this->src_addr_ = source_addr;
}
// GQoS version.
ACE_INLINE int
ACE_GQoS_Session::version (void)
{
return 0;
}
ACE_END_VERSIONED_NAMESPACE_DECL
+55
View File
@@ -0,0 +1,55 @@
$Id: README 80826 2008-03-04 14:51:23Z wotte $
ACE QoS API (AQoSA)
===================
This directory contains the implementation for the ACE QoS API (AQoSA).
BUILD REQUIREMENTS
==================
WIN2K :
AQoSA makes use of the GQOS API under Windows 2000. The minimum
requirements are:
1. June98 Platform SDK or later.
2. Link with ws2_32.lib
More information about GQOS is available from the MSDN website:
http://msdn.microsoft.com/msdn-files/026/002/258/Search.asp
-------------------------------------------------------------------------------
UNIX :
AQoSA makes use of the RSVP API (RAPI) under UNIX.
RAPI can be obtained from: ftp://ftp.isi.edu/rsvp/release/.
rsvpd.rel4.2a4-1 may require patches in order to compile
under current versions of Linux. Contact Craig Rodrigues <[email protected]>
to obtain these patches.
The following lines should be added to your platform_macros.GNU file
before building AQoSA:
PLATFORM_RAPI_CPPFLAGS += -I[path to RAPI header files]
PLATFORM_RAPI_LIBS += -lrsvp
PLATFORM_RAPI_LDFLAGS += -L[path to RAPI library files]
1. Compile AQoSA with
make rapi=1
More information about RAPI can be found at:
http://www.opengroup.org/onlinepubs/9619099/toc.htm
http://www.cs.wustl.edu/~vishal/qos.html
http://www.sun.com/software/bandwidth/rsvp/docs/
http://www.tru64unix.compaq.com/faqs/publications/base_doc/DOCUMENTATION/V51_HTML/ARH9UCTE/TOC.HTM#RSVPCHXX
-------------------------------------------------------------------------------
TEST
====
The test for AQoSA is located in $ACE_ROOT/examples/QOS
+258
View File
@@ -0,0 +1,258 @@
// $Id: SOCK_Dgram_Mcast_QoS.cpp 80826 2008-03-04 14:51:23Z wotte $
#include "SOCK_Dgram_Mcast_QoS.h"
#include "ace/Log_Msg.h"
#include "ace/OS_NS_sys_socket.h"
#if defined (ACE_WIN32)
#include "ace/Sock_Connect.h" // needed for subscribe_ifs()
#endif /* ACE_WIN32 */
#if !defined (__ACE_INLINE__)
#include "SOCK_Dgram_Mcast_QoS.inl"
#endif /* __ACE_INLINE__ */
// This is a workaround for platforms with non-standard
// definitions of the ip_mreq structure
#if ! defined (IMR_MULTIADDR)
#define IMR_MULTIADDR imr_multiaddr
#endif /* ! defined (IMR_MULTIADDR) */
ACE_RCSID (QoS,
SOCK_Dgram_Mcast_QoS,
"$Id: SOCK_Dgram_Mcast_QoS.cpp 80826 2008-03-04 14:51:23Z wotte $")
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_SOCK_Dgram_Mcast_QoS)
// Dummy default constructor...
ACE_SOCK_Dgram_Mcast_QoS::ACE_SOCK_Dgram_Mcast_QoS (options opts)
: ACE_SOCK_Dgram_Mcast (opts)
{
ACE_TRACE ("ACE_SOCK_Dgram_Mcast_QoS::ACE_SOCK_Dgram_Mcast_QoS");
}
int
ACE_SOCK_Dgram_Mcast_QoS::open (const ACE_INET_Addr &addr,
const ACE_QoS_Params &qos_params,
int protocol_family,
int protocol,
ACE_Protocol_Info *protocolinfo,
ACE_SOCK_GROUP g,
u_long flags,
int reuse_addr)
{
ACE_TRACE ("ACE_SOCK_Dgram_Mcast_QoS::open");
ACE_UNUSED_ARG (qos_params);
// Only perform the <open> initialization if we haven't been opened
// earlier.
if (this->get_handle () != ACE_INVALID_HANDLE)
return 0;
ACE_DEBUG ((LM_DEBUG,
"Get Handle Returns Invalid Handle\n"));
if (ACE_SOCK::open (SOCK_DGRAM,
protocol_family,
protocol,
protocolinfo,
g,
flags,
reuse_addr) == -1)
return -1;
return this->open_i (addr, 0, reuse_addr);
}
int
ACE_SOCK_Dgram_Mcast_QoS::subscribe_ifs (const ACE_INET_Addr &mcast_addr,
const ACE_QoS_Params &qos_params,
const ACE_TCHAR *net_if,
int protocol_family,
int protocol,
int reuse_addr,
ACE_Protocol_Info *protocolinfo)
{
ACE_TRACE ("ACE_SOCK_Dgram_Mcast_QoS::subscribe_ifs");
#if defined (ACE_WIN32)
// Windows NT's winsock has trouble with multicast subscribes in the
// presence of multiple network interfaces when the IP address is
// given as INADDR_ANY. It will pick the first interface and only
// accept mcast there. So, to work around this, cycle through all
// of the interfaces known and subscribe to all the non-loopback
// ones.
//
// Note that this only needs to be done on NT, but there's no way to
// tell at this point if the code will be running on NT - only if it
// is compiled for NT-only or for NT/95, and that doesn't really
// help us. It doesn't hurt to do this on Win95, it's just a little
// slower than it normally would be.
//
// NOTE - <ACE_Sock_Connect::get_ip_interfaces> doesn't always get all
// of the interfaces. In particular, it may not get a PPP interface. This
// is a limitation of the way <ACE_Sock_Connect::get_ip_interfaces> works
// with MSVC. The reliable way of getting the interface list is
// available only with MSVC 5.
if (net_if == 0)
{
ACE_INET_Addr *if_addrs = 0;
size_t if_cnt;
if (ACE::get_ip_interfaces (if_cnt, if_addrs) != 0)
return -1;
size_t nr_subscribed = 0;
if (if_cnt < 2)
{
if (this->subscribe (mcast_addr,
qos_params,
reuse_addr,
ACE_TEXT ("0.0.0.0"),
protocol_family,
protocol,
protocolinfo) == 0)
++nr_subscribed;
}
else
// Iterate through all the interfaces, figure out which ones
// offer multicast service, and subscribe to them.
while (if_cnt > 0)
{
--if_cnt;
// Convert to 0-based for indexing, next loop check.
if (if_addrs[if_cnt].is_loopback())
continue;
if (this->subscribe (mcast_addr,
qos_params,
reuse_addr,
ACE_TEXT_CHAR_TO_TCHAR
(if_addrs[if_cnt].get_host_addr()),
protocol_family,
protocol,
protocolinfo) == 0)
++nr_subscribed;
}
delete [] if_addrs;
if (nr_subscribed == 0)
{
errno = ENODEV;
return -1;
}
else
// 1 indicates a "short-circuit" return. This handles the
// rather bizarre semantics of checking all the interfaces on
// NT.
return 1;
}
#else
ACE_UNUSED_ARG (mcast_addr);
ACE_UNUSED_ARG (qos_params);
ACE_UNUSED_ARG (protocol_family);
ACE_UNUSED_ARG (protocol);
ACE_UNUSED_ARG (reuse_addr);
ACE_UNUSED_ARG (protocolinfo);
#endif /* ACE_WIN32 */
// Otherwise, do it like everyone else...
// Create multicast request.
if (this->make_multicast_ifaddr (0,
mcast_addr,
net_if) == -1)
return -1;
else
return 0;
}
int
ACE_SOCK_Dgram_Mcast_QoS::subscribe (const ACE_INET_Addr &mcast_addr,
const ACE_QoS_Params &qos_params,
int reuse_addr,
const ACE_TCHAR *net_if,
int protocol_family,
int protocol,
ACE_Protocol_Info *protocolinfo,
ACE_SOCK_GROUP g,
u_long flags,
ACE_QoS_Session *qos_session)
{
ACE_TRACE ("ACE_SOCK_Dgram_Mcast_QoS::subscribe");
if (this->open (mcast_addr,
qos_params,
protocol_family,
protocol,
protocolinfo,
g,
flags,
reuse_addr) == -1)
return -1;
// The following method call only applies to Win32 currently.
int result = this->subscribe_ifs (mcast_addr,
qos_params,
net_if,
protocol_family,
protocol,
reuse_addr,
protocolinfo);
// Check for the "short-circuit" return value of 1 (for NT).
if (result != 0)
return result;
// Tell network device driver to read datagrams with a
// <mcast_request_if_> IP interface.
else
{
// Check if the mcast_addr passed into this method is the
// same as the QoS session address.
if (qos_session != 0 && mcast_addr == qos_session->dest_addr ())
{
// Subscribe to the QoS session.
if (this->qos_manager_.join_qos_session (qos_session) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("Unable to join QoS Session\n")),
-1);
}
else
{
if (this->close () != 0)
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("Unable to close socket\n")));
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("Dest Addr in the QoS Session does")
ACE_TEXT (" not match the address passed into")
ACE_TEXT (" subscribe\n")),
-1);
}
ip_mreq ret_mreq;
this->make_multicast_ifaddr (&ret_mreq, mcast_addr, net_if);
// XX This is windows stuff only. fredk
if (ACE_OS::join_leaf (this->get_handle (),
reinterpret_cast<const sockaddr *> (&ret_mreq.IMR_MULTIADDR.s_addr),
sizeof ret_mreq.IMR_MULTIADDR.s_addr,
qos_params) == ACE_INVALID_HANDLE
&& errno != ENOTSUP)
return -1;
else
if (qos_params.socket_qos () != 0 && qos_session != 0)
qos_session->qos (*(qos_params.socket_qos ()));
return 0;
}
}
ACE_END_VERSIONED_NAMESPACE_DECL
+142
View File
@@ -0,0 +1,142 @@
// -*- C++ -*-
//=============================================================================
/**
* @file SOCK_Dgram_Mcast_QoS.h
*
* $Id: SOCK_Dgram_Mcast_QoS.h 80826 2008-03-04 14:51:23Z wotte $
*
* @author Vishal Kachroo <vishal@cs.wustl.edu>
*/
//=============================================================================
#ifndef ACE_SOCK_DGRAM_MCAST_QOS_H
#define ACE_SOCK_DGRAM_MCAST_QOS_H
#include /**/ "ace/pre.h"
#include "ace/SOCK_Dgram_Mcast.h"
#include "QoS_Manager.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
/**
* @class ACE_SOCK_Dgram_Mcast_QoS
*
* @brief Defines the member functions for the ACE QoS enabled socket
* wrapper for UDP/IP multicast.
*/
class ACE_QoS_Export ACE_SOCK_Dgram_Mcast_QoS : public ACE_SOCK_Dgram_Mcast
{
public:
// = Initialization routines.
/// Ctor, has same defaults as ACE_SOCK_Dgram_Mcast
ACE_SOCK_Dgram_Mcast_QoS (options opts = DEFOPTS);
// Note that there is no public <open> method. Therefore, this
// class cannot be used unless you <subscribe> to a multicast group.
// If you just want to send (and not listen) to a multicast group,
// use <ACE_SOCK_Dgram> or <ACE_SOCK_CODgram> instead.
/// Default dtor.
~ACE_SOCK_Dgram_Mcast_QoS (void);
// = Multicast group management routines.
/**
* This is a QoS-enabled method for joining a multicast group, which
* passes <qos_params> via <ACE_OS::join_leaf>. The network
* interface device driver is instructed to accept datagrams with
* <mcast_addr> multicast addresses. If the socket has already been
* opened, <subscribe> closes the socket and opens a new socket
* bound to the <mcast_addr>. The session object specifies the QoS
* session that the socket wants to subscribe to. A socket may
* subscribe to multiple QoS sessions by calling this method multiple
* times with different session objects.
*
* The <net_if> interface is hardware specific, e.g., use "netstat
* -i" to find whether your interface is, such as "le0" or something
* else. If net_if == 0, <subscribe> uses the default mcast
* interface. Returns: -1 if the call fails.
*
* Note that some platforms, such as pSoS, support only number, not
* names, for network interfaces. For these platforms, just give
* these numbers in alphanumeric form and <subscribe> will convert
* them into numbers via <ACE_OS::atoi>.
*/
int subscribe (const ACE_INET_Addr &mcast_addr,
const ACE_QoS_Params &qos_params,
int reuse_addr = 1,
const ACE_TCHAR *net_if = 0,
int protocol_family = PF_INET,
int protocol = 0,
ACE_Protocol_Info *protocolinfo = 0,
ACE_SOCK_GROUP g = 0,
u_long flags = 0,
ACE_QoS_Session *qos_session = 0);
// = Data transfer routines.
/// Send <buffer_count> worth of @a buffers to @a addr using overlapped
/// I/O (uses <WSASentTo>). Returns 0 on success.
ssize_t send (const iovec buffers[],
int buffer_count,
size_t &number_of_bytes_sent,
int flags,
const ACE_Addr &addr,
ACE_OVERLAPPED *overlapped,
ACE_OVERLAPPED_COMPLETION_FUNC func) const;
/// Send an @a n byte @a buf to the datagram socket (uses <WSASentTo>).
ssize_t send (const void *buf,
size_t n,
const ACE_Addr &addr,
int flags,
ACE_OVERLAPPED *overlapped,
ACE_OVERLAPPED_COMPLETION_FUNC func) const;
/// Returns the QoS manager for this socket.
ACE_QoS_Manager qos_manager (void);
/// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;
int open (const ACE_INET_Addr &addr,
const ACE_QoS_Params &qos_params,
int protocol_family = PF_INET,
int protocol = 0,
ACE_Protocol_Info *protocolinfo = 0,
ACE_SOCK_GROUP g = 0,
u_long flags = 0,
int reuse_addr = 0);
private:
// = Disable public <open> method to ensure class used properly.
/// Subscribe to the multicast interface using QoS-enabled semantics.
int subscribe_ifs (const ACE_INET_Addr &mcast_addr,
const ACE_QoS_Params &qos_params,
const ACE_TCHAR *net_if,
int protocol_family,
int protocol,
int reuse_addr,
ACE_Protocol_Info *protocolinfo);
/// Manages the QoS sessions that this socket subscribes to.
ACE_QoS_Manager qos_manager_;
};
ACE_END_VERSIONED_NAMESPACE_DECL
#if defined (__ACE_INLINE__)
#include "SOCK_Dgram_Mcast_QoS.inl"
#endif /* __ACE_INLINE__ */
#include /**/ "ace/post.h"
#endif /* ACE_SOCK_DGRAM_MCAST_QOS_H */
+57
View File
@@ -0,0 +1,57 @@
// -*- C++ -*-
//
// $Id: SOCK_Dgram_Mcast_QoS.inl 80826 2008-03-04 14:51:23Z wotte $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_INLINE
ACE_SOCK_Dgram_Mcast_QoS::~ACE_SOCK_Dgram_Mcast_QoS (void)
{
}
ACE_INLINE ssize_t
ACE_SOCK_Dgram_Mcast_QoS::send (const iovec buffers[],
int buffer_count,
size_t &number_of_bytes_sent,
int flags,
const ACE_Addr &addr,
ACE_OVERLAPPED *overlapped,
ACE_OVERLAPPED_COMPLETION_FUNC func) const
{
ACE_TRACE ("ACE_SOCK_Dgram_Mcast_QoS::send");
return ACE_SOCK_Dgram::send (buffers,
buffer_count,
number_of_bytes_sent,
flags,
addr,
overlapped,
func);
}
ACE_INLINE ssize_t
ACE_SOCK_Dgram_Mcast_QoS::send (const void *buf,
size_t n,
const ACE_Addr &addr,
int flags,
ACE_OVERLAPPED *overlapped,
ACE_OVERLAPPED_COMPLETION_FUNC func) const
{
ACE_TRACE ("ACE_SOCK_Dgram_Mcast_QoS::send");
return ACE_SOCK_Dgram::send (buf,
n,
addr,
flags,
overlapped,
func);
}
ACE_INLINE ACE_QoS_Manager
ACE_SOCK_Dgram_Mcast_QoS::qos_manager (void)
{
return this->qos_manager_;
}
ACE_END_VERSIONED_NAMESPACE_DECL
+1787
View File
File diff suppressed because it is too large Load Diff
+5 -5
View File
@@ -4,7 +4,7 @@
/**
* @file Recursive_Thread_Mutex.h
*
* $Id: Recursive_Thread_Mutex.h 89121 2010-02-22 14:48:31Z schmidt $
* $Id: Recursive_Thread_Mutex.h 91066 2010-07-12 11:05:04Z johnnyw $
*
* Moved from Synch.h.
*
@@ -90,14 +90,14 @@ public:
/**
* Acquire mutex ownership. This calls <acquire> and is only
* here to make the <ACE_Recusive_Thread_Mutex> interface consistent
* here to make the ACE_Recusive_Thread_Mutex interface consistent
* with the other synchronization APIs.
*/
int acquire_read (void);
/**
* Acquire mutex ownership. This calls <acquire> and is only
* here to make the <ACE_Recusive_Thread_Mutex> interface consistent
* here to make the ACE_Recusive_Thread_Mutex interface consistent
* with the other synchronization APIs.
*/
int acquire_write (void);
@@ -105,7 +105,7 @@ public:
/**
* Conditionally acquire mutex (i.e., won't block). This calls
* <tryacquire> and is only here to make the
* <ACE_Recusive_Thread_Mutex> interface consistent with the other
* ACE_Recusive_Thread_Mutex interface consistent with the other
* synchronization APIs. Returns -1 on failure. If we "failed"
* because someone else already had the lock, @c errno is set to
* @c EBUSY.
@@ -115,7 +115,7 @@ public:
/**
* Conditionally acquire mutex (i.e., won't block). This calls
* <tryacquire> and is only here to make the
* <ACE_Recusive_Thread_Mutex> interface consistent with the other
* ACE_Recusive_Thread_Mutex interface consistent with the other
* synchronization APIs. Returns -1 on failure. If we "failed"
* because someone else already had the lock, @c errno is set to
* @c EBUSY.
+29 -7
View File
@@ -2,7 +2,7 @@
ACE_RCSID (ACE_SSL,
SSL_Asynch_Stream,
"$Id: SSL_Asynch_Stream.cpp 82574 2008-08-08 19:35:06Z parsons $")
"$Id: SSL_Asynch_Stream.cpp 84181 2009-01-16 22:37:49Z shuston $")
// This only works on platforms with Asynchronous IO support.
#if OPENSSL_VERSION_NUMBER > 0x0090581fL && ((defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) || (defined (ACE_HAS_AIO_CALLS)))
@@ -17,6 +17,10 @@ ACE_RCSID (ACE_SSL,
#include "ace/Proactor.h"
#include "ace/Truncate.h"
#if !defined(__ACE_INLINE__)
#include "SSL_Asynch_Stream.inl"
#endif /* __ACE_INLINE__ */
#include <openssl/err.h>
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -93,13 +97,13 @@ ACE_SSL_Asynch_Stream::ACE_SSL_Asynch_Stream (
ACE_SSL_Asynch_Stream::Stream_Type s_type,
ACE_SSL_Context * context)
: type_ (s_type),
handle_ (ACE_INVALID_HANDLE),
proactor_ (0),
ext_handler_ (0),
ext_read_result_ (0),
ext_write_result_(0),
flags_ (0),
ssl_ (0),
handshake_complete_(false),
bio_ (0),
bio_istream_ (),
bio_inp_msg_ (),
@@ -260,7 +264,7 @@ ACE_SSL_Asynch_Stream::open (ACE_Handler & handler,
// Get a proactor for/from the user.
this->proactor_ = this->get_proactor (proactor, handler);
this->ext_handler_ = & handler;
this->handle_ = handle;
this->handle (handle);
// Open internal input stream
if (this->bio_istream_.open (*this, // real callbacks to this
@@ -342,7 +346,7 @@ ACE_SSL_Asynch_Stream::read (ACE_Message_Block & message_block,
ACE_NEW_RETURN (this->ext_read_result_,
ACE_SSL_Asynch_Read_Stream_Result (
*this->ext_handler_,
this->handle_,
this->handle (),
message_block,
bytes_to_read,
act,
@@ -385,7 +389,7 @@ ACE_SSL_Asynch_Stream::write (ACE_Message_Block & message_block,
ACE_NEW_RETURN (this->ext_write_result_,
ACE_SSL_Asynch_Write_Stream_Result (
*this->ext_handler_,
this->handle_,
this->handle (),
message_block,
bytes_to_write,
act,
@@ -491,7 +495,18 @@ int
ACE_SSL_Asynch_Stream::do_SSL_handshake (void)
{
if (SSL_is_init_finished (this->ssl_))
{
if (!handshake_complete_)
{
handshake_complete_ = true;
if (!post_handshake_check ())
{
return -1;
}
}
return 1;
}
if (this->flags_ & SF_REQ_SHUTDOWN)
return -1;
@@ -541,6 +556,13 @@ ACE_SSL_Asynch_Stream::do_SSL_handshake (void)
return 1;
}
bool
ACE_SSL_Asynch_Stream::post_handshake_check (void)
{
return true;
}
// ************************************************************
// Perform SSL_read call if necessary and notify user
// ************************************************************
@@ -768,7 +790,7 @@ ACE_SSL_Asynch_Stream::print_error (int err_ssl,
const ACE_TCHAR * pText)
{
ACE_DEBUG ((LM_DEBUG,
"SSL-error:%d %s\n" ,
ACE_TEXT("SSL-error:%d %s\n"),
err_ssl,
pText));
@@ -781,7 +803,7 @@ ACE_SSL_Asynch_Stream::print_error (int err_ssl,
{
ERR_error_string_n (lerr, buf, sizeof buf);
ACE_DEBUG ((LM_DEBUG, "%s\n", buf));
ACE_DEBUG ((LM_DEBUG, "%C\n", buf));
}
#endif /* OPENSSL_VERSION_NUMBER */
}
+45 -4
View File
@@ -4,7 +4,7 @@
/**
* @file SSL_Asynch_Stream.h
*
* $Id: SSL_Asynch_Stream.h 80826 2008-03-04 14:51:23Z wotte $
* $Id: SSL_Asynch_Stream.h 84181 2009-01-16 22:37:49Z shuston $
*
* @author Alexander Libman <alibman@baltimore.com>
*/
@@ -185,6 +185,9 @@ public:
int close (void);
/// Return a pointer to the underlying SSL structure.
SSL *ssl (void) const;
/**
* Initializes the factory with information which will be used with
* each asynchronous call.
@@ -294,6 +297,40 @@ protected:
/// more pending AIOs exist. It also calls users handle_wakeup().
virtual void handle_wakeup (void);
/**
* This method will be called after a successful SSL handshake indicating
* that the peer's certificate chain (if any) has been verified and the key
* exchange has completed. When a peer certificate is required, this
* method must be used to perform additional checks beyond the verification
* performed by OpenSSL.
*
* Check 1:
*
* SSL clients that require a peer certificate must specify SSL_VERIFY_PEER
* via ACE_SSL_Context::default_verify_mode. If the peer sends an invalid
* certificate, the SSL handshake will fail; however, if the peer does not
* send a certificate, the SSL handshake will complete successfully which
* may not be acceptable. In this case, you must override this method in a
* subclass and return false if the call to SSL_get_peer_certificate returns
* null.
*
* Check 2:
*
* An additional post handshake check that you should perform is to verify
* the certificate's FQDN against the host address you intended to connect
* to. This check will prevent an attacker from using a certificate signed
* by your CA to usurp your session. For further info on this check, see
* the post_connection_check method in Example 5-8 of 'Network Security with
* OpenSSL' by Viega, et. al.
*
* Return:
*
* false - Terminate the connection. Outstanding IO complete with ERR_CANCELED.
*
* true - Proceed with connection. The default implementation returns true.
*/
virtual bool post_handshake_check (void);
/**
* @name SSL State Machine
*/
@@ -342,9 +379,6 @@ protected:
/// Stream Type ST_CLIENT/ST_SERVER
Stream_Type type_;
/// The real file/socket handle
ACE_HANDLE handle_;
/// The proactor
ACE_Proactor * proactor_;
@@ -377,6 +411,9 @@ protected:
/// The SSL session.
SSL * ssl_;
/// Flag ensures that post_connection_check() is called at most one time.
bool handshake_complete_;
/// The BIO implementation
BIO * bio_;
@@ -417,6 +454,10 @@ protected:
ACE_END_VERSIONED_NAMESPACE_DECL
#if defined(__ACE_INLINE__)
#include "SSL_Asynch_Stream.inl"
#endif /* __ACE_INLINE__ */
#endif /* OPENSSL_VERSION_NUMBER > 0x0090581fL && (ACE_WIN32 ||
ACE_HAS_AIO_CALLS) */
+13
View File
@@ -0,0 +1,13 @@
// -*- C++ -*-
//
// $Id: SSL_Asynch_Stream.inl 83916 2008-11-28 16:32:21Z johnnyw $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_INLINE SSL *
ACE_SSL_Asynch_Stream::ssl (void) const
{
return this->ssl_;
}
ACE_END_VERSIONED_NAMESPACE_DECL
+22 -5
View File
@@ -28,7 +28,7 @@
ACE_RCSID (ACE_SSL,
SSL_Context,
"$Id: SSL_Context.cpp 82574 2008-08-08 19:35:06Z parsons $")
"$Id: SSL_Context.cpp 85202 2009-04-28 18:52:57Z johnnyw $")
namespace
@@ -112,6 +112,7 @@ ACE_SSL_Context::ACE_SSL_Context (void)
: context_ (0),
mode_ (-1),
default_verify_mode_ (SSL_VERIFY_NONE),
default_verify_callback_ (0),
have_ca_ (0)
{
ACE_SSL_Context::ssl_library_init ();
@@ -131,7 +132,7 @@ ACE_SSL_Context::~ACE_SSL_Context (void)
ACE_SSL_Context *
ACE_SSL_Context::instance (void)
{
return ACE_Singleton<ACE_SSL_Context, ACE_SYNCH_MUTEX>::instance ();
return ACE_Unmanaged_Singleton<ACE_SSL_Context, ACE_SYNCH_MUTEX>::instance ();
}
void
@@ -181,15 +182,15 @@ ACE_SSL_Context::ssl_library_init (void)
(void) this->egd_file (egd_socket_file);
#endif /* OPENSSL_VERSION_NUMBER */
const char *rand_file =
ACE_OS::getenv (ACE_SSL_RAND_FILE_ENV);
const char *rand_file = ACE_OS::getenv (ACE_SSL_RAND_FILE_ENV);
if (rand_file != 0)
{
(void) this->seed_file (rand_file);
}
// Initialize the mutexes that will be used by the SSL and
// crypto library.
}
++ssl_library_init_count;
@@ -205,6 +206,9 @@ ACE_SSL_Context::ssl_library_fini (void)
--ssl_library_init_count;
if (ssl_library_init_count == 0)
{
// Explicitly close the singleton
ACE_Unmanaged_Singleton<ACE_SSL_Context, ACE_SYNCH_MUTEX>::close();
::ERR_free_strings ();
::EVP_cleanup ();
@@ -232,7 +236,11 @@ ACE_SSL_Context::set_mode (int mode)
if (this->context_ != 0)
return -1;
#if OPENSSL_VERSION_NUMBER >= 0x10000002
const SSL_METHOD *method = 0;
#else
SSL_METHOD *method = 0;
#endif
switch (mode)
{
@@ -305,16 +313,20 @@ ACE_SSL_Context::load_trusted_ca (const char* ca_file,
{
// Use the default environment settings.
ca_file = ACE_OS::getenv (ACE_SSL_CERT_FILE_ENV);
#ifdef ACE_DEFAULT_SSL_CERT_FILE
if (ca_file == 0)
ca_file = ACE_DEFAULT_SSL_CERT_FILE;
#endif
}
if (ca_dir == 0 && use_env_defaults)
{
// Use the default environment settings.
ca_dir = ACE_OS::getenv (ACE_SSL_CERT_DIR_ENV);
#ifdef ACE_DEFAULT_SSL_CERT_DIR
if (ca_dir == 0)
ca_dir = ACE_DEFAULT_SSL_CERT_DIR;
#endif
}
// NOTE: SSL_CTX_load_verify_locations() returns 0 on error.
@@ -566,7 +578,12 @@ ACE_SSL_Context::report_error (unsigned long error_code)
char error_string[256];
// OpenSSL < 0.9.6a doesn't have ERR_error_string_n() function.
#if OPENSSL_VERSION_NUMBER >= 0x0090601fL
(void) ::ERR_error_string_n (error_code, error_string, sizeof error_string);
#else /* OPENSSL_VERSION_NUMBER >= 0x0090601fL */
(void) ::ERR_error_string (error_code, error_string);
#endif /* OPENSSL_VERSION_NUMBER >= 0x0090601fL */
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("ACE_SSL (%P|%t) error code: %u - %C\n"),
+13 -3
View File
@@ -4,7 +4,7 @@
/**
* @file SSL_Context.h
*
* $Id: SSL_Context.h 80826 2008-03-04 14:51:23Z wotte $
* $Id: SSL_Context.h 83916 2008-11-28 16:32:21Z johnnyw $
*
* @author Carlos O'Ryan <coryan@ece.uci.edu>
* @author Ossama Othman <ossama@dre.vanderbilt.edu>
@@ -264,7 +264,6 @@ public:
*/
void set_verify_peer (int strict = 0, int once = 1, int depth = 0);
/// TODO: a implementation that will lookup the CTX table for the list
/// of files and paths etc.
/// Query the location of trusted certification authority
@@ -280,6 +279,14 @@ public:
void default_verify_mode (int mode);
int default_verify_mode (void) const;
/**
* Set and query the default verify callback for this context, it is
* inherited by all the ACE_SSL objects created using the context.
* It can be overriden on a per-ACE_SSL object.
*/
void default_verify_callback (int (*callback) (int, X509_STORE_CTX *));
int (*default_verify_callback(void) const) (int,X509_STORE_CTX *);
/**
* @name OpenSSL Random Number Generator Seed Related Methods
*
@@ -354,7 +361,7 @@ private:
/// Cache the mode so we can answer fast
int mode_;
/// The private key, certificate, and Diffie-Hellman paramters files
/// The private key, certificate, and Diffie-Hellman parameters files
ACE_SSL_Data_File private_key_;
ACE_SSL_Data_File certificate_;
ACE_SSL_Data_File dh_params_;
@@ -362,6 +369,9 @@ private:
/// The default verify mode.
int default_verify_mode_;
/// The default verify callback.
int (*default_verify_callback_)(int, X509_STORE_CTX *);
/// count of successful CA load attempts
int have_ca_;
+14 -2
View File
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
// $Id: SSL_Context.inl 80826 2008-03-04 14:51:23Z wotte $
// $Id: SSL_Context.inl 83916 2008-11-28 16:32:21Z johnnyw $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -40,7 +40,8 @@ ACE_SSL_Context::check_context (void)
this->set_mode ();
}
::SSL_CTX_set_verify (this->context_, this->default_verify_mode (), 0);
::SSL_CTX_set_verify (this->context_, this->default_verify_mode (),
this->default_verify_callback ());
}
ACE_INLINE SSL_CTX *
@@ -98,6 +99,17 @@ ACE_SSL_Context::default_verify_mode (void) const
return this->default_verify_mode_;
}
ACE_INLINE void
ACE_SSL_Context::default_verify_callback (int (*callback) (int, X509_STORE_CTX*))
{
this->default_verify_callback_ = callback;
}
ACE_INLINE int (*ACE_SSL_Context::default_verify_callback(void) const)(int,X509_STORE_CTX *)
{
return this->default_verify_callback_;
}
ACE_INLINE int
ACE_SSL_Context::get_mode (void) const
{
-1
View File
@@ -6,7 +6,6 @@
// ------------------------------
#if !defined (ACE_SSL_EXPORT_H)
#define ACE_SSL_EXPORT_H
#define ACE_SSL_BUILD_DLL
#include /**/ "ace/config-all.h"
+6 -6
View File
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
// $Id: SSL_SOCK_Acceptor.cpp 82577 2008-08-09 17:43:11Z mitza $
// $Id: SSL_SOCK_Acceptor.cpp 82723 2008-09-16 09:35:44Z johnnyw $
#include "SSL_SOCK_Acceptor.h"
@@ -19,7 +19,7 @@
ACE_RCSID (ACE_SSL,
SSL_SOCK_Acceptor,
"$Id: SSL_SOCK_Acceptor.cpp 82577 2008-08-09 17:43:11Z mitza $")
"$Id: SSL_SOCK_Acceptor.cpp 82723 2008-09-16 09:35:44Z johnnyw $")
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -176,8 +176,8 @@ int
ACE_SSL_SOCK_Acceptor::accept (ACE_SSL_SOCK_Stream &new_stream,
ACE_Addr *remote_addr,
ACE_Time_Value *timeout,
int restart,
int reset_new_handle) const
bool restart,
bool reset_new_handle) const
{
ACE_TRACE ("ACE_SSL_SOCK_Acceptor::accept");
@@ -214,8 +214,8 @@ ACE_SSL_SOCK_Acceptor::accept (ACE_SSL_SOCK_Stream &new_stream,
ACE_Accept_QoS_Params qos_params,
ACE_Addr *remote_addr,
ACE_Time_Value *timeout,
int restart,
int reset_new_handle) const
bool restart,
bool reset_new_handle) const
{
ACE_TRACE ("ACE_SSL_SOCK_Acceptor::accept");
+5 -5
View File
@@ -4,7 +4,7 @@
/**
* @file SSL_SOCK_Acceptor.h
*
* $Id: SSL_SOCK_Acceptor.h 81826 2008-06-02 15:29:53Z schmidt $
* $Id: SSL_SOCK_Acceptor.h 82723 2008-09-16 09:35:44Z johnnyw $
*
* @author John Heitmann
* @author Chris Zimman
@@ -138,8 +138,8 @@ public:
int accept (ACE_SSL_SOCK_Stream &new_stream,
ACE_Addr *remote_addr = 0,
ACE_Time_Value *timeout = 0,
int restart = 1,
int reset_new_handle = 0) const;
bool restart = true,
bool reset_new_handle = false) const;
/**
* Accept a new ACE_SSL_SOCK_Stream connection using the RVSP QoS
@@ -160,8 +160,8 @@ public:
ACE_Accept_QoS_Params qos_params,
ACE_Addr *remote_addr = 0,
ACE_Time_Value *timeout = 0,
int restart = 1,
int reset_new_handle = 0) const;
bool restart = true,
bool reset_new_handle = false) const;
//@}
/// Meta-type info
+2 -2
View File
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
// $Id: SSL_SOCK_Acceptor.inl 80826 2008-03-04 14:51:23Z wotte $
// $Id: SSL_SOCK_Acceptor.inl 84619 2009-02-26 12:26:16Z johnnyw $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -76,7 +76,7 @@ ACE_SSL_SOCK_Acceptor::close (void)
{
ACE_TRACE ("ACE_SSL_SOCK_Acceptor::close ()");
int result = this->acceptor_.close ();
int const result = this->acceptor_.close ();
this->set_handle (ACE_INVALID_HANDLE);
return result;
+6 -6
View File
@@ -4,7 +4,7 @@
/**
* @file SSL_SOCK_Connector.h
*
* $Id: SSL_SOCK_Connector.h 80826 2008-03-04 14:51:23Z wotte $
* $Id: SSL_SOCK_Connector.h 84816 2009-03-13 08:16:32Z johnnyw $
*
* @author Ossama Othman <ossama@uci.edu>
* @author Carlos O'Ryan <coryan@uci.edu>
@@ -86,7 +86,7 @@ public:
* amount of time passes before the connection is made,
* this method returns -1 and errno == ETIME. Note
* the difference between this case and when a blocking
* connect is attmpted that TCP times out - in the latter
* connect is attempted that TCP times out - in the latter
* case, errno will be ETIMEDOUT.
* @param local_sap (optional) The local address to bind to. If it's
* the default value of @c ACE_Addr::sap_any then the
@@ -137,7 +137,7 @@ public:
* amount of time passes before the connection is made,
* this method returns -1 and errno == ETIME. Note
* the difference between this case and when a blocking
* connect is attmpted that TCP times out - in the latter
* connect is attempted that TCP times out - in the latter
* case, errno will be ETIMEDOUT.
* @param local_sap (optional) The local address to bind to. If it's
* the default value of @c ACE_Addr::sap_any then the
@@ -191,7 +191,7 @@ public:
* amount of time passes before the connection is made,
* this method returns -1 and errno == ETIME. Note
* the difference between this case and when a blocking
* connect is attmpted that TCP times out - in the latter
* connect is attempted that TCP times out - in the latter
* case, errno will be ETIMEDOUT.
* @param local_sap (optional) The local address to bind to. If it's
* the default value of @c ACE_Addr::sap_any then the
@@ -242,7 +242,7 @@ public:
* amount of time passes before the connection is made,
* this method returns -1 and errno == ETIME. Note
* the difference between this case and when a blocking
* connect is attmpted that TCP times out - in the latter
* connect is attempted that TCP times out - in the latter
* case, errno will be ETIMEDOUT.
* @param local_sap (optional) The local address to bind to. If it's
* the default value of @c ACE_Addr::sap_any then the
@@ -279,7 +279,7 @@ public:
const ACE_Time_Value *timeout = 0);
/// Resets any event associations on this handle
int reset_new_handle (ACE_HANDLE handle);
bool reset_new_handle (ACE_HANDLE handle);
/// Meta-type info
//@{
+2 -2
View File
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
// $Id: SSL_SOCK_Connector.inl 80826 2008-03-04 14:51:23Z wotte $
// $Id: SSL_SOCK_Connector.inl 82728 2008-09-16 10:22:28Z johnnyw $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -11,7 +11,7 @@ ACE_SSL_SOCK_Connector::ACE_SSL_SOCK_Connector (void)
ACE_TRACE ("ACE_SSL_SOCK_Connector::ACE_SSL_SOCK_Connector");
}
ACE_INLINE int
ACE_INLINE bool
ACE_SSL_SOCK_Connector::reset_new_handle (ACE_HANDLE handle)
{
ACE_TRACE ("ACE_SSL_SOCK_Connector::reset_new_handle");
+28 -1
View File
@@ -4,7 +4,7 @@
/**
* @file SSL_SOCK_Stream.h
*
* $Id: SSL_SOCK_Stream.h 80826 2008-03-04 14:51:23Z wotte $
* $Id: SSL_SOCK_Stream.h 91103 2010-07-15 12:36:57Z mcorino $
*
* @author Ossama Othman <ossama@uci.edu>
* @author Carlos O'Ryan <coryan@uci.edu>
@@ -206,6 +206,18 @@ public:
const ACE_Time_Value *timeout,
size_t *bytes_transferred = 0) const;
/**
* Try to send exactly len bytes into buf (uses the send() call).
* If send() blocks for longer than timeout the number of bytes
* actually sent is returned with errno == ETIME. If a timeout does
* not occur, send_n() return len (i.e., the number of bytes
* requested to be sent).
*/
ssize_t send_n (const void *buf,
size_t len,
const ACE_Time_Value *timeout,
size_t *bytes_transferred = 0) const;
/**
* Try to receive exactly len bytes into buf (uses the recv() call).
* The ACE_Time_Value indicates how long to blocking trying to
@@ -221,6 +233,21 @@ public:
int flags,
const ACE_Time_Value *timeout,
size_t *bytes_transferred = 0) const;
/**
* Try to receive exactly len bytes into buf (uses the recv() call).
* The ACE_Time_Value indicates how long to blocking trying to
* receive. If timeout == 0, the caller will block until action is
* possible, else will wait until the relative time specified in
* timeout elapses). If recv() blocks for longer than timeout the
* number of bytes actually read is returned with errno == ETIME.
* If a timeout does not occur, recv_n return len (i.e., the number
* of bytes requested to be read).
*/
ssize_t recv_n (void *buf,
size_t len,
const ACE_Time_Value *timeout,
size_t *bytes_transferred = 0) const;
//@}
/**
+21 -1
View File
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
// $Id: SSL_SOCK_Stream.inl 82579 2008-08-10 23:03:06Z mitza $
// $Id: SSL_SOCK_Stream.inl 91103 2010-07-15 12:36:57Z mcorino $
#include "ace/OS_NS_errno.h"
#include "ace/Truncate.h"
@@ -251,6 +251,16 @@ ACE_SSL_SOCK_Stream::recv_n (void *buf, int buf_size) const
return this->recv_n (buf, buf_size, 0);
}
ACE_INLINE ssize_t
ACE_SSL_SOCK_Stream::recv_n (void *buf,
size_t len,
const ACE_Time_Value *timeout,
size_t *bytes_transferred) const
{
ACE_TRACE ("ACE_SSL_SOCK_Stream::recv_n");
return this->recv_n (buf, len, 0, timeout, bytes_transferred);
}
ACE_INLINE ssize_t
ACE_SSL_SOCK_Stream::send_n (const void *buf, int len) const
{
@@ -258,6 +268,16 @@ ACE_SSL_SOCK_Stream::send_n (const void *buf, int len) const
return this->send_n (buf, len, 0);
}
ACE_INLINE ssize_t
ACE_SSL_SOCK_Stream::send_n (const void *buf,
size_t len,
const ACE_Time_Value *timeout,
size_t *bytes_transferred) const
{
ACE_TRACE ("ACE_SSL_SOCK_Stream::send_n");
return this->send_n (buf, len, 0, timeout, bytes_transferred);
}
ACE_INLINE int
ACE_SSL_SOCK_Stream::close_reader (void)
{
+13 -11
View File
@@ -4,7 +4,7 @@
/**
* @file sslconf.h
*
* $Id: sslconf.h 80826 2008-03-04 14:51:23Z wotte $
* $Id: sslconf.h 83879 2008-11-26 10:46:30Z smcqueen $
*
* @author Carlos O'Ryan <coryan@ece.uci.edu>
*/
@@ -19,19 +19,21 @@
#include /**/ "ace/config-all.h"
#if !defined (ACE_DEFAULT_SSL_CERT_FILE)
# ifdef WIN32
# define ACE_DEFAULT_SSL_CERT_FILE "cert.pem"
# else
# define ACE_DEFAULT_SSL_CERT_FILE "/etc/ssl/cert.pem"
# endif /* WIN32 */
// Define a default CA certificate filename here if required e.g.:
// # ifdef WIN32
// # define ACE_DEFAULT_SSL_CERT_FILE "cert.pem"
// # else
// # define ACE_DEFAULT_SSL_CERT_FILE "/etc/ssl/cert.pem"
// # endif /* WIN32 */
#endif /* ACE_DEFAULT_SSL_CERT_FILE */
#if !defined (ACE_DEFAULT_SSL_CERT_DIR)
# ifdef WIN32
# define ACE_DEFAULT_SSL_CERT_DIR "certs"
# else
# define ACE_DEFAULT_SSL_CERT_DIR "/etc/ssl/certs"
# endif /* WIN32 */
// Define a default CA certificate files directory here if required. e.g.:
// # ifdef WIN32
// # define ACE_DEFAULT_SSL_CERT_DIR "certs"
// # else
// # define ACE_DEFAULT_SSL_CERT_DIR "/etc/ssl/certs"
// # endif /* WIN32 */
#endif /* ACE_DEFAULT_SSL_CERT_DIR */
#if !defined (ACE_SSL_CERT_FILE_ENV)
+5 -5
View File
@@ -4,7 +4,7 @@
/**
* @file SString.h
*
* $Id: SString.h 86289 2009-07-30 03:40:46Z hillj $
* $Id: SString.h 91058 2010-07-12 08:20:09Z johnnyw $
*
* @author Douglas C. Schmidt (schmidt@cs.wustl.edu)
*/
@@ -145,7 +145,7 @@ public:
/// Constructor that copies @a s into dynamically allocated memory.
ACE_SString (const char *s, ACE_Allocator *alloc = 0);
/// Constructor that copies @a len chars of @s into dynamically
/// Constructor that copies @a len chars of @a s into dynamically
/// allocated memory (will NUL terminate the result).
ACE_SString (const char *s, size_type len, ACE_Allocator *alloc = 0);
@@ -195,7 +195,7 @@ public:
/// Get the underlying pointer.
const char *fast_rep (void) const;
/// Same as STL String's <c_str> and <fast_rep>.
/// Same as STL String's c_str() and fast_rep().
const char *c_str (void) const;
/// Comparison operator that will match substrings. Returns the
@@ -230,7 +230,7 @@ public:
/// Inequality comparison operator.
bool operator != (const ACE_SString &s) const;
/// Performs a <strcmp>-style comparison.
/// Performs a strcmp()-style comparison.
int compare (const ACE_SString &s) const;
/// Dump the state of an object.
@@ -243,7 +243,7 @@ private:
/// Pointer to a memory allocator.
ACE_Allocator *allocator_;
/// Length of the ACE_SString (not counting the trailing '\0').
/// Length of the ACE_SString (not counting the trailing '\\0').
size_type len_;
/// Pointer to data.
+3 -3
View File
@@ -1,4 +1,4 @@
// $Id: Select_Reactor_Base.cpp 88832 2010-02-04 09:57:42Z johnnyw $
// $Id: Select_Reactor_Base.cpp 90989 2010-07-05 11:22:50Z johnnyw $
#include "ace/Select_Reactor_Base.h"
#include "ace/Reactor.h"
@@ -20,7 +20,7 @@
ACE_RCSID (ace,
Select_Reactor_Base,
"$Id: Select_Reactor_Base.cpp 88832 2010-02-04 09:57:42Z johnnyw $")
"$Id: Select_Reactor_Base.cpp 90989 2010-07-05 11:22:50Z johnnyw $")
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -83,7 +83,7 @@ ACE_Select_Reactor_Handler_Repository::handle_in_range (ACE_HANDLE handle)
}
int
ACE_Select_Reactor_Handler_Repository::open (size_t size)
ACE_Select_Reactor_Handler_Repository::open (size_type size)
{
ACE_TRACE ("ACE_Select_Reactor_Handler_Repository::open");
+52 -39
View File
@@ -1,4 +1,4 @@
// $Id: Service_Gestalt.cpp 89501 2010-03-17 08:59:56Z vzykov $
// $Id: Service_Gestalt.cpp 91158 2010-07-21 15:54:12Z mesnier_p $
#include "ace/Svc_Conf.h"
#include "ace/Get_Opt.h"
@@ -31,7 +31,7 @@
ACE_RCSID (ace,
Service_Gestalt,
"$Id: Service_Gestalt.cpp 89501 2010-03-17 08:59:56Z vzykov $")
"$Id: Service_Gestalt.cpp 91158 2010-07-21 15:54:12Z mesnier_p $")
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -259,32 +259,6 @@ ACE_Service_Gestalt::init_i (void)
if (init_svc_conf_file_queue () == -1)
return -1;
if ( svc_conf_file_queue_->is_empty ())
{
// Check if the default file exists before attempting to queue it
// for processing
FILE *fp = ACE_OS::fopen (ACE_DEFAULT_SVC_CONF,
ACE_TEXT ("r"));
bool skip_static_svcs = (fp == 0);
if (fp != 0)
ACE_OS::fclose (fp);
if (!skip_static_svcs) {
// Load the default "svc.conf" entry here if there weren't
// overriding -f arguments in <parse_args>.
if (svc_conf_file_queue_->enqueue_tail
(ACE_TString (ACE_DEFAULT_SVC_CONF)) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("enqueuing ")
ACE_DEFAULT_SVC_CONF
ACE_TEXT(" file")),
-1);
}
}
}
return 0;
}
@@ -1086,19 +1060,62 @@ ACE_Service_Gestalt::open_i (const ACE_TCHAR program_name[],
ACE_Log_Msg::disable_debug_messages ();
}
if (!ignore_default_svc_conf_file)
{
bool add_default = true;
bool has_files = this->svc_conf_file_queue_ &&
!this->svc_conf_file_queue_->is_empty ();
bool has_cmdline = this->svc_queue_ && !this->svc_queue_->is_empty ();
if (has_files || has_cmdline)
{
// check if default file is already listed
ACE_TString *sptr = 0;
ACE_TString default_svc_conf (ACE_DEFAULT_SVC_CONF);
for (ACE_SVC_QUEUE_ITERATOR iter (*this->svc_conf_file_queue_);
iter.next (sptr) != 0 && add_default;
iter.advance ())
{
add_default = (*sptr != default_svc_conf);
}
if (add_default)
{
FILE *fp = ACE_OS::fopen (ACE_DEFAULT_SVC_CONF, ACE_TEXT ("r"));
if (fp != 0)
ACE_OS::fclose(fp);
else
add_default = false;
}
}
// Load the default "svc.conf" entry. here if there weren't
// overriding -f arguments in <parse_args>.
if (add_default && svc_conf_file_queue_->enqueue_head
(ACE_TString (ACE_DEFAULT_SVC_CONF)) == -1)
{
errno = ENOENT;
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("enqueuing ")
ACE_DEFAULT_SVC_CONF
ACE_TEXT(" file")),
-1);
}
}
// See if we need to load the static services.
if (this->no_static_svcs_ == 0
&& this->load_static_svcs () == -1)
result = -1;
else
{
if (this->process_directives (ignore_default_svc_conf_file) == -1)
result = -1;
else
result = this->process_directives ();
if (result != -1 || errno == ENOENT)
result = this->process_commandline_directives ();
}
// Reset debugging back to the way it was when we came into
// into <open_i>.
{
@@ -1230,17 +1247,16 @@ ACE_Service_Gestalt::parse_args_i (int argc,
// Process service configuration directives from the files queued for
// processing
int
ACE_Service_Gestalt::process_directives (bool ignore_default_svc_conf_file)
ACE_Service_Gestalt::process_directives (bool )
{
ACE_TRACE ("ACE_Service_Gestalt::process_directives");
if (this->svc_conf_file_queue_ == 0
|| this->svc_conf_file_queue_->is_empty ())
{
return 0;
}
ACE_TString *sptr = 0;
ACE_TString default_svc_conf (ACE_DEFAULT_SVC_CONF);
int failed = 0;
// Iterate through all the svc.conf files.
@@ -1248,9 +1264,6 @@ ACE_Service_Gestalt::process_directives (bool ignore_default_svc_conf_file)
iter.next (sptr) != 0;
iter.advance ())
{
if (*sptr == default_svc_conf && ignore_default_svc_conf_file)
continue;
int result = this->process_file (sptr->fast_rep ());
if (result < 0)
return result;
+25 -17
View File
@@ -4,7 +4,7 @@
/**
* @file Service_Gestalt.h
*
* $Id: Service_Gestalt.h 89501 2010-03-17 08:59:56Z vzykov $
* $Id: Service_Gestalt.h 91158 2010-07-21 15:54:12Z mesnier_p $
*
* @author Iliyan Jeliazkov <iliyan@ociweb.com>
*/
@@ -154,11 +154,19 @@ public:
* specifies service directives without the need for a configuration
* file. Can be specified multiple times.
*
* Note: Options '-f' and '-S' complement each other. Directives from files
* and from '-S' option are processed together in the following order. First,
* all files are processed in the order they are specified in @a argv
* parameter. Second, all directive strings are executed in the order the
* directives appear in @a argv parameter.
* Note: Options '-f' and '-S' complement each other. Directives
* from files and from '-S' option are processed together in the
* following order. First, the default file "./svc.conf" is
* evaluated if not ignored, then all files are processed in the
* order they are specified in '-f' @a argv parameter. Finally, all
* '-S' directive strings are executed in the order the directives
* appear in @a argv parameter.
*
* If no files or directives are added via the '-f' and '-S'
* arguments, and the default file is not ignored, it will be
* evaluated whether it exists or not, possibly causing a failure
* return. If any other directives are added then the default file
* will be evaluated only if it exists.
*
* @param argc The number of commandline arguments.
* @param argv The array with commandline arguments
@@ -167,16 +175,16 @@ public:
* socket address.
* @param ignore_static_svcs If true then static services are not loaded,
* otherwise, they are loaded.
* @param ignore_default_svc_conf_file If false then the @c svc.conf
* @param ignore_default_svc_conf_file If false then the @c ./svc.conf
* configuration file will be ignored.
* @param ignore_debug_flag If false then the application is responsible
* for setting the @c ACE_Log_Msg::priority_mask
* appropriately.
*
* @retval -1 The configuration file is not found or cannot
* @retval -1 A configuration file is not found or cannot
* be opened (errno is set accordingly).
* @retval 0 Success.
* @retval >0 The number of errors encountered while processing
* @retval >0 The number of directive errors encountered while processing
* the service configuration file(s).
*/
int open (int argc,
@@ -252,7 +260,7 @@ public:
* provided in the svc.conf file(s). Returns the number of errors
* that occurred.
*/
int process_directives (bool ignore_default_svc_conf_file);
int process_directives (bool defunct_option = false);
/// Tidy up and perform last rites when ACE_Service_Config is shut
/// down. This method calls @c close_svcs. Returns 0.
@@ -335,13 +343,13 @@ protected:
bool& ignore_default_svc_conf_file);
/**
* Performs an open without parsing command-line arguments. The
* @a logger_key indicates where to write the logging output, which
* is typically either a STREAM pipe or a socket address. If
* @a ignore_default_svc_conf_file is non-0 then the "svc.conf" file
* will be ignored. If @a ignore_debug_flag is non-0 then the
* application is responsible for setting the
* @c ACE_Log_Msg::priority_mask() appropriately. Returns number of
* Performs an open without parsing command-line arguments. The @a
* logger_key indicates where to write the logging output, which is
* typically either a STREAM pipe or a socket address. If @a
* ignore_default_svc_conf_file is non-0 then the "svc.conf" file
* will not be added by default. If @a ignore_debug_flag is non-0
* then the application is responsible for setting the @c
* ACE_Log_Msg::priority_mask() appropriately. Returns number of
* errors that occurred on failure and 0 otherwise.
*/
int open_i (const ACE_TCHAR program_name[],
+4 -2
View File
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
// $Id: Service_Gestalt.inl 83780 2008-11-17 08:37:37Z johnnyw $
// $Id: Service_Gestalt.inl 91158 2010-07-21 15:54:12Z mesnier_p $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -36,6 +36,8 @@ ACE_Service_Gestalt::open (int argc,
{
ACE_TRACE ("ACE_Service_Gestalt::open");
// Parsing argv may change no_static_svcs_ so set the default here, then
// parse, then pass the final value to open_i().
this->no_static_svcs_ = ignore_static_svcs;
if (this->parse_args_i (argc,
@@ -45,7 +47,7 @@ ACE_Service_Gestalt::open (int argc,
return this->open_i (argv == 0 ? 0 : argv[0],
logger_key,
ignore_static_svcs,
this->no_static_svcs_,
ignore_default_svc_conf,
ignore_debug_flag);
}
+2 -2
View File
@@ -4,7 +4,7 @@
/**
* @file Service_Repository.h
*
* $Id: Service_Repository.h 85007 2009-04-01 14:11:03Z johnnyw $
* $Id: Service_Repository.h 91016 2010-07-06 11:29:50Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -96,7 +96,7 @@ public:
* Locate a named entry in the service table, optionally ignoring
* suspended entries.
*
* @param service_name The name of the service to search for.
* @param name The name of the service to search for.
* @param srp Optional; if not 0, it is a pointer to a location
* to receive the ACE_Service_Type pointer for the
* located service. Meaningless if this method
+2 -5
View File
@@ -1,4 +1,4 @@
// $Id: Sock_Connect.cpp 87160 2009-10-19 14:01:10Z olli $
// $Id: Sock_Connect.cpp 90399 2010-06-03 21:35:20Z mesnier_p $
#include "ace/Sock_Connect.h"
#include "ace/INET_Addr.h"
@@ -60,9 +60,6 @@ const struct in6_addr in6addr_linklocal_allrouters = IN6ADDR_LINKLOCAL_ALLROUTER
#if defined (ACE_HAS_WINCE)
#include /**/ <iphlpapi.h>
# if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) && (_WIN32_WCE < 0x600) && defined (ACE_HAS_IPV6)
// The following code is suggested by microsoft as a workaround to the fact
// that on Windows CE, these constants are exported as function addresses
// rather than simply values.
# include /**/ <ws2tcpip.h>
const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT;
@@ -162,7 +159,7 @@ static ACE_Auto_Array_Ptr<sockaddr> force_compiler_to_include_socket_h;
ACE_RCSID (ace,
Sock_Connect,
"$Id: Sock_Connect.cpp 87160 2009-10-19 14:01:10Z olli $")
"$Id: Sock_Connect.cpp 90399 2010-06-03 21:35:20Z mesnier_p $")
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+8 -8
View File
@@ -4,7 +4,7 @@
/**
* @file Stream.h
*
* $Id: Stream.h 84477 2009-02-16 13:30:38Z johnnyw $
* $Id: Stream.h 91058 2010-07-12 08:20:09Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@uci.edu>
*/
@@ -37,8 +37,8 @@ class ACE_Time_Value;
* @brief This class is the primary abstraction for the ASX framework.
* It is moduled after System V Stream.
*
* A Stream consists of a stack of <ACE_Modules>, each of which
* contains two <ACE_Tasks>. Even though the methods in this
* A Stream consists of a stack of @c ACE_Modules, each of which
* contains two @c ACE_Tasks. Even though the methods in this
* class are virtual, this class isn't really intended for
* subclassing unless you know what you are doing. In
* particular, the ACE_Stream destructor calls <close>, which
@@ -53,7 +53,7 @@ public:
enum
{
/// Indicates that <close> deletes the Tasks. Don't change this
/// Indicates that @c close() deletes the Tasks. Don't change this
/// value without updating the same enum in class ACE_Module...
M_DELETE = 3
};
@@ -88,7 +88,7 @@ public:
// = ACE_Stream plumbing operations
/// Add a new module @a mod right below the Stream head. The
/// <open()> hook methods of the <ACE_Tasks> in this ACE_Module
/// @c open() hook methods of the @c ACE_Tasks in this ACE_Module
/// are invoked to initialize the tasks.
virtual int push (ACE_Module<ACE_SYNCH_USE> *mod);
@@ -101,7 +101,7 @@ public:
/// head).
virtual int top (ACE_Module<ACE_SYNCH_USE> *&mod);
/// Insert a new module @a mod below the named module <prev_name>.
/// Insert a new module @a mod below the named module @a prev_name.
virtual int insert (const ACE_TCHAR *prev_name,
ACE_Module<ACE_SYNCH_USE> *mod);
@@ -111,7 +111,7 @@ public:
int flags = M_DELETE);
/// Remove the named module @a mod from the stream. This bypasses the
/// strict LIFO ordering of <push> and <pop>.
/// strict LIFO ordering of @c push and @c pop.
virtual int remove (const ACE_TCHAR *mod,
int flags = M_DELETE);
@@ -218,7 +218,7 @@ public:
int advance (void);
private:
/// Next <Module> that we haven't yet seen.
/// Next ACE_Module that we haven't yet seen.
ACE_Module<ACE_SYNCH_USE> *next_;
};
+376
View File
@@ -0,0 +1,376 @@
%{
// $Id: Svc_Conf.y 82136 2008-06-23 15:28:40Z sma $
#include "ace/Svc_Conf.h"
#if (ACE_USES_CLASSIC_SVC_CONF == 1)
#include "ace/Module.h"
#include "ace/Stream.h"
#include "ace/Service_Types.h"
#include "ace/ace_wchar.h"
ACE_RCSID (ace,
Svc_Conf_y,
"$Id: Svc_Conf.y 82136 2008-06-23 15:28:40Z sma $")
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// Prototypes.
static ACE_Module_Type *
ace_get_module (ACE_Service_Type const * sr,
ACE_TCHAR const * svc_name,
int & ace_yyerrno);
#define YYDEBUG_LEXER_TEXT (yytext[yyleng] = '\0', yytext)
// Force the pretty debugging code to compile.
// #define YYDEBUG 1
// Bison 2.3 template contains switch statement with a "default:", but
// without a "case:" label. Suppressing a compiler warning for Visual
// C++.
#if defined (_MSC_VER)
# pragma warning ( disable : 4065 )
#endif
// Normalize the message literal's type to match yyerror() prototype
#define YY_ ACE_TEXT
// Prevent yacc(1) from declaring a trivial YYSTYPE just because
// YYSTYPE is not a macro definition. On the other hand we want
// YYSTYPE_IS_DECLARED to be as localized as possible to avoid
// poluting the global namespace - there may be other yacc(1) parsers
// that want to play nice with ACE
#define YYSTYPE_IS_DECLARED
ACE_END_VERSIONED_NAMESPACE_DECL
%}
%token ACE_DYNAMIC ACE_STATIC ACE_SUSPEND ACE_RESUME ACE_REMOVE ACE_USTREAM
%token ACE_MODULE_T ACE_STREAM_T ACE_SVC_OBJ_T ACE_ACTIVE ACE_INACTIVE
%token ACE_PATHNAME ACE_IDENT ACE_STRING
%start svc_config_entries
%type <ident_> ACE_IDENT ACE_STRING ACE_PATHNAME pathname parameters_opt
%type <type_> type status
%type <parse_node_> dynamic static suspend resume remove module_list stream
%type <parse_node_> stream_modules module svc_config_entry
%type <static_node_> stream_ops
%type <svc_record_> svc_location
%type <location_node_> svc_initializer
// Generate a pure (reentrant) parser -- GNU Bison only
%pure_parser
%%
svc_config_entries
: svc_config_entries svc_config_entry
{
if ($2 != 0)
{
$2->apply (ACE_SVC_CONF_PARAM->config, ACE_SVC_CONF_PARAM->yyerrno);
delete $2;
}
ACE_SVC_CONF_PARAM->obstack.release ();
}
| svc_config_entries error
{
ACE_SVC_CONF_PARAM->obstack.release ();
}
| /* EMPTY */
;
svc_config_entry
: dynamic
| static
| suspend
| resume
| remove
| stream
;
dynamic
: ACE_DYNAMIC svc_location parameters_opt
{
if ($2 != 0)
$$ = new ACE_Dynamic_Node ($2, $3);
else
$$ = 0;
}
;
static
: ACE_STATIC ACE_IDENT parameters_opt
{
$$ = new ACE_Static_Node ($2, $3);
}
;
suspend
: ACE_SUSPEND ACE_IDENT
{
$$ = new ACE_Suspend_Node ($2);
}
;
resume
: ACE_RESUME ACE_IDENT
{
$$ = new ACE_Resume_Node ($2);
}
;
remove
: ACE_REMOVE ACE_IDENT
{
$$ = new ACE_Remove_Node ($2);
}
;
stream
: ACE_USTREAM stream_ops stream_modules
{
$$ = new ACE_Stream_Node ($2, $3);
}
| ACE_USTREAM ACE_IDENT { $<static_node_>$ = new ACE_Static_Node ($2); } stream_modules
{
$$ = new ACE_Dummy_Node ($<static_node_>3, $4);
}
;
stream_ops
: dynamic
{
}
| static
{
}
;
stream_modules
: '{'
{
// Initialize left context...
$<static_node_>$ = $<static_node_>0;
}
module_list '}'
{
ACE_UNUSED_ARG ($2);
$$ = $3;
}
| /* EMPTY */ { $$ = 0; }
;
module_list
: module_list module
{
if ($2 != 0)
{
$2->link ($1);
$$ = $2;
}
}
| /* EMPTY */ { $$ = 0; }
;
module
: dynamic
{
}
| static
{
ACE_Static_Node *sn = $<static_node_>-1;
ACE_Module_Type *mt = ace_get_module (sn->record (ACE_SVC_CONF_PARAM->config),
$<static_node_>1->name (),
ACE_SVC_CONF_PARAM->yyerrno);
if (((ACE_Stream_Type *) sn->record (ACE_SVC_CONF_PARAM->config)->type ())->push (mt) == -1)
{
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("Problem with static\n")));
ACE_SVC_CONF_PARAM->yyerrno++;
}
}
| suspend
{
ACE_Static_Node *sn = $<static_node_>-1;
ACE_Module_Type *mt = ace_get_module (sn->record (ACE_SVC_CONF_PARAM->config),
sn->name (),
ACE_SVC_CONF_PARAM->yyerrno);
if (mt != 0)
mt->suspend ();
}
| resume
{
ACE_Static_Node *sn = $<static_node_>-1;
ACE_Module_Type *mt = ace_get_module (sn->record (ACE_SVC_CONF_PARAM->config),
$<static_node_>1->name (),
ACE_SVC_CONF_PARAM->yyerrno);
if (mt != 0)
mt->resume ();
}
| remove
{
ACE_Static_Node *stream = $<static_node_>-1;
ACE_Static_Node *module = $<static_node_>1;
ACE_Module_Type *mt = ace_get_module (stream->record (ACE_SVC_CONF_PARAM->config),
module->name (),
ACE_SVC_CONF_PARAM->yyerrno);
ACE_Stream_Type *st =
dynamic_cast<ACE_Stream_Type *> (const_cast<ACE_Service_Type_Impl *> (stream->record (ACE_SVC_CONF_PARAM->config)->type ()));
if (!st || (mt != 0 && st->remove (mt) == -1))
{
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("cannot remove Module_Type %s from STREAM_Type %s\n"),
module->name (),
stream->name ()));
ACE_SVC_CONF_PARAM->yyerrno++;
}
}
;
svc_location
: ACE_IDENT type svc_initializer status
{
$$ = new ACE_Service_Type_Factory ($1, $2, $3, $4);
}
;
status
: ACE_ACTIVE
{
$$ = 1;
}
| ACE_INACTIVE
{
$$ = 0;
}
| /* EMPTY */
{
$$ = 1;
}
;
svc_initializer
: pathname ':' ACE_IDENT
{
$$ = new ACE_Object_Node ($1, $3);
}
| pathname ':' ACE_IDENT '(' ')'
{
$$ = new ACE_Function_Node ($1, $3);
}
| ':' ACE_IDENT '(' ')'
{
$$ = new ACE_Static_Function_Node ($2);
}
;
type
: ACE_MODULE_T '*'
{
$$ = ACE_MODULE_T;
}
| ACE_SVC_OBJ_T '*'
{
$$ = ACE_SVC_OBJ_T;
}
| ACE_STREAM_T '*'
{
$$ = ACE_STREAM_T;
}
;
parameters_opt
: ACE_STRING
| /* EMPTY */ { $$ = 0; }
;
pathname
: ACE_PATHNAME
| ACE_IDENT
| ACE_STRING
;
%%
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// Prints the error string to standard output. Cleans up the error
// messages.
void
yyerror (int yyerrno, int yylineno, ACE_TCHAR const * s)
{
#if defined (ACE_NLOGGING)
ACE_UNUSED_ARG (yyerrno);
ACE_UNUSED_ARG (yylineno);
ACE_UNUSED_ARG (s);
#endif /* ACE_NLOGGING */
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("ACE (%P|%t) [error %d] on line %d: %C\n"),
yyerrno,
yylineno,
s));
}
void
yyerror (ACE_TCHAR const * s)
{
yyerror (-1, -1, s);
}
// Note that SRC_REC represents left context, which is the STREAM *
// record.
static ACE_Module_Type *
ace_get_module (ACE_Service_Type const * sr,
ACE_TCHAR const * svc_name,
int & yyerrno)
{
ACE_Service_Type_Impl const * const type = sr->type ();
ACE_Stream_Type const * const st =
(sr == 0
? 0
: dynamic_cast<ACE_Stream_Type const *> (type));
ACE_Module_Type const * const mt = (st == 0 ? 0 : st->find (svc_name));
if (sr == 0 || st == 0 || mt == 0)
{
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("cannot locate Module_Type %s ")
ACE_TEXT ("in STREAM_Type %s\n"),
svc_name,
(sr ? sr->name () : ACE_TEXT ("(nil)"))));
++yyerrno;
}
return const_cast<ACE_Module_Type *> (mt);
}
#if defined (SVC_CONF_Y_DEBUGGING)
// Main driver program.
int
ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
ACE_Svc_Conf_Param param (0, stdin);
// Try to reopen any filename argument to use YYIN.
if (argc > 1 && (yyin = freopen (argv[1], "r", stdin)) == 0)
(void) ACE_OS::fprintf (stderr, ACE_TEXT ("usage: %s [file]\n"), argv[0]), ACE_OS::exit (1);
return ::yyparse (&param);
}
#endif /* SVC_CONF_Y_DEBUGGING */
ACE_END_VERSIONED_NAMESPACE_DECL
#endif /* ACE_USES_CLASSIC_SVC_CONF == 1 */
+49 -63
View File
@@ -1,4 +1,4 @@
// $Id: TSS_T.cpp 84282 2009-01-30 15:04:29Z msmit $
// $Id: TSS_T.cpp 91136 2010-07-20 08:56:37Z vzykov $
#ifndef ACE_TSS_T_CPP
#define ACE_TSS_T_CPP
@@ -26,12 +26,28 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_TSS)
#if defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION))
# if defined (ACE_HAS_THR_C_DEST)
extern "C" void ACE_TSS_C_cleanup (void *); // defined in Synch.cpp
# endif /* ACE_HAS_THR_C_DEST */
#endif /* defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION)) */
template <class TYPE>
ACE_TSS<TYPE>::~ACE_TSS (void)
{
#if defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION))
if (this->once_)
{
# if defined (ACE_HAS_THR_C_DEST)
ACE_TSS_Adapter *tss_adapter = this->ts_value ();
this->ts_value (0);
ACE_TSS_C_cleanup (tss_adapter);
# else
TYPE *ts_obj = this->ts_value ();
this->ts_value (0);
ACE_TSS<TYPE>::cleanup (ts_obj);
# endif /* ACE_HAS_THR_C_DEST */
ACE_OS::thr_key_detach (this->key_, this);
ACE_OS::thr_keyfree (this->key_);
}
@@ -79,9 +95,6 @@ ACE_TSS<TYPE>::dump (void) const
}
#if defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION))
#if defined (ACE_HAS_THR_C_DEST)
extern "C" void ACE_TSS_C_cleanup (void *); // defined in Synch.cpp
#endif /* ACE_HAS_THR_C_DEST */
template <class TYPE> void
ACE_TSS<TYPE>::cleanup (void *ptr)
@@ -158,20 +171,12 @@ ACE_TSS<TYPE>::ACE_TSS (TYPE *ts_obj)
ACE_TSS<TYPE>::cleanup));
// Put the adapter in thread specific storage
if (ACE_Thread::setspecific (this->key_,
(void *) tss_adapter) != 0)
if (this->ts_value (tss_adapter) == -1)
{
delete tss_adapter;
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("ACE_Thread::setspecific() failed!")));
}
#else
if (ACE_Thread::setspecific (this->key_,
(void *) ts_obj) != 0)
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("ACE_Thread::setspecific() failed!")));
this->ts_value (ts_obj);
#endif /* ACE_HAS_THR_C_DEST */
}
}
@@ -190,23 +195,21 @@ ACE_TSS<TYPE>::ts_get (void) const
TYPE *ts_obj = 0;
#if defined (ACE_HAS_THR_C_DEST)
ACE_TSS_Adapter *tss_adapter = 0;
ACE_TSS_Adapter *tss_adapter = this->ts_value ();
ACE_TSS_Adapter *fake_tss_adapter = 0;
// Get the adapter from thread-specific storage
void *temp = tss_adapter; // Need this temp to keep G++ from complaining.
if (ACE_Thread::getspecific (this->key_, &temp) == -1)
return 0; // This should not happen!
tss_adapter = static_cast <ACE_TSS_Adapter *> (temp);
// If tss_adapter is not 0 but its ts_obj_ is 0 then we still need to create
// a proper ts_obj. That's the intent of this member function.
if (tss_adapter != 0 && tss_adapter->ts_obj_ == 0)
{
fake_tss_adapter = tss_adapter;
tss_adapter = 0;
}
// Check to see if this is the first time in for this thread.
if (tss_adapter == 0)
#else
// Get the ts_obj from thread-specific storage. Note that no locks
// are required here...
void *temp = ts_obj; // Need this temp to keep G++ from complaining.
if (ACE_Thread::getspecific (this->key_, &temp) == -1)
return 0; // This should not happen!
ts_obj = static_cast <TYPE *> (temp);
ts_obj = this->ts_value ();
// Check to see if this is the first time in for this thread.
if (ts_obj == 0)
@@ -228,8 +231,7 @@ ACE_TSS<TYPE>::ts_get (void) const
ACE_TSS<TYPE>::cleanup), 0);
// Put the adapter in thread specific storage
if (ACE_Thread::setspecific (this->key_,
(void *) tss_adapter) != 0)
if (this->ts_value (tss_adapter) == -1)
{
delete tss_adapter;
delete ts_obj;
@@ -238,8 +240,7 @@ ACE_TSS<TYPE>::ts_get (void) const
#else
// Store the dynamically allocated pointer in thread-specific
// storage.
if (ACE_Thread::setspecific (this->key_,
(void *) ts_obj) != 0)
if (this->ts_value (ts_obj) == -1)
{
delete ts_obj;
return 0; // Major problems, this should *never* happen!
@@ -248,6 +249,8 @@ ACE_TSS<TYPE>::ts_get (void) const
}
#if defined (ACE_HAS_THR_C_DEST)
// Delete the adapter that didn't actually have a real ts_obj.
delete fake_tss_adapter;
// Return the underlying ts object.
return static_cast <TYPE *> (tss_adapter->ts_obj_);
#else
@@ -268,28 +271,15 @@ ACE_TSS<TYPE>::ts_object (void) const
TYPE *ts_obj = 0;
#if defined (ACE_HAS_THR_C_DEST)
ACE_TSS_Adapter *tss_adapter = 0;
ACE_TSS_Adapter *tss_adapter = this->ts_value ();
// Get the tss adapter from thread-specific storage
void *temp = tss_adapter; // Need this temp to keep G++ from complaining.
if (ACE_Thread::getspecific (this->key_, &temp) == -1)
{
return 0; // This should not happen!
}
else
{
tss_adapter = static_cast <ACE_TSS_Adapter *> (temp);
{
if (tss_adapter != 0)
{
// Extract the real TS object.
ts_obj = static_cast <TYPE *> (tss_adapter->ts_obj_);
}
}
#else
void *temp = ts_obj; // Need this temp to keep G++ from complaining.
if (ACE_Thread::getspecific (this->key_, &temp) == -1)
return 0; // This should not happen!
ts_obj = static_cast <TYPE *> (temp);
ts_obj = this->ts_value ();
#endif /* ACE_HAS_THR_C_DEST */
return ts_obj;
@@ -311,37 +301,33 @@ ACE_TSS<TYPE>::ts_object (TYPE *new_ts_obj)
TYPE *ts_obj = 0;
#if defined (ACE_HAS_THR_C_DEST)
ACE_TSS_Adapter *tss_adapter = 0;
void *temp = tss_adapter; // Need this temp to keep G++ from complaining.
if (ACE_Thread::getspecific (this->key_, &temp) == -1)
return 0; // This should not happen!
tss_adapter = static_cast <ACE_TSS_Adapter *> (temp);
ACE_TSS_Adapter *tss_adapter = this->ts_value ();
if (tss_adapter != 0)
{
ts_obj = static_cast <TYPE *> (tss_adapter->ts_obj_);
delete tss_adapter; // don't need this anymore
// Don't delete tss_adapter yet. It can be double-deleted
// in case setspecific below fails.
}
ACE_NEW_RETURN (tss_adapter,
ACE_TSS_Adapter *new_tss_adapter = 0;
ACE_NEW_RETURN (new_tss_adapter,
ACE_TSS_Adapter ((void *) new_ts_obj,
ACE_TSS<TYPE>::cleanup),
0);
if (ACE_Thread::setspecific (this->key_,
(void *) tss_adapter) == -1)
if (this->ts_value (new_tss_adapter) == -1)
{
delete new_tss_adapter;
}
else
{
// Now it's fine to delete the old tss_adapter.
delete tss_adapter;
return ts_obj; // This should not happen!
}
#else
void *temp = ts_obj; // Need this temp to keep G++ from complaining.
if (ACE_Thread::getspecific (this->key_, &temp) == -1)
return 0; // This should not happen!
ts_obj = static_cast <TYPE *> (temp);
if (ACE_Thread::setspecific (this->key_, (void *) new_ts_obj) == -1)
return ts_obj; // This should not happen!
ts_obj = this->ts_value ();
this->ts_value (new_ts_obj);
#endif /* ACE_HAS_THR_C_DEST */
return ts_obj;
+19 -1
View File
@@ -4,7 +4,7 @@
/**
* @file TSS_T.h
*
* $Id: TSS_T.h 80826 2008-03-04 14:51:23Z wotte $
* $Id: TSS_T.h 91124 2010-07-19 11:54:35Z vzykov $
*
* Moved from Synch.h.
*
@@ -39,6 +39,10 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
#if defined (ACE_HAS_THR_C_DEST)
class ACE_TSS_Adapter;
#endif
/**
* @class ACE_TSS
*
@@ -193,6 +197,20 @@ protected:
/// "Destructor" that deletes internal TYPE * when thread exits.
static void cleanup (void *ptr);
/// Obtains a plain value stored in the thread-specific storage.
# if defined (ACE_HAS_THR_C_DEST)
ACE_TSS_Adapter *ts_value (void) const;
# else
TYPE *ts_value (void) const;
# endif /* ACE_HAS_THR_C_DEST */
/// Stores a new plain value in the thread-specific storage.
# if defined (ACE_HAS_THR_C_DEST)
int ts_value (ACE_TSS_Adapter *new_tss_adapter) const;
# else
int ts_value (TYPE *new_ts_obj) const;
# endif /* ACE_HAS_THR_C_DEST */
#endif /* defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION)) */
// = Disallow copying...
ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_TSS<TYPE> &))
+64 -3
View File
@@ -1,11 +1,14 @@
// -*- C++ -*-
//
// $Id: TSS_T.inl 80826 2008-03-04 14:51:23Z wotte $
// $Id: TSS_T.inl 91124 2010-07-19 11:54:35Z vzykov $
#if !(defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION)))
#include "ace/Thread.h"
#include "ace/Log_Msg.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
#if !(defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION)))
template <class TYPE> ACE_INLINE
ACE_TSS<TYPE>::ACE_TSS (TYPE *type)
: type_ (type)
@@ -37,6 +40,64 @@ ACE_TSS<TYPE>::ts_get (void) const
return this->type_;
}
ACE_END_VERSIONED_NAMESPACE_DECL
#else
# if defined (ACE_HAS_THR_C_DEST)
template <class TYPE> ACE_INLINE ACE_TSS_Adapter *
ACE_TSS<TYPE>::ts_value (void) const
{
// Get the tss adapter from thread-specific storage
void *temp = 0;
if (ACE_Thread::getspecific (this->key_, &temp) == -1)
{
return 0; // This should not happen!
}
return static_cast <ACE_TSS_Adapter *> (temp);
}
# else
template <class TYPE> ACE_INLINE TYPE *
ACE_TSS<TYPE>::ts_value (void) const
{
void *temp = 0;
if (ACE_Thread::getspecific (this->key_, &temp) == -1)
{
return 0; // This should not happen!
}
return static_cast <TYPE *> (temp);
}
# endif /* ACE_HAS_THR_C_DEST */
# if defined (ACE_HAS_THR_C_DEST)
template <class TYPE> ACE_INLINE int
ACE_TSS<TYPE>::ts_value (ACE_TSS_Adapter *new_tss_adapter) const
{
if (ACE_Thread::setspecific (this->key_,
(void *) new_tss_adapter) != 0)
{
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("ACE_Thread::setspecific() failed!")));
return -1;
}
return 0;
}
# else
template <class TYPE> ACE_INLINE int
ACE_TSS<TYPE>::ts_value (TYPE *new_ts_obj) const
{
if (ACE_Thread::setspecific (this->key_, (void *) new_ts_obj) != 0)
{
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("ACE_Thread::setspecific() failed!")));
return -1;
}
return 0;
}
# endif /* ACE_HAS_THR_C_DEST */
#endif /* ! (defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION))) */
ACE_END_VERSIONED_NAMESPACE_DECL
+10 -10
View File
@@ -4,7 +4,7 @@
/**
* @file Task.h
*
* $Id: Task.h 80826 2008-03-04 14:51:23Z wotte $
* $Id: Task.h 91058 2010-07-12 08:20:09Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -84,21 +84,21 @@ public:
/**
* Hook called from ACE_Thread_Exit when during thread exit and from
* the default implementation of <module_closed>. In general, this
* the default implementation of @c module_closed(). In general, this
* method shouldn't be called directly by an application,
* particularly if the <Task> is running as an Active Object.
* Instead, a special message should be passed into the <Task> via
* the <put> method defined below, and the <svc> method should
* interpret this as a flag to shut down the <Task>.
* particularly if the Task is running as an Active Object.
* Instead, a special message should be passed into the Task via
* the put() method defined below, and the svc() method should
* interpret this as a flag to shut down the Task.
*/
virtual int close (u_long flags = 0);
/**
* Hook called during <ACE_Module::close>. The default
* Hook called during ACE_Module::close(). The default
* implementation calls forwards the call to close(1). Please
* notice the changed value of the default argument of <close>.
* notice the changed value of the default argument of close().
* This allows tasks to differ between the call has been originated
* from <ACE_Thread_Exit> or from <module_closed>. Be aware that
* from ACE_Thread_Exit or from module_closed(). Be aware that
* close(0) will be also called when a thread associated with the
* ACE_Task instance exits.
*/
@@ -111,7 +111,7 @@ public:
/// A hook method that can be used to pass a message to a
/// task, where it can be processed immediately or queued for subsequent
/// processing in the <svc> hook method.
/// processing in the svc() hook method.
virtual int put (ACE_Message_Block *, ACE_Time_Value * = 0);
/// Run by a daemon thread to handle deferred processing.
+4 -4
View File
@@ -4,7 +4,7 @@
/**
* @file Task_T.h
*
* $Id: Task_T.h 80826 2008-03-04 14:51:23Z wotte $
* $Id: Task_T.h 91016 2010-07-06 11:29:50Z johnnyw $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -96,13 +96,13 @@ public: // Should be protected:
* the stream. To do this, the message is put onto the task next in
* the stream after this task's sibling.
*
* @param ACE_Message_Block Pointer to the block that is used in the reply.
* @param timeout The absolute time at which the put operation used to
* @param mb Pointer to the block that is used in the reply.
* @param tv The absolute time at which the put operation used to
* send the message block to the next module in the stream
* will time out. If 0, this call blocks until it can be
* completed.
*/
int reply (ACE_Message_Block *, ACE_Time_Value *timeout = 0);
int reply (ACE_Message_Block *mb, ACE_Time_Value *tv = 0);
/**
* Transfer message to the adjacent ACE_Task in a ACE_Stream. Note
+24 -1
View File
@@ -4,7 +4,7 @@
/**
* @file Time_Value.h
*
* $Id: Time_Value.h 89121 2010-02-22 14:48:31Z schmidt $
* $Id: Time_Value.h 90683 2010-06-17 22:07:42Z shuston $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -126,6 +126,17 @@ public:
*/
unsigned long msec (void) const;
/// Converts from ACE_Time_Value format into milliseconds format.
/**
* @return Sum of second field (in milliseconds) and microsecond field
* (in milliseconds).
*
* @note The semantics of this method differs from the sec() and
* usec() methods. There is no analogous "millisecond"
* component in an ACE_Time_Value.
*/
ACE_UINT64 get_msec () const;
/// Converts from ACE_Time_Value format into milliseconds format.
/**
* @return Sum of second field (in milliseconds) and microsecond field
@@ -134,6 +145,8 @@ public:
* @note The semantics of this method differs from the sec() and
* usec() methods. There is no analogous "millisecond"
* component in an ACE_Time_Value.
*
* @deprecated Use get_msec() instead.
*/
void msec (ACE_UINT64 &ms) const;
@@ -145,9 +158,19 @@ public:
* @note The semantics of this method differs from the sec() and
* usec() methods. There is no analogous "millisecond"
* component in an ACE_Time_Value.
*
* @deprecated Use get_msec() instead.
*/
void msec (ACE_UINT64 &ms) /* const */;
/// Converts from milli-seconds format into ACE_Time_Value format.
/**
* @note The semantics of this method differs from the sec() and
* usec() methods. There is no analogous "millisecond"
* component in an ACE_Time_Value.
*/
void set_msec (const ACE_UINT64 &ms);
/// Converts from milli-seconds format into ACE_Time_Value format.
/**
* @note The semantics of this method differs from the sec() and
+23 -4
View File
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
// $Id: Time_Value.inl 88502 2010-01-12 19:53:17Z olli $
// $Id: Time_Value.inl 90689 2010-06-18 11:14:47Z shuston $
#include "ace/Truncate.h"
@@ -147,13 +147,21 @@ ACE_Time_Value::msec (void) const
return ACE_Utils::truncate_cast<unsigned long> (secs);
}
ACE_INLINE ACE_UINT64
ACE_Time_Value::get_msec () const
{
// ACE_OS_TRACE ("ACE_Time_Value::get_msec");
ACE_UINT64 ms = ACE_Utils::truncate_cast<ACE_UINT64> (this->tv_.tv_sec);
ms *= 1000;
ms += (this->tv_.tv_usec / 1000);
return ms;
}
ACE_INLINE void
ACE_Time_Value::msec (ACE_UINT64 &ms) const
{
// ACE_OS_TRACE ("ACE_Time_Value::msec");
ms = ACE_Utils::truncate_cast<ACE_UINT64> (this->tv_.tv_sec);
ms *= 1000;
ms += (this->tv_.tv_usec / 1000);
ms = this->get_msec ();
}
ACE_INLINE void
@@ -164,6 +172,17 @@ ACE_Time_Value::msec (ACE_UINT64 &ms) /*const*/
tv->msec (ms);
}
ACE_INLINE void
ACE_Time_Value::set_msec (const ACE_UINT64 &ms)
{
// ACE_OS_TRACE ("ACE_Time_Value::set_msec");
// Convert millisecond units to seconds;
ACE_UINT64 secs = ms / 1000;
this->tv_.tv_sec = static_cast<long> (secs);
// Convert remainder to microseconds;
this->tv_.tv_usec = static_cast<long>((ms - (secs * 1000)) * 1000);
}
/// Converts from milli-seconds format into Time_Value format.
ACE_INLINE void
ACE_Time_Value::msec (long milliseconds)
+4 -4
View File
@@ -1,9 +1,9 @@
// -*- C++ -*-
// $Id: Version.h 90351 2010-05-31 07:06:15Z johnnyw $
// $Id: Version.h 91247 2010-08-01 09:46:33Z johnnyw $
// This is file was automatically generated by \$ACE_ROOT/bin/make_release.
#define ACE_MAJOR_VERSION 5
#define ACE_MINOR_VERSION 7
#define ACE_BETA_VERSION 9
#define ACE_VERSION "5.7.9"
#define ACE_MINOR_VERSION 8
#define ACE_BETA_VERSION 1
#define ACE_VERSION "5.8.1"
Binary file not shown.
+3 -1
View File
@@ -6,7 +6,7 @@
*
* @file config-doxygen.h
*
* $Id: config-doxygen.h 84610 2009-02-26 10:26:09Z johnnyw $
* $Id: config-doxygen.h 91101 2010-07-15 09:49:28Z johnnyw $
*
* @author Carlos O'Ryan <coryan@uci.edu>
* @author Darrell Brunsch <brunsch@uci.edu>
@@ -123,4 +123,6 @@
#define TAO_BEGIN_VERSIONED_NAMESPACE_DECL
#define TAO_END_VERSIONED_NAMESPACE_DECL
#define ACE_HAS_POSITION_INDEPENDENT_POINTERS 1
#endif /* ACE_CONFIG_DOXYGEN_H */
+18
View File
@@ -0,0 +1,18 @@
// -*- C++ -*-
// $Id: config-irix6.5.x-sgic++.h 80826 2008-03-04 14:51:23Z wotte $
// Use this file for IRIX 6.5.x
#ifndef ACE_CONFIG_IRIX65X_H
#define ACE_CONFIG_IRIX65X_H
#include /**/ "ace/pre.h"
// Include IRIX 6.[234] configuration
#include "ace/config-irix6.x-sgic++.h"
// Irix 6.5 man pages show that they exist
#undef ACE_LACKS_CONDATTR_PSHARED
#undef ACE_LACKS_MUTEXATTR_PSHARED
#include /**/ "ace/post.h"
#endif /* ACE_CONFIG_IRIX65X_H */
+254
View File
@@ -0,0 +1,254 @@
/* -*- C++ -*- */
//
// $Id: config-irix6.x-common.h 87167 2009-10-19 19:33:53Z olli $
//
// This file contains the common configuration options for both
// SGI/MIPSPro C++ and g++ under IRIX 6.X
//
// For IRIX 6.2 there are several patches that should be applied to
// get reliable operation with multi-threading and exceptions.
// Specifically you should get a reasonable current IRIX, Compiler
// and POSIX patch-sets.
// For IRIX 6.[34] it's less critical, but it's still recommended
// that you apply the applicable patch-sets (IRIX and Compiler I believe).
// These patches are updated frequently, so you should ask your support
// contact or search SGI's web site (http://www.sgi.com) for the latest
// version.
// Use this file for IRIX 6.[234] if you have the pthreads patches
// installed.
#ifndef ACE_CONFIG_IRIX6X_COMMON_H
#ifndef IRIX6
# define IRIX6
#endif
#if ! defined(ACE_CONFIG_H)
#error "This file may only be included by config-irix6.x-sgic++.h, config-irix6.x-kcc.h or config-irix6.x-g++.h"
#endif
// The Irix 6.x float.h doesn't allow us to distinguish between a
// double and a long double. So, we have to hard-code this. Thanks
// to Bob Laferriere <[email protected]> for figuring it out.
#if defined (_MIPS_SIM) /* 6.X System */
# include <sgidefs.h>
# if defined (__GNUC__)
# define ACE_SIZEOF_LONG_DOUBLE 16
# elif defined (_MIPS_SIM_NABI32) && (_MIPS_SIM == _MIPS_SIM_NABI32)
# define ACE_SIZEOF_LONG_DOUBLE 16
# elif defined (_MIPS_SIM_ABI32) && (_MIPS_SIM == _MIPS_SIM_ABI32)
# define ACE_SIZEOF_LONG_DOUBLE 8
# elif defined (_MIPS_SIM_ABI64) && (_MIPS_SIM == _MIPS_SIM_ABI64)
# define ACE_SIZEOF_LONG_DOUBLE 16
# elif !defined (ACE_SIZEOF_LONG_DOUBLE)
# define ACE_SIZEOF_LONG_DOUBLE 8
# endif
#else
# define ACE_SIZEOF_LONG_DOUBLE 8 /* 5.3 System */
#endif
// petern, Next part of it:
// Platform supports getpagesize() call.
#define ACE_HAS_GETPAGESIZE
// Platform has no implementation of pthread_condattr_setpshared(),
// even though it supports pthreads! (like Irix 6.2)
#define ACE_LACKS_CONDATTR_PSHARED
#define ACE_LACKS_MUTEXATTR_PSHARED
#define ACE_LACKS_SUSECONDS_T
// Platform/compiler has the sigwait(2) prototype
#define ACE_HAS_SIGWAIT
#define ACE_HAS_SIGTIMEDWAIT
#define ACE_HAS_SIGSUSPEND
// Platform supports System V IPC (most versions of UNIX, but not Win32)
#define ACE_HAS_SYSV_IPC
// Platform requires void * for mmap().
#define ACE_HAS_VOIDPTR_MMAP
// Platform supports recvmsg and sendmsg.
#define ACE_HAS_MSG
// Compiler/platform contains the <sys/syscall.h> file.
#define ACE_HAS_SYS_SYSCALL_H
// Compiler/platform supports alloca()
// Although ACE does have alloca() on this compiler/platform combination, it is
// disabled by default since it can be dangerous. Uncomment the following line
// if you ACE to use it.
//#define ACE_HAS_ALLOCA
// Compiler/platform has <alloca.h>
#define ACE_HAS_ALLOCA_H
// Irix needs to define bzero() in this odd file <bstring.h>
#define ACE_HAS_BSTRING
// Compiler/platform has the getrusage() system call.
#define ACE_HAS_GETRUSAGE
// Platform supports POSIX O_NONBLOCK semantics.
#define ACE_HAS_POSIX_NONBLOCK
// Compiler/platform has correctly prototyped header files.
#define ACE_HAS_CPLUSPLUS_HEADERS
// Platform contains <poll.h>.
#define ACE_HAS_POLL
// Platform supports the /proc file system.
#define ACE_HAS_PROC_FS
// Compiler/platform defines the sig_atomic_t typedef.
#define ACE_HAS_SIG_ATOMIC_T
// Platform supports SVR4 extended signals.
#define ACE_HAS_SIGINFO_T
#define ACE_HAS_UCONTEXT_T
// Compiler supports the ssize_t typedef.
#define ACE_HAS_SSIZE_T
// Platform supports STREAMS.
#define ACE_HAS_STREAMS
// Compiler/platform supports struct strbuf.
#define ACE_HAS_STRBUF_T
// Compiler/platform supports SVR4 dynamic linking semantics.
#define ACE_HAS_SVR4_DYNAMIC_LINKING
// Platform provides <sys/filio.h> header.
#define ACE_HAS_SYS_FILIO_H
// Compiler/platform defines a union semun for SysV shared memory.
#define ACE_HAS_SEMUN
// Platform supports IP multicast
#define ACE_HAS_IP_MULTICAST
#ifdef ACE_LACKS_PERFECT_MULTICAST_FILTERING
#undef ACE_LACKS_PERFECT_MULTICAST_FILTERING
#endif
#define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1
//**************************************************************
// Not so sure how next lines should look like
// Platform supports POSIX timers via timestruc_t.
#define ACE_HAS_POSIX_TIME
//**************************************************************
// IRIX 6.4 and below do not support reentrant netdb functions
// (getprotobyname_r, getprotobynumber_r, gethostbyaddr_r,
// gethostbyname_r, getservbyname_r).
#if (ACE_IRIX_VERS <= 64) && !defined (ACE_HAS_NETDB_REENTRANT_FUNCTIONS)
#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS
#endif /* ACE_HAS_NETDB_REENTRANT_FUNCTIONS */
#define ACE_HAS_DIRENT
// Unless the thread enabled version is used the readdir_r interface
// does not get defined in IRIX 6.2
#define ACE_LACKS_READDIR_R
#define ACE_LACKS_RWLOCK_T
#define ACE_HAS_GPERF
#define ACE_HAS_NONCONST_SELECT_TIMEVAL
#define ACE_HAS_BROKEN_DGRAM_SENDV
#define ACE_LACKS_PLACEMENT_OPERATOR_DELETE
#define ACE_PI_CONTROL_BLOCK_ALIGN_LONGS 2
// Platform has POSIX terminal interface.
#define ACE_HAS_TERMIOS
// IRIX 6.5 supports AIO
#define ACE_HAS_AIO_CALLS
#define ACE_POSIX_AIOCB_PROACTOR
#define ACE_HAS_SGIDLADD
#define ACE_HAS_P_READ_WRITE
#define ACE_LACKS_LINEBUFFERED_STREAMBUF
#define ACE_LACKS_STDINT_H
#define ACE_HAS_SYSENT_H
#define ACE_HAS_SYSV_SYSINFO
#define ACE_HAS_SYS_SYSTEMINFO_H
// Platform has support for multi-byte character support compliant
// with the XPG4 Worldwide Portability Interface wide-character
// classification.
#define ACE_HAS_XPG4_MULTIBYTE_CHAR
// We need to setup a very high address or Naming_Test won't run.
#define ACE_DEFAULT_BASE_ADDR ((char *) (1024U * 1024 * 1024))
#define ACE_LACKS_SIGNED_CHAR
// Platform supports reentrant functions (i.e., all the POSIX *_r
// functions).
#define ACE_HAS_REENTRANT_FUNCTIONS
// Optimize ACE_Handle_Set for select().
#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
// Platform does not support reentrant password file accessor functiions.
#define ACE_LACKS_PWD_REENTRANT_FUNCTIONS
// uses ctime_r & asctime_r with only two parameters vs. three
#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
// Prototypes for both signal() and struct sigaction are consistent.
#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES
#define ACE_HAS_UALARM
// Scheduling functions are declared in <sched.h>
#define ACE_NEEDS_SCHED_H
// Compile using multi-thread libraries by default
#if !defined (ACE_MT_SAFE)
#define ACE_MT_SAFE 1
#endif /* ACE_MT_SAFE */
#if (ACE_MT_SAFE != 0)
// Add threading support
#define ACE_HAS_IRIX62_THREADS
// Needed for the threading stuff?
#include /**/ <task.h>
#define PTHREAD_MIN_PRIORITY PX_PRIO_MIN
#define PTHREAD_MAX_PRIORITY PX_PRIO_MAX
// ACE supports threads.
#define ACE_HAS_THREADS
// Platform has no implementation of pthread_condattr_setpshared(),
// even though it supports pthreads! (like Irix 6.2)
#define ACE_LACKS_CONDATTR_PSHARED
#define ACE_LACKS_MUTEXATTR_PSHARED
// IRIX 6.2 supports a variant of POSIX Pthreads, supposedly POSIX 1c
#define ACE_HAS_PTHREADS
// Compiler/platform has thread-specific storage
#define ACE_HAS_THREAD_SPECIFIC_STORAGE
// The pthread_cond_timedwait call does not reset the timer.
#define ACE_LACKS_COND_TIMEDWAIT_RESET 1
// When threads are enabled READDIR_R is supported on IRIX.
#undef ACE_LACKS_READDIR_R
#endif /* (ACE_MT_SAFE == 0) */
#endif /* ACE_CONFIG_IRIX6X_COMMON_H */
+15
View File
@@ -0,0 +1,15 @@
/* -*- C++ -*- */
// $Id: config-irix6.x-g++.h 87268 2009-10-29 21:06:06Z olli $
// The following configuration file is designed to work for the SGI
// Indigo2EX running Irix 6.2 platform using the GNU C++ Compiler
#ifndef ACE_CONFIG_H
#define ACE_CONFIG_H
#include /**/ "ace/pre.h"
#include "ace/config-g++-common.h"
#include "ace/config-irix6.x-common.h"
#include /**/ "ace/post.h"
#endif /* ACE_CONFIG_H */
+36
View File
@@ -0,0 +1,36 @@
/* -*- C++ -*- */
// $Id: config-irix6.x-sgic++.h 81935 2008-06-12 22:01:53Z jtc $
// Use this file for IRIX 6.[234] if you have the pthreads patches
// installed.
#ifndef ACE_CONFIG_H
#define ACE_CONFIG_H
#include /**/ "ace/pre.h"
#include "ace/config-irix6.x-common.h"
// This is the config file for IRIX 6.2, 6.4 and hopefully 6.3, using
// the SGI C++ compiler (7.1 or higher).
// The following three should be enabled/disabled together.
#if _COMPILER_VERSION < 720
#define ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA
#endif /* _COMPILER_VERSION < 720 */
#define ACE_TEMPLATES_REQUIRE_SOURCE
#define ACE_NEEDS_FUNC_DEFINITIONS
// Platform supports STREAM pipes (note that this is disabled by
// default, see the manual page on pipe(2) to find out how to enable
// it).
// #define ACE_HAS_STREAM_PIPES
#if defined (_COMPILER_VERSION)
# define ACE_CC_NAME ACE_TEXT ("SGI/MIPSPro")
# define ACE_CC_MAJOR_VERSION (_COMPILER_VERSION / 100)
# define ACE_CC_MINOR_VERSION (_COMPILER_VERSION % 100)
# define ACE_CC_BETA_VERSION (0)
#endif /* _COMPILER_VERSION */
#include /**/ "ace/post.h"
#endif /* ACE_CONFIG_H */
+9 -2
View File
@@ -1,10 +1,17 @@
// $Id: config-macosx-snowleopard.h 87236 2009-10-27 08:21:42Z wotte $
// $Id: config-macosx-snowleopard.h 91093 2010-07-15 09:12:20Z wotte $
#ifndef ACE_CONFIG_MACOSX_SNOWLEOPARD_H
#define ACE_CONFIG_MACOSX_SNOWLEOPARD_H
#include "ace/config-macosx-leopard.h"
#ifdef __clang__
#ifdef ACE_HAS_GCC_ATOMIC_BUILTINS
#undef ACE_HAS_GCC_ATOMIC_BUILTINS
#endif
#endif
// This header has been deprecated in Snow Leopard.
#define ACE_LACKS_UCONTEXT_H
#endif ACE_CONFIG_MACOSX_SNOWLEOPARD_H
#endif // ACE_CONFIG_MACOSX_SNOWLEOPARD_H
+12
View File
@@ -0,0 +1,12 @@
/* -*- C++ -*- */
// $Id: config-sco-5.0.0-nothread.h 87268 2009-10-29 21:06:06Z olli $
#ifndef ACE_CONFIG_H
#define ACE_CONFIG_H
#include /**/ "ace/pre.h"
#include "ace/config-g++-common.h"
#include "ace/config-sco-5.0.0.h"
#include /**/ "ace/post.h"
#endif /* ACE_CONFIG_H */
+176
View File
@@ -0,0 +1,176 @@
/* -*- C++ -*- */
// $Id: config-sunos5.4-g++.h 87268 2009-10-29 21:06:06Z olli $
// The following configuration file is designed to work for SunOS 5.4
// platforms using the GNU g++ compiler.
#ifndef ACE_CONFIG_H
#define ACE_CONFIG_H
#include /**/ "ace/pre.h"
#if ! defined (__ACE_INLINE__)
# define __ACE_INLINE__
#endif /* ! __ACE_INLINE__ */
// config-g++-common.h undef's ACE_HAS_STRING_CLASS with -frepo, so
// this must appear before its #include.
#define ACE_HAS_STRING_CLASS
#include "ace/config-g++-common.h"
#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
// Platform supports pread() and pwrite()
#define ACE_HAS_P_READ_WRITE
#define ACE_HAS_XPG4_MULTIBYTE_CHAR
// Platform has POSIX terminal interface.
#define ACE_HAS_TERMIOS
// Platform supports System V IPC (most versions of UNIX, but not Win32)
#define ACE_HAS_SYSV_IPC
// Sun has the wrong prototype for sendmsg.
#define ACE_HAS_NONCONST_SENDMSG
// The SunOS 5.x version of rand_r is inconsistent with the header files...
#define ACE_HAS_BROKEN_RANDR
// Platform supports system configuration information.
#define ACE_HAS_SYS_SYSTEMINFO_H
#define ACE_HAS_SYSV_SYSINFO
// Platform supports the POSIX regular expression library
#define ACE_HAS_REGEX
// Platform supports recvmsg and sendmsg.
#define ACE_HAS_MSG
// Compiler/platform contains the <sys/syscall.h> file.
#define ACE_HAS_SYS_SYSCALL_H
// Compiler/platform correctly calls init()/fini() for shared libraries.
#define ACE_HAS_AUTOMATIC_INIT_FINI
// Platform supports POSIX O_NONBLOCK semantics.
#define ACE_HAS_POSIX_NONBLOCK
// Compiler/platform has correctly prototyped header files.
#define ACE_HAS_CPLUSPLUS_HEADERS
// Compiler/platform supports SunOS high resolution timers.
#define ACE_HAS_HI_RES_TIMER
// Platform supports IP multicast
#define ACE_HAS_IP_MULTICAST
// Compiler/platform supports alloca()
// Although ACE does have alloca() on this compiler/platform combination, it is
// disabled by default since it can be dangerous. Uncomment the following line
// if you ACE to use it.
//#define ACE_HAS_ALLOCA
// Compiler/platform has <alloca.h>
#define ACE_HAS_ALLOCA_H
// Platform contains <poll.h>.
#define ACE_HAS_POLL
// Platform supports POSIX timers via timestruc_t.
#define ACE_HAS_POSIX_TIME
// Platform supports the /proc file system.
#define ACE_HAS_PROC_FS
// Platform supports the prusage_t struct.
#define ACE_HAS_PRUSAGE_T
// Compiler/platform defines the sig_atomic_t typedef.
#define ACE_HAS_SIG_ATOMIC_T
// Platform supports SVR4 extended signals.
#define ACE_HAS_SIGINFO_T
#define ACE_HAS_UCONTEXT_T
// Compiler/platform provides the sockio.h file.
#define ACE_HAS_SYS_SOCKIO_H
// Compiler supports the ssize_t typedef.
#define ACE_HAS_SSIZE_T
// Platform supports STREAMS.
#define ACE_HAS_STREAMS
// Platform supports STREAM pipes.
#define ACE_HAS_STREAM_PIPES
// Compiler/platform supports struct strbuf.
#define ACE_HAS_STRBUF_T
// Compiler/platform supports SVR4 dynamic linking semantics.
#define ACE_HAS_SVR4_DYNAMIC_LINKING
// Compiler/platform supports SVR4 gettimeofday() prototype.
#define ACE_HAS_SVR4_GETTIMEOFDAY
// Platform lacks pthread_sigaction
#define ACE_LACKS_PTHREAD_THR_SIGSETMASK
// Compiler/platform supports SVR4 TLI (in particular, T_GETNAME stuff)...
#define ACE_HAS_SVR4_TLI
// Platform provides <sys/filio.h> header.
#define ACE_HAS_SYS_FILIO_H
#define ACE_HAS_STRSIGNAL
/* Turn off the following defines if you want to disable threading. */
// Compile using multi-thread libraries.
#if !defined (ACE_MT_SAFE)
# define ACE_MT_SAFE 1
# if !defined (_REENTRANT)
# define _REENTRANT
# endif /* _REENTRANT */
#endif /* !ACE_MT_SAFE */
// Platform supports Solaris threads.
#define ACE_HAS_STHREADS
// Platform supports threads.
#define ACE_HAS_THREADS
// Compiler/platform has thread-specific storage
#define ACE_HAS_THREAD_SPECIFIC_STORAGE
// Platform supports reentrant functions (i.e., all the POSIX *_r functions).
#define ACE_HAS_REENTRANT_FUNCTIONS
/* end threading defines */
#define ACE_HAS_PRIOCNTL
#define ACE_NEEDS_LWP_PRIO_SET
// Platform supports TLI timod STREAMS module.
#define ACE_HAS_TIMOD_H
// Platform supports TLI tiuser header.
#define ACE_HAS_TIUSER_H
// Platform provides TLI function prototypes.
#define ACE_HAS_TLI_PROTOTYPES
// Platform supports TLI.
#define ACE_HAS_TLI
// Use the poll() event demultiplexor rather than select().
//#define ACE_USE_POLL
// Defines the page size of the system.
#define ACE_PAGE_SIZE 4096
#define ACE_HAS_IDTYPE_T
#define ACE_HAS_GPERF
#define ACE_HAS_DIRENT
#include /**/ "ace/post.h"
#endif /* ACE_CONFIG_H */
+186
View File
@@ -0,0 +1,186 @@
/* -*- C++ -*- */
// $Id: config-sunos5.4-sunc++-4.x.h 87250 2009-10-28 11:57:17Z olli $
// The following configuration file is designed to work for SunOS 5.4
// platforms using the SunC++ 4.0.x compiler.
#ifndef ACE_CONFIG_H
#define ACE_CONFIG_H
#include /**/ "ace/pre.h"
#if ! defined (__ACE_INLINE__)
# define __ACE_INLINE__
#endif /* ! __ACE_INLINE__ */
// Optimize ACE_Handle_Set for select().
#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
// Platform supports pread() and pwrite()
#define ACE_HAS_P_READ_WRITE
#define ACE_HAS_XPG4_MULTIBYTE_CHAR
// Platform supports System V IPC (most versions of UNIX, but not Win32)
#define ACE_HAS_SYSV_IPC
// Sun has the wrong prototype for sendmsg.
#define ACE_HAS_NONCONST_SENDMSG
// The SunOS 5.x version of rand_r is inconsistent with the header files...
#define ACE_HAS_BROKEN_RANDR
// Platform supports system configuration information.
#define ACE_HAS_SYS_SYSTEMINFO_H
#define ACE_HAS_SYSV_SYSINFO
// Platform supports the POSIX regular expression library.
#define ACE_HAS_REGEX
// Platform supports recvmsg and sendmsg.
#define ACE_HAS_MSG
// Compiler/platform contains the <sys/syscall.h> file.
#define ACE_HAS_SYS_SYSCALL_H
// Platform has POSIX terminal interface.
#define ACE_HAS_TERMIOS
// Compiler/platform correctly calls init()/fini() for shared libraries.
#define ACE_HAS_AUTOMATIC_INIT_FINI
// Platform supports POSIX O_NONBLOCK semantics.
#define ACE_HAS_POSIX_NONBLOCK
// Compiler/platform has correctly prototyped header files.
#define ACE_HAS_CPLUSPLUS_HEADERS
// Compiler/platform supports SunOS high resolution timers.
#define ACE_HAS_HI_RES_TIMER
// Platform supports IP multicast
#define ACE_HAS_IP_MULTICAST
// Compiler/platform supports alloca()
// Although ACE does have alloca() on this compiler/platform combination, it is
// disabled by default since it can be dangerous. Uncomment the following line
// if you ACE to use it.
//#define ACE_HAS_ALLOCA
// Compiler/platform has <alloca.h>
#define ACE_HAS_ALLOCA_H
// Platform contains <poll.h>.
#define ACE_HAS_POLL
// Platform supports POSIX timers via timestruc_t.
#define ACE_HAS_POSIX_TIME
// Platform supports the /proc file system.
#define ACE_HAS_PROC_FS
// Platform supports the prusage_t struct.
#define ACE_HAS_PRUSAGE_T
// Compiler/platform defines the sig_atomic_t typedef.
#define ACE_HAS_SIG_ATOMIC_T
// Platform supports SVR4 extended signals.
#define ACE_HAS_SIGINFO_T
#define ACE_HAS_UCONTEXT_T
// Compiler/platform provides the sockio.h file.
#define ACE_HAS_SYS_SOCKIO_H
// Compiler supports the ssize_t typedef.
#define ACE_HAS_SSIZE_T
// Platform supports STREAMS.
#define ACE_HAS_STREAMS
// Platform supports STREAM pipes.
#define ACE_HAS_STREAM_PIPES
// Compiler/platform supports struct strbuf.
#define ACE_HAS_STRBUF_T
// Compiler/platform supports SVR4 dynamic linking semantics.
#define ACE_HAS_SVR4_DYNAMIC_LINKING
// Compiler/platform supports SVR4 gettimeofday() prototype.
#define ACE_HAS_SVR4_GETTIMEOFDAY
// Compiler/platform supports SVR4 signal typedef.
#define ACE_HAS_SVR4_SIGNAL_T
// Platform lacks pthread_sigaction
#define ACE_LACKS_PTHREAD_THR_SIGSETMASK
// Compiler/platform supports SVR4 ACE_TLI (in particular, T_GETNAME stuff)...
#define ACE_HAS_SVR4_TLI
// Platform provides <sys/filio.h> header.
#define ACE_HAS_SYS_FILIO_H
#define ACE_HAS_STRSIGNAL
/* Turn off the following defines if you want to disable threading. */
// Compile using multi-thread libraries.
#if !defined (ACE_MT_SAFE)
# define ACE_MT_SAFE 1
#endif
// Platform supports Solaris threads.
#define ACE_HAS_STHREADS
// Platform supports threads.
#define ACE_HAS_THREADS
// Compiler/platform has thread-specific storage
#define ACE_HAS_THREAD_SPECIFIC_STORAGE
// Platform supports reentrant functions (i.e., all the POSIX *_r functions).
#define ACE_HAS_REENTRANT_FUNCTIONS
/* end threading defines */
#define ACE_HAS_PRIOCNTL
#define ACE_NEEDS_LWP_PRIO_SET
// Reactor detects deadlock
// #define ACE_REACTOR_HAS_DEADLOCK_DETECTION
// Platform supports ACE_TLI timod STREAMS module.
#define ACE_HAS_TIMOD_H
// Platform supports ACE_TLI tiuser header.
#define ACE_HAS_TIUSER_H
// Platform provides ACE_TLI function prototypes.
#define ACE_HAS_TLI_PROTOTYPES
// Platform supports ACE_TLI.
#define ACE_HAS_TLI
#define ACE_LACKS_LINEBUFFERED_STREAMBUF
#define ACE_LACKS_SIGNED_CHAR
// Use the poll() event demultiplexor rather than select().
//#define ACE_USE_POLL
#define ACE_NEEDS_DEV_IO_CONVERSION
// Defines the page size of the system.
#define ACE_PAGE_SIZE 4096
#define ACE_HAS_IDTYPE_T
#define ACE_HAS_GPERF
#define ACE_HAS_DIRENT
# if defined (ACE_HAS_EXCEPTIONS)
// If exceptions are enabled and we are using Sun/CC then
// <operator new> throws an exception instead of returning 0.
# define ACE_NEW_THROWS_EXCEPTIONS
# endif /* ACE_HAS_EXCEPTIONS */
#include /**/ "ace/post.h"
#endif /* ACE_CONFIG_H */
+116 -1
View File
@@ -6,7 +6,7 @@
*
* system error numbers
*
* $Id: os_errno.h 85122 2009-04-20 16:34:19Z johnnyw $
* $Id: os_errno.h 91076 2010-07-13 14:20:35Z johnnyw $
*
* @author Don Hinton <dhinton@dresystems.com>
* @author This code was originally in various places including ace/OS.h.
@@ -42,6 +42,121 @@ extern "C"
#if defined (ACE_WIN32)
// error code mapping for windows
// VC++ 10 has these error codes defined in errno.h,
// this will cause different errors in ACE.
// So we undef these error codes if they are wrongly defined
# if defined (EWOULDBLOCK) && (EWOULDBLOCK != WSAEWOULDBLOCK)
# undef EWOULDBLOCK
# endif /* EWOULDBLOCK */
# if defined (EINPROGRESS) && (EINPROGRESS != WSAEINPROGRESS)
# undef EINPROGRESS
# endif /* EINPROGRESS */
# if defined (EALREADY) && (EALREADY != WSAEALREADY)
# undef EALREADY
# endif /* EALREADY */
# if defined (ENOTSOCK) && (ENOTSOCK != WSAENOTSOCK)
# undef ENOTSOCK
# endif /* ENOTSOCK */
# if defined (EDESTADDRREQ) && (EDESTADDRREQ != WSAEDESTADDRREQ)
# undef EDESTADDRREQ
# endif /* EDESTADDRREQ */
# if defined (EMSGSIZE) && (EMSGSIZE != WSAEMSGSIZE)
# undef EMSGSIZE
# endif /* EMSGSIZE */
# if defined (EPROTOTYPE) && (EPROTOTYPE != WSAEPROTOTYPE)
# undef EPROTOTYPE
# endif /* EPROTOTYPE */
# if defined (ENOPROTOOPT) && (ENOPROTOOPT != WSAENOPROTOOPT)
# undef ENOPROTOOPT
# endif /* ENOPROTOOPT */
# if defined (EPROTONOSUPPORT) && (EPROTONOSUPPORT != WSAEPROTONOSUPPORT)
# undef EPROTONOSUPPORT
# endif /* EPROTONOSUPPORT */
# if defined (ESOCKTNOSUPPORT) && (ESOCKTNOSUPPORT != WSAESOCKTNOSUPPORT)
# undef ESOCKTNOSUPPORT
# endif /* ESOCKTNOSUPPORT */
# if defined (EOPNOTSUPP) && (EOPNOTSUPP != WSAEOPNOTSUPP)
# undef EOPNOTSUPP
# endif /* EOPNOTSUPP */
# if defined (EPFNOSUPPORT) && (EPFNOSUPPORT != WSAEPFNOSUPPORT)
# undef EPFNOSUPPORT
# endif /* EPFNOSUPPORT */
# if defined (EAFNOSUPPORT) && (EAFNOSUPPORT != WSAEAFNOSUPPORT)
# undef EAFNOSUPPORT
# endif /* EAFNOSUPPORT */
# if defined (EADDRINUSE) && (EADDRINUSE != WSAEADDRINUSE)
# undef EADDRINUSE
# endif /* EADDRINUSE */
# if defined (EADDRNOTAVAIL) && (EADDRNOTAVAIL != WSAEADDRNOTAVAIL)
# undef EADDRNOTAVAIL
# endif /* EADDRNOTAVAIL */
# if defined (ENETDOWN) && (ENETDOWN != WSAENETDOWN)
# undef ENETDOWN
# endif /* ENETDOWN */
# if defined (ENETUNREACH) && (ENETUNREACH != WSAENETUNREACH)
# undef ENETUNREACH
# endif /* ENETUNREACH */
# if defined (ENETRESET) && (ENETRESET != WSAENETRESET)
# undef ENETRESET
# endif /* ENETRESET */
# if defined (ECONNABORTED) && (ECONNABORTED != WSAECONNABORTED)
# undef ECONNABORTED
# endif /* ECONNABORTED */
# if defined (ECONNRESET) && (ECONNRESET != WSAECONNRESET)
# undef ECONNRESET
# endif /* ECONNRESET */
# if defined (ENOBUFS) && (ENOBUFS != WSAENOBUFS)
# undef ENOBUFS
# endif /* ENOBUFS */
# if defined (EISCONN) && (EISCONN != WSAEISCONN)
# undef EISCONN
# endif /* EISCONN */
# if defined (ENOTCONN) && (ENOTCONN != WSAENOTCONN)
# undef ENOTCONN
# endif /* ENOTCONN */
# if defined (ESHUTDOWN) && (ESHUTDOWN != WSAESHUTDOWN)
# undef ESHUTDOWN
# endif /* ESHUTDOWN */
# if defined (ETOOMANYREFS) && (ETOOMANYREFS != WSAETOOMANYREFS)
# undef ETOOMANYREFS
# endif /* ETOOMANYREFS */
# if defined (ETIMEDOUT) && (ETIMEDOUT != WSAETIMEDOUT)
# undef ETIMEDOUT
# endif /* ETIMEDOUT */
# if defined (ECONNREFUSED) && (ECONNREFUSED != WSAECONNREFUSED)
# undef ECONNREFUSED
# endif /* ECONNREFUSED */
# if defined (ELOOP) && (ELOOP != WSAELOOP)
# undef ELOOP
# endif /* ELOOP */
//# if defined (ENAMETOOLONG) && (ENAMETOOLONG != WSAENAMETOOLONG)
//# undef ENAMETOOLONG
//# endif /* ENAMETOOLONG */
# if defined (EHOSTDOWN) && (EHOSTDOWN != WSAEHOSTDOWN)
# undef EHOSTDOWN
# endif /* EHOSTDOWN */
# if defined (EHOSTUNREACH) && (EHOSTUNREACH != WSAEHOSTUNREACH)
# undef EHOSTUNREACH
# endif /* EHOSTUNREACH */
//# if defined (ENOTEMPTY) && (ENOTEMPTY != WSAENOTEMPTY)
//# undef ENOTEMPTY
//# endif /* ENOTEMPTY */
# if defined (EPROCLIM) && (EPROCLIM != WSAEPROCLIM)
# undef EPROCLIM
# endif /* EPROCLIM */
# if defined (EUSERS) && (EUSERS != WSAEUSERS)
# undef EUSERS
# endif /* EUSERS */
# if defined (EDQUOT) && (EDQUOT != WSAEDQUOT)
# undef EDQUOT
# endif /* EDQUOT */
# if defined (ESTALE) && (ESTALE != WSAESTALE)
# undef ESTALE
# endif /* ESTALE */
# if defined (EREMOTE) && (EREMOTE != WSAEREMOTE)
# undef EREMOTE
# endif /* EREMOTE */
# if !defined (ETIME)
# define ETIME ERROR_SEM_TIMEOUT
# endif /* !ETIME */