Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / ace / SOCK_Netlink.h
blobf08b5a361a125c5c018df7f8d2bc748e759cf0ac
1 //=============================================================================
2 /**
3 * @file SOCK_Netlink.h
5 * @author Robert Iakobashvilli <coroberti@gmail.com>
6 * @author Raz Ben Yehuda <raziebe@013.net.il>
7 */
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)
18 #pragma once
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #ifdef ACE_HAS_NETLINK
23 #include "ace/SOCK.h"
24 #include "ace/Netlink_Addr.h"
25 #include "ace/Addr.h"
27 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
29 /**
30 * @class ACE_SOCK_Netlink
32 * @brief Defines the member functions for the ACE_SOCK Netlink
33 * abstraction.
35 * Netlink sockets are used in Linux as a communication facilty of kernel to user
36 * and user to kernel.
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
42 public:
43 /// Default constructor.
44 ACE_SOCK_Netlink();
45 ~ACE_SOCK_Netlink();
46 ACE_SOCK_Netlink (ACE_Netlink_Addr &local,
47 int protocol_family,
48 int protocol);
49 /**
50 * opens a RAW socket over an ACE_SOCK and binds it
52 **/
53 int open (ACE_Netlink_Addr &local,
54 int protocol_family,
55 int protocol);
57 /**
58 * receives abuffer with the size n
60 ssize_t recv (void *buf,
61 size_t n,
62 int flags) const;
63 /**
64 * send a buffer of size n bytes
67 ssize_t send (void *buf,
68 size_t n,
69 int flags) const;
71 /**
72 * Recieves an iovec of size @a n to the netlink socket
74 ssize_t recv (iovec iov[],
75 int n,
76 ACE_Addr &addr,
77 int flags = 0) const;
79 /**
80 * Sends an iovec of size @a n to the netlink socket
82 ssize_t send (const iovec iov[],
83 int n,
84 const ACE_Addr &addr,
85 int flags = 0) const;
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 */