#ifndef _PLUGIN_APP_H_
#define _PLUGIN_APP_H_

#include "sctp_server.hpp"
extern "C" {
#include "bstrlib.h"
}

using namespace std;
using namespace sctp;
namespace amf_application {

constexpr auto CURL_MIME_BOUNDARY = "----Boundary";
enum class http_response_codes_e {
  HTTP_RESPONSE_CODE_0                      = 0,
  HTTP_RESPONSE_CODE_200_OK                 = 200,
  HTTP_RESPONSE_CODE_201_CREATED            = 201,
  HTTP_RESPONSE_CODE_202_ACCEPTED           = 202,
  HTTP_RESPONSE_CODE_204_UPDATED            = 204,
  HTTP_RESPONSE_CODE_BAD_REQUEST            = 400,
  HTTP_RESPONSE_CODE_UNAUTHORIZED           = 401,
  HTTP_RESPONSE_CODE_FORBIDDEN              = 403,
  HTTP_RESPONSE_CODE_NOT_FOUND              = 404,
  HTTP_RESPONSE_CODE_METHOD_NOT_ALLOWED     = 405,
  HTTP_RESPONSE_CODE_REQUEST_TIMEOUT        = 408,
  HTTP_RESPONSE_CODE_406_NOT_ACCEPTED       = 406,
  HTTP_RESPONSE_CODE_CONFLICT               = 409,
  HTTP_RESPONSE_CODE_GONE                   = 410,
  HTTP_RESPONSE_CODE_LENGTH_REQUIRED        = 411,
  HTTP_RESPONSE_CODE_PRECONDITION_FAILED    = 412,
  HTTP_RESPONSE_CODE_PAYLOAD_TOO_LARGE      = 413,
  HTTP_RESPONSE_CODE_URI_TOO_LONG           = 414,
  HTTP_RESPONSE_CODE_UNSUPPORTED_MEDIA_TYPE = 415,
  HTTP_RESPONSE_CODE_TOO_MANY_REQUESTS      = 429,
  HTTP_RESPONSE_CODE_INTERNAL_SERVER_ERROR  = 500,
  HTTP_RESPONSE_CODE_NOT_IMPLEMENTED        = 501,
  HTTP_RESPONSE_CODE_SERVICE_UNAVAILABLE    = 503,
  HTTP_RESPONSE_CODE_GATEWAY_TIMEOUT        = 504
};
#define AMF_CURL_TIMEOUT_MS 1000L
class plugin_app {
public:
  plugin_app();
  ~plugin_app();

   void handle_receive(
    bstring payload, sctp_assoc_id_t assoc_id, sctp_stream_id_t stream,
    sctp_stream_id_t instreams, sctp_stream_id_t outstreams);
};
} // namespace config

#endif