Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / Netlink_Addr.h
bloba2bbb238ee80f29a85c98ac0b1bcc7859f14dd79
1 //=============================================================================
2 /**
3 * @file Netlink_Addr.h
5 * @author Robert Iakobashvilli <coroberti@gmail.com>
6 * @author Raz Ben Yehuda <raziebe@gmail.com>
7 */
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)
18 #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"
27 #include "ace/Addr.h"
28 #include "ace/os_include/sys/os_socket.h"
30 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
32 /**
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 {
38 public:
39 /// Default constructor.
40 ACE_Netlink_Addr ();
42 /// Copy 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);
48 /// Dtor
49 ~ACE_Netlink_Addr () = default;
51 /**
52 * @param naddr sets the nl_ member @see nl_
54 int set (const ACE_Netlink_Addr &naddr);
55 /**
56 * sets the pid and groups fields of member nl_ @see nl_
58 void set (int pid, int gid);
59 /**
60 * set nl_ to nl_ @see nl_
62 int set (const sockaddr_nl *, int len);
63 /**
64 * @return pid
66 int get_pid () const;
67 /**
68 * @return the group id @see nl_
70 int get_gid () const;
71 /**
72 * @return addr pointer @see nl_
74 virtual void *get_addr () const;
75 /**
76 * @return nl_ member @see nl_ size
78 int get_addr_size () const;
79 /**
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;
87 private:
88 /**
89 * @return family type AF_NETLINK
91 * */
92 int determine_type () const;
93 /**
94 * set nl_ @see nl_ to zero and sets address family to default value
96 void reset ();
98 sockaddr_nl nl_;
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 */