HIP dissector: HIT_SUITE_LIST parameter from HIPv2

The HIT_SUITE_LIST Parameter from HIPv2 (
http://tools.ietf.org/html/draft-ietf-hip-rfc5201-bis-08 ) is unsupported.

svn path=/trunk/; revision=42132
This commit is contained in:
Alexis La Goutte 2012-04-18 13:42:41 +00:00
parent 68ec58d385
commit 5187255e38
1 changed files with 28 additions and 2 deletions

View File

@ -104,8 +104,9 @@ typedef enum {
#define PARAM_RELAY_FROM 63998
#define PARAM_RELAY_TO 64002
#define PARAM_RELAY_HMAC 65520
/* HIPv2 */
/* HIPv2 draft-ietf-hip-rfc5201-bis-08 see section 5.2 */
#define PARAM_HIP_CIPHER 579
#define PARAM_HIT_SUITE_LIST 715
/* Bit masks */
#define PARAM_CRITICAL_BIT 0x0001
/* See RFC 5201 section 5.1 */
@ -167,6 +168,7 @@ static const value_string hip_param_vals[] = {
{ PARAM_REG_RESPONSE, "REG_RESPONSE" },
{ PARAM_REG_FROM, "REG_FROM" },
{ PARAM_HIP_CIPHER, "HIP_CIPHER"},
{ PARAM_HIT_SUITE_LIST, "HIT_SUITE_LIST"},
{ 0, NULL }
};
@ -274,7 +276,7 @@ static const value_string nat_traversal_mode_vals[] = {
{ 0, NULL }
};
/* HIPv2 draft Section 5.2.8 */
/* HIPv2 draft-ietf-hip-rfc5201-bis-08 Section 5.2 */
static const value_string cipher_vals[] = {
{ 0x0, "Reserved" },
{ 0x01, "NULL-ENCRYPT" },
@ -284,6 +286,13 @@ static const value_string cipher_vals[] = {
{ 0, NULL }
};
static const value_string hit_suite_vals[] = {
{ 0x00, "Reserved" },
{ 0x01, "RSA,DSA/SHA-256" },
{ 0x02, "ECDSA/SHA384" },
{ 0x03, "ECDSA_LOW/SHA-1" },
{ 0, NULL }
};
/* functions */
static int dissect_hip_tlv(tvbuff_t *tvb, int offset, proto_item *ti, int type, int tlv_len);
@ -325,6 +334,7 @@ static int hf_hip_tlv_dh_pv_length = -1;
static int hf_hip_tlv_trans_id = -1;
static int hf_hip_tlv_esp_reserved = -1;
static int hf_hip_tlv_cipher_id = -1;
static int hf_hip_tlv_hit_suite_id = -1;
static int hf_hip_tlv_host_id_len = -1;
static int hf_hip_tlv_host_di_type = -1;
static int hf_hip_tlv_host_di_len = -1;
@ -882,6 +892,18 @@ dissect_hip_tlv(tvbuff_t *tvb, int offset, proto_item *ti, int type, int tlv_len
newoffset += 2;
}
break;
case PARAM_HIT_SUITE_LIST:
t = proto_item_add_subtree(ti, ett_hip_tlv_data);
while (tlv_len > 0) {
/* Suite # 1, 2, ..., n
one byte per HIT Suite id.
According to specification, HIT_SUITE_LIST is defined as eight-bit field,
current four-bit HIT Suite-IDs only use the four higher order bits in the ID Field.*/
proto_tree_add_item(t, hf_hip_tlv_hit_suite_id, tvb, newoffset, 1, ENC_BIG_ENDIAN);
tlv_len -= 1;
newoffset += 1;
}
break;
case PARAM_HOST_ID:
t = proto_item_add_subtree(ti, ett_hip_tlv_data);
hi_len = tvb_get_ntohs(tvb, newoffset);
@ -1312,6 +1334,10 @@ proto_register_hip(void)
{ "Cipher ID", "hip.tlv.cipher_id",
FT_UINT16, BASE_DEC, VALS(cipher_vals), 0x0, NULL, HFILL }},
{ &hf_hip_tlv_hit_suite_id,
{ "HIT Suite ID", "hip.tlv.hit_suite_id",
FT_UINT8, BASE_DEC, VALS(hit_suite_vals), 0xF0, NULL, HFILL }},
{ &hf_hip_tlv_host_id_len,
{ "Host Identity Length", "hip.tlv.host_id_length",
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},