Sequence Chart Studio  svn HEAD revision
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
HttpPacket Class Reference

#include <application_layer.h>

Inheritance diagram for HttpPacket:
Inheritance graph
Collaboration diagram for HttpPacket:
Collaboration graph

Public Member Functions

 HttpPacket (u_char *data, u_short data_size, Ports ports, HttpSettings *http_set)
 
 ~HttpPacket ()
 
u_short get_data_size ()
 
u_charget_upper_data ()
 
u_short get_upper_data_size ()
 
short get_proto ()
 
short get_upper_proto ()
 
std::string get_upper_proto_name ()
 
std::string get_message ()
 
Ports get_ports ()
 
HttpReassemblyPtr get_http_reassembly ()
 
- Public Member Functions inherited from Packet
virtual ~Packet ()
 

Static Public Member Functions

static int header_field_cb (http_parser *parser, const char *field, http_size_t len)
 
static int header_value_cb (http_parser *parser, const char *value, http_size_t len)
 
static int request_uri_cb (http_parser *parser, const char *url, http_size_t len)
 
static int headers_complete_cb (http_parser *parser)
 
static int message_complete_cb (http_parser *parser)
 
static int message_begin_cb (http_parser *parser)
 
static int body_cb (http_parser *parser, const char *body, http_size_t len)
 
static void clean_static_data ()
 

Static Public Attributes

static std::map< Ports,
HttpParsePack
http_parsers
 

Private Member Functions

void set_label (HttpReassemblyPtr msg)
 
void set_http_part (HttpReassemblyPtr msg, bool is_segment)
 
void set_http_settings (http_parser_settings_ptr settings)
 

Private Attributes

u_chardata
 
u_short data_size
 
HttpSettingshttp_settings
 
http_parser_ptr parser
 
std::string label
 
bool is_segment
 
HttpPart part
 

Static Private Attributes

static Ports ports
 
static bool set_settings
 
static http_parser_settings_ptr settings
 

Detailed Description

HTTP packet represents HTTP protocol For parsing and reassemblation uses functionality of https://github.com/joyent/http-parser

Definition at line 176 of file application_layer.h.

Constructor & Destructor Documentation

HttpPacket::HttpPacket ( u_char data,
u_short  data_size,
Ports  ports,
HttpSettings http_set 
)
HttpPacket::~HttpPacket ( )

Definition at line 302 of file application_layer.cpp.

Member Function Documentation

int HttpPacket::body_cb ( http_parser *  parser,
const char *  body,
http_size_t  len 
)
static

Definition at line 195 of file application_layer.cpp.

References http_parsers, and ports.

Referenced by set_http_settings().

void HttpPacket::clean_static_data ( )
static

Definition at line 412 of file application_layer.cpp.

References http_parsers.

Referenced by PcapHandler::last_diagram_update().

u_short HttpPacket::get_data_size ( )
virtual

Return size of packet in Bytes

Implements Packet.

Definition at line 376 of file application_layer.cpp.

References data_size.

HttpReassemblyPtr HttpPacket::get_http_reassembly ( )

Return reassembe info according to this packet

Definition at line 371 of file application_layer.cpp.

References http_parsers, and ports.

Referenced by get_aggregd_for_reass().

std::string HttpPacket::get_message ( )
virtual

Return protocol specific message to include in label

Implements Packet.

Definition at line 335 of file application_layer.cpp.

References label.

Ports HttpPacket::get_ports ( )
virtual

Return ports, make_ports(0,0) otherwise

Implements Packet.

Definition at line 407 of file application_layer.cpp.

References ports.

short HttpPacket::get_proto ( )
virtual

Return protocol numer

Implements Packet.

Definition at line 381 of file application_layer.cpp.

References Ports::dst, ports, and Ports::src.

u_char * HttpPacket::get_upper_data ( )
virtual

Return pointer to encapsulated protocol, NULL otherwise

Implements Packet.

Definition at line 396 of file application_layer.cpp.

u_short HttpPacket::get_upper_data_size ( )
virtual

Return size of encapsulated data in Bytes, 0 otherwise

Implements Packet.

Definition at line 401 of file application_layer.cpp.

short HttpPacket::get_upper_proto ( )
virtual

Return number-id of encapsulated protocol,-1 otherwise

Implements Packet.

Definition at line 386 of file application_layer.cpp.

std::string HttpPacket::get_upper_proto_name ( )
virtual

Return name of encapsulated protocol, empty string otherwise

Implements Packet.

Definition at line 391 of file application_layer.cpp.

int HttpPacket::header_field_cb ( http_parser *  parser,
const char *  field,
http_size_t  len 
)
static
int HttpPacket::header_value_cb ( http_parser *  parser,
const char *  value,
http_size_t  len 
)
static

Definition at line 145 of file application_layer.cpp.

References http_parsers, label, ports, string, and VALUE.

Referenced by set_http_settings().

int HttpPacket::headers_complete_cb ( http_parser *  parser)
static

Definition at line 177 of file application_layer.cpp.

References http_parsers, and ports.

Referenced by set_http_settings().

int HttpPacket::message_begin_cb ( http_parser *  parser)
static

Definition at line 189 of file application_layer.cpp.

References http_parsers, and ports.

Referenced by set_http_settings().

int HttpPacket::message_complete_cb ( http_parser *  parser)
static

Definition at line 183 of file application_layer.cpp.

References http_parsers, and ports.

Referenced by set_http_settings().

int HttpPacket::request_uri_cb ( http_parser *  parser,
const char *  url,
http_size_t  len 
)
static

Definition at line 172 of file application_layer.cpp.

Referenced by set_http_settings().

void HttpPacket::set_http_part ( HttpReassemblyPtr  msg,
bool  is_segment 
)
private

Definition at line 304 of file application_layer.cpp.

References DATA_COMPLETE, DATA_PART, HEADERS_COMPLETE, HEADERS_PART, and ONE_PACK_MSG.

Referenced by HttpPacket().

void HttpPacket::set_http_settings ( http_parser_settings_ptr  settings)
private
void HttpPacket::set_label ( HttpReassemblyPtr  msg)
private

Member Data Documentation

u_char* HttpPacket::data
private

Definition at line 179 of file application_layer.h.

u_short HttpPacket::data_size
private

Definition at line 180 of file application_layer.h.

Referenced by get_data_size(), and HttpPacket().

std::map< Ports, HttpParsePack > HttpPacket::http_parsers
static
HttpSettings* HttpPacket::http_settings
private

Definition at line 184 of file application_layer.h.

Referenced by HttpPacket(), and set_label().

bool HttpPacket::is_segment
private

Definition at line 188 of file application_layer.h.

Referenced by HttpPacket().

std::string HttpPacket::label
private

Definition at line 187 of file application_layer.h.

Referenced by get_message(), header_value_cb(), and set_label().

http_parser_ptr HttpPacket::parser
private

Definition at line 186 of file application_layer.h.

Referenced by HttpPacket().

HttpPart HttpPacket::part
private

Definition at line 194 of file application_layer.h.

Ports HttpPacket::ports
staticprivate
bool HttpPacket::set_settings
staticprivate

Definition at line 191 of file application_layer.h.

Referenced by HttpPacket().

http_parser_settings_ptr HttpPacket::settings
staticprivate

Definition at line 192 of file application_layer.h.

Referenced by HttpPacket().


The documentation for this class was generated from the following files:

SourceForge.net Logo
Generated on Fri Jan 15 2016 16:26:58 for Sequence Chart Studio by  doxygen