summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-06-21 02:47:45 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-06-21 02:47:45 +0000
commit4d75cc5656fdab520c94d6517080a01a1c9dde27 (patch)
treef85dec2616186bd85cdec862845e275e7280cb8f /protocols
parentc0470d6d53f230ba3f4351ba280e72310c3a2e16 (diff)
downloadATCD-4d75cc5656fdab520c94d6517080a01a1c9dde27.tar.gz
ChangeLogTag:Tue Jun 20 19:37:53 2000 Carlos O'Ryan <coryan@uci.edu>
Diffstat (limited to 'protocols')
-rw-r--r--protocols/ace/RMCast/Makefile3
-rw-r--r--protocols/ace/RMCast/RMCast_Header_Size.cpp15
-rw-r--r--protocols/ace/RMCast/RMCast_Header_Size.h55
-rw-r--r--protocols/ace/RMCast/RMCast_Header_Size.i14
-rw-r--r--protocols/ace/RMCast/RMCast_Partial_Message.cpp3
5 files changed, 89 insertions, 1 deletions
diff --git a/protocols/ace/RMCast/Makefile b/protocols/ace/RMCast/Makefile
index 87d640afe74..8ffb9265813 100644
--- a/protocols/ace/RMCast/Makefile
+++ b/protocols/ace/RMCast/Makefile
@@ -9,7 +9,8 @@ LIB = libACE_RMCast.a
SHLIB = libACE_RMCast.$(SOEXT)
FILES= \
- RMCast_Partial_Message
+ RMCast_Partial_Message \
+ RMCast_Header_Size
TEMPLATE_FILES = \
RMCast_Fragment \
RMCast_Reassembly
diff --git a/protocols/ace/RMCast/RMCast_Header_Size.cpp b/protocols/ace/RMCast/RMCast_Header_Size.cpp
new file mode 100644
index 00000000000..f98259eb255
--- /dev/null
+++ b/protocols/ace/RMCast/RMCast_Header_Size.cpp
@@ -0,0 +1,15 @@
+// $Id$
+
+#include "RMCast_Header_Size.h"
+
+#if !defined (__ACE_INLINE__)
+#include "RMCast_Header_Size.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(ace, RMCast_Header_Size, "$Id$")
+
+ACE_RMCast_Header_Size::
+ACE_RMCast_Header_Size (void)
+ : ACE_Message_Block (0, ACE_Message_Block::MB_PROTO)
+{
+}
diff --git a/protocols/ace/RMCast/RMCast_Header_Size.h b/protocols/ace/RMCast/RMCast_Header_Size.h
new file mode 100644
index 00000000000..eb6aa9599af
--- /dev/null
+++ b/protocols/ace/RMCast/RMCast_Header_Size.h
@@ -0,0 +1,55 @@
+// $Id$
+
+// ============================================================================
+//
+// = DESCRIPTION
+// Helper class used in the reassembly layer of the realiable
+// multicast library.
+//
+// = AUTHOR
+// Carlos O'Ryan <coryan@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef ACE_RMCAST_HEADER_SIZE_H
+#define ACE_RMCAST_HEADER_SIZE_H
+#include "ace/pre.h"
+
+#include "RMCast_Export.h"
+#include "ace/Task.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class ACE_RMCast_Export ACE_RMCast_Header_Size : public ACE_Message_Block
+{
+ // = TITLE
+ // A control message to compute the total header size in the stack
+ //
+ // = DESCRIPTION
+ // As layers are pushed into the stack it is often required to add
+ // headers in one or more layers. The headers could be appended
+ // using the message block chain.
+ //
+public:
+ ACE_RMCast_Header_Size (void);
+ // Constructor
+
+ void add_to_header_size (size_t size);
+ // Add a header to the total size
+
+ size_t header_size (void) const;
+ // Return the current header size
+
+private:
+ size_t header_size_;
+ // The header size
+};
+
+#if defined (__ACE_INLINE__)
+#include "RMCast_Header_Size.i"
+#endif /* __ACE_INLINE__ */
+
+#include "ace/post.h"
+#endif /* ACE_RMCAST_HEADER_SIZE_H */
diff --git a/protocols/ace/RMCast/RMCast_Header_Size.i b/protocols/ace/RMCast/RMCast_Header_Size.i
new file mode 100644
index 00000000000..ae197528578
--- /dev/null
+++ b/protocols/ace/RMCast/RMCast_Header_Size.i
@@ -0,0 +1,14 @@
+// $Id$
+
+ACE_INLINE void
+ACE_RMCast_Header_Size::add_to_header_size (size_t size)
+{
+ this->header_size_ += size;
+}
+
+ACE_INLINE size_t
+ACE_RMCast_Header_Size::header_size (void) const
+{
+ return this->header_size_;
+}
+
diff --git a/protocols/ace/RMCast/RMCast_Partial_Message.cpp b/protocols/ace/RMCast/RMCast_Partial_Message.cpp
index 054619d6998..2515c52459b 100644
--- a/protocols/ace/RMCast/RMCast_Partial_Message.cpp
+++ b/protocols/ace/RMCast/RMCast_Partial_Message.cpp
@@ -33,6 +33,9 @@ ACE_RMCast_Partial_Message::fragment_received (ACE_UINT32 message_size,
ACE_UINT32 offset,
ACE_Message_Block *mb)
{
+ if (this->message_body_.length () != message_size)
+ return -1;
+
// Just copy the data...
char *rd_ptr = this->message_body_.rd_ptr () + offset;
size_t total_length = mb->length () - 12;