1 //=============================================================================
5 * @author Robert Iakobashvilli <coroberti@gmail.com>
6 * @author Raz Ben Yehuda <raziebe@gmail.com>
8 //=============================================================================
10 #ifndef ACE_NETLINK_ADDR_H
11 #define ACE_NETLINK_ADDR_H
13 #include /**/ "ace/pre.h"
15 #include /**/ "ace/config-all.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #ifdef ACE_HAS_NETLINK
23 #include "ace/OS_NS_string.h"
24 #include "ace/Global_Macros.h"
25 #include "ace/OS_NS_unistd.h"
26 #include "ace/OS_NS_unistd.h"
28 #include "ace/os_include/sys/os_socket.h"
30 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
33 * @class ACE_Netlink_Addr
35 * @brief Defines a C++ wrapper facade for the netlink sockets
37 class ACE_Export ACE_Netlink_Addr
: public ACE_Addr
{
39 /// Default constructor.
43 ACE_Netlink_Addr (const ACE_Netlink_Addr
&);
45 /// Creates an ACE_INET_Addr from a sockaddr_in structure.
46 ACE_Netlink_Addr (const sockaddr_nl
*, int len
);
49 ~ACE_Netlink_Addr () = default;
52 * @param naddr sets the nl_ member @see nl_
54 int set (const ACE_Netlink_Addr
&naddr
);
56 * sets the pid and groups fields of member nl_ @see nl_
58 void set (int pid
, int gid
);
60 * set nl_ to nl_ @see nl_
62 int set (const sockaddr_nl
*, int len
);
68 * @return the group id @see nl_
72 * @return addr pointer @see nl_
74 virtual void *get_addr () const;
76 * @return nl_ member @see nl_ size
78 int get_addr_size () const;
80 * Set a pointer to the address
82 virtual void set_addr (const void *, int len
= sizeof(sockaddr_nl
) );
84 /// Declare the dynamic allocation hooks.
85 ACE_ALLOC_HOOK_DECLARE
;
89 * @return family type AF_NETLINK
92 int determine_type () const;
94 * set nl_ @see nl_ to zero and sets address family to default value
101 ACE_END_VERSIONED_NAMESPACE_DECL
103 #if defined (__ACE_INLINE__)
104 #include "ace/Netlink_Addr.inl"
105 #endif /* __ACE_INLINE__ */
107 #endif /* ACE_HAS_NETLINK */
109 #include /**/ "ace/post.h"
111 #endif /* ACE_NETLINK_ADDR_H */