/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
 * Copyright (c) 2013-2017 Regents of the University of California.
 *
 * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
 *
 * ndn-cxx library is free software: you can redistribute it and/or modify it under the
 * terms of the GNU Lesser General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later version.
 *
 * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
 *
 * You should have received copies of the GNU General Public License and GNU Lesser
 * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
 * <http://www.gnu.org/licenses/>.
 *
 * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
 */

#ifndef NDN_MGMT_NFD_FACE_EVENT_NOTIFICATION_HPP
#define NDN_MGMT_NFD_FACE_EVENT_NOTIFICATION_HPP

#include "face-traits.hpp"

namespace ndn {
namespace nfd {

/**
 * \ingroup management
 */
enum FaceEventKind {
  FACE_EVENT_NONE = 0,
  FACE_EVENT_CREATED = 1, ///< face created
  FACE_EVENT_DESTROYED = 2, ///< face destroyed
  FACE_EVENT_UP = 3, ///< face went UP (from DOWN state)
  FACE_EVENT_DOWN = 4 ///< face went DOWN (from UP state)
};

/**
 * \ingroup management
 * \brief represents a Face status change notification
 * \sa https://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Face-Status-Change-Notification
 */
class FaceEventNotification : public FaceTraits<FaceEventNotification>
{
public:
  FaceEventNotification();

  explicit
  FaceEventNotification(const Block& block);

  /** \brief prepend FaceEventNotification to the encoder
   */
  template<encoding::Tag TAG>
  size_t
  wireEncode(EncodingImpl<TAG>& encoder) const;

  /** \brief encode FaceEventNotification
   */
  const Block&
  wireEncode() const;

  /** \brief decode FaceEventNotification
   */
  void
  wireDecode(const Block& wire);

public: // getters & setters
  FaceEventKind
  getKind() const
  {
    return m_kind;
  }

  FaceEventNotification&
  setKind(FaceEventKind kind);

private:
  FaceEventKind m_kind;
};

std::ostream&
operator<<(std::ostream& os, const FaceEventNotification& notification);

} // namespace nfd
} // namespace ndn

#endif // NDN_MGMT_NFD_FACE_EVENT_NOTIFICATION_HPP
