summaryrefslogtreecommitdiff
path: root/ace/SOCK_Dgram_Bcast.h
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1996-10-21 21:41:34 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1996-10-21 21:41:34 +0000
commita5fdebc5f6375078ec1763850a4ca23ec7fe6458 (patch)
treebcf0a25c3d45a209a6e3ac37b233a4812f29c732 /ace/SOCK_Dgram_Bcast.h
downloadATCD-a5fdebc5f6375078ec1763850a4ca23ec7fe6458.tar.gz
Initial revision
Diffstat (limited to 'ace/SOCK_Dgram_Bcast.h')
-rw-r--r--ace/SOCK_Dgram_Bcast.h106
1 files changed, 106 insertions, 0 deletions
diff --git a/ace/SOCK_Dgram_Bcast.h b/ace/SOCK_Dgram_Bcast.h
new file mode 100644
index 00000000000..f44270a37a9
--- /dev/null
+++ b/ace/SOCK_Dgram_Bcast.h
@@ -0,0 +1,106 @@
+/* -*- C++ -*- */
+// $Id$
+
+
+// ============================================================================
+
+// = LIBRARY
+// ace
+//
+// = FILENAME
+// SOCK_Dgram_Bcast.h
+//
+// = AUTHOR
+// Doug Schmidt
+//
+// ============================================================================
+
+#if !defined (ACE_SOCK_DGRAM_BCAST_H)
+#define ACE_SOCK_DGRAM_BCAST_H
+
+#include "ace/INET_Addr.h"
+#include "ace/SOCK_Dgram.h"
+
+struct ACE_Bcast_Node
+{
+ ACE_Bcast_Node (ACE_INET_Addr &, ACE_Bcast_Node *);
+
+ ACE_INET_Addr bcast_addr_;
+ // Broadcast address for the interface.
+
+ ACE_Bcast_Node *next_;
+ // Pointer to the next interface in the chain.
+};
+
+class ACE_Export ACE_SOCK_Dgram_Bcast : public ACE_SOCK_Dgram
+ // = TITLE
+ // Defines the member functions for the ACE_SOCK datagram
+ // abstraction.
+{
+public:
+ // = Initialization and termination methods.
+ ACE_SOCK_Dgram_Bcast (void);
+ // Default constructor.
+
+ ACE_SOCK_Dgram_Bcast (const ACE_Addr &local,
+ int protocol_family = PF_INET,
+ int protocol = 0);
+ // Initiate a connectionless datagram broadcast endpoint.
+
+ int open (const ACE_Addr &local,
+ int protocol_family = PF_INET,
+ int protocol = 0);
+ // Initiate a connectionless datagram broadcast endpoint.
+
+ int close (void);
+ // Close up and release dynamically allocated resources.
+
+ ssize_t send (const void *buf,
+ size_t n,
+ u_short portnum,
+ int flags = 0) const;
+ // Broadcast the datagram to every interface. Returns the average
+ // number of bytes sent.
+
+ ssize_t send (const iovec iov[],
+ size_t n,
+ u_short portnum,
+ int flags = 0) const;
+ // Broadcast the <iovec> datagrams to every interface. Returns the
+ // average number of bytes sent.
+
+ ssize_t send (const void *buf,
+ size_t n,
+ const ACE_Addr &addr,
+ int flags = 0) const;
+ // Broadcast an N byte datagram to ADDR (note that addr must be
+ // preassigned to the broadcast address of the subnet...).
+
+ ssize_t send (const iovec iov[],
+ size_t n,
+ const ACE_Addr &addr,
+ int flags = 0) const;
+ // Broadcast an <iovec> of size <n> to <addr> as a datagram (note
+ // that addr must be preassigned to the broadcast address of the
+ // subnet...) */
+
+ void dump (void) const;
+ // Dump the state of an object.
+
+ ACE_ALLOC_HOOK_DECLARE;
+ // Declare the dynamic allocation hooks.
+
+private:
+ int mk_broadcast (void);
+ // Make broadcast available for Datagram socket.
+
+ ACE_Bcast_Node *if_list_;
+ // Points to the head of the list of broadcast interfaces.
+
+ int get_remote_addr (ACE_Addr &) const;
+ // Do not allow this function to percolate up to this interface...
+};
+
+#include "ace/SOCK_Dgram_Bcast.i"
+
+#endif /* ACE_SOCK_DGRAM_BCAST_H */