Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once
#include "Codec.hh"
#include "Params.hh"
class Base_Type;
class TTCN_Typedescriptor_t;
class TTCN_Buffer;
namespace LibItsHttp__TypesAndValues {
class HttpMessage;
class Request;
class Response;
class HeaderLines;
class HeaderLine;
}
class HttpCodec: public Codec <
LibItsHttp__TypesAndValues::HttpMessage,
LibItsHttp__TypesAndValues::HttpMessage>
{
public:
explicit HttpCodec() : Codec<LibItsHttp__TypesAndValues::HttpMessage, LibItsHttp__TypesAndValues::HttpMessage>() { };
virtual ~HttpCodec() { };
virtual int encode (const LibItsHttp__TypesAndValues::HttpMessage&, OCTETSTRING& data);
virtual int decode (const OCTETSTRING& data, LibItsHttp__TypesAndValues::HttpMessage&, Params* params = NULL);
private:
int encode_request (const LibItsHttp__TypesAndValues::Request& p_request, TTCN_Buffer& p_encoding_buffer);
// int encode_response (const LibItsHttp__TypesAndValues::Request&, TTCN_Buffer& p_encoding_buffer);
int decode_headers(TTCN_Buffer& decoding_buffer, LibItsHttp__TypesAndValues::HeaderLines& headers);
int decode_header(CHARSTRING& header_line, LibItsHttp__TypesAndValues::HeaderLine& header);
int decode_body(TTCN_Buffer& decoding_buffer, CHARSTRING& body);
int get_line(TTCN_Buffer& buffer, CHARSTRING& to, const bool concatenate_header_lines = false);
}; // End of class HttpCodec