#include "MirrorMessageResponseState.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void MirroredMessageResponseState::serialize(Serializer& ser) const { ser % serializerTag(); serializeContents(ser); } std::unique_ptr MirroredMessageResponseState::deserialize( Deserializer& des) { uint32_t tag; des % tag; if (!des.good()) return {}; #define HANDLE_TAG(value, type) \ case value: return boost::make_unique(des); switch (tag) { HANDLE_TAG(NETMSGTYPE_OpenFile, OpenFileMsgEx) HANDLE_TAG(NETMSGTYPE_CloseFile, CloseFileMsgEx) HANDLE_TAG(NETMSGTYPE_TruncFile, TruncFileMsgEx) HANDLE_TAG(NETMSGTYPE_MkFileWithPattern, MkFileWithPatternMsgEx) HANDLE_TAG(NETMSGTYPE_Hardlink, HardlinkMsgEx) HANDLE_TAG(NETMSGTYPE_MkLocalDir, MkLocalDirMsgEx) HANDLE_TAG(NETMSGTYPE_UnlinkFile, UnlinkFileMsgEx) HANDLE_TAG(NETMSGTYPE_RmLocalDir, RmLocalDirMsgEx) HANDLE_TAG(NETMSGTYPE_MkDir, MkDirMsgEx) HANDLE_TAG(NETMSGTYPE_MkFile, MkFileMsgEx) HANDLE_TAG(NETMSGTYPE_RmDir, RmDirMsgEx) HANDLE_TAG(NETMSGTYPE_UpdateDirParent, UpdateDirParentMsgEx) HANDLE_TAG(NETMSGTYPE_RemoveXAttr, RemoveXAttrMsgEx) HANDLE_TAG(NETMSGTYPE_SetXAttr, SetXAttrMsgEx) HANDLE_TAG(NETMSGTYPE_SetDirPattern, SetDirPatternMsgEx) HANDLE_TAG(NETMSGTYPE_SetAttr, SetAttrMsgEx) HANDLE_TAG(NETMSGTYPE_RefreshEntryInfo, RefreshEntryInfoMsgEx) HANDLE_TAG(NETMSGTYPE_MovingFileInsert, MovingFileInsertMsgEx) HANDLE_TAG(NETMSGTYPE_MovingDirInsert, MovingDirInsertMsgEx) HANDLE_TAG(NETMSGTYPE_Rename, RenameV2MsgEx) HANDLE_TAG(NETMSGTYPE_LookupIntent, LookupIntentMsgEx) HANDLE_TAG(NETMSGTYPE_AckNotify, AckNotifiyMsgEx) HANDLE_TAG(NETMSGTYPE_FLockEntry, FLockEntryMsgEx) HANDLE_TAG(NETMSGTYPE_FLockRange, FLockRangeMsgEx) HANDLE_TAG(NETMSGTYPE_BumpFileVersion, BumpFileVersionMsgEx) default: LOG(MIRRORING, ERR, "bad mirror response state tag.", tag); des.setBad(); break; } return {}; }