-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
1,321 additions
and
484 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Copyright (c) 1999 Miguel Castro, Barbara Liskov. | ||
// Copyright (c) 2000, 2001 Miguel Castro, Rodrigo Rodrigues, Barbara Liskov. | ||
// Licensed under the MIT license. | ||
#include "Append_entries.h" | ||
|
||
#include "Message_tags.h" | ||
#include "ds/logger.h" | ||
#include "pbft_assert.h" | ||
|
||
Append_entries::Append_entries() : | ||
Message(Append_entries_tag, sizeof(Append_entries_rep)) | ||
{} | ||
|
||
bool Append_entries::verify() | ||
{ | ||
return true; | ||
} | ||
|
||
bool Append_entries::convert(Message* m1, Append_entries*& m2) | ||
{ | ||
if (!m1->has_tag(Append_entries_tag, sizeof(Append_entries_rep))) | ||
{ | ||
return false; | ||
} | ||
|
||
m1->trim(); | ||
m2 = (Append_entries*)m1; | ||
return true; | ||
} | ||
|
||
Append_entries_rep& Append_entries::rep() const | ||
{ | ||
PBFT_ASSERT(ALIGNED(msg), "Improperly aligned pointer"); | ||
return *((Append_entries_rep*)msg); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Copyright (c) 1999 Miguel Castro, Barbara Liskov. | ||
// Copyright (c) 2000, 2001 Miguel Castro, Rodrigo Rodrigues, Barbara Liskov. | ||
// Licensed under the MIT license. | ||
#pragma once | ||
|
||
#include "Message.h" | ||
#include "nodeinfo.h" | ||
|
||
// | ||
// Append entries messages have the following format: | ||
// | ||
#pragma pack(push) | ||
#pragma pack(1) | ||
struct Append_entries_rep : public Message_rep | ||
{}; | ||
#pragma pack(pop) | ||
|
||
class Append_entries : public Message | ||
{ | ||
public: | ||
Append_entries(); | ||
|
||
bool verify(); | ||
|
||
static bool convert(Message* m1, Append_entries*& m2); | ||
|
||
private: | ||
Append_entries_rep& rep() const; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.