ETSI STF525 / Internal Testing test suite This project provides an internal testing test suite and its associated Test Adapter/Codec

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