1 //=============================================================================
5 * @author Robert Iakobashvilli <coroberti@gmail.com>
6 * @author Raz Ben Yehuda <raziebe@013.net.il>
8 //=============================================================================
10 #ifndef ACE_SOCK_NETLINK_H
11 #define ACE_SOCK_NETLINK_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
24 #include "ace/Netlink_Addr.h"
27 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
30 * @class ACE_SOCK_Netlink
32 * @brief Defines the member functions for the ACE_SOCK Netlink
35 * Netlink sockets are used in Linux as a communication facilty of kernel to user
37 * This code was created so one could use ACE reactor
38 * as a gateway to a linux kernel.
40 class ACE_Export ACE_SOCK_Netlink
: public ACE_SOCK
43 /// Default constructor.
46 ACE_SOCK_Netlink (ACE_Netlink_Addr
&local
,
50 * opens a RAW socket over an ACE_SOCK and binds it
53 int open (ACE_Netlink_Addr
&local
,
58 * receives abuffer with the size n
60 ssize_t
recv (void *buf
,
64 * send a buffer of size n bytes
67 ssize_t
send (void *buf
,
72 * Recieves an iovec of size @a n to the netlink socket
74 ssize_t
recv (iovec iov
[],
80 * Sends an iovec of size @a n to the netlink socket
82 ssize_t
send (const iovec iov
[],
87 /// Declare the dynamic allocation hooks.
88 ACE_ALLOC_HOOK_DECLARE
;
91 ACE_END_VERSIONED_NAMESPACE_DECL
93 #if defined (__ACE_INLINE__)
94 #include "ace/SOCK_Netlink.inl"
95 #endif /* __ACE_INLINE__ */
97 #endif /* ACE_HAS_NETLINK */
99 #include /**/ "ace/post.h"
101 #endif /* ACE_SOCK_NETLINK_H */