1 // $Id: SOCK_Netlink.h 80826 2008-03-04 14:51:23Z wotte $
2 //=============================================================================
6 * $Id: SOCK_Netlink.h 80826 2008-03-04 14:51:23Z wotte $
8 * @author Robert Iakobashvilli <coroberti@gmail.com>
9 * @author Raz Ben Yehuda <raziebe@013.net.il>
11 //=============================================================================
13 #ifndef ACE_SOCK_NETLINK_H
14 #define ACE_SOCK_NETLINK_H
16 #include /**/ "ace/pre.h"
18 #include /**/ "ace/config-all.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 #ifdef ACE_HAS_NETLINK
27 #include "ace/Netlink_Addr.h"
30 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
33 * @class ACE_SOCK_Netlink
35 * @brief Defines the member functions for the ACE_SOCK Netlink
38 * Netlink sockets are used in Linux as a communication facilty of kernel to user
40 * This code was created so one could use ACE reactor
41 * as a gateway to a linux kernel.
44 class ACE_Export ACE_SOCK_Netlink
: public ACE_SOCK
{
46 // = Initialization and termination methods.
47 /// Default constructor.
48 ACE_SOCK_Netlink(void);
49 ~ACE_SOCK_Netlink(void);
50 ACE_SOCK_Netlink (ACE_Netlink_Addr
&local
,
54 * opens a RAW socket over an ACE_SOCK and binds it
57 int open (ACE_Netlink_Addr
&local
,
62 * receives abuffer with the size n
64 ssize_t
recv (void *buf
,
68 * send a buffer of size n bytes
71 ssize_t
send (void *buf
,
76 * Recieves an iovec of size @a n to the netlink socket
78 ssize_t
recv (iovec iov
[],
84 * Sends an iovec of size @a n to the netlink socket
86 ssize_t
send (const iovec iov
[],
91 /// Declare the dynamic allocation hooks.
92 ACE_ALLOC_HOOK_DECLARE
;
95 ACE_END_VERSIONED_NAMESPACE_DECL
97 #if defined (__ACE_INLINE__)
98 #include "ace/SOCK_Netlink.inl"
99 #endif /* __ACE_INLINE__ */
101 #endif /* ACE_HAS_NETLINK */
103 #include /**/ "ace/post.h"
105 #endif /* ACE_SOCK_NETLINK_H */