| /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| /* |
| * Copyright (c) 2013, Regents of the University of California |
| * Yingdi Yu |
| * |
| * BSD license, See the LICENSE file for more information |
| * |
| * Author: Yingdi Yu <yingdi@cs.ucla.edu> |
| */ |
| |
| #ifndef CHRONOCHAT_INVITATION_HPP |
| #define CHRONOCHAT_INVITATION_HPP |
| |
| |
| #include "common.hpp" |
| |
| #include <ndn-cxx/security/identity-certificate.hpp> |
| |
| namespace chronochat { |
| |
| class Invitation |
| { |
| public: |
| /* |
| * /[invitee_namespace] |
| * /CHRONOCHAT-INVITATION |
| * /<chatroom_name> |
| * /<inviter_routing_prefix> |
| * /<inviter_cert> |
| * /<timestamp> |
| * /<keylocator> |
| * /<signature> |
| */ |
| static const size_t NAME_SIZE_MIN; |
| static const ssize_t SIGNATURE; |
| static const ssize_t KEY_LOCATOR; |
| static const ssize_t TIMESTAMP; |
| static const ssize_t INVITER_CERT; |
| static const ssize_t INVITER_PREFIX; |
| static const ssize_t CHATROOM; |
| static const ssize_t CHRONOCHAT_INVITATION; |
| |
| class Error : public std::runtime_error |
| { |
| public: |
| Error(const std::string& what) |
| : std::runtime_error(what) |
| { |
| } |
| }; |
| |
| Invitation() |
| { |
| } |
| |
| Invitation(const Name& interestName); |
| |
| Invitation(const Name& inviteeNameSpace, |
| const std::string& chatroom, |
| const Name& inviterRoutingPrefix, |
| const ndn::IdentityCertificate& inviterCertificate); |
| |
| Invitation(const Invitation& invitation); |
| |
| virtual |
| ~Invitation() |
| { |
| } |
| |
| const Name& |
| getInviteeNameSpace() const |
| { |
| return m_inviteeNameSpace; |
| } |
| |
| const std::string& |
| getChatroom() const |
| { |
| return m_chatroom; |
| } |
| |
| const Name& |
| getInviterRoutingPrefix() const |
| { |
| return m_inviterRoutingPrefix; |
| } |
| |
| const ndn::IdentityCertificate& |
| getInviterCertificate() const |
| { |
| return m_inviterCertificate; |
| } |
| |
| const uint64_t |
| getTimestamp() const |
| { |
| return m_timestamp; |
| } |
| |
| const Name& |
| getUnsignedInterestName() const |
| { |
| return m_interestName; |
| } |
| |
| private: |
| Name m_interestName; |
| |
| Name m_inviteeNameSpace; |
| std::string m_chatroom; |
| Name m_inviterRoutingPrefix; |
| ndn::IdentityCertificate m_inviterCertificate; |
| uint64_t m_timestamp; |
| }; |
| |
| } // namespace chronochat |
| |
| #endif // CHRONOCHAT_INVITATION_HPP |