diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2008-03-04 14:51:23 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2008-03-04 14:51:23 +0000 |
commit | 99aa8c60282c7b8072eb35eb9ac815702f5bf586 (patch) | |
tree | bda96bf8c3a4c2875a083d7b16720533c8ffeaf4 /ACE/ace/Netlink_Addr.cpp | |
parent | c4078c377d74290ebe4e66da0b4975da91732376 (diff) | |
download | ATCD-99aa8c60282c7b8072eb35eb9ac815702f5bf586.tar.gz |
undoing accidental deletion
Diffstat (limited to 'ACE/ace/Netlink_Addr.cpp')
-rw-r--r-- | ACE/ace/Netlink_Addr.cpp | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/ACE/ace/Netlink_Addr.cpp b/ACE/ace/Netlink_Addr.cpp new file mode 100644 index 00000000000..2a7ef2a8bde --- /dev/null +++ b/ACE/ace/Netlink_Addr.cpp @@ -0,0 +1,68 @@ +// $Id$ + +//============================================================================= +/** + * @file Netlink_Addr.cpp + * + * $Id$ + * + * @author Robert Iakobashvilli <coroberti@gmail.com> + * @author Raz Ben Yehuda <raziebe@gmail.com> + */ +//============================================================================= + +#include "ace/Netlink_Addr.h" + +#ifdef ACE_HAS_NETLINK + +#if !defined (__ACE_INLINE__) +#include "ace/Netlink_Addr.inl" +#endif /* __ACE_INLINE__ */ + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +ACE_ALLOC_HOOK_DEFINE(ACE_Netlink_Addr) + +int ACE_Netlink_Addr::set (const ACE_Netlink_Addr &sa) +{ + ACE_OS::memset ((void *) &this->nl_,0,sizeof this->nl_); + this->nl_.nl_family = AF_NETLINK; + this->base_set (sa.get_type (), sa.get_size ()); + return 0; +} + +// Copy constructor. + +ACE_Netlink_Addr::ACE_Netlink_Addr (const ACE_Netlink_Addr &sa) +: ACE_Addr (AF_NETLINK, sa.get_size ()) +{ + this->set (sa); +} + +int ACE_Netlink_Addr::set (const sockaddr_nl *un, int len) +{ + (void) ACE_OS::memcpy ((void *) &this->nl_,un,len); + return 0; +} + +ACE_Netlink_Addr::ACE_Netlink_Addr (const sockaddr_nl *un, int len) +{ + this->set (un, len); +} + +int +ACE_Netlink_Addr::get_pid (void) const +{ + return this->nl_.nl_pid; +} + +int +ACE_Netlink_Addr::get_gid (void) const +{ + return this->nl_.nl_groups; +} + +ACE_END_VERSIONED_NAMESPACE_DECL + +#endif + |