match changes to tpg infrastructure.
svn path=/trunk/; revision=16063
This commit is contained in:
parent
aef8dd5c4c
commit
99104fe179
|
@ -48,61 +48,52 @@ typedef struct _http_info_value_t
|
||||||
|
|
||||||
%rule sp = [ ]+ .
|
%rule sp = [ ]+ .
|
||||||
|
|
||||||
%choice versions = "1.0" | "1.1".
|
%choice versions = "1.0" | "1.1". <version>
|
||||||
|
|
||||||
%field version hyttp.version "HTTP Version" FT_STRING .
|
%field version hyttp.version "HTTP Version" FT_STRING .
|
||||||
|
|
||||||
%sequence http_version = "HTTP/" & versions<version> .
|
%sequence http_version = "HTTP/" & versions .
|
||||||
|
|
||||||
%field response hyttp.response "Response" FT_STRING .
|
%field response hyttp.response "Response" FT_STRING .
|
||||||
%field response_code hyttp.response.code "Response Code" FT_UINT32 BASE_DEC %{ http_response_codes %} .
|
%field response_code hyttp.response.code "Response Code" FT_UINT32 BASE_DEC %{ http_response_codes %} .
|
||||||
%sequence response = http_version & sp & [0-9]+<response_code:RESPONSE> & ... ( crlf ) . <response:%plain_text> {
|
|
||||||
%root response
|
%sequence %tree response = http_version & sp & [0-9]+<response_code:RESPONSE> & ... ( crlf ) . <response:%plain_text> %{
|
||||||
%code %{
|
TT_DATA->is_response = TRUE;
|
||||||
TT_DATA->is_response = TRUE;
|
TT_DATA->response_code = TPG_UINT(RESPONSE);
|
||||||
TT_DATA->response_code = TPG_UINT(RESPONSE);
|
%}
|
||||||
%}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
%field request hyttp.request "Request" FT_STRING .
|
%field request hyttp.request "Request" FT_STRING .
|
||||||
%field method hyttp.request.method "Request Method" FT_STRING .
|
%field method hyttp.request.method "Request Method" FT_STRING .
|
||||||
%field uri hyttp.request.uri "Request URI" FT_STRING .
|
%field uri hyttp.request.uri "Request URI" FT_STRING .
|
||||||
%sequence request = [A-Z]+<method:METHOD> & sp & [^ ]+<uri:URI> & sp & http_version & crlf . <request:%plain_text> {
|
%sequence %tree request = [A-Z]+<method:METHOD> & sp & [^ ]+<uri:URI> & sp & http_version & crlf . <request:%plain_text> %{
|
||||||
%root request
|
TT_DATA->is_response = FALSE;
|
||||||
%code %{
|
TT_DATA->request_method = TPG_STRING(METHOD);
|
||||||
TT_DATA->is_response = FALSE;
|
TT_DATA->request_uri = TPG_STRING(URI);
|
||||||
TT_DATA->request_method = TPG_STRING(METHOD);
|
%}
|
||||||
TT_DATA->request_uri = TPG_STRING(URI);
|
|
||||||
%}
|
|
||||||
}
|
|
||||||
|
|
||||||
%choice req_resp = request | response.
|
%choice req_resp = request | response.
|
||||||
|
|
||||||
%field media hyttp.content_type.media "Content-Type Media" FT_STRING .
|
%field media hyttp.content_type.media "Content-Type Media" FT_STRING .
|
||||||
|
|
||||||
%sequence media = [a-z]+ & "/" & [a-z]+ . <MEDIA> {
|
%sequence media = [a-z]+ & "/" & [a-z]+ . <media:MEDIA> %{
|
||||||
%code %{
|
|
||||||
TT_DATA->media = TPG_STRING(MEDIA);
|
TT_DATA->media = TPG_STRING(MEDIA);
|
||||||
%}
|
%}
|
||||||
}
|
|
||||||
|
%sequence content_type_value = media & ... ( crlf %leave ) . <content_type>
|
||||||
|
|
||||||
%field content_type hyttp.content_type "Content-Type" FT_STRING .
|
%field content_type hyttp.content_type "Content-Type" FT_STRING .
|
||||||
%sequence content_type_hdr = 'Content-type: ' & media<media> & ... ( crlf %leave ) & crlf .
|
%sequence content_type_hdr = 'Content-type: ' & content_type_value & crlf .
|
||||||
|
|
||||||
%field content_length hyttp.headers.content_length "Content-Length" FT_UINT32 BASE_DEC .
|
%field content_length hyttp.headers.content_length "Content-Length" FT_UINT32 BASE_DEC .
|
||||||
%sequence content_length = 'Content-length: ' & [0-9]+<content_length:LENGTH> & crlf. {
|
%sequence content_length = 'Content-length: ' & [0-9]+<content_length:LENGTH> & crlf. %{
|
||||||
%code %{
|
TT_DATA->content_length = TPG_UINT(LENGTH);
|
||||||
TT_DATA->content_length = TPG_UINT(LENGTH);
|
%}
|
||||||
%}
|
|
||||||
}
|
|
||||||
|
|
||||||
%field transfer_encoding hyttp.transfer_encoding "Transfer-Encoding" FT_STRING .
|
%field transfer_encoding hyttp.transfer_encoding "Transfer-Encoding" FT_STRING .
|
||||||
%sequence transfer_encoding = 'Transfer-encoding: ' & ...<transfer_encoding:ENCODING> ( crlf %leave ) & crlf. {
|
%sequence transfer_encoding = 'Transfer-encoding: ' & ...<transfer_encoding:ENCODING> ( crlf %leave ) & crlf. %{
|
||||||
%code %{
|
TT_DATA->transfer_encoding = TPG_STRING(ENCODING);
|
||||||
TT_DATA->transfer_encoding = TPG_STRING(ENCODING);
|
%}
|
||||||
%}
|
|
||||||
}
|
|
||||||
|
|
||||||
%field authorization hyttp.authorization "Authorization" FT_STRING .
|
%field authorization hyttp.authorization "Authorization" FT_STRING .
|
||||||
%sequence authorization = 'Authorization: ' & ...<authorization> ( crlf %leave ) & crlf.
|
%sequence authorization = 'Authorization: ' & ...<authorization> ( crlf %leave ) & crlf.
|
||||||
|
@ -123,7 +114,9 @@ typedef struct _http_info_value_t
|
||||||
%sequence user_agent = 'User-Agent: ' & ...<user_agent> ( crlf %leave ) & crlf.
|
%sequence user_agent = 'User-Agent: ' & ...<user_agent> ( crlf %leave ) & crlf.
|
||||||
|
|
||||||
%field host hyttp.host "Host" FT_STRING .
|
%field host hyttp.host "Host" FT_STRING .
|
||||||
%sequence host = 'Host: ' & ...<host> ( crlf %leave ) & crlf.
|
%sequence host = 'Host: ' & ...<host:HOST> ( crlf %leave ) & crlf. %{
|
||||||
|
TT_DATA->http_host = TPG_STRING(HOST);
|
||||||
|
%}
|
||||||
|
|
||||||
%field accept hyttp.accept "Accept" FT_STRING .
|
%field accept hyttp.accept "Accept" FT_STRING .
|
||||||
%sequence accept = 'Accept: ' & ...<accept> ( crlf %leave ) & crlf.
|
%sequence accept = 'Accept: ' & ...<accept> ( crlf %leave ) & crlf.
|
||||||
|
@ -161,7 +154,7 @@ typedef struct _http_info_value_t
|
||||||
%sequence other_header = [A-Z] & [a-zA-Z-]+ & ": " & ... ( crlf %leave ) & crlf.
|
%sequence other_header = [A-Z] & [a-zA-Z-]+ & ": " & ... ( crlf %leave ) & crlf.
|
||||||
|
|
||||||
%field header hyttp.headers.line "HTTP Header Line" FT_BOOLEAN .
|
%field header hyttp.headers.line "HTTP Header Line" FT_BOOLEAN .
|
||||||
%choice header =
|
%choice %tree header =
|
||||||
content_type_hdr
|
content_type_hdr
|
||||||
| transfer_encoding
|
| transfer_encoding
|
||||||
| content_length
|
| content_length
|
||||||
|
@ -183,9 +176,7 @@ typedef struct _http_info_value_t
|
||||||
| etag
|
| etag
|
||||||
| last_modified
|
| last_modified
|
||||||
| server
|
| server
|
||||||
| other_header . <header:%plain_text> {
|
| other_header . <header:%plain_text>
|
||||||
%root header
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
%tail %{
|
%tail %{
|
||||||
|
|
|
@ -21,6 +21,7 @@ static int hf_http_response_code = -1;
|
||||||
static int hf_http_transfer_encoding = -1;
|
static int hf_http_transfer_encoding = -1;
|
||||||
static int hf_http_content_length = -1;
|
static int hf_http_content_length = -1;
|
||||||
static int hf_http_media = -1;
|
static int hf_http_media = -1;
|
||||||
|
static int hf_http_host = -1;
|
||||||
static int hf_http_request_uri = -1;
|
static int hf_http_request_uri = -1;
|
||||||
|
|
||||||
static dissector_handle_t http_handle;
|
static dissector_handle_t http_handle;
|
||||||
|
@ -43,6 +44,7 @@ static void dissect_http(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree
|
||||||
pi = proto_tree_add_boolean(pt,hf_http_is_response,tvb,0,0,msgdata->is_response);
|
pi = proto_tree_add_boolean(pt,hf_http_is_response,tvb,0,0,msgdata->is_response);
|
||||||
pt = proto_item_add_subtree(pi,ett_http);
|
pt = proto_item_add_subtree(pi,ett_http);
|
||||||
|
|
||||||
|
|
||||||
if (msgdata->is_response) {
|
if (msgdata->is_response) {
|
||||||
proto_tree_add_uint(pt,hf_http_response_code,tvb,0,0,msgdata->response_code);
|
proto_tree_add_uint(pt,hf_http_response_code,tvb,0,0,msgdata->response_code);
|
||||||
proto_tree_add_uint(pt,hf_http_content_length,tvb,0,0,msgdata->content_length);
|
proto_tree_add_uint(pt,hf_http_content_length,tvb,0,0,msgdata->content_length);
|
||||||
|
@ -50,6 +52,7 @@ static void dissect_http(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree
|
||||||
if (msgdata->media) proto_tree_add_string(pt,hf_http_media,tvb,0,0,msgdata->media);
|
if (msgdata->media) proto_tree_add_string(pt,hf_http_media,tvb,0,0,msgdata->media);
|
||||||
} else {
|
} else {
|
||||||
if (msgdata->request_method) proto_tree_add_string(pt,hf_http_request_method,tvb,0,0,msgdata->request_method);
|
if (msgdata->request_method) proto_tree_add_string(pt,hf_http_request_method,tvb,0,0,msgdata->request_method);
|
||||||
|
if (msgdata->http_host) proto_tree_add_string(pt,hf_http_host,tvb,0,0,msgdata->http_host);
|
||||||
if (msgdata->request_uri) proto_tree_add_string(pt,hf_http_request_uri,tvb,0,0,msgdata->request_uri);
|
if (msgdata->request_uri) proto_tree_add_string(pt,hf_http_request_uri,tvb,0,0,msgdata->request_uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +74,8 @@ static void proto_register_http(void) {
|
||||||
{ &hf_http_transfer_encoding, { "=Transfer-Encoding", "hyttp.info.transfer_encoding", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }},
|
{ &hf_http_transfer_encoding, { "=Transfer-Encoding", "hyttp.info.transfer_encoding", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }},
|
||||||
{ &hf_http_content_length, { "=Content-Length", "hyttp.info.content_length", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},
|
{ &hf_http_content_length, { "=Content-Length", "hyttp.info.content_length", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},
|
||||||
{ &hf_http_request_uri, { "=Request URI", "hyttp.info.uri", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }},
|
{ &hf_http_request_uri, { "=Request URI", "hyttp.info.uri", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }},
|
||||||
{ &hf_http_media, { "=Media", "hyttp.info.media", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}
|
{ &hf_http_media, { "=Media", "hyttp.info.media", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }},
|
||||||
|
{ &hf_http_host, { "=Host", "hyttp.info.host", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}
|
||||||
};
|
};
|
||||||
|
|
||||||
gint *ett[] = {
|
gint *ett[] = {
|
||||||
|
|
Loading…
Reference in New Issue